Tuesday, June 30, 2009

Configure Usage Reporting in Sharepoint 2007

Share/Save/Bookmark

Follow the below steps to activate sharepoint usage logging and see the analysed reports(statistics) based on the logs..


Enable Usage Logging

The first and foremost thing for using usage logs is to enable them at farm level that is hosting
the webapplication
  • On the Central Administration home page, click Operations.
  • On the Operations page, in the Logging and Reporting section, click Usage analysis processing.
  • On the Usage Analysis Processing page, in the Logging Settings section, select Enable logging.
  • Type a log file location and number of log files to create.(usually sharepoint logs location)
  • In the Processing Settings section, select Enable usage analysis processing, and then select a time to run usage processing.
  • Click OK.

Now reporting should be enabled so that sharepoint can use these logs and generate more advanced stats.

Enable Usage Reporting
Now advanced usage analysis has to enabled by SSP admin under the SSP site thats mapped to the web application where usage reports are needed.
  • On the SSP home page, in the Office SharePoint Usage Reporting section, click Usage reporting.
  • On the Configure Advanced Usage Analysis Processing page, in the Processing Settings section, click Enable advanced usage analysis processing.
  • In the Search Query Logging section, select Enable search query logging.
  • Click OK.
Search Query Logging should be enabled when reports are needed on search like best bets,top queries, etc.


To see the graphic stats for a site based on the usage logs then feature "Office Sharepoint Standard Sites" has to be activated.


Click on SiteUsageReports under SiteSettings for a site to see the graphic reports for the specific site.

Note:The analysis processing is run through a timer job which runs once for a day.So if all the activations done then for the reports to get generated one day has to awaited.

Subscribe

Wednesday, June 24, 2009

Promotion & Demotion of properties in Sharepoint Document library

Share/Save/Bookmark
This is the first time i ever heard of this sharepoint feature which manages the properties of a document in any document library, in simple it synchs the properties between the document and custom columns of the document library.

What is promotion?
Every document has its own set of office properties so whenever a document is uploaded to a document library then these properties are updated to the sharepoint columns which is called as promotion of office properties

What is Demotion?
After upload of the document if properties values are changed by updating the sharepoint columns in document library then the values are copied back to document level to make everything in sync.

Practically, when we upload a file to a document library or create a new document using "new" the propeties are promoted. but i still doubt if promotion happens when single upload

This promotion and demotion of the document properties is done by sharepoint with the help of document parser.So if a synchronization of a document has to maintained which has a custom file extension then a custom parser has to be written to do this.

Subscribe

Monday, June 22, 2009

Enable Audit settings for a Sharepoint List Programmatically

Share/Save/Bookmark

Sharepoint provides audit property for the objects that can be audited. Its pretty easy to turn on audit feature programmatically on any list/document library or a sitecolleciton by setting the values for the property. In the object model, for a SPList, SPListItem the audit property can be set on specific events so that it doesn’t generate huge data. Code as follows :

SPSite siteCollection = SPContext.Current.Site;
SPWeb site = siteCollection.RootWeb;
SPList docLib = site.Lists("DocLibName");
// Turn on auditing flags.
docLib.Audit.AuditFlags = SPAuditMaskType.View |
                          SPAuditMaskType.ChildDelete;
docLib.Audit.Update();

In the above example only view and delete events get audited, any more events to be audited can be added to audit flag separating Bitwise OR.

Auditing options:

SPAuditMaskType.CheckIn
SPAuditMaskType.CheckOut
SPAuditMaskType.ChildDelete
SPAuditMaskType.Copy
SPAuditMaskType.Delete
SPAuditMaskType.Move
SPAuditMaskType.ProfileChange
SPAuditMaskType.SchemaChange
SPAuditMaskType.Search
SPAuditMaskType.SecurityChange
SPAuditMaskType.Undelete
SPAuditMaskType.Update
SPAuditMaskType.View
SPAuditMaskType.Workflow

Subscribe

Read Sharepoint Audit log reports

Share/Save/Bookmark

The audit log data enabled for a site collection can be read programmatically as follows:

SPSite siteCollection = SPContext.Current.Site;
SPAuditQuery wssQuery = new SPAuditQuery(siteCollection);
SPAuditEntryCollection auditCol;
auditCol = siteCollection.Audit.GetEntries(wssQuery);
// enumerate through audit log and read entries
foreach (SPAuditEntry entry in auditCol) {
    // inspect entry
}

Reading the log data can be a performance issue if all the entries are looped, so restrict the entries to either a list,listitem or a user using methods RestrictToList or ResstrictToListItem, RestrictToUser. SetRangeStart and SetRangeEnd methods on SPAuditQuery class can be used to get the logs for a limited period.


Subscribe

Monday, June 8, 2009

Permission Levels and Permissions

Share/Save/Bookmark

By default sharepoint creates 5 permission levels, each has its own permissions associated.In case, to customize the permissions associated with a specifc level all 3 levels(except limited access and Full Control) can be modified.

Default permission levels in Windows SharePoint Services 3.0
Permission Level
Description
Full Control
This permission level contains all permissions. Assigned to the Site name Owners SharePoint group, by default. This permission level cannot be customized or deleted.
Design
Can create lists and document libraries, edit pages and apply themes, borders, and style sheets in the Web site. Not assigned to any SharePoint group, by default.
Contribute
Can add, edit, and delete items in existing lists and document libraries. Assigned to the Site name Members SharePoint group, by default.
Read
Read-only access to the Web site. Users and SharePoint groups with this permission level can view items and pages, open items, and documents. Assigned to the Site name Visitors SharePoint group, by default.
Limited Access
The Limited Access permission level is designed to be combined with fine-grained permissions to give users access to a specific list, document library, item, or document, without giving them access to the entire site. However, to access a list or library, for example, a user must have permission to open the parent Web site and read shared data such as the theme and navigation bars of the Web site. The Limited Access permission level cannot be customized or deleted.




Subscribe