Posts Tagged ‘Microsoft SharePoint Server’

Print This Post This page as PDF Email This Post Microsoft SharePoint Server Mini Calendar Webpart

Saturday, August 1st, 2009

Dot Net team at OffshoreSoftwareDevelopmentIndia.com has developed Microsoft SharePoint Server Mini Calendar Webpart. This MOSS 2007 Mini Calendar Webpart allows administrator to select any of the list to configure with the calendar. Calendar displays all the tasks, events in the calendar. Upon selecting the list, all the events/tasks will show in Mini calendar by highlighted background to the date. On mouse hover to that date, a popup will appear with all the events/tasks for that day. On clicking that link of the events/tasks, the page will redirect to that task/event page.

It is easy to install. Easy to configure. With rich functionalities.

Working with MOSS Mini Calendar:

There is often need to share information about important dates, appointments and meetings. The MOSS Mini Calendar provides all information.

When you import MOSS Mini Calendar on site it looks like as follows:

Mini Calendet for MOSs

(Fig. 1)

When click on Modify Shared Web Part (right top corner) of Fig. 1, it looks like as follows:

Mini Calendet for MOSs

( Fig. 2 )

What you see on right side of Fig. 2 are custom properties of the mini calendar.

  1. About us: When click on this, it displays company details in popup window.
  2. Select a list: It contains variety of contents like documents, form and templates, master page gallery, web part gallery etc.
  3. Select a display column: It contains different columns like name, title, created by, modify by related to selected list item. What you want to display on calendar please select from this list.
  4. Select a view to filter calendar items: select which items to display related to calendar item.
  5. Select a date column to base the calendar on: Means which items to display related to date column (e.g. created, modify).
  6. Select a Background Color: It sets calendar date cells background color.
  7. Select a Body Text Color: It sets calendar date cells text color.
  8. Select a Border Color: It sets calendar border color. It also sets calendar?s title back color.
  9. Select a Border Font Color: It sets calendar?s title fore color.
  10. Select a Highlight Color: It sets color on that cells where there are some events display in popup window by moving mouse over on cell as follow-
  11. Mini Calendet for MOSs

  12. Select a Highlight Font Color:
  13. Mini Calendet for MOSs

  14. Select a Day Header Background Color: It sets the calendar?s day header background color.
  15. Mini Calendet for MOSs

  16. Select a Day Header Fore Color: It sets the calendar?s day header font color.
  17. Mini Calendet for MOSs

    By setting all above properties, click on OK button it display as Fig.1. Now When you take mouse over the highlight cell it display popup window as follow ?

    Mini Calendet for MOSs

    When click on any items it goes to that particular page.

    Calender Webpart Configuration: Webpart Properties

    Mini Calendet for MOSs

    Mini Calendet for MOSs

    Mini Calendet for MOSs

    Mini Calendet for MOSs

    Mini Calendet for MOSs

    Mini Calendet for MOSs

    Prerequisites:

    1. We need to make sure that timer job is running from:
    2. Administrative Tools >> Services >> Windows SharePoint Services Timer

      Mini Calendet for MOSs

      If service is not started please start it.

    3. Check whether solution is deployed or not.
    4. From - Central administration >> Operations >> Solutions

      Mini Calendet for MOSs

    5. If it is deployed then they can go ahead and activate feature manually by going to site collection
    6. Site Actions >> Site Settings >> Modify All Site Settings >> Site Collection Features.

      Mini Calendet for MOSs

Print This Post This page as PDF Email This Post MOSS18 / Using Content Query Webpart in SharePoint

Friday, October 10th, 2008

This article will show you how to use Content Query webpart for MOSS 2007.

How to use Content Query Web part in MOSS site:

1. How to Add a Content Query Web Part.

Click on Site Actions >> Edit Page

Content Query Webparts

2. Now for add a Content Query Web Part to our page

Click on Add a Web Part

Content Query Webparts

3. Now from the popup window like below from all web part list select checkbox content Query Web Part
And click on Add button.

Content Query Webparts

4. Now click on edit on the right top and then from the popup menu click on modify Shared Web Part Like below.

Content Query Webparts

5. Now Content Query Tool Part is Open.

Content Query Webparts

6. Now you can select from the tool part according to the result you wan’t.

Now Click on + sign on front of Query sub menu is open from that you can select option and according to that result will be generated.
Now from the submenu you can filter out from that

From the source:

