Macaw SPS joust menu 1.6

Author: Serge van den Oever, Specialist Developer, Macaw (serge@macaw.nl)

Release date: 26 februari, 2003

 

Home on the net: http://spsutil.sourceforge.net

 

1         Abstract

The Macaw SPS Joust Menu is a tree view web part that allows you to configure a view on information in the Web Storage System (WSS). WSS is the “database” used by SharePoint Portal Server 2001 to store all documents, category trees, dashboard trees and other information. Macaw SPS Joust Menu provides your user a similar interface as the Explorer add in provides when installing the SharePoint Portal Server client tools to browse through your documents, but much more configurable. Select which folders to display, specify filters on the documents to be displayed, which property to display as title, and what action to execute on selection of an item in the tree.

2         A quick intro

Macaw SPS Joust Menu is all about trees, content and beefing up your user experience in the SharePoint Portal Server dashboards…

 

The following pictures will show more than the thousands of words that follow to give you a quick impression!

 

Render a tree view for the Documents folder in SharePoint, note that the items are the same as the icons rendered in the Explorer view using the SharePoint client tools.

 

 

 

Also complete category tree views, using the names of the categories

 

 

 

 

 

 

 

You can also show a tree view of your dashboards! Be able to navigate your complete site, without this “strange” two-line menu navigation mechanism, without reloads to get to deeper levels, and with a complete view of all levels above you!!

 

 

 

 

 

View entries by their title, or any property that you want!

 

 

 

 

 

 

 

 

Respond in other web parts on actions taken in the tree view using a powerful client-side event mechanism.

 

I hope that this quick intro showed you some of the possibilities, and there are many, many more!! But that is described in the thousands of words below… with only a few pictures.

 

Have fun!

3         Introduction

Macaw SPS joust menu is a tree menu to render folders and documents of the SharePoint Portal  Server 2001 WSS. Initially only the top level entries are rendered. Items within folders are retrieved dynamically using a roundtrip to the server when requested.

 

Features:

 

Please let me know if this functionality is useful, when the documentation is not clear, when you find bugs, if you would like to see changed/new features, or need any help.

4         Using the Macaw SPS joust menu

There are two ways that the code for the Macaw SPS joust menu can be used:

  1. Through a virtual directory containing the code
  2. Packaged with the web part

 

Both approaches have their advantages and disadvantages.

4.1      Virtual directory containing code

Advantages:

 

Disadvantages:

4.2      Code packaged with web part

Advantages:

 

Disadvantages:

4.3      Approaches taken

Mutiple versions of the web part are available:

 

Macaw SPS Joust Menu.dwp (embedded code)

Macaw SPS Joust Menu - virtual directory.dwp (code through virtual directory)

