Saturday, August 30, 2008
What is Code Access Security in SharePoint 2007
These days, you can't pick up a blog without reading about the need for the customizing SharePoint as per need of organization. Most of these are done via setting configuration and some time by custom programming too. We as programmer need to think carefully before tweaking the setting for WSS_Minimal and WSS_Medium trust levels. In exceptional cases a third configuration ‘Full’ can also be set. Let me warn you here that this may have serious implications and you may not be able to convince the security group to deploy it in production boxes.
Earlier the security were declared in the web.config file, but that doesn't seem to be the case any more. You will find two pointers to config file of folder localdrive:\program files\common files\microsoft shared\web server extensions\12. The classes are configured for code access level. For example you will find out that SqlClientPermission are not allowed in WSS_Minimal but is allowed in WSS_Medium trust.
Wednesday, August 27, 2008
Extending OCS
Tuesday, August 26, 2008
STSDEV: Sharepoint Code generator
http://www.codeplex.com/stsdev
Monday, August 25, 2008
Find Permission and perform action based on Admin access
SPWeb thisweb = SPControl.GetContextWeb(Context);
isAdmin = thisweb.DoesUserHavePermissions(SPBasePermissions.ManageLists);
if (isAdmin == true)
{
// todo
}
Sunday, August 24, 2008
Setting URL of link Programatically
SPListItem newLink = list.Items.Add();
SPFieldUrlValue value = new SPFieldUrlValue();
value.Description = "test";
value.Url = "http://www.microsoft.com/sharepoint";
newLink["URL"] = value;
newLink.Update();
Diaplaying Link field in ItemStyle
< name="DisplayTitle">
< name="OuterTemplate.GetTitle">
< name="Title" select="@URL">
< name="UrlColumnName" select="'URL'">
< /xsl:call-template>
< /xsl:variable>
< name="LinkTarget">
< test="@OpenInNewWindow = 'True'"> _blank< /xsl:if>
< /xsl:variable>
< id="linkitem" class="item">
< class="bullet link-item">
< name="OuterTemplate.CallPresenceStatusIconTemplate">
<>
< name="href">
< select="substring-before($DisplayTitle,', ')">
< /xsl:value-of>
< /xsl:attribute>
< name="title">
< select="@Description">
< /xsl:value-of>
< /xsl:attribute>
< select="substring-after($DisplayTitle,', ')">
< /xsl:value-of>
< /a>
< /div>
< /div>
< /xsl:template>
Saturday, August 23, 2008
Surveys Add questions.
Surveys Add questions programatically
SurveysSPListTemplate objTemplate = currentWeb.ListTemplates["mySurvey"];
Guid objGuid = currentWeb.Lists.Add("mycode", "survey", objTemplate);
SPList objSurvey = currentWeb.Lists["mycode"];
//Let’s add questions
StringCollection strQuestions = new StringCollection();
string strQuestion = "What is your favrate colour?";
strQuestions.Add("Red");strQuestions.Add("Blue");
strQuestions.Add("Green");
objSurvey.Fields.Add(strQuestion, SPFieldType.Choice, true, false, strQuestions);
objSurvey.AllowMultiResponses = false;objSurvey.Update();
Friday, August 22, 2008
Preformance Optimization in SharePoint Server 2007
1) Delayloading of core .js
You can load it conditionally. Optimizing core.js
2) Browser Cache Settings
You can look here
Sample event handler to set field as primary field
see here
Thursday, August 21, 2008
Programmatically retrieve the items in a list based on the current user
Programmatically rename a file inside a SharePoint document library
Wednesday, August 20, 2008
Find User Name
Find User Name
string loginName = SPControl.GetContextWebContext).CurrentUser.LoginName.ToString();
Tuesday, August 19, 2008
How we can retrieve Discussion Topics (items) from a Discussion List ?
Move file in event handler causes "No item exists" Error
Ckick here
How To: Customizing alert emails using IAlertNotifyHandler
Click here
Monday, August 18, 2008
AllowUnsafeUpdates
Make a call to SPUtility.ValidateFormDigest() before doing anything esle. This will ensure that the post request is validated (that it is not a cross-site scripting attack) and after that you will not have to worry about AllowUnsafeUpdates as this will be marked as true.
more info
here
Sunday, August 17, 2008
How to add a new item to a list
{
using(SPWeb myWeb = mySite.OpenWeb())
{
SPList contactsList = myWeb.Lists["Contacts"];
SPListItem mynewItem = contactsList.Items.Add();
mynewItem ["First Name"] = "Hament";
mynewItem ["Last Name"] = "Verma";
mynewItem .Update();
}
}
Saturday, August 16, 2008
Faceted Search
http://www.codeplex.com/FacetedSearch
Some of the advantages listed are
1) Grouping search results by facet
2) Displaying a total number of hits per facet value
3) Refining search results by facet value
Hidden User Information List
http://SiteA/_catalogs/users/simple.aspx
you will find the list of all user :)
Custom Site Definition
http://mossbaba.blogspot.com/2008/03/custom-site-definition.html
Iterating all lists in the site
{
using(SPWeb myWeb = mySite.OpenWeb())
{
string Alllink= "";
foreach(SPList list in myWeb.Lists)
{
string Alllink= ""
+ list.Title + "("+list.Items.Count+")
";
Alllink+= Alllink;
}
}
}
Friday, August 15, 2008
Change all items in the list
{
using(SPWeb myWeb = mySite.OpenWeb())
{
SPList contactsList = myWeb.Lists["Contacts"];
foreach(SPListItem existingItem in contactsList.Items)
{
existingItem["E-mail Address"] = "test"
newItem.Update();
}
}
}
how to get item's properties
{
using(SPWeb myWeb = mySite.OpenWeb())
{
SPList mycontactsList = myWeb.Lists["MyContacts"];
foreach (SPListItem contact in mycontactsList .Items)
{
string contactLastName = contact["Last Name"].ToString();
}
}
}
how to get the object for a list whose name is known
{
using(SPWeb myWeb = mySite.OpenWeb())
{ SPList contactsList = myWeb.Lists["nameoflist"];
}
}
Geeting reference to a site
using(SPSite mySite = new SPSite(http://mysite))
{
using(SPWeb myWeb = mySite.OpenWeb())
{
}
}
Wednesday, August 13, 2008
SharePoint 2007 Maximum Limitations
Site Name 128 characters
Site URL 255 characters
Display name 128 characters
Connection string 384 characters
Email address 128 characters
Version numbers 064 characters
Virtual Server Friendly Name 064 characters
SQL Database Name 123 characters
More here
Auto refresh sharepoint page...
See comments to find out how to overcome the message "need to post data"
http://drewmace.blogspot.com/2008/02/auto-refresh-sharepoint-page.html
Monday, August 11, 2008
Programatically creating 1000 of folder with unique permission
Permission for SPSecurityTrimmedControl
'<' SharePoint:SPSecurityTrimmedControl PermissionsString="AddAndCustomizePages, ManageLists" runat="server"'>'
'<'/SharePoint:SPSecurityTrimmedControl'>'
The content within the control will be shown based on users access level.
The permission are like..
AddListItems
EditListItems
DeleteListItems
ViewListItems
ApproveItems
OpenItems
Zac Smith has listed all of them here
Friday, August 8, 2008
Updating UserProfile Property of type ChoiceList
PropertyCollection props = m_mngr.Properties;
Property location = props.GetPropertyByName("CountryList");
Location.MaximumShown = Location.MaximumShown +1;
more
How to set SPFolder.WelcomePage property?
SPWeb web = site.OpenWeb();
SPFolder folder = web.RootFolder;
folder.WelcomePage = "TestWiki/Hello1.aspx";
this will work more
How to customize your SharePoint site?
Updates are currently disallowed on GET requests. while creating a WSS site
SPGlobalAdmin globalAdmin = new SPGlobalAdmin();
Context.Items[SPGlobalAdmin.RequestFromAdminPort] = true;
Page.RegisterHiddenField("__REQUESTDIGEST", globalAdmin.AdminFormDigest);
more
Wednesday, August 6, 2008
Site Defination viewer
http://blogs.msdn.com/maximeb/archive/2008/02/16/site-definition-viewer-a-windows-net-2-0-tool-to-read-site-definition-and-features-configurations-version-0-1.aspx
26 feb 08
Tuesday, August 5, 2008
Some cool functionalities of UserGroup.asmx webservice
How we can work with output cache programmatically ?
Monday, August 4, 2008
Make the "Overwrite existing file" check box to be unselected by default in MOSS 2007
more
"Invalid data has been used to update the list item. The field you are trying to update may be read only" - when updating BEGIN - END fields in an eve
more
https:// in which case 7 needs to be 8 */
int startCount = 7;
/* this is to rip-off http:// unless you are using https:// in which case 7 needs to be 8 */
int index = goodUrl.IndexOf("/",startCount,goodUrl.Length-(startCount+1));
goodUrl = goodUrl.Substring(0,index);
more
Changing Quota Template Names in SharePoint V2
SPGlobalAdmin globalAdmin = new SPGlobalAdmin();
SPGlobalConfig globalConfig = globalAdmin.Config;
SPQuotaTemplateCollection templates = globalConfig.QuotaTemplates;
foreach(SPQuotaTemplate template in templates)
{
if(template.Name == “Personal Site”)
{
template.Name = “Modified Personal Site”;
template.Add(template);
Console.WriteLine(“Quota Template name changed!!”);
break;
}
}
more
Getting Event Handlers developed in VS.NET 2005 to work with SharePoint V2
more
FullTextSqlQuery with QueryText length greater than 4096 characters throws ArgumentOutOfRange exception.
Add/Update "sealed" properties in SharePoint lists
more details here
Programming navigation in WSS 3.0
SPNavigationNode newNode1 = new SPNavigationNode("MS TechNet", "http://technet.microsoft.com", true);
SPNavigationNode newNode2 = new SPNavigationNode("SharePoint SDK Online", "http://msdn.microsoft.com/sharepoint", true);
more details
The security validation for this page is invalid" error when updating objects through SharePoint object model
Project to customize the small search control in SharePoint 2007
more
What permissions are behind the permission levels (roles) in SharePoint
more details
FBA and User Display Names
{
SPUser user = web.AllUsers[loginName];
user.Name = displayName;
user.Email = email;
user.Update();
Page.Response.Redirect(web.Site.Url.ToString());
}
more details
Organization Hierarchy a Mess?
more details
Using Post Caching Substitution in SharePoint 2007 Web Parts
more details
How to download files from a SharePoint document library remotely via Lists.asmx webservice
more detail
Make BDC work with FBA
Sunday, August 3, 2008
A way of hiding ListViewWebParts in all pages of SharePoint site in a single shot
more detail
create publishing pages in portal sites programmatically and add it into a specific folders inside the Pages library
How to debug inline code of custom layout pages
How to show task creator's & modifier's name instead of "System Account" in the Task Library
How to enable users to download infected files when a download scan that is performed by using anti-virus software is disabled?
Creating a read-only field with default value in a SharePoint list
publishing portal pages : "Value does not fall within the expected range"
SPSecurity.RunWithElevatedPrivileges - an important point while using it in web context
Rename a File in a SharePoint document library through object model
How to take out the dlls from GAC ?
work around for customization of core.js
implement a custom mechanism to delete the audit entries in your SharePoint site
Problem with PeopleEditor
more
Update email addresses of all users
more
Retrieving the metadata information of a current approved version of a list item
A requirement that you want to add some webparts while creating a new site
Issue with the WebPartManager class while adding webparts dynamically to a specific webpart zone
more
How we can create documents inside a document library based upon the content type’s document template?
more
Friday, August 1, 2008
Attempted to read or write protected memory
Event Id: 6398
Event Source: Windows SharePoint Services 3
The Message text contains: "Microsoft.Office.Server.Administration.
ApplicationServerAdministrationServiceJob" and "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
6482, 7076
Microsoft has released fix for this
Wednesday, July 23, 2008
Bog in the language you dont know.
http://sharepoint.microsoft.com/blogs/LKuhn/Lists/Posts/Post.aspx?ID=56
Sharepoint and word integration.
I do think MS Sharepoint 2007 holds some real promise, especially with the degree it integrates with Word. I also know that a key is going to be to develop good document hygiene practices and training our people to use them. Users are going to have to rethink how they communicate and collaborate.
http://www.lawtechtv.com/home/
Log Shipping: Limitations and Constraints of SharePoint
more infor here
Sharepoint Alternate Access Mapping.
more information here
Sunday, July 20, 2008
Enabling Advance search contains option
The may be various reason to enable these options. The required additional resource can be justified by the benefot provided by these option. Some time "We need this option" can come as a command.
The advance search site is the place where you will get the option to enable same. You must have adminstrator privelages to do same. You have to modify the webpary and expand all properties. Find "Option Name=AllowOpContains" and change the Value to "True" <name=allowopcontains" value="">
<name=allowopcontains" value="True">
If you dont find these option you can create same.
Saturday, July 19, 2008
SharePoint and Microsoft Project Server
4 april 08
Coldfusion Sharepoint integration
Friday, July 18, 2008
Wordle confirms sharepoint domination
Graphics play a important role in Wordle. These are so good looking. JUst by seeing in them we can get intresated.
Quickly we can find out the pulse of the web site. The key theme which is going around in the sight. No longer we have to go in details and then come to conclusion about the theme of the web site.
ONe of the blog reports that sharepoint in far ahead then IBM and other leading competitors...
Wednesday, July 16, 2008
Silverlight and sharepoint.
MOSS already has blue print of same. read more here
Displaying help in MOSS 2007
click link to modify webpart. Go on advance section under tool pane. You will see Help URL and Help Mode. This works only under chrome.
Tuesday, July 15, 2008
Sharepoint calender vs Personal calender
MOSS keeps team updated.
Monday, July 14, 2008
Team site having a distribution list
Thursday, July 10, 2008
Out look for offline capablites
Saturday, July 5, 2008
Task notification
MOSS Content Deployment Wizard
here
http://sharepointnutsandbolts.blogspot.com/2007/12/introducing-sharepoint-content.html
Thursday, July 3, 2008
Programming Sharepoint.
Programming sharepoint.
1. simple version of handler page code that calls implementations of the IHtmlTrLoadBalancer and IHtmlTrLauncher interfaces, converts a document by using the CHICreateHtml method, and writes the output of the conversion process to a file. here
Wednesday, July 2, 2008
Thursday, June 26, 2008
MOSS used successfully
http://www.microsoft.com/casestudies/search.aspx?ProTaxID=1902
Monday, June 23, 2008
Office SharePoint Server Licensing
http://www.harbar.net/archive/2007/04/04/Office-SharePoint-Server-Licensing.aspx
http://office.microsoft.com/en-us/sharepointserver/FX101865111033.aspx
Actual prices
Why sharepoint is gaining
To a certain extent, the excitement about SharePoint has really been a reflection of disillusionment with existing collaboration, content management, and portal products. The people that are interested in SharePoint - despite already having incumbent alternatives - see at first glance a product that may finally provide easy-to-use, inexpensive, web-based collaborative solutions.
23-mar-07
Saturday, June 21, 2008
SharePoint Governance
http://www.sharepointjoel.com/archive/2008/04/21/sharepoint-governance-and-burton-group-workshop.aspx
Make sure your deployement of sharepoint dont become nightmare.
Multitenant version of Sharepoint.
Monday, June 16, 2008
Sharepoint Gear up and ROI
click here
Office is the bread while SharePoint is the butter
"the corporate enterprise market is Microsoft's kitchen, and Office is the bread while SharePoint is the butter that makes everything "
read more here
Monday, June 9, 2008
Protocols between Microsoft Office SharePoint Server 2007 and Microsoft Office client applications
Protocols between Microsoft Office SharePoint Server 2007 and Microsoft Office client applications;
• Protocols between Microsoft Office SharePoint Server 2007 and other Microsoft server products;
• Protocols between Microsoft Exchange Server 2007 and Microsoft Office Outlook;
• Protocols between 2007 Microsoft Office system client applications and other Microsoft server products.
more here
Saturday, June 7, 2008
Sharepoint Services Decoupled from Windows Server 2008
http://blogs.zdnet.com/microsoft/?p=883
Sounds like the fetures update/reales will be far more :-)
Friday, June 6, 2008
Feature wish list.
Thursday, June 5, 2008
Sharepoint 2007: Next Revolution
3-4 year down the line every body will be using it and will wonder how was life before sharepoint.
Monday, May 19, 2008
Architecting Business Application in Sharepoint world
Why Sharepoint?
The capablity of the application to evolve with the business requirement through configration only is superb. The benefits sharepoint brings on table for managing the unstructured data are too much to ignore it. Your manager like it, His manager like it and you too will like it once you start managing people(just joking!).
The process of the organization in which innovation through new technologies and business models can provide competitive advantage are in domain of Sharepoint.
Golden Rules
1)Sharepoint is for un structured data. LOB application and ERP are there for structured process. (click here to see bigger picture)
(click here to see bigger picture)
2) Plug in sharepoint for all un structured process in organization. Target all the process where innovation is posible and value can be added by changing the process.
3) Identifiy the un structured process part in the LOB and ERP and plug in sharepoint to manage the un structured part. Leave the optimized business process which are matured to LOB application and ERP.
Why Not sharepoint for matured Business Process.
1) Off self application address the needs better by confirming to industry standards. The overall cost of software for matured process is low via off self application.
2)Database fetures like stored procedure, trigger, seperate tables , Master Detail tables relationship, functions, column level security, performance is better utilised by off self application.
3) Reporting features are better in Off the self application.
Why sharepoint for Unstructured Business Process.
1) New approches, models, innovation can be incorporated in application on demand by configration in sharepoint. Organization can develope competative advantage by adopting new ways.
2) Sharepoint can evolve to business need in quick turn around time. In fact Business user can configure the application without need of IT people.
3) Content of Unstructured Business Process will be digitalised. This is huge advantage for the organization. Unstructured Business Process will always there in organization.
How does sharepoint add value?.
1)Provides intutive plateform to digitilise all your unstructured process. The process can be tailored by business people by configration. Employess can try new model, Innovate new ways to improve the process.
2)Security: Every thing is secured. Permission can be set right from higher level to item level. No glitches. Audit reports are welcome add in
3)Engineers @microsoft are evolving the application. Expect tons of functionality in to be added in next version.
When to develop business application in sharepoint.
1) There is need to try different model, process.
2) Every thing else is on Sharepoint.
3) Work flows are part and parcel of Business application.
How to develop business application in sharepoint.
1)Workflow will have maximum code(State machine).
2) Use custom SQL server Tables, Infopath and BDC to read, write data. Donot store business data in list.
3) See Microsoft implementations.
Questions:
1) How to develop business application in sharepoint.
2) Where to store data? in sharepoint list or busness database tables.
3) Will all business application will be ported to sharepoint.
Learn about composite application
Thursday, May 15, 2008
architecture
Tuesday, May 6, 2008
Thinkweek: Microsoft uses SharePoint
...
For example, each year I do something called ThinkWeek where anybody in the company can submit a paper about an idea they have to change the way our company works or to pursue a new development project. We used to rely primarily on printed documents, but now it's simple for us to create a Web site to manage the entire process. This year, more than 350 papers were submitted. Not only did I read and comment on many of them, but other technical leaders from across the company were able to go up to the ThinkWeek Web site and add their thoughts. This has led to many lively discussions and started numerous new projects, something that was much harder to do when everything was on paper
read...
http://office.microsoft.com/en-us/help/HA102402071033.aspx
Thursday, February 7, 2008
SharePoint Resources and Links
Latest MOSS 2007 SDK (includes samples,starter kit .... )
SharePoint resources & Nice WebLogs
- http://www.tonstegeman.com/Blog/Lists/Posts/Archive.aspx
- http://stevepietrekweblog.wordpress.com/- http://blogs.technet.com/stefan_gossner/pages/SharePoint-resources.aspx
Today I was learning about custom webparts and following links were really useful
http://technet.microsoft.com/en-us/library/cc299032.aspx