If you want to display items from the entire site check radio button in front of that.

If you want to display items from your selected site and sub site then check radio button in front of that click on browse button and select the site as you want items from that to display.

You can also select item from the list

Content Query Webparts

7. You can also filter out your items from the list type as you choose from the dropdown control. Option like document library, custom list, post, task, workflow History, picture library, pages library are there and can choose any option from that.

Content Query Webparts

8. You can also filter out your answer according to content type you choose.

Content Query Webparts

9. You can also filter out your answer from the additional filters menu.
Whichever query you passed according to that the items will be displayed on web part.

10. Click on Presentation menu drop down list is open from that you can sort your answer like descending and ascending and also you can filter your answer group wise.

You can display your items on web part in no. of column as you choose.

You can also limit no. of items to display in web part

Content Query Webparts

11. You can apply group style and item style in no. of ways as you want.

Content Query Webparts

Content Query Webparts

12. You can also change appearance of web part.
Like change title of the web part ,change height and width of a web part.

Content Query Webparts

13. From the Layout menu you can apply direction like right to left, left to right, none for displaying items in web part.

14. You can also place your web part in any zone like Top, bottom left zone, bottom right zone.

Content Query Webparts

Advance menu:

From advanced menu you can select checkbox for item you want to display

Option are Allow minimize, allow close, allow hide, allow zone changes, allow connections.

If allow minimize checkbox is selected then you can minimize your web part

If allow close items is selected then you can close your web part.

Content Query Webparts

After making all the changes Click on ok button or Apply button you web part is display on page like below. When you click on any item you can redirect directly on that page.

Content Query Webparts

Print This Post This page as PDF Email This Post MOSS11 / Creating a Solution for SharePoint Server

Wednesday, September 10th, 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 a Solution:

A solution package is a cabinet (.cab) file with a .wsp file name extension and a manifest file. It can contain the following components:

  • Site definitions
  • Feature definitions and their corresponding element definitions and files
  • Web Part files (*.webpart, *.dwp)
  • Template files and root files, which can include the following:
    1. _layouts files
    2. Resources(*.resx)
    3. Resource files(for example, *.doc or *.xls)
  • Assemblies, which can include the following:
    1. Safe control entries
    2. Resources
  • Code access security policies

Solution files have a hierarchical structure a manifest file is at the root while feature, resource, or site definition directories are contained in subdirectories. In turn, feature definitions define where associated files are located inside of the solution.

The solution creator can define the remaining structure; however, it is recommended that files for a particular feature or site definition be placed in that feature or site definition’s subdirectory.

Note:

The directory structure inside of the .wsp file determines the final directory structure on the front-end Web server file system.

To create a solution package, perform the following steps:

  • Create a solution manifest.xml file.
  • The solution manifest (always called manifest.xml) is stored at the root of a solution file. This file defines the list of features, site definitions, resource files, Web Part files, and assemblies to process. It does not define the file structure if files are included in a solution but not listed in the manifest XML file, they are not processed in any way.

    Following is the structure of a manifest.xml file.

    XML

<Solution SolutionId=”4AFC1350-F354-4439-B941-51377E845F2B” xmlns=”http://schemas.microsoft.com/sharepoint/”>

<FeatureManifests>
<FeatureManifest Location=”FeatureLibrary\feature.xml”/>
</FeatureManifests>
<TemplateFiles>
<TemplateFile Location=”ControlTemplates\Featurelibraryform.ascx”/>
</TemplateFiles>
<RootFiles>
<!– These files go into the 12\ directory and can be used for Web services and global resources –>
<RootFile Location=”ISAPI\MyWebService.asmx”>
</RootFiles>
<Assemblies>
<Assembly DeploymentTarget=”GlobalAssemblyCache”
Location=”ms.samples.sharepoint.myFeature.dll”/>
</Assemblies>

</Solution>

In addition, you can add a DwpFiles element to specify .webpart or .dwp files, or a ResourceFiles element to specify resource files, site definitions, application resources, and code access security policies.

  • Optional. Annotate your feature.xml files with tags.

In the <ElementManifests> tag in your feature.xml file, add <ElementFile Location=”…”/> for all of the extra files in your feature, such as .aspx pages (for example, allitems.aspx) or master pages, and so on.

Note:

This step is required only if your solution contains features.

  • Create your solution package (the .wsp file).

