General Bloging

Development and Stuff

About the author

Author Name is someone.
E-mail me Send mail

Recent comments

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

Hiding fields in Sharepoint 2007

To hide fields in the edit and newform pages for a list add the following Javascript to the top on the

default list pages using SPD 

 <script language="javascript" type="text/javascript">

_spBodyOnLoadFunctionNames.push("hideFields");

function findacontrol(FieldName) {

   var arr = document.getElementsByTagName("!");
   // get all comments
   for (var i=0;i < arr.length; i++ )
   {
      // now match the field name
      if (arr[i].innerHTML.indexOf(FieldName) > 0)
      {         return arr[i];      }
   }
}

function hideFields() {

   var control = findacontrol("Influence");
   control.parentNode.parentNode.style.display="none";
   control = findacontrol("Experience");
   control.parentNode.parentNode.style.display="none";
 
}
</script>

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by gurney on Monday, February 23, 2009 9:40 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Import export backup restore site

So just a couple of basics before we start.

  • My portal is located at http://portal.abc.local
  • I have a team site (standalone site collection) located at http://portal.abc.local/sites/hr

If I wanted to see a list of all of the site collections below my portal I can do that. The easy, out of the box way is to use stsadm.exe –o enumsites –url http://portal.abc.local

You will also notice from the screen shot that stsadm gives us more details in this version. ContentDatabase, StorageUsedMB, StorageWarningMB, and StorageMaxMB are all new pieces of information that could be handy in a pinch.

Anyway, back to the task at hand. How are we going to move HR to be part of the portal site collection? How about using stsadm.exe –o export

From the screen shot we can see at a minimum we will need to use the –url and –fliename options. So we probably want to run stsadm –o export –url http://portal.abc.local/sites/hr -filename HRsite.bak

Depending on the size of your site collection this command may run for several minutes. Once it finishes you will get a message saying Operation Completed Successful. Now we need to figure out how to get the site collection back in. To do this let's look at the command stsadm –o import

From this screen shot we can now see that we just need to do is import our previous file to a url inside our portal site collection. Something like stsadm –o import –url http://portal.abc.local/HR -filename HRsite.bak

Once again you should get a Operation Completed Successfully message. If you did then you should now be able to browse to http://portal.abc.local/sites/hr. Now don't forget to also go back and manually deleted your old site collection http://portal.abc.local/sites/hr once you are sure you have successfully moved everything. I will leave how to delete to you. It always scares me to give out instructions on deleting things because you never know who might only half way read this article and mindlessly delete something on accident. It happens!

Once you finish all of this moving around you will need to do a little navigation cleanup but nothing we can't do through site settings these days.

Shane SharePoint Help

Notes

I would just suggest that people make note of the -includeusersecurity option for both the export and import. Definitely save some headaches.

To determine whether the Stsadm.exe command-line tool was run successfully, review the Unified Logging Service (ULS) files that are located in the following folder:

Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\LOGS

 

 

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by gurney on Tuesday, December 23, 2008 3:45 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Configuring Search

"1.  After you have installed SharePoint, go under Operations, and Services on the Server.

2.  Under there, start up Office SharePoint Server Search. If you get an Error when doing this the most likly cuase is that you have to prefix the Domain in front of all user names ie

ML234APPS\Admin etc

3.  Next, setup Shared Services for that farm.

4. Go to the Shared Services Administration website, and under there go to “Search Settings” under “Search”.

5. Under Search Settings -> Manage Content sources and Crawl Schedules. You should see a “Local Office SharePoint Server sites” setup for ya. You’d think this would do it – but no.

6. Click on that link and setup a schedule for “Full Crawl” and “Incremental Crawl”. If you want – start up a full crawl after you are done setting up this schedule.

