Monday, August 3, 2009

why do Contributors have access to edit my main page?

This issue only occurs with publishing templates. With collaboration templates, Contributors do not have any Site Actions menu choices.

Some people go off making permission levels to fix this. This will not work since Contributors still need Edit & Delete rights to the lists in the site.

This issue occurs because in sites created with the publishing template, Contributors have Add/Edit/Delete rights to the Pages document library (which is where the home page is typically stored).

The simple fix for this is:

  • break the permission inheritance for the Pages doclib
  • change the permissions for the Contributors (probably Home Members) to only allow read access

Although the Site Actions menu will still be present, Create Page and Edit Page will no longer show up!

Regards..

Wednesday, July 29, 2009

why is the Include-Content button greyed when making a list template?

Apparently this occurs when there is a Lookup-type column in the list. Just remove this column and it should be save-able (sic) with the content. Another optin is to "de-reference" the lookup column. Do this by:

- create a new text column
- go into datasheet mode
- select the entire lookup column and copy/paste into the new text column

The reason this occurs is because a lookup column works by referencing an interal generated name for the list it references.

The "instantiate a template" function cannot recreate the lookup column field (since the referred-to-list may not even exist where the new list is instantiated), so they chose to disable saving the content if this field is present.

Sunday, July 5, 2009

Document conversion not very useful & broken in one case

This is another case where the Publishing parts of MOSS are not integrated cleanly IMO.

I created a site collection under a publishing root level site. This site collection did not have the Publishing Features activated.

When I uploaded a Word 2007 file, the context menu has an item labelled Convert Document >> From Word Document to Web Page.

Not knowing what this was I tried it. You immediately get an error screen displaying:

The site is not valid. The 'Pages' document library is missing.

There is no indication what the problem is related to.

So I created a 'Pages' document library. Tried the same menu item and got the same message.

Then I added the Publishing Infrastructure to my site. Same result.

Then I looked on the web about this error message and I was instructed to check Central Administration. I did this and saw:

Document Conversions Launcher Service is present and started

Finally I made a site collection using the Publishing site template. Then I uploaded the document to this new site collection and tried the menu item again. Lo and behold:

The document converter was able to create HTML from this document, but it had to modify the output:
1 embedded image(s) from the document were not preserved in the HTML.

Click OK to go to the created page.


I went to the page and it looked like Word's old SaveAs Html option. Not very useful!

So this menu item is enabled even though in many instances it will cause an error. Not the A answer!

Regards..

Roger Williams
Franklin Laboratory

copying including associated metadata

There is some good news on this issue.

Basically if you copy a document library item that is a certain content type and contains certain meta-data to another location, using ECB >> Send To >> Other Location, the entire content type will be copied providing that the destination document library has content types enabled as well as the "copied from" content type.

In my tests, if the content type management is not enabled in the docuement library, only the document gets copied and it truncates the metadata. The fact that no message is issued on loss of dat is a bug IMO.

To test this do the following steps:

  • optionally create any needed site columns
  • create a content type (using those columns)
  • create the target document library
  • enable content types (List Settings >> Advanced Settings >> Allow management of content types)
  • include the source content type in the target doclib (List Settings >> Add from existing site content type)
  • save a copy of the target document library URL
  • go to the source document library
  • navigate to the folder or view containing the item to copy
  • use the Edit-Control-Block to perform the copy (ECB >> Send To >> Other Location)
  • paste in the target document library URL (strip off Forms/AllItems.aspx)
  • hit OK twice

This should do it. Note that there are several additional capabilities this should have, including:

  • let the user pick the doclib from a screen
  • let the user select folders
  • let the user select several items to copy simulatneously
  • the system should strip the URL for the user
  • reduce the number of clicks!!

