Posts Tagged ‘SharePoint code’

MOSS4 / Create Minimal Master Page for SharePoint

Wednesday, May 14th, 2008

SharePoint team and Project server team at offshoresoftwaredevelopmentindia.com has great experience of creating web application based on MOSS 2007 and Project server 2007. That includes customization and development of webpart, site definitions, theme development, extension development, module creation. The team has developed CRM application, Job portal, Project management, to CMS applications based on MOSS 2007 and project server 2007.

Team would like to share same experience. This can help who wanted to begin with the sharePoint development and Project Server development.

There are list of articles start with SP and from number 1 to … Always start with the article SP1 and read next article to start working on MOSS easily and quickly.

How to Create Minimal Master Page for MOSS:

Go to Site Action -> Site setting -> Modify All Site Settings.

Then you will see the following screen. Then click on

Galleries -> Master pages and page layouts

You will see page as following image.

Click on default.master, it opens pop up then click send to -> Download a Copy

Save it to local drive. Rename defalt.master to maven.master. (Your referred name)

Then click on upload link.

Create Minimal Master Page

On clicking upload link following page will be displayed. Click browse, select .master file we have renamed and click ok.

Create Minimal Master Page

After clicking Ok, you will see following page. Select Content Type Publishing Master Page. Add the name and description. And click check in.

Create Minimal Master Page

Click on maven.master. we will see popup menu. Click on check out to make master page writable. Then click on maven.master, from popup click edit in Microsoft office sharepoint designer.

Create Minimal Master Page

This will open sharepoint server. Give the username and password of the site. The code of the current maven.master will be open.

Create Minimal Master Page

Replace code of the current maven.master with following code.


<%– Identifies this page as a .master page written in Microsoft Visual C# and registers tag prefixes, namespaces, assemblies, and controls. –%>
<%@ Master language=”C#” %>
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<%@ Import Namespace=”Microsoft.SharePoint” %>
<%@ Register Tagprefix=”SPSWC” Namespace=”Microsoft.SharePoint.Portal.WebControls” Assembly=”Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>
<%@ Register Tagprefix=”SharePoint” Namespace=”Microsoft.SharePoint.WebControls” Assembly=”Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>
<%@ Register Tagprefix=”WebPartPages” Namespace=”Microsoft.SharePoint.WebPartPages” Assembly=”Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>
<%@ Register Tagprefix=”PublishingWebControls” Namespace=”Microsoft.SharePoint.Publishing.WebControls” Assembly=”Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>
<%@ Register Tagprefix=”PublishingNavigation” Namespace=”Microsoft.SharePoint.Publishing.Navigation” Assembly=”Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>
<%@ Register TagPrefix=”wssuc” TagName=”Welcome” src=”~/_controltemplates/Welcome.ascx” %>
<%@ Register TagPrefix=”wssuc” TagName=”DesignModeConsole” src=”~/_controltemplates/DesignModeConsole.ascx” %>
<%@ Register TagPrefix=”PublishingVariations” TagName=”VariationsLabelMenu” src=”~/_controltemplates/VariationsLabelMenu.ascx” %>
<%@ Register Tagprefix=”PublishingConsole” TagName=”Console” src=”~/_controltemplates/PublishingConsole.ascx” %>
<%@ Register TagPrefix=”PublishingSiteAction” TagName=”SiteActionMenu” src=”~/_controltemplates/PublishingActionMenu.ascx” %>
<%– Uses the Microsoft Office namespace and schema. –%>
<html>
<WebPartPages:SPWebPartManager runat=”server”/>
<SharePoint:RobotsMetaTag runat=”server”/>

<%– The head section includes a content placeholder for the page title and links to CSS and ECMAScript (JScript, JavaScript) files that run on the server. –%>
<head runat=”server”>
<asp:ContentPlaceHolder runat=”server” id=”head”>
<title>
<asp:ContentPlaceHolder id=”PlaceHolderPageTitle” runat=”server” />
</title>
</asp:ContentPlaceHolder>
<Sharepoint:CssLink runat=”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderAdditionalPageHead” runat=”server” />
</head>