Because the solution file is essentially a .cab file, use the makecab.exe tool to create the solution package. The makecab.exe tool takes a pointer to a .ddf file, which describes the structure of the .cab file. The format of a .ddf file is basically in the same style as the .inf file you declare a standard header and then enumerate, one file per line, the set of files by where they live on disk, separated by where they should live in the .cab file.

Xml

.OPTION EXPLICIT; Generate errors
.Set CabinetNameTemplate=MySolutionFile.wsp
.set DiskDirectoryTemplate=CDROM ; All cabinets go in a single directory
.Set CompressionType=MSZIP;** All files are compressed in cabinet files
.Set UniqueFiles=”ON”
.Set Cabinet=on
.Set DiskDirectory1=Package
build\manifest.xml manifest.xml
build\ MySolutionFile \feature.xml MySolutionFile \feature.xml

Installation Instructions:

Prerequisites:

- Installation package: LHH.PageLayoutsAndLists.wsp

- Flash Player installed on the client to access the site.

From cmd go to: “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin”

  • Adding Solution:

Run this command:
Stsadm.exe -o addsolution -filename C:\Temp\LHH.PageLayoutsAndLists.wsp

  • Deploying Solution:

Run this command
Stsadm.exe -o deploysolution -name LHH.PageLayoutsAndLists.wsp ?local -allowgacdeployment

  • Activating Features:

From LHH Portal Site go to Site Actions >> Site Settings >> Modify All Site Settings

Site Collection Features
Activate:
LHH Content Types
LHH Master Page and Page Layouts

  • Referencing content types:

Go to “Site Actions” >> View All Site Content >> Pages
Click on “Document Library Settings”
Click on Advance Settings >> Allow Manage Content Types (True) >> Ok

Then Go to

Site actions -> Site setting -> modify all settings

Site collection administration -> site collection feature

solution site settings

Then you will see the site collection feature list, active our feature from the list. We will have all the features available.

solution site features

Print This Post This page as PDF Email This Post MOSS10 / Publishing Page Layout using a Feature

Sunday, August 10th, 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.

Publishing Page Layout using a Feature:

This is the post on creating site columns, publishing content types and page layouts using features:

This post describes how to create a publishing page layout and deploy it using a custom feature. Now that we have a custom publishing site columns as well as custom publishing content types defined using a feature, the next step is to create the page layout.

Publishing page layouts map to the custom fields of a publishing content type. The files are placed in the Master page gallery (Site Actions > Site Settings > Modify All Settings > Galleries section > Master pages and page layouts).

Creating the page layout:

The page layout can be created by using Visual Studio 2005. It’s really an .ASPX page and some basic Intellisense works for the SharePointWebControls and PublishingWebControls.

If you need information on how to create your custom page layout there is a very good article on MSDN:

Customizing and Branding Web Content Management-Enabled SharePoint Sites (Part 1 of 3): Understanding Web Content Management and the Default Features.

Important to remember here is that you are dependant from the Master Page that will be used together with your page layout. In this article I’m using the default Blue Bland one; so all the default Content placeholders are available.

Snippet of the page layout (download all the files from the link at the bottom of the post):

Publishing Page layout Usinf Feature

Tip: to quickly create and test a page layout for my custom content types I sometimes use SharePoint Designer 2007 (SDP). Create the page layout by choosing “New > Page Layout” in the Master pages gallery. Be sure to choose your custom page layout:

Publishing New PageLayout

Then open the page using SharePoint Designer. Add your HTML and design elements and drag your custom properties to the page. HTML page design is really not my thing so this is an easy way to add some tables and layout to the page. Once you have the page ready in SPD, save the file, check in and test it by creating a new page.

You can now use the HTML and controls from this page when creating your custom page layout using Visual Studio.

Note that SPD saves the page directly into the SharePoint database and not on the hard drive. So this is just a fast way to start up the creation of your page layout but it does not allow you to deploy the page easily to other servers.

Creating the provisioning xml schema:

To provision the page layout and any used CSS, images or other files we create a XML file that will be picked up by the feature and install the files in the corresponding libraries in your publishing site.

In my example I have one custom page layout with just one image. I could as well have several images and CSS files installed using the same feature. I guess you get the idea with this image sample.

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

<Module Name=”ProductPageLayouts” Url=”_catalogs/masterpage” Path=”PageLayouts” RootWebOnly=”TRUE”>

