Pages

Showing posts with label MOSS. Show all posts
Showing posts with label MOSS. Show all posts

Tuesday, December 15, 2009

Wednesday, June 10, 2009

.NET 3.5 framework with SharePoint

I thought to search on how best we can get from .NET 3.5 framework into SharePoint environment, so first I have searched what .NET 3.5 framework provides us for developer, actually .NET 3.5 frameworks provides some of the good development features like LINQ, AJAX, WF (workflow foundation), WCF (workflow communication foundation) and WPF (workflow presentation foundation)

Now if we use and integrate .NET 3.5 with SharePoint then we can use same features into our development environment, but for using .NET 3.5 framework into SharePoint, we needs to install .NET 3.5 framework into SharePoint servers and has to make configuration changes like changing our existing SharePoint web application, I have also found out that there were some problem into record center site after installing .NET 3.5 framework.

Reference Links:

1. How to setup and configure .NET 3.5 with SharePoint

http://www.zimmergren.net/archive/2008/09/22/how-to-get-up-and-running-with-net-3-5-in-your-sharepoint-environment.aspx   

2. How to use LINQ into SharePoint

http://www.zimmergren.net/archive/2008/09/24/how-to-use-linq-and-the-net-3-5-framework-with-sharepoint-to-retreive-sharepoint-list-items.aspx

3. Record center SharePoint site wasn’t working after installing .NET 3.5 frameworks

http://dotneteers.net/blogs/aghy/archive/2008/10/31/moss-2007-and-net-framework-3-5-sp1.aspx

Just try it out into development machine and see how it works :)

Good Luck!!

SharePoint web services – permission for GetWebCollection method

For one of my requirement I took the advantage of SharePoint web services, actually I needs to make a windows application which will get the information for all document libraries and list down all the documents inside each document library from SharePoint site.

 

So I have used WEBS and LISTS web service to get my required results, while working with WEBS web service, I used web method GetWebCollection() from WEBS web service to take all the web site name underneath one SharePoint web site, the windows application runs well for development sites but for production sites it’s giving me unauthorized access error while accessing GetWebCollection() method, because I don’t have sufficient rights into product site, I was thinking that for executing GetWebCollection() method, I need service account or extra full control rights, but after finding from the internet, I had conclude that I just need “contributor” rights into all sites and sub-sites while working with GetWebCollection() method.

 User needs “browse directories” permission.

 Reference Link:

 http://www.novolocus.com/2008/07/03/browse-directories-and-webs-getwebcollection-strangeness/

From my point of view, we can do all things with SharePoint web services which we can achieve from SharePoint object model, just we need to know which web services and web method to call.

Happy coding !!

Anonymous access into SharePoint web services

Till now I didn’t find how to anonymous access web services, we can impersonate our SharePoint object model code by writing block of code under SPSecurity.Runwithelevatedprivileges method, I am looking for something like this for my web services code, I tried to find solution from internet, but I didn’t get success.

 

I can run or authenticate my web service code by passing current user credentials or any custom credentials (user name, password, domain name), but I am looking something different in authentication mode, please reply to me if any of you find some solutions or any alternatives for my challenge problem and I’ll also do same thing.

 

Thank you very much!

Sizes and items limitation for SharePoint List objects

Below are recommended guidelines for creating total # of site collection, webs, document library and many more …

 1. Recommended limitation for SharePoint site objects  

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

 2. Limitation guidelines for SharePoint 2003 and SharePoint 2007

 http://www.sperto.com.ar/fs_files/user_img/articulos/SharePoint%20Limits.pdf

 Apart from this article discussion, here is very good link which will describes logical architecture of site collection

http://www.sharepointblogs.com/llowevad/archive/2007/06/25/site-collection-logical-architecture.aspx

Sunday, May 10, 2009

SharePoint Designer (SPD) Workflow deployment

One day I have very tough requirement, my requirement was to deploy my SharePoint designer workflow from development server to TEST server, I tried to find solutions from the internet but didn’t get any easy way for my requirements, at the last I have found one very good link which fulfill my requirements, though it requires some manual steps as describes in below link.

But now I can replicate same designer workflow to target server with some or more manual changes, I know that it’s very painful at some level to do manual steps, but we can say that it’s possible to deploy SPD workflow to other machine with manual effort ….

