A place for Sharepoint and rantings
Archive for March, 2005
Why why why continued
Mar 31st
So I figured why my custom pane doesn’t appear, there is a setting, customise web parts, so I changed it for my members and readers. Tried to save the settings but becuase SPS zones disallow personalisation it wouldnt save them. It half worked in WSS but I figure the half that broke was probably me.
If you want Custom properties saved in SPS you need to save them elsewhere, it would seem.
I will have to revisit this later, at the moment Im creating a WebPartBase and Skinnable WebPart Frames. Dont Ask.
WHY WHY WHY WHY WHY – Sharepoint
Mar 30th
I have a custom menu, I have a custom toolpane. The menu displays for a reader (Great) but the show -1 toolpane event does not work it will not show the pane if the user is a reader.
HELLO ! I require my webpart to have Reader customisation on my custom properties. DAMN MS, even Plumtree got this right. This doesnt even follow the default behaviour for standard toolpanes if you call the JS function to show pane for standard properies it shows with an error, so why dont you let me be in charge of my own errors ???????
If anyone knows why my toolpane doesnt show for readers please post a comment (for some reason the contact me doesntwork).
The definitive WepPart developer guide
Mar 30th
I went on course 2014B, with the exception of the security section of this course it was a waste of time. For developers with something about them all you need is this document to get you going and more
http://www.sharepointcustomization.com/resources/whitepapers/Web%20Parts2003.pdf
I’ve been experimenting with custom web part menus and custom toolpanes and its all in this document.
Personal Settings on a SPS webpart
Mar 22nd
I was told this couldnt be done, you have a web part that requires personalisation but the designers do not want this web part to go on the My Page its to go in an area they choose but the client needs to configure the settings.
If you set the storage mode to personal, and place webpart in a zone in SPS, there is no ability to change that setting. If you try and force it in code it goes bang. If you load the property pane using script for personal then it errors with a naughty boy error you dont have permission to do this.
It is possible to allow this for web parts but you have to do something more evil to acheive it. You have to edit the area template find the zone you want to allow personalisation and change the AllowPersonalisation to true. So you can save your personal property, but you now have give the user control over the look of your SPS area, something far worse than not having a property.
Dont have an answer to this, considering the properties I want to store are user related an extension to the user profile may be possible, scary More >
Windows Server 2003 as Desktop
Mar 22nd
About to rebuild my machine again and need to create a desktop 2003 server
http://www.msfn.org/win2k3/misc.htm
Handy url with details how.
WebPart Resources
Mar 15th
With web parts there is a special way in which to place resources in the correct folder and have the part deploy and reference them.
Take an image for example. Just drop the Image into the Root of the web part project (no need to separate it into separate folder unless you have lots of course or want to).
This example has a Traffic.jpg in the Web Part Project.
In the manifest is the following :
ClassResources> ClassResource FileName=”Traffic.jpg”/>/ClassResources>
The class can reference the href like this :
this.ClassResourcePath + “/Traffic.jpg”;
To give a Web Part a custom Icon then create a 32×32 gif/png/jpg (pref. gif for transparency), It is displayed at 16×16 though. Make an entry for it in the ClassResource Section, then in the DWP:
PartImageLarge>_WPR_/ICO32.gifPartImageLarge>
Notice the _WPR_, this is automatically replaced by stsadm with the wpresources path (which is the ClassResourcePath) for the specific web part, as this is where it gets deployed.
There is also a PartImageSmall setting which I couldn’t get to work, not enough time to play with it though so I stuck with this.
Preconfigure a Web Parts Height or other property (including custom ones) for deployment
Mar 15th
So you have your web part and you want to pre-configure the height of the web part at time of deployment, rather than have the support department have to set the height everywhere your part has automatically been added etc.
I found this Gem on how to create preconfigured custom properrties here http://weblogs.asp.net/mnissen/archive/2004/05/20/135744.aspxand just adpated it for Base properties (with a slight bodge), there may be a better way but I don’t have time to find it (I did try overriding/new the Height property but it wouldn’t have it).
In your web part code create a custom property for DefaultHeight in your class e.g.
[DefaultProperty("TeamName"),ToolboxData(""),XmlRoot(Namespace=http://www.BinaryJam.com/HelpDeskWebParts/TeamWebPart)]public class TeamWebPart : Microsoft.SharePoint.WebPartPages.WebPart{ [Browsable(false),DefaultValue(defaultText),WebPartStorage(Storage.Shared)] public string DefaultHeight{ get { return this.Height; } set { this.Height = value; } }}
Then using the techniques described in the blog entry, enter the following line in the DWP file.
DefaultHeight xmlns=”http://EonUK/Oberon/RemedyWebPart/TeamWebPart”>150DefaultHeight>
When deployed this has the effect of Setting the Height of the Part to 150 pixels.
This technique could be used for width or any of the base properties exposed by WebPart.
WebPart ToolParts, not just ffor properties
Mar 3rd
Custom ToolParts can be really useful when you need to say select an item froma dropdown list whose data is stored in a WebService. Thats how I’ve useed them before.
But Consider using them for more than that. I created a new one, it has no properties to update or show, it just displays the Version number of the Assembly and the current user viewing the properties. Im going to extend it to display a host of other useful support information