Other needed tests include:

  • content type mis-match but meta-data match (using doclib list columns
  • built-in content types and complete meta-data match

Anyway, at least it works for the center-of-the-street case.

Regards..

Roger Williams
Franklin Laboratory

Monday, June 22, 2009

making pages containing lists of sites, lists

One of the projects I am working on needed some pages containing lists of subsites and lists of lists. Some examples include:

  • A top-level site that has lots of blog sites beneath it. The user wants a list of all of the blog sites to appear in a web part on the top level site.
  • A top-level site that has lots of discussion boards contained within it. The user wants a list of all of the discussion boards inside this site.


Note that top-level in this case does not necessarily mean a site collection.

I could not find a built-in web part to accomplish this. However, it is very straighforward to create a DVWP (i.e. data view web part) talking to built-in WSS web services. This is done using SharePoint Designer. Here is the process:

  • create a web part page (Site Actions >> Create >> Web part page)
  • open the page in SPD (use either Design or Split view)
  • Data View >> Manage Data Sources
  • In the Data Source Library, select Connect to a web service

Here the directions will be slightly different for sites vs. lists

For Sites:

  • use http://<your site>/_vti_bin/webs.asmx for sub-sites
  • use the GetWebCollection method
  • after creating this data source, drag it into one of the web part zones on the new page (this creates a DVWP)
  • use the context menu ">" and season to taste

For Lists:
  • use http://<your site>/_vti_bin/lists.asmx for containing lists
  • use the GetListCollection method
  • after creating this data source, drag it into one of the web part zones on the new page (this creates a DVWP)
  • use the context menu ">" and season to taste

Good luck!

Wiki pages are not first class "items" in WSS v3

One of the strengths of the WSS platform is that all of the built-in list types have the same features set, such as alerting, permissions, folders, metadata. Not!

One of my customers is doing a Web 2.0 implementation using MOSS as the platform. They will be using the Wiki page type extensively.

Now I have recently discovered that Wiki page libraries cannot make folders for the pages.

This has the potential to be a large issue for 2 reasons:

  • folders allow a better organization of the pages
  • WSS has a well-known performance issue when a single view of data becomes longer than 2000 items

So this is definitely a drawback that will need to me mitigated. It is certainly possible that a code-based solution will be the best mitigation for this issue.

Here is a MSDN thread with the start of a workaround on this.

Note further that the Kwizcom product with enhanced Wiki capability also has this limitation.

Tuesday, June 9, 2009

InfoPath cannot handle URL fields in SP lists

One component of the dream of no-code SharePoint is to store data in SharePoint lists and expose the data thru Infopath [which business analysts and administrators can use to change the UI design easily].

This dream is dimmed slightly when InfoPath cannot handle SharePoint list types correctly. In this case, URL fields are not parsed correctly causing the link field to fail [when clicked].

In this example, I made a URL field in a custom list called "u 0" and I stored a value in it.

Make the infoPath form with a datasource pointing to the custom list. Then you will see the symptom of this problem. The problem itself is caused by this XSLT code stored in view1.xsl. (Sorry, I could not get the formatting to work!)

<span class="xdHyperlink" hideFocus="1" title="" style="OVERFLOW: visible; WIDTH: 130px; TEXT-ALIGN: left" xd:xctname="Hyperlink">
<a class="xdDataBindingUI" xd:CtrlId="CTRL4" tabIndex="0" xd:disableEditing="yes">
<xsl:attribute name="href">
<xsl:value-of select="@u_0"/>
</xsl:attribute>
<xsl:value-of select="@u_0"/>
</a>
</span>


The correct code is shown below:


<span class="xdHyperlink" hideFocus="1" title="" style="OVERFLOW: visible; WIDTH: 130px; TEXT-ALIGN: left" xd:xctname="Hyperlink">
<a class="xdDataBindingUI" xd:CtrlId="CTRL4" tabIndex="0" xd:disableEditing="yes">
<xsl:attribute name="href">
<xsl:value-of select="substring-before(@u_0, ',')"/>
</xsl:attribute>
<xsl:value-of select="substring-after(@u_0, ',')"/>
</a>
</span>

I find it hard to believe but apparently noone has documented this out on the web. After I debugged it, I found this link from 2005 about the SPD predecessor, of which #5 & #6 are the answer.

It is also frustrating that Microsoft has not fixed this in the InfoPath 2007 product.

Regards..

Tuesday, May 26, 2009

Monday, May 4, 2009

export of a versioned list neglects data (WSS v3)

The use of versioning is typically very important to users. At one of my engagements using WSS V2, the IT group discouraged the use of the versioning feature since the storage mechanism (inside WSS) was very inefficient.

In WSS V3 the storage mechanism for versioning was improved and some very nice additional user features for versioning were added. Basically these are: 1) tracking versions by individual meta-data 2) alert notifications showing the old and new values.