There is no direct way to copy designer workflow from one server to another server. Only thing which we can do is through “site template” also.

We need to save our SharePoint site as template in which we have created the workflow from SharePoint designer and using that template we can create a new site on another server which will have same workflow attached with it.

Here is link which describes manual steps to deploy designer workflow.

http://www.sharepointblogs.com/andynoon/archive/2007/09/18/reparenting-a-workflow-to-a-different-list.aspx

Enjoy working!!

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, November 4, 2008

Conflict into SharePoint version

One time, I had problem while installation of MOSS 2007, my installation was corrupted due to some problem, so I was not able to repaired, every time I was getting error when I run “SharePoint Products and Configuration Wizard” from the interface.

I find the below solution, If we run below psconfig command from command prompt then will able to install SharePoint successfully without any version confliction.

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\BIN>
psconfig -cmd upgrade -inplace b2b -wait -force

SharePoint Products and Technologies Configuration Wizard version 12.0.6217.1000
Copyright (C) Microsoft Corporation 2005. All rights reserved.

Performing configuration task 1 of 4
Initializing SharePoint Products and Technologies upgrade...

Successfully initialized SharePoint Products and Technologies upgrade.

Performing configuration task 2 of 4
Initiating the upgrade sequence...

Successfully initiated the upgrade sequence.

Performing configuration task 3 of 4
Upgrading SharePoint Products and Technologies...

Successfully upgraded SharePoint Products and Technologies.

Performing configuration task 4 of 4
Finalizing the SharePoint Products and Technologies configuration...

Successfully completed the SharePoint Products and Technologies configuration.

Total number of configuration settings run: 4
Total number of successful configuration settings: 4
Total number of unsuccessful configuration settings: 0
Successfully stopped the configuration of SharePoint Products and Technologies.
Configuration of the SharePoint Products and Technologies has succeeded.

Monday, October 20, 2008

SSRS 2005 deployment to FBA enabled MOSS site

I was having problem to deployed SSRS 2005 Report Model from visual studio to SharePoint Integrated mode with Forms Authentication enabled on MOSS site. It gives an error message "A connection could not be made to report server "http"//<sharepointservername>/"

Though, I was successfully able to deploy SSRS 2005 Report Model from visual studio to SharePoint Integrated mode with Windows Authentication enabled on MOSS site.

I installed SharePoint 2007 server, SQL server 2005 Developer Edition with sp2 and also applied hotfixes from Microsoft for reports to work with Forms Authentication.

I also worked with Microsoft Support team and I tried to find the resolution, at the last I came to one common point that its design limitation of SharePoint and sql server, so Microsoft support team told me that because of security reason, it has been designed that way only.

Few people already notice this bug and some of them get the temporary patch/fix from Microsoft but its not permanent solution, Microsoft is saying that this problem will resolved with SQL Server SP3.

Reference link :

http://www.sharepointblogs.com/nrdev/archive/2007/06/21/ssrs-in-sharepoint-2007-site-using-forms-based-authentication-sharepoint-integrated-mode.aspx

Saturday, October 18, 2008

Custom Themes in MOSS 2007

Steps to creating custom themes in MOSS 2007

1. Explore to the Themes folder e.g. LocalDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\Themes

2. Make a copy of one of the existing theme folders and rename it e.g. MyCustomTheme.

3. Rename the .INF file which is in the MyCustomTheme folder to MyCustomTheme.INF

4. Edit MyCustomTheme.INF.

1. At the info section, Change the title, to “Custom Site Theme”.
2. In the titles section, rename the names to your new name. This section is to present the name in the different language.

5. Provide an image to give a preview of your theme.
This image should be placed in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES. E.g. MyCustomThemelogo.gif

6. Modify the c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\Layouts\1033\SPTHEMES.xml to include a reference to the new MyCustomTheme theme

<Templates>
<TemplateID>MyCustomTheme</TemplateID>
<DisplayName> MyCustomTheme</DisplayName>

<Description> Apply this Theme for applying MyCustomThemelogo and unique colors and fonts styles.

</Description>
<Thumbnail>images/MyCustomTheme.gif</Thumbnail>
<Preview>images/ MyCustomTheme.gif</Preview>
</Templates>

7. Modify the CSS within MyCustomTheme folder to personalize your theme.

8. Run iisreset from the command prompt

