Wednesday, December 30, 2009

Variations in MOSS2007

From Last few months i have been working on WCM features for one of the world class intranet portal. Especially on PageLayouts for publishing article pages,List templates,Site Definition ,Conent Types,WebParts,Social sites from NewsGator and Variations.
In this post I would like to explain how to implement multilingual on MOSS.
1. Open the Site Settings of the top-level site and click on Variation Settings.
2. On the Variation Settings page

3. In the Site Settings page, click now on Variation Labels.
A. Click New Label and create the source label.
B. Enter English as the label name.
C. Set English as the display name.
D. Set the local to English (United States)
E. Check Set this variation to be the source variation.
F. Select appropriate site template
(In the below screencast we are using custom site definition)
G. Click OK.

4. Like that we r using 10 variation Labels

Based on the profile settings and browser settings default locale page would open.User can select required language based on the user control

Wednesday, December 2, 2009

Knowledge Champion on MOSS?

On 18th Nov Winners League'09 held in HCL,Noida.
I have selected as a SharePoint Knowledge Champion and am HCL T2ID SharePoint Trainer also.

I’m really pleased to get the award, as it’s nice to be recognized by HCL T2ID for what I’ve done. I find it useful (to me anyway!) to have a bit of reflection on what I’ve been up to for the last year.

Friday, November 20, 2009

Importance of PortalSiteMapProvider in WCM?

PortalSiteMapProvider provides a nice automatic caching infrastructure for retrieving list data. The class includes a method called GetCachedListItemsByQuery that was used in this test. This method first retrieves data from a list based on an SPQuery object that is provided as a parameter to the method call. The method then looks in its cache to see if the items already exist. If they do, the method returns the cached results, and if not, it queries the list, stores the results in cache and returns them from the method call.
SPQuery strQuery = new SPQuery();
strQuery.RowLimit = 1;
//Retrieve the items for the specified Target location from the Target list
strQuery.Query = "CAML query...";
PortalSiteMapProvider ps = PortalSiteMapProvider.WebSiteMapProvider;
PortalWebSiteMapNode pNode = ps.FindSiteMapNode(web.ServerRelativeUrl) as PortalWebSiteMapNode;
SiteMapNodeCollection pItems = new SiteMapNodeCollection();
pItems = ps.GetCachedListItemsByQuery(pNode, "targetListName", strQuery, web);
//Check if there are items for the specified target location
if (pItems.Count != 0)
{
try
{
//Retrieve the most recently created item for the specified Target location from the list
foreach (PortalListItemSiteMapNode pItem in pItems)
{//TODO}
catch (Exception ex)
{}
}

Monday, November 9, 2009

How to install Visual Studio 2010?

If you are a MSDN subscriber, you can download Visual Studio 2010 from here.
If you want to know how to download and install Visual Studio 2010 watch Channel9 video.
To get you started, head over to MSDN and read some of the walkthroughs on SharePoint Development in Visual Studio 2010.

Tuesday, November 3, 2009

How to Display SAP Preferred Welcome Name?

I got the requirement that based on preferred name the welcome name should come.
Go to Shared Services Administration: SSP1 > User Profile and Properties > View User Profiles
Modify ur preferred name as per screenshot

Refer How to modify profile properites
Go to My site click on details link and modify ur name filed with ur prefer name.

Run the below cmd

After the sync has been performed the User Info table will be updated with the values from the My Profile details.

Friday, October 30, 2009

The site collection could not be restored!!!

I have been doing base line of my application in my VM.I have two site collection in my web application. Each has its own database…
I got the following error while doing restore site collection.

Resolution:
Delete the corresponding DB ,next recreate new DB for your site collection and try to restore again.
It should work

Thursday, October 22, 2009

Creating Custom Page Layouts notes?

Overview of Page Layouts?
Combined with master page to define the rendering of a content page
􀂃 Obtains master page from SPWeb.CustomMasterUrl
• Hosts field controls and Web Part zones
• Complies to the Page Layout content type
• Has an associated content type
􀂃 Dictates which content type the page layout is used for rendering
• Can bind multiple page layouts to content type
• Associated with exactly one content type
Page layouts live within the Master Page Gallery
􀂃 http://servername/_catalogs/masterpage
􀂃 Exists only in the top-level site within a site collection
• Upon site provisioning, page layout added to Master Page Gallery as GhostableInLibrary
􀂃 While living in the Master Page Gallery as uncustomized the page layout on the file system is used
Site Columns & Content Types In Publishing Sites
Site columns & content types play a key role in Publishing sites
• Both are used to define schema for content pages
• Content types must inherit from the Page content type (which inherits from System Page)
􀂃 Go to the following location for basic information
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\PublishingResources\PublishingContentTypes.xml
􀂃 The article page layout with the following content type

• Page layouts must be associated with content types
Why site Column?
Reusable column template for use within lists and content types
• Specify:
􀂃 Name & description
􀂃 Data type
􀂃 Site column group
• Scoped at the site level
􀂃 Available to child sites
• Adding to a list / content type creates a copy.
Create / manage many ways:
􀂃 Browser-based user interface
􀂃 SharePoint object model
􀂃 Feature XML
• Features & object model provide most control
􀂃 Easy to version in virtually all source control systems
􀂃 Highest level of reuse
Creating Site Columns with Features

Wt is the Content Types?
Enable storage of different types of content in
same list or library
• Specify:
􀂃 Name & description
􀂃 Site columns, workflows, event receivers, policies, etc.
􀂃 Content type group
• Scoped at the site level
􀂃 Available to child sites
• Adding to a list creates a copy
Create / manage many ways:
􀂃 Browser-based user interface
􀂃 SharePoint object model
􀂃 Feature XML
Creating Content Types with Features

Activate our feature..

After activation site columns and content types would appear like the below.

How to create a page layout using SPD2007?

Now you need to add some structure to this page. Cheat a bit by copying the contents of the ArticleLeft.aspx page layout and paste them into CusomPageLayout.aspx.
Drag and drop our site columns in a structured maner.Here I just drag n droping….


Wt are the difference b/w Field controls and WebParts?

I will try to explain how to deploy page layout through studio in future posts.
Thanks my WCM guru and Ian for giving support.

Wednesday, October 21, 2009

Error: The path specified cannot be used at this time. (Exception from HRESULT: 0x80070094)

While creating a web application on MOSS2007 environment i have been getting this error.
I didn't find out any errors related to this in Logs file.
Finally i did two steps
1)Restart the SharePoint Timer Services
2)IIS RESET.
Still i am getting this error...
Finally restart the server...
I know the last one is actually ridiculous but it helped.(My box RAM is 1GB,2 users are using this through remotely and N/W IP is slow and etc)
Trust me it should work!!

