Posts Tagged MOSS

SharePoint 2007: Last Modified Date of Lists / Document Libraries

Scenario: We need to find the last access / modified date of all document libraries in a site collection.

Resolution:

Following code solved our issue

SPSite spSite = new
SPSite(“SiteCollectionURL”);

SPWeb spWeb = spSite.OpenWeb();

SPListCollection listColl = spWeb.Lists;

DateTime lastModifiedDate;

foreach (SPList list in listColl)

{     

if (list.BaseType == SPBaseType.DocumentLibrary)

{     

lastModifiedDate = list.LastItemModifiedDate;

Console.WriteLine(“Document Library Title:” + list.Title + “\nLast Modified Date:” + lastModifiedDate + “\n\n”);

}

}

P.S. Please change BaseType as per your requirement for Lists etc or remove this check all together.

Advertisements

Comments (1)

SharePoint 2007: Server Error in ‘/’ Application. (Yellow Screen of Death)

Scenario:

We canceled document uploading using ItemAdding event handler based on some condition. Instead of getting a simple SharePoint error page, we were getting “Server Error in ‘/’ Application. (a.k.a Yellow Screen of Death).

Server Error in ‘/’ Application.


We are afraid creating file(s)/folder(s) is not allowed. You can create file(s)/folder(s) inside folder EDW.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: We are afraid creating file(s)/folder(s) is not allowed. You can create file(s)/folder(s) inside folder EDW.Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

 

[COMException (0x81020089): We are afraid creating file(s)/folder(s) is not allowed. You can create file(s)/folder(s) inside folder EDW.

]

Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish) +0

Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish) +203

[SPException: We are afraid creating file(s)/folder(s) is not allowed. You can create file(s)/folder(s) inside folder EDW.

]

Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish) +251

Microsoft.SharePoint.SPListItem.AddOrUpdateItem(Boolean bAdd, Boolean bSystem, Boolean bPreserveItemVersion, Boolean bNoVersion, Boolean bMigration, Boolean bPublish, Boolean bCheckOut, Boolean bCheckin, Guid newGuidOnAdd, Int32& ulID, Object& objAttachmentNames, Object& objAttachmentContents, Boolean suppressAfterEvents) +1026

Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents) +182

Microsoft.SharePoint.SPListItem.Update() +94

Microsoft.SharePoint.WebControls.SaveButton.CreateFolder(SPFolder folder, SPContext itemContext) +1032

Microsoft.SharePoint.WebControls.SaveButton.SaveItem(SPContext itemContext, Boolean uploadMode, String checkInComment) +1236

Microsoft.SharePoint.WebControls.SaveButton.SaveItem() +71

Microsoft.SharePoint.WebControls.SaveButton.OnBubbleEvent(Object source, EventArgs e) +277

System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37

System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118

System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10

System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13

System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

 

Resolution:

Made following changes in the web.config of virtual directory (located at C:\Inetpub\wwwroot\wss\VirtualDirectories\80)

<SafeMode
MaxControls=200
CallStack=true
DirectFileDependencies=26
TotalFileDependencies=50
AllowPageLevelTrace=true>

To

<SafeMode
MaxControls=200
CallStack=false
DirectFileDependencies=26
TotalFileDependencies=50
AllowPageLevelTrace=false>

And

<customErrors
mode=Off />

To

<customErrors
mode=On />

Leave a Comment

SharePoint 2007: Remove / Disbale Anonymous Access From Browsing Application Pages / Document Library

Issue:

We enable anonymous access of one of our site collections. The concern was that anonymous users were able to access application pages of the site. Like anonymous users were able to browse “All Site Contents” by adding “_layouts/viewlsts.aspx” to the URL. This also give them ability to browse document libraries, lists etc.

Resolution:

First solution is in two steps:

  1. Enable LockDown Feature using command:

    stsadm –o activatefeature -filename ViewFormPagesLockdown\feature.xml –url <SiteCollectionURL>

  2. Disbale and enable anonymous access by setting it to “Nothing” and then again back to “Entire Web Site”.

Second solution is add following lines in web.config where <location=path…> exist:

<location path=”_layouts/viewlsts.aspx”>

<system.web>

<authorization>

              <deny users=”?” />

      </authorization>

      </system.web>

</location>  

This will block user to view “View All site Contents”.

One interesting point is that if you want to search how many SharePoint site are there with this issue, try google “This system library was created by the Publishing feature to store pages that are created in this site.”

Source:

http://blogs.msdn.com/ecm/archive/2007/05/12/anonymous-users-forms-pages-and-the-lockdown-feature.aspx

http://technet.microsoft.com/en-us/library/cc263468.aspx

