Archive for the ‘SharePoint 2007’ Category

Pre-populate a textbox using jQuery

Here’s the scenario:

I have a form which contains a textbox. This textbox should be populated with a query string value. Users should not be able to edit the value of the textbox while adding the item.

Solution:
The above can be achieved using a Content Editor Web Part (CEWP) and jQuery.

Steps:
1. Append the NewForm.aspx url with the following: &PageView=Shared&ToolPaneView=2
2. This will cause the ‘Add Web Part’ tool pane to show up.
3. Add a CEWP to the page.
4. Go the webparts properties and click the Source button
5. Add the following:

// Note: replace this url with the url of the jquery library residing on the site!!
<script type=”text/javascript” src=”http://intranet/InternalDocuments/jquery-1.2.6.min.js”></script>

<script>
// This method retrieves the querystring value. If the querystring is missing it returns null. I’m not the author of the method; found it on the net, can’t remember from where though 🙂
function getQuerystring(key, default_)
{
if (default_==null) default_=””;
key = key.replace(/[\[]/,”\\\[“).replace(/[\]]/,”\\\]”);
var regex = new RegExp(“[\\?&]”+key+”=([^&#]*)”);
var qs = regex.exec(window.location.href);
if(qs == null)
return ‘null’
else
return qs[1];
}

//Note: The title attribute of my textbox is called ‘Source’. Replace it with the title attribute of the textbox on your form. The query string name is all called ‘Source’, replace as appropriate.
$(document).ready(function() {
$(“input”).val(unescape(getQuerystring(‘Source’,”)));
$(“input”).attr(‘readonly’,’true’);

});
</script>

6. Hit the Save button
7. Expand ‘Appearance’ and change ‘Chrome Type’ none. This step is optional.

Advertisements

When you begin using data view web parts (aka data form web parts) to display information on a sharepoint webpage, you will find that filtering is rather easy. After you insert a data view, you should see a small ‘<‘ symbol (MSFT calls it a chevron) off to the right of your new data view webpart. If you click it, you can see that the first thing they let you click is to Filter. When you do, you can choose the first dropdown to be any column; but to filter it to the current user, you need to pick a Person/Group column that you have created. The middle dropdown should be "Equals". The third dropdown, you should be able to scroll to the VERY bottom and find something called "[Current User]". This will filter the webpart to only show you items where your username is in that person/group column. Mine looks like this:

Pretty simple, huh? Well, there’s one small kicker to this: this works right IF you are only using a single list. If you follow the instructions of Laura Rogers or other SharePoint gurus and create a linked data source (joining the information from 2 different lists with a common column), then this filter will not work. It will actually change the place in the "code" where the filtering happens and it just won’t work. The way to fix this is to open up the page in Split or Code view and you’ll have to copy-paste something from here into a specific part (don’t worry, I’ll show you where). The piece you need to copy to your clipboard is this:

"&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name="YOURCOLUMNNAME"/&gt;&lt;Value Type="Integer"&gt;&lt;UserID/&gt;&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;/View&gt;"

What this really looks like is this:

"<View>

<Query>

<Where>

<Eq>

<FieldRef Name="YOURCOLUMNNAME"/>

<Value Type="Integer">

<UserID/>

</Value>

</Eq>

</Where>

</Query>

</View>"

This is the dreaded CAML – a markup language used to get information from sharepoint lists like SQL will get information from SQL tables. What it means is that it needs to check the Field "YOURCOLUMNNAME" (which you will need to replace with the name of your person/group column that you want to filter by) and use the "UserID" integer (aka your ID number from sharepoint) to only get the ones where the ID number in that column matches yours. Where you will need to place this code, look toward the top of the code for your data view webpart and look for two things: 1) the words "SharePoint:AggregateDataSource" and several "<asp:Parameter"s. 2) just below the Aggregate data source and some of the parameters, you should see "SharePoint:SPDataSource" and toward the right you will find the phrase SelectCommand = "&lt;View&gt;&lt;/View&gt;" or something super close to that. Replace everything in quotes for the SelectCommand with the stuff from above. Be sure to rename the YOURCOLUMNNAME with the actual name of your column. This will filter that data source automagically for you. Hope that helps and doesn’t increase brain fog.

Reference: http://www.hornerit.com/2010/08/filtering-data-view-web-part-to-current.html

Here is how to fetch web template name, id and configuration id of a SharePoint site:

protected override void OnLoad(EventArgs e)

{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPWeb thisWeb = this.Web)
{
lblWebTempalte.Text = thisWeb.WebTemplate;
lblWebTemplateID.Text = thisWeb.WebTemplateId.ToString();

int configuratuionId = web.Configuration ;
}
});
}