<File Url=”ProductDetail.aspx” Type=”GhostableInLibrary”>
<Property Name=”Title” Value=”$Resources:pagelayout_product_name;” />
<Property Name=”MasterPageDescription” Value=”$Resources:pagelayout_product_description;” />
<Property Name=”ContentType” Value=”$Resources:cmscore,contenttype_pagelayout_name;” />
<Property Name=”PublishingPreviewImage” Value=”~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/DefaultPageLayout.png, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/DefaultPageLayout.png” />
<Property Name=”PublishingAssociatedContentType” Value=”;#$Resources:contenttype_productbase_name;;
#0×010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB0645
84E219954237AF3900ADB88465BE2C439798977662094183BC;#”/>
</File>

</Module>
<Module Name=”ProductLayoutImages” Url=”Style Library” Path=”Styles” RootWebOnly=”TRUE”>
<File Url=”images/line.jpg” Name=”product/images/line.jpg” Type=”GhostableInLibrary” />
</Module>

</Elements>

(Note: the value for PublishingAssociatedContentType above contains a break for HTML display reasons. You should put the value in one line).

I must say not much is available in the MSDN documentation about the schema for provisioning publishing pages. Like in other cases I looked at the PublishingLayouts feature delivered with the MOSS 2007 installation. This is a hidden feature that provisions the standard page layouts, master pages, etc for a MOSS Publishing site. You can find the feature here: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\PublishingLayouts.

Some clarifications to the schema elements:

<Module> element:

<Module Name=”[your module name]” Url=”virtual path destination of the module elements ” Path=”path from within this feature”>

PublishingAssociatedContentType property:

This property specifies to which the page layout you are installing is mapped to. The syntax is
;#ContentTypeName;#ContentTypeID;#

GhostableInLibrary:

Every element has the property Type=”GhostableInLibrary”. This property is important because it will install the file in the Master Page gallery, but the actual file content are still stored on the hard drive and not directly in the SharePoint database (as is the case if you create your page layout using SDP).

Wrapping it up: creating the feature:

I’m using one single feature to create my custom publishing fields, custom publishing content type and custom page layout(s).

The feature now has the following structure:

Three XML files are referenced by the feature schema in the order in which they should be installed.

  • myfields.xml: this file defines all my custom site columns.
  • ProductContentTypes.xml: this file defines my two custom publishing content types and uses the custom field defined in myfields.xml.
  • PageProvisionedFiles.xml: this file contains the provisioning for page layout and associated image.

I think the order in which these files are referenced in the feature schema are important because the site columns must be created before the content types, and the content types must be created before the page layout can reference it.

So, I have no proof that this really executes in the order defined in the feature schema but I do assume it is the case. Maybe someone has found some documentation on this?

Feature schema:

<?xml version=”1.0″ encoding=”utf-8″?>
<Feature Id=”787DCDC4-97F9-4f64-A771-D2A8B86DCADB”
Title=”My publishing content type”
Description=”$Resources:feature_description;”
Version=”1.0.0.0″
Scope=”Site”
DefaultResourceFile=”_Res”
Hidden=”FALSE”
xmlns=”http://schemas.microsoft.com/sharepoint/”>
<ActivationDependencies>
<!– Add a dependency to the Publishing site–>
<ActivationDependency FeatureId=”F6924D36-2FA8-4f0b-B16D-06B7250180FA” />
</ActivationDependencies>
<ElementManifests>
<ElementManifest Location=”myfields.xml”/>
<ElementManifest Location=”ProductContentTypes.xml”/>
<ElementManifest Location=”PageProvisionedFiles.xml”/>
</ElementManifests>
</Feature>

That’s it, the feature is complete.

All that needs to be done is copy the feature directory to “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\MyContentTypeFeature” and run the install command.

stsadm -o installfeature -filename MyContentTypeFeature\feature.xml

This command can be used to install and test the feature. For a production environment I would recommend creating a SharePoint solution that installs the feature and all its files.

Print This Post This page as PDF Email This Post MOSS9 / Creating Publishing Content Types

Thursday, July 10th, 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 Site Columns:

Before going into detail on the creation of content types via features it is important to understand how Content type IDs work.

You should read the following MSDN page that explains about ContenTypes IDs and their inheritance based model: http://msdn2.microsoft.com/en-us/library/aa543822.aspx

Since this post shows how to create Publishing Content Types we need to find from which existing content type we want to base our own. I did some research on the features that are installed and activated when you use the Publishing site. In there we can see that the base content type from which we want to inherit is the “Page”. This Content Type has an ID of:

0×010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB0
64584E219954237AF39

So in order to create our own ID we can add two hexadecimal values, or, we can add “00″ followed by a GUID. I prefer this approach as it is unique and identifies custom content types more easily.

So my content type ID can be:

0×010100C568DB52D9D0A14D9B2FDCC96666E9F20079481
30EC3DB064584E219954237AF3900ADB88465BE2C439798977662094183BC

The bold text is the Page content type ID to which I append “00″ and a new GUID.

Content Type Schema:

Second important piece of information is the Content Type schema. I could not find any information specific to publishing content types on MSDN or the MOSS SDK. So again the solution is to use the available information together with some nosing in the publishing features installed by MOSS in the 12 hive. ContentType schema on MSDN: http://msdn2.microsoft.com/en-us/library/aa544268.aspx

In the following sample I’m creating two content types: a product content type and a hardware product content type. You will see that the hardware product content type inherits from the product content type by appending 00 + a new GUID to the ID.

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

<!– Product base content type –>
<ContentType ID=”0×010100C568DB52D9D0A14D9B2FDCC96666E9F2007
948130EC3DB064584E219954237AF3900ADB88465BE2C43979
8977662094183BC” Name=”$Resources:contenttype_productbase_name;” Description=”$Resources:contenttype_productbase_description;” Group=”$Resources:group_productcontenttypes;” Sealed=”FALSE” Version=”0″>
<FieldRefs>
<FieldRef ID=”{F44BFBB0-4725-4167-B976-F85F84131AA3}” Name=”ProductCategory” Required=”FALSE” />
<FieldRef ID=”{EB19D87C-5DEE-4a73-85E0-506293D422D9}” Name=”ProductName” Required=”TRUE” />
<FieldRef ID=”{D73843E5-0D9F-4400-BC75-1A4C2BD27900}” Name=”ProductIntro” Required=”TRUE” />
<FieldRef ID=”{894635F9-1DF8-46f1-BC47-46EFF09FEF3D}” Name=”ProductDescription” Required=”FALSE” />
<FieldRef ID=”{D89C9409-2A97-4a7a-81F5-7D45E7CD8D6B}” Name=”LaunchDate” Required=”TRUE” />
<FieldRef ID=”{6036ECDE-521A-4dbe-94B4-40E0E4EF7029}” Name=”ProductImage” Required=”FALSE” />
<FieldRef ID=”{F31DF817-D220-4449-BD6F-2F1B7C0823ED}” Name=”ProductPrice” Required=”TRUE” />
</FieldRefs>
<DocumentTemplate TargetName=”/_layouts/CreatePage.aspx” />
</ContentType>

<ContentType ID=”0×010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3D
B064584E219954237AF3900ADB88465BE2C439798977662094183BC00B2DE
F3B02D274199BFF43C6D2F129D99″ Name=”$Resources:contenttype_hardwareproduct_name;” Group=”$Resources:group_productcontenttypes;” Sealed=”FALSE” Version=”0″>
<FieldRefs>
<FieldRef ID=”{6A08E31A-0620-45df-BAC1-54A4D0FBFDCE}” Name=”ProductManual” />
</FieldRefs>
<DocumentTemplate TargetName=”/_layouts/CreatePage.aspx” />
</ContentType>

</Elements>

Now we need to add this to the feature and install it together with what was done in part I of this series.

The complete feature can be downloaded here.

Refer:

http://www.katriendg.com/aboutdotnet/2007_4_2_publishing-content-types.aspx

Print This Post This page as PDF Email This Post MOSS8 / Create Site Columns in SharePoint Server

Thursday, June 12th, 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 Site Columns:

In this 3 part series I will explain the steps you need to follow in order to create site columns, content types and page layouts for use with a MOSS publishing site.

There is already quite some information to be found on the internet on how to create site columns and custom lists using a feature, however most part apply to team sites (WSS3 sites), not MOSS publishing sites.

Field definition schema:

Site columns are created by placing <Field> elements inside an <Elements> tag. It is important to review the <Field> element definition before going any further. The complete schema definition is detailed in the WSS3 SDK which can be consulted online on the MSDN site (http://msdn2.microsoft.com/en-us/library/ms437580.aspx). On the mentioned URL you can find all the types of fields available out of the box, the required attributes, possible values and so forth.

This is very good documentation for WSS3 fields but information on extra field types for publishing site columns is not available. At least I was unable to find it in the MOSS SDK or online. My solution was to look at the feature definitions used by MOSS publishing feature available out of the box.

Most of the attributes of the <Field> element are optional. This is a sample field definition using the most common attributes:

<Field

ID=”{4C67267C-B950-4cd4-8038-DEACA9EC2F74}”
Name=”IntroductionText”
StaticName=” IntroductionText ” SourceID=”http://schemas.microsoft.com/sharepoint/v3″
Group=”My publishing fields group”
DisplayName=”Introduction text field”
Type=”Text”
Required=”FALSE”
Sealed=”TRUE”
MaxLength=”250″>

</Field>

When using other types of fields there are extra attributes that are useful.

A note about the sealed attribute: setting this to “TRUE” will ensure the field cannot be removed via the “Change column” page. However when you are creating a choice field (a dropdown, a checkbox list), and you want your users to be able to edit the list of values you need to set sealed to FALSE.

Some attributes are only used in combination with some types of fields, like for example the StorageTZ attribute, which is useful together with Type=”DateTime”.

When it comes to publishing field types there are some new types that you can use. As far as I could find they are not yet documented. By looking at the “PublishingResources” hidden feature I could find the following:

Field type Description Related attributes
Image Publishing field for storing an image. The edit control shows the Insert picture button. RichText=”TRUE”
RichTextMode=”FullHtml”
HTML HTML editing control RichText=”TRUE” RichTextMode=”FullHtml”
Link Hyperlink control

In edit mode, allows the user to select an internal file (also external links can be allowed)

In display mode shows the clickable link to the file

RichText=”TRUE” RichTextMode=”FullHtml”
SummaryLinks Field control for editing a list of links

There are also some extra fields that are related to the page publishing content types such as “Publishing schedule start date”. I don’t think you’d like to use these as the page content types normally already inherit these types of columns.

As a sample for this and the following posts in this series I’m creating a product page content type. My product contains 8 fields going from name and description, date, image, price.

This is the XML schema (myfields.xml):

<?xml version=”1.0″ encoding=”utf-8″ ?>
<!– _lcid=”1033″ _version=”12.0.4017″ _dal=”1″ –>
<!– _LocalBinding –>
<!–
–>
<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>
<Field ID=”{F44BFBB0-4725-4167-B976-F85F84131AA3}” Name=”ProductCategory” StaticName=”ProductCategory” SourceID=”http://schemas.microsoft.com/sharepoint/v3″ Group=”$Resources:column_group_products;” DisplayName=”$Resources:column_productcategory_displayname;” Type=”Choice” Format=”Dropdown” Required=”FALSE” Sealed=”FALSE”>
<CHOICES>
<CHOICE>$Resources:column_productcategory_choice1;</CHOICE>
<CHOICE>$Resources:column_productcategory_choice2;</CHOICE>
<CHOICE>$Resources:column_productcategory_choice3;</CHOICE>
</CHOICES>
</Field>
<Field ID=”{EB19D87C-5DEE-4a73-85E0-506293D422D9}” Name=”ProductName” StaticName=”ProductName” SourceID=”http://schemas.microsoft.com/sharepoint/v3″ Group=”$Resources:column_group_products;” DisplayName=”$Resources:column_productname_displayname;” Type=”Text” Required=”TRUE” Sealed=”TRUE” MaxLength=”255″></Field>
<Field ID=”{D73843E5-0D9F-4400-BC75-1A4C2BD27900}” Name=”ProductIntro” StaticName=”ProductIntro” SourceID=”http://schemas.microsoft.com/sharepoint/v3″ Group=”$Resources:column_group_products;” DisplayName=”$Resources:column_intro_displayname;” Type=”Text” Description=”$Resources:column_intro_description;” Required=”TRUE” Sealed=”TRUE” MaxLength=”500″ NumLines=”2″></Field>
<Field ID=”{894635F9-1DF8-46f1-BC47-46EFF09FEF3D}” Name=”ProductDescription” StaticName=”ProductDescription” SourceID=”http://schemas.microsoft.com/sharepoint/v3″ Group=”$Resources:column_group_products;” DisplayName=”$Resources:column_productdesc_displayname;” Type=”HTML” Required=”FALSE” Sealed=”TRUE” RichText=”TRUE” RichTextMode=”FullHtml”></Field>
<Field ID=”{D89C9409-2A97-4a7a-81F5-7D45E7CD8D6B}” Name=”LaunchDate” StaticName=”LaunchDate” SourceID=”http://schemas.microsoft.com/sharepoint/v3″ Group=”$Resources:column_group_products;” DisplayName=”$Resources:column_date_displayname;” Type=”DateTime” Format=”DateTime” Required=”TRUE” Sealed=”TRUE” StorageTZ=”UTC”></Field>
<Field ID=”{6036ECDE-521A-4dbe-94B4-40E0E4EF7029}” Name=”ProductImage” StaticName=”ProductImage” SourceID=”http://schemas.microsoft.com/sharepoint/v3″ Group=”$Resources:column_group_products;” DisplayName=”$Resources:column_image_displayname;” Type=”Image” Required=”FALSE” Sealed=”TRUE” RichText=”TRUE” RichTextMode=”FullHtml”></Field>
<Field ID=”{6A08E31A-0620-45df-BAC1-54A4D0FBFDCE}” Name=”ProductManual” StaticName=”ProductManual” SourceID=”http://schemas.microsoft.com/sharepoint/v3″ Group=”$Resources:column_group_products;” DisplayName=”$Resources:column_manual_displayname;” Type=”Link” Required=”FALSE” Sealed=”TRUE” RichText=”TRUE” RichTextMode=”FullHtml”></Field>
<Field ID=”{F31DF817-D220-4449-BD6F-2F1B7C0823ED}” Name=”ProductPrice” StaticName=”ProductPrice” SourceID=”http://schemas.microsoft.com/sharepoint/v3″ Group=”$Resources:column_group_products;” DisplayName=”$Resources:column_productprice_displayname;” Type=”Currency” Required=”TRUE” Sealed=”TRUE” Decimals=”2″></Field>
</Elements>

To install the field definitions via a feature I’m creating a feature.xml file that refers to the myfields.xml. In the feature file I also add a dependency to the PublishingSite feature.

A note about resources files:

As you may notice in the display name and description attributes I?m referring to a resource instead of typing in the text. I recommend using resource files whenever translatable (non system name) text is used.

Living in Belgium, a country where we have three official languages I’m used to creating multi-lingual applications. Even when a first requirement does not specify a multi-lingual approach I still prefer to foresee resource files.

When creating features you can use local resource files by placing them in a sub-folder in the feature directory.

Print This Post This page as PDF Email This Post MOSS5 / Create a Page Layout in Sharepoint

Saturday, June 7th, 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 a Page Layout in Sharepoint?

Page layouts are templates that define content structure for a page and are always associated with a content type. A content type contains a document template, data columns, workflows, and other information that completely define a document. The publishing feature of MOSS uses a single root content type for publishing called Page. All of the page layouts inherit from this base. Here’s how to create a new page layout in MOSS.

STEP 1:- Define Site Columns

The individual content elements that appear in a page layout are derived from site columns. When you create a page layout, you can use any of the site columns already defined or define your own.

STEP 2:- Define a Content Type

Page layouts have a direct relationship to a content type defined within the site. The content type is a collection of site columns, a page template, workflows, and other information that determine the appearance and behavior of a page layout. In order to create a page layout, you must create a new content type that derives from the existing Page content type. Inheriting the Page content type allows the new page layout to function correctly within the MOSS content management Feature.

STEP 3:- Create the Page Layout

Page layouts are stored in Master Page and Page Layout Gallery. From this gallery, you can create a new page layout and associate it with a content type. This process makes the site columns that are defined for the content type available to the page layout as field controls that you can place on the page with the SharePoint Designer.

STEP 4:- Edit the Page Layout in SharePoint Designer

Once you have created the new page layout, you must open it in the SharePoint Designer so that you can add the desired field controls. The site columns you defined as part of the content type become available in the SharePoint Designer as field controls that you can place on the page layout.

STEP 5:- Publish the New Page Layout

Once the page layout is created, you must publish and approve it so that it becomes available for content authors. This process is essentially the same as publishing any item in MOSS. First the document is checked in, then it is published, and finally it is approved.

STEP 6:- Create a New Page

Once the page layout is published and approved, content authors may use it to create new pages. This is done in the normal way by selecting the Create Page item from the Site Actions menu. After the page is created, the field controls may be edited to develop the actual page content.

Print This Post This page as PDF Email This Post 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

Print This Post This page as PDF Email This Post 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’

Print This Post This page as PDF Email This Post 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