Now I have just found out that one feature in V2 was deprecated by these changes. If you export a versioned list to Excel, only the latest version is exported. Apparently this is also true for content deployment in ECM. A user has told me that this exported all data (including previous versions) in WSS V2.

Unfortunately the only work-arounds I have found so far involve code. :-(

I have made some web services code to dump the previous versions. This was written in C#. Another approach is to write an Object Model program to address this limitation. Either approach can be written in C#, VB.Net or PowerShell.

Regards..

Wednesday, April 15, 2009

Did some testing with SharePoint Guidance

I found this out on the MSoft patterns & practices site.

Similar to the MVC thing it is designed [one hopes] to motivate SP programmers to greater productivity levels.

One thing it does for sure is show:
  • how a real application can be integrated into SP
  • how many pieces-and-parts [at the code level] are frequently required to accomplish this
There are some gotchas that I found. For an experienced SP developer, these are easy to work-around. I have not dug in to fix all of these, but for sure fixing some of these would not be easy. They are listed here along with the perceivable symptom:

  • does not work on non-port 80 webapp - instantiating the site just hangs
  • workflow build issue - second project will not build complaining about feature scoping; the fix is straightforward although you also run into some Visual Studio bug fixing it (maybe this is related to the original bug)
  • workflow run-time issue - could not get this to run correctly when set to the original site instantiated for the application; may be related to the fact that it must be instantiated in a site collection
  • theme selection issue - the theme project does not install into the Site Settings location; so the customer cannot test it out with built-in themes
  • install to more than one webapp does not work - this is because of GUID collisions
  • workflow DLLs not installed in the Contoso VPC - so when you open the workflow source code, Visual Studio complains and cannot open it
  • the directions talk about error checking, but when I schedule a course with the end date before the start date it spits out an ugly ASP.NET exception screen

So it is some distance from best practices. Rather than 1.0, I would call this a 0.7 version of guidance. Many of the issues above could be put into the destructions. Then someone does not have to stumble over the problems one-by-one.

Of course, it is more fun that way.

Regards..

Sunday, April 12, 2009

ASP.NET MVC 1.0 free book contains broken code

Hey...what a news flash!

MVC 1.0 is a new application framework for ASP.NET. I wanted to figure out what it is because it, like some other "frameworks" I use are designed to make application development closer to Code Free. This specifically is on my list since:

1) It took me a while to get my head around the ASP.NET 2.0 declarative markup programming model. It is so vast and so powerful that you need to understand at least 30-40% to be productive at all. And a higher knowledge level is needed to debug it. I have had some success using 2.0 and pushing it over to Sharepoint with relatively minimal problems.
2) Now I read about MVC like it is something new. The first time I read about it was in a SmallTalk book in the 80's.
3) Even MSoft had a MVC-type framework called MFC, again from the 80's.

Here is the blog that announces the 1.0 version.

So I loaded the Contoso VPC for SharePoint to test another framework [described in another blog entry]. Then I decided to try this MVC thing in that VPC-image. To install it, nothing more than the usual .Net framework hassles to overcome.

The link above also allows you to download the completed code that is [presumably] built up step-by-step in the book.

I have seen many cases where some group gave a tutorial book and the code and they did not agree. Whether I cared about that or not depended on the subject matter. There have been times in the past where if I really wanted/needed to learn the material and I ran in to the book does-not-equal code case, I would just skip the book and go to the documentation for the code.

In this case although I was ready for it, now that we know this is the case again, I am a little more disappointed because:

1) frameworks are big entities to learn
2) the stated goal of this book is to help someone learn
3) I have read this Scott Guthries blog in the past and he seemed like a stand-up guy
4) After reading the chapter before trying the code, almost none of the ASP.NET 2.0 decalrative framework carries over; even more reason for this think to work
5) I guarantee you these guys know the [lack of] pedagogical value of having a how-to book that is incorrect and the final code; of course, it is better than just having the book!
6) MSoft usually treats programmers better; I have seen lots of cases where they give not-quite-ready stuff to users, but they usually understand the developers have a bigger hill to climb
7)the purpose of a framework is to let the developer think big-picture; having to dig into the guts of MVC routing on your first trip to nirvana with this thing is not what the doctor ordered

So again I am naive; again the industry chucks one huge framework to move to a slightly better one that is just as hard for developers to learn.