Wednesday, October 7, 2009

How to get value from resource file and set into a control in a ASPX page?

I have been struggling from past 2 days to fix this issue.
Luckly I got information from
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\ADMIN\CMSIncrementalMigration.aspx at 64 line.

<
It should work.Tx WSS Team...

Sunday, September 13, 2009

Building Multilingual Solutions by Using SharePoint Products and Technologies

Hot to use Microsoft® Office SharePoint® Server 2007 in scenarios where content is managed across different languages. It details most of the functionality provided by Office SharePoint Server 2007 and suggests how to use it to manage multilingual scenarios. It also provides examples for creating custom Web Parts by using Microsoft Visual Studio® 2005 and how to configure and manage them by using Microsoft Office SharePoint Designer 2007, the next generation of Web designer tools specifically designed for SharePoint sites. Microsoft Windows® SharePoint Services 3.0 features and functionality, and how they add value to the end-user experience, are also described.
http://technet.microsoft.com/en-us/library/cc262942.aspx

Tuesday, September 1, 2009

Some of the key areas should know as a MOSS admin

I am giving some of the key points about the daily activities of a MOSS dev.
Reusing Sites
•Save site as template
•Works for all sites except publishing sites
•Default template limit 10 MB
▫Change via command line
▫Change to max of 500 MB
Stsadm.exe –o setproperty–pnmax-template-document-size –pv524288000
•Does not save security