+ many more showing some configuration features (all on the virtual directory version, if you want to use the embedded code version (no virtual directory install needed), copy the configuration!

 

My preference is to use the Macaw SPS joust menu web parts that use the virtual directory (Macaw SPS Joust Menu – virtual directory.dwp and others).

5         Configuring the virtual directory

Configure the virtual directory where the Macaw SPS Joust Menu is hosted with the same security settings as used for the virtual directory of jour portal. To review the security settings of your portal do the following:

 

  1. Open the Internet Information Services (StartàProgramsàAdministrative ToolsàInternet Services Manager)
  2. Right click on the virtual directory of your portal (don’t mind the red error sign in front of the portal virtual directory, has to do with the order of initialization of IIS and the Web Storage System , select Properties
  3. Select the tab “Directory Security”
  4. Select “Edit” on “Anonymous access and authentication control”
  5. Review the settings, apply the same settings to the MacawSPSJoustMenu virtual directory as described below.

The virtual directory for MacawSPSJoustMenu virtual directory should be configured as follows:

 

  1. Open the Internet Information Services (StartàProgramsàAdministrative ToolsàInternet Services Manager)
  2. Right click on “Default Website”, select NewàVirtual Directory
  3. Create a virtual directory named MacawSPSJoustMenu (if it does not already exist)


  4. Specify the directory containing the MacawSPSJoustMenu code. For example you could copy it from the package to the directory c:\inetpub\wwwroot.
  5. Use the default access permissions
  6. Select the properties of the MacawSPSJoustMenu virtual directory and select the “Directory Security” tab.
  7. Select “Edit” on “Anonymous access and authentication control”
  8. Configure the authentication settings as reviewed on the portal virtual directory. Normally: deselect “Anonymous access”. Based on your security approach select “Integrated Windows authentication” or “Basic authentication” (or both). The Macaw SPS joust menu accesses SharePoint using the current security settings.
  9. Done!

 

The MacawSPSJoustMenu virtual directory contains the code for the tree control. The tree control web parts will access the code through the url http://<servername> /MacawSPSjoustMenu.

6         Using the Macaw SPS joust menu web parts

The installation of the Macaw SPS joust menu web parts is simple, use “Import a Web Part File…” option in the Content screen and browse to the “Macaw SPS Joust Menu.dwp” file or “Macaw SPS Joust Menu – virtual directory.dwp” file (or one of the other examples!). When the “Macaw SPS Joust Menu.dwp” file is imported, all related content in the “Macaw SPS Joust Menu_Files” is also installed. For the “Macaw SPS Joust Menu – virtual directory.dwp” web part (and other “virtual directory” examples) the MacawSPSjoustMenu virtual directory must be configured first (see above).

 

The web part can be configured through the “urn:schemas-microsoft-com:webpart:PartStorage” attribute (Part Storage field in Advanced Settings in the settings screen of the web part). In the previous versions od Macaw SPS Joust Menu this field contained the configuration in XML. This approach was not easy and clear enough. The current version contains a configuration file in the following format:

 

workspace=_WORKSPACE_

url=_WORKSPACE_

openurl=_WORKSPACE_

rememberstate=showactive

charset=utf-8

folderdisplayproperty=

filedisplayproperty=urn:schemas-microsoft-com:office:office#Title

roottext=Documents

rooturl= _WORKSPACE_/Documents

rooticon=_WORKSPACE_/Portal/resources/DocTypeIcons/urn-content-classes-folder16.gif

showhidden=false

linkonfolder=true

foldersonly=false

modalfolders=false

DDSCevents=false

checkimage=false

texttarget=_blank

foldertarget=_top

querySelect=

querywherefirst=

querywhereother=

queryorder=

debug=false

 

Where three replacement variables are available:

_SERVER_                  Replaced by the name of the server, for example http://sergelaptop

_WORKSPACE_        Replaced by the name of the workspace, for example http://sergelaptop/serge

_CURRENTURL_       Replaced by the current URL within the portal, can be used in the ‘openurl’ parameter to have the menu opened at the correct entry when used on the “Document Library” dashboard or the “Categories” dashboard, or when used to display the dashboards tree.

6.1      Macaw SPS joust menu configuration

Requires parameters:

workspace=...

Name of SharePoint workspace we are working on

url=...

URL to menu root folder within SharePoint WSS (in canonicalized Utf8 format).


Optional parameters:

openurl=...

URL within the menu to be displayed as initial open entry (in canonicalized Utf8 format).

charset=...

character set to be used for menu rendering, default: utf-8, can be set to other character set

rememberstate=none|showactive|doclick

'none' means don't remember last state menu was in, 'showactive' means remember state, and on next view show the last selected entry as "active", 'doclick' means same as ‘showactive’, but also activate the action as if the menu entry displayed as selected is clicked

folderdisplayproperty=...

Specify a property as display name for folder tree entries; for example urn:schemas-microsoft-com:webpart:Title for dashboard folders (optional, default DAV:displayname)

filedisplayproperty=...

Specify a property as display name for file tree entries; for example urn:schemas-microsoft-com:office:office#Title for documents (optional, default DAV:displayname)

roottext=...

Display a root node, this is the text to display

rooturl=...

URL to link to on the root node

rooticon=...

path to icon to be used for root node, if no http://, assume from root of workspace

showhidden=true|false

Show/Don't show folders/files with hidden attribute (optional, default false)

linkonfolder=true|false

If true, clicking on folders will jump into the folder, if false clicking on folders will expand/collapse. Folders are opened in the foldertarget (optional, default false)

foldersonly=true|false

If true only folders are shown (and linkonfolder is overriden to true), if false also files are shown in the tree (optional, default false)

modalfolders=true|false

If true only one folder can be open at any particular moment (unless it's a sub-folder in which case its Parents will remain open) (optional, default false)

DDSCevents=true|false

If true DDSC events are fired on selection of files/folders. On selection of folders (if linkonfolders is true) the function DDSC.RaiseEvent("urn:schemas-microsoft-com:dhtml", "onMacawSPSjoustMenuFolderSelect", strFolderURL) is called. On selection of files the function DDSC.RaiseEvent("urn:schemas-microsoft-com:dhtml", "onMacawSPSjoustMenuFileSelect", strFileURL) is called.

checkimage=true|false

If true, icon images based on content class for folders and extension for files are checked for existance, and if image does not exist it is replaced with a default image. If false this check is not performed, and no image is shown if not available (white box with dot in center is displayed on IE) (optional, default is false)

texttarget=...

Target to display document (optional, default "_blank", use "text" for text area (not really supported anymore, textarea is hidden), or "_top" to replace content in current window)

foldertarget=...

Target to display folder (optional, default "_top", use "_blank" for new window)

querySelect=...

extra properties to select, needed for where or order part of clause. Enclose in double quotes, seperate by comma's

querywherefirst=...

Where part for first level of tree

querywhereother=...

Where part for deeper levels of tree

queryorder=...

Ordering of the results

debug=true|false

If true some extra information is displayed in the menu for debugging purposes

 

Some URL parameters must be specified in canonicalized Utf8 format. This means that special characters and accentuated characters are encoded using %xx coding style. You can use the provided web part “Macaw SPS Canonicalized Utf8 Converter.dwp” to get the current url and a specified url in canonicalized Utf8 format.

 

Some interesting features available through the above configuration:

 

Configure the character set we are working in (the default utf-8 will do for most situations)

 

Remember the content of the menu, so it opens at the same node when returning to the dashboard containing this tree. Note that this is an extra performance penalty, we have to read level by level the nodes, multiple roundtrips to the server (done at server side).

 

Specify separate display properties for the tree entry names for folders and files.

 

Optional specification of a “root” entry (text and icon) [Thanks to Steven Collier for the request]. You can also set an URL on this root entry that will be “executed” when the root entry is clicked.

 

Do/don’t show hidden files (sometimes you need to show the hidden files, for example to show the dashboard tree, those items are hidden)

 

Modal folders is handy if remember state is also on. Because rememberstate can only reconstruct the last opened folders, not all folders opened and closed in the meantime. Performance penalty would be too high. Using modal folders reflects this situation better (although I don’t really like this kind of operation in a tree).

 

DDSC events are generated on folder/file selection

 

The web part can be used in two modes:

NOTA BENE: THIS DUAL DISPLAY IS NOT SUPPORTED ANYMORE (ALTHOUGH IT COULD BE ENABLED IN index.asp BY SETTING THE “text” IFRAME TO A GIVEN SIZE.

 

Target window specification for documents and folders

 

Advanced extra selection and ordering filters.

 

Currently only one URL folder can be specified. The contents of this folder will be displayed as top-level entries. If request for it come, I will extend this to the selection of multiple URL’s, in this case those URL’s will be the top-level entries. For example only the /Categories and /Documents entries. Can be solved using filtering, see examples!!!

 

Examples:

 

Two column, menuwidth=210, textwidth=* (means fill remainings), texttarget=text.

 

Two single column views, on categories and portal content. menuwidth=100%, textwidth=*, texttarget=_blank. [NOT POSSIBLE ANYMORE, WILL BE UPDATED]

7         Example configurations

This section describes some common used configurations to provide useful functionality within your portal.

 

Note that the configurations.txt file in the web parts directory of the Macaw SPS Joust Menu distribution contains a bunch of sample configurations.

7.1      Document Library tree

Interesting configuration for usage on the “Document Library” dashboard.

Folders only, only folders as shown in SharePoint, change querywherefirst for other languages. If people have a more language independent approach, please let me know.

 

workspace=_WORKSPACE_

url=_WORKSPACE_

openurl=_CURRENTURL_

rememberstate=none

charset=utf-8

folderdisplayproperty=

filedisplayproperty=urn:schemas-microsoft-com:office:office#Title

roottext=Documents

rooturl= _WORKSPACE_/Documents

rooticon=_WORKSPACE_/Portal/resources/DocTypeIcons/urn-content-classes-folder16.gif

showhidden=false

linkonfolder=true

foldersonly=true

modalfolders=false

DDSCevents=false

checkimage=false

texttarget=_blank

foldertarget=_top

querySelect=

querywherefirst=(("DAV:isfolder"=true AND "DAV:displayname"='Dashboards') OR ("DAV:isfolder"=true AND "DAV:displayname"='Documents') OR ("DAV:isfolder"=true AND "DAV:displayname"='Portal Content') OR "DAV:isfolder"=false)

querywhereother=

queryorder=

debug=false

Version which shows only the folders, and not that help file in the root directory. Exactly same view as SharePoint “Document Library” view.


workspace=_WORKSPACE_

url=_WORKSPACE_

openurl=_CURRENTURL_

rememberstate=none

charset=utf-8

folderdisplayproperty=

filedisplayproperty=urn:schemas-microsoft-com:office:office#Title

roottext=Documents

rooturl= _WORKSPACE_/Documents

rooticon=_WORKSPACE_/Portal/resources/DocTypeIcons/urn-content-classes-folder16.gif

showhidden=false

linkonfolder=true

foldersonly=true

modalfolders=false

DDSCevents=false

checkimage=false

texttarget=_blank

foldertarget=_top

querySelect=

querywherefirst=(("DAV:isfolder"=true AND "DAV:displayname"='Dashboards') OR ("DAV:isfolder"=true AND "DAV:displayname"='Documents') OR ("DAV:isfolder"=true AND "DAV:displayname"='Portal Content') OR "DAV:isfolder"=false)

querywhereother=

queryorder=

debug=false

 

The tree will display the directory open in the Document Library, on click on a directory in the tree control, the Document Library will display the corresponding files.

 

A first step to the replacement of the current Document Library functionality into a more intuitive one!

 

Only problem is that in the top level view the Document Library only displays the entries:

 

While the above configuration gives the following entries:

 

If requests for it will come, I will implement the multiple url feature described in the wishlist. [NOTE: IS SOLVED BY ABOVE CONFIGURATION!]

7.2      Dashboards tree

 

7.3         Show a tree of dashboards, opened to the dashboards level the web part is on.

workspace=_WORKSPACE_
url=_WORKSPACE_
openurl=_CURRENTURL_
rememberstate=none
charset=utf-8
folderdisplayproperty=urn:schemas-microsoft-com:webpart:Title
filedisplayproperty=urn:schemas-microsoft-com:webpart:Title
roottext=Dashboards
rooturl=_WORKSPACE_
rooticon=_WORKSPACE_/Portal/resources/DocTypeIcons/urn-content-classes-folder16.gif
showhidden=true
linkonfolder=true
foldersonly=true
modalfolders=false
DDSCevents=false
checkimage=false
menuwidth=100%
textwidth=0
texttarget=_blank
foldertarget=_top
querySelect="urn:schemas-microsoft-com:webpart:DashboardOrder"
querywherefirst="DAV:contentclass"='urn:schemas-microsoft-com:dashboard'
querywhereother="DAV:contentclass"='urn:schemas-microsoft-com:dashboard'
queryorder="urn:schemas-microsoft-com:webpart:DashboardOrder" asc
debug=false

7.4      Categories tree

Interesting configuration for usage on the “Categories” dashboard:

 

workspace=_WORKSPACE_

url=_WORKSPACE_/Categories

openurl=_CURRENTURL_

rememberstate=none

charset=utf-8

folderdisplayproperty=

filedisplayproperty=urn:schemas-microsoft-com:office:office#Title

roottext=Categories

rooturl= _WORKSPACE_/Categories

rooticon=_WORKSPACE_/Portal/resources/DocTypeIcons/urn-content-classes-rootcategoryfolder16.gif

showhidden=false

linkonfolder=true

foldersonly=true

modalfolders=false

DDSCevents=false

checkimage=false

texttarget=_blank

foldertarget=_top

querySelect=

querywherefirst=

querywhereother=

queryorder=

debug=false

 

The tree will display the folder open in the Categories, on click on a folder in the tree control, the Categories will display the corresponding information.

 

8         Using as stand-alone page

If the virtual directory is created as described above, you can access the the Macaw SPS joust menu at the following URL: 

 

http://<servername>/MacawSPSjoustMenu/index.asp?...

 

Examples:

 

…/index.asp?workspace=http://sergelaptop/serge&url=http://sergelaptop/serge/Documents

 

…/index.asp?workspace=http://sergelaptop/serge&url=http://sergelaptop/serge/Documents&showhidden=false&texttarget=_blank&foldertarget=_blank

9         Styling the menu

The visual appearance of the menu items are managed in the JoustStyles CSS as defined at the top of menu.htm:

 

<STYLE ID="JoustStyles" TYPE="text/css">

<!--

.menuItem {position:absolute; visibility:hidden; left:0px;}

.menuItem BR { clear: both; }

.node { color: black;

        font-family : "Helvetica", "Arial", "MS Sans Serif", sans-serif;

        font-size : 9pt;}

.node A:link { color: black; text-decoration: none; }

.node A:visited { color: black; text-decoration: none; }

.node A:active { color: black; text-decoration: underline; }

.node A:hover { color: red; text-decoration: underline; }

.leaf { color: black;

        font-family : "Helvetica", "Arial", "MS Sans Serif", sans-serif;

        font-size : 9pt;}

.leaf A:link { color: black; text-decoration: none;}

.leaf A:visited { color: black; text-decoration: none; }

.leaf A:active { color: black; text-decoration: underline; }

.leaf A:hover { color: red; text-decoration: underline; }

-->

</STYLE>

 

Currently we configured a red color and underline for hovered over folders and documents and underline for the currently active folder or document. Play with it and amaze yourself.

10   What is new

Version 1.6:

Version 1.5 [bug release]:

 

The file menu.asp contains two scenarios for solving the problem:

 

a.       A redraw of the menu

b.      A complete refresh of the iframe

 

First the first scenario should be tried, if this does not work try the second scenario (currently commented out).

 

To find the two scenario’s: search the file menu.asp for the following code:

 

function RedrawMenuAfterIFrameResize()

{

      // option 1: refresh the DHTML

      if (theMenu) {

            theMenu.refreshDHTML();

      }

      // option 2: reload, a complete rebuild of the menu is done

      //document.location.href = document.location.href;

}

 

 

Version 1.4:

11   Known “features”

 

à    Should be solved now (version 1.2), menu contains entry “*** ERR: Table does not exist. ***” in case of incorrect url specified.

 

 

12   Wishlist

13   Thanks to….

14   History

Version 1.0: initial version

Version 1.1: Major rewrite, many new options

Version 1.2: Bug fixes and minor changes

-         linkonmenu only worked when DDSCevents was set to true. FIXED.

-         French users still had problems with the character encoding. Encoding is now configurable (charset option). Hope this solves the problem. Please let me know your experiences with other character encodings…

-         Improved error handling (should solve hangings on incorrect parameters like unknown url).

Version 1.3: Bug fixes and additional features

-         Again some character encoding issues solved

-         openurl parameter added

-         debug parameter added

Version 1.4: Major rewrite, many new features, some bugs solved.

Version 1.5: Bug fix release

Version 1.6: Bug fix release + interactive configuration support.

15   License

Due to the fact that most part of the code is based on the Joust Outliner, this code is distributed under the same licensing conditions as the Joust Outliner as described below. Some additional statements are added to this license for the SPS specific code.

15.1Preamble

We request that publicly available Web Sites using Joust provide a suitable acknowledgement and a link to our site. Promoting Joust in this fashion will help to grow our user community, thus providing us with stimulus for the continued development and support of Joust. This is a request, not a requirement. The Software Licence, below, explains the requirements for using Joust.

15.2Software Licence

Joust Outliner Version 2.5.3
(c) Copyright 1996-2001, MITEM (Europe) Ltd. All rights reserved.

Macaw SPS joust  menu Version 1.6
© Copyright 2002-2003, Serge van den Oever (Macaw).
All rights reserved.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

The copyright notice must not be modified or removed from any of the source code. If the source is reorganised into different files (*.js files, for example) then the copyright notice must be included in each file that contains some or all of the original source.

Redistributions of source code must retain all copyright notices in the source and must be accompanied by this license.

Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

Neither the name of MITEM (Europe) Ltd nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY ORIGINAL CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.

The Joust design and JavaScript code remain the intellectual property of MITEM (Europe) Ltd. © Copyright 1996-2001. All rights reserved.

The Macaw SPS joust menu design and JavaScript/VBScript code remain the intellectual property of Serge van den Oever, Macaw. © Copyright 2002-2003. All rights reserved.