/  494
 
THE EXPERT’S VOICE
®
IN STELLENT
Brian “BexHuff
The Definitive Guide to
Stellent
Content ServerDevelopment
 A comprehensive guide and reference for all Stellent administrators and developers 
 
Brian “BexHuff
The Definitive Guide toStellent Content ServerDevelopment
 
The Definitive Guide to Stellent Content Server DevelopmentCopyright © 2006 by Brian Huff
 All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,electronic or mechanical, including photocopying, recording, or by any information storage or retrievalsystem, without the prior written permission of the copyright owner and the publisher.ISBN-13: 978-1-59059-684-5ISBN-10: 1-59059-684-6Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrenceof a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.Lead Editor: Jonathan HassellTechnical Reviewer: Samuel WhiteEditorial Board: Steve Anglin, Ewan Buckingham, Gary Cornell, Jason Gilmore, Jonathan Gennick,Jonathan Hassell, James Huddleston, Chris Mills, Matthew Moodie, Dominic Shakeshaft, Jim Sumser,Keir Thomas, Matt WadeProject Manager: Elizabeth SeymourCopy Edit Manager: Nicole LeClercCopy Editor: Nancy Sixsmith Assistant Production Director: Kari Brooks-Copony Production Editor: Kelly GuntherCompositor: Molly SharpProofreader: Dan Shaw Indexer: Toma MulliganCover Designer: Kurt KramesManufacturing Director: Tom DebolskiDistributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail
orders-ny@springer-sbm.com
, orvisit
http://www.springeronline.com
.For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley, CA 94710. Phone 510-549-5930, fax 510-549-5939, e-mail
info@apress.com
, or visit
http://www.apress.com
.The information in this book is distributed on an “as is” basis, without warranty. Although every precautionhas been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability toany person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work.The source code for this book is available to readers at
http://www.apress.com
in the Source Code section.
 
Layout Manager API
Architecture
The Layout Manager is an APIthat uses JavaScript and Cascading Style Sheets (CSS)to changethe look and feel of the Content Server. This API does not affect the content on the pages; it isused to control the navigation menus. It also controls the Hypertext Markup Language (HTML)at the beginning and ending of every page.The
layouts 
in this API are JavaScript resources that describe which navigation menus arepresent and how they are drawn on the page. The
skins 
are collections of CSS files and imagesthat control the color scheme of the layouts. As demonstrated in Chapter 8, it is easy to alterthe navigation nodes with a component. It is also possible to create new skins and layouts andthen package them into a component.This appendix contains information about the JavaScript API used to create new layoutsor modify the navigation dynamically.
Navigation XML Schema 
The XML schema for the navigation nodesis fairly simple. There are three node types:
navtree
,
item
, and
collection
. The root node must be a
navtree
node. The
item
nodecontainsinformation about a menu link in the navigation. For example, the Check In link, which takes you to the content check-in page, is represented with an
item
node. A 
collection
noderepre-sents a submenu, which can contain other
item
and
collection
nodes (for example, the My Stellent submenu contains links to personalized view of the Content Server). That menu isrepresented with a
collection
node. All nodes must have a unique
id
attribute. The root node’s
id
must be
NAVTREE
. All otherattributes are optional:
collection_service
: Valid only for
collection
nodes. Some collections, such as those ina Folders library, need to run a service before their child nodes can be populated. In thatcase, this attribute is set to the URL to run that service. When clicked, the URL is openedin an invisible
IFRAME
. The resulting HTML page contains JavaScript that populates the
collection
node with its children.
icon
: A URL to an icon image for this node, which is used only when the node is shown ina tree view (for example, the left sidebar in the
Trays
layout). If it is not set, a default
icon
is used.
411
 APPENDIX G
s s s
 
id
: The globally unique id for this node.
label
: The label displayed for this node, such as My Stellent or Check In New.
target
: If the URL for the menu link should be opened in a new window, it is set to thelink’s target.
tray_doc
: Only valid for the
Trays
layout. If a node in the menu should display an HTMLpage instead of a tree view control, set this attribute to the URL of that page. It is used forthe Search Tray.
url
: Only for item nodes. When this menu item is clicked, it follows this URL.
Configuration Flags
 A handful of configuration flags affect the behavior of the Layout Manager:
LmDefaultLayout
: The default layout used by guests and new users. It defaults to
Trays
butit can also be
Top Menus
or
Classic
.
LmDefaultSkin
: The name of the skin used by guests and new users. It defaults to
Stellent
on version 7.0 and to
Stellent05
on version 7.5. It can also be
Collegiate
or
Windows
.
The navBuilder Variables
The
navBuilder
object contains all the XML navigation nodes, as well as pointers to theJavaScript functions used to render XML into HTML. Each navigation area has its own
navBuilder
object, containing its nodes and functions. For example, the menu at the very topis drawn differently from the menu second from the top. The left side tray navigation is alsorendered differently.The global object
coreNav
contains all
navBuilder
objects for all navigation sections.
htmlString
Contains the generated HTML string for this
navBuilder
object. This HTML is generated with acall to
generateChildNodeDisplayCode
based on the data in
xmlDocument
.
menuA
 A 
navBuilder
object containing data for the topmost horizontal menu. This menu is usedmostly for links (
item
nodes), not drop-down menus (
collection
nodes). It is used in the
Top Menus
and
Trays
layouts. To make a node visible here, add it to the main
navBuilder
object in
finishLayoutInit
. Then add its
id
to
menuA.topLevelNodes
 with the function
menuA.addTopLevelNode(...)
.
menuB
 A 
navBuilder
object containing data for the horizontal menu under
menuA
. It is used mostly fordrop-down menus (
collection
nodes) and it is used in the
Top Menus
layout. To make a nodevisible here, add it to the main
navBuilder
object. It or one of its ancestors must also have its
id
in
menuB.topLevelNodes
.
 APPENDIX G
s
LAYOUT MANAGER API
412
 
topLevelNodes
 A standard JavaScript Array containing an ordered list of node ids to display in this navigationsection. To display a navigation node, it or one of its ancestors must have its
id
in the list of 
topLevelNodes
for one of the navigation areas. The navigation areas are named
menuA
,
menuB
,and
trayA
.
trayA
 A 
navBuilder
object containing data for the tray-based navigation section on the left side of the window. It is used in the
Trays
layout. To make a node visible at the top level here, add it to themain
navBuilder
object. It or one of its ancestors must also have its
id
in
trayA.topLevelNodes
.
xmlDocument
The full XML Document object for this
navBuilder
object. It contains all
collection
and
item
nodes. This is initially empty for the
menuA
and
trayA
navigation areas. The nodes are copiedinto navigation areas from the main
navBuilder
object just prior to display.
xmlNodeMap
 An Array of node
ids
and
nodePointer
objects, which contain information about the node’slocations. It helps to find nodes more quickly. The value
nodePointer.location
is a string suchas “0.1.2”, which means that the node is the third child, of the second child, of the first child, of the
xmlRoot
object.
xmlRoot
The
documentElement
node for the
xmlDocument
object.
navBuilder Methods
addChildNodeTo(parentId, nodeType [, attribute1, attribute2, ...])
Constructs a new node and adds it as a child to an existing 
collection
node with an
id
equalto
parentId
. The
nodeType
is the type of the node: either
collection
or an
item
. After this, thefunction can take an arbitrarily long list of attribute strings in the form of 
id==NEW_NODE_ID
.The
id
attribute must be specified; all others are optional.
addPrevSiblingNodeTo(siblingId, nodeType [, attributes])
Constructs a new node, and add it as the previous sibling to an existing node. This function issimilar to
addChildNodeTo
, except that it adds the new node as a sibling, not a child.
addTopLevelNode(nodeId [, beforeNodeId])
 Adds a
nodeId
to the list of node ids in
topLevelNodes
for a specific navigation area. It forcesthe node to be drawn as a top-level menu item. If 
beforeNodeId
is specified, it inserts this nodebefore the node with that id. Otherwise, the node is added at the end. The
beforeNodeId
parameter is available only in version 7.5.
 APPENDIX G
s
LAYOUT MANAGER API
413

Sections

show all« prev | next »

Share & Embed

More from this user

Add a Comment

Characters: ...