|
|
Aparently there is a versioning limitation in SharePoint, where if you enable verisioning settings for any kind of a document library, sharepoint will limit the number of versions to exist with the number 255. Once the limit the reached SharePoint apparently display the following error screen.
To overcome this problem, the user is either required to turn off versioning, of keep a check on the number of versions of the current document exists and delete the older versions which are no more necessary to be in use.

Reasons and fix for the issue are listed below
- It was observed that the search crawler has logged the following warning message, “Some parts of this document cannot be accessed”
- It was found upon that this message is displayed for the types of content that were either password protected or were mht files that required an active x control to be installed to open the content.
- It was recommended that the content with password protection be replaced by SharePoint’s Item Level Permissions feature.
- It was also recommended to reduce the IE security setting to enable the installation of the active x control to enable the crawler to crawl the content.
I encountered this log when I was fixing the performance issues in a project. Upon further analysis, I came to know that the code was trying to access a list, but the thing is that the code was invoked from the Master Page. Ultimately when this piece of code that queries the list was being invoked whenever the Master page was loaded, which is not the desired behaviour.
Frequent querying for the list items are logged as this issue. Aparently we take a note of it only when performance becomes an issue or when we see a huge log file.
The wsp builder is a plug-in that adds a template in the visual studio. This tool can be download from the following link,
http://wspbuilder.codeplex.com/releases/view/16820
The following are the steps for creating a solution package for list instance of a custom list defintion in SharePoint 2007.
Open Visual Studio, File – New -Project ,
Select the WSPBuilder template, provide the path of the project and the project name and click ok,

The project folder is created along with a folder named 12. This folder will simulate the files to added in to the solution package.

You can copy the files generated by the Solution Generator to be reused here, by adding it as new blank feature,

An ideal feature struction for a custom list definition and the list instance would like below,

The list instance file would have the following elements,
<?xml version=”1.0″ encoding=”utf-8″?>
<Elements Id=”92885583-f403-4319-a1de-33cb4f916b6c” xmlns=”http://schemas.microsoft.com/sharepoint/“>
<ListInstance FeatureId=”844c1659-a002-4a34-8d57-3cc146a932ee”
Title=”Folders”
Description=”Stores a list of all comments used to store pages ”
TemplateType=”100″
Url=”Lists/Comments” OnQuickLaunch=”TRUE”>
</ListInstance>
</Elements>
The project can be deployed by right clicking on the Project and selecting the option WSPBuilder -> BuildWSP. The wsp solution package is created in the project folder and this can then be deployed using the stsadm command.
After you move a sharepoint database or relocate a sharepoint content database you may encounter the above mentioned error, where in it says that the access is denied for the current user.
The workaround that I did was to go the physical location of the SharePoint mdf and the ldf files and then check the security permissions.
- Open the SQL Server Configuration Manager from Start – Programs – Microsoft SQL Server 2005 – Configuration Tools

- Click on the SQL Server 2005 services and then right click and select Properties from the istance that is created for SharePoint ( in my case it is OFFICESERVERS).
- The user mentioned in the Built-in account will be account that will be used to access the database. Take a note of the account.

- Go to the Physical location where the mdf and the ldf files are located, Right click and open the properties of the files. Click ok
- Click on the Advanced button, uncheck the Compress contents to save disk space, if it is checked.

- Go to the Security tab in the properties pane, add the instance service built in account, that you took note of in step no.4, give full control.
- Add the SQLServer2005MSSQLUser$STANDALONE1$[YOURSHAREPOINTINSTANCENAME] group to the files.
- This will open the databases from the new location.
- If you see that the databases are in Read only mode, then Open the database in the SQL Server Management Studio Express and then go to the options from the propreties of the database
- Under State – Change the value of Database Readonly from true to false.

- Open the SQL Server Management Studio Express, if the database is not available, then i suggest that reattach the database, this will attach the database in the readonly mode, repeat from Step 6.
The solution generator can be used to create list definitions and deployment package for the same.
Steps to create a solution package for a list defintion,
Open the Solution Generator,
Select the list definition option and click next,
Select the “Specify a site url” option if the default site is not the desired site, and click Next,
Select the list names that you like to create the definitions for and click Next,
Choose a location and provide list definition name and click Next,
Click Finish in the next screen,
This will create a list defintion project in the path specifed by you.
To fix this issue, check on the following steps
- It was observed that search crawler had logged the following warning message, “The file reached the maximum download limit. Check that the full text of the document can be meaningfully crawled”
- This message is displayed because there is a default registry entry made by SharePoint that restricts the file size during search crawl.
- To overcome this limitation the following registry change was made to incorporate more memory availability during the search crawling process.
- Created a registry entry MaxDownloadSize and set the value of 512 in decimal, in the following path, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Global\Gathering Manager
The code for programmatically setting the moderation status to Approval for folders created in the publising pages library is as follows, it is assumed that the folder is being created already. Setting the folder approval status is vital as otherwise the approval status is pending, and this will prevent the pages inside the pages library from appearing in the Search results,
Dim spFolder As SPListItem = folder
Dim folderApprovalStatus As SPModerationInformation = spFolder.ModerationInformation
folderApprovalStatus.Status = SPModerationStatusType.Approved
spFolder.Update()
Sharepoint by default does not allow creating folders in the Pages library. Folders can be created using the explorer view in the Page Library and another is using custom development, by using a tool. The code for creating a folder in the Pages library in the Publishing template is as follows,
Dim ospfolder As SPFolder = oSpListItem.ParentList.ParentWeb.GetFolder(oSpListItem.ParentList.ParentWeb.Url + “/” + oSpListItem.ParentList.Title + “/” + strNewFolder)
oSpListItem.File.Url.ToString())
If ospfolder.Exists = False Then
Dim folder As SPListItem = Nothing
folder = oSpListItem.ParentList.Items.Add(“”, SPFileSystemObjectType.Folder, strNewFolder)
folder.Update()
End If
Item level permissions are implemented as per the business flow. It can be implemented in SharePoint 2007 either by implementing it as an event handler or a workflow.
Depending on whichever way of implementation the following code segment can be used to remove a particular user or group from the list item’s permissions.
Using oSite As SPSite = New SPSite(siteUrl)
Using oWeb As SPWeb = oSite.OpenWeb()
Dim osplist As SPList = oWeb.Lists(listName)
Dim osplistItem As SPListItem = osplist.GetItemById(itemID)
If Not osplistItem.HasUniqueRoleAssignments Then
osplistItem.BreakRoleInheritance(True)
End If
Dim userToRemove As SPPrincipal = Nothing
Try
userToRemove = oWeb.AllUsers(userName)
Catch ex As Exception
userToRemove = Nothing
End Try
If userToRemove Is Nothing Then
Try
userToRemove = oWeb.SiteGroups(userName)
Catch ex As Exception
userToRemove = Nothing
End Try
End If
If userToRemove IsNot Nothing Then
osplistItem.RoleAssignments.Remove(userToRemove)
End If
End Using
End Using
A screen shot of the above code, is as below,

|
|