December 27, 2007 - 20:42, by Steven Van de Craen
Categories: .NET, CKS, General, SharePoint 2007
In case you noticed my RSS feed acting weird; I was updating the CKS:EBE version (currently version 2.0 Beta 2) on my blog. One of the downsides when running alfa/beta software I guess. But it's never been an issue so far. I have so far really enjoyed working on this community project.
The latest version is almost ready for release (keep an eye out on http://www.codeplex.com/CKS for further details !) and includes a lot of bug fixes and performance improvements.
- Easily deployable solution file (.WSP) with Features that can be activated or deactivated
- Modular Theme Framework ("MTF")
- Protection for anonymous access to 'System Pages'. This means anonymous users cannot access /lists/.aspx, /forms/.aspx, /_layouts/*.aspx
- MetaBlogApi working a bit better...You will need to create a Picture/Document library called Media for it to upload images.
- Support for Akismet comment spam detection
- Multiple categories/tags can be mapped to each blog entry/post
- Anonymous comments can be moderated
- CAPTCHA Validation for reducing spam comments
- Name and URL fields in comments
- Friendly URL ("FURL") for the blog's posts
- Friendly URL for the blog's RSS feed
- Support for CKS:TagCloud web part (being released separately)
- Configurable settings
-
- Enable content caching
- CAPTCHA validation on comments and contact forms
- Enable post trimming
- Lock down system pages
- Akismet key spam validation
- Set specific blog theme (as the default)
- Custom RSS feed (e.g. from Feedburner)
- Enable Theme Selector (so users can select their own theme)
Could you have told that this blog was running on Windows SharePoint Services 3.0 ?
December 27, 2007 - 14:49, by Steven Van de Craen
Categories: .NET, SharePoint 2007
Introduction
By default text properties in the Web Part Property pane can be filled in using a Property Builder as shown below:
This only applies to the default SharePoint ToolPanes (or EditorParts as they're called in the new terminology). If you develop a custom ToolPane or EditorPart with TextBoxes, Labels and such you don't get that Property Builder.
BuilderTextBox
... Introducing the BuilderTextBox ! A free Composite Control that renders a Text Box and Button with the necessary javascript in order to show the text property builder.
Installation and Usage
- Install the BuilderTextBox in the Global Assembly Cache (drag .dll to %systemroot%\assembly)
- Reference the BuilderTextBox assembly in your Visual Studio project
- Use it in your custom Microsoft.SharePoint.WebPartPages.ToolPane or System.Web.UI.WebControls.WebParts.EditorPart
Sample ToolPart
public class DynamicToolPart : Microsoft.SharePoint.WebPartPages.ToolPart
{
private Vandest.BuilderTextBox.BuilderTextBox text1 = null;
public DynamicToolPart()
{
this.Title = "My Custom ToolPart";
}
protected override void CreateChildControls()
{
text1 = new Vandest.BuilderTextBox.BuilderTextBox();
text1.ID = "text1";
text1.Text = this.WebPartToEdit.Description; // Using Description for sample purposes
Controls.Add(text1);
}
public override void ApplyChanges()
{
// Set value of a property in this.WebPartToEdit
// Using Description for sample purposes
this.WebPartToEdit.Description = text1.Text;
base.ApplyChanges();
}
public override void SyncChanges()
{
base.SyncChanges();
}
}
Downloads
-
Compiled assembly
-
Visual Studio 2005 Project
References
Notes
This control was developed for and tested in WSS 3.0 and MOSS 2007.
ToolPart is used in combination with a SharePoint Web Part (Microsoft.SharePoint.WebPartPages.WebPart). If possible use EditorPart in combination with an ASP.NET 2.0 Web Part (System.Web.UI.WebControls.WebParts.WebPart).
Feel free to modify or improve the code.
Excel Services Trusted Locations and Alternate Access Mappings
December 20, 2007 - 12:10, by Steven Van de Craen
Categories: SharePoint 2007, Excel Services
0 Comments
December 20, 2007 - 11:35, by Steven Van de Craen
Categories: .NET, SharePoint 2007
Terminating the workflow will set its status to Canceled and will delete all tasks created by the workflow.
Via browser interface
Via code
// Cancel
SPWorkflowManager.CancelWorkflow(workflowProperties.Workflow);
Applies To
- Windows SharePoint Services 3.0 (+ Service Pack 1)
- Microsoft Office SharePoint Server 2007 (+ Service Pack 1)
.NET Framework 2.0 and 3.0 Service Pack 1
December 15, 2007 - 15:23, by Steven Van de Craen
Categories: .NET, General
I just noticed that Service Pack 1 for .NET Framework 2.0 and 3.0 has been released. I missed it completely due to the large number of announcements regarding Office 2007 Service Pack 1.
Thanks to Aaron Ruckman for the link to the redistributables (couldn't find them on the download site).
0 Comments
December 10, 2007 - 14:27, by Steven Van de Craen
Categories: .NET, SharePoint 2007
Using the Web Part Gallery you can easily add new Web Parts to a Site Collection and it will even generate the .webpart or .dwp XML file for you. Just drop the assembly in the BIN or GAC, add a correct node in the web.config and you should see your Web Part(s) in the New dialog of the Web Part Gallery.
After adding your Web Part(s) you can edit them and set additional information (meta data) such as 'Group', which is used to group Web Parts when adding them on a page.
Unfortunately changing the Group is something that has to be done manually per Web Part. If you have a lot of Web Parts this gets tedious, so I wrote a small tool for it.
WPGalleryGroupChanger
Description
This tool allows you to connect to a Site Collection's Web Part Gallery and change the metadata of multiple Web Parts at the same time. Changeable metadata: file name, title, description, group, quick add groups
Instructions
- The process account must have sufficiënt permissions in SharePoint. Use Run As to specify an alternate account
- The tool must be run locally on a SharePoint server
- Fill in the URL to a Site Collection and click 'Connect' to retrieve the Web Parts in the Web Part Gallery
- Change the metadata
- Click 'Update' to save the changes to SharePoint
Screenshot
Downloads
-
WPGalleryGroupChanger executable
-
WPGalleryGroupChanger source code (VS 2005)
Applies to
- Windows SharePoint Services 3.0
- Microsoft Office SharePoint Server 2007
December 6, 2007 - 17:09, by Steven Van de Craen
Categories: .NET, SharePoint 2003, SharePoint 2007
There are some things you need to know as a SharePoint developer...
Creating a list
When you create a list using the browser you get to specify the name for the list. Basically this means both the url part as the title. Not all characters are allowed in a URL so SharePoint will just filter them out of the url part WITHOUT NOTICE !
The example above will create a list at location http://moss/My%20List1d with title 'My List??1..d'.
When you create a list using the Object Model you also specify the url part and title as one parameter and invalid characters get stripped from the url part.
Renaming a list
When a list is created it cannot be renamed. Well, you can change the title but not the url part. I use this technique quite often as follows:
- Create a list named 'kb'
- Rename the list to 'Knowledge Base'
This way the url part remains short while your users see a more descriptive title. I always tend to avoid spaces and exotic characters in the url part. Too bad they don't allow this separation at list creation time...
Caveat
There could be some confusion when you have the following situation:
- You have a list named 'Questions' (http://moss/Lists/Questions)
- You create a new list named 'Questions ???'
Guess the outcome ? The new list contains some illegal URL characters which will be stripped. However there exists a list with the same url part already...
Answer: The new list is created successfully at the following location: http://moss/Lists/Questions1
The '/Lists' segment
If you notice the URL of some lists and libraries you might notice the difference. Some of them have the '/Lists' segment and others dont.
In general:
- Lists with files: root location of the web. Example: http://moss/MyDocLib
- Other lists: '/Lists' segment. Example: http://moss/Lists/MyAnnouncements
Exceptions (found so far):
- A Site Directory 'Sites' List (type: enhanced Links List) lives in the root location of the Site Directory web
Get the instance of a list in code
When you write SharePoint code and you need to get the instance to the list you have some options:
1. Using SPFolder.ParentListId
This only works for libraries since the list has to support folders. You can get to the root folder of the document library and then get the parent list id as Guid. In turn this id can be used to get to the SPList instance.
Possibilities:
- web.Folders["url part"].ParentListId
- web.Folders[web.Url + "/url part"].ParentListId
- web.Folders[web.ServerRelativeUrl + "/url part"].ParentListId
- web.Folders[site.MakeFullUrl("url part")].ParentListId
Instead of using web.Folders[url] you can also use web.GetFolder(url)
2. Using SPWeb.Lists[title]
This works for all types of lists and uses the title or list id. The latter can be used in combination with the SPFolder.ParentListId method.
Possibilities:
- web.Lists["title"]
- web.Lists[listId]
3. Using SPWeb.GetList(url)
This works for all types of lists and uses the absolute or relative url. It cannot the url part in itself so if you only have that it must be made into a absolute or relative url.
Possibilities:
- web.GetList[web.Url + "/url part"]
- web.GetList[web.ServerRelativeUrl + "/url part"]
- web.GetList[site.MakeFullUrl("url part")]
-
4. Using SPWeb.GetListFromUrl(url)
This works for all types of lists and uses the absolute or relative url to a form. (not just any file !)
Possibilities:
- web.GetListFromUrl["url part/Forms/AllItems.aspx"]
- web.GetListFromUrl[web.Url + "/url part/Forms/AllItems.aspx"]
- web.GetListFromUrl[web.ServerRelativeUrl + "/url part/Forms/AllItems.aspx"]
- web.GetListFromUrl[site.MakeFullUrl("url part/Forms/AllItems.aspx")]
-
5. Using SPWeb.GetListFromWebPartPageUrl(url)
Seems to be identical to the above method. It doesn't seem to work with a Web Part Page url so I'm not sure what additional features it offers.
Possibilities: same as 4.
Alternative
If you're in the context of SharePoint and displaying an item or form in a list or library you can use the following:
Conclusion
It's possible to store a reference to a specific list using the title, the url or url part, or the ID in combination with the web url. Since the list title is subject to change by anyone with sufficient permissions You shouldn't rely on it to find the specific list. The title should be used for display but the url part or ID should be used to work with behind the scene.
Also, nothing prevents you from having two lists with the same title on the same web. This might be confusing but can be prevented by user education or by providing the url along with the title.
Think of this when designing your web parts, win apps, etc.
December 6, 2007 - 14:41, by Steven Van de Craen
Categories: SharePoint 2007
One of our projects is being automated using solution files and Features. When the Site Collection Feature is activated it automatically creates Site Columns, Site Content Types and a Document Library using both of the aforementioned.
Currently the entire process is via Object Model code. However, for flexibility and standardization we're looking into defining the columns and content types using CAML XML files.
It appears however that site columns defined in CAML XML cannot be modified using the browser. We have a CHOICE field where we want modify the list of values from within the browser but that functionality is missing.
Please tell me I'm missing something here ?
UPDATE:
I was missing something: brackets around the Field Id GUIDs.
{EFEEE760-23C1-4f63-87DF-19C163D09A5C}" Name="FJobOptions" DisplayName="Job Options by Feature" StaticName="FJobOptions" Group="MyWCMPublishing" Type="Choice">
Hello
World
Now it works like a charm !