Site Templates Usage
•Save Site as template
•Saved to Site Template Gallery
▫1 per Site Collection
Use Template Globally
•Deploy via command line
•Add Template
Stsadm–o addttemplate–filename YourFile.stp –title YourTitle–description YourDesc
•Delete Template
Stsadm–o deletetemplate–title YourTitle
•List Templates
Stsadm–o enumtemplates
•After running Add/Delete IISResetrequired
List Templates
•No option for deploying globally
Feature deactivation
▫Removes functionality
▫Does not remove data created by feature
Setting trust level
•Options
▫WSS_Minimal(default)
▫WSS_Medium
▫Full (built in .NET Policy)
Code Access Security in SharePoint 2007 for Administrators
SharePoint Web Parts run with a Trust Level which is set in the Web.Config file for the entire Web Application allowing not just one Web Part, but all Web Parts to run with that trust.
The default trust level that the Web Application runs with is WSS_Minimal. Developers will normally request that this is set to WSS_Medium or Full which are the only other configurations possible unless the developer creates a custom configuration file.
Code Access Security – The Architecture
In the Web.Config file for the web application you will see two Trust Level Elements in the Security Policy Element pointing to the two configuration files stored in 12\CONFIG (localdrive:\program files\common files\microsoft shared\web server extensions\12).
Each configuration file configures a number of classes by setting its properties. The classes are illustrated below.

The default Trust is WSS_Minimal which allows most code to run but would block your code from accessing SQL, The SharePoint Object Model, Environment Variables such as Machine Name and DNS etc. To allow these permission you would need to up the trust level to WSS_Medium, Full or to a Custom Policy. However, increasing the Trust Level for the Web Application would allow all Web Parts within that Web Application to run with more permissions. Best practice would be to create a custom policy and listing your web part in the file to run with the permissions it needs.
To create a new set of permissions you need to create a new file such as Custom_WSS_Medium.config and then make SharePoint aware of the file by pointing to it in the Web.Config for the Web Application. You can merge the settings in WSS_Minimal and WSS_Medium in your new Custom File to create your own permission set. It is advised not to change the original files as Microsoft may alter these files during the application of a Service Pack.

Each custom Web Part should be Strongly Named by the Developer which provides the DLL file for the Web Part with a Public Key. You can extract the Public Key using the SN tool provided by Visual Studio.NET: sn –Tp filename.dll
This will return the Public Key BLOB and the Public Key Token for the dll. Normally this would be a developer role as it requires Visual Studio.NET.

The Public Key Token is used in the Safe Controls entry in the Web.Config for the Web Part (Assembly) to register it as a Safe Control within the Web Application. The Public Key can also be used in the custom Trust Level Configuration File to give one particular Web Part or a group of Web Parts Full Trust whilst still leaving the Trust Level set to a minimal set of permissions.
To list a Web Part with Full Permissions within your Web Application whilst still retaining a WSS_Minimal permission set for all other Web Parts follow these steps:
1. Make a copy of the WSS_Minimal.Config file from the 12\Config folder and paste it into the same folder renaming it to Custom_WSS_Minimal.Config.
2. Edit the Custom_WSS_Minimal.Config file with an XML editor such as Visual Studio.NET or NotePad.
3. Obtain the Public Key Token and Public Key Blob for the Web Part assembly that you want to deploy using the following command: sn –Tp filename.dll.
4. Create a new entry in your Custom_WSS_Minimal.Config file for your Web Part:
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="My custom Strong name"
Description="This code group grants code signed with the “My Custom
Strong Name” strong name full trust.">
PublicKeyBlob="00240000048000009400000006020000002400005253413100040000010001009BC5B83BBD16C6ABB44BAB156CF9C55D1D67078CE98CE7B423C72EE91647BD73241BFC700192ED32481CA7CF06C205BD4C7BEDA3D4FA5ED5689AA23BC1C2118EBFA6018238AD5B4DA420FB335E6BECA9EDE5E3F53C4BFFF266411445AE7B1DDD14FB0F01C075589770EABD4B1D1A70F731C098F22EDE9838CC9783C73451B5"/>

5. Create a new TrustLevel element for your config file in the Web.Config called Custom_WSS_Minimal that points to your custom file in the 12\config folder.
6. Set the Trust Level of the Web.Config to Custom_WSS_Minimal
7. Recycle the Application Pool or run IISReset
8. Deploy & Test your Web Part.

