A discussion following on from a presentation I recently attended (on the use of SharePoint in business) raised the opinion that email is a competitor to SharePoint in terms of business use. The basis of the argument was that people in an organisation either can use SharePoint for their collaboration or they can use email.
I disagree. SharePoint is now very much email-enabled, with the ability to send alerts or emails from custom code, and to receive emails into lists. The ideas in the discussion may have been based on the belief that users are required to interact with the data contained in a SharePoint site only through the site's web pages.
Certainly the users will need to perform some actions through web pages, but it is possible without much work at all to implement a business process in SharePoint in such a way that the users can continue to use emails for many of the operations they perform. An email sent to a SharePoint list can be interpreted by event handlers on the list, which could act on information in the email and add or edit data in the list.
What I have found is that architecting solutions in SharePoint requires a different vision than when developing in ASP.Net. One of the key points is to build on SharePoint's strengths - think about using lists for storing data (for example, store temporary data for an application in a list rather than in a database table).
Wednesday, August 8, 2007
Strange Results When Adding Web.Config Values
SharePoint provides a programmatic way of editing existing values and adding new values to a web application's web.config file - through the use of the SPWebConfigModification class (defined in the Microsoft.SharePoint.Adminstration namespace).
There are plenty of posts around explaining how to use this class, the basic pattern for adding a custom value being the following:
private void AddWebConfigEntry(
string keyName, string entryValue)
{
SPWebConfigModification modification = new SPWebConfigModification
(string.Format("add[@key=\"{0}\"]", keyName)
, "configuration/appSettings");
modification.Owner = Constants.FEATURE_NAME;
modification.Sequence = 0;
modification.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode;
modification.Value = entryValue;
_webApp.WebConfigModifications.Add(modification);
_webApp.Update();
}
Wen I first wrote and used this function, I found that the key was correctly added to the web.config file, but was not being removed by a similar deletion function I wrote. And everytime I called this AddWebConfigEntry function, a duplicate entry was written to the file.
Turned out that I had missed the escaped double quotes in the first argument of the SPWebConfigModification constructor call. What made this a tricky effect to fault-find was the fact that the new web.config entry was being created.
So the morale of this tale is - be VERY careful with the arguments to that constructor!
There are plenty of posts around explaining how to use this class, the basic pattern for adding a custom value being the following:
private void AddWebConfigEntry(
string keyName, string entryValue)
{
SPWebConfigModification modification = new SPWebConfigModification
(string.Format("add[@key=\"{0}\"]", keyName)
, "configuration/appSettings");
modification.Owner = Constants.FEATURE_NAME;
modification.Sequence = 0;
modification.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode;
modification.Value = entryValue;
_webApp.WebConfigModifications.Add(modification);
_webApp.Update();
}
Wen I first wrote and used this function, I found that the key was correctly added to the web.config file, but was not being removed by a similar deletion function I wrote. And everytime I called this AddWebConfigEntry function, a duplicate entry was written to the file.
Turned out that I had missed the escaped double quotes in the first argument of the SPWebConfigModification constructor call. What made this a tricky effect to fault-find was the fact that the new web.config entry was being created.
So the morale of this tale is - be VERY careful with the arguments to that constructor!
Tuesday, July 17, 2007
Internet Explorer Default XSL
To view the default XSL used by IE, browse to res://msxml.dll/DEFAULTSS.xsl in Interner Explorer. This works in versions of IE prior to IE9 - I have not found an equivalent for IE9
Monday, July 9, 2007
MOSS Install - Tips from an MS Field Engineer
Tips from a Microsoft premier field engineer on how to achieve a "... less painful experience ..." when faced with a MOSS install - http://sharepoint.microsoft.com/blogs/fromthefield/Lists/Posts/Post.aspx?ID=9
(and here's another useful post on configuring Alternate Access Mappings)
(and here's another useful post on configuring Alternate Access Mappings)
Sunday, July 8, 2007
Calling a Custom Javascript Function on Page Load
A simple way to add a custom Javascript function to the list of scripts that run at page load is as follows:
<script type="text/javascript">
_spBodyOnLoadFunctionNames.push("YourFunctionName");
</script>
<script type="text/javascript">
_spBodyOnLoadFunctionNames.push("YourFunctionName");
</script>
Thursday, July 5, 2007
Displaying Site Data in a SharePoint Page
To display the name of the current site in a master page or page layout within SharePoint, add the following control to the source of the page:
<SharePointWebControls:ProjectProperty Property="Title" runat="server"/>
This display the title of the site. The ProjectProperty SharePoint Web Control is useful for displaying properties of the current web site. Other fields such as the site description can also be displayed this way
Note that Microsoft must have used the name "project" at some stage for a SharePoint site, given the name of this control and also the name of the site Title and Description settings page (which is prjseng.aspx)
<SharePointWebControls:ProjectProperty Property="Title" runat="server"/>
This display the title of the site. The ProjectProperty SharePoint Web Control is useful for displaying properties of the current web site. Other fields such as the site description can also be displayed this way
Note that Microsoft must have used the name "project" at some stage for a SharePoint site, given the name of this control and also the name of the site Title and Description settings page (which is prjseng.aspx)
Adding a CSS File Link to a MasterPage
Use the following to add a reference to a stylesheet in a WCM publishing site's Style Library document library:
<SharePointWebControls:CssRegistration ID="CssRegistration1"
name="<% $SPUrl:~sitecollection/Style Library/style.css %>"
runat="server"/>
Note that some of the default styles may still override those in the referenced stylesheet, so you may need to add the CSS as the Alternative CSS URL on the "Site Master Page Settings" form
<SharePointWebControls:CssRegistration ID="CssRegistration1"
name="<% $SPUrl:~sitecollection/Style Library/style.css %>"
runat="server"/>
Note that some of the default styles may still override those in the referenced stylesheet, so you may need to add the CSS as the Alternative CSS URL on the "Site Master Page Settings" form
Subscribe to:
Posts (Atom)