Using below table you can get the exact site template ID used to create particular site:

Web Template Configuration Template Name
STS#0 Team Site
STS#1 Blank Site
STS#2 Document Workspace
MPS#0 Basic Meeting Workspace
MPS#1 Blank Meeting Workspace
MPS#2 Decision Meeting Workspace
MPS#3 Social Meeting Workspace
MPS#4 Multipage Meeting Workspace
CENTRALADMIN#0 Central Admin Site
WIKI#0 Wiki Site
BLOG#0 Blog
BDR#0 Document Center
OFFILE#1 Records Center
OSRV#0 Shared Services Administration Site
SPS#0 SharePoint Portal Server Site
SPSPERS#0 SharePoint Portal Server Personal Space
SPSMSITE#0 Personalization Site
SPSMSITE#0 Contents area Template
SPSTOPIC#0 Topic area template
SPSNEWS#0 News Site
CMSPUBLISHING#0 Publishing Site
BLANKINTERNET#0 Publishing Site
BLANKINTERNET#1 Press Releases Site
BLANKINTERNET#2 Publishing Site with Workflow
SPSNHOME#0 News Site
SPSSITES#0 Site Directory
SPSCOMMU#0 Community area template
SPSREPORTCENTER#0 Report Center
SPSPORTAL#0 Collaboration Portal
SRCHCEN#0 Search Center with Tabs
PROFILES#0 Profiles
BLANKINTERNETCONTAINER#0 Publishing Portal
SPSMSITEHOST#0 My Site Host
SRCHCENTERLITE#0 Search Center

Web Template IDs:

1 – STS – “windows SharePoint Services Site”, “Team Site”, “Blank Site”, “Document Workspace”
2 – MPS – “Basic Meeting Workspace”, “Blank Meeting Workspace”, “Decision Meeting Workspace”, “Social Meeting Workspace”, “Multipage Meeting Workspace”
3 – CENTRALADMIN – “Central Admin Site”
4 – WIKI – “Wiki Site”
7 – BDR – “Document Center”
9 – BLOG – “Blog”
20 – SPS (OBSOLETE) – “SharePoint Portal Server Site”
21 – SPSPERS – “SharePoint Portal Server Personal Space”
22 – SPSMSITE – “Personalization Site”
30 – SPSTOC (OBSOLETE) – “Contents area Template”
31 – SPSTOPIC (OBSOLETE) – “Topic area template”
32 – SPSNEWS (OBSOLETE) – “News area template”
33 – SPSNHOME (SubWebOnly) – “News Home template”
34 – SPSSITES – “Site Directory area template”
36 – SPSCOMMU (OBSOLETE) – “Community area template”
38 – SPSREPORTCENTER – “Report Center Site”
39 – CMSPUBLISHING (SetupPath=SiteTemplates\PUBLISHING) – “Publishing and Team Collaboration Site”
40 – OSRV (SetupPath=SiteTemplates\OSRV) – “Shared Services Administration Site”
47 – SPSPORTAL – “Corporate Intranet Site”
50 – SRCHCEN – “Search Center”
51 – PROFILES – “Profiles”
52 – BLANKINTERNETCONTAINER – “Internet Presence Web Site”
53 – BLANKINTERNET – “Publishing Site”, “Press Releases Site”, “Publishing Site”
54 – SPSMSITEHOST – “My Site Host”
90 – SRCHCENTERLITE (SetupPath=SiteTemplates\SRCHCENTERLITE) – “Search Center Lite”
6221 – PWA (SetupPath=SiteTemplates\PWA) – “Project Web Access Site”
6215 – PWS (SetupPath=SiteTemplates\PWS) – “Project Workspace”
14483 – OFFILE – “Records Repository”, “Records Repository”