Wednesday, July 29, 2009

Installation of Sharepoint2010

Today i installed new version of Sharepoint in my testing box.
I am trying to get the new architectural changes in 2010.

Wednesday, July 15, 2009

SharePoint 2010 SneakPeek!

Now SharePoint 2010 Era has Began!
SharePoint 2010 Products and Technologies developer documentation dropped and is available for download here:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=94afe886-3b20-4bc9-9a0d-acd8cd232c24
SharePoint 2010 sneak peaks are now available here:
http://sharepoint.microsoft.com/2010/Sneak_Peek/Pages/default.aspx

Thursday, June 18, 2009

How to enable including content checkbox in Issue Tracking template?


I created a issue tracker list called Krishna

I am able to click “Include Content ” check box .
Now I am going to create a list with “Naveed” list template.

Solution:
Go to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\IssuesList\ListTemplates\Issues.xml
Replace DontSaveInTemplate="TRUE" like the below and do iisreset.

Have a nice day...

Friday, June 12, 2009

How to resolve "Report Server has encountered a SharePoint error. (rsSharePointError)"

Unfortunately i have faced this error while integrating SSRS2005 with MOSS2007.
I googling a lot n finally i configured all the options once againg through RSCongfiguration Manager.

I have the issue with email settings.

U need to configure email setting properly.Other wise u would get the following error.

"An existing connection was forcibly closed by the remote host at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) "

Once u did every thing properly u should Subscription through email.

Tuesday, May 12, 2009

Creating the SharePoint Silverlight Slideshow

I have the requirement like provide the training for new joinees in our organization.After finishing the slides the user need to attend the test.Bcz due to Microsoft network access permission associate should finished 3 exams.
For this requirement i suggest to choose the following ways.
The following link is outofbox feature by WSS3.0.

The following has developed using Silverlight.

For more details use the following link
http://www.wssdemo.com/Blog/archive/2009/01/10/Creating-the-SharePoint-Silverlight-Slideshow.aspx

Thursday, May 7, 2009

Patterns and Practices -> SharePoint Guidance

A well documented guidance around SharePoint Products and Technologies.
You can read more on the guidance here:
http://msdn.microsoft.com/en-us/library/dd203468.aspx
This guidance discusses the following:
-Architectural decisions about patterns, feature factoring, and packaging.
-Design tradeoffs for common decisions many developers encounter, such as when to use SharePoint lists or a database to store information.
-Implementation examples that are demonstrated in the Training Management application and in the QuickStarts.
-How to design for testability, create unit tests, and run continuous integration.
-How to set up different environments including the development, build, test, staging, and production environments.
-How to manage the application life cycle through development, test, deployment, and upgrading.
-Team-based intranet application development.

Thursday, April 30, 2009

How to write Custom Audit Entries in WSS3.0?

Last year i attend Ted's training on WSS3.0. He given all Lab and whitepapers which are published by him.I am reading one by one.
One article on Audit logging is awasome.
I would like to post the summary of the article.
Audit logs detailing events that track data such as which users viewed and updated records and documents, and when these events occurred.
Microsoft Windows SharePoint Services 3.0 (WSS 3.0) and Microsoft Office SharePoint Server 2007 (MOSS) provide support for auditing user access to pages, content, and documents, and includes auditable events such as viewing and updating.
While WSS provides the basic auditing mechanisms, MOSS adds value by supplying an administrative user interface that allows auditing at the site collection level. MOSS goes even further and enables auditing at the list or document library level, and control over what types of events should be recorded in the audit log. MOSS also provides a reporting function that uses Microsoft® Office Excel® workbooks to display and keep records of audit logs. Therefore, MOSS allows you to take advantage of the WSS auditing support without having to write any custom code.
// turn on auditing flags to a list
SPSite siteCollection = new SPSite("http://LitwareServer1");
SPWeb site = siteCollection.OpenWeb();
SPList list = site.Lists["Proposals"];
list.Audit.AuditFlags = SPAuditMaskType.View
SPAuditMaskType.Update
SPAuditMaskType.Delete;
list.Audit.Update();
The code is written to read the audit log of the current site collection by creating an SPAuditQuery object.
SPAuditQuery wssQuery = new SPAuditQuery(siteColl);
SPAuditEntryCollection auditCol = siteColl.Audit.GetEntries(wssQuery);

