5/23/2009

SharePoint: The List, the Whole List, Nothing but the List

 

SharePoint does not provide a clean way to display or print just a list or library. It only displays the list inside of the master page and that includes all of the navigation, search and graphics.

Here are a few workarounds:

Here is the goal:

The list, the whole list, nothing but the list (and maybe a crumb trail…)

 

 

There are two ways to do what we need. Plan "A" below is "educational" to let you see how it is all done. Plan "B" is the easiest.

After completing the steps below add a link to this new page in Quick Launch, a links list or as a link from some other page.

 

Plan "A" - Create it all in SharePoint Designer

Open SharePoint Designer
Open your site
Right-click in the Folder List on the project root (the first item in the list: http://yoursite)
Select New and ASPX
Rename the file (JustTheList.aspx, etc)

Double click the new file and select the Design view
Select Insert, SharePoint Controls, Web Part
From the Web Parts pane select your list or library and drag it into the Design View of your new page.
Done... ugly, but a working list only page.
Save it and test in a browser (F12 is the shortcut to open the current page)

Now to make it pretty...

We need the Core.css, and optionally the Theme CSS, CSS files linked to this page. You could manually create the <link> tags, but it's easier to copy what you need from the default.master page.

Add this just above the <html> tag:

<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

Add this somewhere between the <head> and </head> tags:

<SharePoint:CssLink runat="server"/>
<SharePoint:Theme runat="server"/>

If your master page has any custom CSS, add that here too.

Almost there.

Now it looks like a SharePoint list. But it has a title that you may not want and it has the toolbar.

Some properties can be changed from the Design view by right-clicking the web part and selecting Web Part Properties. There you can change most web part properties, except for the view for the list and turning toolbar on or off.

So go ahead and change the title or hide it by setting "Chrome" to none.

To remove the toolbar requires a little code editing.
Display the code view of the page and search for "toolbar".
Change
  Toolbar Type="Standard"
to
  Toolbar Type="None"

Changing the displayed view... Now here's problem. The view is defined by the XSLT embedded in the web part. If you want to pick another view, then it's time for plan "B".

 

Plan "B" - Copy and paste it all...


Open the site in a browser
Go to Site Actions, Create and create a Web Part Page (this is a temporary file, so any name and library will do)
Click Add A Web Part and pick your list or library.
Select Edit, Modify Shared Web part and make all of your customizations.
Click Exit Edit Mode
Open SharePoint Designer
Open your site
Right-click in the Folder List on the project root (the first item in the list: http://yoursite), or select an existing library such as Shared Documents.
Select New and ASPX
Rename the file (JustTheList.aspx, etc)
Double click the new file and select the Design view
In the Folder List browse to the library where you saved the new page and double click the new page to open it
Switch to the Code view and search for "<WebPartPages:ListViewWebPart"
Copy from this start tag to the matching end tag.
Go back to your new page and paste the web part code between the <form> tags.
Save it and test in a browser (F12 is the shortcut to open the current page)

Final cleanup?

  • Add some HTML comments about how you did all of this, or maybe a comment with a link to this artile, so you can fix this up in the future.
  • Find the <title> tags at the top of the page and add a proper title to display at the top of the browser and as the title for Favorites.

And I suppose you want a crumb trail too...
The default crumb trail in the master page looks like this:

<asp:SiteMapPath
    SiteMapProvider="SPContentMapProvider"
    id="ContentMap"
    SkipLinkText=""
    NodeStyle-CssClass="ms-sitemapdirectional"
    runat="server"/>

Strangely this does not display the folders of a library as you drill down using the web part. I tried most of the things I found on the web and none have worked. So as a temporary workaround I created some JavaScript to emulate the crumb trail feature.

JavaScript crumb trail:

<div id="navtrick" class='ms-globalbreadcrumb' style="text-align:left;" ></div>
<script>
fullURL = parent.document.URL
splitURL = fullURL.substring(fullURL.indexOf('?')+1, fullURL.length).split("&")
siteURL = fullURL.substring(0,fullURL.indexOf('?'), fullURL.length)
siteURL = siteURL.substring(0,siteURL.lastIndexOf('/') );
rootURL = fullURL.substring(0,fullURL.indexOf('?')) + "?RootFolder="
path = unescape(splitURL[0].split("=")[1])
folders=path.split("/")
document.all("navtrick").innerHTML = " <a href='" + siteURL + "'>Home</a>"
for (i=1;i<folders.length;i++)
{
  rootURL += "/" + folders[i]
  document.all("navtrick").innerHTML += " &gt; <a href='" + rootURL + "'>" + folders[i] + "</a>"
}
</script>

 

Presented as is… no guarantees… Have fun!

5/22/2009

SharePoint: Service Pack 2 Released - Improved Forms Based Authentication!

Microsoft has just released Service Pack 2 for WSS and MOSS!

Update! SP2 can change your license expiration date! It changes your license to a 180 day evaluation license.

The fix is easy. See here: http://blogs.msdn.com/sharepoint/archive/2009/05/21/attention-important-information-on-service-pack-2.aspx

 


A number of fixes and improvements are listed, but one that stands out to me is that Office itegration now works with Forms Based Authentication (FBA). This has always been a sore spot to anyone using FBA. What I'm not clear on yet is if this only applies to Office 2007... testing will tell.

Update! I’ve tested it and it works! See here for details:

http://techtrainingnotes.blogspot.com/2009/05/sharepoint-with-service-pack-2-sp2.html

 

 

Here's the TechNet articles:

WSS:
http://technet.microsoft.com/en-us/library/cc288043.aspx
MOSS:
http://technet.microsoft.com/en-us/library/cc262201.aspx


Here's the key text (Note comments on Outlook):

If you have not installed Microsoft Office SharePoint Server 2007 with Service Pack 2 (SP2), client integration is disabled by default when you use forms-based authentication. This is because client integration does not natively support forms-based authentication prior to Office SharePoint Server 2007 with SP2. When client integration is disabled, links to client applications are not visible and documents cannot be opened in client applications; documents can only be opened in a Web browser. However, users can download documents, edit them in client applications locally, and then upload them to the site.
If you have installed Office SharePoint Server 2007 with SP2, client integration is supported, except for Outlook integration. All other client integration is supported, including SharePoint Designer authoring.

5/20/2009

Adobe 64 bit PDF iFilter Finally

    ( was (Adobe 64 bid PDF iFilter (sort of) )

Time to update this item… Adobe has released a 64 bit version of their iFilter: (the file date in the download is 11/26/08)
 
and they have tested it with:

• Microsoft Windows Server® 2003 x64 Edition R2 with Service Pack 2: SharePoint Server 2007, Exchange Server 2007, Windows Desktop Search 3
• Microsoft Windows Server 2008 x64 with Service Pack 1: SharePoint Server 2007, SQL Server 2005, Windows Search 4

 
For an interesting comparison of the Adobe 64 bit iFilter vs the FoxIt 64 bit iFilter see:
(FoxIt is 5 times faster!?)
 
 
 
 
The older stuff….
 
Word around the blogs is that Adobe has finally released a 64 bit PDF iFilter. Not true! (as of 12/5/07 anyway) What they have released is a workaround that lets you install their 32 bit iFilter on a 64 bit system. Here's the URL:
http://labs.adobe.com/wiki/index.php/PDF_iFilter_8_-_64-bit_Support

If you are running the 64 bit version of MOSS Indexing then you need the 64 bit versions of your iFilters, or the Adobe 32 bit workaround. You still may want to consider the FoxIt 64 bit PDF iFilter. Do a some blog searches and see what people are saying about features and performance. The FoxIt version sounds pretty good!

http://www.foxitsoftware.com/pdf/ifilter/



5/18/2009

SharePoint: Conventions and Shows

 

Upcoming SharePoint Conferences and Events


SPTechCon: The SharePoint Technology Conference Boston!
June 22-24, 2009
http://www.sptechcon.com

 

Best Practices Conference
August 24-26, 2009 - Washington, D.C.
http://www.bestpracticesconference.com/

 

SharePoint Conference 2009 - Las Vegas
October 19-22, 2009
http://www.mssharepointconference.com

5/17/2009

SharePoint 2010 News!

 

Search the web… lots of rumors out there… (and by the way, it’s now just “Microsoft Server 2010”, no more MOSS)

 

The “Official” Sneak Preview Site:  watch these videos!

http://sharepoint.microsoft.com/2010/Sneak_Peek/Pages/default.aspx

 

Some videos from Partner’s Conference in New Orleans:

Visio Services
http://www.youtube.com/watch?v=pW-AjRO5YyY

Access Services
http://www.youtube.com/watch?v=79D_r17fnnA

Microsoft SharePoint Workspace 2010
(And if you watch carefully you will see some “home page” screens and some interesting stuff in the Site Actions menu)http://www.youtube.com/watch?v=QNUxYjFJEs4

 

Blog articles… (popping up everywhere!)

http://knowledgeforward.wordpress.com/2009/07/18/a-first-look-at-sharepoint-2010/

http://kalsing.blogspot.com/2009/07/accessing-business-data-with-sharepoint.html

 

 

Here’s something that‘s at least “official”:

Announcing SharePoint Server 2010 Preliminary System Requirements

http://blogs.msdn.com/sharepoint/archive/2009/05/07/announcing-sharepoint-server-2010-preliminary-system-requirements.aspx

 

And in preparation for Server 2008:

Windows Server 2008 and SharePoint Resources

http://blogs.msdn.com/sharepoint/archive/2008/01/16/windows-server-2008-and-sharepoint-resources.aspx

 

Computerworld says 2010 (invitation-only) beta due in two months:

http://news.idg.no/cw/art.cfm?id=48E662D2-1A64-67EA-E4337461F8125E8C

 

ZDNet: 201 will have a “Ribbon”, Silverlight, more search options:

http://blogs.zdnet.com/microsoft/?p=2761&tag=nl.e539

SharePoint: STSADM notes

 

  • A new Silverlight based help tool!
  • Charts!
  • A GUI!
  • A speed up!

 

A new Silverlight based help tool!

This is a pretty cool tool to both browse the commands and documentation, but to also see what’s new in each service pack.

For WSS:
http://technet.microsoft.com/en-us/windowsserver/sharepoint/dd418924.aspx

For MOSS:
http://technet.microsoft.com/en-us/windowsserver/sharepoint/dd418924.aspx

Charts!

Microsoft has wall sized charts for WSS and MOSS STSADM commands:

Remember… STSADM is extendable and will generally have commands added with each service pack. Here’s how to add your own extensions (for .Net developers!):
http://msdn.microsoft.com/en-us/library/bb417382.aspx

Some examples of additional STSADM commands:

http://stsadm.blogspot.com/

 

Microsoft Reference

A list of STSADM commands and documentation is here:
http://technet.microsoft.com/en-us/library/cc263384.aspx

 

A GUI for STSADM!

“stsadmWin 2007 is here”http://blogs.msdn.com/ronalus/archive/2007/01/04/stsadmwin-has-an-2007-version.aspx

 

STSADM slow???

http://www.dynasign.nl/blog/?p=9

5/16/2009

SharePoint: A better Yes/No field for surveys and lists

 

The out of the box Yes / No column type in SharePoint just displays a checkbox with no text next to it. If you are using it in a survey then you have biased the question as the field is either pre-unchcecked or pre-checked. (and it defaults to YES!)

The workaround? Just use a Choice field with two choices “Yes” and “No”. When used in surveys the end result is exactly the same as Yes/No and it defaults to neither choice selected.

And, you can be more verbose when needed: “Yes I agree” / “No I don’t agree”.

 

Both a normal Yes/No and the Choice Yes/No in a survey (or list) form.

The survey report:

5/15/2009

Silverlight: A few notes on HTML / JavaScript access from Silverlight

 

You can call into a Silverlight control from JavaScript in the HTML page and access Silverlight managed code properties and methods. The process is relatively straight forward really lets you use a Silverlight object as a true control, and not just a fancy animated advertisement (Sorry Flash designers…)

I will follow shortly with notes on the other half of the picture, accessing HTML objects and JavaScript functions from Silverlight code.

 

 

Accessing data / method in Silverlight from JavaScript

Step 1:  Add a reference

Add a reference to System.Windows.Browser, and add a using or Imports to your code file.

        using System.Windows.Browser;

 

Step2: Mark the item or class to be scriptable

The item can be either a property or a method. The attribute is [ScriptableMember] (<ScriptableMember> in VB.Net). Some examples show [ScriptableMemberAttribute], but the short form is preferred.

A sample property:

        private int x=9;

        [ScriptableMember]
        public int MyProperty { get { return x; } set { x = value; } }

 

The entire class can be marked as Scriptable using [ScriptableType], but note that all public members are then available for access from JavaScript.

See notes at the end of this article for more info on the use of the attributes.

 

Example:

or the entire class (warning: all publics are exposed)
[ScriptableType]
public class Calculator2
{
    public int Add(int a, int b)
       { return a + b; }

    public int Subtract(int a, int b)
    { return a – b; }
}

 

Step 3: Register the class as scriptable

Register the class as scriptable either in the app.xaml.cs, but more likely in yourpage.xaml.cs file.

Example if registered from Page.xaml

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            HtmlPage.RegisterScriptableObject("Page", this);

        }

Example to register another class:

         private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {

            HtmlPage.RegisterScriptableObject("MyPage",  new Class1());

        }

 

Step 4: Make the call from the HTML page:

This example makes the call from a button, but could also be done from the <BODY> onload event or the Siverlight control’s load event.

    <script>
    function GetSomeData() {
        sl = document.getElementById("Xaml1");
        alert(sl.Content.Page.MyProperty);
     }
    </script>
    <button onclick="GetSomeData()" >Get Data</button>

or as a single line:
        <button onclick="sl = document.getElementById('Xaml1');alert(sl.Content.Page.MyProperty);" >Get Data 2</button>

or even...
        <button value="Get Data" onclick="alert(document.getElementById('Xaml1').Content.Page.MyProperty);" >Get Data 2</button>

 

Some observations and discoveries…

  • Both attributes are not needed!
    Some sources say that both the class must be marked as [ScriptableType] and the property or method must be marked as [ScriptableMember]. I found that just marking the class as [ScriptableType] made all public members script accessible. I also found that marking a property or method as [ScriptableMember] was all that was needed to expose the one member. It was not necessary to mark up the class at all.

    And I would say that Microsoft agrees with me!  ;-)
    http://msdn.microsoft.com/en-us/library/system.windows.browser.scriptabletypeattribute(VS.95).aspx
  • “ScriptableTypeAttribute Class - Indicates that all public properties, methods, and events on a managed type are available to JavaScript code when they are registered by using the RegisterCreateableType method.”

    “If you want to expose only a subset of properties, methods, and events as scriptable endpoints, do not use a ScriptableTypeAttribute object. Instead, attribute the subset of properties, methods, and events with a ScriptableMemberAttribute object.”

    If you do choose to use [ScriptableType] and want to hide one of the public members mark it with:

       [ScriptableMember(EnableCreateableTypes = false)]

    Note: the preferred notation for the attributes excludes the word “Attribute”, so use [ScriptableType] and [ScriptableMember].

     

  • "HtmlAccess=Enabled" is not needed for calls INTO Silverlight, only to enable calls out.
      <asp:Silverlight ID="Xaml1" HtmlAccess=Enabled ...

 

Useful web resources:

SharePoint: Survey Options – Show user names and Allow multiple responses…

 

Trying to find how to change these two Survey list options after you have created the survey?

  • Show user names in survey results?
  • Allow multiple responses?

Based on using other types of lists you would expect to find these in the “Advanced settings” section. For a Survey they put them in “Title, description and navigation”. Go figure…

5/02/2009

SharePoint: With Service Pack 2 (SP2) Forms Based Authentication and Client Integration Works!

 

Forms Based Authentication (FBA) now works with Office Integration! But only for Office 2007 Service Pack 2.

 

Here are my tests:

 

Tests were done on a VPC with SharePoint and Office on the same VPC.

The VPC started with Server 2003 Std Edition, MOSS Enterprise Edition SP1 and Office 2003 Std Edition

Installed WSS SP2 and MOSS SP2

SP2 install instructions: http://fabianwilliams.spaces.live.com/Blog/cns!DC80CE4E9C963237!536.entry

Created a new application, site collection and configured FBA in a typical manner using the ASP.Net membership and role providers.

Client Integration was disabled by default! (in spite of what was said in the MSDN articles.)  In enabled Client Integration for these tests.

Tests with Office 2003

  • Upload Multiple worked!
  • Open in Microsoft Word - did not work, instead it opened login.aspx as a Word document!
  • Export to Spreadsheet – did not work: "To export a list, you must have a Windows SharePoint Services-compatible application"
  • Connect to Outlook – did not work: "error (0x8004110): 'An error occurred either in Outlook or Windows SharePoint Services...."

So, except for Upload Multiple, Client Integration does not work with Office 2003.

Office 2007 (Enterprise Edition) initial release 12.0.6213.1000

  • Open in Microsoft Word - Word launched, but no errors, nothing, just empty word.
  • Open from Word using full URL to document. ("Could not open "http://.....")
  • Connect to Outlook - Displayed normal SharePoint to Outlook messages, but then displayed an emtpy calendar, so the calendar was created in Outlook, but the data was not linked. Clicking on calendar displays the "read only" message usually seen in Outlook 2003.
  • Export to Spreadsheet - "You do not have adequate permissions to modify this list ..."

So, except for Upload Multiple, Client Integration does not work with Office 2007 (without SP2).

 

Office 2007 (Enterprise Edition) SP2

  • It all works! (with one extra click)
  • Open in Microsoft Word – displays a login page (looks just like login.aspx) and after logging in display the document (and saves it) just fine.
  • Connect to Outlook, Export to Excel both fail… but….
  • If you checkmark “Sign me in automatically” while logging in then every thing I have tested so far works.
    • Connect to Outlook works
    • Export to Excel works

So as long as you checkmark “Sign me in automatically” when you login FBA now supports Client Integration!

How does it work?

Cookies. Deleting cookies in the middle of a session will break Client Integration.

If you have written your own custom membership provider or your own custom login page then you will need to implement a “remember me” feature using an ASP cookie.

 

More tests needed…. Does Client Integration work with Office 2007 SP2 without WSS or MOSS SP2???  Don’t know yet…

 

.

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.