1. Introduction

SharePoint 2010 is The Business Collaboration Platform for the Enterprise and the Web. Previously known by the code name SharePoint 14, SharePoint 2010 marks a significant upgrade to the SharePoint product.

The capabilities of SharePoint 2010 are enhanced even further by being designed to work better with Microsoft Office 2010 and additional products such as Project Server 2010, Visio 2010 and more.

Thought SharePoint 2010 still needs to be explored in a larger way this document simply puts together major changes in SharePoint 2010 as compared to MOSS 2007 along with insights into some of the new features in Microsoft’s simpler yet most powerful product – SharePoint 2010.

2. Visual Interface – Ribbon

The most prominent change to the visual interface is the introduction of the Ribbon. The Ribbon works much the same way as it does in Office 2007 and Office 2010 applications. The buttons on the Ribbon are contextual, meaning you’ll see buttons and options that relate to the task you are currently performing

  • If we access the home page of my Windows Foundation Services homepage we get the following:

  • If we select the “Edit” link we get the following:

  • If we now select the “Share & Track” link we get the following:

  • If we edit the homepage and choose the image we get the following:

  • If we modify the text the ribbon bar yet again changes:

  • When working within Central Administration, for example when trying to modify service applications we get the following Ribbon Bar:

  • Ribbon interface is contextual and customizable which means you will get an extra Library Tools Tab when you are in a SharePoint document library:

· This will allow users to select multiple files and perform checkout / check in actions:

Tip: To look at the full structure of how these items are added to the UI you need to look at the file CMDUI.XML in the 14 hive. This contains the out of the box structure of all the ribbon bar items. You also have the ability to add your own items to the ribbon bar.

3. Web Edit

In SharePoint 2010 we can edit our web page directly and get a live preview which is same as office client. This allows changing common things such as images and text a lot easier than the current one.

  • Here is the comparative snapshot of “Edit page view” in MOSS 2007 and SharePoint 2010
  • For example, if you want to edit the new wiki startup page for a Team Site, you’ll get inline editing options for changing the text and layout of that page, as shown in Figure below:

  • Live preview same as office client:

· Change images, allow you select images from your PC or from Internet Address and also allow you to select resize the image by drag and drop:

4. Ajax / Silverlight

  • Ajax

Another very prominent visual feature is that editing and configuring now happens

using pop-up Ajax windows, as shown in below figure:

Notice that the Ribbon also works in these pop-up windows.

  • Silverlight Web parts

SharePoint 2010 out of the box comes with Silver light web part which allows users to view interactive rich text content.

· Silverlight webpart which allow you to Zoom In/Out the content:

5. Multiple Browser Support

· SharePoint 2010 will support a wider range of browsers

· Out of the box, SharePoint will support IE 7 and newer, Firefox, and Safari as Tier 1 browsers. This means that all features will work in these browsers

· Microsoft also has a set of Tier 2 browsers, where most functionality will still work but without guarantees or support

· IE 6 is on Tier 2 browsers list, so you need to start preparing for a browser upgrade if you haven’t already moved on from IE 6 to later versions

· Mozilla firebox snapshot with SharePoint site

6. Themes

· Themes in MOSS 2007 were a set of predefined CSS themes

· There was no supported way to change them or add new themes

· Themes in SharePoint 2010 are based on Office themes files (THMX files)

· THMX files allow using a single theme file across various Office applications along with SharePoint

· You can also change the themes through the web interface to change fonts and colors, as shown in below figure. You even get to preview the new theme without applying it:

· We can Change SharePoint site’s look and feel using PowerPoint themes:

· PowerPoint themes preview and color with different font sizes:

· Upload the PowerPoint themes you are able to select as SharePoint site theme, then select

color palate display for your preview:

· By clicking apply theme, SharePoint site changes to new theme:

7. Navigation

Getting around from site to site, and from place to place within a site, has received a lot of attention in SharePoint 2010.

· In the case of MOSS 2007 site navigation, a breadcrumb stretched across the top of the page content area. For large site hierarchies, this could become unwieldy as it stretched across the page:

· For 2010, Microsoft replaced it with a folder icon in the tab banner, which produces an indented hierarchical view of your current location:

· In MOSS 2007 lists and libraries selecting a view was accomplished by selecting it from a drop-down list on the toolbar:

· In SharePoint 2010, there is no list toolbar. Microsoft has turned the title panel into an in-site breadcrumb. When looking at a list or library, the last item in that breadcrumb is the name of the current view:

List or library toolbar also has been given lots of attention in SharePoint 2010.

· In MOSS 2007 list toolbar looks like:

· In SharePoint 2010 this has been moved into the Library tab of the new ribbon interface:

· In MOSS 2007 Properties for individual item’s dropdown looks like:

· In SharePoint 2010 this have been moved into the Documents (or other appropriate item’s) tab:

Note: In this case, the individual item dropdown is still there as well.

8. Visio Services

· With SharePoint 2010, Microsoft has taken the Visio Services to the next level by allowing rendering of Visio diagrams and charts within the browser

· Users can now use the out of the box Visio web parts to render the Visio diagrams and bring in the seamless integration of business intelligence between Visio, SharePoint and back end data

· No Visio client Installation is required

· Visio 2010 can take data-refreshable diagrams and publish them to SharePoint for broad distribution to anyone with a web browser

· Visio Services performs data refresh and rendering on the server and delivers up-to-date diagrams in the browser

· The diagram author no longer needs to repost the diagram every time the data changes, and diagram viewers no longer need the Visio client to see the diagram

· Beyond simply viewing the latest version of a diagram in the browser, Visio Services enables interactive dashboards or mash-ups

· You can show a Visio diagram in a web part and define interactions between the diagram and other web parts on a page

· For example, in the image above, selecting a computer shape in the diagram will display detailed information about that computer on the right side

· Additionally, choosing one of the radio buttons on the right side will select the shapes in the diagram that match that criterion.

9. SharePoint Designer 2010

SharePoint Designer 2010 new UI, enhanced modeling capabilities and improved workflow capabilities makes designers and developers to collaborate seamlessly.

· The first thing seen on booting SharePoint Designer 2010 is the Sites Place in the Backstage. From here you can open a site or create a new one :

· After opening a site, you’re launched Onstage to the new user interface of SharePoint Designer 2010:

· The list and libraries gallery shows all of the lists and document libraries in the site:

· The breadcrumb allows for quick drilling down or stepping upward. The Back and Forward buttons act just like a web browser:

· The history button in the breadcrumb is often very handy. Each tab remembers its history, and like a web browser you sometimes want to jump backward multiple steps:

10. Central Administration

Microsoft did a major overhaul on the SharePoint Central Administration site. In MOSS 2007 we have 3 pages to sort through, now we have it condensed onto a single page layout which really makes it a lot easier to find what you’re looking for as everything is laid out in a proper manner.

  • Let’s take a look at the main page:

As you can see in the above screenshot we have a one shot view of our Central Admin. Notice how everything is bucketed properly now to make things easy to find.

  • Application Management:

  • System Settings

  • Monitoring

  • Backup and Restore

  • Security

  • General Application Settings

11. Conclusion

  • With the release of SharePoint 2010 we will see major enhancement in SharePoint technology
  • SharePoint 2010 provides many new and improved administrative features
  • The ribbon UI is a nice contextual addition to the site design in that ribbon tabs appear based on what you are working with
  • The new Web Edit feature allows you to customize a site quickly. If you select a picture, the necessary tools appear automatically in contextual ribbons to help you modify your image
  • The new Silverlight Web Part can be quickly integrated within your site, and it functions well in all browsers that support Silverlight (which include Internet Explorer, Firefox, Safari, Chrome, and soon Opera)
  • There is an impressive set of new rich theming possibilities, with my favorite being the ability to take a PowerPoint theme (a collection of colors schemes you can use across your Word, Excel, and PowerPoint documentation to ensure a single color palette) and apply it to your site with a few clicks
  • Visio Services is an excellent way to share diagram-oriented data (without viewers needing to have Visio), and the fact that they are linked allows you to make changes to the diagram and have those changes go live in real time

And many more still to explore…………………

SharePoint Overview

Posted: January 19, 2011 in SharePoint, SharePoint 2007