As you examine the implementation of the code that reads information from the WSS audit log, observe how it retrieves user names. The WSS audit log tracks user IDs but not user names. After you have obtained a user ID, you can retrieve the associated user name using the GetByID method on the SiteUser collection, which is exposed as a property of the top-level site. Make sure you use the SiteUsers collection; do not confuse this with the User collection, which does not provide the same results.
string GetUserNameById(int UserId, SPWeb site) {
return site.SiteUsers.GetByID(UserId).Name;
//return site.Users.GetByID(UserId).Name; - YOU CANNOT USE SPWeb.Users collection here

}

Writing custom audit entry
item.Audit.WriteAuditEvent(SPAuditEventType.Custom, "CustomViewAuditEvent", "");

Friday, April 24, 2009

How to create your own custom STSADM Command?

I have the requirement like to extend STSADM command.
My ECM guru has posted excellent piece about this topic.
There are two steps:
1) Implement the ISPStsadmCommand interface
2) Create an XML file in the 12\CONFIG folder that describes your commands
ISPStsadmCommand interface consists following 2 methods .

The full story was written by Holiday


Thursday, April 23, 2009

WITH (NOLOCK) directive in SQL

I am poor at DataBase level. luckly i have a requirement to work on SSRS2005. I used to see the existing reports , queries n i found new directive called WITH(NOLOCK) .
I had discussed with my RM n has cleared my doubts and explained senario(s) n Tips.
I would like to explain the summary .
"Same kind of reports r accessing multiple users in the bussiness hours.If i lock the records while retiving reports the remaining users should wait untill the task completion.Insted of that we r prefering WITH(NOLOCK) directive before a table in a query"
The following link is very useful for me.
http://blogs.neudesic.com/blogs/phil_scott/archive/2005/12/05/11.aspx

Wednesday, April 22, 2009

CAML.NET IntelliSense for SharePoint

As a MOSS Hunter i know the CAML very well. But still i have been facing littile bit trouble on CAML usage.
But last week i have attended ECM training from Tedpattison. John has Announced the CAML.NET IntelliSense project.
Using this installation in our box our daily task will be easy.

Tuesday, April 21, 2009

SharePoint Designer 2007 - It's FREE!

In case you haven't heard, Microsoft Office SharePoint Designer 2007 is now available as a FREE download.
Check it out from Asif.

Longitude for sharepoint

My best friend Sanjay has been working on Longitude. I go through his blog and find some cool stuff on MOSS Development.

Tuesday, April 14, 2009

How to increase the bandwidth of the Web-enabled forms?

Ans: Set Form Session State to Form view
Goto Central Administration > Application Management > Configure InfoPath Forms Services at the bottom sharepoint given the follwoing option

How to ensure the data from web services is accessible into InfoPath 2007 Browser Forms

I am searching that how to enable the web service proxy for user forms. I got the idea once i red the following post.
http://blogs.msdn.com/infopath/archive/2006/10/02/Data-Connections-in-Browser-Forms.aspx

How to migrate of a MCMS 2002 to our MOSS 2007 environment?

As per my MCTS prepartion for Configuration i go through some of migration tool.
We need to migration tasks that need to be completed. For this purpose in CodePlex some tools r avilable. And one fine article on MSDN. Go through the following link.
http://msdn.microsoft.com/en-us/library/aa480227.aspx

Friday, April 10, 2009

How to deploy SSRS report into MOSS environment?

I got the chance to work on SSRS.I developed Emp Details Page Template and Leave Tracking details for one of my stakeholder. The data is storing in a Data Base Table. Using these data I am going to generate various reports. So as per my first attempt I did one sample report and I would like to explain how to deploy into Sharepoint environment.

Once i deploy the report it has show like the following shot.

Thursday, April 9, 2009

Random Question using Survay's in WSS3.0?