I guess that this is another one of the benefits of open source. I guess if anybody could do it, they wouldn't need programmers, right?

Finally, there is a tweet out there somewhere found by Google when I type in "errata" about this mess. Wanna guess the fixes will be printed at the back-of-the-newspaper?

Ohh, I got up to page 45...and the code will not breakpoint in DinnerController...must be a user error!?!

Regards..

Monday, March 30, 2009

Examples of my SharePoint work

All of these are sites that are internal to the client. Contact me if you want more information.

A public utility in NorCal

· internal directory application exposing AD - Active Directory was dumped to a SQL2k5 DB and I made an ASP.NET 2.0 application to access and expose this as an SP application in /_layouts/

A large pharmaceutical in SoCal

· InfoPath FormServer integration – create InfoPath chemical compound shipping form with simple approval workflow included; test with users; deploy to FormServices
· web services based administration tools – crawl multiple sites to make security and other settings changes without touching the SharePoint backend
· email settings crawled from client – write a Powershell script to use .NET to make a "keyboard robot" to access/change settings not available to web services
· powerpoint slide manager – integrated consolidated slide deck application by using SharePoint facilities (e.g. permissions) and adapted a script to do consolidation with PowerPoint OM
· project schedule webpart – integrated SharePoint facilities (e.g. alerts) with script driving MSProject OM XML extraction to feed a SP XML webpart on the SP site
· XL Services integration – import/deploy chem-informatics spreadsheet to XL Services for search and customer access
· Integration to an internal Java application – built web part to integrate chemistry data and expose internal application results using web services
· BDC setup – XML definitions to use DBC to access Oracle data; included SP list integration, SP Designer web-parts as well as search integration
· Administration of the developers SP environment – installation, configuration and customization of the local developers SP environment including MSDN, TFS and compiler setup
· education for scientists - wrote and presented SP for Scientists class at 2 levels

A large health system in Missouri

· Initial TFS setup – installed and configured a developer image under VMWare delivered as a DVD
· Project design consulting – architecture design; use case review; deployment design
· Installation, configuration of TEST/PROD deployments – debugging related to FBA, IIS setup
· HTTP module development – C# module for custom authentication

A financial services company in NorCal

· integration in a large system - integrated Sharepoint upload into ASP.NET 2.0 application
· team participation beyond SP - responsible for several non-SP modules in the system
· ASP programming - used ASP.NET 2.0 declarative programming extensively
· Build setup/operation – installation, configuration and customization of build environment for developers for TFS, MSDN and SharePoint

Tuesday, March 24, 2009

Application #2

Let's call this: slide deck managment system

The business analyst asks the user: What is the requirement?

We have the slide deck of about 300 Powerpoint slides that we need to manage every 3 months or so. Each team leader has about 25-30 slides for which they make sure the content is correct.

We have to keep these separate so no one destroys anyone else's content. Then at the end of the quarter, we need to consolidate them all into one deck. When the consolidation comes, we need to lock out the changes and let everyone know where the final version is.

The business analyst writes down:

This is just like a group of editors who are each managing a bunch of chapters of a book. Let's use Sharepoint facilities to provide:


  • check-in/check-out
  • alerts
  • permissions
Then I need the tech guys to make a script that will consolidate all of the slide decks. The business analyst finds a script that will [almost] do it here:

Together the busines analyst and the tech guys come up with the solution by following these steps:


  • create a site with unique permissions
  • create a document library
  • name the slide decks so that the script can read them in the proper order
  • upload the various slide decks
  • set the alerts on each slide deck to point to the team leader for that deck
  • set the alerts so that when the consolidated deck is stored, the correct people will be notified
  • get each team leader to initially check-out their deck so no one else can modify it

Then modify the script to:

  • read the slide decks from the SharePoint site using the UNC name
  • store the consolidated file back into the site
  • be run every 3 months or at the behest of the business user consolidator


This stripped-down implementation will work [I implmented it for one of my clients] and is in-lieu of a custom system that would cost big-dollars to develop/deploy/support/operate.

Monday, March 16, 2009

Application #1

Let's call this: The Plungers Ordering system

The business analyst asks the user: What is the requirement?

We always order plungers through Bob. He adds the details of the order as a row in a spreadsheet file. This works fine except: There is only one "correct" version of the file. Most of the time Bob has it. Sometimes other people have it. And then Bob does not have the latest one.

