Tuesday, November 3, 2009

How to Display SAP Preferred Welcome Name?

I got the requirement that based on preferred name the welcome name should come.
Go to Shared Services Administration: SSP1 > User Profile and Properties > View User Profiles
Modify ur preferred name as per screenshot

Refer How to modify profile properites
Go to My site click on details link and modify ur name filed with ur prefer name.

Run the below cmd

After the sync has been performed the User Info table will be updated with the values from the My Profile details.

Friday, October 30, 2009

The site collection could not be restored!!!

I have been doing base line of my application in my VM.I have two site collection in my web application. Each has its own database…
I got the following error while doing restore site collection.

Resolution:
Delete the corresponding DB ,next recreate new DB for your site collection and try to restore again.
It should work

Thursday, October 22, 2009

Creating Custom Page Layouts notes?

Overview of Page Layouts?
Combined with master page to define the rendering of a content page
􀂃 Obtains master page from SPWeb.CustomMasterUrl
• Hosts field controls and Web Part zones
• Complies to the Page Layout content type
• Has an associated content type
􀂃 Dictates which content type the page layout is used for rendering
• Can bind multiple page layouts to content type
• Associated with exactly one content type
Page layouts live within the Master Page Gallery
􀂃 http://servername/_catalogs/masterpage
􀂃 Exists only in the top-level site within a site collection
• Upon site provisioning, page layout added to Master Page Gallery as GhostableInLibrary
􀂃 While living in the Master Page Gallery as uncustomized the page layout on the file system is used
Site Columns & Content Types In Publishing Sites
Site columns & content types play a key role in Publishing sites
• Both are used to define schema for content pages
• Content types must inherit from the Page content type (which inherits from System Page)
􀂃 Go to the following location for basic information
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\PublishingResources\PublishingContentTypes.xml
􀂃 The article page layout with the following content type

• Page layouts must be associated with content types
Why site Column?
Reusable column template for use within lists and content types
• Specify:
􀂃 Name & description
􀂃 Data type
􀂃 Site column group
• Scoped at the site level
􀂃 Available to child sites
• Adding to a list / content type creates a copy.
Create / manage many ways:
􀂃 Browser-based user interface
􀂃 SharePoint object model
􀂃 Feature XML
• Features & object model provide most control
􀂃 Easy to version in virtually all source control systems
􀂃 Highest level of reuse
Creating Site Columns with Features

Wt is the Content Types?
Enable storage of different types of content in
same list or library
• Specify:
􀂃 Name & description
􀂃 Site columns, workflows, event receivers, policies, etc.
􀂃 Content type group
• Scoped at the site level
􀂃 Available to child sites
• Adding to a list creates a copy
Create / manage many ways:
􀂃 Browser-based user interface
􀂃 SharePoint object model
􀂃 Feature XML
Creating Content Types with Features

Activate our feature..

After activation site columns and content types would appear like the below.

How to create a page layout using SPD2007?

Now you need to add some structure to this page. Cheat a bit by copying the contents of the ArticleLeft.aspx page layout and paste them into CusomPageLayout.aspx.
Drag and drop our site columns in a structured maner.Here I just drag n droping….


Wt are the difference b/w Field controls and WebParts?

I will try to explain how to deploy page layout through studio in future posts.
Thanks my WCM guru and Ian for giving support.

Wednesday, October 21, 2009

Error: The path specified cannot be used at this time. (Exception from HRESULT: 0x80070094)

While creating a web application on MOSS2007 environment i have been getting this error.
I didn't find out any errors related to this in Logs file.
Finally i did two steps
1)Restart the SharePoint Timer Services
2)IIS RESET.
Still i am getting this error...
Finally restart the server...
I know the last one is actually ridiculous but it helped.(My box RAM is 1GB,2 users are using this through remotely and N/W IP is slow and etc)
Trust me it should work!!

Wednesday, October 7, 2009

How to get value from resource file and set into a control in a ASPX page?

I have been struggling from past 2 days to fix this issue.
Luckly I got information from
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\ADMIN\CMSIncrementalMigration.aspx at 64 line.

<
It should work.Tx WSS Team...

Sunday, September 13, 2009

Building Multilingual Solutions by Using SharePoint Products and Technologies

Hot to use Microsoft® Office SharePoint® Server 2007 in scenarios where content is managed across different languages. It details most of the functionality provided by Office SharePoint Server 2007 and suggests how to use it to manage multilingual scenarios. It also provides examples for creating custom Web Parts by using Microsoft Visual Studio® 2005 and how to configure and manage them by using Microsoft Office SharePoint Designer 2007, the next generation of Web designer tools specifically designed for SharePoint sites. Microsoft Windows® SharePoint Services 3.0 features and functionality, and how they add value to the end-user experience, are also described.
http://technet.microsoft.com/en-us/library/cc262942.aspx

