Pages

Wednesday, May 6, 2009

Challenges while working with object model to access recurring meeting workspace site information

I was faced many challenges while getting all agenda list, document library from recurring meeting workspace site, because when we are accessing recurring meeting workspace into object model by SPList and other object, we are only getting data of first meeting instance ID, we are not able to loop through all instance at one place.

 

Many of the people were facing same problem like me, here is one of the link http://www.eggheadcafe.com/forumarchives/Sharepointwindowsservices/Aug2005/post23625925.asp

 

I did lots of search on internet and finally I found one line of code from which I got some direction to work on. I followed this link to find my solution, http://www.eggheadcafe.com/forumarchives/Sharepointwindowsservicesdevelopment/Sep2005/post23663884.asp

 

Points to be taken care:
1. There is one hidden list called “Meeting Series” into object model, which will store all the meeting Instance ID, so we need to take each meeting Instance ID from hidden list

 

2. We need to pass meeting Instance ID to SPQuery object, SPQuery contains property to hold Meeting Instance ID.

 

Sample Code to find out all data from recurring meeting workspace site:

 

        //Check if current Web is Meeting Workspace then execute below code

        if (SPMeeting.IsMeetingWorkspaceWeb(oWeb))

        {

            //Get Meeting Series list for taking Instance ID of each workspace site

            SPList meetingSeriesList = oWeb.Lists["Meeting Series"];

 

            for (int Cnt = 0; Cnt < meetingSeriesList.Items.Count; Cnt++)

            {

                int InstanceId = Convert.ToInt32(meetingSeriesList.Items[Cnt]["InstanceID"]);

 

                if (InstanceId != 0)

                {

                    // Use SPQuery to set Meeting Instance ID

                    SPQuery MeetingQry = new SPQuery();

                    MeetingQry.IncludeMandatoryColumns = true;

                    MeetingQry.MeetingInstanceId = InstanceId;

 

                    //Do Processing of SPQuery Object and get all Agenda List, Document Library data                  

                }

            }

         }

How to get Roles and permission for SharePoint site/web

There are two powerful classes into SharePoint Object model, one is SPRoleAssignmentCollection and second one is SPRoleAssignment, we can use this classes and find permission of any SharePoint objects, starting from Site, Web, Document Libraraies, etc..

Here I am writing sample code to find all the users permission into current web.

Sample Code:

  using (SPSite site = new SPSite("http://sitename/"))

            {

                using (SPWeb objMainWeb = site.OpenWeb())

                {

 

                       SPRoleAssignmentCollection oRoleAssignments = objMainWeb.RoleAssignments;

             foreach (SPRoleAssignment oRoleAssignment in oRoleAssignments)

            {

                             // SPRoleType provide enumaration for finding all user roles like  Administrators, Designer, Contributors, Visitors

                        //check oRoleAssignment.RoleDefinitionBindings.Contains(objMainWeb.RoleDefinitions.GetByType(SPRoleType.Administrator)) value
                   //  if current role is FULL CONTROL/Administrators then it will return TRUE

                SPPrincipal oPrincipal = oRoleAssignment.Member;

                  // oPrincipal object which will return SPuser or SPGroup, depending on current object

                             }

                     }

           }

        

Reference Link:

Finding roles and permission for list
http://dotnet.org.za/zlatan/archive/2007/12/23/getting-roles-and-permissions-on-a-list-document-library-level-in-sharepoint-2007-or-wss-3-0.aspx

 

Get RoleCollection for Web Site
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.roleassignments.aspx

 

What are the changes in authorization model into WSS 3.0(introduction of new class hierarchy)
http://msdn.microsoft.com/en-us/library/ms469194.aspx

 

How to get SPUser, SPGroup, SPRole objects
http://forums.asp.net/p/1012092/3068708.aspx

Tuesday, May 5, 2009

Limitation of SharePoint Designer(SPD) Workflow

SharePoint Designer is good tool to start initial or basic level workflow, I am not expert and good person to point out any limitation into any software, but as per me below are some of the limitation which I felt for SharePoint Designer Workflow, I’ll also write you more description about some of the limitation in coming posts …

  1. We don’t have facility to send BCC email to any person from “Send an Email” actions.

  2. We can’t bind and attach more then one list into designer workflow, though there are some manual steps from where we can fulfill our requirements, but there won’t be any easy steps from interface or GUI

  3. We can’t deploy/copy our designer workflow from one server to another server like there won’t be any easy way to deploy SPD workflow from development machine to TEST and Production Server; I’ll write how to do manual steps to achieve this functionality. here is my post regarding how to deploy designer workflow ...

  4. Designer Workflow don’t give us full customized editor from where we can customized our email body text, to do this, we need to write static HTML tags into email body part.

  5. We don’t write any calculation fields or formulas into Designer Workflow actions items, like I can’t extract only date from date-time column into designer workflow interface, for this I need to take one extra column into my SharePoint list and need to manipulate into designer workflow.

  6. While working in “Send an Email” action, if we add any list column from adding “Add Lookup to Body” button and if that column don’t have any values into SharePoint list, then it’s shows as ?????? instead of blank values into email body while sending emails …


I’ll update above lists as per my experience with designer workflow.

SharePoint Designer (SPD) Workflow

I am sharing some of my good repository links regarding working with SharePoint Designer Workflow.

 Good link to start with SPD Workflow – how to send email with list columns

http://rshelton.com/archive/2007/10/05/sharepoint-document-workflow-quothow-toquot---sending-an-email-with.aspx

 How to change task list for auto generated tasks for SPD Workflow

http://www.sharepointblogs.com/tbone/archive/2008/01/10/ode-to-joy-changing-the-task-list-for-auto-generated-tasks-within-sharepoint-designer.aspx

http://nickgrattan.wordpress.com/2008/04/29/changing-the-task-list-for-sharepoint-designer-workflows/

 Applying SPD Workflow to multiple lists

http://nickgrattan.wordpress.com/2007/10/17/applying-a-sharepoint-designer-workflow-to-multiple-lists/

 Best link which will describe how to “collect data from user” action activity

http://office.microsoft.com/en-us/sharepointdesigner/HA102098081033.aspx

 Good information for how to send email with customize email message, hyperlink into with SPD Workflow

http://office.microsoft.com/en-us/sharepointdesigner/HA102390421033.aspx

How to find GUID of SharePoint list

Till now I came across many articles related to finding GUID of SharePoint list from SharePoint interface/GUI, but I think, below is easiest way to find GUID of list.

Go to respective List – >Click on Settings Menu – > Click on List Settings Link- > here in this list settings page, we can find many links, we need to click on “Audience targeting settings” link.

Now, currently we are in Audience targeting page, look up at the URL of current audience target page, that the current address have GUID of list, at the end of URL we can find GUID, like ?List={552bef05-b62c-4c76-a217-35e85a1507f1}