Thursday, March 6, 2008

Further achivements!

Now Im getting somewhere!

Had a problem today that might interest someone using either DataFormWebPart or SPSiteDataQuery creating querys towards Sharepoint. The problem was with Calendars and retrieving the RecurrentData XML that specified how the event was repeating. In my case when retrieving from the SPList the RecurrentData was empty all the time. I thought first my dataformwebpart xslt was the error but putting the generated XSLT into sharepoint designer revealed no errors. It had to do with the selectcommand of the SPdatasource!
I didnt have a clue but you had to specifiy the column as a if you actually wanted the RecurrentData to show. But I had a mistake in generating the query: I used
<View><ViewField><FieldRef Name="field1" /><FieldRef Name="field2" /></ViewField></View> while sharepoint designer used the very strange syntax:
<View><ViewField><FieldRef Name="field1" /><FieldRef Name="field2" /></ViewField><ViewFields><FieldRef Name="field1" /><FieldRef Name="field2" /></ViewFields></View> OBS ViewFields with the same columns as the ViewField... Microsoft...plz

Thursday, February 21, 2008

Toolbar complete

I've just completed the toolbar for the generic list with some fancy buttons presenting the user with delete buttons for each item in the list or with a form for creating a new item to the list.

The toolbar was a big pain, it took me probably two-three weeks(!!) to figure out how sharepoint developers are creating their menus! Thats pritty insane, but my only source of information has been blogs and SharePoints insane pile of code.. come on M$ produce some documentation to your API please. Probably they havn't heard that an API without documentation is useless. I've could have completed a menu of my own in half that time or less...

Friday, February 8, 2008

Advancement!

Hi! Now I have finaly accomplished something, I was able to create a custom sharepoint menu for my application page using FeatureMenuTemplate containing MenuItemTemplate:s. To display them I used a control named toolbar residing in the 12-hive under controltemplates. Then I used SharePoint:Menu as template-buttons reffering to the menutemplates i created earlier.

Though now i have a problem when trying to inject some javascript into the web part. Its not recognizing it!

Monday, February 4, 2008

hmm more problems

Crap, today i read on a web page regarding the DataFormWebPartthat:
For security reasons, you cannot create Microsoft JScript code in your XSLT code using msxsl:script. All extension code available in your XSLT must either come from standard XSLT code, or from the functions described in this article.


That fucks me up quite a bit, because now i cant insert any javascript.

Hm, nevermind. I'll just insert my javascript in another way using one of these techniques. I only cant used external javascript files, which would be preferred.

Anyway I today realized that I will have further problems: The SPDataSource used for populating the DataFormWebPart cannot be used for Create, Delete and Update...Because it will only be rendered to a string and passed along through web services to another web-server, and there being inserted as a widget. But I can create all the forms in the web-part and then only handle receiving from forms and performing an javascript asynchronous web service-request to the list service when for example a list is being edited.

Thursday, January 31, 2008

Xslt creation complete

One step closer. The xslt-creating part is now over, a successful copy of the xslt created by sharepoint designer for this particular datasource/list is now complete. To make it dynamic though alot of work is left, but so far this is how it looks when using the web service creating the web part:

The following features are complete:

  • The custom web service deployed on the sharepoint server, using code deployed in the GAC

  • The service executes an aspx page containing the DataFormWebPart, all code is created in the code-behind for the aspx-page residing in an assembly in the GAC.

  • The DataFormWebPart is created in the code-behind, making it very easy to dynamically changing the caml-query used in the datasource

  • The xslt-code is all generated from XmlWriter, making it very easy to change any aspect to the transformation. For example adding fields or changing the formatting of the columns

  • Forms authentication is used on the sharepoint server, so that extranet user can use it



Next weeks mission is to create menu-controls, using as much functionality as possible from sharepoints. All links thats present in the menu has to receive javascript popups instead of the original forms, because postbacks are evil and will break everything. The question is how the forms in the popups will be created, because they must be very customizable and adaptive regarding to what list's showing.

Questions!

Argh, Microsoft sucks on documenting their API. Why even have one if its not documented..
Currently I'm trying to figure out how to configure a webcontrol.NewMenu. Possibly i have to create controls of my own. Something like this

Writing xslt

In the current stage of development for my project I'm trying to use the DataFormWebPart used by SharePoint Designer. To configure the web part some input parameters is going to construct the web part according to what the used needs. My goal is to make it very functional, being able to use any datasource while providing some nice filtering and sorting according to more inputs.
An example for an input could be the following:
<datasource>
<protocol>SPList</protocol>
<Name>ListName</name>
<Field>Title, Status, PercentComplete, Priority</Field>
<Order Name="PercentComplete" Ascending="False" >
</datasource>
<Formatting>
<Width>40%</Width>
<Menu>True</Menu>
</Formatting>



And returned from the web service is a well formated list, spanning 40% of the parent-container, with a menu used for CRUD actions. The CRUD is not implemented so far.

That is my vision.

Currently im working with the XmlWriter, used for producing a xsl used for the transformation in the DataFormWebPart.

A minor problem atm is that writer.writeString is creating html-text from htlm, for example "<" becomes & l t ; but without whitespace between.

---------
Edit: problem almost solved, used WriteRaw instead, but this way formatting is screwed.

Wednesday, January 30, 2008

First post

Cool, I've finally realized a blog would fit my project, because the solitude is killing me, I need to think more about what I'm doing regarding my programming.