For my Quiz application my requirement is getting random question from a survay list in WSS3.O. I google lot and met few MVPs. But i didn't get a +ve reply.I would like to give one of the MVP Mr SS.Ahmed's reply.

RenderPattern Element in WSS3.0

My Stakeholder has one of the tricky requirement on DisplayPattern .
I created a Quiz application . In that I have been tracking the results in a list. The list contains the following datails.
1) Who attend the exam.
2) Wt is percentage he/she got.
3) Wt time.
4) Result.
The issue is once the user got failed the value should be in red color.

I dig a lot and i found one sample from Ted Pattison's code. I am giving a sample which i did in my previous app. But that is a custom field.

Thursday, April 2, 2009

WCM Training

I got the chance to attend WCM Traning from Andrew Connell.This was Awesome.I learned lot from this cource.

Understanding Field Controls and Web Parts in SharePoint Server 2007 Publishing Sites

I red a new article which was Published by Andrew Connell
I prepared a small notes on this article....
The CEWP doesn't store version history, it doesn't participate in any publishing approval workflow and it does store absolute URLs rather than relative URLs. Even if you enter a relative URL into the editor, it will be converted to an absolute URL. The rich text editor that the Publishing HTML field type is tied to does not convert relative URLs to absolute URLs.
What are the differences between Web Parts & Field Controls and when to use them?
Field controls differ from Web Parts in two fundamental ways: who has control over the layout and structure of the page, who has control over the content on the page, and where the content is stored.
Web Parts
Beginning with Windows SharePoint Services 3.0 and Office SharePoint Server 2007, the ASP.NET 2.0 Web Part framework manages all of this on behalf of Windows SharePoint Services. This means that Windows SharePoint Services no longer controls which Web Parts are on the page or their locations on the page, and does not manage the content stored in the Web Parts. The content and configuration data for Web Parts, known as personalization data, is stored in the ASP.NET 2.0 personalization data store. In Windows SharePoint Services 3.0 sites, this personalization data store is kept in the SharePoint content database.
It is important to understand how Web Parts work within ASP.NET 2.0 and Windows SharePoint Services 3.0 sites. When a Web Part is added to a page in a SharePoint site, ASP.NET 2.0 inserts a block of XML into the Web Part zone that notifies ASP.NET 2.0 about which Web Part to load and what data to assign to all of the Web Part's public properties. When the page is requested, the ASP.NET 2.0 Web Part framework examines this XML to find the Web Part to load (by assembly and class), loads the control, and sets the values of all the public properties. Finally, the page rendering process renders the Web Part.
This XML data is stored in the ASP.NET 2.0 personalization data store—not with the page itself. This means the personalization data is tied to the page's URL and user context, not to the page or version of the current page (as in a SharePoint Server publishing site).
The advantage to using Web Parts for content is that you can personalize the content on a user-by-user basis if the publishing site has a way to uniquely identify users, such as by requiring a logon.
Field Controls
A field control pulls data (in display mode) from a particular column in a list item and writes back to that column in edit mode. Pages in a Publishing site are stored as items in a list; the Pages list. Because they are in a list, they can leverage all the benefits a list has to provide, but visioning & history is the most important here. When a developer places a field control on a page layout, they have the ultimate control of where it is placed on the page.
Field controls provide developers and designers a higher level of control over content pages than Web Parts do. Content owners can only add and manage content within field controls. They cannot move field controls on the page or override the settings set by developers.
What is the significance?
• Consistent lookand feel (A corporate brand)
• Structured organization of contentand a versioned and/or historical record of the content.
If structure and history is important on your site, you should ONLY consider field controls for your content. If you want to have a more relaxed authoring environment where structure & history isn't important, Web Parts are better.
To summarize: the content in Web Parts is not versioned and there is no history, but the content in field controls is versioned & a history is retained
And My Guru explained how to add Safecontrol entries into Web.config file ….

Thursday, March 26, 2009

Renaming a SharePoint 2007 server

Hi today i configured my MOSS Server with 4GB RAM.But unfortunately i found the mistake that the formate of my system name.I have expected prob may occure.I renamed my system name.... Fuck....

Now i am unable to acess my CA site.

My face is blank.....

After Googling i found one wonderful aricle.