http://www.agileconcepts.com/Blogs/AQ/Lists/Posts/Post.aspx?List=71ced1e4%2Dd1b5%2D4ce4%2D9cb7%2D209f38df315a&ID=10&RootFolder=%2A

http://blog.richfinn.net/blog/2008/07/22/PublicFacingSharePointHeresSomethingScaryPleaseActivateViewFormPagesLockDown.aspx

Comments (2)

SharePoint 2007: Site Usage Reports

Long long ago, I was requested for “Site Usage Report” explanation. I was able to interpret the information but not able to find any other resource to confirm. Looking for some other information, reached an excellent resource for explanation of SharePoint “Site usage Reports” by Mark Arned.

Leave a Comment

MOSS: SharePoint Designer Training Material

MS is offering free SharePoint designer training material in two different editions, namely, Desktop and Portal. Desktop edition is for single user. Portal edition is for all users and it requires installing on Office SharePoint Server. URL of training site is as under: 

http://office.microsoft.com/en-us/sharepointdesigner/HA102632321033.aspx?pid=CL100796271033

 Training topics include: 

Adding a page to a SharePoint site
Learn how to create a new page in a SharePoint site.

Contributor Settings
Learn how to manage Contributor Settings and see how they affect SharePoint Designer.

Creating a custom list data form
Learn how to create a custom list data submission form using SharePoint Designer.

Managing data sources
Learn how to add and remove data sources from the SharePoint Designer Data Source Library.

Enabling editing in Data Views
Learn how to utilize the built-in editing functions of the Data View Web part to allow users to edit data.

Data View properties
Learn how to create data view properties that can be read in from a query string.

Web part connections
Learn how to use SharePoint Designer to create Web part connections on a SharePoint page.

Creating a workflow
Learn how to use SharePoint Designer to create a SharePoint workflow.

Collecting data in a workflow
Learn how to use SharePoint Designer to ask for user feedback during a workflow.

Modify a master page
Learn how to use SharePoint Designer to modify and re-brand a SharePoint default master page.

Modify the default SharePoint content placeholders
Learn how to use SharePoint Designer to add custom content in to the default SharePoint content placeholders and apply it to the entire site.

Creating pages from a master page
Learn how to use SharePoint Designer to create a new SharePoint page based on a specific master page.

Changing content page layouts
Learn how to use SharePoint Designer to change the layout and behavior of Web part zones and other controls in a SharePoint content page.

Managing master pages
Learn how to use SharePoint Designer to set the master page for the site and how to revert a customized page to the site definition.

Create a cascading style sheet
Learn how to create a new cascading style sheet and how to reference it in SharePoint.

Modifying Style Sheets
Learn how to identify and modify specific styles inside a SharePoint site.

Using the CSS task panes
Learn how to use the CSS properties, Apply Styles and Manage Styles task panes.

Creating Publishing Page Layouts
Learn how to use SharePoint Designer to create a Publishing Page Layout based on a content type.

Customizing a Publishing Page Layout
Learn how to use SharePoint Designer to customize a pre-existing Publishing Page Layout.

Code snippets
Learn how to create code snippets and use some basic functions of the code view inside SharePoint Designer.

Leave a Comment

MOSS: Training material

 

MS is offering free SharePoint training material in two different editions, namely, Desktop and Portal. Desktop edition is for single user. Portal edition is for all users and it requires installing on Office SharePoint Server. URL of training site is as under:

 

http://office.microsoft.com/en-us/sharepointserver/HA102488011033.aspx

 

 

Training topics included

 

Collaboration

Finding your way around a team site

Understanding permissions

Customizing a team site

Linking calendars to Outlook

Adding Web Parts

Collaborating in libraries, lists, and workspaces

Using blogs and wikis to share information

Enterprise Content Management

Document management

Protecting files

Using workflows

Records management

Creating and publishing Web pages

Improving compliance and support litigation discovery

Search

Finding files, Web sites, information, and people

Portals and personalization

My Sites

Targeting content to specific audiences

Managing access to your My Site

Business processes and forms

Streamlining business processes with forms and workflow

Gathering information with browser-compatible forms

Designing custom workflows using SharePoint Designer

Business intelligence

Sharing Excel workbooks as interactive reports

Working with a Report Center site

Using dashboards to drive decisions

Understanding Filter Web Parts

Integrating external data

 

Leave a Comment

MOSS 2007: MS Office Word 2003 document error

Scenario:

 

When of our client tried to open document using MS Office 2003 from SharePoint 2007, following error displayed:

 

“File is locked. In order to save changes to the file, you can other close the file before making any changes and then re-open it, use Save As (File menu) to save the file using another file name, or turn off Shared Workbook and then save the fie.”

 

 

 

 

 

 

 

Resolution:

 

Rename the file and it will work fine. We tried some other options but things do not seems to be working.

 

Leave a Comment

Older Posts »