Microsoft Office SharePoint Server 2007 is equipped with six key functional areas of features.

These areas are 1.) Collaboration, 2.) Portal, 3.) Enterprise Search, 4.) Enterprise Content Management, 5.) Business Process and Forms, and 6.) Business Intelligence

The Microsoft Office SharePoint Office SharePoint Server (MOSS) build on top of Windows SharePoint Service 3.0 (WSS). MOSS offers two editions Standard and Enterprise.

MOSS.jpg

MOSS 2007 Core Features

CoreService.jpg


Portal
Provides Single Infrastructure for Intranet, Extranet, Internet, a common navigation across multiple sites and include some customized site templates


Collaboration
MOSS allows users to share information and work together and provides a hub


Enterprise Content Management
Content management was previously called Microsoft’s Content Management Server 2002. Now release with MOSS 2007.


Enterprise Search
New to MOSS 2007 ability to find relevant content in many different locations and formats. Search results that respect security permissions.


Business Intelligence
Provides a Report Centre template, Server calculations, web, rendering and Key Performance Indicator (KPI) lists and Web parts.


Business Process
Provides built-in workflow and allow you to create, maintain, and analyze custom workflows, helps you to streamline your collaborative processes.

MOSS-Portal.jpg

Portal

Provides Single Infrastructure for Intranet, Extranet, Internet, a common navigation across multiple sites and include some customized site templates.


Site Template

By default MOSS 2007 come with following categories of templates

Collaboration (Team Site, Blank Site, Document Workspace, Wiki Site, Blog)
Meetings (Basic Meeting Workspace, Blank meeting Workspace, Decision meeting workspace, Social Meeting Workspace and Multipage Meeting Workspace)
Enterprise (Document Center, Record Center, Personalization site, Site Directory, Report center, Search Center and Search center with tabs)
Publishing (Publishing Site, Publishing Site with Workflow, News Site and Collaboration Portal, Publishing Portal and My Site Host)

MOSS 2007 also allow you to create one or more customized template.


News

MOSS Content Syndication feature allows you use Really Simple Syndication (RSS) feeds. Allow you to information from a variety of sources and keep update to date.


My Sites

MOSS My Site is a personal site for individual users. This is considered a top-level site. My Site has two type of pages My Site Page and My Profile. My Site Pages for user when he/she visit personal page. My Profile pages which all user can see. My Site allow user to store documents, link, pictures, alerts and RSS feeders.


Site Directories

Provided aggregated view and help you categories as you wish. SharePoint 2003 by default created site collection when you create sites. MOSS 2007 you can able to list sub sites under site collection. This feature provides seamless integration for Navigation. MOSS 2007 also extended to add other site/page links to portal navigation.

People Search

The People search offers unique way of finding other people not limited to only from department or Position, Location its search people with common interest, expertise in particular topic and from communities (Blog, Wiki). SharePoint provide Web Parts and improved display of the results specifically for finding other people.

Privacy

The privacy and security features allow the user to control, its allow you to view and permissions on the targeted content.

Collaboration

Collaboration.jpg

MOSS allows users to share information and work together and provides a hub


Wiki

Wiki means quick or fast in Hawaiian, The Wiki Site template provides teams to share and discuss information. Repository information that can be quickly and easily editable by team members. The Wiki site include pages, link and recorded history which help to restore deleted content.


Blog

Blog is similar to journal entries, which enable an individual/group to quickly share information among employees. Add insight to a difficult subject area, provide inspiration and guidance, or explain a new guideline or procedure within organization also help people to provide comment on posts and provide links to related sites, photos, and blogs.


Discussion forum

A discussion forum is a web place where allow members to create content and respond to content created by someone. Basically discussions are collected in threads and organized by category such as subject, topic. For example, let say you want to discuss about Corporate development or HR related issue you can create discussion forum and create threads.


Calendar

SharePoint calendars to track events for a team or projects and hold the date and time of specific events, such as meetings, presentations, training sessions, and holidays. MOSS 2007 lets you open both your SharePoint and Outlook 2007 and Export an event to your personal Outlook calendar to receive a reminder for that event


Tasks