Tuesday, September 1, 2009

Some of the key areas should know as a MOSS admin

I am giving some of the key points about the daily activities of a MOSS dev.
Reusing Sites
•Save site as template
•Works for all sites except publishing sites
•Default template limit 10 MB
▫Change via command line
▫Change to max of 500 MB
Stsadm.exe –o setproperty–pnmax-template-document-size –pv524288000
•Does not save security

Site Templates Usage
•Save Site as template
•Saved to Site Template Gallery
▫1 per Site Collection
Use Template Globally
•Deploy via command line
•Add Template
Stsadm–o addttemplate–filename YourFile.stp –title YourTitle–description YourDesc
•Delete Template
Stsadm–o deletetemplate–title YourTitle
•List Templates
Stsadm–o enumtemplates
•After running Add/Delete IISResetrequired
List Templates
•No option for deploying globally
Feature deactivation
▫Removes functionality
▫Does not remove data created by feature
Setting trust level
•Options
▫WSS_Minimal(default)
▫WSS_Medium
▫Full (built in .NET Policy)
Code Access Security in SharePoint 2007 for Administrators
SharePoint Web Parts run with a Trust Level which is set in the Web.Config file for the entire Web Application allowing not just one Web Part, but all Web Parts to run with that trust.
The default trust level that the Web Application runs with is WSS_Minimal. Developers will normally request that this is set to WSS_Medium or Full which are the only other configurations possible unless the developer creates a custom configuration file.
Code Access Security – The Architecture
In the Web.Config file for the web application you will see two Trust Level Elements in the Security Policy Element pointing to the two configuration files stored in 12\CONFIG (localdrive:\program files\common files\microsoft shared\web server extensions\12).
Each configuration file configures a number of classes by setting its properties. The classes are illustrated below.

The default Trust is WSS_Minimal which allows most code to run but would block your code from accessing SQL, The SharePoint Object Model, Environment Variables such as Machine Name and DNS etc. To allow these permission you would need to up the trust level to WSS_Medium, Full or to a Custom Policy. However, increasing the Trust Level for the Web Application would allow all Web Parts within that Web Application to run with more permissions. Best practice would be to create a custom policy and listing your web part in the file to run with the permissions it needs.
To create a new set of permissions you need to create a new file such as Custom_WSS_Medium.config and then make SharePoint aware of the file by pointing to it in the Web.Config for the Web Application. You can merge the settings in WSS_Minimal and WSS_Medium in your new Custom File to create your own permission set. It is advised not to change the original files as Microsoft may alter these files during the application of a Service Pack.

Each custom Web Part should be Strongly Named by the Developer which provides the DLL file for the Web Part with a Public Key. You can extract the Public Key using the SN tool provided by Visual Studio.NET: sn –Tp filename.dll
This will return the Public Key BLOB and the Public Key Token for the dll. Normally this would be a developer role as it requires Visual Studio.NET.

The Public Key Token is used in the Safe Controls entry in the Web.Config for the Web Part (Assembly) to register it as a Safe Control within the Web Application. The Public Key can also be used in the custom Trust Level Configuration File to give one particular Web Part or a group of Web Parts Full Trust whilst still leaving the Trust Level set to a minimal set of permissions.
To list a Web Part with Full Permissions within your Web Application whilst still retaining a WSS_Minimal permission set for all other Web Parts follow these steps:
1. Make a copy of the WSS_Minimal.Config file from the 12\Config folder and paste it into the same folder renaming it to Custom_WSS_Minimal.Config.
2. Edit the Custom_WSS_Minimal.Config file with an XML editor such as Visual Studio.NET or NotePad.
3. Obtain the Public Key Token and Public Key Blob for the Web Part assembly that you want to deploy using the following command: sn –Tp filename.dll.
4. Create a new entry in your Custom_WSS_Minimal.Config file for your Web Part:
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="My custom Strong name"
Description="This code group grants code signed with the “My Custom
Strong Name” strong name full trust.">
PublicKeyBlob="00240000048000009400000006020000002400005253413100040000010001009BC5B83BBD16C6ABB44BAB156CF9C55D1D67078CE98CE7B423C72EE91647BD73241BFC700192ED32481CA7CF06C205BD4C7BEDA3D4FA5ED5689AA23BC1C2118EBFA6018238AD5B4DA420FB335E6BECA9EDE5E3F53C4BFFF266411445AE7B1DDD14FB0F01C075589770EABD4B1D1A70F731C098F22EDE9838CC9783C73451B5"/>

5. Create a new TrustLevel element for your config file in the Web.Config called Custom_WSS_Minimal that points to your custom file in the 12\config folder.
6. Set the Trust Level of the Web.Config to Custom_WSS_Minimal
7. Recycle the Application Pool or run IISReset
8. Deploy & Test your Web Part.