Then we order stuff we already have in-house.
Also, other people will add stuff to the sheet they want ordered without Bob knowing about it.


Lastly the spreadsheet can accidentally be seen by people in other groups and then they cause a political ruckus.

The business analyst writes down:

We just need to share this file, be able to review it before placing new orders, search for orders already placed and know we are looking at the latest version of the file. Also if we make a mistake we need to see what changes are made and optionally go back to an earlier version of the data.

We also need to make sure that noone outside of our group can see the contents of the file.

What is one technical alternative?
  • Load the spreadsheet into a DB.
  • Write some desktop or web code to access the DB.
  • Work with the users to design the screens.
  • Add a module to enforce security or put this in the DB DDL.
  • Add a module to do versioning in the DB and screen to allow them to select/use old versions.
  • Add help support to the system.Teach the users how to use the application.
  • Have a QA process to make sure the application meets the business requirement.
  • Roll out the application to production.
  • When it needs to be changed [e.g. somebody quits], tell the users to call the programmer.
Usually the tech people go beyond this and also add:
  • A forms system to order plungers
  • A status screen to show everyone the status of the plunger orders.
  • A security system to show everyone who has what permissions and to allow them to change the permissions.
What is an easier code-free alternative?
  • Use Sharepoint.
  • Optionally create a site to hold the data.
  • Create a custom list by importing the spreadsheet data.
  • Set Versioning=on for the custom list.
  • Set up the security giving the appropriate people read access and others write access.
  • Optionally, tell the Sharepoint administration group to make sure search works for this site.
  • Test the application security and search functions.
  • Show Bob how to check-in/check out the spreadsheet so versions will be kept.
  • Show Bob how to change the security for the system.
Compare/contrast tech vs. code-free alternatives.


Advantages=Benefits
  • tech - application is *exactly* like the users wants and no more
  • code-free - user can build it themselves
  • code-free - application goes to production much quicker
  • code-free - user can use it immediately, on their own schedule
  • code-free - application is managed by the user (security, et.al.)
  • code-free - application can be changed by the user
  • code-free - other code-free applications will behave the same
Disadvantages=Costs
  • code-free - some SharePoint screens may not be exactly to the users taste
  • code-free - MSoft bug in import needs a workaround
  • code-free - users may proliferate applications that may need cleanup by IT staff
  • tech - a coder is needed
  • tech - application takes much longer to create/test/deploy
  • tech - application is available to the users on IT schedule
  • tech - application needs a coder to manage it (security, et.al.)
  • tech - application needs a coder to change it

The Plungers Ordering system

This is a very simple system. I have seen requests like this from users for many years. Of course, they have their own types of plungers.

The usual scenario, which will also be described here, includes:
  • the business analyst asks the users to describe the requirement
  • the users tell their view of the system in their own words
  • the business analyst translates the user requirement into a set of specifications to tell the coders
  • the coders come up with a design
  • the process of system construction starts ending with a system that meets the users' requirements
Of course this is very simplified and there are many detours to trip us up at each step.

Next I will describe in more detail 2 ways to construct the Plungers Ordering System.

Sunday, March 15, 2009

Helping Users get Solutions Faster (=Cheaper)

For many years users have exploited various shortcuts because we (the IT guys) cannot get the solutions to them fast enough at the speed of business. Everyone knows that a very famous shortcut was when they started ordering Excel & 1-2-3 on the departmental budget. And we all know about the 3GLs and 4GLs.

Since then, and seemingly always, they have the desire to make their own solutions, if not the know-how.

In the last few years a Microsoft platform offering called SharePoint has gained widespread deployment, if not acceptance. In a few organizations I have consulted in, the users tell IT they want it. In some environments, marketing just tells IT to put it up and they say they will learn it themselves. I have seen these types of projects crash as often as succeed, but it does give some measure of the hunger.

SharePoint has a massive front-end, administration and development surface area. We will not cover very much of it. The focus will be on user-perceivable function and architecture.

One of its capabilities is the ability to create so-called no code solutions or almost no code. These approaches still have many kinks to work out, but I believe that it does point towards a future where (a new kind of) business analyst and some educated users can use these tools and the platform to create prototypes, if not applications, in the timeframe that business requires.