How to read the correct web.config setting

01 April 2010 8:20 AM Posted by Mano Mangaldas

0

Suppose you have created a job and scoped to multiple web application.. the job should be smart enough to pick up the correct setting you may have added in the config file.. below is the code to get it..
// get the settings 
System.Configuration.Configuration myConfig;

//myConfig = WebConfigurationManager.OpenWebConfiguration("/", "SharePoint_500");
myConfig = WebConfigurationManager.OpenWebConfiguration("/", this.WebApplication.Name);

if (!myConfig.Equals(null))
{
       this.connStrFromAppSettings = myConfig.AppSettings.Settings["ConnectionString"].Value;
       this.CUSTOM_SITE_TEMPLATE_NAME = myConfig.AppSettings.Settings["CustomSiteTemplateName"].Value;
       this.SITECOLLECTION_URL = myConfig.AppSettings.Settings["SiteCollectionURL"].Value;
       this.BUFFER_SIZE = Convert.ToInt32(myConfig.AppSettings.Settings["BufferSize"].Value);
}

MCTS 70-542 SharePoint Study ( Learning ) Guide [ Developer ] - Part 1

31 December 2009 6:11 AM Posted by Mano Mangaldas

0




MCTS 70-542 SharePoint Server Developer Study ( Learning ) Guide


You are creating a SharePoint solution. You need to add a button to the Quick Access toolbar that will allow users to approve a document. You create an assembly named approvebtn.dll that implements the necessary functionality, and install it on the SharePoint server.

What additional steps must you take? (Each correct answer presents part of the solution. Choose two.)

  • In the CustomQuickAccess.xml file, add a <consolenode> element to the <references> element to identify the assembly and the class.
  • In the QuickAccess.xml file, add an element to the <references> element to identify the assembly.
  • In the CustomQuickAccess.xml file, add an element to the <references> element to identify the assembly.
  • In the QuickAccess.xml file, add an element to the <references> element to identify the assembly.
  • In the QuickAccess.xml file, add a <consolenode> element to the <structure> element to identify the assembly and the class.
  • In the CustomQuickAccess.xml file, add a <consolenode> element to the <structure> element to identify the class.

Explanation:
You should modify the CustomQuickAccess.xml file. You need to add a <reference> element to the <references> element to identify the assembly. You also need to add a <consolenode> element to the <structure> element to add the class.

You should not modify the QuickAccess.xml file. Although this file contains configuration settings for the default Quick Access toolbar, you should not modify it. Doing so could cause incompatibility issues with other areas of SharePoint. Instead, you should modify the CustomQuickAccess.xml file.

You should not add a <consolenode> element to the <references> section or a <reference> element to the <structure> section. The schema for the CustomQuickAccess.xml file is:

 
 
 
 
 
 
 
 

Reference:
http://msdn.microsoft.com/en-us/library/aa674506.aspx
Custom Quick Access Buttons video tutorial.





You are creating a workbook that shows sales data. The workbook includes a pivot table mapped to an Online Analytical Processing (OLAP) cube on SQL Server 2005. You create a report cell in the workbook to allow users to filter the results shown in the pivot table.

You perform the following steps:

Create an Office Data Connection file and import it into the trusted data connection list.
Copy the workbook into a trusted file location that supports linked data connections only.

You need to allow users to view and filter the pivot table in an Excel Web Access control.

What should you do?

  • Add a SQL Server Analysis Service Filter Web Part to the page.
  • Enable the trusted workbook location to support both embedded and linked data connections.
  • Add the report cell's dimension and hierarchy properties to a Key Performance Indicator (KPI) list.
  • Export the data connection information and import it to the Business Data Catalog (BDC).
Explanation :
You should add a SQL Server Analysis Service Filter Web Part to the page. The Excel Web Access Web Part cannot filter data directly using the report cell. Instead, you must add a SQL Server Analysis Service Filter Web Part to the page and configure it with the same dimension and hierarchy as the report cell.

You should not export the data connection information and import it to the Business Data Catalog (BDC). The BDC is used for line-of-business application data, not to allow a user to filter the results shown in a pivot table.

You should not add the report cell's dimension and hierarchy properties to a Key Performance Indicator (KPI) list. A KPI list should contain status indicators. They can be mapped to cells in an Excel spreadsheet, but not to the dimension and hierarchy values of a report cell.

You should not enable the trusted workbook location to support both embedded and linked data connections. Although you can do so to allow the connection to be stored in the workbook, doing so will not allow the data to be displayed and filtered in the Excel Web Access Web Part.

