May 9, 2012

Enable the Content Approval in Publishing sites in Moss 2007

To Enable the Content Approval for the new pages in Pages Document library in Sharepoint publishing sites.
 

a. Click on View All Site Content , then click on Pages Document Library
b. Select Settings on Pages document Library then Document Library Settings
c. Under General Setting click Versioning Settings and do the following changes.





Creating Sharepoint Groups in Moss 2007

Group can be created at the site collection level. The following example will create group with Read only permission.

1)  On the Site Actions menu, point to Site Settings.
2)  On the Site Settings page, under Users and Permissions, click People and groups.
3)  On the People and Groups page, Click New > New Group.
4)  On Next page, Enter Group Name, Group Owner Name and select Read from the Permission Level.














Creating Custom Permission Level in Moss 2007

Custom permission Level can be created at the site collection level with default rights/options or by creating own rules. The following example shows creating custom permission level using default Contributor permission level.

•    Go to Site Actions > Site Settings > Modify All site Settings > Advanced Permission under User and Permission heading.
•    On the next page , click settings > Permission Levels.
•    On permission Levels page, click Contribute.
•    On bottom of page, click copy permission level. On the copy permission level “Contribute”, enter name of custom permission level and description.
•    Clicks create.







Publishing Feature

To enable the SharePoint Server Publishing Infrastructure feature for a site collection
a. On the Site Actions menu, point to Site Settings, and then click Modify All Site Settings.
b. If you are not at the root of your site, under Site Collection Administration, click Go to top level site settings.
c. On the Site Settings page, under Site Collection Administration, click Site collection features.
d. On the Site Collection Features page, next to Office SharePoint Server Publishing Infrastructure, click Activate.







To enable the SharePoint Server Publishing feature for a site
a)    On the Site Actions menu, point to Site Settings, and then click Modify All Site Settings.
b)    On the Site Settings page, in the Site Administration section, click Site features.
c)    Next to Office SharePoint Server Publishing, click Activate.







Cannot connect to the configuration database Error in MOSS 2007

Sometimes in sharepoint, while opening the sites we got the "Cannot connect to configuration database" error. The below screen appears,



The problem occurs because the Sharepoint_config database is put to the SUSPECT mode in Sql Server. The following can be checked by logging to the SQL Server 2005 Management Studio. Expand Server > Databases > SharePoint_Config. A red mark next to the SharePoint_Config database appears with "Suspect" word.

To solve this problem, we have to follow this approach.

"Suspected" status > "Emergency" status> Multi User Mode > Enable database
(Convert the database to single user mode by going to properties of database >> options >> Restrict Access >> Single Use)


1) The solution to the above problem is to first convert the "SharePoint_Config" database to the "Emergency" mode by using the Following command/query.

alter database "Database_Name" set emergency

2) Convert database to Multi User Mode by using query


ALTER DATABASE Database_Name SET MULTI_USER


(Below command will convert database to Single User Mode)
ALTER DATABASE Database_Name SET single_USER


3) Finally Run below query

EXEC sp_resetstatus '
Database_Name'
GO
ALTER DATABASE
Database_Name SET EMERGENCY
DBCC checkdb('
Database_Name')
ALTER DATABASE
Database_Name SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB ('
Database_Name', REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE
Database_Name SET MULTI_USER


For some seetings to take place (or if you face some errors) try restarting the highlighted sql services.


April 25, 2012

Change Text or Image of the MySite Link in Moss 2007

Sometimes the user wants to change the MySite Link text to something else like "My World". In that case, you can do that by making changes to the MySiteLink.ascx file. This MySiteLink.ascx file is located at
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES
Now, open that MySiteLink.ascx file in sharepoint designer and change the following line
Add visible="false"
The above line will become .

Now, finally to change the Mysite text add the following line with the text that you want to display. Here, i want to display "Hello".

To display image in place of MySite Text you can use the following line

Retriving URL Value of SharePoint Hyperlink Field


To get the value of a SharePoint hyperlink field in a custom list using the object model, we generally use.

SPList mylist = myweb.Lists[Your_ListName];
SPQuery rootQuery = new SPQuery();
rootQuery.Query = "";

SPListItemCollection lstitemcol = mylist.GetItems(rootQuery);

foreach (SPListItem lstitem in lstitemcol)
{
   string URL=lstitem[url_Column_Name].ToString();   
}

The above URL string will contains the value but the only problem with this URl string is that  it will contains two URL’s separated by a comma. This is because one is the actual display text for the field and the other is the value (the actual URL itself).

In order to get just the URL value, you need to use the following object model code:

SPFieldUrlValue rootUrl = new SPFieldUrlValue(lstitem[Column_Name].ToString());
string URL = rootUrl.Url;

You can also use value.Description to get the actual display text for the field.

Error installing .Net Framework 3.5 in Sql Server 2012

During installation of Sql Server 2012 on Windows server 2012 or addition of roles and features for SharePoint 2013, the setup wizard will...