Apply the new theme "MyCustomTheme" to a site by click on SiteActions -> SiteSettings -> sitetheme.

Now Select the newly created theme and click on apply and you can see new look of your site according to you theme.

SharePoint Custom Actions

I came across requirement of customizing out of box SharePoint pages (like create.aspx, spcf.aspx, qstnew.aspx) to fulfill client need to add functionality or custom code in those pages.

Generally we are making copy of those pages for making changes and add custom link on page from where it’s getting called.

Example:

If you are required to override the Web Part Page/Survey Creation Page (spcf.aspx/new.aspx) then you have to add link under particular Group in Create.aspx page. This you can achieve without writing any code in create.aspx by creating Feature using Custom Actions.

SharePoint provides so many defaults Custom Actions which we can use as per our creativity.

Code example: To add custom link in Site Actions Menu which takes user to custCreate.aspx page.

<CustomAction
Id = "RepLetterCustCreatePage"
Title = "Custom Create"
Sequence="2000"
Description = "Add a new library, list or web page to this website using custom Create Page."
GroupId = "SiteActions"
Location = "Microsoft.SharePoint.StandardMenu">

<UrlAction Url="~site/_layouts/custcreate.aspx"/>

</CustomAction>

Example :

I also added custom link into SharePoint Central Admin Site into Operation TAB, on clicking of new added link, I am opening my ASPX page from Central Admin site.

Element file look like:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

<CustomActionGroup
Id="CustomSecurity"
Location="Microsoft.SharePoint.Administration.Operations"
Title="Custom Security"
Sequence="1000"
/>

<CustomAction
Id="TerminationJob"
GroupId="CustomSecurity"
Location="Microsoft.SharePoint.Administration.Operations"
Sequence="10"
Title="Termination Job">

<UrlAction Url="/_admin/TerminationJob.aspx"/>

</CustomAction>

</Elements>

One more thing, I remember that after developing feature, I was not able to see custom link into Central Admin site, I came to know that in feature file, where we are defining element manifest file, I use wrong tag for giving XML file location, we have to use

<ElementManifests>

<ElementManifest Location="elementManifest.xml" />

</ElementManifests>

I was using

<ElementFile Location="elementManifest.xml" />

Useful reference link for Custom Actions:

http://msdn.microsoft.com/en-us/library/bb802730.aspx

http://msdn.microsoft.com/en-us/library/ms473643.aspx

Disabling some file export options in Reporting Service

There are some options available in Reporting services to export reports.

If you want to disable few options from that list into all application on your server then you can make it visible false by editing one central config file named "rsreportserver.config"

You need to make visible false which ever extension you don't want in the list of export report.

But if you want to make this for only one particular application then you can write down below code into your application:

private void DisableUnwantedExportFormats()
{
foreach (RenderingExtension extension in ReportViewer1.ServerReport.ListRenderingExtensions())
{
if (extension.Name == "XML" || extension.Name == "IMAGE" || extension.Name == "MHTML"
|| extension.Name == "PDF" || extension.Name =="RGDI" || extension.Name == "XLTemplate"
|| extension.Name == "WordTemplate" || extension.Name == "HTML4.0" || extension.Name == "HTML3.2")
{
FieldInfo info = extension.GetType().GetField("m_serverExtension", BindingFlags.NonPublic |     BindingFlags.Instance);
if (info != null)
{
Extension rsExtension = info.GetValue(extension) as Extension;
if (rsExtension != null)
{
rsExtension.Visible = false;
}
}
}
}
}

Tuesday, October 14, 2008

SPListItem Class

In SharePoint object model, for document library, each item consider as SPListItem in code, like If I have one word document file and one folder then both comes under SPListItem class, but for differentiate purpose we can check SPListItem.ContentType.Name and compare with "folder" type or anything.

Monday, September 22, 2008

Google Maps and MOSS

One of my friend has requirements to show Google maps into contact list for SharePoint site, so below are some of the links which will show how to integrate Google maps into SharePoint site.

Two things have to be considered.

1. We can use content editor web part and add JavaScript provided from Google

2. Has to generate or enter key from Google.

Reference links:

http://www.codeplex.com/SPGoogleMap

http://www.sharepointblogs.com/bobbyhabib/archive/2007/12/05/create-a-google-map-web-part-for-free.aspx

http://svengillis.blogspot.com/2007/12/google-maps-and-moss-integration.html