Reference:
http://office.microsoft.com/en-us/sharepointserver/HA101054751033.aspx
http://office.microsoft.com/en-us/sharepointserver/HA101054701033.aspx
http://office.microsoft.com/en-us/sharepointserver/HA102078901033.aspx



sharepoint global calendar (sharepoint calendar sharing)

25 November 2009 5:45 AM Posted by Mano Mangaldas
Labels: , ,

0

sharepoint calendar sharing - sharepoint global calendar


Recently, working with one of our clients who wanted a single calendar at the root site, to be shared among multiple sub-sites,with some filter.









Download:
Download entire code here


Ref:

Rename a standalone Sharepoint Server

20 November 2009 7:25 AM Posted by Mano Mangaldas

0

References:
  • http://technet.microsoft.com/en-us/library/cc261986.aspx

  • http://elczara.spaces.live.com/blog/cns!554EC06D366AC9D5!854.entry

  • http://vspug.com/nrdev/2008/07/15/tip-how-to-rename-a-sharepoint-server-machine-name/
  • Miscellaneous Admin Tasks

    11 October 2009 7:07 AM Posted by Mano Mangaldas

    0

    Disabling MySites and MyLinks

    • From Shared Service Administration site, choose "Personalization services permissions" under User Profiles and My Sites
    • Remove 'NT AUTHORITY\Authenticated Users'
    • Remove rights to 'Create personal sites' and 'Use personal features' from all other users ( service accounts ).

    Setup Search Settings

    • Go to Shared Services Administration site
    • Under Search, choose "Search Settings"
    • Select 'Content Sources and crawl schedules'

    • Edit the 'Local Office SharePoint Server Sites' content source by clicking on the 'Edit' context menu

    • Set the crawl schedules as
      • Full Crawl – weekly every Saturday
      • Incremental Crawl – every 4 hours

    Changing the Index location

    • The following stsadm commands will set the SharePoint Services index location

      stsadm -o spsearch -action list

      stsadm -o spsearch -indexlocation E:\SharePoint\Data\SEARCHINDEX

     

    • The following stsadm command will set the SSP index location ( use if SSP is configured )

      stsadm -o osearch -action list

      stsadm -o editssp -title [SSPNAME] -indexlocation E:\SharePoint\Data\OSEARCHINDEX

    Change service accounts and their passwords

    1. Open SharePoint Central Administration, click Operations.
    2. Under Security Configuration, click Service accounts.
    3. Click the radio button beside Web application pool. Select Windows SharePoint Services Web Application. Select the application pool where you want to change the identity, for example: Sharepoint - 80.
    4. Make a note of the existing settings in case you need to unwind your changes.
    5. Select the Configurable radio button. Provide the user name and password. It helps to be explicit here and use the domain\account format (e.g. mydomain\SPService). Also be sure to use a strong password. Click OK.
    6. To restart the application pool, either open IIS and recycle the application pool, or open a command prompt and type iisreset -noforce.
    7. Open your SharePoint site in a browser to confirm that the change was successful.  

    This change will be automatically propagated to all web front-ends.

    Re-direct using Content Editor Webpart

    04 August 2009 5:52 AM Posted by Mano Mangaldas
    Labels: , ,

    0

    Code to re-direct using Content Editor Webpart and Javascript based on a QueryString value
    
    

    How to set unique permissions to a document library

    12 May 2009 3:44 PM Posted by Mano Mangaldas

    0

    /// 
    /// Set Unique permissions to document Library
    /// 
    /// 
    /// 
    /// possible values 'Full Control', 'Read', 'Contribute' 
    public static void SetDocLibPermissions(SPWeb spWeb, SPGroup grpToGrantPermission, string roleDefinitionName)
    {
     string docLibName = "MyDocumentLib";
    
     SPList MyDocLibrary = spWeb.Lists[docLibName];
     if (MyDocLibrary != null)
     {
      MyDocLibrary.BreakRoleInheritance(false);
      if (roleDefinitionName != null)
      {
       SPRoleAssignment roleAssignment = new SPRoleAssignment(grpToGrantPermission);
       SPRoleDefinition roleDefinition = spWeb.RoleDefinitions[roleDefinitionName];
       roleAssignment.RoleDefinitionBindings.Add(roleDefinition);
       MyDocLibrary.RoleAssignments.Add(roleAssignment);
    
       MyDocLibrary.Update();
      }
     }
    }