Powered By Blogger

Monday, 5 December 2011

within 13 steps you can design a Sharepoint Site using Visual Studio 2010

Now it is time to create a generic branding solution using the SharePoint development tools in Visual Studio 2010.

    Lets we do step by step for designing a Site in sharepoint 2010.

1.You can start by creating an Empty SharePoint Project named Branding101




2.When you create the new SharePoint project, the SharePoint Customization Wizard prompts you to provide a URL to a local SharePoint test site and to select either Deploy as a sandboxed solution or Deploy as a farm solution for testing. Be sure to select Deploy as a sandboxed solution,

  




Creating a Custom Master Page:
3. In Visual Studio 2010, in Solution Explorer, right-click the Branding101 project node. On the Project menu, select Add and then New Item.
In the Add New Item dialog box, create a new Module project item named MasterPageGallery

4.After you create the new Module, it contains an element manifest named Elements.xml and a sample element file named Sample.txt. Right-click the Sample.txt file, and rename it Branding101.master



5.The next step is to modify the contents of the Branding101.master template file with the starting point for a custom master page. A popular technique is to copy and paste the text from the standard SharePoint 2010 master page named v4.master. Use Windows Explorer to locate the v4.master template file, which exists at the following path.
E:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\GLOBAL\v4.master
 
When you locate the v4.master template file, open it and copy its contents to the Clipboard. Next, open the Branding101.master template file in your project and delete all the contents in the file. Paste the contents from v4.master inside Branding101.master, and then save your changes. After you successfully copy the content from v4.master, close this template file without saving any changes.
Currently, your custom master page has the same content as the standard SharePoint 2010 master page, v4.master.
  You can do this by locating the opening body tag in Branding101.master and adding the following element just below it.

<div style="background-color:yellow">Branding101.master</div>
 
6.Now that you have created your custom master page, you must modify the 
Elements.xml file inside the MasterPageGallery module to ensure that it 
is correctly deployed to the master page gallery during Feature 
activation. Open the Elements.xml file and update the Module 
element and its inner File element with the following XML content. 

7.At this point, you have finished your initial work on the 
MasterPageGallery module. Now you should turn your attention to the 
Feature that will be used to deploy this module. Notice that when you 
added the module to the Branding101 project, the 
SharePoint development tools in Visual Studio 2010 automatically create a
 new Feature named Feature1. Locate this Feature in  
Solution Explorer, right-click it and rename it to Main.
 
 
8.After you rename the Feature, double-click the Feature node so that you can
see the Feature in the Feature Designer. Change the Title of the Feature
to something more appropriate, such as Branding 101 Sample Feature,
as shown in Figure 5. It is also important to change the Scope of
the Feature from Web to Site so that it activates at the level of the site 
collection and not the level of the site. 
 
 Creating Custom CSS Files
8.
In Solution Explorer, right-click the Branding101 project node, and on the Project menu, select Add and then New Item.
In the Add New Item dialog box, create a new Module project item named Style Library, as shown in
9.The new Module project item initially contains an element manifest named Elements.xml and a sample element file named Sample.txt. Right-click Sample.txt and rename the file Styles.css.
Next, right-click the Style Library module node, and on the Project menu, select Add and then New Folder to create a new child folder in the Style Library module. Name the folder Branding101.
After you create this folder, you can move the styles.css file by dragging it to the folder in Solution Explorer.




Adding Feature Receiver:

10;In Solution Explorer, right-click the Main Feature node, and then select Add Event Receiver to add a Feature receiver class.
  Inside the Feature receiver class, you must override and implement two methods named FeatureActivated and FeatureDeactivating. Begin your coding by cleaning up and restructuring the source file for your Feature receiver class to look like the following example.


Thursday, 1 December 2011

centered SharePoint 2010 Site

I have followed a steps to get a centered Sharepoint site as of Figure 1.



Its takes just two minutes to center a sharepoint site .I followed below link,So begineers who like to explore follow this.

Happy Sharepoint....


Creating a Approval WorkFlow in Sharepoint 2010

Workflows (sequences of connected steps) are an everyday occurrence in most offices and as such, SharePoint 2010 provides support for workflows. In this article we review how to add an approval workflow to a SharePoint Document Library.

The approval workflow is one of the few built-in workflows that come with the SharePoint 2010. Basically it allows you to receive an approval for a document from your superiors.
If you need a custom workflow you can create your own with SharePoint Designer or Microsoft Visio and import it into SharePoint Designer or program it inside Microsoft Visual Studio. How to do this is outside of the scope of the current article.