http://blog.sqlauthority.com/2008/09/09/sql-server-error-fix-sharepoint-stop-working-after-changing-server-computer-name/


Finally got it.
Tx Pinalkumar

Friday, March 20, 2009

How to Create a quiz application using Survey template in SharePoint 2007?

Using "Survey" list template, I recently created a quizzing application. In my application I have a list with Question s, choices and answers. Using some object model I was able to make use of the SharePoint survey list template to organize a quiz within our organization.
I inherit some of the functionality from the following link. Sridhar has gave a start up idea for my requirement.
http://blogs.msdn.com/sridhara/archive/2008/12/15/howto-create-a-quizzing-application-with-sharepoint-2007.aspx
Using his tool I am able to create a Demo Exam to attend the employee. I am imitating the permissions to the lists from Sridhar.
Well, in the code, the Read/Write Securities for the survey list are set to 2, which means "Users have Read access only to items that they create" and "Write only my items" respectively. However, once a user answers all questions and submits the quiz, he/she can ‘t attend the test again.
Here the results are declare immediately.
The results are storing in a separate list . In that I am maintaining Employee Name, Date of attempt, Score. For this I am using ItemAdded Event handler.
I am creating a feature for this.

Tuesday, March 17, 2009

How to add People picker control into Sharepoint Page Template?

I have a requirement that add a people picker control into on page template.Why means my input values will be store in DB Custom Table.Once get all details i can get reports using SSRS.


For adding People picker control u have to register the following dlls in my aspx page template.

Monday, March 9, 2009

How to check the authorization to load a page ?

I achived to check the authrization of user follwoing way.

public static bool IsUserExistsInGroup(string aGroupName, SPWeb aWeb, string aUserName)
{
SPGroup userGroup;
SPUser user;
bool userExists = false;
try
{
userGroup = aWeb.Site.RootWeb.SiteGroups[aGroupName];
try
{
user = userGroup.Users[aUserName];

if (user != null)
{
userExists = true;
}
}
catch
{

}
}
catch (Exception ex)
{
throw ex;
}
return userExists;
}

Sunday, March 8, 2009

How to develope Page Templates in MOSS?

I got the chance to work on few Page Template like EmployeeEntryForm.aspx,CertifaicationDetails.aspx etc.I would like to attach a sample screenshot.

I am ataching a screen shot How to attach .cs with my aspx page.

Wednesday, January 28, 2009

How ASP.NET drop down controls Filter the Data View in SharePoint Designer?

To begin, create two lists in the browser: Categories with a field of CategoryName and Products with a field of CategoryName as well (I use a Lookup field type for simplicity, but it doesn't have to be - this code does a simple string compare). Then fill out the lists so you have more than one item in each.

This tip also assumes you already know how to open your Site in SPD and you have created a new page. I realize it is a lot of steps, but I believe they are pretty straight forward as you perform them...

Place your page into design view
Click Task panes :: Data Source Library
Click the data source called Categories
Click to Insert Data Source Control
If prompted, click “Yes” to display the control
Place insertion point below this control
Click Insert :: ASP.NET Controls > Drop Down List
Click the Smart Panel :: Choose Data Source...
Choose the Data Source (for example, SPListDataSource1)
Tell it to display "CategoryName" (or the field that contains your category name)
Make its value "CategoryName"
Click OK
Click to select the dropdownlist control
Click the Smart Panel :: AutoPostBack == True

For getting a default value like "Please select a item..." ?
1. Select the control
2. click on Task Panes > Tag Properties
3. change the AppendDataBoundItem to be True
4. Click the Smart Panel > Edit Items
5. click "Add"
6. type "Please select a item..." for the Text property
7. Click "OK"

Drag and drop the Products list onto a page to create a Data View
Clck the Smart Panel :: Edit Columns to add and remove the columns you want to display
Click Data View :: Filter
Create the following filter:
Field: CategoryName (or the field that contains your category name)
Comparison: Equals
Value: [Create a new Parameter]
Param Name: Param1
Source: Control
Control ID: DropDownList1
Default: Beverages
Click OK
Click OK again
Save the page
Preview in the browser
Make a change to the DropDownList control