7. You can specify other search engine criterion here – URLs to exclude in search results, various rules on following links/domains etc., the content access account (make sure this isn’t administrator – and you would have set this up anyway when you setup SharePoint server search in item #2), file types etc.

That’s it. Your search is ready to rock’n’roll. Go to your site – issue a search; should work now. " From a blog at http://blah.winsmarts.com/2006-11-Implementing_search_on_a_Sharepoint_2007_installation.aspx#feedback

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by gurney on Monday, December 22, 2008 5:26 PM
Permalink | Comments (0) | Post RSSRSS comment feed

What level SP Sharepoint

 

Using SharePoint Central Administration Web site SharePoint HTML Site Settings admin pages or IIS Manager, on the web sites properties HTTP Headers tab, virtual servers once extended will show the following version numbers: 
    MOSS 20071 or WSS 3.0 
Cumulative update (KB956056 & KB956057)  12.0.0.6327
    MOSS 20071 or WSS 3.0 
Infrastructure Update (KB951695 & KB951297)  12.0.0.6318
    MOSS 20071 or WSS 3.0 post-SP1 hotfix (
KB948945)      12.0.0.6303
    MOSS 20071 or WSS 3.0 post-SP1 hotfix (
KB941274)      12.0.0.6301
    MOSS 20071 or WSS 3.0 post-SP1 hotfix (KB941422)      12.0.0.6300
    MOSS 20071 or WSS 3.0 SP1                                        12.0.0.6219
    MOSS 20071 or WSS 3.0 
October public update               12.0.0.6039 
    MOSS 20071 or WSS 3.0 August 24, 2007 hotfix package 12.0.0.6036 
    MOSS 20071 or WSS 3.0 RTM                                        12.0.0.4518 
    MOSS 20071 or WSS 3.0 Beta 2 TR:                               12.0.0.4407 
    MOSS 20071 or WSS 3.0 Beta 2:                                    12.0.0.4017 
    Office 12 (PDC image - pre-beta):      12.0.0.3111 (This version of Office does not have a support link in the Add/Remove programs dialog box).

1To confirm that a particular service pack is install on SharePoint Server you must either check the version numbers of specific dlls as specified in the related Microsoft Knowledge Based article or select the Show Updates check box in Add and Remove Programs.

    WSS 2.0 SP3                                    6.0.2.8165 
    WSS 2.0 SP2 KB900929 + KB924881 6.0.2.8117 
    WSS 2.0 SP2 rollup KB900929           6.0.2.8000
    WSS 2.0 SP2                                    6.0.2.6568
    WSS 2.0 SP2 Beta = R2:                   6.0.2.6551 
    WSS 2.0 SP1 + KB887981                6.0.2.6411
    WSS 2.0 SP1:                                  6.0.2.6361 
    WSS 2.0 Unservice packed:               6.0.2.5530

To confirm that service packs are installed, especially with SharePoint Server 2007, goto Control Panel -> Add and Remove Programs
Select the product and then click: Click here for support. The versions will
be displayed as follows:

 

Windows SharePoint Services 3.0

Microsoft Office SharePoint Server 2007

post-SP1 hotfix (KB948945)

12.0.6303.5000

12.0.6303.5000
SP1

12.0.6219.1000

12.0.6219.1000
RTM

12.0.4518.1016

12.0.4518.1016
Beta 2 TR

12.0.4407.1005

12.0.4407.1005
Beta 2

12.0.4017.1006

12.0.4017.1006
 

Windows SharePoint Services 2

SharePoint Portal Server 2003

SP3

11.0.8173.0

11.0.8168.0

post SP2 rollup

11.0.8000.0

11.0.8126.2

SP2

11.0.7969.0

11.0.8126.0

R2 WSS SP2 beta

11.0.6551.0

 

SP1+KB887981

11.0.6411.0

With Service Pack 1

11.0.6361.0

11.0.6715.0

Unserviced pack

11.0.5608.0

11.0.5704.0

See David Hunter's blog post, "SharePoint 2007 Versions ", to find the version number directly from a SharePoint database.

Thanks to Matthew McDermott and Kenneth Searles for the update on the version related to the hotfix KB887981

Note: If you have a version number starting with 10, then it is either SharePoint Team Services (SPTS) or SharePoint Portal 2001 (SPS 2001).

  • SPTS, 10.0.2627.01 is the version with no service packs. In the Administrative Tools menu, you will see a link to Microsoft SharePoint Administrator. This will display a web page, where you can see the version number of the virtual server(s), e.g., 5.0.2.2623. The ISAPI filter is fpexedll.dll.
  • For SPS 2001, 10.145.4629 is the version number with no service packs. There will be no ISAPI filter, and from the Administrative Tools menu you will see a link to SharePoint Portal Server Administrator which launches a mmc snap-in.

Currently rated 2.5 by 2 people

  • Currently 2.5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by gurney on Thursday, September 18, 2008 12:08 PM
Permalink | Comments (2) | Post RSSRSS comment feed

Changing list ID for a customised page

Once you have customised a page in Sharepoint designer using data views the list id etc are embeded into the page.

If you the export and import the site, all id become invalid, the code below is how to restamp the customised page with the new Id. 

try

{

//using (SPSite site = new SPSite(SPContext.Current.Site.ID))

using (SPSite site = new SPSite(SiteURL))

{

using (SPWeb Web = site.OpenWeb(WebURL))

{

//This bit of code restamps all the list guid that SPD

//put into the page source for our customised project home page.

//When the site is exported and re-imported all lists get new ID hence the page is

//broken this fixes it for the new site.

byte [] bfile = Web.Files["default.aspx"].OpenBinary();

System.Text.Encoding enc = System.Text.Encoding.ASCII;

string myString = enc.GetString(bfile);

//re-stamp the guids from the default projector site with the new ones that

//have been created in this site.

SPList list = Web.Lists["List Name"];

myString = myString.Replace("69D01208-49F1-43BC-ABF9-550A75BD1A54", list.ID.ToString());

bfile = enc.GetBytes(myString.Replace("???",""));

Web.Files["default.aspx"].SaveBinary(bfile);Web.Files[

"default.aspx"].Update();

 

}

catch (Exception ex)

{

Console.WriteLine("Exception " + ex.ToString());

}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by gurney on Monday, March 10, 2008 8:10 PM
Permalink | Comments (1) | Post RSSRSS comment feed