The sample workflow we are going to build will be triggered upon uploading a new document to a custom document library. Then the workflow will assign a task to a predefined user to approve the uploaded document. The status of the document – approved/rejected will be displayed in one of the columns of the library. And we will do everything without writing a single line of code!

The first step is  to create the Document library where the approval workflow will be enabled. To do this, select the “Site Actions” menu and then choose “New Document Library” as shown in Figure 1.

Create New Document Library - Site Actions menu
Figure 1 Create New Document Library – Site Actions menu

Next, the dialog for creating a new Document library will appear (Figure 2). Fill in “Purchase Requests” for the “Name” of the new library and optionally provide description. Select the options for “Navigation” and “Document Version History” – whatever fits to your requirements is fine as they are irrelevant to our example. For “Document template”,  select “Microsoft Word document”. You can choose whatever you wish but this current example we will use Word documents.

Create New Document Library
Figure 2 Create New Document Library

After you have filled in everything, click Create and the new document library will be created as shown in 

Figure 3
Purchase Request Library is created
Figure 3 Purchase Request Library is created

Now it is time to enable the Approval workflow for our newly created library. To do so select “Library” from the “Library tools” and then select “Workflow Settings” as displayed in Figure 4.
Workflow Settings button
Figure 4 Workflow Settings button

This will start the wizard shown in Figure 5 which will help you to enable the approval workflow for the current document library. The first thing to do is select the workflow template from the list box in the “Workflow” section. You can choose from several out-of-the-box workflow templates but we will choose “Approval – SharePoint 2010”. Then we provide a name for our workflow:  “Expense approval”.

The task list drop down  allows us to define a list where a new task will be assigned to the corresponding user. Let’s use the default value – “Tasks”. Later we will configure the users responsible for approving the documents. Next, we define the history list for the workflow. History lists are special logs which monitor the execution of the workflow.

At each step of the workflow, messages at written to the log upon execution of the step. Again, accept the default value, as shown in Figure 5. Now, configure how the workflow is started. Generally, two approaches are possible -  manual and automatic. We will use the latter and will deselect the check boxes for manual starting and we will select the checkboxes for automatic starting.

After pressing the next button, we will navigate to the second step of the configuration wizard – Figure 6.
Add workflow – Step 1

Figure 5 Add workflow – Step 1
Add workflow – Step 2
Figure 6 Add Workflow – Step 2

Now, we need to configure the users responsible for approving the content (Word files in this case). We will do it by clicking the ‘open book’ icon and select it from a list. In our example the approver will be John. You can also specify user groups, not just single users. If there are multiple users selected, you can choose to approve one at a time or all at a time.

We also need to specify a Notification message. This message will be used to remind the user assigned as an approver, the action he is supposed to take. Something like “Please approve” will be appropriate in this case.
The other fields are not necessary to complete the workflow. If you are curious about these, you can read the detailed explanation below each field.

After pressing the Save button our workflow is ready and it is time to see how it works. To do this, we will upload a new Word document to the document library we have created earlier. Navigate to the “Purchase Requests” via the menu on the left and select “Add new document”. A new popup dialog will appear (Figure 7) where we can select a Microsoft Word document from the local hard drive.

Click OK and a popup dialog will appear, where additional properties can be assigned to the newly uploaded file. For example,  you can associate some keywords with it.
Upload Document
Figure 7 Upload Document

As you can see from Figure 8 our file has been uploaded to the document library and the last column shows that the Expense approval workflow is in progress. This means that a new task has been assigned to John (the user we specified early as an approver). If we open the Tasks List (Figure 9), we will note that there is a new task with the title “Please approve Backup Server” assigned to John. If SharePoint is configured to use the SMTP server, John will receive an email that informs him of the new task.

Newly uploaded document has started the workflow
Figure 8 Newly uploaded document that has started the workflow

Approval Task Assigned to John
Figure 9 Approval Task Assigned to John

Now, let’s suppose we have logged in as John. After opening the “Please approve the Backup Server” task a new popup window will appear – Figure 10. We can approve or reject the document by clicking Approve/Reject . In addition, we have the option to assign the task for approving the document to another user. For this demo we will approve the document by clicking Approve.
Document Approval Dialog
Figure 10 Document Approval Dialog

Now, after John has approved our document, we can go back to the “Purchase Requests” document library and check the status of our document. You will notice that the last column now shows “Approved”.
Document is approved
Figure 11 Document is approved

In this article we have reviewed how to configure an approval workflow for a custom document library. The workflow was started automatically after a new document was uploaded. If you need a more sophisticated workflow, you will need to use the SharePoint Designer or Visual Studio to create one. The last approach is far more complicated and requires programming skills.

   That's It......