Task Lists, which help you assign and track projects for individuals or groups. Project Task are similar to task lists. Project task provide visual or Gantt view with progress bars. Another type task is Issue tracking track the progression of events.


Outlook integration

Its seamless integration which allow you integrate nearly everything you use in Outlook into your My Site in MOSS 2007.

Hope this helps in understaning the SharePoint overview !!

signatureline.htm@Middle

In case you need to update multiple list items in a particular view of a SharePoint list on a single button click, JQuery is the only way which will help you to achieve this:

Here is the final JQuery script that you can add on to Content editor web part. Just change the List name, view name, field name and Site URL in bold and you are good to go !!

<script type=”text/javascript” src=”<JQuery Script.js Location“></script>

<script type=”text/javascript”>

$(document).ready(function(){

$(“#btnPublishAll”).click(function(){

var soapEnv =

“<soapenv:Envelope xmlns:soapenv=’http://schemas.xmlsoap.org/soap/envelope/‘> \

<soapenv:Body> \

<GetListItems xmlns=’http://schemas.microsoft.com/sharepoint/soap/‘> \

<listName>{ACA08888-D3D0-4DDB-81B1-0272D24CD7BA}</listName> \

<viewName>{F1A4C3D8-E849-419B-B082-8E3C18EC1CB8}</viewName> \

<viewFields> \

<ViewFields> \

<FieldRef Name=’SendEmail’ /> \

</ViewFields> \

</viewFields> \

</GetListItems> \

</soapenv:Body> \

</soapenv:Envelope>”;

$.ajax({

url: “Site URL“,

type: “POST”,

dataType: “xml”,

data: soapEnv,

complete: processResult,

contentType: “text/xml; charset=\”utf-8\””

}); // end $.ajax()

function processResult(xData, status) {

//alert(xData.responseText);

var updateEnv;

$(xData.responseXML).find(“z\\:row”).each(function()

{

//Here you get the ID’s of each Item in the List and we can call Update function using these ID’s

//To Display each List items Title in a row

//updateList( $(this).attr(“ows_ID”), “Yes” ) ;

updateEnv = “<?xml version=’1.0′ encoding=’utf-8′?> \

<soapenv:Envelope xmlns:soapenv=’http://schemas.xmlsoap.org/soap/envelope/‘> \

<soapenv:Body> \

<UpdateListItems xmlns=’http://schemas.microsoft.com/sharepoint/soap/‘> \

<listName>{ACA08888-D3D0-4DDB-81B1-0272D24CD7BA}</listName> \

<viewName>{F1A4C3D8-E849-419B-B082-8E3C18EC1CB8}</viewName> \

<updates> \

<Batch OnError=’Continue’ PreCalc=’TRUE’> \

<Method ID=’1′ Cmd=’Update’> \

<Field Name=’SendEmail‘>Yes</Field> \

<Field Name=’ID’>” + $(this).attr(“ows_ID”) + “</Field> \

</Method> \

</Batch> \

</updates> \

</UpdateListItems> \

</soapenv:Body> \

</soapenv:Envelope>”;

$.ajax({

url: “<SiteURL>/_vti_bin/lists.asmx“,

beforeSend: function(xhr) {xhr.setRequestHeader(“SOAPAction”,”http://schemas.microsoft.com/sharepoint/soap/UpdateListItems“);},

type: “POST”,

dataType: “xml”,

data: updateEnv,

contentType: “text/xml; charset=\”utf-8\””

}); // end $.ajax()

//alert(updateEnv);

});

} // end processResult

alert(“Reminders sent“);

}); // end click

}); // end ready

</script>

<input type=”button” id=”btnPublishAll” value=”Send Reminder” />

signatureline.htm@Middle

Though feature installation and uninstallation through stsadm command is simple yet sometimes I miss some partameter or the other and end up with error.. Yeah how foolish.. but cant help it.. !!

Just for my reference here is the syntax 🙂

Install Feature

Syntax:
stsadm -o installfeature -name <feature name> [-force]

Example:
stsadm -o installfeature -name MyFeature -force

Uninstall Feature

Syntax:
stsadm -o uninstallfeature -name <feature name> [-force]

Example:
stsadm -o uninstallfeature -name MyFeature -force