<%– When loading the body of the .master page, SharePoint Server 2007 also loads the SpBodyOnLoadWrapper class. This class handles .js calls for the master page. –%>
<body onload=”javascript:_spBodyOnLoadWrapper();”>
<%– The SPWebPartManager manages all of the Web part controls, functionality, and events that occur on a Web page. –%>
<form runat=”server” onsubmit=”return _spFormOnSubmitWrapper();”>
<wssuc:Welcome id=”explitLogout” runat=”server”/>
<PublishingSiteAction:SiteActionMenu runat=”server”/>
<PublishingWebControls:AuthoringContainer id=”authoringcontrols” runat=”server”>
<PublishingConsole:Console runat=”server” />
</PublishingWebControls:AuthoringContainer>
<%– The PlaceHolderMain content placeholder defines where to place the page content for all the content from the page layout. The page layout can overwrite any content placeholder from the master page. Example: The PlaceHolderLeftNavBar can overwrite the left navigation bar. –%>
<asp:ContentPlaceHolder id=”PlaceHolderMain” runat=”server” />
<asp:Panel visible=”false” runat=”server”>
<%– These ContentPlaceHolders ensure all default SharePoint Server pages render with this master page. If the system master page is set to any default master page, the only content placeholders required are those that are overridden by your page layouts. –%>
<asp:ContentPlaceHolder id=”PlaceHolderSearchArea” runat=”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderTitleBreadcrumb” runat=”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderPageTitleInTitleArea” runat=”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderLeftNavBar” runat=”server”/>
<asp:ContentPlaceHolder ID=”PlaceHolderPageImage” runat=”server”/>
<asp:ContentPlaceHolder ID=”PlaceHolderBodyLeftBorder” runat=”server”/>
<asp:ContentPlaceHolder ID=”PlaceHolderNavSpacer” runat=”server”/>
<asp:ContentPlaceHolder ID=”PlaceHolderTitleLeftBorder” runat=”server”/>
<asp:ContentPlaceHolder ID=”PlaceHolderTitleAreaSeparator” runat=”server”/>
<asp:ContentPlaceHolder ID=”PlaceHolderMiniConsole” runat=”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderCalendarNavigator” runat =”server” />
<asp:ContentPlaceHolder id=”PlaceHolderLeftActions” runat =”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderPageDescription” runat =”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderBodyAreaClass” runat =”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderTitleAreaClass” runat =”server”/>
<asp:ContentPlaceHolder id=”PlaceHolderBodyRightMargin” runat=”server” />
</asp:Panel>
</form>
</body>
</html>


Above code is default code for any master pages. Whatever our design we need, code it in this file. There is one content place holder which holds the page layout.

Save the file. Then go to master page and layouts page from the site as follows.

Create Minimal Master Page

Click on maven.master and click check in. This will open following page. Select Major Version (publish). And click open.

Create Minimal Master Page

Again click maven.master and click Approve/Reject from popup. And click approve.

Create Minimal Master Page

To change the master page of current site, go to;

Site action -> site settings -> modify all settings

Look and Feel -> Master page

This will open following form,

Create Minimal Master Page

Select maven.master.
This will apply maven.master to current site.

Fore more details please refer:

http://msdn2.microsoft.com/en-us/library/aa660698.aspx

MOSS3 / Creating Themes / Skins / Templates

Sunday, May 4th, 2008

SharePoint team and Project server team at offshoresoftwaredevelopmentindia.com has great experience of creating web application based on MOSS 2007 and Project server 2007. That includes customization and development of webpart, site definitions, theme development, extension development, module creation. The team has developed CRM application, Job portal, Project management, to CMS applications based on MOSS 2007 and project server 2007.

Team would like to share same experience. This can help who wanted to begin with the sharePoint development and Project Server development.

There are list of articles start with SP and from number 1 to …. Always start with the article SP1 and read next article to start working on MOSS easily and quickly.

Creating Themes / Skins / Templates

  • On the SharePoint server go to the Themes folder e.g. c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\Themes
  • Make a copy one of the existing theme folders and its contents rename it e.g. MyTheme.
  • Rename the .INF file within the MyTheme folder to MyTheme.INF
  • Edit MyTheme.INF.
    • At the the info section, Change the title, to MyTheme. Change codepage, e.g 22200, replacing the code page will fixing error “A theme with the name ‘MyTheme 1011′ and version already exists on the server.”
    • In the titles section, rename the names to your new name. this section is to present the name in the different language.
  • 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. tmbMyTheme.gif
  • 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 MyTheme theme

