Beruflich Dokumente
Kultur Dokumente
Version: 5.5
FATWIRE, CORP. PROVIDES THIS PUBLICATION AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. In no event shall Fatwire be liable for any loss of profits, loss of business, loss of use of data, interruption of business, or for indirect, special, incidental, or consequential damages of any kind, even if Fatwire has been advised of the possibility of such damages arising from this publication. Fatwire may revise this publication from time to time without notice. Some states or jurisdictions do not allow disclaimer of express or implied warranties in certain transactions; therefore, this statement may not apply to you. Copyright 2003 Fatwire, corp. All rights reserved. This product may be covered under one or more of the following U.S. patents: 4477698, 4540855, 4720853, 4742538, 4742539, 4782510, 4797911, 4894857, 5070525, RE36416, 5309505, 5511112, 5581602, 5594791, 5675637, 5708780, 5715314, 5724424, 5812776, 5828731, 5909492, 5924090, 5963635, 6012071, 6049785, 6055522, 6118763, 6195649, 6199051, 6205437, 6212634, 6279112 and 6314089. Additional patents pending. Fatwire, Content Server, Content Server Bridge Enterprise, Content Server Bridge XML, Content Server COM Interfaces, Content Server Desktop, Content Server Direct, Content Server Direct Advantage, Content Server DocLink, Content Server Engage, Content Server InSite Editor, Content Server Satellite, and Transact are trademarks or registered trademarks of Fatwire, corp. in the United States and other countries. iPlanet, Java, J2EE, Solaris, Sun, and other Sun products referenced herein are trademarks or registered trademarks of Sun Microsystems, Inc. AIX, IBM, WebSphere, and other IBM products referenced herein are trademarks or registered trademarks of IBM Corporation. WebLogic is a registered trademark of BEA Systems, Inc. Microsoft, Windows and other Microsoft products referenced herein are trademarks or registered trademarks of Microsoft Corporation. UNIX is a registered trademark of The Open Group. Any other trademarks and product names used herein may be the trademarks of their respective owners. This product includes software developed by the Apache Software Foundation (http://www.apache.org/) and software developed by Sun Microsystems, Inc. This product contains encryption technology from Phaos Technology Corporation. You may not download or otherwise export or reexport this Program, its Documentation, or any underlying information or technology except in full compliance with all United States and other applicable laws and regulations, including without limitations the United States Export Administration Act, the Trading with the Enemy Act, the International Emergency Economic Powers Act and any regulations thereunder. Any transfer of technical data outside the United States by any means, including the Internet, is an export control requirement under U.S. law. In particular, but without limitation, none of the Program, its Documentation, or underlying information of technology may be downloaded or otherwise exported or reexported (i) into (or to a national or resident, wherever located, of) Cuba, Libya, North Korea, Iran, Iraq, Sudan, Syria, or any other country to which the U.S. prohibits exports of goods or technical data; or (ii) to anyone on the U.S. Treasury Departments Specially Designated Nationals List or the Table of Denial Orders issued by the Department of Commerce. By downloading or using the Program or its Documentation, you are agreeing to the foregoing and you are representing and warranting that you are not located in, under the control of, or a national or resident of any such country or on any such list or table. In addition, if the Program or Documentation is identified as Domestic Only or Not-for-Export (for example, on the box, media, in the installation process, during the download process, or in the Documentation), then except for export to Canada for use in Canada by Canadian citizens, the Program, Documentation, and any underlying information or technology may not be exported outside the United States or to any foreign entity or foreign person as defined by U.S. Government regulations, including without limitation, anyone who is not a citizen, national, or lawful permanent resident of the United States. By using this Program and Documentation, you are agreeing to the foregoing and you are representing and warranting that you are not a foreign person or under the control of a foreign person. Content Server Core Developer Course: Exercises and Solutions Document Revision Date: December 19, 2003 12:10 pm Product Version: 5.0
Table of
Contents
Module 1: Introduction to Content Server 5.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . .7 Module Learning Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Terms to Know . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Lesson 1.1: Content Server Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 What is Content Server?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Content Server Servlets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 General Rules for Content Server Servlets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 CS-Direct Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 CS-Direct Advantage Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Additional Content Server Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Lesson 1.2: Content Server Product Architecture. . . . . . . . . . . . . . . . . . . . . . . . 14 Content Server Product Stack. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Software Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Content Server Environments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Module Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Module 2: Page Design and Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 Module Learning Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Terms to Know . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Lesson 2.1: CS-Direct Asset Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 The Basic Asset Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Core and Sample Asset Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Assets and the Content Server User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Asset Types: CS-Direct Out-of-the-Box and Samples. . . . . . . . . . . . . . . . . . . . . 19 Core Asset Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Burlington Financial Sample Asset Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Exercise 2.1.1: Working with Assets via CS-Direct . . . . . . . . . . . . . . . . . . . . . . 22 Lesson 2.2: AssetMaker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Asset Descriptor File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 AssetMaker, Data Types, and Asset Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Coding an Asset Descriptor File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Exercise 2.2.1: Creating Hello Personal Asset Type . . . . . . . . . . . . . . . . . . . . . 28 Exercise 2.2.2: Creating Hello Personal Assets . . . . . . . . . . . . . . . . . . . . . . . . 31 Lesson 2.3: Builing a Content Server Direct Web Site . . . . . . . . . . . . . . . . . . . . 32 Developing the Hello Asset World Web Site. . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Lesson 2.4: The Page Asset Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Exercise 2.4.1: Creating and Placing Page Assets . . . . . . . . . . . . . . . . . . . . . . 35 Lesson 2.5: Asset Relationship and Association. . . . . . . . . . . . . . . . . . . . . . . . . . 37 Sample Burlington Financial Site. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Exercise 2.5.1: Creating Asset Association . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Lesson 2.6: Query and Collection Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Exercise 2.6.1: Building Collection Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Module Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Module 3: Content Server Tools and Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 Module Learning Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Terms to Know . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Lesson 3.1: Content Server Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Content Server Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Exercise 3.1.1: Working with Content Server Explorer . . . . . . . . . . . . . . . . . . . 50 Exercise 3.1.2: Customizing the Asset Descriptor File . . . . . . . . . . . . . . . . . . . 52 CatalogMover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Exercise 3.1.3: Using Catalog Mover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Lesson 3.2: Content Server Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 <ics:setvar> Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 <ics:setssvar> Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 <ics:getvar> Tag. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 <ics:getssvar> Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 <ics:callelement> Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Exercise 3.2.1: Commonly Used Content Server JSP Tags . . . . . . . . . . . . . . . . 60 Lesson 3.3: Database Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Types of Database Tables (Catalogs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Lesson 3.4: Error Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Lesson 3.5: Page Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Modular Page Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Modular Design and Caching. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Choose the Coding Language. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Activity: Modularizing an Existing Web Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Lesson 3.6: Caching Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 Caching. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 CacheManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 Double Buffered Caching. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Table of Contents
Exercise 3.6.1: Page Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 Module Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Module 4: Template Assets and Content Server Tags . . . . . . . . . . . . . . . . . . . .81 Module Learning Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Terms to Know . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Lesson 4.1: The Template Asset Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Exercise 4.1.1: Creating a Template Asset . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Lesson 4.2: Asset Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Database Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Asset Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 Exercise 4.2.1: Using the <asset:load> and <asset:get> Tags . . . . . . . . . . . . 94 Exercise 4.2.2: Using the <asset:children> Tag . . . . . . . . . . . . . . . . . . . . . . . 95 Lesson 4.3: Render Tags. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 Setting the rendermode Arguement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 Render Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 Exercise 4.3.1: Using Render JSP Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Exercise 4.3.2: Rendering Collection Assets with Templates . . . . . . . . . . . . . 103 Exercise 4.3.3: Rendering Page Assets with Templates . . . . . . . . . . . . . . . . . . 105 Lesson 4.4: Site Plan Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Database Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Site Plan Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Exercise 4.4.1: Building a Page Navigation Bar . . . . . . . . . . . . . . . . . . . . . . . 111 Module Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Module 5: Workflow, Publishing, and Revision Tracking . . . . . . . . . . . . . . . . .115 Module Learning Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Terms to Know . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Lesson 5.1: Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 Workflow Participants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 Workflow States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 Workflow Steps: Moving Assets from State to State. . . . . . . . . . . . . . . . . . . . . 119 Managing Deadlocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Delegating and Clearing Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Placing an Asset in Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Restricting Access to Assets While They Are in Workflow . . . . . . . . . . . . . . . 121 Instructor Demonstration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Sample Workflow Steps and States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Sample Workflow Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Placing an Asset in a Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 Lesson 5.2: Publishing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 Delivery Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 Publishing Destinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 Publishing and the Approval Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 The Publishing Schedule (Publish Events). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 What Happens During the Publishing Session? . . . . . . . . . . . . . . . . . . . . . . . . . 133
Instructor Demonstration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Creating a Destination for Dynamic Publishing. . . . . . . . . . . . . . . . . . . . . . . . . 134 Mirroring an Asset (Dynamic Publishing) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 Creating a Destination for Static Publishing . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 Exporting an Asset to Disk (Static Publishing) . . . . . . . . . . . . . . . . . . . . . . . . . 137 Lesson 5.3: Revision Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 Implicit vs. Explicit Checkin and Checkout. . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 Revision Tracking and Non-Asset Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 How Many Versions? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 Instructor Demonstration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 Enabling Revision Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 Checking Out Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 Undoing a Checkout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Checking In Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Examining Version History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Reverting to a Previous Version (Rollback). . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Releasing Locked Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 Module Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
M od ul e 1
Terms to Know
Terms Asset Type Definition A category of basic assets. Each asset must belong to an asset type. For example, Article is a popular asset type. An Article asset is an instance of an Article asset type. A site might contain millions of Article assets but only one asset type named Article. An instance of an asset type. The central organizational unit of CS-Direct, CS-Direct Advantage, and CS-Engage. The following are examples of assets: one image and the data that describes it, one article and the data that describes it, or one product for sale. A large site might contain millions of assets. In addition, nearly all the infrastructure in a site (for example, templates and attributes) are themselves assets. CSEE defines two major categories of assets: basic assets and flex assets. The way in which CS-Direct stores content objects in one primary storage table in the database for each type of asset.
Asset
Basic Assets
Introduction
There are a few main components of Content Server 5.0 that are important to understand: Content Server Content Server Satellite Content Server Direct CSEE Tools
ContentServer
The ContentServer servlet generates and serves pages dynamically. It provides disk caching, session management, event management, searching, and personalization services.
CatalogManager
The CatalogManager servlet manages the content and object tables, which store hierarchical information about other tables in the Content Server database.
TreeManager
The TreeManager servlet manages the tree tables, which store hierarchical information about other tables in the Content Server database.
Module 1
BlobServer
The BlobServer servlet locates and serves binary large objects (or blobs for short) and is most commonly used for images. Blobs are not processed in any way they are served served in the same format as they are stored in.
CookieServer
The CookieServer servlet serves cookies for Content Server pages, whether those pages are delivered by the ContentServer servlet or by the CS-Satellite application.
DebugServer
This servlet provides tools to help debug XML or JSP code.
HelloCS
Displays version information about the Content Server software installed on your system.
CS-Direct Overview
Content Server Direct (CS-Direct) provides you with a user interface that enables you to easily input, organize, and edit your content as objects called assets. CS-Direct includes the following features: The Basic asset model The concept of a Sites & site plan CS-Direct XML & JSP tags
Assets can be: Created Edited Inspected Deleted Shared across sites Placed into workflow Tracked through revision tracking Searched for Previewed Published
During the process of designing your online site, you and others on your team examine your design and determine how the content of your site breaks down into assets. In general, content should be treated as an asset and not embedded into your code.
10
Module 1
In other words, template assets serve as an intermediary between formatting code and content providers. Content providers can assign the code to their assets but they cannot modify it (unless they have the appropriate permissions).
11
Workflow
CS-Direct introduces the workflow feature to the Content Server product family. Workflow is the movement of content from one person to another in a predictable, systematic way. For example, perhaps all articles must be seen by both an editor and by someone from your legal department before they can be approved (and then published). You can use the workflow feature to ensure that the article is assigned to the appropriate person at the appropriate point in its life cycle and to restrict who has access to an asset at each stage.
12
Module 1
To enable this interface, you and other developers must code your rendering templates to activate it for the appropriate asset types.
13
Web Server/CS-Satellite
CS-Bridge Enterprise CS-Engage CS-Bridge XML CS-Direct Advantage CS-Direct Content Server/CS-Satellite J2EE Application Server
Your CS-Direct Web Site Custom Content Server Elements
Database
Figure 1:
Software Requirements
Content Server requires a web server, an application server, a database and a browser. To find the current supported versions, go to http://www.openmarket.com/products/ ContentServer/
14
Module 1
Management Delivery
QA
Content
Developers
Code
Figure 2:
In the Development Environment, web and Java developers code the various componants of the web site. When their work is complete, they then move their work to the Testing Environment for testing. In the Testing Environment, QA Engineers test the code that the developers have created. The testing environment is also used for performance testing the web site. Once the code has been tested and approved by QA, it is moved to the Management and Delivery environments. In the Management Environment, Authors and Editors create and edit the content for the web site. Completed content is then published to the Delivery Environment so that visitors to the live web site can view it. The Delivery Environment contains completed code and content. It serves the finished web site to the site visitors.
15
Module Summary
Content Server consists of several servlets that run on top of an application server, including the ContentServer and BlobServer servlets. The Content Server Direct application takes advantage of all of Content Server's features, while adding another layer to extend the content management features. Each environment (development, testing, management and delivery) requires the following components: Web browser, Web server, Content Server software, J2EE application server, and DBMS. Rendering is the construction of output that is displayed on the browser. A pagelet in the Content Server environment is the output of an HTTP request displayed in a browser. Content Server Direct (or CS-Direct) uses the basic asset model to create a structure for your content in which there is one primary storage table in the database for each type of asset.
16
M od ul e 2
Terms to Know
Terms Basic Asset Asset Association Asset Maker Template Asset Definition The way in which CS-Direct stores content objects in one primary storage table in the database for each type of asset. A parent-child relationship between two basic assets. For example, an Article asset can be a parent of an ImageFile asset. No field values are inherited in this relationship. A utility used to create a new asset type. An asset that contains the code used to format your web site. A Template asset is a site design asset.
17
Other asset types, such as the Article asset, are sample asset types. Sample asset types are only installed if you install the Content Server sample sites.
18
Module 2
Edit?Edit this item; Make modifications to the values of the attributes of a specific asset. Delete?Delete this item; Delete a specific asset of a particular type.
Core Asset Types Combination Site Design and Content: Query Asset Type
A query asset stores a SQL query and returns a single asset type. When you create a query asset, you specify what kind of asset the query asset returns in the result of Query field: Articles, ImageFiles, etc.
19
the queries, and then ranking (or ordering) the assets that you selected. This ranked, ordered list is the collection.
Regarding template naming conventions, you should use the Template Asset Form of CSDirect: Name: Template_Name For Asset Type: Asset_Type
20
Module 2
Creditline - The organization responsible for the article. urlbody - The link to the actual text of the article.
Dependency Type
The exact dependency type indicates that two assets are inseparable. Use when: The assets are highly interdependent. One asset contains the other. Two assets can be considered one combo-asset but are separated because of workflow or work process reasons. The association is optional. Any asset of the appropriate asset type will do. Edits on the two assets are likely to be independent.
The exists dependency type indicates that two assets are companions. Use when:
21
Logging in to CS-Direct 1. In the Windows Explorer, double-click on cskit5.5/jconsole to invoke the Jump Start kit.
2. Using a browser, go to the Content Server Login screen of CS-Direct by typing: http://localhost:7001/servlet/ContentServer? pagename=OpenMarket/Xcelerate/UIFramework/LoginPage in the url field
of the browser.
3. Save this link to the Internet Explorer Favorites folder for future reference. 4. Enter admin in the Login Name field and demo in the Password field. Then click the
Login button.
5. You will be presented with a list of sites in which admin is enabled. Since your goal is
to become familiar with the assets of Burlington Financial, click the BurlingtonFinancial link to go directly to this site that is content managed by CSDirect. Searching for Assets 1. From the Content Server CS-Direct Interface screen, click the Search button to get a list of asset types that are searchable.
2. Click the Find Article link to perform a simple search of article assets.
To search for a particular article instance, enter a key word that will be your search criteria. (Example: In the Search field, select Name and in the field, enter AMD). By clicking the Search button, you will be searching the Article table for all records that have AMD as the value of the Name field.
22
Module 2
Saving a Search If the preceeding search will be executed many of times, then as a rule, save the search so that a business user can execute the search again without building the search criteria.
1. Click the Save This Search link. 2. In the Name field, enter AMD Article Search. 3. Check the Users of the following roles check box and from the Sharing Search
Criteria list, select Author. All users in Author role will be able to use this search.
4. From the Other Publications box, you can select BurlingtonFinancial.
Users in Author role in Burlington Financial site will be able to use the AMD Article Search.
5. Click the Save button.
Working with Asset Functions 1. From the resultset of executing the simple search, inspect the assets attributes by clicking the Inspect icon. Inspecting allows a business user to view the attributes (or fields) and their corresponding values of a particular asset.
2. Click the Preview icon to view how the asset will be presented to site visitors.
Previewing opens a new browser window that will display how the asset is rendered by the template assigned to it.
3. Click the Edit icon to invoke the edit form that allows business users to make changes
to an assets attributes values. Make any changes you like and click the Save Changes button to commit the change. Then, preview the asset again to view the changes. Adding Assets to Active List Save the assets that you use frequently to your active list. Next time you need to use these asset, you can find them in your Active List tab. The assets will be stored for the user or all the users in the same role, if you choose thos option, between sessions.
1. From the Content Server CS-Direct Interface screen, click the Search button to get a
23
Introduction
AssetMaker helps you create, and delete custom CS-Direct asset types. To create an asset type, you code an XML file called an Asset Descriptor File (ADF) that describes your new asset type. AssetMaker then uses the ADF to create the specified asset type.
All information required to create an asset and its database table are defined in the Asset Descriptor File. However, only custom fields (with JDBC data types) specific to the asset type are defined in the Asset Descriptor File. AssetMaker automatically defines standard asset fields.
The ASSET tag, which follows the XML version tag, names the asset type, provides the name of the database table for the asset type, and determines what graphical notation
24
Module 2
designates that a field is required. The opening tag is always the first line of code and the closing tag is always the last line of code in the asset descriptor file. There is only one ASSET tag pair in each asset descriptor file because an asset descriptor file defines one asset type. A pair of PROPERTIES tags marks the section of the file that holds the property descriptions. The opening tag is always the second statement in the asset descriptor file. There is only one PROPERTIES tag pair in each asset descriptor file. Nested within the PROPERTIES tag pair are pairs of PROPERTY tags that define each property (field and column) for assets of this type. The PROPERTY tag provides both the name of the column in the database that holds the values entered for this field as well as the field name on the form that you use to create assets of this type.
Asset Tag
This tag names the new asset type and its database table and sets certain default values. Its syntax is represented as:
<ASSET NAME="..." DESCRIPTION="" PROCESSOR="" DEFDIR="">
Description The name of the asset (internal name) The name of the asset seen by CS-Direct users (external name). Specifies the version number of AssetMaker for which this asset description is designed. Required if the asset type contains url fields (for uploaded files), see the Article table.
Example:
<ASSET NAME="PostItNotes DESCRIPTION="PostItNotes PROCESSOR=5.0 DEFDIR="D:\futuretense\postitnotes"> </ASSET>
Property Tag
This tag Instructs AssetMaker to create a new property and provides the name for the column in the table and the name for the field in the CS-Direct forms. Its syntax is represented as:
<PROPERTY NAME="column_name" DESCRIPTION="field_name">
ATTRIBUTE NAME
DESCRIPTION The internal name of the property, that is, the name of the column in the database table for this asset type.
25
ATTRIBUTE DESCRIPTION
DESCRIPTION The external name of the property, that is, the name of the field in the CS-Direct forms.
Example:
<PROPERTY NAME=title DESCRIPTION=Title> <STORAGE TYPE=VARCHAR LENGTH=100/> <INPUTFORM TYPE=TEXT WIDTH=65 MAXLENGTH=65 REQUIRED=YES DEFAULT=DefaultValue/> <SEARCHFORM DESCRIPTION=Title Contains: TYPE=TEXT WIDTH=20 MAXLENGTH=30/> </PROPERTY>
forms, its name and format. For example: is it a drop-down list or a check box or a text field? The TYPE specified by INPUTFORM must be compatible with the TYPE specified by STORAGE.
SEARCHFORM, which determines whether the field is displayed on the CS-Direct Advanced Search form. Note that if the value of the TYPE parameter is "Table" or Date, a drop down list will not appear on the SimpleSearch form, although it will appear in the Advanced Search form for the asset type.
SEARCHRESULTS, which determines which field values appear in the search results form that CS-Direct displays after a search. By default, the field is not displayed unless INCLUDE is set to TRUE. (This tag is optional.) If you are modifying a standard field, do not set SEARCHRESULTS to true for name or description.
Description A single line of text. Corresponds to the HTML input type named TEXT.
26
Module 2
Input TYPE
TEXTAREA
Description A text box, with scroll bars, that accepts multiple lines of text. Corresponds to the HTML input type named TEXTAREA. If you expect large amounts of text to be entered in the field, it is a good idea to create a text box that displays the contents of a URL column. To do so, you must specify a string for PROPERTY NAME that begins with the letters url and set the STORAGE TYPE to VARCHAR. When a user clicks Save, the text entered into this kind of field is stored in the file directory specified as the default storage directory for this asset type. You can specify the default storage directory (defdir) in either the asset descriptor file, or in the AssetMaker form when you create the asset type. Note that you can specify an unlimited size for a url field that is edited via a TEXTAREA field by not specifying a value for the MAXLENGTH parameter. A field that takes a file name (a URL) and presents a Browse button so that you can either enter the path to and name of a file or browse to it and select it. When you specify that a field is an upload field, set a string for PROPERTY NAME that begins with the letters url and set STORAGE TYPE (the propertys data type) to VARCHAR. You can also use the BLOB storage type for an upload field; in this case, the PROPERTY NAME string does not have to begin with url. When the user clicks Save, Content Server uploads the selected file and stores it in the file directory specified as the default storage directory for this asset type. You can specify the default storage directory (defdir) in either the asset descriptor file, or in the AssetMaker form when you upload the file. Note: the size of a file that is selected in an upload field cannot exceed 30 megabytes. A field that presents a drop-down list of options that can be selected. You can either specify the options that are presented in the list or you can specify a query so that the options are selected from the database (or an external table) and presented dynamically. Corresponds to the HTML input type SELECT. A check box field. You can specify the names of the check box options or you can specify a query so that the names are selected from the database (or an external table) and presented dynamically. This input type allows the user to select more than one option. Corresponds to the HTML input type CHECKBOX.
UPLOAD
SELECT
CHECKBOX
27
Input TYPE
RADIO
Description A radio button control. You can either specify the names of the radio options or you can specify a query so that the names are selected from the database (or an external table) and presented dynamically. This input type allows the user to select only one option. Corresponds to the HTML input type RADIO. A field whose contents you edit by using the eWebEditPro HTML editor, a third-party tool from Ektron, Inc. When you specify that a field is an eWebEditPro field field, its best if you make it a URL field. That is, set a string for PROPERTY NAME that begins with the letters url and set STORAGE TYPE (the propertys data type) to VARCHAR. Calls an element that you create to display a field on the ContentForm, ContentDetails, or SearchForm forms. The custom element must be found at one of the following locations: For a field on the ContentForm form: OpenMarket/Xcelerate/AssetType/myAssetType/
ContentForm/fieldname
EWEBEDITPRO
ELEMENT
Where myAssetType is the asset type that you are creating the custom field for, and fieldname is the name of the custom field. An ELEMENT field can have any storage type, including BLOB.
28
Module 2
Property
cc.char cc.varchar cc.smallint cc.integer cc.bigint cc.double cc.datetime cc.blob cc.bigtext
Datatype
NOT NULL NUMBER(38) NOT NULL VARCHAR(64) VARCHAR(128) VARCHAR(64) VARCHAR(24) VARCHAR(64) VARCHAR(255) NOT NULL VARCHAR(2) VARCHAR(64) VARCHAR(255)
29
Field
URLEXTERNALDOC(System Field) CREATEDBY(System Field) UPDATEDBY(System Field) CREATEDDATE(System Field) UPDATEDDATE(System Field) STARTDATE ENDDATE
Datatype
VARCHAR2(255) NOT NULL VARCHAR(64) NOT NULL VARCHAR(64) NOT NULL DATE NOT NULL DATE DATE DATE
Default Storage Directory Any table with a url field must have a default storage directory (or defdir) specified for it. This directory is where the values entered into the field are actually stored. The defdir column of the SystemInfo table holds the name of the default storage directory for tables with url fields. The value entered into a url field is actually a relative path to a file since the value in a url field is appended to the value of the table's defdir setting.
Editing this element with Content Server Explorer, the element designer is actually using the built-in text editor of Content Server Explorer on file main.jsp. The location of main.jsp is determined by the value of defdir and the value of url: defdir = $(CS.Property.cs.jskpath)\futuretense\Storage\elements\
30
Module 2
Note: CS.Property.cs.jskpath = /JumpStartKit url = OpenMarket\Samples\NewPortal\JSP\main.jsp Therefore, the location of main.jsp is:
\JumpStartKit\futuretense\Storage\elements\OpenMarket\Samples\N ewPortal\JSP\main.jsp
To view the contents of this file with Content Server Explorer, double-click on its urlbody field value. The built-in text editor of Content Server Explorer will then open file 972312773045.txt. The location of 972312773045.txt is determined by the value of defdir and the value of urlbody: defdir = $(CS.Property.cs.jskpath)\futuretense\Storage\Storage\ Article\ Note: CS.Property.cs.jskpath = /JumpStartKit urlbody = 972312773045.txt Therefore, the location of 972312773045.txt is: \JumpStartKit\futuretense\Storage\Storage\Article\972312773045. txt
31
Purpose
In this lab exercise, you will complete the following actions: Log in CS-Direct as an administrator for Hello Asset World site. Code the Asset Descriptor File. Review and load the Asset Descriptor File.
Creating the Asset Descriptor File 1. Open the CourseMaterials/HelloPersonalsADF.xml file using Notepad or WordPad.
2. Using the other PROPERTY statements as a guide, and the information about the PROPERTY tag in section Property Tag on page 25 and Table 1, Input Types of the
Fields on page 26, create three new properties in your ADF: Property Name greeting urlad homeplanet Property Description Greeting Personal Ad Home Planet Property Data Type VARCHAR(255) VARCHAR(64) - reference to the file on the file system VARCHAR(64)
Loading Your ADF 1. To load the Asset Descriptor File, from the Admin tab, expand the AssetMaker node and then double-click the Add New option.
32
Module 2
see an entry for the HelloPersonal asset type. Enabling the HelloPersonal Asset Type 1. From the Admin tab, expand the Sites > HelloAssetWorld > Asset Types node.
2. Double-click the Enable option to view a list of asset types that you can enable for
preceeding asset type is legal for Hello Asset World. Note: Enabling the HelloPersonal asset type only gives System users the ability to search for instances of the HelloPersonal asset type. It does not provide the ability to create new instances of HelloPersonal asset type. Adding a New Start Menu From the Admin tab, expand the Start Menu node.Double-click the Add New option to create a new Start Menu for the HelloPersonal asset type. The Start Menu window will appear. Enter the following fields:
1. In the Name field, enter New Hello Personal 2. In the Description field, enter Creates a New Hello Personal asset 3. From the Type menu, select New. 4. From the Asset Type menu, select HelloPersonal asset type. 5. From the Sites menu, choose the HelloAssetWorld site. 6. From the Roles menu, select the following roles that you want to be able to create new
If you select HelloAuthor and HelloEditor roles, Coco and anyone else in these roles will be able to log in and created new instanses of HelloPersonal asset type.
7. Leave the WorkflowProcess field unchanged.
This field is used to automatically place each new asset in to the workflow.
8. Click the Save button at the bottom of the screen to save the new start menu item.
33
Adding a Search Start Menu From the Admin tab, expand the Start Menu node.Double-click the Add New option to create a new Start Menu for the HelloPersonal asset type. The Start Menu window will appear. Enter the following fields:
1. In the Name field, enter Find Hello Personal 2. In the Description field, enter Searches for a New Hello Personal asset 3. From the Type menu, select Search. 4. From the Asset Type menu, select HelloPersonal asset type. 5. From the Sites menu, choose the HelloAssetWorld site. 6. From the Roles menu, select the following roles that you want to be able to create new
If you select HelloAuthor and HelloEditor roles, Coco and anyone else in these roles will be able to log in and search for HelloPersonal assets.
7. Leave the WorkflowProcess field unchanged.
Note: The WorkflowProcess field should not be in this form (known bug).
8. Click the Save button at the bottom of the screen to save the search start menu item.
Creating HelloPersonal Subtypes 1. From the Admin tab, expand the Asset Types > HelloPersonal node.
2. Double-click the Subtypes node and then click the Add New Subtype button to add a
new subtype for your asset type. The Add New HelloPersonal Subtype window will appear:
34
Module 2
a. In the Name field, enter Female. b. From the list of sites, select HelloAssetWorld site. c. Click the Add New Subtype button to save the subtype. 3. Repeat the preceeding steps to create Male subtype.
35
Direct site.
2. Click the New assets button at the top left-hand corner of the screen. 3. Click the New HelloPersonal asset type link. The New HelloPersonal window
Note: You can either enter your own values into the HelloPersonal form fields or cut and paste in values from files in the CourseMaterials/HelloWorldPersonals folder.
5. Repeat this process to add more HelloPersonal assets.
36
Module 2
Figure 3:
In order to create this web page, you will need to take the following steps: Create a Page asset called PersonalPage. Place the PersonalPage asset in the Site Plan Tree. Associate each Personal asset with the appropriate HelloImage asset. Create a Query asset called PersonalQuery which will retrieve the asset IDs of your Personal assets. (This has already been done for you.) Create a Collection asset called PersonalCollection which contains the results of PersonalQuery.
37
Create a Template asset called PersonalTemplate that displays the Personals asset and its associated ImageFile asset. Create a Template asset called QueryTemplate that displays the results of a query as a navigation bar. Create a Template asset called HelloPersonalPage that calls the PersonalTemplate and the QueryTemplate.
The exercises in this section lead you through the first six of these tasks.
38
Module 2
39
Purpose
In this lab exercise, you will complete the following actions: Create a page asset. Place the page asset in the Site Plan Tree.
Adding Subtypes to the Page Asset Type In the following steps you will create two suptypes for the Page asset type: articles and personals. You use there subtypes in the HelloAssetWorld site only. The subtypes distinguish pages that render HelloArticles assets from the ones that render HelloPersonal assets.
1. From the Admin tab, expand the Asset Types > Page node. 2. Double-click the Subtypes node to add a new subtype for your asset type. a. In the Name field, enter articles. b. From the list of sites, select HelloAssetWorld site. c. Click the Add New Subtype button to save the subtype. 3. Repeat the preceeding steps to create personals subtype.
Creating Page Assets 1. Click the New button, then click the Create New Page link to create a new page asset.
2. To create a page asset representing the main page of HelloAssetWorld, enter the
following values in these fields: Name: HelloPersonalsHome Description: HelloPersonals Home Page Subtype: personals
3. Click the Save button. 4. Use the preceeding steps to create two more Page assets: FemaleAliensPage and MaleAliensPage.
40
Module 2
Placing Pages in the Site Plan Tree 1. From the Site Plan tab in the Content Server Direct UI, right-click Placed Pages node and select the Place Page option.
2. Rank page asset HelloPersonalsHome with a value of 10 and then click the Save
button.
3. Expand the Placed Pages node again. Right-click on the HelloPersonalsHome node
41
Page P1 - Collection Page P1 - Query Q2 C1 Page P2 - Collection C5 Thus, a page asset is a container of other assets.
Following are some examples using the home page of the Burlington Financial site:
Page Association Collection Association Name: Top Stories Dependency Type: Exists
Query: Home Wire Feed
Page Association Query Association Name: WireFeed Dependency Type: Exists Page Association Collection Association Name: Sidebar Top Dependency Type: Exists Page Association Collection Association Name: Sidebar Middle Dependency Type: Exists Page Association Collection Association Name: Sidebar Bottom Dependency Type: Exists
Collection: HomePage Columns Collection: Editors Pick Collection: Analyst Home Stories
Figure 4:
42
Module 2
Page: Home Home Relationship HomePage Stories Association Name: Top Stories Collection: HomePage Stories Query: Home Wire Feed Home Relationship Home Wire Feed Association Name: WireFeed Home Relationship HomePageColumns Association Name: Sidebar Top Collection: HomePage Columns Collection: Editors Pick Collection: Analyst Home Stories Home Relationship Editors Pick Association Name: Sidebar Middle Home Relationship Analyst Home Stories Association Name: Sidebar Bottom
Figure 5:
43
Purpose
In this lab exercise, you will complete the following actions: Create asset type associations (admin) Create asset type associations (user)
Creating Asset Type Association Creating asset type associations is the responsibility of the Site administrator (Coco/ hello).
1. From the Admin tab, expand the Asset Types > HelloPersonal > Asset Association
node.
2. Double-click the Add New option to create a new asset type association between
Creating Asset Relationship Creating asset relationships is the responsibility of the business users of the site. Since you are currently logged in as the Site administrator (Coco/hello), you can log out of CSDirect and re-login as a business user (Moe/hello) of HelloAssetWorld.
44
Module 2
1. First, search for all of the HelloImages for HelloAssetWorld and add them to your
Active List:
a. Click the Search button and click the HelloImage link to implement a simple
search for all HelloImage assets of HelloAssetWorld. b. At the Search for HelloImage window, click the Search button again to display all HelloImages of HelloAssetWorld. c. For each HelloImage record displayed, select the associate checkbox at the right. d. Finally, click the Add to My Active List button.
2. Search for the HelloPersonal assets of HelloAssetWorld, select any HelloPersonal
HelloImage link. This is where you will make an Asset Retionship between the HelloPersonal asset a HelloImage asset:
a. From the Active List tab, highlight a HelloImage asset by clicking its node once. b. Then click the Add Select Items button corresponding to HelloPersonal
HelloImage Association to make the relationship. c. Click the Save Changes button.
4. Repeat the preceeding steps for the remaining HelloImage assets that need to be
related to other Alien Personals. Note: If you would like to use more HelloImage assets for your personals, you can create additional HelloImage assets and upload sample image file located in the CourseMaterials/HelloPersonals/alien_images directory.
45
46
Module 2
Pupose
In this lab exercise, you will complete the following actions: Create a new Collection asset. Build the Collection asset.
Creating Query Assets The query asset will query HelloPersonal table and extract assets that match the query. This query can be used later by the collections. Complete the following steps to create query assets:
1. If necessary, log in to the CS-Direct user interface with the user name Coco and the password hello. 2. Click New on the button bar and then select Query from the list of asset types. (Query
asset type must be enabled for your site). The Query form appears.
3. Fill in the following fields with the following values: a. In the Name field, type FemaleAliensQuery. b. In the Description field, type a brief description of the query. c. In the Result of Query, select HelloPersonal. d. In the SQL query text box, type the following query: SELECT * FROM HelloPersonal WHERE status!='VO' AND subtype='Female' e. Click the Save button to save the query asset. 4. Follow the preceeding steps to add another query called MaleAliensQuery. Use the
Note: If you named your subtypes female and male (all small letters) use the exact names in your queries. Content Server is case sensitive.
47
Creating Collection Assets Complete the following steps to create a collection asset:
1. Click New on the button bar and then select Collection from the list of asset types.
(Collection asset types must be enabled for your site).The Collection form appears.
2. Fill in the following fields with the following values: a. In the Name field, type FemaleAliensCollection. b. In the Description field, type a brief description of the collection.
You can enter up to 128 characters. c. In the Subtype box, select HelloPersonal. d. In the Associated queries section, select FemaleAliensQuery. e. Click Save.
3. Follow the preceeding steps to add another collection called MaleAliensCollection. In the Associated queries section, select
MaleAliensQuery.
4. Follow the preceeding steps to AllAliensCollection. In the Associated queries
section, select both FemaleAliensQuery and MaleAliensQuery queries. Building Collections Complete the following steps to build a collection asset:
1. Click the Inspect icon to edit the FemaleAliensCollection that you just created. 2. In the more... drop-down select box, located in the upper-right corner, select Build.
You can also click the Build hyperlink in the lower right corner of the screen. Note: Content Server runs the query or queries in the collection and displays the results in two or more lists of assets.
3. Rank the assets by entering the appropriate number in the Rank field. You can enter
up to three numeric characters. If you want to remove an asset that is already included in the top list, select the Remove option next to its Rank field. Note: You cannot remove an included asset by deleting its rank number in the query list.
4. Click Save Changes.
Content Server builds the collection and then displays it in the Inspect form.
5. Follow the preceeding steps to build the MaleAliensCollection and the AllAliensCollection assets. Save your changes after you build the collections.
48
Module 2
e. Save your Collection asset by clicking on the Save Changes button. 2. Follow the preceeding steps to assign the MaleAliensColection to the MaleAliensPage and AllAliensCollection to the HelloPersonalsHome.
49
Module Summary
Caching improves performance and relieves load on Content Server. Content Server uses double-buffered caching to ensure that visitors to your web site never encounter broken links. Modular page design allows users to code componants of their web pages once and use those componants in many places. Rendering is the construction of output that is displayed on the browser. A pagelet in the Content Server environment is the output of an HTTP request displayed in a browser. A web page is composed of multiple pagelets that are called by a containing page. Content Server Direct (or CS-Direct) uses the basic asset model to create a structure for your content in which there is one primary storage table in the database for each type of asset. Several asset types come with CS-Direct, including: Article, ImageFile, Image, Linkset, Stylesheet, Query, Collection, Page, and Template. Asset type associations are mechanisms that allow a relationship between assets. Associations are between asset types while relationships are between assets. Some dependency types are inseparable, while others are companions. You use the AssetMaker utility to create and delete new asset types. Developers must code an Asset Descriptor File in XML for each asset type they want to create. All tables with a url field must have a default storage directory in which the values entered into the column will be stored. AssetMaker helps you create new CS-Direct asset types When you use AssetMaker, you are only responsible for creating the Asset Descriptor File (.XML file) that is used by AssetMaker to create the specified asset type.
50
M od ul e 3
Terms to Know
Term Template Asset Definition An asset that contains the code used to format your web site. A Template asset is a site design asset. An asset that is a group of asset associations. You add any assets that you want to display on your web site to a Page asset. A Page asset is a site design asset. An asset that is associated with an element. An asset that associates a CS-Element asset with an entry in the SiteCatalog table.
Page Asset
51
Definition A Content Server tool that lets you step through the execution of XML and JSP elements. A parameter whose value is the arguments that you wish to pass to a web page or pagelet. resargs are set in the SiteCatalog or ElementCatalog tables.
52
Module 3
Introduction
There are a variety of tools available to you in Content Server. In this training session, we will focus on the following tools: Content Server Explorer: Microsoft Windows application for viewing and editing tables and rows in the Content Server database and for creating and editing executable elements (i.e. files) written in XML or JSP. CatalogMover: Allows you to export and import Content Server database tables.
These tools are also available in the Content Server Direct environment. Business users will be using the CS-Direct interfaces to perform content management tasks such as add, modify, and delete content, revision tracking, and workflow.
It is recommended that you use Content Server Explorer's built-in editor to edit your elements.
53
Purpose
In this lab exercise, you will complete the following actions: Log in to Content Server Explorer via Jump Start. Create a folder in the SiteCatalog and ElementCatalog tables. Add a record. Create a JSP element. Preview pages of the SiteCatalog.
Follow these directions for completing this lab exercise. Logging in to Content Server Explorer 3. In the Windows Exporer, double-click on cskit5.5/tools/ ContentServerExplorer/ContentServerExplorer to invoke Content Server Explorer.
4. On the Content Server Explorer screen, choose the menu path: File > Open Content
Name - jumpstart Password - jumpstart Host name or address - localhost Port - 7001
6. Select the HTTP and Standard servlet (/servlet/CatalogManager) radio buttons. 7. Click the OK button.
54
Module 3
b. Name the folder Training and then click the Save button. 2. Repeat the above steps to create a similar folder name Training in the SiteCatalog
table. Adding a ElementCatalog Entry 1. Create a page record in the Training folder of the ElementCatalog table:
a. Highlight the Training folder and in the right panel, right-click on your mouse b. c. d. e.
and select New. In the elementname field for your element, enter hello. In the description field, enter My first JSP element. In the url field, click on a button and then select .jsp in the New file dialog window, and then click the OK button. In the element editor, between tags <cs:ftcs> and </cs:ftcs>, look for <!user code here -->. Overtype this line with the text: Hello Students!
Adding a SiteCatalog Entry 1. Create a page record in the Training folder of the SiteCatalog table:
a. Highlight the Training folder and in the right panel, right-click on your mouse
and select New. b. In the pagename field for your element, enter HelloPage. c. In the rootelement field, modify the string to Training/hello d. In the cacheinfo field, set the SiteCatalog entry to be not cached (false).
2. Click the Save or Save All files/catalogs button to save your SiteCatalog entry.
Previewing a Page in the SiteCatalog 1. From the Content Server Explorer screen, search for page entry Training/Hello. Right-click the Display Status icon for page name Hello and select the Preview Page option.
2. Click the OK button to accept the default values displayed. A new browser window displays the Training/HelloPage page.
Note: You can also preview the same page directly in the browser by providing the following URL:
http://localhost:7001/servlet/ContentServer?pagename=Training/ HelloPage
55
Purpose
In this exercise, you will complete the following actions: Code the custom asset field element. Enable the Personal asset type for Hello Asset World site.
Follow these directions for completing this lab exercise. Creating an eWebEditPro Field 1. In the Content Server Explorer, navigate to the AssetType folder.
2. Sort the table rows by clicking on a column named urldescriptor. 3. Find and open the descriptor file for the HelloPersonals asset type (HelloPersonalsADF.xml). 4. Change the parameters for the urlad property (Personal Ad field) to use
eWebEditPro software, which is installed on with your JumpStart. The modified property should look similar to the following:
<PROPERTY NAME="urlad" DESCRIPTION="Personals Ad"> <STORAGE TYPE="VARCHAR" LENGTH="6000"/> <INPUTFORM TYPE="EWEBEDITPRO" WIDTH="500" HEIGHT="200" REQUIRED="YES"/> </PROPERTY> 5. Save your changes in the Content Server Explorer and test them in the CS-Direct
interface. Note: The first time you edit a HelloPersonal asset, your Windows will install Ektron software to run eWebEditPro in your browser. Creating a Custom Element Field 1. In the Content Server Explorer, go to ElementCatalog > OpenMarket > Xcelerate > AssetType > HelloPersonal folder.
56
Module 3
2. Add a new folder called ContentForm and in this new folder, create a new element called idiosyncrasies.
Note: CS Explorer allows you to input the name of your new element. The name of the custom element must be the same as the name of the field in the ADF(idiosyncrasies).
3. In the new ElementCatalog/OpenMarket/Xcelerate/AssetType/ HelloPersonal/ContentForm/idiosyncrasies element, do the following: a. Click in the url field. If XML is not already selected as the coding language for
this element, select it. b. Locate and open the CustomField.txt file in the CourseMaterials folder. Paste the code that it contains into your element. c. Replace the text ENTER DATA ENTRY INSTRUCTIONS HERE with some text of your choosing. Be sure to mention that the content managers should input the idiosyncracies as if they were keywords. d. Click the Save icon to save your element.
4. Modify the idiosyncrasies property in the HelloPersonalADF.xml file again to call the custom element you created. Change the <INPUTFORM TYPE=TEXT ../> for the <INPUTFORM TYPE=ELEMENT ... />. The modified property
Direct interface.
57
CatalogMover
The CatalogMover tool allows you to export and import Content Server database tables, including the SiteCatalog and ElementCatalog tables. CatalogMover creates an HTML file that preserves table structure and table content. If a table has a url column, then CatalogMover imports referenced files. In addition, it can uncompress imported files and compress exported files. For example, you can use CatalogMover to export page elements and content assets to one system and load the same elements and assets into the database on another system. You can export and import database tables as either HTML or ZIP files. CatalogMover allows you to: Connect to a server. Export table rows to an HTML file. Preserve table structure(s). Store associated uploaded files (such as URL fields) in a subdirectory. Import files can into another database.
This tool exports and imports table content but is not meant to move all tables. For instance, if you export the SystemUsers table (which holds all registered users of the system), passwords will be encrypted. Therefore, if you import the SystemUsers table passwords will be encrypted again. It is important to remember that CatalogMover is unaware of Content Server Directit knows nothing about asset associations and will not automatically copy coherent set of tables. However, CatalogMover is great for table backups.
58
Module 3
Purpose
The objectives of this exercise are: Import records into the ElementCatalog and SiteCatalog tables via Catalog Mover. Export elements from ElementCatalog.
Follow these directions for completing this lab exercise. Start and Log in to Catalog Mover Complete the following steps to log in to CatalogMover:
1. Start Catalog Mover by running the tool from the cskit5.5/JumpStart/Tools.
Server - Enter the localhost Port - Enter 7001 Name - Enter jumpstart Password - Enter jumpstart Secure (No) Standard Servlets (\servlet\CatalogManager)
Importing records into the Element Catalog In this section, you will import the rows from a file into the ElementCatalog table.
1. From the CatalogMover - Connected to localhost:7001 dialog box, choose the
following menu path: Catalog > Auto Import Catalog(s). The Select base directory for import dialog box displays.
2. Find files to import in the following location CourseMaterials/Exercises/ ElementCatalog.html 3. From this directory, double-click on the file you wish to import. The Catalog Data
59
5. The Importing Tables dialog box appears, followed by the Results for Import
Catalogs dialog box. Click OK. CatalogMover imports the following elements into the ElementCatalog table: - HelloPersonal/Solutions/HelloPersonalTemplate - HelloPersonal/Solutions/HelloPersonalTemplate2 - HelloPersonal/Solutions/HelloPersonalTemplate3 - HelloImage/Solutions/HelloImageTemplate - Collection/Solutions/HelloCollectionTemplate2 - Page/Solutions/HelloPageTemplate2 - HelloExtra/Solutions/HelloNavBar 6. Log in to the Content Server Explorer and find the new imported rows in the ElementCatalog. Exporting records from ElementCatalog In this section, you will export the rows form the ElementCatalog and save them on your local drive. Because information about elements is stored in the ElementCatalog but the elements themselves are stored on a file system, CatalogMover will have to export both the rows from the table and the files from the file system. It will place the save the rows from the table into the ElementCatalog.html file and the files from the file system into the folder called ElementCatalog.
7. In the Windows Explorer, create the folder called c:/fatwire. 1. From the CatalogMover - Connected to localhost:7001 dialog box, choose the menu
path: CatalogList > Load. The CatalogMover - Connected to localhost:7001 dialog box updates with a listing of tables.
2. From the list of tables displayed, double-click on the ElementCatalog selection to
load the rows from the ElementCatalog table. Once the rows are loaded, the ElementCatalog panel will appear at the bottom of the Catalog Mover window.
3. Switch to the ElementCatalog panel to view the rows. 4. Highlight any element and then choose the menu path: Catalog > Export Catalog
Rows. The Select base directory for export dialog box displays.
5. Browse to c:/fatwire folder. This is the directory where CatalogMover will place
60
Module 3
<ics:setvar> Tag
This JSP tag declares and initializes the value of a regular variable. Its syntax is represented as:
<ics:setvar name="Variable_Name" value="Variable_Value"/>
For example,
<ics:setvar name="city" value="Boston"/>
The value of the variable exists for the duration of the page evaluation unless it is explicitly deleted using <ics:removevar>.
<ics:setssvar> Tag
This tag sets the value of a session variable. Its syntax is represented as:
<ics:setssvar name="Session_Variable_Name" value="Session_Variable_Value"/>
For example,
<ics:setssvar name="asset_type" value="Article"/>
The value of the session variable exists for the duration of the session unless it is explicitly deleted using <ics:removessvar>.
<ics:getvar> Tag
This JSP tag returns and displays the value of a Content Server variable. Its syntax is represented as:
<ics:getvar name="Variable_Name" encoding="default" output="Output_Variable_Name"/>
Description The name of the variable. The encoding used to convert binary values to a string. The value of this parameter must be set to default.
61
Parameter output
Description Specifies an optional output variable. If this parameter is not specified, the output will be streamed to the browser. For example,
<ics:getvar name="city"/>
The city variable could have been set previously either by using <ics:setvar/> tag or by passing this variable to a Content Server page with either GET or POST method. For example, you can pass the city variable to the Content Server page named HelloPage by simply appending this variable and its value to a URL string that calls the page:
http://localhost:7001/servlet/ ContentServer?pagename=HelloPage&city=Boston
<ics:getssvar> Tag
This tag returns a Content Sever session variable. Its syntax is represented as:
<ics:getssvar name="Session_Variable_Name"/>
<ics:getssvar name=session_user_id/>
<ics:callelement> Tag
The ics:callelement tag processes the content of an element. The element must exist in the ElementCatalog. Its syntax is represented as:
<ics:callelement element="element name"> <ics:argument name="argument name" value="arg value"/> </ics:callelement>
ElementVariables set in a parent element are not visible in the child element unless they are passed in the <ics:argument name="argument name" value="arg value"/ > tag within <ics:callelement> tag. However, variables set in a child element can be read in the parent element.
62
Module 3
In the SimpleTest element, variables var1 and var2 can be displayed with the <ics:getvar/> tag:
Variable X: <b><getvar name=var1/></b><br> Variable Y: <b><getvar name=var2/></b><br>
63
Follow these directions for completing this lab exercise. Setting Content Server Variables 1. Using Content Server Explorer, edit the Training/hello element located in the ElementCatalog table.
2. Within the Training/hello element, use the <ics:setvar> tag to set a Content Server variable named city to the name of the city you are from. 3. Within the Training/hello element, use the <ics:getvar> tag to display the city variable that you set in step 2 of this procedure.
HelloPage.
3. Right-click the Display Status icon for the page name Training/HelloPage and select
Passing Content Server Variables to your Page 1. Within the Training/hello element, delete the <ics:setvar> tag that sets the Content Server variable named city.
2. Preview your page by proving the following URL in your browser: http://localhost:7001/servlet/ContentServer?pagename=Training/ HelloPage
The page should not display the variable, because the variable was not set.
3. Now, preview the same page in your browser by appending city=Boston to the
64
Module 3
http://localhost:7001/servlet/ContentServer?pagename=Training/ HelloPage&city=Boston
Calling Elements 1. In the Content Server Explorer, add an element Training/logo. Write the following line in the element: Hello Page Logo
2. From the Training/hello element, call the Training/logo element by using the <ics:callement> tag. 3. Now, preview the same page in your browser again. Your URL should look similar to
the following:
http://localhost:7001/servlet/ContentServer?pagename=Training/ HelloPage&city=Boston 4. You can modify the <ics:callement> tag by adding arguments that you would like to pass to your Training/logo element. For example, you can set a Content Server variable with your name and then pass its value to the Training/logo element. In the Training/logo element, display the value of the variable. Test your page again.
65
Content Server can cache the resultsets from queries against any table in the Content Server database, including foreign tables.
Object Tables
Object tables store data as an object and can be represented in hierarchies. Those objects can be loaded, saved, and managed with the CatalogManager API. The asset type tables for CS-Direct and CS-Direct Advantage are object tables. The primary key for object tables is always the ID (id) column. This column cannot be changed. When you instruct Content Server to add an object table, it creates an ID column in that table. ID is a unique identifier that Content Server assigns to each row as it is added to the table. For example, when someone creates a new asset with CS Direct, Content Server determines the ID and assigns that value as the ID for that asset. You cannot change the ID that Content Server assigns to objects (such as assets). Anytime that you need to store data and you want to ensure that each row of that data is uniquely identified, use an object table because Content Server handles ID generation for you. When AssetMaker or Flex Family maker creates an object table for a new asset type, they create several additional columns by default. Examples of object tables: All tables that hold assets Many of the CS-Direct publishing tables The CS-Engage tables that hold visitor data
66
Module 3
Tree Tables
Tree tables store information about the hierarchical relationships between object tables. In other words, object tables can be represented in hierarchies, but the hierarchy itself is stored in a tree tablethe hierarchy is the tree. For example, CS-Direct adds the following tree tables to the Content Server database: AssetRelationTree, which stores information about associations between assets. These associations create parent-child relationships. SitePlanTree, which stores information about parent-child relationships between page assets and the assets that are referred to from those assets. This information is presented graphically on the Site Plan tab that is present in the Content Server interface when CS-Direct is installed. Each row in a tree table is a node in that tree. Each node in a tree table points to two places: To an object in an object table, that is, to the object that it represents. To its parent node in that tree table, unless it is a top-level node and has no parent In other words, the object itself is stored in an object table. That object's relationships to other objects in the database (as described by the tree) are stored in the tree table as a node on a tree.
Note that child nodes point to parent nodes, but parents do not point to children. When you create a tree table, it has the following columns by default. You cannot add to or modify these columns:
nid
Description The ID of the node. This is the primary key. The ID of the node's parent node. A number that ranks peer or sibling nodes. For example, the AssetRelationTree table uses this column to determine the order of the assets that are in collections. The object type of the node. For example, in the SitePlanTree table (a CS-Direct table), otype is either the asset type "page" or the name of a site ("publication"). In the AssetRelationTree table (another CS-Direct table), otype is an asset type and is the name of the object table for assets of that type. The ID of the object that the node refers to. Reserved for future use. Holds a string that has meaning in the context of what the table is being used for. For example, in the SitePlanTree, ncode is set to "placed" or "unplaced" based on whether the page asset that the node refers to has been placed or not. In the AssetRelationTree, ncode holds the name of a named association.
otype
67
Content Tables
Content tables store data as flat data (rather than as objects) and that information cannot be organized in a hierarchy. You use content tables for simple lookup tables. For example, these are a few of the content tables that CS-Direct adds to the Content Server database: Source, which holds strings that are used to identify the source of an article or image asset Category, which holds codes that are used to organize assets in several ways StatusCode, which holds the codes that represent the status of an asset
All three of these tables are lookup tables that the CS-Direct product uses to look up values for various columns in the asset type tables (object tables). In another example, CS-Direct also adds a content table called MimeType. This table holds mimetype codes that are displayed in the Mimetype fields of the Burlington Financial sample site asset types named stylesheet and imagefile. The Mimetype fields for these asset types query the MimeType table for mimetype codes based on the keyword column in that table. Setting the Primary Key for a Content Table When you create a content table, an ID column is not created for you and the primary key is not required to be the ID. This is another major difference between content tables and object tables. The cc.contentkey property in the futuretense.ini file specifies the name of the default primary key for all content tables. When you create a new content table, you are responsible for defining a column with the name specified by the cc.contentkey property. However, you can override the identity of the primary key for a specific content table by adding and setting a custom property in the futuretense.ini file. This property must use the following format: cc.tablenameKey For example, if you create a content table named Books and you want to override the default primary key so that it uses the ISBN column instead, you would add a property named cc.BooksKey and set it to ISBN.
Foreign Tables
A foreign table is one that Content Server does not completely manage. For example, perhaps your site pages perform queries against a table that is populated by an ERP system and Content Server displays that information to your site visitors. Content Server can query foreign tables and cache the resultsets just as it does for its own object and content tables. However, you must first identify that foreign table to Content Server by adding a row for it in the SystemInfo table. This is the only time you should ever modify information in the SystemInfo table. Additionally, you must be sure to flush the Content Server resultset cache with a CatalogManager flushcatalog tag whenever the external system updates the tables that you query. Otherwise, the resultsets cached against those tables might not be up-to-date.
68
Module 3
System Tables
System tables are core Content Server tables whose schema is fixed. They are implemented in Content Server by their own classes and they do not follow the rules (for caching and so on) that the other tables follow. You can add rows to some of the system tables (either using the Content Server Management Tools forms or the Content Server Explorer tool), but you cannot add or modify the columns in these tables in any way. You also cannot add system tables to the database. The following table lists and defines the Content Server system tables: Table SiteCatalog ElementCatalog SystemACL Description Lists a page reference for each page or pagelet served by Content Server. Lists all the XML or JSP elements used in your system. An element is a named piece of code. Has a row for each of the access control lists (ACLs) that were created for your Content Server system. ACLs are named definitions of roles or users who have particular access permissions, called privileges. Has a row for each event being managed by Content Server. An event represents an action that takes place on a certain schedule. Content Server inserts a row in this table when you set an event by using either the APPEVENT or EMAILEVENT tags. Lists all the tables that are in the Content Server database and any foreign tables that Content Server needs to reference. Holds SQL queries that you can reuse in as many pages or pagelets as necessary. You can store SQL queries in this table and then use the ics.CallSQL() method, the CALLSQL XML tag,or the <ics:callsql> JSP tag to invoke them. Then, if you need to modify the SQL statement, you only have to modify it once. Registers Java classes that are external to Content Server but that Content Server has access to (includes access control). Lists all the users who are allowed access to pages, functions, and tables. Note that if you are using LDAP, this table is not used. Stores attribute information about the users such as their email addresses. Note that if you are using LDAP, this table is not used.
SystemEvents
SystemInfo
SystemSQL
SystemSeedAccess
SystemUsers
SystemUserAttr
69
Table SystemPageCache
Description Holds information about pages that are cached: the folder that it is cached to, the query used to generate the file name, the time it was cached, and the time that it should expire. Holds information about specific items on pages that are cached (assets, for example): the identity of the item, the page it is associated with, and the time it was cached.
SystemItemCache
Querying Databases
There are several methods you can use to query the Content Server database for information: Java Query Methods: - ics.SelectTo() - ics.CatalogManager() - ics.SQL() - ics.CallSQL() JSP Tags - ics:selectto - ics:catalogmanager - ics:sql - ics:callsql
<ics:selectto> JSP Tag This JSP tag executes a simple query from a table. However, it is not used for joined tables. Its syntax is represented as:
<ics:selectto table="Table_Name" what="Field_Name" listname="List_Name" where="Criteria" orderby="Sort_By_Field" limit="List_Size"/>
70
Module 3
Description List of columns to return; the format of what is a commaseparated list of column names. Name of the list to contain the resultset. Comma-separated list of table columns to select against. For each item in the where string, the value of the corresponding variable is used to construct a SQL where clause. All the elements in the comma-separated list must be variables. Orders the rows returned by the query; the format of orderby is a comma-separated list of column names. Maximum number of rows to return.
orderby limit
Example: Consider the following content table called EnployeeRecords where the information about employees is stored in 6 columns: ssn (primary key) - social security number fname - first name lname - last name address - street address city - city of residence state - state of residence fname lname Joe Mary Sam Sarah Smith Scott Jones Akerman address 53 First St. 284 Vine Ave. 33 Elm St. 440 Walnut St. city Howard state Ohio
Figure 6:
EmployeeRecords Table
The following is the code used to retreive and display records of employees (first name, last name, address, city, and state) who live in Ohio state, city Howard:
<ics:setvar name=city value=Howard/> <ics:setvar name=state value=Ohio/>
71
<ics:selectto table="EmployeeRecords" what="fname,lname,address,city,state" listname="EmployeeList" where="address" /> <!-- display the results here --> <!-- use the <ics:listloop> and <ics:listget> tags --> ...
<ics:listloop> JSP Tag This JSP tag provides a tabular data structure that contains content in row/column format and acts as the container of a resultset. Use <ics:listloop> to iterate throughout the entire list. Its syntax is represented as:
<ics:listloop listname="List_Name" maxrows="Number_Of_Iterations" startrow="Start_Row_Number" endrow="End_Row_Number"/>
Description Name of the list to iterate. The maximum iterations the loop should be executed. The row number to start the iteration. The row number of the row to end the iteration.
72
Module 3
<ics:listget> JSP Tag This JSP tag retrieves the value of the specified field in a specified list. Its syntax is represented as:
<ics:listget listname="List_Name" fieldname="Field_Name" output="variable_name/>
Description Name of the list to iterate. The fieldname parameter may be any column in the list to retrieve that columns value for the current row. A Content Server variable that will store the value of a fieldname. Later, this variable can be evaluated with
<ics:getvar/>
Example:
<ics:listloop listname="EmployeeList"> <ics:listget listname="EmployeeList" fieldname="SSN" output="ssnumber"/><br> <ics:listget listname="EmployeeList" fieldname="fname"/><br> <ics:listget listname="EmployeeList" fieldname="lname"/><br> <ics:listget listname="EmployeeList" fieldname="address"/><br> <A HREF="http://localhost:7001/servlet/ ContentServer?pagename=EmployeeResume&emplId='<%= ics.GetVar("ssnumber") %>'>Get Employee Resume</A> </ics:listloop>
<ics:callsql> JSP Tag This JSP tag retrieves and executes an SQL query stored in the SystemSQL table. The resultset of the query is cached against the table name specified for the query in the SystemSQL table. The table name must exist in the database prior to calling <ics:callsql>. Its syntax is represented as:
<ics:callsql qryname="Query_Name" listname="List_Name" limit="List_Size"/>
Description Name of query to retrieve and execute. Name of list to contain resultset. Maximum number of rows in the resultset.
73
Example: To get reccords from the EmployeeRecords table, a developer first needs to create an SQL query in the SystemSQL table called Training/getEmployees:
select * from EmployeeRecords where state=Variables.mystate
Variables mystate can be provided to Content Server page either by GET or POST method or by using <ics:setvar/> tag. Content Server will evaluate all of its variables prior to running queries. Below is the example of how the query can be called with <ics:callsql/> tag:
<ics:callsql qryname="Training/getEmployees" listname="EmployeeList2" /> <!-- display employee records here --> <ics:listloop listname="EmployeeList2"> <ics:listget listname="EmployeeList2" fieldname="SSN" output="ssnumber"/> <ics:listget listname="EmployeeList2" fieldname="fname"/><br> <ics:listget listname="EmployeeList2" fieldname="lname"/><br> <ics:listget listname="EmployeeList2" fieldname="address"/><br> <A HREF="http://localhost:7001/servlet/ ContentServer?pagename=EmployeeResume&emplId='<%= ics.GetVar("ssnumber") %>'>Get Employee Resume</A> </ics:listloop>
Note: In <ics:callsql/> tag (qryname argument) requires you to provide the full path to you query. If your query name is getEmployees and it is located in the Training folder in the SystemSQL table, then gryname must be set to Training/getEmployees. <ics:catalogmanager> JSP Tag This JSP tag invokes the CatalogManager servlet. That servlet creates, modifies, or deletes tables and rows. The syntax of the <ics:catalogmanager> JSP tag is dependent upon the command passed to it. Refer to documentation for a complete list of commands and their corresponding syntax for <ics:catalogmanager> Example: To add a row to the EmployeeRecords table, use the following code:
<ics:catalogmanager> <ics:argument name=ftcmd value=addrow/> <ics:argument name=EmployeeRecords value=table/> <ics:argument name=fname" value=Jane/> <ics:argument name=lname" value=Rosen/> <ics:argument name=address" value=34 Howard Street/>
74
Module 3
75
Error Checking
Some requests to Content Server can result in an error condition. Content Server tags report error codes which are stored in the errno variable. Use the <ics:if> tag to test the value of errno. If errno is a negative integer, then an error occurred during the execution of the tag. Otherwise, the tag was executed successfully. The following examples show how to use the <ics:geterrno/> tag to display the value of the errno variable:
<ics:if condition='<%= ics.GetErrno() < 0 %>'> <ics:then> Error Value: <ics:geterrno/> </ics:then> </ics:if>
or
<% if (ics.GetErrno() < 0) { out.write ("Error Value: " + ics.GetErrno()); } %>
Log File Content Server logs errors to several default log files. To turn error logging on, set the following debug properties (located in futuretense.ini) to yes :
ft.debug - Controls whether Content Server should put debug messages into the log
file.
ft.xmldebug - Controls whether Content Server should put XML template evaluation messages into the log file. ft.dbdebug - Controls whether Content Server should put database debug messages into the log file and standard output. ft.dbl - Allows for browser-based retrieval of the log.
76
Module 3
P agelet B
P age let A
P a gelet C
Figure 7:
Page Design
Each rectangle in the preceeding diagram represents a pageletthe generated output of one or more elements. These pagelets are called by a containing page. The containing page lays out how the pagelets appear on the finished web page and contains any code that must be evaluated each time the page is viewedcustom ACL
77
checking code, for example. This strategy allows you to code an element once and use it in many places in your web site.
If the content seldom changes. If the content changes frequently. If the pagelet does not contain logic that If the content must be real time. requires evaluation to work. If the pagelet contains code that checks for ACLs, or other logic that requires evaluation to work. When a request for a web page comes to CS-Satellite, it checks its cache for the various pagelets that comprise the finished page, then assembles those chached componants and serves the completed page.
CS also supports Java. Use the Content Server Java API to code your business logic.
78
Module 3
79
Caching
Caching is one of the most powerful features of Content Server. Caching stores a copy of a rendered web page in memory. When a web site visitor requests a cached page, Content Server displays the copy of the page rather than re-rendering it. An effective page caching strategy allows your site to perform well by relieving load on Content Server and the database. The divine Content Server product family contains two products that cache web pages: Content Server, which caches pages on the main server to either disk or Java memory. Content Server Satellite, (CS-Satellite) which provides another level of page caching. CS-Satellite comes with Content Server and is installed automatically on the Content Server box. For additional performance benefits, you can also install CS-Satellite on remote servers.
For optimum performance on the delivery system, Content Server uses the caching capabilities of both products in tandem, in a method known as double-buffered caching.
CacheManager
As assets change, pages containing them will change. Therefore, cached versions become invalid. The CacheManager Java object manages cached pages and pagelets, flushing only the invalid pages from the cache. When an item such as an asset is loaded for a page, CacheManager records that item as a dependency for the pages validity. Then it saves this information with the cache information. As a result, two new cache tracking tables are created: SystemPageCache (replaces SystemExpire and gives each page an ID) SystemItemCache (links items such as assets to pages)
When new content is published, CacheManager checks the cache tracking tables to find which pages and pagelets contain outdated content. It then flushes outdated pages and pagelets from the cache, and loads updated copies of the outdated pagelets into the Content Server cache. CacheManagers flush and refresh functions work for both Content Server and CS-Satellite. CacheManagers flush and refresh functions work for both Content Server and CSSatellite.
80
Module 3
Figure 8:
Double-buffered caching
Content providers publish updated assets to the delivery system. CacheManager checks the cache tracking tables to see which cached items are affected by the updated assets. CacheManager flushes the outdated Page1 from the Content Server cache, then reloads the Content Server cache with the updated Page1. Any requests for Page1 will be served the old version of Page1 from the CS-Satellite cache. This protects the Content Server machine from undue load as it deletes and rebuilds its cache. CacheManager flushes the outdated items from the CS-Satellite cache. As visitors come to the web site and request Page1, the CS-Satellite searches to see if Page1 is in its cache. Because Page1 is not in the CS-Satellite cache, the request is passed on to Content Server. The CS-Satellite systems cache is filled with an updated version of Page1, taken from the Content Server cache. The updated page is served to the requestors. If Page1 were requested again, the page would be served from the CS-Satellite cache.
81
Follow these directions for completing this lab exercise. Setting Page Cache In this section, you will set the cache for your page.
1. In the Content Server Explorer, find the SiteCatalog entry (page) Training/ HelloPage. 2. In the cachinfo field for the Training/HelloPage page, enter true. 3. Save your changes by clicking the Save button. 4. Click the Save all files/catalogs button. 5. Find and preview the Training/HelloPage page. 6. Make a change in the Training/hello element and preview the page again. The
page rendered in the browser will not change because the page is cached.
7. Now, preview the same page in your browser by appending city=Boston to the
Your page will not change. Setting Page Criteria In this section of the exercise, you will set the page criteria.
1. In the Content Server Explorer, find the SiteCatalog entry (page) Training/ HelloPage. 2. In the resargs1 field for the Training/HelloPage page, enter PageCriteria=city 3. Save your changes by clicking the Save button. 4. Now, preview the same page in your browser by appending city=Boston to the
82
Module 3
5. Change the value of the city argument passed to the page to NYC. Your URL should
83
Module Summary
There are a variety of tools available to you in Content Server, including Content Server Explorer and CatalogMover. Content Server Explorer is a Microsoft Windows application for viewing and editing tables and rows in the Content Server database and for creating and editing executable elements (i.e. files) written in XML or JSP. Users of the Content Server Explorer tool include Element Developers and Database Administrators. CatalogMover allows you to export and import Content Server database tables. Users of the CatalogMover tool include Element Developers and CSEE Administrators. JSP provides an easy way to mix raw HTML and Java code in the same file. Use HTML (format code) to lay out the format of a page; use Java or XML or JSP tags (content code) to provide logic or access the database.
84
M od ul e 4
Terms to Know
Term Asset type Definition A category of basic assets. Each asset must belong to an asset type. For example, Article is a popular asset type. An Article asset is an instance of an Article asset type. A site might contain millions of Article assets but only one asset type named Article.
85
Term Asset
Definition An instance of an asset type. The central organizational unit of CS-Direct, CS-Direct Advantage, and CS-Engage. The following are examples of assets: one image and the data that describes it, one article and the data that describes it, or one product for sale. A large site might contain millions of assets. In addition, nearly all the infrastructure in a site (for example, templates and attributes) are themselves assets. CSEE defines two major categories of assets: basic assets and flex assets. The state of a page asset when positioned appropriately in the site tree. A unique value that identifies a publication (site). The state of a page asset when the location of the page is not in the site tree.
86
Module 4
To override these settings for the page entry for this template, click in the field and enter the new values.
acl, which contains a comma-separarated list of the Access Control Lists (ACLs). If you want to restrict the visitors who can request this page, enter the ACLs that visitors must have in order to see the page. resargs2, which corresponds to the PageLevelParameters field in CS-Direct.
This column holds variables (arguments) that can be passed to the page entry. CSDirect uses several reserved variables, called PageCriteria, that CS-Direct stores in the resargs column when you save the template. Note that the root element for this page entry in the SiteCatalog table is the element that you create or identify in the next section of the template form.
87
(Required)
4. In the For Asset Type field, select the Personals asset type (required field) and then
128 characters.
6. If this template will be used to render sub types, select the subtypes in the Applies to
Subtypes field.
7. In the Create Template Element? section, click JSP. 8. In the Template Element Description field, enter a description of the template. When
you save the template asset, the information in this field is written to the description column for the element entry in the ElementCatalog table.
9. In the Template Element Logic entry area, code your element. Write a simple statement, such as Hello Students!
You can use Content Server Explorer to continue coding this template element. If you decide to use Content Server Explorer, complete the rest of the steps in this procedure first, before you use Content Server Explorer to open the element.
10. Click the Save button to save your template.
To test a CS-Direct template directly in the browser (live mode), type the following URL:
88
Module 4
89
Assets are stored in the Content Server database. You use Asset methods (or tags) to extract the information about the assets that you want to display on your on-line site from the database. When you use an <asset:load> tag to retrieve an asset from the database, CS-Direct loads an instance of the asset into memory as an object. You then have access to that instance of the asset with the other asset tags until either the session is flushed (the root element exits) or the name that is used for the asset object is overwritten. Assets can have parent-child relationships that are set up through one of the following: Named associations - Defined, asset-type-specific relationships represented as fields in the asset forms. Unnamed relationships - Established, for example, when you select assets from the generic select list boxes on the Page form.
Database Tables
CS-Direct stores information about assets in these database tables: Primary database table - Holds assets of a given type. For example, each page asset has a row in the Page table and each article asset has a row in the Article table. These tables store information such as the assets name, object ID, who created it, which template it uses, etc. Use the Asset methods to extract information from these tables. AssetRelationTree table - Holds information if the asset has named associations or unnamed relationships with other assets. Use the <asset:children> tag to extract information from this table. AssetPublication table - Specifies which management sites (or publications) give you access to the asset through CS-Directs asset entry and edit forms. If the asset is shared between more than one site (or publication), there is a row entry for each pubid, which is a unique value that identifies a publication (or site). SitePlanTree table - Holds information if the asset is a Page asset.
90
Module 4
Asset Tags
The following tags retrieve an asset from the database and allow you to access the information that it contains: <asset:load> <asset:get> <asset:scatter> <asset:children>
<asset:load> Tag
The <asset:load> tag retrieves an instance of a specified asset and then saves the instance into memory (as session information), assigning it the name provided by the name parameter. That object is then available until the session is flushed (the root element exits) or the name is overwritten. Object names are global in scope. Its syntax is represented as:
<asset:load name=Asset_Name type=Asset_type objectid=Asset_ID field=Field_Name value=Field_Value/>
Description Name to use to identify the asset after it is retrieved and stored as an object in memory. All references to the asset by other asset tags (for example, <asset:children> and <asset:get>) during this session will use this name to identify the asset. Asset type of the asset that you want to retrieve from the database. The object ID of the asset. If the objectid fargument is not used, use both field and value attributes. The field attribute supplies a field name for a field that contains a value that uniquely identifies an asset. If the objectid argument is not used, use both field and value attributes. The value attribute is used in conjunction with the field attribute, the value attribute supplies a value that uniquely identifies an asset.
value
91
or if you dont want to use the ID of the HelloArticle asset and you know its unique name, you can use the followng code instead to do the same result:
<asset:load name=myArticle type=HelloArticle field=name value=spacejunk/>
<asset:get> Tag
The <asset:get> tag retrieves the value of a single field from a loaded asset object and stores that value in a Content Server variable. Typically, this tag is used to extract information that you want to display on-line from the specified asset object. If you want to extract information from multiple fields at once, use the <asset:scatter> tag. The syntax is represented as:
<asset:get name=Asset_Name field=Field_Name output=Variable_Name/>
Description The name assigned to the asset whose field value you want to get. This asset must be loaded and assigned a name before you can pass its name to this tag. The name of the field whose value you want to retrieve. The name of the output variable to create to store the value of the field.
Example: Below is the example of how to get fields (name, description, headline, and body) of a HelloArticle asset:
<!-- load a HelloArticle asset first --> <!-- get the cid and c arguments dynamically --> Hello Article ID: <ics:getvar name=cid/> <asset:load name=myArticle type=<%= ics.GetVar(c) %> objectid=<%= ics.GetVar(cid) %>/> <!-- get the article name --> <asset:get name=myArticle field=name output=theName/> <br><b>Article Name:</b> <ics:getvar name=theName/>
<!-- get the article description --> <asset:get name=myArticle field=description output=theDesc/> <br><b>Article Description:</b> <ics:getvar name=theDesc/>
<!-- get the article headline --> <asset:get name=myArticle field=headline output=theHeadline/ >
92
Module 4
<!-- get the article body --> <asset:get name=myArticle field=urlbody output=theBody/> <br><b>Article Body:</b> <ics:getvar name=theBody/>
Note: You always have to load the asset first with the <asset:load> tag before you get its fields. Note: In the <asset:get> tag, the names of the fields the names of columns in the asset type table rather than the names of the field that appear in the CS-Direct user interface. For example, the HelloArticle body field has a corresponding column in the HelloArticle table called urlbody. When using <asset:get> tag to extract HelloArticle body field, use set the field argument to urlbody.
<asset:scatter> Tag
The <asset:scatter> tag retrieves values from the fields of a previously loaded asset and then writes them into memory (session information) as variables. The variables are constructed with a prefix that you supply by using the tags prefix parameter. After you use this tag, you can display the information contained in the assets fields. Its syntax is represented as:
<asset:scatter name=Asset_Name prefix=Variable_Prefix_Name/>
Description The name assigned to the asset whose fields you want to make variables of (or scatter). This asset must be loaded and assigned a name before you can pass its name to this tag. Specifies a string to be included in the name of the variables that store the assets information.
prefix (required)
Example: Below is the example of how to scatter fields (name, description, headline, and body) of a HelloArticle asset:
<!-- load a HelloArticle asset first --> <!-- get the cid and c arguments dynamically --> Hello Article ID: <ics:getvar name=cid/> <asset:load name=myArticle type=<%= ics.GetVar(c) %> objectid=<%= ics.GetVar(cid) %>/> <!-- scatter all the fields from the HelloArticle asset --> <asset:scatter name="myArticle" prefix="article"/> <!-- print the values of the scattered fields --> <br><b>Article Name:</b> <ics:getvar name=article:name/>
93
<!-- <asset:scatter> does not work when rendering url fields, use <asset:get> instead to render HelloArticle boudy --> <asset:get name=myArticle field=urlbody output=theBody/> <br><b>Article Body:</b> <ics:getvar name=theBody/>
Note: You always have to load the asset first with the <asset:load> tag before you scatter its fields. Note: In the <asset:scatter> tag, the names of the fields the names of columns in the asset type table rather than the names of the field that appear in the CS-Direct user interface.
<asset:children> Tag
The <asset:children> tag retrieves assets that are associated with (are children of) the asset that you specify. Each child is listed with a value for each field from its row in the AssetRelationTree table (such as nid, nparentid, nrank, otype, oid, and ncode). You must load the parent asset (By using the <asset:load> tag) before you can invoke this tag to list its children. Its syntax is represented as:
<asset:children name=Asset_Name list=List_Name code=Association_Name objectype=Asset_Type objectid=Asset_ID order=nrank/>
Description The name assigned to the parent asset whose children you want to list. This parent asset must be loaded and assigned a name before you can pass its name to this tag. The name to assign to the list which stores the results. Restricts the list to include only the child assets that have the relationship (or association) specified by this parameter. Restricts the list of children by asset type. Restricts the list to include only the child asset that you specify. The fields to sort the list by and whether the sort on those fields is in ascending (asc) or descending (desc) order.
The <asset:children> tag will extract children assets from the AssetRelationTree table and returned the following fields for each child in the list:
94
Module 4
oid (child id) otype (child type) nid (node id) nparentid (child node parent id) ncode (name of the association, if named) nrank (ranking for assets in collections only)
Example: Below is the example of how to find an associated asset for a HelloArticle asset:
<asset:load name=myArticle type=<%= ics.GetVar(c) %> objectid=<%= ics.GetVar(cid) %>/> <asset:children name=myArticle list=ImageList objecttype=HelloImage/> <ics:if condition='<%= ics.GetErrno() < 0 %>' > <ics:then> <ics:if condition='<%= ics.GetErrno() == -111 %>' > <ics:then> <br>Asset has no children </ics:then> <ics:else> <br>Error received: <ics:geterrno/> </ics:else> </ics:if> </ics:then> <ics:else> <!-- display asset children --> <ics:listloop listname=ImageList> <ics:listget listname=ImageList fieldname=#numRows output=childNum /> <ics:listget listname=ImageList fieldname=oid output=childId /> <ics:listget listname=ImageList fieldname=otype output=childType /> <br>Number of children: <ics:getvar name=childNum /><br> <!-load the child asset --> <asset:load name=myImage objectid=<%= ics.GetVar(childId) %> type=<%= ics.GetVar(childType) %> /> <asset:get name=myImage field=name output=v_name /> <br><ics:getvar name=v_name/> <asset:get name=myImage field=description output=v_desc /> <br><ics:getvar name=v_desc/> <!-- use the <render:satellite> tag to display a picture --> ...
95
<satellite:blob> Tag
The <satellite:blob> tag retrieves a blob. If the specified blob is already cached on this CS-Satellite, <satellite:blob> loads it into the page. If the specified blob is not already cached on this CS-Satellite, <satellite:blob> extracts the blob from a table, caches it, and loads it into the page. Keep in mind that this tag works regardless of the cookie setting on the browser. This tag overrides the default caching expiration time defined by the CS-Satellite
expiration property.
The satellite:blob tag is the preferred method to render images, downloadable documents, and other large objects that are managed by Content Server.
Its syntax is represented as:
<satellite:blob> [<satellite:parameter name="service" value="service_name"/>] [<satellite:parameter name="blobtable" value="blob_table_name"/>] [<satellite:parameter name="blobkey" value="primary_key_name"/ >] [<satellite:parameter name="blobwhere" value="primary_key_value"/>] [<satellite:parameter name="blobcol" value="column_name"/>] [<satellite:parameter name="blobheader" value="MIME_type"/>] [<satellite:parameter name="csblobid" value="session variable"/>] <satellite:parameter name="cachecontrol" value="expiration_date_time"/> [<satellite:parameter name="blobnocache" value="true or false"/>] <satellite:parameter name="ALT" value="alttext"/> <satellite:parameter name="BORDER" value="border_size"/>
Description
Specify the start of the HTML tag to hold this blob. For example, if the blob is an image, set service_name to "img src".
Name of the content table containing the binary data. Name of the column used as the table's primary key. Value of the primary key for the row containing the binary data.
96
Module 4
MIME type for returned data. It takes the form description/extension. For example, the MIME type for a GIF image is image/gif. The value of this parameter must correspond to a session variable of the same name when BlobServer security is on. When a request is made to the BlobServer, the img src service parameter sends a new request to the application server after the browser reads the containing page. BlobServer then verifies if the csblobid parameter was set. When BlobServer security is set to true and the csblobid value matches the session variable value, the blob is served. If the values do not match a security violation is reported and no blob is served.
Specifies when this blob expires from the cache. If you omit this tag, CS-Satellite uses the value of the expiration property to determine how long to cache this blob. You can override the default expiration value by specifying one of the following: never - This blob should never expire for time reasons. Such objects are not guaranteed to stay in the cache forever. For example, if the cache is full, CS-Satellite removes blobs on a LRU (Least Recently Used) basis. immediate - Expire this blob immediately; in other words, to not cache this page. expiration_date_and_time - Specifies the precise date(s) and time(s) this blob should expire.
csblobid
cachecontrol
- Specifies the precise date(s) and time(s) this blob should expire. Placing the word session in front of expiration_date_and_time tells CS-Satellite to serve this blob only to the person who originally requested it.
session:expiration_date_and_time
Whether or not to disable blob caching. A value of true prevents the blob from being cached.
Alternate text associated with the blob. Sets the border size for the blob.
Example: Below is the example of how to display a HelloImage asset with the BlobServer:
<satellite:tag> <satellite:parameter name='type' value='open'/> </satellite:tag>
97
... <satellite:blob> <satellite:parameter <satellite:parameter <satellite:parameter <satellite:parameter <satellite:parameter <satellite:parameter <satellite:parameter </satellite:blob> ... <satellite:tag> <satellite:parameter name='type' value='closed'/> </satellite:tag>
name="service" value="img src"/> name="blobtable" value=HelloImage /> name="blobkey" value="id" /> name="blobwhere" value=HelloImageID/> name="blobcol" value="urlfile" /> name="blobheader" value=img/gif /> name="ALT" value=Some Image
Note: Make sure that you import satellite.tld tag library file with the following code:
<%@ taglib prefix="satellite" uri="futuretense_cs/satellite.tld" %>
98
Module 4
Now, preview another HelloPersonal asset with the template that you created in this exercise. Use the URL shown above and simply change the value of cid to be the ID of your asset.
Extra Credit
Use the <asset:scatter> tag to display the same fields as you displayed with the <asset:get> tag. Note: You always have to loads the asset before you scatter its fields. The <asset:scatter> tag does not work when rendering url fields; use the <asset:get> tag instead.
99
Finding Associated Assets with the <asset:children> JSP tag 1. Modify your HelloPersonalTemplate element to add the <asset:children> JSP tag. Name the list returned by the <asset:children> tag HelloImageList.
2. From the list the associated of HelloImage assets, retrieve and display the value of each child images oid field. Use this oid value (image ID) to load a HelloImage asset with the <asset:load> tag. 3. Use the <asset:get> JSP tag to get the values of the mimetype and alttext
fields for the HelloImage asset. Store the values in the Content Server variables v_mimetype and v_alttext, respectively. Displaying HelloImage Asset Before you use satellite.blob tag, you will need to notify Satellite Server that there are Satellite tags in the code. For this, you will need to add both, the Satellite Server opening and closing tags to your element:
1. Add a Satellite Server opening tag in the beginning of your element: <satellite:tag> <satellite:parameter name=type value=open/> </satellite:tag> 2. Add the Satellite Server closing tag at the end of your element: <satellite:tag> <satellite:parameter name=type value=closed/> </satellite:tag> 3. Import the satellite.tld by adding the following line in the header of your
element:
100
Module 4
<%@ taglib prefix=satellite uri=futuretense_cs/ satellite.tld %> 4. Display the HelloImage asset with <satellite:blob>. The following is the code sample for displaying a HelloImage with the <satellite:blob> tag: <satellite:blob> <satellite:parameter name=service value=img src/> <satellite:parameter name=blobtable value=HelloImage /> <satellite:parameter name=blobkey value=id /> <satellite:parameter name=blobwhere value=<%= ics.GetVar(ChildId) %> /> <satellite:parameter name=blobcol value=urlfile /> <satellite:parameter name=blobheader value=<%= ics.GetVar(v_mimetype) %> /> <satellite:parameter name=ALT value=<%= ics.GetVar(v_alttext) %> /> </satellite:blob>
template and then click on the Preview button. While previewing an asset in the Preview mode (via the CS-Direct interface), CS may display an preview error page at the bottom of the template, which looks similar to the following:
The error message only happens in the Preview mode when the asset does not have any other assets associated with it and asset:children tag returns an empty list.
2. In your browser, preview any asset with any template by typing the following URL: http://localhost:7001/servlet/ ContentServer?pagename=HelloAssetWorld/HelloPersonal/ HelloPersonalTemplate&cid=HelloPersonaID
101
CS-Direct determines how to render content by using an argument named rendermode. rendermode has three valid settings: Export - CS-Direct uses the Export to Disk publishing method to create static HTML files. Live - CS-Direct invokes Content Server to serve content dynamically. Preview - CS-Direct invokes Content Server to render a selected asset in a browser pointed at a CS-Direct management or development system.
Render Tags
The following tags render a page for use with CS-Satellite, render an element, and render a blob for use with CS-Satellite: <render:satellitepage> <render:callelement> <render:satelliteblob>
102
Module 4
Description The name of the page to invoke. Determines how long to cache the pagelet.
Example: The following code calls for the page entry of a template named HelloImageTemplate1, passing the ID of the asset that it should display:
<render:satellitepage pagename="HelloAssetWorld/HelloImage/HelloImageTemplate1"> <render:argument name="cid" value=HelloImageID/> </render:satellitepage>
Note: This tag assumes that the asset you are rendering has its own template. Thus if you would like to display a child asset with its parent you can do so either by displaying the child asset within a parent template as you did in Exercise 4.2.2, or you can create a template for child assets and use <render:satellitepage> to display child assets with their own templates. If you would like to display a child with the default template, the best way to get the name of a default template is looking up in the asset type table. Load the child asset first with <asset:load> tag and then get the name of a default template with the <asset:get> tag. See the example:
<!-load the child asset --> <asset:load name=myImage objectid=<%= ics.GetVar(childId) %> type=<%= ics.GetVar(childType) %> /> <asset:get name=myImage field=template output=v_template />
103
</render:getpageurl>
Description Name of the variable that stores the URL generated by this tag. Page name from a SiteCatalog entry. The page name can be referred to by a specific name or it can be determined through some combination of the four standard CS-Direct page criteria variables (c, cid, ct, and p). For example:
pagename=BurlingtonFinancial/Article/ Variables.ct
cid (required) p c
ID of the asset that the URL represents. ID of the parent page. If a value for p is not explicitly provided, the tag tries to determine whether a value exists. Type of the asset. This parameter is optional, but if c (asset type) is not supplied, rendermode is set to export, and assets of this type have a Filename field, then the file name that the Export to Disk publishing method creates for the asset does not include the information from the Filename field of the asset. divine strongly recommends that you supply a value for c. Whether or not to include session IDs in the URL when a browser is set to reject cookies. true means to encode session IDs in the URL. If this parameter is not specified, it is set to true by default. Whether to create a static or a dynamic URL for the asset when the page is being rendered by the Export to Disk publishing method. true means to create a dynamic URL even if rendermode is set to export. false means to create a static URL if rendermode is set to export. If this parameter is not specified, it is set to false by default. Previously created URL-encoded packed arguments, in standard form; that is, the output of a previous render:packargs tag. Name/value pairs to be passed in and included in the URL.
addsession
dynamic
packedargs
render:argument
Example: Below is an example of how to create dynamic links for the HelloArticle assets in the Collection of HelloArticle assets:
<render:getpageurl outstr="theURL" pagename="HelloAssetWorld/ HelloArticle/HelloArticleTemplate" cid=ArticleID> </render:getpageurl> <br><A HREF='<%= ics.GetVar("theURL") %>'>Article Name</A>
104
Module 4
Description Input. Start of the HTML tag to hold the reference to the blob. For example, if the blob is an image, use service=IMG
SRC.
Input. Name of the CS-Direct table that stores assets of this type. For example, blobtable=ImageFile. Input. Name of the column used as the primary key. Typically, this is id. Input. Object ID of the asset. Input. Name of the column that contains the binary data. For example, for the imagefile asset type, blobcol=urlpicture.
105
Description Mimetype for returned data, in the form description/ extension. For example, the mimetype for a GIF image is image/gif. Specifies HTTP header variables to suit your needs, The blobheadername parameter is used in conjunction with the blobheadervalue parameter to produce name/value pairs. This parameter represents the variable name. Used in conjunction with blobheadername to specify and represent HTTP header variable values. Input. Name/value modifiers for the HTML tag. For example:
<render:argument name=vspace value=5/> <render:argument name=hspace value=5/>
blobheadernamen
blobheadervaluen render:argument
cachecontrol csblobid
Input. Determines for how long to cache the blob. See satellite:blob for details about this parameter. Value of this parameter must correspond to a session variable of the same name when BlobServer security is on. When a request is made to the BlobServer, the img src service parameter sends a new request to the application server after the browser reads the containing page. BlobServer then verifies if the csblobid parameter was set. When BlobServer security is set to true and the csblobid value matches the session variable value, the blob is served. If the values do not match, a security violation is reported and no blob is served.
106
Module 4
Creating a Template for HelloImage Assets 1. Log in to CS-Direct and create a JSP template asset called HelloImageTemplate. HelloImage assets will be rendered with this template.
2. Use the <asset:load>, <asset:get>, and <ics:getvar> tags to load a
HelloImage asset, and then to get and display the name of the asset.
3. Use the <satellite:blob> tag to display the HelloImage asset.
Refer to the tag syntax and example in <satellite:blob> Tag on page 96. Dont forget to import the satellite.tld and to use the opening and closing tag for Satellite Server in your element.
4. Add an HTML tag to your template to display the image with a background color (<body bgcolor=yellow> </body>). 5. Assign the HelloImageTemplate to one of the HelloImages as a default template. 6. Preview a HelloImage asset with the HelloImageTemplate. You should be able to see
the image with its name and yellow background. Using the <render:satellitepage> Tag to Call HelloImageTemplate 1. Modify the HelloPersonalTemplate element to display HelloImage child asset within its own template:
a. Remove the <satellite:blob> tag from the HelloPersonalTemplate
element. HelloImageTemplate will render the image. b. Use the <render:satellitepage> tag to make a call to HelloImageTemplate and pass the ID of a HelloImage asset that you would like to display.
2. Preview a HelloPersonal asset. You should be able to see your image with the yellow
background.
107
Creating a Template for a Collection Asset 1. In the CS-Direct, create a JSP Template asset called HelloCollectionTemplate2. Collections assets will be rendered with this template.
a. In the Name and Description fields, type HelloCollectionTemplate2 b. In the For Asset Type field, select Collection c. In the Applies to Subtypes field, select HelloPersonals.
This template will only render collections of HelloPersonals assets. d. From the Create Template Element? section, click the JSP button. e. Click the Save button to save your template.
2. Assign the HelloCollectionTemplate2 template to all three Collections:
Rendering a Collection asset 1. In the Content Server Explorer, open the Collection/ HelloCollectionTemplate2 element.
2. Use the <asset:load>, <asset:get>, and <ics:getvar> tags to load a
Collection asset, and then to get and display the name of the Collection.
3. Similarly to steps for rendering HelloPersonals children in Using the
<asset:children> Tag on page 100, add code to your template to find an ordered Collection children (HelloPersonal assets).
4. Display the ordered list of children by showing hyperlinks to HelloPersonals assets.
When the user clicks on a link, he or she should see a HelloPersonal asset displayed with the HelloPersonal Template. Use <render:getpageurl> tag to display the link to these assets. The hyperlink should render a HelloPersonal asset with the HelloPersonalTemplate. Please refer to the example and tag syntax in the <render:getpageurl> JSP Tag on page 103.
108
Module 4
You should be able to see a page with the list of hyperlnks to the HelloPersonal assets.
3. Click on a hyperlink to view a HelloPersonal.
109
Creating a Template for a Page Asset 1. In the CS-Direct, create a JSP Template asset called HelloPageTemplate2. Collections assets will be rendered with this template.
a. In the Name and Description fields, type HelloPageTemplate2 b. In the For Asset Type field, select Page c. In the Applies to Subtypes field, select personals.
This template will only render collections of HelloPersonals assets. d. From the Create Template Element? section, click the JSP button. e. Click the Save button to save your template.
2. Assign the HelloPageTemplate2 template to the following page asset:
Rendering a Page asset 1. In the Content Server Explorer, open the Page/HelloPageTemplate2 element.
2. Use the <asset:load>, <asset:get>, and <ics:getvar> tags to load a Page
asset, and then to get and display the name of the Page.
3. Use the steps for rendering HelloPersonals children in Using the <asset:children>
Tag on page 100, add code to your template to find Page children (Collections).
4. Display the ordered list of the Page children.
Use <render:satellitepage> tag to display each Collection. This tag should render a Collection with the HelloCollectionTemplate2. Please refer to the example and tag syntax in the <render:satellitepage> JSP Tag on page 102.
110
Module 4
111
Database Tables
CS-Direct stores information about Page assets in these Content Server database tables: Page table - Stores information about the Page asset as an asset (such as its name and object ID, who created it, which template it uses, etc.); uses the Asset methods to obtain information from that table. AssetPublication table - Specifies which management sites (or publications) give you access to the Page. Page assets cannot be shared between sites (or publications) so there is only one row entry for a page because it can have only one pubid, which is a unique value that identifies a publication (or site). SitePlanTree table - Stores information about the Page assets hierarchy in the site structure; uses the Site Plan methods to obtain information from that table.
Description The name of top-level node of the site plan to load. The node ID of the top-level node in the site plan.
112
Module 4
Description The name assigned to the page asset whose node ID you want to retrieve. This page asset must be loaded and assigned a name before you can pass its name to this tag. The variable name to assign to the page assets node ID.
output (required)
Description The name of the parent node whose children you want to list. This parent node must be loaded and assigned a name before you can pass its name to this tag.
113
Description The name to assign to the list of the nodes children. This list holds values for all of the fields in the SitePlanTree table. Restricts the list to nodes of a specific type and that type should always be Page. The object ID of a specific child node. The name of the association that describes the relationship between the child and parent nodes. Valid values are Placed and Unplaced. The fields to sort the list by and whether the sort on those fields is in ascending (asc) or descending (desc) order.
order
You should load the node from the Site Plan tree first before looking for child pages. The following is the example of how to use this tag:
<!-- load the Home page --> <asset:load name="root" type="Page" field="name" value="Home"/> <!-- get the node ID of this page asset --> <asset:getsitenode name="root" output="topnodeid"/> Node ID: <ics:getvar name=topnodeid/> <!-- load the node --> <siteplan:load name="topnode" nodeid='<%= ics.GetVar("topnodeid") %>'/> <!-- get the page children here --> <siteplan:children name="topnode" list="pageList" code="Placed" order="nrank"/> <ics:if condition='<%= ics.GetErrno() < 0 %>' > <ics:then> <ics:if condition='<%= ics.GetErrno() == -111 %>' > <ics:then> <br>Page has no children </ics:then> <ics:else> <br>Error received: <ics:geterrno/> </ics:else> </ics:if> </ics:then> <ics:else> <ics:listget listname="children" fieldname="#numRows" output="childNum" />
114
Module 4
<ics:listloop listname="children" maxrows='<%= ics.GetVar("childNum") %>'> <ics:listget listname="children" fieldname="oid" output="childpage:id" /> <asset:load name="childpage" type="Page" objectid='<%= ics.GetVar("childpage:id") %>'/> <asset:get name="childpage" field="name" output="childpage:name"/> <br> Child Page Name: <ics:getvar name="childpage:name"/> </ics:listloop> </ics:else> </ics:if>
115
Purpose
While performing this exercise, you will learn how to: Use the <siteplan:children> tag. Use the <siteplan:listpages> tag to navigate through the Hello Asset World site tree. Generate dynamic links to pages by building the referURL variable.
Creating a CSElement HelloNavBar In this section, you will create a new CSElement asset that displays page assets the Site Plan tree. The CSElement HelloNavBar is an asset, which you can inspect, edit, delete, publish, and preview in the CS-Direct interface. This element can be shared by all the pages in the Hello Asset World site.
1. In the CS-Direct interface, select New and then click on the CSElement link to create
If you do not enter anything in this field, the CS-Direct will automatically create a new HelloNavBar element in the root directory of the ElementCatalog.
5. From the Create Element? section, click the JSP button.
The CS-Direct will create code in the Element Logic text area. When you save this asset, this code is saved in the HelloExtra\HelloNavBar.jsp file. You can change the name of the JSP file by modifying the entry in the Element Catalog Entry Storage Path/Filename: field before you save the CSElement asset.
6. Click the Save button to save your CSElement asset.
You can now modify code in the HelloExtra\HelloNavBar element. You can also test your changes by simply clicking the Preview button in the asset Inspect form.
116
Module 4
Displaying the Root of Hello Asset World Site Plan Tree In this section, you will add code to the HelloExtra\HelloNavBar element to display the Site Plan tree.
1. Use the <asset:load> tag to load the HelloPersonalsHome page (top page in the
Site Plan tree). You do not need to know the ID of this page asset. Simply use the name of the asset in your code. The following code is the example of how you can find an asset by its unique field:
<asset:load name="root" type="Page" field="name" value="HelloPersonalsHome"/> 2. Use the <asset:get> tag to get the value of the page asset ID and then use the <render:getpageurl> tag to display the link to this page.
Please refer to the example and tag syntax in the <render:getpageurl> JSP Tag. Displaying All Pages in Hello Asset World Site Plan Tree In this section, you will modify the HelloExtra\HelloNavBar element. You will use the <siteplan:children> tag to display links HelloPersonalsHome children pages.
1. Get the Site Plan tree top node if with the <asset:getsitenode> tag. Store the
node id in the CS variable (refer to the example and tag syntax in Site Plan Tags on page 112).
2. Load this node with the <siteplan:load> tag. 3. Use the <siteplan:children> tag to get all children nodes. 4. Write an <ics:if><ics:then><ics:else> statement that checks for errors returned by the <siteplan:children> tag. Error -111 means that no children nodes
were found. Do not display any error messages if no grandchildren were found.
5. If the children list exists, for each child page load and display the name of the page and then use the <render:getpageurl> tag to build and display a dynamic link to
117
Module Summary
When you use an <asset:load> tag to retrieve an asset from the database, CSDirect loads an instance of the asset into memory as an object. Assets can have parent-child relationships that are set up through named associations or unnamed relationships. Named associations are defined, asset-type-specific relationships represented as fields in the asset forms. Unnamed relationships are established, for example, when you select assets from the generic Select list boxes on the Page form. CS-Direct stores information about assets in these database tables: Primary database AssetRelationTree AssetPublication SitePlanTree
<asset:load> <asset:get> <asset:scatter> <asset:children>.
The CS-Direct site tree is an outline or site plan, located on the Site Plan tab, that displays the page assets in your site. CS-Direct stores information about page assets in these database tables: Page AssetRelationTree AssetPublication SitePlanTree
Siteplan queries that you use frequently include: - <siteplan:load> - <asset:getsitenode> - <siteplan:children> CS-Direct renders content by pages and pagelets into static HTML pages (via the Export to Disk function) or dynamic pages and by assets (via the Preview function) There are three valid settings for the rendermode argument: - export - live - preview Render queries that you use frequently include: - <render:satellitepage> - <render:callelement> - <render:satelliteblob>
118
Module 4
119
120
M od ul e 5
Terms to Know
Term workflow process Definition Workflow is a feature provided by CS-Direct that you use to manage the work on an asset when more than one person participates in its creation. An asset that a participant is working on (or is supposed to be working on). The movement of an asset between states is called a step
121
Definition A state is a point in the workflow process that represents the status of the asset at that point. For example, writing article, reviewing image, legal review, and so on. The job titles of the people who participate in a workflow process are considered roles in the Content Server interface. Roles describe the function of an individual on a site. When you enable a user for a site, you assign that user the roles that they fulfill for that site. The individual user who is selected from the pool of users who have the correct role at any point is called a workflow participant. A deadlock occurs when the following conditions are true: There is more than one step from a state. Two or more of the steps require the participants to perform that step. That is, they are all-voting steps. An asset in that state is assigned to more than one participant. The participants select different all-voting steps when they finish the assignment. Workflow groups enable content providers to send a defined set of assets though the workflow together. Function privileges restrict access to a function from the user interface only. You can then configure the workflow process to send e-mail messages that remind a participant when the deadline is approaching or has been missed. These e-mail messages are examples of timed actions. On a static CSEE delivery system, Content Server copies the rows for your approved assets from the Content Server database on the management system to the Content Server database on the delivery system. On a static CSEE delivery system, a web server, CS-Direct instructs Content Server to render all approved assets according to their templates and then saves those files. This delivery type is a data transformation method. Rather than creating pages that are ready to be displayed by a web server, it uses the Export API to create one XML file for each approved asset. A publishing destination defines the location where your content is published to. Total number or revisions for Content Server to keep. Going back to the previous version.
role
workflow participant
deadlock
static HTML publishing (Export to Disk) static XML publishing (Export Assets to XML) publishing destination version number rollback
122
Module 5
Definition When users create or edit assets of a type that is being revision tracked, they do not have to manually check out the asset: it is automatically assigned to them. Then, when they click Save, the asset is checked back in. When a content provider manually (explicitly) checks out an asset, a version is not storedno matter how many times he or she saves ituntil is is manually checked back in.
123
Workflow Participants
When you begin creating a workflow process, the first general question is this: what are the job titles of the people who work on assets of this type? For example, are they authors, editors, marketers, graphic artists, product managers, lawyers? The job titles of the people who participate in a workflow process are considered roles in the Content Server interface. Roles describe the function of an individual on a site. When you enable a user for a site, you assign that user the roles that they fulfill for that site. When you create a workflow process, you determine which roles are appropriate for each task. Then, when an individual asset is going through that workflow process, only the users who have the appropriate role are allowed to complete the task. The individual user who is selected from the pool of users who have the correct role at any point is called a workflow participant.
Workflow States
Next, what are the tasks that are performed for assets of this type? For example, writing, pricing, editing, fact checking, legal review, and so on. These tasks are called workflow states. A state is a point in the workflow process that represents the status of the asset at that point. For example, writing article, reviewing image, legal review, and so on. Participants complete the work that the state represents while the asset is in that state. An asset that a participant is working on (or is supposed to be working on) is called an assignment. A users assignment list is displayed on the My Work form in the Content Server interface. An asset appears on a users assignment list as soon as it enters a state for which the user has a role to fulfill as a workflow particpant. Should an asset in a specific state remain in that state for only a specific amount of time? If so, assign a deadline to the state. You can then configure the workflow process to send email messages that remind a participant when the deadline is approaching or has been missed. These e-mail messages are examples of timed actions. You can create one or more timed action for each state.
124
Module 5
Managing Deadlocks
A deadlock occurs when the following conditions are true: There is more than one step from a state. Two or more of the steps require the participants to perform that step. That is, they are all-voting steps. An asset in that state is assigned to more than one participant. The participants select different all-voting steps when they finish the assignment.
DEADLOCK
Note that if even one of the steps is not all-voting and a participant selects that step, the asset will not become deadlocked.
Resolving Deadlocks
An asset that is in a deadlocked state cannot progress through the workflow process until the deadlock is resolved. To resolve the deadlock, the participants must confer with each other and agree on that path that the asset should take. Then, the participants who must change their selection can do one of the following to resolve the deadlock: Finish the assignment and select the step that they all agreed to take. Select the Abstain from Voting option from the Workflow Commands drop-down list on the assets Status form.
125
Preventing Deadlocks
Before configuring a workflow process that can result in a deadlock, be sure that it is absolutely necessary to have complete agreement on all the possible steps from the state. As you can see from this description, deadlocks cause additional work for all the participants so be sure that you use this feature only when you need to. For example, consider a review state with two possible steps: return for revisions and approve for publish. If you configure the steps so that return for revisions does not require a unanimous vote but approve for publish does, you have created a desirable controlall the reviewers must agree before the asset can be published and any rejection stops the asset from being publishedwithout risking a deadlock.
Workflow Groups
Is there ever a situation in which several assets are so closely connected that they need to be thought of as one unit of work or they need to be approved at the same time? In such a case, you can use the workflow group feature.
126
Module 5
Because steps are enabled for specific roles, only the users who have a role that is assigned to the start step of a process can select that process. This means that if you are using start menu items to place assets in workflow, you must be sure that the roles assigned to the start menu item are the same roles that are assigned to the start step of the default workflow. Note Versions of CS-Direct prior to Version 4 assigned a default workflow to assets through a property in the futuretense_xcel.ini file. The ability to assign a default workflow through a start menu item has replaced that method of determining a default workflow.
127
There are three parts to a function privilege: The function being restricted. The roles allowed or not allowed to perform the function. The state during which users with those roles are allowed or not allowed to perform the function.
When a function privilege is in effect, it means that a user can perform that function only when the following conditions are true: The user has an appropriate role. The asset is in the correct state. The asset is assigned to the user.
This means that even if the user has the correct role and the asset is in the correct state, the user cannot perform that function on that asset unless the asset is assigned to that user.
128
Module 5
Continue down the list of functions, until you have at least one privilege specified for each function privilege listed in the Functions form for the workflow process.
129
Instructor Demonstration
Follow along as the instructor demonstrates how to place and navigate HelloPersonal asset in a workflow.
Start: Write A user in the role of HelloAuthor receives HelloPersonal e-mail notification of the assignment. The End: Edit HelloPersonal author writes and revises the article before finishing the assignment. Start: Edit HelloPersonal End: End of Workflow Start: Edit HelloPersonal End: Write HelloPersonal The HelloPersonal status is updated to approved for publishing to selected destinations. The asset is removed from workflow. A user in the role of HelloEditor receives an e-mail notification of the assignment. The HelloEditor finishes the assignment by rejecting the HelloPersonal because of factual errors. The rejection triggers a notice to the HelloAuthor, who must make some corrections and resubmit the HelloPersonal for approval.
130
Module 5
reads the HelloPersonal and fixes some punctuation. When done, Flo saves her changes and uses the Finish My Assignment function to Approve for Publishing. Because Flow can either approve or reject the HelloPersonal asset, the workflow process presents both options to her. However, when Flo approves the article, its state does not change until Coco (another HelloEditor) also approves it. If Coco approves the HelloPersonal, the workflow process changes the state of the article to End of Workflow. The asset is automatically approved for publishing and removed from workflow.
Since Joe and Moe are the two users that have HelloAuthor role, any of them can log in and place a HelloPersonal asset in to the workflow.
2. Create a new HelloPersonl asset or use the existing one to place it in a workflow. For
this, inspect the asset and select choose Status from the pop-up menu:
131
3. In the assets status screen,which looks similar to the following screen, will come up:
4. From the Workflow commands, choose Select Workflow. 5. From the Select
screen, select HelloPersonal Process and then click the Set Participants button.
6. From the Set Participants screen, select Joe for HelloAuthor role and then select both
This should bring you back to the Select Workflow for HelloPersonal:
HelloPersonal asset name screen. 8. From this screen, click the Select Workflow button, to place the asset into the
After you finish your work for an assignment, you need to notify the system that you are done so the asset can continue to move through the workflow process. Complete the following steps:
1. View the assets status by opening the asset in the Status form. 2. Click in the Workflow commands field and then choose Finish My Assignment
132
Module 5
From the same menu, you can also select Delegate Assignment to another user in HelloAuthor role. However, Joe is the only participant of this role in this workflow.
a. Select the next step and state for the asset. b. In the Action Taken field, type a short description of the work that you completed
on the asset. c. In the Action to Take field, type a short suggestion for the next person who will work with the asset.
3. Click Finish My Assignment.
The asset status screen will show with the workflow history. Examine the workflow history to verify where the asset went. It should indicate who the asset was assigned to. In this case, this asset was assigned to Flow and Coco (both are in HelloEditor role). The HelloPersonal asset is now in the EditPersonal state and should be edited by both Flo and Coco.
4. Log out and log back in to Content Server with the Flo/hello user name and
password. You should be able to see the HelloPersonal asset in the assignment list. Continue editing and reviewing the asset. Finish your assignment to pass the asset to the next state.
133
During a publishing session, CS-Direct writes information about that session to log files. Because the publishing process runs in the background, you can use your browser to complete other administratrive tasks while the session runs. And you can monitor the session through the Publish Console, which shows both the publishing history and the status of any publishing sessions that are currently running. When the publishing session uses the Mirror to Server delivery type, the publishing system communicates and cooperates with the CacheManager on the delivery system. The CacheManager is a Content Server servlet that manages the page cache on a system. It ensures that pagelets or pages that refer to the assets that will be mirrored are cached. Then, after the publishing session concludes, CacheManager generates those pages again to display the updated content, and caches the new pages and pagelets.
134
Module 5
Delivery Types
The term delivery type means the publishing method. There are three delivery types and they use either the Export API or the Mirror API. Which delivery type you use for your CSEE system depends on how you plan to deliver the content on your delivery system (statically or dynamically) or whether you are delivering your content to some other nonCSEE system: On a static CSEE delivery system, a web server delivers static files files to your site visitors. You use the Export to Disk delivery type to create the files. During an export publishing process, CS-Direct instructs Content Server to render all approved assets according to their templates and then saves those files. You, the adminstrator, must then use FTP or another file transfer protocol to move those files to the web server that is your delivery system. On a dynamic CSEE delivery system, Content Server generates (renders) pages upon request. Content Server makes dynamic content decisions based on the request. You use the Mirror to Server delivery type to copy the rows for your approved assets from the Content Server database on the management system to the Content Server database on the delivery system. The Export Assets to XML delivery type is a data transformation method. Rather than creating pages that are ready to be displayed by a web server, it uses the Export API to create one XML file for each approved asset. You use this delivery type when your end goal is to publish assets to another (non-CSEE) delivery system or database and that system needs your content to be formatted in XML.
Publishing Destinations
A publishing destination defines the location where your content is published to. A destination is a named object that contains the following information: A delivery type (that is, Export to Disk, Mirror to Server, or Export Assets to XML) A location For Export to Disk and Export Assets to XML, the location is the root file directory that the resulting HTML or XML files are saved to after the publishing system converts the approved assets into files. You set this directory with the cs.pgexportfolder property in the futuretense.ini file. For Mirror to Server, the destination is the server name in URL format (which includes the port number if it is anything other than 80) of the server that is supposed to deliver that content. You set the server name in the Destination address field of the Destination form. Note that before you can publish to a mirror destination, you must initialize it.
Various publishing arguments, depending on which delivery type you are using. For example, if you are using Export to Disk you could specify a URL prefix for your internal links (HREFs). The CSEE sites whose assets can be published to the destination.
You can configure more than one publishing destination for your CSEE system. Depending on how your online sites are designed by the developers, you may need to publish both static and dynamic content. For this kind of dual implementation, consult with your developers to determine how to configure your publishing destinations.
135
In this document, the following terms are used when discussing publishing destinations and configuration: Source, which means the Content Server database that serves as the source for a publishing session. Because you can mirror assets from any CSEE system to any other CSEE system, the source is not always the CSEE management system. Destination, which means either the Content Server database that you are mirroring to or the directory that you are exporting to.
When an asset is ready to be published, a content provider marks it as approved for a specific destination. (For information about how you approve assets, see the chapter on publishing in the CSEE User's Guide.) CS-Direct then verifies that the asset is ready to be published by calculating the list of assets upon which approval depends. For example, the Burlington Financial sample site has article assets with associated imagefiles. An approved article with an unapproved associated imagefile cannot be published until the imagefile is also approved. It is typical to build an approval step into your workflow processes.
Approval Dependencies
The approval status of an asset is determined by its dependency relationships, which include the approval status of all asset items associated with a particular asset item, as well as the dependency relationships of those associated items. How are approval dependencies calculated? That depends on the publishing method: For Export to Disk, the approval system renders the asset according to the template that is assigned to it when the asset is approved, or, if there is one, according to the default approval template for assets of that type.The tags in the template code set approval dependencies that determine the appropriate dependents for the approved asset. The dependent assets must be in an appropriate approval state before the current asset can be published. For Mirror to Server or Export Assets to XML, the approval process examines the data relationships between asset types. Basic assets have associations. Flex assets have family relationships. Both of these relationships create approval dependencies for these publishing methods. For example, if you approve a flex asset, it will be held from a publishing session unless its parent assets are in an appropriate approval state.
When the approval system calculates approval dependencies, it further categorizes those dependencies by the following types: Exists some version of the dependent asset must exist on the destination so that links to it will work. Exact the version of the dependent asset must exactly match the version of it that was approved. That version must either already exist on the destination or be approved
136
Module 5
for the destination so that it can be published with the asset that is being evaluated. The version of an asset is based on the timestamp in the updateddate column for that asset. An asset can be published only if it meets all specified dependencies: that is, all associated assets are also in the correct approval state (either approved or previously published, as necessary). If not, the approved asset is held by CS-Direct until its dependent assets have been approved. Note When someone deletes an asset, its status is changed to Void and it is automatically approved for any destination that it was ever published to. Then, during the next publishing sessions for those destinations, that asset is published and its status becomes Void on those destinations.
Held Assets
A held asset is one that cannot be published because its approval dependencies are not yet met. When its approval dependencies are met, it will be published. An asset will be held from a publishing session when any of the following conditions are true: It is not approved. It was approved, but someone edited it again and it has not yet been re-approved. It has a dependent asset with an exact dependency that is not approved. It has a dependent asset with an exists dependency and that dependent asset has never been published. It has a dependent asset with an exact dependency, the dependent asset has been published, but it has since been edited and is not yet approved. It is an exact dependent of another asset that was previously approved, but has since been edited and is not yet re-approved. It is checked out (revision tracking).
The approval system calculates dependencies for basic assets differently when the delivery type is Export to Disk than when it is Mirror to Server and Export Assets to XML.
137
When the delivery type is Export to Disk, the dependencies are determined as the code in the template is evaluated. If a default template has been assigned for assets of that type, the approval system uses it to determine the dependencies. If there is no default template, the approval system uses the template specified for the asset. Developers create default templates for asset types for the following reason: when Export to Disk actually publishes the asset, it does not necessarily use the template that is assigned to the asset the code in another element could determine that a different template is used for that asset in certain cases. If this is the case for your online site, it is likely that the developers who created the templates also designed default templates for the approval system to use when calculating approvals. You or your site designers can set default approval templates for each asset type and for each publishing destination. For more information about how dependencies are created between assets when the delivery type is Export to Disk, see the chapters on template design in the CSEE Developers Guide.
Note that the Approve Multiple Assets feature is not the BulkApprover utility. The BulkApprover utility approves only those assets that have been imported into the Content Server database with the BulkLoader utility. Both BulkLoader and BulkApprover are described in the CSEE Developers Guide.
138
Module 5
Additionally, you can publish to more than one destination at the same time. You just set up events for the destinations and select the same time for them. Be aware that the reverse is not true: that is, you cannot have more than one source publish to the same destination. If you do, there will be problems with data integrity as well as publishing errors. Because a publishing event completes database transactions, the publishing feature must have a user account specified for it. This user is called the batch user and you use the xcelerate.batchuser and xcelerate.batchpass properties in the futuretense_xcel.ini file to identify the batch user account for your CSEE system.
Then, those assets are either rendered into files or mirrored to a destination database, depending on the delivery type in use. When the publishing session concludes, the publishing system notifies the approval system of which assets were published and then it updates the page cache. Note The CS-Direct publishing system publishes assets that are held in the Content Server database. If you are storing files directly on your web server or your site designers use links from assets to files that are not assets, you must implement an additional process to move those files to your web server and to update them when necessary.
139
Instructor Demonstration
Follow along as the instructor demonstrates how to create a publishing destination and publish HelloPersonal asset.
node and then double-click the Dynamic link. The screen that appears in the right side of user interface looks similar to the following image:
2. In the Publish Destination screen, click the Edit button to edit the destination: a. In the Name field, write HelloAssetWorld Destination. b. In the Destination address field, write the address of your destination server, the
port, and the application server directory. You can use your neighbors server to publish the asset. For this, ask another student to get your the name of his/her machine and construct the destination server in the following manner:
http://servername:portnumber/servlet/ContentServer
140
Module 5
This user name and password are used to log in and publish an asset on a remote server.
4. From the Sites list, choose Hello Asset World. 5. Click the Save button.
3. Check the Dynamic (using Mirror to Server) check box and then click the Approve
botton. Content Server will list the depending assets that you have to approve on the next screen.
4. Check all the dependencies and then click the Approve button. Content Server will
(Mirror to Server) and then click the Select Destination button. Content Server will inform you how many assets are ready to be published.
7. Click the Publish button, wait, and then go to Publish console to see the status of the
publishing process.
141
Content Server will inform you whether the process went successfully or failed for a certain reason.
node and then double-click the Dynamic link. The following screen appears in the right side of user interface looks similar to the following:
This arguement will appernt /yourname to the standard directory where the files are usually stored (usually set in the cs.pgexportfolder property in the futuretense.ini file).
3. From the Sites menu, select Hello Asset World. 4. Click the Save button.
You can now set a default template that publishing process will use for the HelloPersnal assets. Since there is only one template in this site, the setting up of a default template is not as important; however for training purpose, the instructor will demonstrate to you how to do it anyway.
5. In the Admin tab, go to Publishing->Destinations->Static->Set Default Templates. 6. In the screen that appears on the right side of the window, select a default template for
the HelloPersnal asset and for any other asset type that you intend to publish.
142
Module 5
Status option to preview and set up a starting point for the asset.
3. At the bottom of the Status screen, in the Publishing Destinations section, next to
Static: click the Specify Path/Filename, Start points link. On the next screen, do the following:
a. On the next screen, from the Is this asset an export starting point?, select Yes b. c. d.
e.
checkbox. In the Using Templates section, check HelloPersonalTempalate. Leave the Force specified path and Force specified filename unchecked. Click the Save button. Content Server will take you back to the Status screen from where you can preview an asset with the template it is going to be published with. For this, simply click the Preview this for Static link. If you like what you see in the Preview window, click the Approve this asset link
4. In the Approve
for publish to Static of HelloPersonal: HelloPersonal Asset Name window, select and approve all the dependent assets.
Once the asset the all its dependent assets are approves, you can follow the steps in the Mirroring an Asset (Dynamic Publishing) section to publish the assets.
If publishing is successful, you will find the *.html files on your local drive. The location of the files is easyto find out. First, look at the cs.pgexportfolder property in the futuretense.ini file. Then, append your DIR argument value set in the Creating a Destination for Static Publishing section. You direcory name will be cs.pgexportfolder/DIR.
143
144
Module 5
For example, an asset that consists of a small amount of ASCII data occupies so little space that a large number of revisions would take little disk space. However, each version of an asset that holds a large amount of binary data could occupy a significant amount of disk space. In the second case, you must strike the appropriate balance, storing the fewest number of versions necessary for rollback purposes.
145
Instructor Demonstration
Follow along as the instructor demonstrates how to create a publishing destination and publish HelloPersonal asset.
Asset Types->HelloPersonal->Revision Tracking node, and then double-click the Track link. The following screen will appear on the site:
2. In the Revisions to Keep text box, indicate how many revisions you would like to
have, then click the Enable Revisions Tracking button. You are now ready to place HelloPersonal assets in the revision tracking system.
and password.
2. Find and select the asset you want to check out. 3. Open the asset in the Inspect form and click Check Out under the action bar.
If the asset has been checked out by another user, the Content Server interface displays a message indicating that. If your checkout is successful, the Content Server interface displays the message: Checkout Successful, and updates the checkout status.
146
Module 5
Undoing a Checkout
To undo a checkout:
1. If the Content Server interface is not already open, log in. 2. Find and select the asset. 3. Open the asset in the Inspect form and click Undo Checkout under the action bar.
The Content Server interface displays the message: Undo Check Out Successful! The asset is returned to the database without a record of this checkout.
Checking In Assets
To check in an asset that you have checked out:
1. If the Content Server interface is not already open, log in. 2. Find and select the asset you want to check in. 3. Open the asset in the Inspect form and click Check In under the action bar.
the version that you are checking in. Comments are displayed with the asset title when you view the version history.
5. Keep Checked Out (optional) Select this option if you want to back up the asset but
The Content Server interface displays a Revision History Report for the asset. You can view any listed version by clicking the appropriate inspect icon in the left column. The Inspect view appears in a separate window.
147
4. Select the option in the Rollback column next to the version of the asset that you want
to return to.
5. Click Rollback.
A confirmation message appears. Note that rolling back an asset creates another version.
The system displays a list of all the assets that are currently checked out to you.
3. For any asset that should not be checked out to you, select it and check it back in. See
148
Module 5
Module Summary
The end goal for any asset is for it to be published. Before an asset can be published, it must be approved for publishing. Because there are so many configuration possibilities, it is typical to create a separate workflow process for each asset type that you plan to use workflow with rather than attempt to create one process for more than one asset type. When an individual asset is going through that workflow process, only the users who have the appropriate role are allowed to complete the task. Before configuring a workflow process that can result in a deadlock, be sure that it is absolutely necessary to have complete agreement on all the possible steps from the state. If you want to restrict who has access to an asset while it is in workflow, use the workflow feature called function privileges. These are restrictions set on functions such as edit, copy, approve, delete, show versions, and so on in the context of workflow states and workflow roles. The term delivery type means the publishing method. There are three delivery types and they use either the Export API or the Mirror API. Which delivery type you use for your CSEE system depends on how you plan to deliver the content on your delivery system (statically or dynamically) or whether you are delivering your content to some other non-CSEE system: Export to Disk, Mirror to Server, and Export Assets to XML. A publishing destination is either the Content Server database that you are mirroring to or the directory that you are exporting to. The approval system provides a feature called Approve Multiple Assets and publishing scheduling. When you enable revision tracking for a table, Content Server maintains multiple versions of a row in that table. When revision tracking is on for an asset type, Content Server provides both implicit (or automatic) and explicit (or manual) checkout/checkin functionality. When users create or edit assets of a type that is being revision tracked, they do not have to manually check out the asset: it is automatically assigned to them. Then, when they click Save, the asset is checked back in.
149
150