<Templates>
<TemplateID>MyTheme</TemplateID>
<DisplayName> MyTheme </DisplayName>
<Description> MyTheme has a white background with blue control areas and orange highlights.</Description>
<Thumbnail>images/tmbMyTheme.gif</Thumbnail>
<Preview>images/ tmbMyTheme.gif</Preview>
</Templates>

  • Modify the CSS within MyTheme folder to personalize your theme.
  • Run iisreset from the command prompt
  • Apply the new theme to a ‘test site’

MOSS2/Working with Web Application and Site Collection

Monday, April 14th, 2008

SharePoint team and Project server team at offshoresoftwaredevelopmentindia.com has great experience of creating web application based on MOSS 2007 and Project server 2007. That includes customization and development of webpart, site definitions, theme development, extension development, module creation. The team has developed CRM application, Job portal, Project management, to CMS applications based on MOSS 2007 and project server 2007.

Team would like to share same experience. This can help who wanted to begin with the sharePoint development and Project Server development.

There are list of articles start with SP and from number 1 to …. Always start with the article SP1 and read next article to start working on MOSS easily and quickly.

Working with Web Application and Site Collection:

To start working with WA (Web Application) and SC (Site Collection), open web application we have created by entering link into browser. We need to log in by user name and password which we have given to web application.

See to the following image for home page of the web application. The most important control on the webpage is site Actions.

Working with WebApplication And SiteCollections

If you click on the site action button you will see the menu with so many options.

Go to Site Action -> Site setting -> Modify All Site Settings.

Working with WebApplication And SiteCollections

After clicking Modify All site Settings you will see following screen.

Working with WebApplication And SiteCollections

Change theme of the website:

Please go to

Go to Site Action -> Site setting -> Modify All Site Settings.

Then you will see the following screen. Then click on

Look and feel -> Site theme

Working with WebApplication And SiteCollections

Then you will see the following screen to change the theme. Select theme you want and apply it.

Working with WebApplication And SiteCollections

After applying we can see the new theme as following screen.

Working with WebApplication And SiteCollections

Working with master pages and templates:

Please go to

Go to Site Action -> Site setting -> Modify All Site Settings.

Then you will see the following screen. Then click on

Galleries -> Master pages and page layouts

Working with WebApplication And SiteCollections

On clicking master pages you will see page as shown in following image.

Working with WebApplication And SiteCollections

Master Page:

ASP.NET master pages allow you to create a consistent layout for the pages in your application. A single master page defines the look and feel and standard behavior that you want for all of the pages (or a group of pages) in your application. You can then create individual content pages that contain the content you want to display. When users request the content pages, they merge with the master page to produce output that combines the layout of the master page with the content from the content page.

How Master Pages Work:

Master pages actually consist of two pieces, the master page itself and one or more content pages.

A master page is an ASP.NET file with the extension .master (for example, MySite.master) with a predefined layout that can include static text, HTML elements, and server controls. The master page is identified by a special @ Master directive that replaces the @ Page directive that is used for ordinary .aspx pages.

In addition to the @ Master directive, the master page also contains all of the top-level HTML elements for a page, such as html, head, and form. For example, on a master page you might use an HTML table for the layout, an img element for your company logo, static text for the copyright notice, and server controls to create standard navigation for your site. You can use any HTML and any ASP.NET elements as part of your master page.

Replaceable Content Placeholders:

In addition to static text and controls that will appear on all pages, the master page also includes one or more ContentPlaceHolder controls. These placeholder controls define regions where replaceable content will appear. In turn, the replaceable content is defined in content pages. After you have defined the ContentPlaceHolder controls, a master page might look like the following.


C#
<%@ Master Language=”C#” %>

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML
1.1//EN” “http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”>

<html>
<head runat=”server” >
<title>Master page title</title>
</head>
<body>
<form id=”form1″ runat=”server”>
<table>
<tr>
<td><asp:contentplaceholder id=”Main” runat=”server” /></td>
<td><asp:contentplaceholder id=”Footer” runat=”server” /></td>
</tr>
</table>
</form>
</body>
</html>


Working WebApplication And SiteCollections

MOSS1 – Create Web Application and Site Collections

Friday, April 4th, 2008

SharePoint team and Project server team at offshoresoftwaredevelopmentindia.com has great experience of creating web application based on MOSS 2007 and Project server 2007. That includes customization and development of webpart, site definitions, theme development, extension development, module creation. The team has developed CRM application, Job portal, Project management, to CMS applications based on MOSS 2007 and project server 2007.

Team would like to share same experience. This can help who wanted to begin with the sharePoint development and Project Server development.

There are list of articles start with SP and from number 1 to …. Always start with the article SP1 and read next article to start working on MOSS easily and quickly.

Installation: SharePoint server 2007 must be installed to perform all the actions.

Create Web Application:

To start working with share point server we need to first install share point server 2007 if it is not installed.

After installation we need to run share point product and services configuration wizard from the

Start menu -> Microsoft office Server -> SharePoint Products and Technologies Configuration Wizard.

See the following image.

Create WebApplication And SiteCollections

Central Administration:

First time to work with the share point server, we need to work with share point central administration.

Start menu -> Microsoft office Server -> Share Point 3.0 Central Administration.

See the following image.

Create WebApplication And SiteCollections

The following image displays the central administration home page. There are three tabs in the central administration panel.

  1. Home
  2. Operations
  3. Application Management

Home Tab:

Create WebApplication And SiteCollections

Operations Tab:

Create WebApplication And SiteCollections

Application Management Tab:

Create WebApplication And SiteCollections

Creating Web Application:

To work with the share point site or to create a new share point site first we need to create share point Web Application.

A Web application is comprised of an Internet Information Services (IIS) site with a unique application pool and can be assigned to an SSP (Shared Services Provider) to enable features such as InfoPath Forms Services, Excel Calculation Services, and Workflows.

To create share point web application, go to

Central administration -> Application Management

Then click on SharePoint Web Application Management -> Create or extend web Application

Create WebApplication And SiteCollections

Create WebApplication And SiteCollections

Create WebApplication And SiteCollections

Create WebApplication And SiteCollections

Create WebApplication And SiteCollections

Provide above mentioned information to the site like website description, Port, Configurable User Name and Password.

Then click OK.

After that we can see following processing screen.

Create WebApplication And SiteCollections

After completion of the processing we can see following application created screen.

Create WebApplication And SiteCollections

Creating Site Collection:

A site collection is a group of sites built on Microsoft Windows SharePoint Services that all exist under a top-level site.

After creating web application, to work with web application we need to create site collection. We cannot work in empty site collection. We have to create site collection.

To create a site collection we need to go to central administration -> Application Management.

Create WebApplication And SiteCollections

We need to select web Application for which we need to create site collection as following screen.

Create WebApplication And SiteCollections

This will show us the list of the site application as following screen. We need to create site application we created ex. Yahoo-1111. Click on Yahoo-1111 as following screen.

Create WebApplication And SiteCollections

Then our web application path will be changed to our created web application’s path with mentioned port-1111 as following screen.

Create WebApplication And SiteCollections

Then we need to feel the data like title, Description, URL, Template, primary site collection administrator and secondary site collection administrator for the site collection as following screen.

URL:

We are creating first site collection for the Web Application so we need to select base site (root site) in the URL. Select “/”.

Template:

There are many types of templates available. There are for tabs for the template. We are creating publishing site so we need to create publishing tab and then need to select publishing portal.

Site Collection Administrator:

Site Collection Administrator should be user of the current server, either from administrative group or from non administrative group.

Please see the following image for all these details.

Create WebApplication And SiteCollections

After submitting above details we will see following processing screen.

Create WebApplication And SiteCollections

On completion of the processing we will get message top level site collection successfully created as per following screen.

Create WebApplication And SiteCollections

Site collection is created successfully.

Now we can work with web application with mentioned URL – http://server03:1111/.

  • QUICK QUOTE

     

    cforms contact form by delicious:days

  • CLIENT SPEAKS

    The team at Maven Infosoft has been simply awesome, they provide a great service and are easy to communicate remotely with and have a quick response time.


Country
State / County
City