Professional Documents
Culture Documents
Cali Clarke Stuart Crump Dineshbabu Ramakrishnan Raul Munoz Serrano Hebba Soliman Rayomand Sui Narla Vasudevamurthy Wei-Dong (Jackie) Zhu
Preface
Important Note about referencing the latest information
This PDF document represents the overall Building a sample website with IBM Web Content Manager 7.0. In addition to the information contained in this document, also refer to the complete Lotus Redbooks Wiki at the following URL:
2 of 439
3 of 439
Hebba Soliman is a Senior Application Developer in IBM Egypt, Global Delivery Center (EGDC). She has been working as a developer and designer in many IBM Web Content Manager and WebSphere Portal projects in the last couple of years.
Rayomand Sui is a Client Technical Professional (CTP) for the IBM Collaboration Solutions (ICS) software brand in Wellington, New Zealand. In his previous role at IBM, he was part of the IBM Software Services for Lotus (ISSL) team delivering successful WebSphere Portal and IBM Web Content Manager solutions. He has worked with IBM Lotus technologies for over thirteen years and has been involved with IBM Web Content Manager implementations since 2003. He has also co-authored the IBM developerworks white paper "IBM Workplace Web Content Management V2.x to V6.x Migration Guide" and the IBM Redbooks wiki "Building a Website Using Lotus Web Content Management 6.1". In his spare time, he enjoys playing tennis, trying his culinary skills in the kitchen and Ceroc dancing. Narla Vasudevamurthy is a Software Engineer at WebSphere Web Content Management L2 Support, IBM Software Group. He has over 18 years of experience in the IT Industry. He has been working with Websphere Portal software since 2003. He is also a IBM Certified System Administrator - WebSphere Portal and WebSphere Application Server. Wei-Dong (Jackie) Zhu is an Industry Solution Project Leader with International Technical Support Organization. She has more than 10 years of software development experience in accounting, image workflow processing, and digital media distribution using C, C++, Java, and Lotus Notes scripts. Jackie holds a Master of Science degree in Computer Science from the University of the Southern California. Jackie joined IBM in 1996. She is a Certified Solution Designer for IBM Content Manager and has managed and lead the production of many Enterprise Content Management redbooks and Lotus Domino redbooks wiki projects.
4 of 439
Thanks to the authors of the previous editions of this wiki. Authors of the second edition, Building a Web Site using IBM Web Content Management, published in 2008, were: John Bergland Joesephine E Justin (Joyce) Hebba Soliman Stuart Crump Raul Munoz Serrano Erasmus Tapera Narla Vasudevamurthy Rayomand Sui
Become a contributor
Join us for a two- to six-week residency program! Share your knowledge with peers in the industry and learn from others. Help create content about specific products or solutions, while getting hands-on experience with leading-edge technologies. You will have the opportunity to team with IBM technical professionals, Business Partners, and Clients. Your efforts will help increase product acceptance and customer satisfaction. As a bonus, you will develop a network of contacts in IBM development labs, and increase your productivity and marketability. Find out more about the residency program, browse the residency index, and apply online at: http://www.ibm.com/redbooks/residencies.html
5 of 439
Part 1. Introduction
Part 1 covers the following topics: 1.1 Introduction to this guide This section introduces the Redbooks wiki: Building a website using IBM Web Content Manager. 1.2 Website fundamental This section describes the basic terminology and concepts of a website. It also examines why build a web site, the objectives are, and how to avoid failure. 1.3 People involved in a website This section describes functional groups and user roles which are typically brought together in a collaborative environment when building a website. 1.4 Web content management and IBM Web Content Manager This section explains the concept of web content management and what IBM Web Content Manager offers. 1.5 Key new features in IBM Web Content Manager V7.0 This section describes key new features for IBM Web Content Manager Version 7.0. DISCLAIMER: This guide outlines an example of building a basic website using a sample site, River Bend. This sample is not intended as a best practice for development, configuration, architecture, or any other aspect, such as scalability or performance. No warranty or support is implied for the example site or sample code used.
6 of 439
specific technical features, this guide discusses the key concepts and best practices for creating an accurate information architecture and site framework. DISCLAIMER: This guide outlines an example of building a basic website using a sample site, River Bend. This sample is not intended as a best practice for development, configuration, architecture, or any other aspect, such as scalability or performance. No warranty or support is implied for the example site or sample code used.
Website
A website is a collection of all of the text, graphic images, links, sounds, and other content elements that make up a presence on the web. The goal is to present content and information in the most dynamic, up-to-date method possible. Each individual document is called a web page. Web sites have three basic components: A home page - The home page is the top-most page in a web site. Web pages - Local and remotely stored web pages linked to the home page. Content - Content includes text, graphic images, and sounds.
Home page
A web site's home page is the first page that users see when they access a web site. It creates the first impression for users and sets the tone for organization and content in the site. A home page usually contains a header at the top that gives the name of the source for the site. Some headers are very simple and contain only text, while others have designs that incorporate graphic images.
Links
Users access local and remotely stored web pages linked to the web page by clicking on links. Links can: Take users to other web pages at the same site. Move users to other web pages at different sites. Jump the cursor to another place on the same page. Cause a file to be downloaded or copied from the website to the user's computer. Connect the user to other Internet resources, such as e-mail.
7 of 439
Content
Content is the substance of a website. It can take many forms, including: Text documents Graphic images Sounds Downloadable movie clips Links to other related sites
8 of 439
Today, the web is used as a natural medium that allows individuals and business to conduct transactions, especially the buying and selling of goods and services. Businesses use websites and portals to deliver efficiencies, with faster access to information and people and easier consumption of knowledge and education. In essence, there is much more reliance upon the web and websites than there could have ever been realized five to ten years ago. Why do websites fail? They fail because organizations do not acknowledge or understand their target audience, the needs of the consumer, or the need to deliver information at the right time, at the right place, with the right method. They also fail for the following reasons: Not understanding the businesses needs Web sites fail because the organization loses sight of their objectives and the businesses needs. Neglecting to keep objectives in focus can easily lead to a website existing just as a digital business card when really it is meant to deliver additional traffic through their outlets and drive additional sales online. A website must meet the objectives of the business and align with its target audience and what they want. Not having the right balance of the website design and content With a few exceptions, the balance of design versus content must be maintained. Too much in either direction might mean that the website is perceived as looking great but with no substance or value, or as a great source of information but difficult to use. Content and design are key elements for ensuring that the initial experience and perception of the website is good and that repeat consumer visits can be expected. Not having new content to attract repeat visitors Content is king. Whether for textual, applications, video, and audio reasons, consumers of a website revisit because their initial experience was good and their expectations were met. Consumers of the site will only return if the site is updated with new content. A consumer might look elsewhere when the content shows signs of being out of date or no longer relevant. Maintenance of the site especially its content is key to its success and should be planned and budgeted for as part of a website project. Not marketing and linking the website to attract new visitors Failure to market a website in either a traditional or digital marketing sense only leads to a failed website. Consumers visit websites through a number of mechanisms such as word of mouth, agencies, magazines, other Web sites, or search engines. Expect to use one or more of these avenues to publicize the site especially if it is within a competitive market. Not understanding the audience to better serve them Understanding the usage pattens and how many visitors you might expect to see on the site at any peak time can be difficult to estimate, but is important. If the site is designed to accommodate hundreds of users in a peak hour, when the actual number is in the ten thousands, this can lead to the website being slow and unresponsive. If more users stay on the website longer, perhaps reading or watching more or due to the slow response time, then this might result in the total visitor concurrency number to be higher than expected. Therefore, the experience for the visitor might become unpredictable. Understanding who the audience is, what they will be doing on the website, and how they might be using the website are keys to ensuring that a website does not fail.
9 of 439
While websites fail for other reason also, focusing upon these five areas help to ensure that the website has a healthy start.
1.3.1. Introduction
Building and maintaining a website using a content management system such as IBM Web Content Manager (WCM) is not a task to be undertaken by a single individual. It is not that this is an impossible task, rather this task requires skills, experience, and knowledge that usually come from many individuals working in a collaborative environment. Typically, we bring together individuals from three areas (business, technology, and information) and four distinctive groups (business, technical, content, and design (or layout). Depending on the size of the business and situation, it is possible for the same person to be split across positions in these groups. The functional groups represented include: Business Technology Information The specific user roles include: Business owners Corporate communications and marketing personnel Graphic designers Information architects Infrastructure engineers and operations Content authors, subject matter experts, and approvers Consumers
10 of 439
Typical members of this group include members of the management board, a project sponsor or sponsors (which is sometimes shared), business owners, and process leaders.
11 of 439
Note: These groups are key to building and maintaining the process and groups that persist along with the longevity of the website. While omitted here is the consumer or visitor, this group is vital for obvious reasons and can be logically grouped with the design or layout team because they will be responsible for the experience provided by the website. We talk about the consumer in a another section.
1.3.3. Roles
The user roles consist of business owners, corporate communications and marketing personnel, graphic designers, information architects, infrastructure engineers and operations, content authors, subject matter experts, and approvers, and consumers.
Business owners
As mentioned previously, the delivery of a content management system-based website is one where we can typically bring together individuals under four distinctive groups that collaborate together on a single goal, for the website. The business group has the vision for the website. They know the line of business requirements and can define the success criteria of the project among other responsibilities. Members of the management board and executive team perform the following tasks: Set and announce the key business objectives. Set the business context. Define the project sponsors (because this can be shared). Authorize the process leaders. Set the project budgets and the time line. The project sponsor or sponsors (part of the organization that is driving the project) perform the following tasks:
12 of 439
Work with business owners and content owners to define the information architecture. Define key concepts and terminology. Steer the decision process. Manage the project.
Process leaders perform the following tasks: Manage the project. Define the resources that are required. Work with business owners and content owners to define taxonomies that categorize and organize information for both the content creator and the content consumer. These tasks are closely related to the underlying information architecture.
Graphic designers
The design and layout group is responsible for delivering the complete user experience for the website visitor. The responsibilities include layout, styling, corporate branding, and accessibility, for example, in addition to the areas mentioned in the following list. The design, layout, and development team performs the following tasks: Helps to create and stamp the corporate design on the website. Ensures that styling and layout provide a flexible user experience for the visitor. Liaises with subject matter experts where necessary to address accessibility needs. Works with the IT team to technically implement the corporate design. Helps to create the author's template environment.
Information architects
Aligned with the group for IT, the information architect (sometimes known as information designers ) team closely works with individuals from the group and are responsible for the delivery of the structure to the content, categorization, placement, and alignment with the visitors' expectations of information placement. Content information architects perform the following tasks: With the design team, ensure the best fit and alignment with the visitors' mental model of information.
13 of 439
Help define the taxonomy in association with the content authors and subject matter experts. Define the content structure and groupings with the design team.
Information architects can be seen as an extension of the design and user experience group. Because common elements are shared across both areas, it is important to keep communicating and working in a collaborative partnership.
Consumers
Today, information, products, and services are acquired over the Internet through websites that are built with Web Content Manager. Web sites are a vehicle to unite consumers with products or information, and as such, the consumer plays the lead role. Consumers switch between competitive websites with the click of a mouse button if they do not find what they want within seconds of their visit. This is also the case with procurement of services and products. Sales are quickly lost if a consumer's mental model of how their interaction should take place is not aligned with how the website works. Clearly, consumers are important. For new websites, all consumer feedback is important. Getting the website wrong costs time, money, and consumers' trust. However, there is difficulty with getting it right the first
14 of 439
time if you do not have user feedback to work with. The question is: how do you get that feedback before your website goes live? There are several answers to this question. One that stands out is to solicit the expertise of user experience, information architects, and user centered practitioners, along with a targeted sample of willing participants from the general community. This is typically a standard practice among the methods used by these professions. For websites that are already in place and perhaps transitioning to a new experience, such as a portal or new design, it is becoming common practice to offer certain groups within the websites' core user base to have access to a live beta version of the site to gain feedback. This approach can be advantageous where there is a need to ensure business as usual. Consumers in a role that assists the organization perform the following tasks: Provide live and relevant website feedback. Can validate use case scenarios, check, and balance. Help eliminate overlap and misinterpretations of new design elements. Provide usability feedback, crucial with accessibility. Approve content. These roles and their functions are typically brought together in a collaborative environment when building a site.
15 of 439
Enterprise content management has the following objectives: Provide an efficient and secure solution for managing content within the enterprise, including enterprise-wide content storage, access, search, distribution, and retention. This is especially true with the current focus on corporate accountability and regulatory compliance. Build knowledge-based environments to leverage corporate know-how and expertise.
16 of 439
Dynamic web content Rather than embedding the information directly together with the design, dynamic web content treats the content and the presentation of the content as two distinct entities. By separating the web content from the presentation layer, you can manage and deliver content quickly and efficiently, independent of its presentation. The ability to manage both content and its presentation layer as separate entities is enabled most frequently by using web content management systems. With IBM Web Content Manager, companies or organizations can put the information in the right people easily and efficiently, which is a key component in sustaining a competitive advantage. Authors do not need to handle the technical side of web technologies. Content that is created can be integrated with multiple uses and processes, distributed or shared throughout and beyond an organization. For example, a single product sheet can contain complete pricing information, including internal prices that you only share within your organization. By taking advantage of the multi-publishing feature, you can publish a subset of the same document for your customers, without needing to maintain separate documents.
17 of 439
When looking at existing enterprises, specialized applications and databases are often established when it comes to business-critical information. IBM Web Content Manager becomes increasingly important for companies and organizations to leverage the complete spectrum of data assets within their enterprise and share it electronically among suppliers, customers, partners, and employees. Content that is created and managed from authors for the purpose of web publishing becomes only one component. Enterprise Content Management (ECM) provides a basis for the next generation of data management, enabling customers to collect, manage, and distribute all forms of business information. For example, an employee of a human resources department who updates a phone number in an internal application, has actually executed a step within a greater content management context. The changed number is simultaneously published to the web. It is mandatory to integrate content from a broad range of existing data sources. Open standards for content exchange are the key.
18 of 439
Workflow
The accuracy, relevancy, and recency of content is assured by automating the content life cycle, from creation to review, approval, delivery, and archival.
Management
Content becomes an asset as control of the web site is placed back in the hands of the users who understand the subject and customers best.
Content publication
After content is authored and approved, the content publication stage is where the content is released for delivery to the live site. The delivery can be a simple process, such as making a file available on a file system to a web server and advertising the URL. Or it can be a more complex procedure such as moving content through a complex workflow and into a production environment.
19 of 439
Content aggregation
Content aggregation occurs when content from various sources is brought together. In a simple web site, this occurs manually during the content creation phase. In a more dynamic and data-driven environment, the aggregation occurs at an application server level.
Content integration
Aggregation, transactional integration, and performance enhancing caching enrich the user experience.
Content delivery
Content must be delivered to the user in the appropriate (or desired) format. Most frequently, this implies delivery via HTTP by using browsers and similar devices. Alternatively, content delivery can refer to other publish-and-subscribe methods, data feeds, or web service protocols.
20 of 439
Content and design are just two important aspects of any web site (intranet or Internet) that benefit from a web content management system. The following aspects are important to a web site: Content: The creation, approval, and delivery process streamlined to take advantage of your organization's distribution of knowledge and skills. Design: Separation of design from content to allow for the design process (in-house or agency) to deliver consistent branding of your business, its products, and services. Componentization: Reuse of assets to allow the business to deliver more with less, and save money. Standards: A system to employ best practices where accessibility is required. Integration and delivery: Providing a framework from which a business can integrate with systems, services, and information including growth from Web sites to portals and beyond.
21 of 439
With these concepts in mind, you can be reassured that you are making the right decision to use a web content management (WCM) system. While there might be many factors to consider, the following decision tree can guide you and provide a starting point to expand upon.
22 of 439
23 of 439
Tree view:
24 of 439
25 of 439
Favorites
The updated authoring portlet allows users to select favorite items and views. This makes it easier to access these items in the future. To mark an item a favorite is very easy. The heart allows you to select and deselect an item as a favorite.
Syndication API
Web Content Manager now allows some syndication operations to be performed using the Web Content Manager API. Users can retrieve status, view the numbers of items in the last syndication event, push an update or a rebuild event to the syndicator and subscriber objects.
26 of 439
Query API
Web Content Manager Version 7.0 has added a great deal of functionality with the new query API. It is now possible to retrieve Web Content Manager objects using the API by creating queries to run against the repository. In the past versions, you could do very simple retrieval such as selecting by exact name or all items of a specific type. Now, there are many more options of how to retrieve items, as well as the availability to sort the results.
Projects on the other hand provide more than just the ability to group items in a common location. One of the difficulties that content authors have had is the challenge of publishing a group of items all at the same time. For example, if you have an announcement concerning a new product launch, there may be many Web Content Manager assets that are related to this announcement. It may be difficult to line up all of these items to publish at the same time, because some items may have to go through workflow and some do not, so it is not possible to set future publish date. Also, there is no guarantee that all items related to the announcement would be ready by announcement time. Projects solve this problem by allowing multiple items to be placed within the same project. Then, when the condition to publish the project is complete, all items within the project will be published. The project owner has control over how the project will be
27 of 439
published, whether manually, automatically (when all items in the project are pending publish), or based on a specific date. See the infocenter for more information on Projects.
Multiple drafts
In Version 7.0, Web Content Manager now allows content authors to create more than one draft version of a published object. In the past, only one draft object was allowed at a time. Now, you can have multiple drafts of the same workflow item:
28 of 439
WSRP
In the past, to retrieve content from a remote Web Content Manager server involved the Web Content Manager remote rendering portlet. This involved additional configuration above and beyond a typical portlet configuration. Now, the JSR286 portlet can take advantage of WSRP to retrieve content from a remote server.
29 of 439
Friendly URL
The JSR286 portlet allows for friendly URLs to Web Content Manager content to be processed and rendered through the portlets. Constructing Web Content Manager friendly URLs is a powerful and complex to explain. Check the infocenter information on this process. for more
Portlet caching
The JSR286 portlet can store information in the portlet cache. The portlet configuration allows administrators to determine what caching options will be used for a particular portlet, including the cache timeout behavior, and whether the cache should be shared across users, or specific to individual users.
1.5.8. WebDAV
Web Content Manager has added the ability to manipulate some items within Web Content Manager using WebDAV. This allows you to create, delete, and modify Web Content Manager assets using operating system tools, instead of using the Web Content Manager authoring interface.
1.5.9. JMS
Web Content Manager has added the functionality of generating JMS Messages to allow for notification of various events within Web Content Manager. This allows applications to be alerted when specific actions take place within Web Content Manager, mostly items being changed. Check the infocenter Content Manager. for more information on enabling JMS within Web
30 of 439
31 of 439
32 of 439
The key components in the architecture figure above are explained as follows.
33 of 439
In addition, refer to each product's documentation for details on the specific hardware and software requirements for these databases.
34 of 439
The web content viewer portlet (JSR 286) can be configured to display web content on the same portal server as the instance where WCM is installed or configured to display web content on a different portal server than the instance where WCM is installed. The following link explains how web content viewer (JSR 286) portlet can be configured to render content residing on a remote WCM Server:
http://www10.lotus.com/ldd/portalwiki.nsf/dx/Rendering_Web_Content_Viewer_portlet_consumed_from_Rem ote_IBM_Web_Content_Manager_V7_using_WSRP.__Setup_and_troubleshooting_guide.
Tip: Be aware of your infrastructure when using the web content viewer portlet (JSR 286) to render content residing on a remote WCM server.
35 of 439
2.2.1. Portal
Portal provides the basic framework services for content aggregation, role-based access, personalization, and security. The underlying J2EE platform provides low-level middleware services such as enabling security through a user registry and session management. These underlying services coupled with the basic portal framework services can provide content life cycle management in terms of content authoring and content delivery. Different roles, such as author, reviewer, and approver, can move content from authoring to delivery. The content management and delivery framework embedded in portal can be used in tandem with other features, such as personalization and content aggregation, which provides an effective presentation layer in the architecture. The portal framework allows the delivery of pages and sites that combine content from the CMS and other kinds of portal content from back-end systems.
2.2.2. Traditional
In the traditional architectural framework, content is prepared in pure HTML format by using different HTML editors, and the content is hosted on a web server for presentation. The URLs are exchanged with the reviewers and approvers for verification and validation over e-mail. The hosting platform does not provide content management. The dynamic applications came into existence with CGI scripts but had many limitations. The evolution of the J2EE platform brought new ways to display content on web sites: Static web content can be coupled with the dynamic content that is generated through servlets and JavaServer Pages (JSPs). However, the traditional framework still lacks in content management functionality.
36 of 439
37 of 439
almost before they are even aware that they are searching for the information, then you have accomplished the goal of organizing the information correctly and effectively for users. The primary reason for sharing information on a web site is to make it available for users. However, it is often the central reason why websites fail, which may also include the following reasons: Information is often voluminous and widespread over different divisions within an organization, making it difficult to maintain a consistent oversight of the structure of information and to determine a structure that is easy to understand and to use. There is rarely a single person or department with a consistent oversight of all the information that an organization wants to share. Information is used everyday, and as a result, it is often not obvious which pieces of information are most valuable or how they should be structured. By using a content management system, content providers can share more information and gain more experience, which can result in a strain on the original organization of the content.
The information architecture defines how the information on a web site should be organized and linked so that users can access content. An organization should investigate, analyze, design, and implement the information architecture for a site. Then, it must face the challenge of presenting an image that enhances the way in which the user experiences the information. There may be reasons why a specific path to information supports your business needs. The experience that a user has can be the key to success and often reflects the organizations philosophy. Frequently, an organization builds its success on a unique customer experience that cannot be ignored when architecting a web site. In addition, the audience can vary such that it becomes necessary to separate users into categories to provide a tailored experience for different types of users. For example, consider the following diverse offerings: A food company might offer both traditional, home style food and more contemporary fast food. A vehicle manufacturing company might have diverse offerings that range from passenger cars, to industrial trucks, to motorcycles, such as BMW. A technology company might offer a range of products and services, from technical consulting services to consumer electronics, such as Hewlett-Packard.
Because of this diverse range of products, brands may require their own web sites with a specific information architecture and web address (URL). In this case, a master (parent) web site, which includes links to seperate web sites to represent the specific branding, is the best choice. Defining the information architecture is often the most underestimated part of a content management project. Organizations frequently spend more time finding the right content management system than on developing the right information architecture for that system. When planning the information architecture, an organization must determine the following information: The hierarchical structure of the site The functionality that is required on the site The look of individual pages How to classify the content The flexibility of the architecture to allow the business to evolve
38 of 439
The information architecture determines the structure of the site, how navigation is derived, and therefore the ease of navigating the site. The following aspects of information architecture are considered when designing the content management system: Site framework Category hierarchy Document type hierarchy
Defining the information architecture lays much of the groundwork for how content is organized on a site. Regardless of where the content resides, you need a good understanding of what content needs to be presented. Tip: A good information architecture team includes representatives of all content areas that are included on the web site. It is also beneficial to have a single person lead the team who is willing to take a leadership role and to make the required decisions.
By using the profile information provided, along with additional personal information such as region, age, sex, and buying and viewing trends of the site, River Bend hopes to be able to increase revenues by making recommendations and posting custom campaigns on their site. River Bend has identified the following top levels of site areas or containers for content that are directly accessible from the home page:
39 of 439
From these top levels, a secondary site area allows users to specify the topic that they are looking for within that area. For example, the secondary site area for products includes coffee or tea. This architecture provides an obvious separation that users can comprehend that leads them to the information they want to find. The third level site area offers more content on the chosen topic. For example, under tea, users can find black tea, green tea, and herbal tea. From both levels 2 and 3, the site offers detailed search capabilities for specific items that the user might be looking for and tailored campaign content based on the site area and user profile information.
Page layout
To determine the structure and layout of the site it is important to create basic diagrams to help users to better understand how content will be structured. Likewise, it is important to agree on a navigational model. One method of building a website is to create basic wireframe diagrams. Wireframes are like blueprints for a website page layout. They show how the framwork of a website look like. You can use drawing, graphics, or presentation tools to draw the wireframe diagrams. Wireframes connect the underlying information architecture.
40 of 439
In a wireframe, it shows where the content or navigational item lay on a page and the functions that the page provides. For example, in the following figure, it shows where the content item, content menu, and link menu will be placed on a page. It also shows where the navigations and search capability will be provided on the page.
The following figure illustrates a sample home page also known as the landing page. This page is the starting point for site visitors. The page contains the following items: 1. Offers Menu - To tempt visitors into navigating to new product offerings such as a new coffee blend. 2. Four link images - To help users to quickly access to the important information (Content item A, B, C, and D). This can be for example, Coffee, Tea, News, and Company information. 3. Footer with short links - To provide contact, policy and site map information.
41 of 439
4. 5. 6. 7. 8.
9. 10.
The following figure shows the main or general page which provides access to all parts of the site: Navigational elements expanded - To show sub areas of the site - one parent and one child node deep. Offers Menu re-used - Perhaps slightly re-arranged (by date). Main part of the page - Used as the primary content delivery area, with inline editing tools when available. A Rate button is shown which uses an API function. Search bar - To allow users to perform search in the website. Campaign area - To deliver targeted information depending upon season or date (for example, eggnog or cinnamon coffee at Christmas, iced teas and coffee in the summer). Links Menu - To show links to other content with a suggest button. Foot - Re-used footer to display contact, policy, and site map information.
Note: The wireframe diagrams listed above are for illustrative purposes only. They do not represent the actual wireframes for the River Bend site.
42 of 439
not just the content and page layout but also the potential screen resolution, browser type, mobile access from smart phones, tablets and other devices as well as language and any accessibility and disability considerations. You should ensure that all of the relevant aspects are reflected in the user scenarios you develop. We'll talk more about this later in this chapter. Whilst we have stressed the importance of considering and developing the information architecture for your site as early as possible you may find that changes need to be made later in the process. This can be due to changes in the project scope or feedback from usability testing. Ensure that due consideration is given to the existing IA, any decisions based from this and the impact of the proposed changes by someone familiar with the architecture before any fundamental changes are made. Consideration should also be given to whether the site will be delivered through a portal or traditional website as these will likely drive differences in the information architecture as a portal site will need to consider what other tools, applications and capabilities are to be delivered alongside the web content. Sometimes an organization will implement an information architecture that may appear not to meet some users requirements. For example, a car manufacturer's web site will likely use an information architecture that provides good, easily found information for users looking for information about the latest models and launches. However, if users want information about specific supplies such as winter type, the information may be less easily found. The car manufacturer has fundamental business motive behind this strategy if for example the car manufacturer wants users to contact a local dealer instead of using the web to gain this type of information. In this example, the information architecture forces users to follow the preferred distribution channel and, in turn, helps the car manufacturers business. In this case an alternative would be to make the type information easily found but for the content to refer the car owner to the dealer and provide tools to easily find and contact their nearest dealership.
Introduction
How easily content can be found on an intranet can directly impact an organization's overall productivity. Organizations recognize the importance of information architecture as both the primary prerequisite for designing and developing a new content management system and as the means to organize information in a way that is readily accessible to customers or employees. One example is a call center that responds to customers by using an intranet portal to maintain contracts and to give information. For this call center, the range of time that is required for an agent to find the corresponding information and to fulfill the required steps ranges from under two minutes to four and a half minutes. Thus, if 80 attempts per day are made to find information and each requires two minutes more than necessary, this call center loses 160 minutes or 2.5 hours in productivity. Even without considering the costs that result from lost productivity, the customer satisfaction will decrease. When users cannot obtain the information that they need the organization has a dissatisfied customer or, worse, a lost customer. The effort to win back these customers is significant.
43 of 439
In addition to content accessibility, design flexibility becomes a key success factor for the information architecture of a website. One task is to conduct workshops with business stakeholders, including corporate communications and process area representatives. Given that the website will evolve as more business users provide input and, more importantly, contribute content, the site architecture can be expected to evolve as well. It is critical that the site framework be developed with flexibility for modification as a key goal. When planning the information architecture, key considerations include: Understanding the goals of the site Understanding your audience Considering objectives and key success factors Finding a highly effective application Defining use case scenarios Planning the site framework and site areas Defining category taxonomy Defining content type hierarchy Defining metadata, keywords, and categories Determining the components of the website Using workflow and syndication
These considerations translate to tasks that you perform and they guide you in the website design and decision process.
44 of 439
In our example of the River Bend Coffee and Tea Company (River Bend), the business goals and users goals are clearly defined after two studies were conducted and the core team completed a conceptual review. The sample findings of these tasks are outlined in the following sections.
Another common mistake that occurs in projects such as these is that either the questions or the answers are left to be too vague. Obviously, this leads to assumptions being made that may or may not be correct. For example, in the previous example, the
45 of 439
results of "the existing site was too hard to navigate" is ambiguous. It leads to other questions, such as what specifically was "hard" about the navigation? Consider for example the following additional questions: Were the menus too long? Was there too much scrolling? Was the resolution too poor to read?
Upon doing a follow-up survey, the previous points were then further defined so that they were useful: Organization When navigating the site, it is easy to loose where you are The grouping of content (teas versus coffees) was not clear "I didn't feel that the site was specific to my needs" Other sites offer recommendations and recipe ideas Navigation The menus were sometimes 4 or 5 levels deep, too hard to keep track of Some content was too lengthy, a lot of scrolling needed Search There was no intuitive way to search for specific coffees
46 of 439
The site framework should also be flexible and easy to modify: Ensure clear communication to those involved with the project. Involve content owners in the defining process but remain focused on the essentials. Get feedback from different groups of users from everyday content creators through site managers to occasional end users. Ensure varied groups and users review the content and site, avoid having a single user or department review as their perspective may be skewed. Appoint an overall lead for the project to ensure decisions get made and the project moves forward. Ensure that the content is easy to find. Ensure good knowledge of the audience's website experience. Make a distinction between different types of users. Set a realistic time frame.
In our example of the River Bend, a workshop was conducted with the key business stakeholders. They defined business objectives based on the feedback from their customer user community and the current state of the business. The following key items, among others, resulted from that workshop: Increase customer satisfaction with the site. Based on individual user profile, provide recommendations of other items they might be interested in purchasing. Present targeted sales and promotional campaigns on the website in order to drive more revenue.
47 of 439
spectrum of users is comprised of linear and non-linear thinkers. A linear approach, a non-linear approach, and a combination of these two approaches are equally valid. To accommodate the broadest community of users, IBM recommends that you develop three discrete design directions, focusing on page layout and navigation. Then present the design directions to a focus group that is comprised of a cross-section of users. The users will provide feedback regarding specific direction about how you should design the site and the content that you should highlight. A facilitator, which can be a qualified person within the content owners, should be engaged to conduct the session, and the session should be scripted with specific questions to ask the group. A website with a high score in terms of usability includes the following characteristics: Information is easy to find. The site is simple to use. Pages open quickly. Creating and maintaining content is a painless process. The site is adaptable to changes. The site must be secure (where applicable), stable, and scalable for both the content and the user population.
As discussed in the section above, Understanding your audience, you might need to classify the audience into groups with individual needs. You can divide these groups of users at least into two subgroups: First-time users Experienced, repeat users
In addition, include a second involved target group when it comes to UCD. Consider the following experts who will work with the web content management system: Content authors (such as content creators and approvers) Site developers and site administrators
The success of a web content management project also depends on the usability for the every day editor's work. Their environment should be intuitive and consistently structured as well.
48 of 439
In our example of the River Bend, there were five use case scenarios: 1. Persona: Content Author Description: An internal River Bend non-technical employee who needs to quickly and securely search relevant content libraries to his specific group role and create and submit for approval content based on a predefined UI template. 2. Persona: Content Approver Description: An internal River Bend non-technical employee who needs to quickly and securely get immediate notifications when new content is waiting for approval and be able to view, modify, delete, or approve content for immediate publishing to the website. 3. Persona: Customer User: Guest Description: An anonymous Internet user who initially spends a short time on the site but who needs to quickly gain an understanding of the company vision and what makes River Bend unique to its customers. 4. Persona: Customer User: Coffee: Big Bean Level Description: A self registered River Bend Internet customer who is a frequent visitor and buyer of River Bend coffees and teas. This user expects to be made aware of new and ongoing promotions, expects to get recommendations of other products, services, and recipes, expects to quickly search for whatever the user needs to find on the site, and expects to navigate to a destination in the site within two to three clicks. This user has a level of Big Bean, which implies that this user gets an automatic 15% discount based on buying patterns. 5. Persona: Customer User: Tea: Tea Leaf Level Description: A self registered River Bend Internet customer who is a frequent visitor and buyer of River Bend coffees and teas. This user wants to be made aware of new and ongoing promotions, expects to get recommendations of other products, services and recipes, expects to quickly search for whatever they need to find on the site, and expects to navigate to a specific destination in the site within two to three clicks. This users has a level of Tea Leaf, which implies that this user gets an automatic 5% discount based on buying pattern.
The goal of this analysis is to determine the structure of the site and, consequently, the
49 of 439
navigation of the site. During this process, the following core facets of the information architecture are developed: Site framework Category hierarchy Authoring template type hierarchy
Site framework
There are two ways to organize the content on a website, hierarchical and cross linking. Hierarchical organization Hierarchical organization of content is represented in the following figure. Each piece of content has a physical location at a level in the site. Because content is usually accessed from a single entry point (for example, the home page), hierarchical organization of content is particularly well suited to websites. Hierarchically structured content works best if you have well organized content that can be easily sorted into different levels on your site. Most visitors to a website understand the concept of hierarchies, such as chapters in a book. Therefore, this is a common navigational aid. It provides at a glance an idea of the site's structure. This type of content organization may be better suited to a less technical audience. The following figure illustrates the hierarchical organization of content.
Cross-linking Cross-linking content is illustrated in the following figure. With cross linking, any page can be linked to any other page on the site, regardless of its location within a hierarchy. This type of content organization works well in web sites that enclose many hierarchal levels and allows content that is located on a deeper level within the website to be presented at a higher level. Cross-linked content is well suited to a more experienced user and is intuitive to use only if the linking follows a content context that the audience easily understands. Frequently,
50 of 439
only the Back button of the browser allows the user to revisit pages. The following figure illustrates cross-linking of content.
In traditional, flat HTML websites, the site framework is an artificial concept based on links between pages. In IBM Web Content Manager, the site framework is defined first, and the links between the pages are generated dynamically. The different sections of a website are defined in site areas, and content is grouped under different site areas. Navigators are based on the site framework. By clicking a navigator, a user can access all content in a specific area. Menus display lists of content that can be located in any area of the site. Menus usually show content grouped by category, although menus can use a variety of search criteria, including site framework and content type.
51 of 439
Two main standards groups are doing work in the area of categorization: The Dublin Core Metadata Initiative includes specifications of the terms to be used when creating metadata. You can find information at: http://dublincore.org. The World Wide web Consortium's Resource Description Framework (RDF) provides recommendations about the way to represent resources on the web. You can find information at: http://www.w3.org.
The initiatives of these two organizations provide companies with the ability to standardize the metadata tags that they used on their site. These initiatives provide standards for terminology to be used in category taxonomy. However, they provide little assistance in the creation of the taxonomy itself.
We recommend that, in most cases, you use only child-level categories to profile content to allow more control over what displays in menus. Taxonomies cannot be used in Web Content Manager menu searches. If you want a menu to return results based on content that is profiled with any category in taxonomy, create a single, top-level category and base the menu on the top-level category. For our fictitious website for the River Bend Coffee and Tea Company, we organized the content by the five sections Products, Company, Locations, News and Contact, as shown in the following figure. Our reference implementation site structure reflects this organization.
52 of 439
The secondary site areas allow the user to specify an item to search on in this area. The secondary area for Products includes coffee or tea . The separation is obvious, and users can comprehend intuitively and exactly what they can expect to find here.
53 of 439
descriptive information that is structured in such a way that allows web pages to be properly searched and processed. Metadata is often keywords about the content of digital material in the form of labels that are only visible in the HTML code that builds the web page. The metadata will often come from the keywords or categories that a user associates with the content. In our example, we plan to generate metadata for WCM pages by specifying standard metadata fields. The search supports the metadata fields that are described in the following table. Name Description Author Keywords Subject The title of the content item A description of the content item the authors of the content item Keywords that are associated with the content item Taxonomy and category information associated with the content item
The metadata is created automatically for each web page. Refer to the search methods detailed in the "Search" section of this wiki.
54 of 439
The River Bend website is built using five components: 1. The company logo is used as the head banner. 2. At River Bend, search can be executed from two areas. The first is a basic text search of user-specific content from the banner area. The second, more detailed search performs an advanced search of content text as well as metadata tags. 3. The personalized greeting is displayed to the customer and, in this example, also indicates their status level. 4. Based on the page design, this is where the dynamically changing campaign and recommendations are displayed. In our example, in the interest of conserving real estate on the page, the team decided to write some Java script that refreshes the area every three seconds with a combination of campaign and recommendation centric content. 5. The content area displays the current, selected content. The chosen navigation shows all top levels of the River Bend site which makes it easy for users to navigate the site. The navigator expands downward and can be used to support further site areas.
Creating a workflow
Workflows can be used within IBM Web Content Manager to review, approve and authorize content published to the website. Normally at least two stages, Draft and Published are needed for a workflow. A recommended workflow contains the stages Draft, Approval, Published, and Archived. As the content passes through each stage the change is logged in the content history which makes traceability easier. IBM Web Content Manager offers various options to configure more dedicated workflows to serve further needs including custom workflow actions which allow integration with external workflow or process systems. Often the dynamics of a site require other workflow options such as a quick publish, no approval workflow. This workflow, available only to certain authorized users, allows content to be quickly pushed through to the publish stage without having to go through a multi-step approval process. This can be useful for quickly making changes to existing content or publishing time critical new content. Important: The process of content creation is often underestimated. The technology is simple, but the planning is where the real work begins. There is a significant risk in underestimating the value of the workflow process. Workflow ensures content quality and that published content meets the organizations policies and requirements.
55 of 439
Using syndication
Syndication is the method used by an IBM Web Content Manager location to exchange (replicate) data from one IBM Web Content Manager library to another. Syndication is not involved in the process of approving content. Syndication is only responsible for replication of IBM Web Content Manager assets across multiple locations. When creating a syndication process, IBM Web Content Manager allows you two choices for the granularity of items to be syndicated: All Items When configured with this setting, all elements of the IBM Web Content Manager location are replicated to the other location, including draft and expired content. Typically, authoring and development locations need access to all types of content for testing purposes. This setting is common when syndicating between distributed authoring locations or between an authoring location and a development location. All Live Items As opposed to the All Items setting, this option replicates only live content. Live content is defined as content that has been approved via workflow (live) but that is not yet past its expiration date. Typically, a production location only receives live data, so this setting is common when syndicating from authoring to staging or staging to production.
Tip: Syndication always syndicates copies of your technical assets (for example, presentation templates, authoring templates, library components, and so forth). By default, there is no setting to stop this syndication. You can configure IBM Web Content Manager to workflow these items.
Introduction
A critical component of information architecture is its design, which addresses content access through the site interface. Page layout, links, menus, navigators, taxonomy, site breadcrumbs, search, identity standards and graphics are all components of web information design. Users have different preferred means for accessing information so an effective information design provides users with multiple ways of accessing information. The most common means of accessing information are: Site navigators Direct feature links Embedded hyperlinks Site menus Search
All are valid and we recommend that you leverage all the site components from IBM Web Content Manager (WCM) when designing and building a site to enhance user
56 of 439
experience. To provide a relevant context for these components and to illustrate specific examples, we use the River Bend sample site referred to throughout this wiki.. We use these throughout this book, because we believe that they represent good information architecture and good site design.
57 of 439
Note: Navigators are not menus. Menus are a list of hyperlinks that take you to specific pages, but navigators are organized differently. Navigators present the logical arrangement of a web site, while menus are a list of related web pages that might appear
anywhere in your site and use search criteria to present the links.
Using menus
A menu is ultimately a search mechanism that groups together lists and related documents based on specific criteria, such as categories, site areas, or keywords for display and access to users. The image below displays links as images, icons with text, links with a summary, or many other combinations. These menus combine elements based on content from more than one site area, not possible with navigators. To users, menus and navigators provide the same functionality allowing a user to navigate around the site or to locate particular content.
58 of 439
The figure below shows the embedded hyperlinks marked by red square boxes.
Another usage of embedded hyperlinks is in WebSphere Portal where they can be used to reference corresponding content or applications, depending or related information. This WebSphere Portal feature is called Click-to-action. The click-to-action capability lets you send information from one portlet to another automatically. This capability leverages the way that web content and web applications interact and leads to more powerful dynamic workplaces. For example, if a user clicks on a specific topic in a Topic List portlet, click-to-action allows an adjacent portlet to limit the postings shown to just those in the specified topic, based on the criteria selected in the Topics portlet.
Using search
Searching a website is one of the most used features and is particularly useful to users who do not have time to learn the site structure. Visitors expect the search to return exactly what they are looking for, particularly when they know that the information is there. Because of this high expectation, search results need to be high quality. To return effective search results it is critical that content categories and keywords are defined and applied to each page prior to publication. See for information related to the search setup and configuration. So, how should a search work from an information design perspective? There are two options possible. First, the search function should be ntuitive to use. The user can enter words in an input field, and the results deliver all content that include the searched parameters, sorted by relevance. Relevance normally means it starts with the content that includes all words searched for and continues with single words found. The second option is advanced search. Advanced search options may included Boolean combinations using AND, OR and NOT as well searching by Date, Author, Keywords or other metadata. Search results can also have a different approach. Search results will usually offer a URL to the web page that includes the cited content. Search results may also include a short abstract of the content as part of the result. This abstract offers a specified number of words from the content or additional metadata fields. Details of the results can be saved for download or can be printed.
59 of 439
For a multilingual site, consideration should be given to the default language of the search as well as parameters controlling which language content is to be returned.
60 of 439
61 of 439
Demonstration Part of the communication plan should include a demonstration that illustrates the site navigation. In that demonstration, very simple action settings should be enabled for demonstrating the multiple ways of providing information. Not all information access methods need to be demonstrated. Open and agreed areas should be identified and marked. In meetings with business users, demonstrations such as this require little preparation time but are effective in communicating accessibility and usability concepts.
Workshop preparation
Information architecture workshops require preparation in order to be effective. Prior to conducting any workshops, we recommend that organizations develop a test site with IBM Web Content Manager to gain hands-on experience with the product and to develop an understanding of the capabilities of the tool. This training helps the team to connect user requirements or wishes with the capability of the tool to support them. With that understanding, stakeholder requests that are technically complex or time consuming can be identified immediately, so that expectations can be set correctly. Alternatives can be discussed on the spot. After a workshop is scheduled with the stakeholders of a process area, the organizations team should thoroughly review that area of the site. Site areas and a sampling of specific pieces of content should be identified and documented. Separate documented notes by content type or site area but make no additional marking on them prior to the workshop. To reach a high acceptance, we recommend a professional preparation. Because the workshop topics can get quite challenging, you do not want to spend any time discussing topics that are related to future topics. We recommend setting up the conference room for the workshop prior to its start (for example, draw a couple of page layout grids on a whiteboard and include some of the page elements that are persistent throughout the site. In addition to the information provided here, see the following article for specific recommendations and an approach to assist a consultant in defining a WCM workshop agenda:
Guide to running a WCM Requirements Workshop
62 of 439
Have the business stakeholders validate the site areas and content identified in the preparation. Group like content types together, and arrange the groupings on the whiteboard within the grid. Use a system of dots to identify site levels (one dot for the top, two for the next, and so forth). Capture the raw output of the workshop on digital camera.
Work products
The workshop outputs should include: A map of the process site area hierarchy, usually developed in Visio. Page layouts, usually drilling down two to three levels.
Information architecture determines the structure of the site, how navigation is derived, and the ease of navigating the site. The following Content Management System constructs are developed when designing a system: Site framework Category hierarchy Content type hierarchy
Defining the information architecture lays much of the groundwork for how content is organized on a site. Regardless of where the content resides, you need a good understanding of the content. For detailed information on how to determine a proper underlying information
63 of 439
architecture, and to begin modelling the initial structure and design of your site, refer to the following sections in this wiki:
2.3.1 Defining information architecture 2.3.3 Designing information architecture 2.3.5 Site acceptance and information architecture workshop
These are all valid ways of accessing information. We recommend that you leverage a variety of site components from WCM when designing and building a site to enhance user experience. To provide a relevant context for these components and to illustrate specific examples, we draw upon examples from River Bend sample site referred to throughout this wiki, and other relevant sites. We use these throughout this book because we believe that they represent good information architecture and good site design. Tips to make the website usable: Make a clear and intuitive navigation model for the site. Make it obvious so that users know - Where they are now - Where they have been - Where they can go Keep the navigation model consistent throughout all pages and components of the site Use direct embedded text hyperlinks effectively and include sub-text (mouse over text) to make it obvious where the link will take the user.
64 of 439
Defining accessibilty
As a starting point, what exactly do we mean by the term "accessibility"? The definition from the Web Accessibility Initiative (WAI) is as follows: "Web accessibility means that people with disabilities can use the Web. More specifically, Web accessibility means that people with disabilities can perceive, understand, navigate, and interact with the Web, and that they can contribute to the Web. Web accessibility also benefits others, including older people with changing abilities due to aging."
Standards
Making websites accessible and meeting accessibility requirements often requires adhering to standards such as the WAI (Web Accessibility Initiative) and it's guideline document, and Section 508 . In addition specific local country regulations need to be understood and applied appropriately. WAI The Web Accessibility Initiative (WAI) of the World Wide Web Consortium (W3C) is focused on addressing the requirements for web accessibility. WAI provides a repository of the latest web accessibility guidelines and tools. The WCAG guidelines are primarily intended for 4 main focus groups: Content developers (content contributors, presentation designers and developers.) Web authoring tool developers Web accessibility evaluation tool developers Others who want or need a technical standard for Web accessibility
65 of 439
The WCAG documentation provides guidelines as to how to make web content accessible to people with disabilities, that's the text, images, forms, sounds, etc.. that are part of any web page or web application. WCAG is part of a series of accessibility guidelines, including the Authoring Tool Accessibility Guidelines (ATAG) and the User Agent Accessibility Guidelines (UAAG). Note: WCAG 1.0, was completed in 1999, is it's scope is HTML & CSS. In December 2008 the WCAG 2.0 guidelines were published as a W3C recommendation. Unlike WCAG 1.0, which was limited to HTML & CSS, WCAG 2.0 will be principle based in order to be applicable to all Web technologies. Here is a mapping of the two guidelines. Section 508 Section 508 of the US Rehabilitation Act Amendments of 1998 requires all US federal agencies to make their information technology accessible to their employees and customers with disabilities. Important to web content management is that Section 508 also applies to Web sites that are produced for government agencies.
Testing tools
Both the WAI and Section 508 websites make reference to several tools to assist the content contributor or web designer with their efforts to ensure that standards and guidelines are implemented successfully. In addition to tools provides by the standards bodies noted previously, IBM has also developed its own tools to assist with the testing of accessible websites and social information. aDesigner aDesigner is a disability simulator that helps web designers ensure that their content and applications are accessible and usable by the visually impaired. For more information on aDesigner, see the link to aDesigner . Voice browsers and screen readers read aloud the text on web pages and are used by visually impaired people. However, these devices are less effective with certain kinds of content, such as highly graphical material. Web developers can use aDesigner to test the accessibility and usability of Web pages for low-vision and blind people.
66 of 439
aDesigner also helps users to check accessibility of ODF documents and Flash content. It also has accessibility information (MSAA/IA2) inspection functions. Rational Policy Tester - Accessibility Edition The Accessibility Edition helps ensure website user accessibility by monitoring for over 170 accessibility checks. It helps determine the site's level of compliance with government standards and displays results in user-friendly dashboards and report.
67 of 439
Typically, these servers perform one of the following roles within the WCM infrastructure: Authoring Staging or preview server Production (live) or delivery
Authoring environment
The authoring environment is where you develop and unit test the WCM technical assets such as presentation templates, HTML components, menus, and navigators. In addition, this server can be the first place you install patches and fix packs to ensure that they do not negatively impact your servers. Typically, you syndicate changes to the staging environment to roll out changes. These changes are, in turn, syndicated or replicated to the production or live environments after appropriate testing. Note: WCM currently does not support selective replication. That is, you cannot have WCM to syndicate only design changes from the authoring server to other servers in your environment. Be careful when syndicating content to or from an authoring server. One approach is to set the syndicator to syndicate only live content and delete all content (via the API) prior to syndication. Another similar approach is to configure syndication the same way but have no live content in the authoring server. Regardless of your preferred approach, be careful when syndicating from the authoring server to other servers. Content authors and approvers create, edit, preview, approve, and expire content in the Authoring environment which can be distributed if required. For example, if you have offices across the globe, it might make sense to have authors work on a server closer to their physical location as opposed to a centralized authoring system. If you choose to have a distributed authoring environment it is important to ensure that people on separate servers do not attempt to work on the same content simultaneously. In situations where distributed authoring environments make sense, secure your IBM Web Content Manager environment so that people on each authoring server can only modify a unique set of data.
Staging environment
The staging environment is sometime perceived as merely "nice to have", but a staging environment is highly recommended as a safety net. A staging environment provides a chance to review changes in the context of your whole site before they are syndicated into the live environment. This can include previewing the web content and integrating it with other applications. A staging environment is particularly useful if you are pushing out a large number changes simultaneously. A staging environment can also tie into your test environment, depending on the relevant testing that is part of your content management and WebSphere Portal Development life cycles. From a best practices perspective, the staging environment should use all functional elements found in the production (live) environment. For example, if your production environment contains a cluster for IBM Web Content Manager servers, your staging environment should too.
68 of 439
Designing your staging environment in this manner provides two potential benefits: Testing If you need to test a new configuration, install a patch/fix, and so forth, you need a place to test such changes prior to implementation on the production servers. If the Staging environment mirrors your Production environment you can confirm such changes in Staging. Performance testing In an ideal environment, Staging would be an exact duplicate of the Production environment. If this were the case you could easily do performance testing in the Staging environment. If the Staging environment contains all elements of Production but on a smaller scale you can still use this environment to run performance testing, but you will have to extrapolate the results, which could lead to incorrect performance expectations.
Testing environment
If you need to test a new configuration, install a patch or fix or make other changes you need a place to test such changes prior to implementation on the production servers. If the staging environment mirrors your production environment you can confirm such changes in staging. Otherwise or if resources are available, considering to have a designated testing environment.
69 of 439
Workflow
Workflow controls the creation, approval, and run-time (live) access to an item. A workflow consists one or more stages. Tip: Normally content will not be seen by visitors on the published site (live) until the content is approved.
Syndication
Syndication is the method used by WCM Server to replicate data from one WCM Server to another. Unlike workflow, syndication is not involved in the process of approving content. Syndication is only responsible for replication of WCM assets across multiple servers. Its intended use is as an ongoing process to keep a receiving server or subscriber up to date with the latest content and design changes from the transmitting machine, which is also known as the syndicator. In versions of WCM prior to V6, a Syndicator spans the entire data store. From version 6 onwards, it is possible to partition a data store into multiple (virtual) libraries. You can configure a Syndicator to syndicate single or multiple libraries. When creating a Syndicator, you have choices for the granularity of items to be syndicated: All items: When configured with this setting, all elements of the WCM Server are replicated to the other server, including draft and expired content. Typically authoring and development servers need access to all types of content for testing purposes. This setting is common when syndicating between distributed authoring servers or between an authoring server and a development server. All live Items: As opposed to the "All items" setting, this option only replicates live content. Live content is defined as content that has been approved via workflow (live), but is not yet past its expiration date. Typically a production server only receives live data, so this setting is common when syndicating from authoring to staging or staging to production.
Tip: Syndication will always syndicate technical assets; presentation and authoring templates, components etc. By separating out design assets into their own library you can syndicate them independently of content. Refer to 5.2 Syndication for additional information.
70 of 439
The primary differences in these designs are due to variations in the basic assumptions: Site size and complexity For a relatively small web site, it might not be necessary to have individual servers dedicated to all four types of IBM Web Content Manager environments. Funding In many cases, there is a limitation in regard to the funding provided to build the IBM Web Content Manager infrastructure. In these cases, you must construct your environment as soundly as possible within the budget. However, the budget is likely to force you to reduce the infrastructure. Corporate standards Your company standard might not allow for the creation of certain types of servers. For example, it is quite common for smaller companies to omit the staging environment because it requires time and resources to perform the content review in this stage.
Important: As you look at these various architectures, remember that these are only representative architectures based on practical experience in deploying IBM Web Content Manager. Many other architectural combinations can be built based on your organizations needs. Use these architectures as a baseline from which to build your environment.
In the basic architecture, a single WCM Server is responsible for all IBM Web Content Manager activities. Site visitors access this single server for content when they visit the web site. An HTTP server is placed in the DMZ to receive all requests for site content. This HTTP server acts primarily as a proxy to shield the IBM Web Content Manager server from direct access. If you use IBM HTTP Server (or Apache), the WebSphere Portal and IBM Web Content Manager server can generate an HTTP plug-in to ease configuration of the HTTP server. While this architecture is technically feasible, there are a variety of issues that make it sub-optimal.
71 of 439
Design advantages
Design advantages include simplicity. This design is simple to implement due to the limited number of components that are involved.
Design disadvantages
This architecture has the following design disadvantages: Failover or redundancy: This environment has no failover or redundancy in any layer. If any one part of the system fails, then the entire site appears to be down. Load balancing: This environment has no load balancing capabilities. There is only one IBM Web Content Manager server, and it must handle the entire workload at all times. Maintenance: To perform site maintenance, the site must be unavailable.
In the intermediate architecture, multiple WCM servers share the responsibility for IBM Web Content Manager activities. Site visitors can access any of these servers for content when they visit the web site. Multiple HTTP servers are placed in the DMZ to receive requests for site content. These HTTP Servers perform two primary functions: Proxy: The HTTP servers act as a proxy to shield the IBM Web Content Manager servers from direct access. If you use IBM HTTP Server (or Apache), the WebSphere Portal and IBM Web Content Manager server can generate an HTTP plug-in to ease configuration of the HTTP Server. Load balancing: The HTTP plug-in can be configured to provide load balancing based on a variety of algorithms. If your IBM Web Content Manager servers are not
72 of 439
similar in processing capabilities, you can set up the plug-in to load balance traffic according to server capacity.
While this architecture improves upon the basic architecture, there are still several issues that make it sub-optimal for larger environments.
Design advantages
The intermediate architecture has the following design advantages: Simplicity: This design is simple to implement due to the limited number of components that are involved. Load balancing and redundancy: If you are using IBM HTTP Server (or Apache), this environment has basic load balancing capabilities. Because there are duplicates of all components, a basic level of redundancy exists in this design. Maintenance: With multiple servers available to deliver content, site maintenance can be performed without the entire site becoming unavailable.
Design disadvantages
The intermediate architecture has the following design disadvantages: Administration: As more IBM Web Content Manager servers are added to the infrastructure, the maintenance effort to make changes increases in a linear fashion. Changes must be manually made to each server because the servers are not clustered in this design. Failover: While we have redundancy with this design, there is no automated failover in the event that a specific component fails. If any one part of the system fails, there is a likelihood that the site is down to subset of site users.
The intermediate architecture still contains one major deficiency. That is, there is no failover within the environment. To resolve this issue, we look at building a slightly more complex infrastructure that includes clustering some of the servers.
2.6.3. Advanced architecture: WebSphere Portal and IBM Web Content Manager integrated
In the WebSphere Portal and IBM Web Content Manager integrated architecture, we continue to enable IBM Web Content Manager on all of the WebSphere Portal servers. Unlike the intermediate architecture, in this environment, we cluster the portal servers as illustrated in the following figure.
73 of 439
When you cluster WebSphere Portal servers, they share an identical configuration. This configuration is managed from a WebSphere Deployment Manager server (not pictured). The Deployment Manager is responsible for synchronizing the WebSphere Portal configuration across all servers in the cluster. Thus, when you deploy a IBM Web Content Manager portlet or create a new portal page, the Deployment Manager synchronizes all servers in the cluster, which is a reduction in administrative time and effort. In addition, when you cluster the WebSphere Portal servers, the Deployment Manager can create a plug-in for IBM HTTP Server and Apache that allows the HTTP servers to gracefully failover in the event that one of the portal servers stops functioning. While setup and maintenance of a cluster take time and effort, this effort is typically small compared to the ongoing benefits provided to the infrastructure.
Design advantages
The WebSphere Portal and IBM Web Content Manager integrated architecture has the following design advantages: Load balancing and redundancy: If you are using IBM HTTP Server or Apache, this environment has basic load balancing capabilities. Because there are duplicates of all components, a basic level of redundancy exists in this design. Failover: With the addition of a cluster, the HTTP Server can provide failover for the WebSphere Portal servers. If any one part of the system fails, the entire site does not appear to be down. Maintenance: With multiple servers available to deliver content, site maintenance can be performed without the entire site becoming unavailable. Web Content Viewer JSR 286 portlet: If IBM Web Content Manager is running on all portal servers, you can use the Web Content Viewer JSR 286 portlet. By not having to communicate with an external IBM Web Content Manager server (as required with the WSRP for remote rendering), you eliminate a potential performance bottleneck. Administration: As more IBM Lotus Web Content Manager servers are added to the infrastructure, the maintenance effort to maintain the infrastructure does not increase significantly. Changes to server configurations are performed from the central Deployment Manager console.
74 of 439
Design disadvantages
The WebSphere Portal and IBM Web Content Manager integrated architecture has the following design disadvantages: Complexity: This design is fairly complex. The learning curve for installing and administering a clustered environment servers should not be underestimated. Cost: Enabling IBM Web Content Manager on every WebSphere Portal server quickly increases your infrastructure cost.
2.6.4. Advanced architecture: WebSphere Portal and IBM Web Content Manager separated
In the WebSphere Portal and IBM Web Content Manager separated architecture, we no longer enable IBM Web Content Manager on all of the WebSphere Portal servers. Instead, we create a separate tier of servers with the sole task of serving IBM Web Content Manager content as illustrated in the following figure.
As with the other advanced architecture, this configuration clusters the portal servers. However, in this configuration, we create a separate cluster for the IBM Web Content Manager servers. When you cluster the WebSphere Portal or IBM Web Content Manager servers, they share identical configurations within their respective cluster. This configuration is managed from a WebSphere Deployment Manager server (not pictured). The Deployment Manager is responsible for synchronizing the configuration across all servers in each cluster. This means that, when you deploy an updated IBM Web Content Manager portlet or create a new portal page, the Deployment Manager synchronizes all servers in the appropriate cluster, resulting in a reduction in administrative time and effort. In addition, when you cluster the WebSphere Portal or IBM Web Content Manager
75 of 439
servers, the Deployment Manager can create a plug-in for IBM HTTP Server or Apache that allows the HTTP Servers to gracefully failover in the event that one of the portal servers stops functioning. This is how both sets of HTTP Servers can provide failover for WebSphere Portal and IBM Web Content Manager requests. Note: It is technically possible to have a single set of HTTP Servers act as the front end for all IBM Web Content Manager and WebSphere Portal servers. This requires a manual modification to the plug-in that combines elements from the plug-ins created by each cluster. Because there are duplicates of all components, a basic level of redundancy exists in this design.
Design advantages
The WebSphere Portal and IBM Web Content Manager separated architecture has the following design advantages: Failover: The addition of a cluster allows the HTTP Server to provide failover for each cluster. If any one part of the system fails, the entire site does not appear to be down. Maintenance: With multiple servers available to deliver content, site maintenance can be performed without the entire site becoming unavailable. Administration: As more WebSphere Portal or IBM Web Content Manager servers are added to the infrastructure the maintenance effort to maintain the infrastructure does not increase significantly. Changes to server configurations are performed from the central Deployment Manager console.
Design disadvantages
The WebSphere Portal and IBM Web Content Manager separated architecture has the following design disadvantages: Complexity: This design is fairly complex. The learning curve for installing and administering a clustered environment servers should not be underestimated. Remote Rendering Portlet: If IBM Web Content Manager is running on a separate set of servers for all portal servers, you must use the Remote Rendering Portlet. Because this portlet communicates with an external IBM Web Content Manager server, there is a potential performance bottleneck if the network connection is poor.
Note: There is a cost-benefit analysis with regard to clustering stand-alone IBM Web Content Manager servers. The Deployment Manager automatically creates the plugin for the HTTP Server. This plug-in makes for easy setup of failover within the IBM Web Content Manager tier. If the clustering issues lead you toward not clustering the IBM Web Content Manager servers, other techniques can provide failover for the IBM Web Content Manager server tier. For example, several vendors make hardware that can perform this task. Of course, the hardware has additional costs and configuration issues. No single answer is work for all scenarios.
76 of 439
2.7. Use case sample site infrastructure: River Bend Tea and Coffee Company
This section combines all the concepts that are described in 2.5 Environment type and 2.6 Sample physical architecture of a website and build an example infrastructure for the River Bend Coffee and Tea Company (River Bend). Note: Because River Bend is a fictitious company, all of the assumptions and requirements are created solely for the purpose of this discussion. In a real world situation, there are far more issues to take into consideration when designing a web site infrastructure. We keep the example infrastructure moderately simple in an effort to ensure that we explain clearly the key issues around IBM Web Content Manager (WCM). Certainly far more complex infrastructures are in place today for working with IBM Web Content Manager. You can extrapolate the concepts that we describe in this section into larger designs as needed. DISCLAIMER: This wiki outlines an example of building a basic website using the sample site, River Bend. This sample is not intended as a best practice for development, configuration, architecture, or any other aspect, such as scalability or performance. No warranty or support is implied for the example site or sample code used.
77 of 439
The following figure illustrates the sample physical infrastructure for River Bend.
Staging environment
The syndicated content from Authoring environment is tested for its functionality, integrity and also systems integrations testing is performed at this stage.
Production environment
River Bend wants to provide for a reasonable amount of failover and redundancy within
78 of 439
their infrastructure. Furthermore, River Bend wants to implement typical security best practices to secure their infrastructure.
Internet
The Internet is where site visitors initiate requests for the River Bend site. Our DMZ must be properly configured to allow access to the HTTP servers from the Internet and any other valid source location such as the company intranet.
2.7.2. Syndication
Syndication is used to move our IBM Web Content Manager content between the various environments in the infrastructure. The syndication flow for our infrastructure is fairly straightforward.
Authoring to staging
Because we have a single authoring server, we must set up syndication from this server to each staging server. The staging server is not a place for content modification. We only syndicate live content to the staging servers.
79 of 439
As content is approved and new technical assets are created, the staging environment collects syndicated changes from the authoring environment. During normal operation, the syndication from authoring to staging is enabled.
Staging to production
When content is reviewed in the staging area, we need to syndicate this content from the staging server to our production servers. To facilitate this, we configure one of the staging servers to syndicate its content out to all production servers. Because the staging environment collects syndicated changes from authoring server in real time, we do not want to set up a similar syndication pattern from staging to production. If we do, approved content on the authoring server would syndicate to staging and then to production automatically, which defeats the purpose of having the staging environment. To stop this from happening is to set up the syndication from staging to production but then disable the syndicator. When the web master is ready to confirm a set of changes, they perform the following process: 1. Disable syndication from authoring to staging. When the web master starts to review the content and design changes, you do not want additional data showing up in the middle of the testing process. 2. Review content in staging as needed. 3. Enable syndication from staging to production. By doing this, the reviewed and approved changes can syndicate to the production servers where they can be accessed by the site visitors. 4. Disable syndication from staging to production. When the content is pushed out to the production servers, you want to disable this syndication to ensure that no additional content syndicates to production accidentally. 5. Enable syndication from authoring to staging. When the production servers are updated, we want to start aggregating the next set of changes on the staging server. Important: Syndication is an important process. You should plan out your syndication strategy carefully prior to implementation.
80 of 439
For the purpose of providing a realistic business context to this part, we use the River Bend Tea and Coffee Company as the basis for the development scenario. River Bend Coffee and Tea Company (River Bend) is a fictitious company that uses IBM Web Content Manager (WCM) software. DISCLAIMER: This wiki outlines an example of building a basic website using a sample site, River Bend. This sample is not intended as a best practice for development, configuration, architecture, or any other aspect, such as scalability or performance. No warranty or support is implied for the example site or sample code used.
81 of 439
The figure shown below illustrates the home page that a user sees when first entering the site. It also show seasonal products and currently featured (promoted) products.
82 of 439
The figure shown below illustrates the Coffee product area of the site.
83 of 439
The figure shown below illustrates the Community page of the site.
84 of 439
The figure shown below shows the About Us page within the site.
3.1. Overview of key concepts and terminology for IBM Web Content Manager components
This section addresses the core concepts of IBM Web Content Manager (WCM). We review the separation of presentation and content and emphasize the importance of using components within page and site design. We also describe the key items and components and outline important considerations for reuse and extensibility. This section uses the River Bend Coffee and Tea Company website an the example web site, which we refer to as the River Bend website. All concepts and technology used in the website will be explained.
85 of 439
The following figure shows the River Bend Coffee and Tea Company website.
This approach of separating the creation and presentation of content also guarantees that a website has a consistent look and feel. If the design changes, the content parts are unaffected. Additionally, the separation supports specialization of roles and skills. Content owners can focus on content creation and site developers can manage the look and feel through HTML and other web skills. For our use case example, the River Bend website shows a Product list of tea types
86 of 439
offered. In this list the content documents are displayed as a list showing the item title as a link (see the following figure).
The link opens the document so the user can read the product details. When the product item is open, the title, summary, and body are displayed (see the following figure). This shows how the same product item can be displayed using different presentation layouts. The Product Menu shows only the title and a short description of the item. The detail layout shows the title, rating, summary and body fields as well as the tags. This illustrates how the separation of content from presentation allows the easy re-purposing and reuse of content.
87 of 439
88 of 439
Componentization of objects and items occurs across the system. Responsibility for different aspects of authoring, site design and ongoing maintenance can all be devolved to specific users and roles.
89 of 439
Attention: While components can be reused many times, do not nest them too deeply or else it would become cumbersome to maintain. In addition, remember that nesting components can impact page rendering and site performance. Tips: Preferrably, all objects should be modular so that they do not rely on any other object to close a table tag or to put script tags around it. You should be able to change a component slightly without having to change any other elements that rely on that component. All functionality should remain within the component that needs it (either coded directly in the component or in the form of another complete component).
90 of 439
WCM items
From a conceptual perspective, a separation between content-centric and architectural items are made. The content-centric items are used for content creation and management. The architectural items define the hierarchical structure of the website and its design.
Content-centric items
Content centric items are created, managed and used by subject matter (SME) authors and content owners. Content-centric items include the following items: Authoring template The authoring template is used by a content creator to create content by entering text, predefined resources (such as images and files), and components into fields. Categories and taxonomies Categories are predefined terms used to manage relationships between items. Categories are grouped into hierarchical taxonomies. Keywords are somewhat similar to categories. However, keywords, which are used in an authoring template field, provide a free form text entry and are not predefined or centrally managed. Workflow Because every content item has to pass through a workflow in order to be published, workflows are essential elements. Workflows control the access to, verification and approval of items. By default, workflow is enabled for content items but can be configured for most items and components by inserting the appropriate values in the aptrixjpe.properties file. Workflows consist of multiple workflow stages and actions. Content Content items are any kind of information intended to be published to a website and are created using authoring templates.
91 of 439
components, Image and file resources. These design components are stored in the components section in the authoring portlet. Presentation template Presentation templates aggregate all the parts required to render a web page. This includes the CSS which describes the presentation together with static and dynamic components, for example, reference to a static HTML component for the footer for all pagers and a dynamic reference to the body component of the content to be populated based on the current location
Design components are referenced within the presentation template to form the look of a web page such as the header or style sheets. Content item fields are referenced to display text on the web page.
3.1.4. Key WCM definitions - Authoring templates, category management and the site framework
This section covers an in-depth discussion on the IBM Web Content Manager (WCM) functions and items. All examples are based on the River Bend Tea and Coffee Company (River Bend) website. If you want to build the website, see 3.2 Steps to build the River Bend Tea and Coffee Company website.
Authoring template
Authoring templates are used for content creation. They provide the editing and authoring forms for content authors. Similar to document types in document management solutions, fields for text and metadata are defined in the authoring template. In addition to the common fields described in Web Content Manager fields , the following sections are provided: Profile Content form properties Content
These sections contain fields for immediate content input or references to other components.
Profile
The Profile section contains settings for Categories and Keywords. Both are ways of profiling content. A Category refers to the subject matter of your content item. For example, your content item may be of the category New Products or Latest News. Taxonomies are used to group categories. Users select from a predefined list of categories when profiling a Content item. Categories provide quick selection with no misspellings or near-duplicates but users can only select from pre-defined categories. Keywords can also be used to profile content. Unlike categories, which are chosen from a predefined list, you can enter any keywords you like when creating content items. This has flexibility but can lead to misspelt keywords and multiple, similar keywords. Categories and Keywords are used as content metadata for search and Menu definitions.
92 of 439
See Menu component for more details about how to use Categories and Keywords in menus. The following figure shows the categories and keywords fields in the Profile section of the authoring template.
Used to specify the characteristics of the item generated from the authoring template, including the type of item to be created, where it can be saved and version control strategies.
93 of 439
Content
The Default Content section shows the different elements on the authoring template. All fields are added to the authoring template using the element manager, as shown in the following figure.
The fields are defined by a field name and the field type. The field type is selected from a list that is either a component field, such as a Text, a Rich Text field, or a reference of a component that defined in the component library allowing the reuse of existing components. Refer to the following figure for a complete list of available fields in element manager.
94 of 439
Category management
The category management section of the item navigator defines taxonomies and categories. These items are an important, and often underestimated, elements for content that is metadata. Note: Categories are metadata for content that is used in menus and search.
Taxonomy
A taxonomy defines the collection of terms that form the categories. For distinct termsets, you can create independent taxonomies, although it might not be necessary because the number and depth of categories is nearly unlimited. Authors select categories and assign them to a content item by clicking a tree of categories. A reasonable depth of the taxonomy tree helps the user in selecting categories. A maximum of five to six levels has proven to be a good depth with which to work. You can adjust taxonomies where necessary.
Category
A category is an informational component that is used to describe what a piece of content is about. Categories used in content transcend hierarchies of architectural elements as site or site areas. Changing the navigational hierarchy is difficult, while categories should reflect business needs and are adjusted as the organization's needs change. Do not confuse categories with a site area, which is created to provide a path to that piece of content. Menu design components can use a category, via search criteria, to create menus or to create lists of related documents. For example, if the coffee business faces a boost for Ginger flavored Coffee, River Bend can add the category ginger to the taxonomy. The overall hierarchy based on site and site areas stays unchanged. Immediately after adding the ginger category to content documents, searches for ginger on the River Bend website show results without any development work. In addition, the ginger category can be removed easily without any influence on the overall navigational hierarchy of the site at any time.
95 of 439
Another example is that the River Bend website uses categories in a personalization component to identify content based on the season. The home page displays an image of the seasonal drink, whether a summer or a winter drink. The drink content itself is categorized either Summer Drink or Winter Drink categories that are under the Season Drink Category. In our use case example "Coffee freddochino" was added in the Summer Drink category. Changing the content belonging to that category will change the image on the home page that is displaying the summer drink.
Content
So far, we have discussed all the elements that you need to create content: authoring template, taxonomy and category, and workflow. Creating content for users who rarely use the authoring interface might be confusing. A common practice to apply security to all items to make sure that the authoring portlet shows only items that users need to see. Optionally, the customizable template portlet is a good choice because it allows you to hide fields that users do not need. The customizable template portlet is very easy to use. Fields are preselected, such as the authoring template and site area.
Site framework
A site framework reflects part of the information architecture of a website. A lack of investment in the information architecture can result in a website that has a poorly designed site framework. Unfortunately, this situation is often identified after IBM Web Content Manager projects have already progressed into late stages. Avoid this situation by invest time and resources to define information architecture early. A site framework provides a hierarchical structure for the website and is the base for the final website's navigation. The content is linked to the site framework and is identified for
96 of 439
display on the website using the content's site framework information as search criteria for navigators and menus. The navigator and menu design components use the site framework to create a site map (also a navigator), navigation, breadcrumbs, and menus. Because these elements are created dynamically at run time, there are no broken links when a site area is changed or moved. The following figure shows the site framework of River Bend and the resulting site map navigator.
Site area
A site area is a unit within a site framework where content items are grouped together. You have to define the default content for a site area. The default content displays when the page is opened. Without default content assigned, the page cannot be viewed in the browser. Default content, of course, can contain component references that allow individual designs for different site areas and content pages. In the River Bend website, some content items reference a menu component. The menu displays content that is found using the menu's search criteria. (See Menu component for details about menus.) Before the content can be viewed on a website, each authoring template is paired with a presentation template. Doing so on the site level underlying site areas can inherit the pairing. Pairings on site area level can define new pairs for the specific site area and below. Site areas allow the use of the element manager to add component fields or component reference fields to the site area document. (Identical functionality is available in content
97 of 439
items.) Using this feature in site areas allows you to define design or content items to be displayed on selected site areas. Creating and maintaining site areas is performed by site administrators rather than by users or content creators. Site administrators are expected to be more literate and advanced in using components. Therefore, it might be easier for them to manipulate the design of site areas than placing the task into content creators' hands who might need extra guidance to understand the component library philosophy. Referencing a menu in a site area rather than in a content item has the advantage that the menu item is predefined in the site, and a content author does not have to know how to perform the task or which component to reference. Site areas in a site framework can be classified into parents, siblings, and children, where the site is the parent for preceding site areas but has no parent or sibling itself because it is the only root for a site framework. Site areas always have a parent and often siblings and children. A site area has the option of making it searchable. This option specifies if the site area should be searchable through portal search or not.
Presentation templates
In the presentation template, all the aspects we have discussed and all the components come together to form the web pages that are viewed by site visitors. The presentation template combines all layout and design elements needed for the web site appearance.
98 of 439
The general presentation template of River Bend includes a style sheet and several images to create the overall layout which is consistent for all pages. IBM Web Content Manager references components in the component library by name, as shown in the following example: [Component name="riverbend/html-logo"/] [Component name="riverbend/search_form"/] [Component name="riverbend/nav-left"/]
As shown the image component, the search form HTML component as well as the navigator are referenced the same way. Due to the separation of content from presentation, the content does not play a role in the layout of a page. The content is referenced in the presentation template. Content items fields are referenced from the content library where they are stored and are referenced by the fields that make up the content. The general presentation template references the Display Title, Body, Content Image, Menu Component Reference fields using the field names as identifiers or keys. All fields are referenced in a current context. The current content is the content item to which the user has navigate using the navigator on the left side of the page. The type content states that a content item is referenced, as shown in the following example: [Element [Element [Element [Element [Element context="current" context="current" context="current" context="current" context="current" type="content" type="content" type="content" type="content" type="content" key="Summary"/] key="Image"/] key="Body"/] key="Link"/] key="Menu"/]
99 of 439
Note: If a referenced component does not have a value to display, nothing is shown on the web site. For example, the Link field is empty and therefore it does not appear on the page. Same with the components. Note: When a new presentation template is created, remember to pair it with the appropriate authoring template in the site framework. While creating the presentation template, a user may want to add an image that is stored as an image components or in the content. There is an Insert Image button that can be used to add the image instantly in the HTML. A link can be added using the Insert Link button. You can create links to: Content items, files or images Existing link components External url links
Component library
The component library is the home of all components. Each of them can be referenced with the component library tag throughout the other items and also in the components themselves.
Navigator component
A navigator provides a mechanism that allows users to move through the site. A navigator uses the site framework to automatically create links to different parts of the site (site areas) or pages (content) in the site. Because it is based on the site framework, the navigator displays the hierarchy of the information architecture. Thus, when a site framework or a site area changes, the navigator is updated dynamically, eliminating the need for re-coding and preventing the possibility of broken URL links.
100 of 439
Important: Menus are updated automatically to reflect changes in the content library. Consistency is maintained by the system. Menus display links as images, icons with text, links with a summary, or other combinations. See the following figure showing menu construction from various selection criteria.
Menu options
The following options define a menu.
101 of 439
- Select current content which searches for content that is in the same site areas as the one being currently rendered. Enter a query string. The selection would be based on the parameters sent. Choose to merge selected authoring templates with included authoring templates. This option merges the content selected by the menu based on the settings made in this section with those content matching the selected authoring template. Choose to replace selected authoring templates with included authoring template. This option overrides the contents found by the menu based on the settings made in this section over the ones from the selected authoring template.
102 of 439
The following options define the presentation of content using the menu MENU-Site Area
The current document can be excluded in the displayed menu by selecting the exclude current document from. That is only valid if the case is applicable, which reminds you that a menu can be displayed in a content context and also can be based on a site or site area. The ascending order for results option is selected. Alternatively, deselecting the field creates a descending order based on the sort key of Results Primary, Results Secondary, and Results Tertiary sort key fields. Available sort keys are: name, description, published date, last modified date, title, expiry date, general date One, and general date two. Set the results per page to zero (0) to allow all items to display on one page regardless of how many are found. Increasing the number changes the number of documents that display. For example, changing the results per page to 3 displays documents 1 through 3 on page 1, and documents 4 through 6 on page 2. For a better overview, limit the number of displayed documents to no more than 10. Also, sort in reverse order so that the newest document is at the top of the list. The Start Page field defines which page results are displayed on. The maximum pages to include option limits the total number of pages that will be displayed and returned for the menu. The pages to read ahead option controls the number of result pages to read ahead when using a page navigation element.
The following fields define the design for the menu through text, tags, and components
Header Design can specify a header text or component to appear before the menu list. The appearance for the Menu elements are defined in the Component Design for each matching Content field. The footer defines the design below the menu and separator between the menu element. The layout if no results are returned defines the layout if there were no matching content items. No header nor footer will be displayed in that case.
103 of 439
Text component
Text components can be used to store text or HTML as reusable text modules. For the River Bend website, we create text components to describe standardized processes for coffee and tea production, such as roasting or picking. Note, tea picking is different from coffee picking. After you define the text components, you can use them as standard text blocks in the coffee and tea product description pages.
Another example of a file resource component is graphics that are used to add polish to the River Bend website. For example, the navigators do not use a symbol (such as arrows) to indicate activated sections. You can store a graphic as a file resource to serve as indicator for an activated selection.
HTML component
HTML components are very flexible. An HTML component contains HTML code and often references items, content fields, and components.
Image component
Images that are used throughout the website can be stored directly into image component fields in the authoring templates. In this case, the author has the option to define the size of the image, which might or might not fit the overall design. Defining
104 of 439
images as image resources provides identical images for re-usage. The River Bend website uses multiple image components as consistent design elements in the presentation templates. The images are re-used in the different components and presentation templates.
JSP component
The JSP components store the path to a JSP and error message text in case the JSP is not available. An extended discussion on JSP in combination with the API is found in 4.3 Programming.
Taxonomy component
Taxonomy components are often used together with personalization to allow users to select categories of interest from a list. Alternatively, you can use the taxonomy component to display categories for navigation instead of site areas. Be aware that this option works only for authenticated users. If your site requires the taxonomy components option for anonymous users, the implementation is more complex. In this case, you need to create a JSP for an imaginary user for which the component is displayed. The taxonomy component displays a list of categories, starting with the selected start area (in this case, a category), and displaying the depth according to the Depth field. You can define further selection criteria by using a Profile Search Rule. The remaining fields are used to format the displayed categories with a header and footer. The Unselected Components and Selected Component fields contain special layout for selecting categories, which could be check boxes.
105 of 439
Perform inline editing of the current content item through a pop-up window or by navigating to a separate page. Delete the content item displayed in a web page. Approve or reject the current content being previewed. These are only visible to approvers who open a draft content item from a URL sent by an email workflow action used in a workflow stage.
The River Bend website uses the authoring tool component for the Edit and New functionality. See the following figure that shows the authoring tool in the tea area.
For more details on authoring tool, refer to 4.1 Personalize the authoring tools.
Link component
A link component stores a reusable link to an IBM Web Content Manager item or to an external website that you can use in multiple places across the site.
106 of 439
Shuttle control related to current page. For example, next page, previous page, go last, and go first. Paging control, showing an index for all the available pages or a continuation link for the pages. Jump to page, displaying a text box, where the user can enter the page number if known beforehand.
Refer to the following figure for the available options for the page navigation component and the result in the figure after that.
The following html could be added to the footer to display the current page number and the total number of the pages. 1: 2: <p><strong>Ex: Page 2 of 10 </strong></p> 3: <pre> 4: Page <PageInfo value="currentPage"/> of <PageInfo value="unknownPages" knowntext="" unknowntext=""/> <PageInfo value="totalPages"/> 5: </pre> Refer to 3.2.7.6 Creating the page navigation component for a complete example of the page navigation. The following figure shows the page navigation controls.
107 of 439
3.2. Steps to build the River Bend Tea and Coffee Company website
In this section, we provide detailed steps of how to build the the portal and IBM Web Content Manager (WCM) based website for the River Bend Tea and Coffee Company (River Bend).
Log in to the WebSphere Portal, open the Administration page, and navigate to Portal Content -> Web Content Libraries as shown in the following figure.
108 of 439
2. Click the Create new Library button, and type Riverbend in the Web content library name field. 3. Type a summary for the library into the Description field, for example: The River Bend Tea and Coffee company sample site. 4. Select English as the default language from the Language drop-down box. 5. To safeguard our library from being accidentally deleted, select the Prohibit library from being deleted box. 6. Ensure the checkbox for the library being Enabled is selected as by default. 7. Click the OK button. The following figure shows the completed steps prior to clicking the OK button.
The newly created library should now be visible in the list of Web Content Libraries as shown in the figure below.
109 of 439
During the creation of the library, you would have seen an option to Include default items in the new library, as shown in the second figure. Select this checkbox if you want to create default content items and associated components in the library. For our case, we don't want to select that option.
Propagation Inheritance
Administrator Manager Editor Contributor Yes Yes Yes Yes Yes Yes Yes Yes riverbend_ContentCreators, riverbend_ContentApprovers, wcmadmins
110 of 439
With the library permissions set, we can now set the permissions to the resources (item types). Permissions at this level restrict visibility of item types such as authoring templates and components in the Library Explorer interface.
to save. 5. Click the button 6. Using above steps 1 to 5 set the access permission for the item type listed in the following table. Add the user groups specified in the tables below to the defined roles. For components access rights setup: Roles Allow Allow User / Group
Propagation Inheritance
Administrator Manager Editor Contributor User Roles Yes Yes Yes Yes Yes Allow Yes Yes Yes Yes Yes Allow User / Group
Propagation Inheritance
Administrator Manager Editor Contributor User Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes riverbend_Designers, riverbend_ContentCreators
111 of 439
For presentation templates access rights setup: Roles Allow Allow User / Group
Propagation Inheritance
Administrator Manager Editor Contributor User Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes riverbend_Designers
For set areas access rights setup: Roles Allow Allow User / Group
Propagation Inheritance
Administrator Manager Editor Contributor User Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes riverbend_Designers
For taxonomy access rights setup: Roles Allow Allow User / Group
Propagation Inheritance
Administrator Manager Editor Contributor User Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes riverbend_Designers
For workflow and workflow elements access rights setup: Roles Allow Allow User / Group
Propagation Inheritance
Administrator Manager Editor Yes Yes Yes Yes Yes Yes riverbend_Designers
112 of 439
Contributor User
Yes Yes
Yes Yes
Using the button move the Riverbend library from the Available Libraries to the Selected Libraries, click OK.
5. Select the checkbox Show new libraries in the library explorer, This option removes the need to manually add the libraries to the authoring interface in future. 6. Expand the collapsed User Interface Options section. 7. Set the value of the Maximum rows per table to 25 or higher. This allows you to see more items on the screen, for example a longer list of content within a site area. 8. Click the OK button to save these preferences,
113 of 439
The current library used now is RiverBend as shown in the following figure.
2. 3. 4. 5. 6.
Click the New User button, and type gcloud in the User ID field. Type a suitable password and reconfirm the password in the next field. Type a Glenn in the First Name field. Type a Cloud the Last Name field. Click the OK button to save and create the user.
114 of 439
Using the steps 2 - 6 create the following users: Samantha Daryn (sdaryn) Misha Thompkin (mthompkin) Vivian Hanley (vhanley) Jim Lendler (jlendler) Rita Ferrar (rferrar) Mike Motley (mmotley) Amy Blanks (ablanks) Dina Maroni (dmaroni) Harry Greene (hgreene) Paul Clemmons (pclemons) Liz Schonfield (lschonfield) Sheila Durgan (sdurgan) Jasmine Harj (jharj) George Bandini (gbandini) Larry Moriarty (lmoriarty) Paula Starky (pstarky) Natalie Olmos (nolmos) Glenn Cloud (gcloud)
115 of 439
1.
116 of 439
1. Click the name of the group riverbend_ContentCreators, this will place you inside the group 2. Click the Add Member button 3. Click the Search button, note the default is to search for Groups 4. Tick the check box beside the groups riverbend ContentCreatorsMarketing, riverbend ContentCreatorsOps, riverbend ContentCreatorsStoreMgr 5. Click the OK button to save your selection. Follow the steps above for riverbend_ContentApprovers, adding the groups riverbend_ContentApproversHQ, riverbend_ContentApproversHR, riverbend_ContentApproversLegal For all the groups currently defined we now need to ensure that the Riverbend website team are assigned correctly. Assigning users to groups is a similar process to that of above with nested groups: 1. Click the group riverbend_Designers, 2. Click the Add Member button 3. Select Users from the search dropdown box. Set the Search by: dropdown to uid, and the Search parameter to " * " (asterisk) - this will show all users.
117 of 439
4. Tick the box beside the user Glenn Cloud. 5. Click the OK button.
Using the table defined below by the Riverbend administrators add the following users to groups. Site Role Creator (Author) Group riverbend_Content riverbend_ContentCreatorsMarketing riverbend_ContentCreatorsStoreMgr riverbend_ContentCreatorsOps User(s) Samantha Daryn Rita Ferrar, Mike Motley, Samantha Daryn Amy Blanks, Dina Maroni, Harry Greene, Samantha Daryn Misha Thompkin, Vivian Hanley, Jim Lendler, Samantha Daryn Approver riverbend_ContentApprovers riverbend_ContentApproversHR riverbend_ContentApproversHQ riverbend_ContentApproversLegal Paul Clemmons Liz Schonfield, Sheila Durgan, Paul Clemmons Jasmine Haj, George Dandini, Paul Clemmons
118 of 439
Larry Moriarty, Paula Starkey, Paul Clemmons Designer Site Administrator riverbend_Designer wcmadmins Glen Cloud Natalie Olmos Glenn Cloud
Click on the New button in the Library Explorer, and select Site Area shown in the following figure.
119 of 439
2. Type in Riverbend for the Name and Display Title fields. 3. Select the Description field and type; Site root for the River Bend Tea and Coffee Company. 4. Click the Save and Close button. You should now see in the Library Explorer the newly created site area, shown in the following figure.
120 of 439
1. Click on the Riverbend site area, you will now see in the breadcrumb menu that you are inside the Riverbend site area.
2. Click the New button and select Site Area as described previously. 3. Note that the location of your next site area has now defaulted to RiverBend/Riverbend (Library/Site Area). 4. Type in Home for the Name and Display Title fields. 5. Click the Save and Close button. 6. Repeat steps 1 to 5 to create another site areas with Home, where its Name is Products, and Display Name is Products also. At this point you have started to build out the nested site areas of Riverbend as shown in the figure below. If you expand the site framework view, you see the Home site area within the navigational hierarchy, as also shown in the figure below.
At this point, you can repeat this process to create the site areas that are shown in Figure 5. Repeat step 1 through 5 again to create the rest of the site areas for this example. The above figure shows the Library Explorer configured to display the Library Explorer in a hierarchical view, this has been configured just to emphasise the structure you are creating for the Riverbend Site Areas. This view is not the default, however can be button from the Display: menu. Selecting the enabled by clicking on the will restore the default at any time. button
Note: Selecting either Start or End for the link order determines the sequential placement of a site area within the list of multiple site areas. If the order of the site areas listed does not match the exact example that we provide, do not worry. Refer to section Rearranging the site area order for details about how to re-order site areas. Tip: Use Save As button to create copies of a site area that is already open in edit
121 of 439
mode.
Hint: The Names you see in Figure 5 are the display names for the Site Area items.
122 of 439
3. Expand the Riverbend > Home>About Us site areas. 4. Select Company site area. 5. Choose After from the Placement option at the bottom of the screen shown in the following figure.
123 of 439
The Careers site area is now displayed after History site area as shown in the following figure.
Note: Within this section we describe specific steps for rearranging the order site area items within the overall site framework. Keep in mind that you can use the Move button to move a specific site areas to any library, or site area within the framework.
124 of 439
Note: Page templates need to have a unique name that is prefixed wps.content.template. to ensure the Page Template dropdown box is populated correctly when using the New Page from.. option. Follow the steps as above, this time using the unique name of riverbend_4layout.
River Bend is using IBM WebSphere Portal and Web Content Manager v7.0.0.1 CFx, This version allows for pages to be created from pages template via the Administration Interface, and not the page builder 2 theme.
125 of 439
2. From the Edit Layout section of the page, click the button. The following figure shows the Web Content Viewer Portlet:
3. Select the Search by: dropdown to Contains in Title, and type in Web Content Viewer. 4. Tick the checkbox beside the portlet, and click the OK button. 5. Repeat the steps above to add 3 more portlets to the page. Done button to save and close the template. 6. Click the 7. Complete the steps above for the Riverbend 4 Portlet template page. This time adding one more portlet to the page.
126 of 439
The River Bend page hierarchy is comprised of a main Home page level, this is the primary entry point to the website. The Products, About Us and Community levels are portal labels, as such do not contain content. Beneath the labels are pages that contain specific site area information, for example Coffee, Tea, Locations, and News content.
127 of 439
Creating labels
Follow these steps to create labels: 1. Select the Riverbend Home title link, this will place you within that page in the portal page hierarchy. 2. 3. 4. 5. New Label button. Click the Type in Products for the label Title. Type in riverbend_products for the Unique name:. type in products for the Friendly URL name:. OK button.
6. Click the
128 of 439
Following steps 2 to 6, create the Labels for the About Us, and Community site area sections. Using steps 1 to 7 from the section Creating Site Pages, create the hierarchy of pages below each of your labels as follows: Products [label] - Coffee - Tea - Soft Drinks - Food About Us [label] - History - Locations - Products - Careers Community [label] - News - Events
129 of 439
- Blog - FAQ
Page properties of the Tea Detail page 7. From the Web Content Mappings option click the Select link to define the WCM library / content mapping for the page. Choose the Riverbend library, and select the Tea site area.
130 of 439
Click the OK button. You should now see the page you create in the Manage Pages section, at this stage we want to place a single Web Content Viewer portlet on the detail page to display content. As we are within the portal administration interface we can use the Edit Page Layout button to achieve this. An alternative to this is to use the page Actions available when using the PageBuilder2 or Rivervend theme (see image below).
Click the Edit Page Layout button Click the + Add portlets button Change the Search by: scope to Title contains Type in the Search: box, 286 to locate the Web Content Viewer portlet Tick the checkbox to the right of the portlet, and click the OK button. Click the Done button.
You should now have configured the Tea-Detail page. As the Riverbend uses several detail pages, use the steps outlined above to complete detail pages for the following: Products - Coffee - Tea
131 of 439
2. Click the Riverbend library name. 3. Click the New button, and select Taxonomy from the drop down list. 4. Type in Riverbend for the Name and Display Title fields. 5. Select the Description field and type; The Riverbend content taxonomy.
132 of 439
The figure below shows the created taxonomy for River Bend.
6. Click the Save and Close button. While the River Bend sample website only uses a single taxonomy, IBM Web Content Manager (WCM) allows you to create as many as required to support your needs.
133 of 439
1. Click the Riverbend taxonomy you created in the previous steps. 2. Click the New button and select Category. Category should be listed at the top of the drop-down list as it's contextual to where you are currently located. 3. Type in Career for the Name and Display Title fields. 4. Click the button Save and Close. 5. Repeat steps 2 to 5 to create the following list of categories, noting that some categories are nested and have sub-categories.
134 of 439
This diagram shows a graphical representation of the workflows in use at River Bend.
River Bend workflow consists of the following elements: Workflow stages are represented by the rectangular shapes. Workflow states are represented by the shape colour: - Draft items in orange, also denoted with a D - Published items in green, also denoted by a P - Expired items in blue , also denoted by a E Workflow actions within a stage appear before and after each shape, also surrounded by a grey box to represent what will be executed when the item enters or exits that stage.
Note: For specific steps on how to create these, refer to the document .
135 of 439
Additional actions are required. Use the steps 2 to 4 above, create the actions outlined below: 3.3.2 Working with workflow - Creating basic and custom workflows. Action Email for rejected Content Expired Move content on expiry date Generate thumbnail Action Type Email Action Expire Action Scheduled Move Action Custom Action
For the "Move content on expiry date" action, select Expiry Date from the Date Type list and choose an appropriate date to see this action, for example tomorrow's date. For the "Email for rejected Content", select E-mail authors. E-mail Stage Approvers is selected by default. Add an apology message in Additional e-mail text.
136 of 439
Click the New button and select Workflow Type in the Name: field, Express Select Workflow Stages in the Properties section. Click the Add button Select Draft, Published and Expired from the list of workflow stages. Using the arrows to the right of the listed stages, move the stages into the order listed above in step 5. 7. Click OK button.
1. 2. 3. 4. 5. 6.
137 of 439
4. Type in the Name: field, Event. 5. Type in the Display title: field, Event. 6. Type in the Description: field, Authoring template for Events. 7. Click on More Actions Manage Elements button 8. Select Date and Time from the Element type: dropdown box. 9. Type in the Name: field, Date 1. 10. Type in the Display title: field, Start date. 11. Click the Add button. 12. For the elements listed in the below repeat steps 8 to 11.
138 of 439
14. Click the OK button to save your changes and return to the authoring template. 15. From the Site area selection options:, choose Selected site areas. 16. Using the Add button locate and select the /Riverbend/Riverbend/Home/Community/Events site area for all content created with this authoring template to be stored within. 17. From the Form properties section:, choose Collapsible sections for the Content form layout: option. 18. Select the Default Content Properties tab 19. Open the Workflow section, tick the checkbox to Disable workflow, and Hide Section. 20. Click the Save and Close button. Using the steps outlined above for the event authoring template, use the criteria in the next sections to create the remaining templates. Article Element type Name Display title Rich Text Body Body Image Image Image File Resource File File Link Related Link 1 Related Link 1 Link Related Link 2 Related Link 2 Link Related Link 3 Related Link 3 Default Content Properties: Content form layout = Collapsible Sections Workflow = Disabled, Hidden
139 of 439
Essential Link Element type Name Display title Link Link Link Default Content Properties: Content form layout = Collapsible Sections Workflow = Disabled, Hidden General Element type Name Display title Rich Text rtf_Body Body Image img_Image Image Link link_Link Link Component Reference cmpt_Navigator Navigator Component Reference cmpt_Menu Menu Default Content Properties: Content form layout = Collapsible Sections Workflow = Riverbend/Approval Landing Page Element type Name Display title Rich Text Body Body Component Reference Post Body Component Post Body Component Component Reference Auxiliary Component Auxiliary Component Default Content Properties: Content form layout = Collapsible Sections Workflow = Disabled, Hidden Locations Element type Name Display title Text txt_Summary Summary Rich Text rtf_Body Body Image img_Image Image Short Text shtxt_TheStoreTeam TheStoreTeam Option Selection sel_Country Country Item Properties: Selected Site Areas = /Riverbend/Riverbend/Home/About Us/Locations Default Content Properties: Content form layout = Collapsible Sections Workflow = Disabled, Hidden News Element type Name Display title Rich Text Details Details Image ImageLg Large Image Image ImageTn Small Image Component Reference Related Related Collateral Item Properties: Selected Site Areas = /Riverbend/Riverbend/Home/Community/News
140 of 439
Default Content Properties: Content form layout = Collapsible Sections Workflow = Disabled, Hidden Products Element type Name Display title Rich Text Details Details Image ImageLg Large Image Image ImageTn Small Image Component Reference Complimentary Complimentary Items Component Reference Related Related Products Item Properties: Selected Site Areas = /Riverbend/Riverbend/Home/Products/Coffee, /Riverbend/Riverbend/Home/Products/Tea, and /Riverbend/Riverbend/Home/Products/Food Choose saving option for the content author = Allow under multiple site areas Default Content Properties: Content form layout = Collapsible Sections Workflow = Disabled, Hidden Vacancy Element type Name Display title Option Selection Store Store Option Selection Location Location Rich Text Details Details Short Text Contact 1 Contact Name Short Text Contact 2 Contact Phone Short Text Contact 3 Contact Email Item Properties: Selected Site Areas = /Riverbend/Riverbend/Home/About Us/Careers Default Content Properties: Content form layout = Collapsible Sections Workflow = Disabled, Hidden
141 of 439
5. 6. 7. 8.
9.
Click on More Actions > Manage Elements button. Select File Resource from the Element type: dropdown box. Type in the Name: field, Recipe. Type in the Display title: field, PDF Recipe. Click the Add button. The following figure shows adding of a file resource element.
10. Click the OK button to save your changes and return to the authoring template.
You will notice that the within the Item Properties section of the authoring template the template type is now selectable; choose Resource as the type from the dropdown box. In addition select Recipe as the File resource Element to use.
142 of 439
11. From the Site area selection options:, choose Selected site areas. 12. Using the Add button locate and select the /Riverbend/Riverbend/Recipes/ site area for all content created with this authoring template to be stored within. 13. Select the Default Content tab. 14. Click on the field properties icon for the PDF Recipe. 15. Type in the Maximum bytes: size, 153600 (150kb) 16. Type in the Help text: Browse and upload a Recipe in Adobe PDF format. The following figure shows the properties of the file field resource.
17. Select the Default Content Properties tab. 18. Open the Workflow section, tick the checkboxes to Disable workflow and Hide Section. See figure below.
143 of 439
Note: You can download the sample images listed below from the Additional Resources Page.
144 of 439
The following image shows the RiverBend site banner used in the home page of the River Ben website.
145 of 439
146 of 439
7. In the Approve action properties section: <a href="[Placeholder tag="href"]" > [Placeholder tag="name"]</a>
8. In the Reject action properties section: <a href="[Placeholder tag="href"]" > [Placeholder tag="name"]</a>
</span><span>
11. In the Footer properties section: </span></div> 12. Click Save, and then click Save and Close. 13. In the menu Menu - Current Area Items, add a reference to the authoring tool to show the buttons for the admins in the menu. 14. In the Design for each menu search result field, reference the authoring template by adding the following after the existing text showing the item details. [Component name="riverbend/auth-editcreatedeleteapprove" compute="always"]
147 of 439
The following image displays the menu component showing the authoring tool in each item.
148 of 439
the home page. To display the navigator, the component reference is added to the three presentation templates. To add the site map navigator component, you need to do the following: 1. Create the site map navigator component. 2. Reference the site map navigator component in the presentation template. 3. Format the site map navigator component by creating bold and normal HTML components. 4. Reference the HTML formatting components in the site map navigator component. Following are the steps for creating the site map component: 1. Click New > Component > Navigator. 2. In the Name field, enter NAV-siteMap. Tips: It is good style and helpful to use a naming schema for components. It makes references easier to understand. For navigators, use a nav- prefix. A reference then reads: <Element name="NAV-siteMap"/>
3. In the display title, enter Site Map Navigator or NAV-siteMap. 4. In the Description field enter: Navigator for accessing site area sections as a site map 5. In the Navigator Component section in the Start Type list, choose Selected. This action defines the site area where the search begins. 6. In the Selected Start Area section, choose Select Start Area. 7. In the index, click River Bend and then click click OK. 8. De-select Include Start so that River Bend does not appear in the navigator. 9. From the Descendant Level list, select 1 Level. This action defines that the first level of children site areas of River Bend are collected. 10. De-select Show Content. If this option is selected, links to content in the current site area display in the navigator. 11. Select Expand current navigator branch one level. If this option is selected, the navigator expands to display the children site areas of the current site area. 12. Select Expand navigator to display current site area . 13. In the Header field, enter the following code: <div id="leftNav">
</div>
149 of 439
15. Indent each site area level and create a placeholder for the code you will add to format the site area links. In the Navigator result design 1 field, enter the following code: <IndentCmpnt offset="0" repeat=" "/> <placeholder tag="namelink"/><br>
16. Click Save and then Close or click Save and Close.
150 of 439
[IndentCmpnt offset="0" repeat=" "] [AlternateDesign normal="riverbend/html-layout-main nav plain" highlight="riverbend/html-layout-main nav bold" type="Any"]<br> 7. Click Save and then Close or click Save and Close. Reference the navigator created from the portlet configuration of the Site Map page as follows:
151 of 439
Following is an image of the site map navigator after being referenced from a portlet in the Site Map page:
152 of 439
153 of 439
To create a menu using authoring template and site area as search criteria, follow these steps: 1. 2. 3. 4. 5. 6. 7. 8. Click New and choose Component Menu. In the name field, enter Menu-Locations. In the Menu Element Query, choose Authoring Templates , and Site Areas. In the Authoring template section, Click on Add Authoring Template. Choose Locations and click OK. In the Site Areas section, click on Add Site Areas. Navigate to Locations by clicking on Home > About Us > Locations. Expand Further Options and select Current content. Add the following html to the header:
154 of 439
9. Add the following html to the Design for each menu search result:
1: 2: <tr><td> 3: <b>[Property context="autofill" type="content" field="title"] </b> 4: </td></tr> 5: <tr><td> 6: [Element context="autofill" type="content" key="txt_Summary"] 7: [Element context="autofill" type="content" key="rtf_Body"] 8: [Element context="autofill" type="content" key="img_Image"] 9: [Element context="autofill" type="content" key="shtxt_TheStoreTeam"] 10: [Element context="autofill" type="content" key="sel_Country"] 11: </td></tr>
10. Close the table using the following html in the footer: 1: </table>
11. In the Separator, you can either reference an image which represents a line to separate the result or add a dotted line which could be changed later.
To add an image not already created as an image component, do the following steps: 1. 2. 3. 4. In the separator section, click on Insert an Image. Click on Browse and navigate to the image seperator_490.gif. Select the option Add image to library and grant all users access and click OK. Click Save and Close.
To see the image that has been added to the library, click on Component > Image. You will find a new image component added with the file name seperator_490.gif. Repeat steps 1 through 21 to create the following menu components: Menu Name (Menu Criteria) Authoring Template Site Area Other options
Exclude current content from results Location = Further Options > Current Content Display Order = Decending Results Primary Sort
155 of 439
Key = Publish Date Menu Featured Content /Riverbend/Riverbend/Hom e/Our Community Categories = /Riverbend/Riverbend/ Featured (include descendants) Display Order = Decending Results Primary Sort Key = Publish Date Display Order = Decending Results Primary Sort Key = Publish Date Exclude current content from results Display Order = Ascending Results Primary Sort Key = Publish Date Company/Careers with us News News News/Promotions News/Corporate Information
Menu Recipes
Recipe
Menu - Offers
The Design for the menu would be as follows (no header or footer):
1: 2: 3: 4: 5: 6:
<!-- Design Results --> <tr> <td> <a href="<Placeholder tag="href"/>"> <Placeholder tag="name"/></a><br> </td> </tr>
156 of 439
Menu - Recipes
The Header, Design and Footer for the menu would be as follows:
1: 2: <!-- Header --> 3: <div class="contentIndex"> 4: <div class="body"> 5: <h1>Recipes</h1> 6: <ul class="list"> 7: 8: <!-- Design Result --> 9: <li class="contentEditContainer item"> 10: <div class="itemDetails"> 11: <h3 class="itemTitle"> 12: [Component name="riverbend/site images/downloadicon"] <a href="[Element context="autofill" type="content" key="Recipie"]">[Property context="autofill" type="content" field="title"]</a> 13: </h3> 14: <div class="itemSummary"> 15: [Property context="autofill" type="content" field="description"] 16: </div> 17: </div> 18: <div class="contentClear"></div> 19: </li>
1: 2: 3: 4: 5:
1: 2: 3: 4: 5: 6:
<!-- Header --> <div class="contentIndex"> <div class="body"> <ul class="list"> <li class="contentEditContainer item first"></li>
157 of 439
1: 2: <!-- Design Result --> 3: <li class="contentEditContainer item"> 4: <div class="itemImage"> 5: [Element context="autofill" type="content" key="ImageTn"] 6: </div> 7: <div class="itemDetails"> 8: <h3 class="itemTitle"> 9: <a href="[URLCmpnt context="autofill" type="content" mode="current"]">[Property context="autofill" type="content" field="title"]</a> 10: </h3> 11: <span class="itemSubTitle"> 12: [Element context="autofill" type="content" key="Date 1" format="DATE_LONG"] - [Element context="autofill" type="content" key="Location"] 13: </span> 14: <div class="itemSummary"> 15: [Property context="autofill" type="content" field="description"] 16: </div> 17: <div class="itemLink"> 18: [Component name="riverbend/html - read more link"] 19: </div> 20: </div> 21: <div class="contentClear"></div> 22: </li>
1: 2: 3: 4: 5:
1: 2: 3: 4: 5: 6:
<!-- Header--> <div class="contentIndex"> <div class="body"> <ul class="list"> <li class="contentEditContainer item first"></li>
158 of 439
1: 2: <!-- Design Results--> 3: <li class="contentEditContainer item"> 4: <div class="itemImage"> 5: [Element context="autofill" type="content" key="ImageTn"] 6: </div> 7: <div class="itemDetails"> 8: <h3 class="itemTitle"> 9: [Property context="autofill" type="content" field="title"] 10: </h3> 11: <div class="itemSummary"> 12: [Property context="autofill" type="content" field="description"] 13: </div> 14: <div class="itemLink"> 15: [Component name="riverbend/html - read more link"] 16: </div> 17: </div> 18: <div class="contentClear"></div> 19: </li>
1: 2: 3: 4: 5:
1: 2: 3: 4: 5: 6:
<!-- Header --> <div class="contentIndex"> <div class="body"> <h1>Products</h1> <ul class="list">
159 of 439
1: 2: <!-- Design Result --> 3: <li class="contentEditContainer item"> 4: <div class="itemImage"> 5: [Element context="autofill" type="content" key="ImageTn"] 6: </div> 7: <div class="itemDetails"> 8: <h3 class="itemTitle"> 9: <a href="[URLCmpnt context="autofill" type="content" mode="current"]">[Property context="autofill" type="content" field="title"]</a> 10: </h3> 11: <div class="itemSummary"> 12: [Property context="autofill" type="content" field="description"] 13: </div> 14: <div class="itemLink"> 15: [Component name="riverbend/html - read more link"] 16: [Component name="riverbend/autheditcreatedeleteapprove" compute="always"] 17: </div> 18: </div> 19: <div class="contentClear"></div> 20: </li> 1: 2: <!-- Footer and Paging --> 3: <div class="foot"> 4: <div class="pagingBar"> 5: [Component name="riverbend/pn_pagenavigator"] 6: </div> 7: </div> 8: </ul> 9: </div> 10: </div>
For the River Bend website example, we personalize an image on the home page. This image changes automatically based on the current season. There are currently two images, a winter image and a summer image. The winter image showing on the
160 of 439
Using personalization rules, the current seasons beverage will be selected and the image from the content will be displayed. When creating the personalization component, the following key steps are involved: 1. 2. 3. 4. Create select action rules. Create profiler rule. Create binding rule. Create Personalization Component.
Navigate to the Personalization page from the Content tab as shown in the below image and choose Business Rules from the drop down menu.
161 of 439
2. 3. 4. 5. 6. 7. 8. 9. 10. 11.
Select New and choose Rule. Enter SummerDrinkRule in the Rule name. Choose Select Action if not already selected. Click on content* and change it to be Web Content. Click on Attribute and change it to be Category. Choose is exactly instead of "is associated with". Click on value*, click on Select category. Navigate to the category Products > Beverages > SeasonDrink > Summer. Click OK and click Save. Repeat steps 2 through 11 to create the Winter Selection Rule. The rule name is WinterDrinkRule and Category is Winter.
162 of 439
If content already exists that matches the categories, we can view the content as shown in the figure below by clicking on Preview.
163 of 439
A no content screen will be shown until content exists with those categories.
164 of 439
8. Click Save and then click Save and Close. Add a reference to the personalization component from the html component HTML Seasonal Product. The html used for that is as follows: 1: 2: 3: 4: 5: 6: 7:
<div class="contentSlideshow"> <div class="head"> <h2 class="blockHeading">Seasonal Product</h2> </div> [Component name="riverbend/pers-seasons"] </div>
The section provides the steps to build the page navigation component for the River Bend site. When creating the component, there are two key steps involved: 1. Create the page navigation component. 2. Reference the page navigation component from within the menu components.
165 of 439
6. In the footer, enter the following: 1: 2: </span> 3: <span> 4: Page [PageInfo value="currentPage" ] 5: [PageInfo value="unknownPages" knowntext="of" unknowntext="of at least" ] 6: [PageInfo value="totalPages" ]. 7: </span> 8: </table>
7.
For the rest of the values leave the default values, as shown in the following image:
166 of 439
167 of 439
The following figure shows the resulting page navigation component displayed on the product page.
168 of 439
DISCLAIMER OF WARRANTIES: The accompanying code provided in this section (and this wiki) is sample code, created by the authors of this wiki. This sample code is not part of any standard or IBM product and is provided to you solely for the purpose of assisting you in the development of your website. The code is provided as is, without warranty of any kind. IBM shall not be liable for any damages arising out of your use of the sample code, even if they have been advised of the possibility of such damages.
For the River Bend site, we use a dojox.image.SlideShow to render a slide show of images. These images come from some of the key products of the sample site. When the image is clicked, content opens.
169 of 439
Note that we have configured the menu to pull content based on a specific site area, the /Riverbend/Riverbend/Key Products site area. We have configured it to return a maximum of 10 results, and we have no need for sorting. We only want to include 1 page, and no need for read ahead.
170 of 439
Menu header
In the menu header, we set up the component to be able to use the dojo assets:
1: 2: 3: 4: 5: 6:
We do not describe how dojo works in this section, but the important piece is where we open the ItemFileReadStore. We leave it open ended so that in each menu match design, we can add in the relevant information for that particular match.
In summary, what this does is add the relevant information about each match to the javascript object that will drive the dojo ImageSlider component. We add in the image, the URL to the content, and the title of the content.
Menu separator
For the menu separator, we only need to include a comma: 1: 2:
Menu footer
In the menu footer, we close off the ItemFileReadStore object now that each item has been placed in. Also, we add the code to display the dojo asset to the page.
171 of 439
1: 2: <script> 3: dojo.addOnLoad(function() { 4: dojo.parser.parse(); 5: //Call the setDataStore function, passing it the data store, the request object, 6: //and the name map. 7: dijit.byId('slideshow1').setDataStore(imagestore, 8: { query: {}, count:20 }, 9: { 10: imageLargeAttr: "imageLargeAttr", linkAttr: "linkAttr", titleAttr: "titleAttr" 11: } 12: ); 13: }); 14: </script> 15: 16: <div dojoType="dojox.image.SlideShow" id="slideshow1" > </div>
What we have done here is to drop the dojox.image.SlideShow to the page in the div tags. This is where dojo renders the image slide show when it is complete. The rest of the javascript tells that slide show to use the data that will be coming from the menu. For the dojo, it will be included with the out of the box themes. If you wish to use with a custom theme, you have to ensure dojo is available.
172 of 439
From within the RiverbenCustom application, right click on RiverbendCustom/Java Resources/src and select New -> Nackage.
173 of 439
2.
174 of 439
Right click on the package, and create a new class by select New > Class.
2.
Name the new class SimpleCacheObject. Ensure it is in the correct package. Click Finish.
175 of 439
1: 2: package com.ibm.riverbend.simplecache; 3: import java.util.logging.Logger; 4: 5: /** 6: * 7: * SimpleCacheObject a wrapper for a simple cache entry 8: */ 9: public class SimpleCacheObject 10: { 11: /** 12: * Logger for the class 13: */ 14: private static final Logger s_log = Logger.getLogger(SimpleCacheObject.class.getName()); 15: 16: /** 17: * the object in the cache 18: */ 19: private Object cacheEntry; 20: 21: /** 22: * the expiration time 23: */ 24: private long cacheExpireTime; 25: 26: /** 27: * 28: * Constructor 29: * 30: * @param objectToCache the object to cache 31: * @param cacheExpire the time to cache it for 32: */ 33: SimpleCacheObject(Object objectToCache, long cacheExpire) 34: { 35: cacheEntry = objectToCache; 36: cacheExpireTime = cacheExpire; 37: } 38: 39: /** 40: * 41: * getCacheEntry returns the object stored in the cache 42: * 43: * @return the cached object 44: */ 45: public Object getCacheEntry() 46: { 47: return cacheEntry; 48: } 49: 50: /**
176 of 439
51: * 52: * setCacheEntry sets the item to store in the cache 53: * 54: * @param p_cacheEntry the item to cache 55: */ 56: public void setCacheEntry(Object p_cacheEntry) 57: { 58: cacheEntry = p_cacheEntry; 59: } 60: 61: /** 62: * 63: * getCacheExpireTime returns the cache expiration 64: * 65: * @return the cache expiration 66: */ 67: public long getCacheExpireTime() 68: { 69: return cacheExpireTime; 70: } 71: 72: /** 73: * 74: * setCacheExpireTime sets the cache expiration time 75: * 76: * @param p_cacheExpireTime the time to set as cache expiration time 77: */ 78: public void setCacheExpireTime(int p_cacheExpireTime) 79: { 80: cacheExpireTime = p_cacheExpireTime; 81: } 82: 83: /** 84: * override toString 85: */ 86: public String toString() 87: { 88: String returnString = ""; 89: returnString = "SimpleCacheObject cached::"+cacheEntry+":: expireTime::"+cacheExpireTime; 90: return returnString; 91: } 92: } 93:
177 of 439
At a high level, the object is a wrapper around another object. We use the wrapper so that we can also associate an expiration time with it.
178 of 439
1: 2: package com.ibm.riverbend.simplecache; 3: 4: import java.util.HashMap; 5: import java.util.Map; 6: import java.util.logging.Level; 7: import java.util.logging.Logger; 8: 9: /** 10: * 11: * SimpleCacheImpl a Simple cache 12: */ 13: public class SimpleCacheImpl 14: { 15: private static final Logger s_log = Logger.getLogger(SimpleCacheObject.class.getName()); 16: private static long defaultExpirationMinutes = 30; 17: private static SimpleCacheImpl s_theCacheImpl; 18: 19: private static Map<String, SimpleCacheObject> s_simpleCacheEntries = new HashMap<String, SimpleCacheObject>(); 20: 21: /** 22: * 23: * get retrieve the cache object from the cache 24: * Will return null if the item is expired, and will remove the 25: * item from the cache if its expired 26: * 27: * @param keyValue the key of the item to retrieve 28: * @return 29: */ 30: public SimpleCacheObject get(String keyValue) 31: { 32: SimpleCacheObject returnObject = null; 33: returnObject = s_simpleCacheEntries.get(keyValue); 34: // return null if its expired 35: if(returnObject != null && isExpired(returnObject)) 36: { 37: remove(keyValue); 38: returnObject = null; 39: } 40: if(s_log.isLoggable(Level.FINEST)) 41: { 42: s_log.log(Level.FINEST, "get called with key "+keyValue); 43: if(returnObject != null) 44: { 45: s_log.log(Level.FINEST,"get returning
179 of 439
"+returnObject); 46: } 47: else 48: { 49: s_log.log(Level.FINEST, "returning null"); 50: } 51: 52: } 53: return returnObject; 54: } 55: 56: /** 57: * 58: * remove remove the cache entry based on the key 59: * 60: * @param keyValue the key for the cache entry to be removed. 61: */ 62: public void remove(String keyValue) 63: { 64: s_simpleCacheEntries.remove(keyValue); 65: } 66: 67: /** 68: * 69: * put add an item to the cache 70: * 71: * @param keyValue the key value for the cache item 72: * @param cacheObject the object to add to the cache 73: */ 74: public void put(String keyValue, Object cacheObject) 75: { 76: long expireTime = System.currentTimeMillis()+defaultExpirationMinutes * 60 * 1000; 77: put(keyValue, cacheObject, expireTime); 78: } 79: 80: /** 81: * 82: * put add an item to the cache 83: * 84: * @param keyValue the key value for the cache item 85: * @param cacheObject the object to add to the cache 86: * @param expireTime the expiration of the object 87: */ 88: public void put(String keyValue, Object cacheObject, long expireTime) 89: { 90: SimpleCacheObject cachedObject = new SimpleCacheObject(cacheObject, expireTime); 91: s_simpleCacheEntries.put(keyValue, cachedObject); 92: if(s_log.isLoggable(Level.FINEST)) 93: { 94: s_log.log(Level.FINEST, "put called with key "+keyValue+" cacheObject "+cacheObject+" expireTime "+expireTime); 95: } 96: }
180 of 439
97: 98: /** 99: * 100: * isExpired whether or not the cache item is expired 101: * 102: * @param theObject the cache item to check 103: * @return boolean whether expired 104: */ 105: public boolean isExpired(SimpleCacheObject theObject) 106: { 107: boolean isExpiredReturn = false; 108: if(theObject != null) 109: { 110: isExpiredReturn= System.currentTimeMillis()>theObject.getCacheExpireTime(); 111: } 112: if(s_log.isLoggable(Level.FINEST)) 113: { 114: s_log.log(Level.FINEST, "isExpired "+isExpiredReturn); 115: } 116: return isExpiredReturn; 117: } 118: 119: static public SimpleCacheImpl getInstance() 120: { 121: if(s_theCacheImpl == null) 122: { 123: s_theCacheImpl = new SimpleCacheImpl(); 124: } 125: return s_theCacheImpl; 126: } 127: }
The class allows us to get and set cache entries. One thing to note, we have added a logger to the class. This means we can enable trace in the WebSphere Portal administration to see whether the class is behaving correctly. To do so, enable the following trace, and we will see the trace statements in the trace.log: com.ibm.riverbend.simplecache.*=finest
An example trace statement: [9/28/11 10:59:02:529 PDT] 00000031 SimpleCacheOb 3 isExpired false [9/28/11 10:59:02:529 PDT] 00000031 SimpleCacheOb 3 get called with key ANON_Riverbend_Menu_KeyProductsImageRotator [9/28/11 10:59:02:529 PDT] 00000031 SimpleCacheOb 3 get returning SimpleCacheObject cached::
181 of 439
Repeat this process to create a folder within the jsp folder named html. When we finished, you have /jsp/html under the WebContent folder in the application. See the screenshot above.
182 of 439
3.
4. After the folder is created, import the wcm.tld file from the 7.0 WebSphere Portal server. You can find the file in /wp_profile/installedApps/cellname/wcm.ear/ilwwcm.war/WEB-INF/tld. 5. Copy the file to a directory on the machine where you use RAD. 6. Right click the tld folder, and select Import.
7. From the wizard, select File System. 8. In the dialog that is presented, select the folder where the .tld file resides. Click OK. 9. In the next dialog, select the wcm.tld file on the right hand side.
183 of 439
10. Click finish. The end result should be that the wcm.tld file now resides within /WEB-INF/tld folder in your project.
184 of 439
To create the jsp file: 1. Right click the html folder, and select new jsp file.
2. Click the Next button. 3. In the dialog, name the file renderRotatorMenu.jsp.
185 of 439
4. Once the jsp is created, replace the entire text of the jsp with the following code.
1: 2: <%@ taglib uri="/WEB-INF/tld/wcm.tld" prefix="wcm" 3: %><%@ page session="false" contentType="text/html" import="java.util.*, 4: java.util.logging.*, 5: javax.portlet.*, 6: com.ibm.riverbend.simplecache.*, 7: com.ibm.workplace.wcm.api.exceptions.*, 8: com.ibm.workplace.wcm.api.query.*, 9: com.ibm.workplace.wcm.api.*" 10: %> 11: <%! 12: private static final Logger s_log = Logger.getLogger(SimpleCacheObject.class.getName()); 13: 14: %> 15: <!-- grab the dojo assets --> 16: <link rel="stylesheet" href="<%=pageContext.getAttribute("dojoRoot", PageContext.REQUEST_SCOPE)%>/dijit/themes/tundra/tundra.css" type="text/css" /> 17: <link rel="stylesheet" href="<%=pageContext.getAttribute("dojoRoot", PageContext.REQUEST_SCOPE)%>/dojox/image/resources/image.css" type="text/css" /> 18: <wcm:initworkspace/> 19: <% 20: boolean isLoggingFinest = s_log.isLoggable(Level.FINEST); 21: try 22: { 23: Workspace usersWorkspace = (Workspace) pageContext.getAttribute(Workspace.WCM_WORKSPACE_KEY); 24: // check cache first 25: SimpleCacheImpl theCache = SimpleCacheImpl.getInstance(); 26: String keyString = "Riverbend_Menu_KeyProductsImageRotator"; 27: // if we are anonymous, use a different key 28: if(request.getUserPrincipal() == null) 29: { 30: keyString = "ANON_Riverbend_Menu_KeyProductsImageRotator"; 31: }
186 of 439
32: 33: SimpleCacheObject theCacheObject = theCache.get(keyString); 34: if(theCacheObject != null) 35: { 36: String cachedString = (String)theCacheObject.getCacheEntry(); 37: out.println(cachedString); 38: } 39: else 40: { 41: // retrieve the workspace and the rendering context 42: // set the library in the workspace 43: usersWorkspace.setCurrentDocumentLibrary(usersWorkspace.getDo cumentLibrary("Riverbend")); 44: RenderingContext usersRC = (RenderingContext) pageContext.getRequest().getAttribute(Workspace.WCM_RENDERINGCONTEXT_ KEY); 45: 46: // get the menu to render it. Use the new QueryAPI 47: QueryService queryService = usersWorkspace.getQueryService(); 48: Query query = queryService.createQuery(LibraryMenuComponent.class); 49: query.addSelector(Selectors.nameLike("MENU KeyProductsImageRotator%")); 50: 51: // execute the query 52: ResultIterator results = queryService.execute(query); 53: if(results.hasNext()) 54: { 55: if(isLoggingFinest) 56: { 57: s_log.log(Level.FINEST, "renderRotatorMenu.jsp :: menu not null"); 58: } 59: 60: LibraryMenuComponent userMenu = (LibraryMenuComponent)results.next(); 61: String renderedHTML = usersWorkspace.render(usersRC,userMenu); 62: out.println(renderedHTML); 63: 64: if(isLoggingFinest) 65: { 66: s_log.log(Level.FINEST, "renderRotatorMenu.jsp :: menu not null"); 67: s_log.log(Level.FINEST, "renderRotatorMenu.jsp :: renderedHTML "+renderedHTML);
187 of 439
68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79:
We do not go into great detail about the jsp. We concentrate on the important bits of the code as follows. Here, we are generating a key to hold the cache entry. Since this is a menu with images, we want to allow anonymous and authenticated requests. In order to handle that, we need a different cache key for anonymous vs authenticated. 1: 2: 3: 4: 5: 6: 7:
String keyString = "Riverbend_Menu_KeyProductsImageRotator"; // if we are anonymous, use a different key if(request.getUserPrincipal() == null) { keyString = "ANON_Riverbend_Menu_KeyProductsImageRotator"; }
Next, we attempt to retrieve the item out of the cache if it exists. If it does, it is rendered directly to the screen. 1: 2: SimpleCacheObject theCacheObject = theCache.get(keyString); 3: if(theCacheObject != null) 4: { 5: String cachedString = (String)theCacheObject.getCacheEntry(); 6: out.println(cachedString); 7: }
188 of 439
1: 2: <%@ page session="true" contentType="text/html" import="java.util.*, 3: java.util.logging.*, 4: javax.portlet.*, 5: com.ibm.riverbend.simplecache.*" 6: %> 7: 8: <% 9: try 10: { 11: // check cache first 12: SimpleCacheImpl theCache = SimpleCacheImpl.getInstance(); 13: String keyString = "Riverbend_Menu_KeyProductsImageRotator"; 14: String keyString2 = "ANON_Riverbend_Menu_KeyProductsImageRotator"; 15: String passedValue = (String)request.getParameter("key"); 16: if(passedValue != null) 17: { 18: keyString = passedValue; 19: } 20: theCache.remove(keyString); 21: theCache.remove(keyString2); 22: out.println("removed "+keyString); 23: 24: } 25: catch(Exception e) 26: { 27: e.printStackTrace(); 28: } 29: %>
The way that the jsp is written, it automatically clears the cache entries for the 2 hard coded keys that we created. If you create your own custom keys, you would pass those values on the URL to the JSP as ?key=keyname.
189 of 439
Right click on the project name within RAD, select Export > WAR file.
2. Choose the location where you want the file to be placed, and call the file RiverbendCustom.war.
190 of 439
Log into the WebSphere Application Server admin console and navigate to Applications > Application Types > WebSphere Enterprise Applications.
2. Click on the Upload button. 3. On the next page in the wizard, keep the Local File System selection active, and choose the RiverbendCustom.war, and then click Next.
4. On the next page, keep Fast Path checked, and click Next. 5. For the Step 1 page, keep the values as they are, and click the Next button. 6. On the Step 2 page, where we map the modules to the servers. In this case, we want to map the custom application to the WebSphere_Portal server. To do that, select the server from the list of clusters and servers, and select the RiverbendCustom module. With the checkbox selected, click on the Apply button. Ensure the server in the mapping for the RiverbendCustom module is the WebSphere_Portal server. Click on the Next button.
191 of 439
7. On the next page, map the context root for the application. In the context root field, enter /RiverbendCustom. Then click the Next button.
8. After you click Next, the summary screen appears. Click on the Finish button to deploy the changes. 9. After the application is deployed, click Save on the next change to persist the changes to the server. Once saved, ensure the application is started: 1. Navigate to Applications > Application Types -> WebSphere Enterprise Applications. 2. On the form, click on the Filter button, then leave name as the filter and type Riverbend*, and click OK.
192 of 439
3. Click the checkbox to select the application, and click the Start button. Now the application will be started.
193 of 439
2. For the name, display title, and description, enter JSP - removeCacheEntry.jsp. 3. For the path, enter /RiverbendCustom;/jsp/html/removeCacheEntry.jsp. 4. Enter the same in the error field.
194 of 439
This tells WCM to retrieve the jsp from the custom application in the directory where we placed it.
195 of 439
The only other options to change are the portlet cache options. We want to ensure each user gets their own copy of the portlet cache, and since we are relying on the custom cache, we set the timeout to 1 second.
After the configuration changes, click OK. Finally, render the portlet, and you will see the menu being rendered from the JSP.
196 of 439
The portal provides two user interfaces for tagging and rating The default user interface. It allows users to tag and rate resources, and to view tags and ratings for multiple resources. An alternative user interface that works with inline widgets. This shows tags and ratings for individual resources in the context of each resource.
By default this user interface is available for blogs and wikis. Administrators can also add this user interface to other types of resources. To create and reference tags and ratings, you need to add a reference to the tags or rating widget in the presentation template. This section provides steps to create and reference tags and rating widgets for the River Bend site.
197 of 439
Presentation template should now look as following: 1: 2: <!-- Products PT --> 3: <div class="contentEditContainer contentDetail"> 4: <div class="head"> 5: <h2 class="itemTitle">[Property context="current" type="content" field="title"]</h2> 6: </div> 7: <div class="body"> 8: <div class="itemSummary"> 9: [Element context="current" type="content" key="ImageLg"] 10: </div> 11: <div class="itemBody"> 12: [Element context="current" type="content" key="Details"] 13: </div> 14: </div> 15: <div class="foot"> 16: <div class="tagging"> 17: <div id="tags">[Plugin:tags]</div> 18: </div> 19: </div> 20: 21: <!-- Component Reference --> 22: [Element context="current" type="content" key="Related"] 23: [Element context="current" type="content" key="Complimentary"] 24: </div>
198 of 439
Following is a figure of a content using the product presentation template showing the tagging widget:
199 of 439
Presentation template should now look as following: 1: 2: <!-- Products PT --> 3: <div class="contentEditContainer contentDetail"> 4: <div class="head"> 5: <h2 class="itemTitle">[Property context="current" type="content" field="title"]</h2> 6: <div class="rating">Product Rating:[Plugin:ratings]</div> 7: </div> 8: <div class="body"> 9: <div class="itemSummary"> 10: [Element context="current" type="content" key="ImageLg"] 11: </div> 12: <div class="itemBody"> 13: [Element context="current" type="content" key="Details"] 14: </div> 15: </div> 16: <div class="foot"> 17: <div class="tagging"> 18: <div id="tags">[Plugin:tags]</div> 19: </div> 20: </div> 21: 22: <!-- Component Reference --> 23: [Element context="current" type="content" key="Related"] 24: [Element context="current" type="content" key="Complimentary"] 25: </div>
200 of 439
Following is a figure of a content using the product presentation template showing the rating widget and the tagging widget.
201 of 439
directly select these components as required. The WCM Web Content Viewer portlet provides options to select components from WCM for display. It also provides an override function to alter the display based upon an alternative presentation template to the one mapped. For the River Bend site, we create the following presentation templates: Landing Page Events Products
We also illustrate how to pair the authoring template and the presentation template.
8.
202 of 439
Note: To reference a component, the tag result from the Insert Tag button will look similar to [Component name=" Name of the component " /]. You will notice that once you have saved your presentation template, component tags when shown in edit mode will also include an ID reference. This ID is to ensure referential integrity, if removed it will be readded when saved. Note: To reference an element inside the content, the tag result from the Insert Tag button will look similar to [Element context="current" type="content" key=" Name of the field to be referenced " /]. Other Tag such as Property, Style Sheet, URL Path will be similar.
203 of 439
204 of 439
205 of 439
206 of 439
Landing page
For the River Bend landing page we are going to set a Default mapping of the Landing Page authoring template to the Landing presentation template. 1. From the Library Explorer navigate to the authoring templates view. 2. Tick the check-box beside the Landing Page authoring template and click the Edit button. 3. Within the Item Properties section > Default Presentation Template option, using the Select Presentation Template link choose the Landing presentation template.
207 of 439
4.
Click the OK button. The following figure shows applying the default mapping.
5. Click the Save and Close button to apply your default mapping.
Applying a default template mapping may not always be appropriate/required, using the site area to address mapping the authoring templates with presentations templates is an alternative. Using the following steps pair the different templates together at the River Bend site area levels.
208 of 439
4.
5. A list of available authoring templates and presentation templates are displayed as above. 6. In the Authoring Template section choose Event. 7. In the Presentation Template section, choose Event. 8. Click the button, OK. 9. The two templates are displayed as mapped. 10. Click the button, OK. 11. Repeat steps 3 through 10 to create the remainder of the template mappings for the site areas according to the screenshot below. Be sure to select the appropriate site area for each template mapping. 12. Click the button, OK and then the Save and Close button to apply all the mapping.
209 of 439
Note: All children site areas will inherit these mappings unless a further mapping is applied in a lower nested site area using the same authoring template; this overrides any prior maps.
In this section, we describe how to modify the portlet configurations used for presenting content in the River Bend site. The portlets were previously added when the River Bend pages were created from the portal page templates.
210 of 439
The following image shows the first portlet configured with an image component.
The River Bend home page is assembled from 4 or more Web Content Viewer portlets, each portlet configured differently to display content and components as needed. Using the diagrams shown and their specific option selections, configured the portlets using the same steps as outlined above.
211 of 439
212 of 439
213 of 439
214 of 439
Take a look at our featured news items, seasonal products and tasty daily special offers. The default content we use for the Riverbend home page also contains additional elements to include WCM components as part of the content item. Next we will add these components to the content item. 6. In the Post Body Component, click select Component and select the Menu Featured Content item.
Note: When selecting a component item it can be quicker to select your component via the Recent Items (if youve recently edited/view the component) or Favorite links.
7. Click the Save and Close button. In a previous section we created the Riverbend Home page, this was created from a template (Riverbend 3 Portlet Layout), and was also mapped to the corresponding site area called Home to default the context for content. We now need to assign the content we created in the steps above to the Home site area. 8. From the Library Explorer navigate to the Riverbend site area. 9. Tick the site area Home, and click the Edit button.
215 of 439
10. From Site Area Properties section, click the Select Default Content link, choose the Riverbend/Home/Home content item and click the OK button. 11. Click the Save and Close button.
216 of 439
3. Green 4. and Oolong We take these dried base teas and add our own special additive, all natural to offer you a range of over 12 types of tea in store. Our tea making process is a secret but we can tell you it takes a long time to perfect but worth every minute we hope. We know we sell allot of tea, but did you know that production of tea is over 3 million tonnes per year with both China and India being the largest producers. Site area: Riverbend/Products/Food and Snacks Field / Element Name: Display title: Description: Body: Content FoodHome Home Default content and landing page for Food and Snacks site area Hot or Cold you can't beat our food and snacks made by Riverbend staff in store.
Baked by our master bakers in country the bread for our sandwiches doesn't travel far to be married up with locally sourced ingredients. Whether it's Eggs, cold meats or salad, our sandwiches are made with ingredients produced and farmed locally to the store. Making our own sandwiches in store with locally prodyuced ingredients not only saves the environment, but also means they taste great and are fresh too.
If youre not in the mood for a sandwich, then we have plenty of cakes available too, why not try a delicious Orange cake, Carrot cake or even our fabulous Chocolate cake. We also make speciality cupcakes, different in every store and every week, something a little lighter and fun. Just take a look at what we have to offer in store to go with your Tea, Coffee of soft drink. Site area: Riverbend/AboutUS/History Field / Element Name: Display title: Description: Body: Content HistoryHome Home Default content and landing page for Food and Snacks site area The River Bend Tea & Coffee company has not always been as big as it is today, when John Bergland set up the business
217 of 439
back in 1971 it was running from his home with 1 employee, himself. Back then John used his families experience roasting coffee to give a unique flavour & texture to the beans his coffee was made from. John just sold coffee then, today things are different. Today the River Bend products are in demand by our customers, we still use the same family style of roasting but we've also gone back through the family archives to adopt the same values across our entire product range. River Bend strives to ensure the best experience in store with the best true Italian style and quality coffee & teas. Unlike many other coffee companies and stores we make many of our products, tea and coffee included on site in our stores. This means you get the best and we save costs and the planet at the same time. Site area: Riverbend/AboutUS/Careers Field / Element Name: Display title: Description: Body: Content CareersHome Home Default content and landing page for the careers site area During the next 12 months River Bend will be opening 24 new stores across the UK, USA, Europe and India. If you feel that you have what it takes to work at River Bend and want to join a growing, fun and exciting team then we urge you to get in touch. All our stores will have openings for, Delivery Agents, Store Staff and Management including Cleaners and Security. River Bend is working in partnership with local recruitment offices close to the new store planned below: UK West Chiltington, West Sussex Cheam, Surrey Staines, Middlesex Fulham, London London, City (3 stores) Europe Berlin, Germany (3 stores) Barcelona, Spain (2 stores) St. Omer, France USA Westford, MA Cambridge, MA Rochester, NY (2 stores) Samford, CT (3 stores) Orange County, NY India Bangalore o Delhi
218 of 439
Site area: Riverbend/Community/Events Field / Element Name: Display title: Description: Body: Content EventsHome Home Default content and landing page for the events site area At Riverbend we love events, so much we make sure every store is an integral part of your local community. Making the most of what good in around your store and our products & services. Take a look through our event schedule.... [Component name="Riverbend/DefaultArticleText"]
219 of 439
Small Image:
CappuchinoTn.jpg
Site area: Riverbend/Community/Events Field / Element Name: Display title: Description: Start Date: End Date: Location: Body: Content TeaTuesdays Tea Tuesdays Flavoured Tea giveaway with every drink purchased. October 03, 2011. 11am October 31, 2011. 11pm Raleigh, NC. United States We love our flavoured Teas at Riverbend, and we think you will to if you try them. Throughout October we are giving you a new takeaway flavoured Tea sachet with every drink purchased, With over 8 different types of Tea in store we think there is one you'll just love. Why not try our: Jasmine Pepermint Lemon Herbal Green Remember it's throughout October only, so come on Tea lovers. Enjoy Large Image: Small Image: FlavouredTeaLg.jpg FlavouredTeaTn.jpg
Site area: Riverbend/Community/Events Field / Element Name: Display title: Description: Start Date: End Date: Location: Body: Content CommunityDays Community Days Helping the young in the community. September 12, 2011. 11am December 23, 2011. 11pm Hamilton, New Zealand. Riverbend believes that the future of our planet lies with the young people in our community.
Every Riverbend store and employee strives to find innovative ways to help their communities grow, and we are behind them in doing this. Our employees have committed over 1,000 hours of community help which is a great achievement in a short space of time.
220 of 439
If you work with the young people in the local community, bring with your Raleigh Community Card next time your in the store and we will give you and extra shot of coffee to keep you going, or if you like your Tea complimentary snack. Enjoy Large Image: Small Image: CommunityLg.jpg CommunityTn.jpg
Site area: Riverbend/Recipes Field / Element Name: Display title: Description: Recipe: Content RecipeChocolateCake Chocolate Cake Deep and rich chocolate cake made with 60% coco. Chocolate Cake.pdf
Site area: Riverbend/Recipes Field / Element Name: Display title: Description: Recipe: Content RecipeBerrySpongeCake Berry Sponge Cake Soft and creamy sponge with a sweet all natural berry sauce, topped with vanilla icing. Berry Sponge Cake.pdf
Site area: Riverbend/Recipes Field / Element Name: Display title: Content RecipeCitrusCarrotCake Citrus Carrot Cake
221 of 439
Description: Recipe:
Zesty carrot cake, filled with a citrus cream filling. Citrus and Carrot Cake.pdf
Site area: Riverbend/Recipes Field / Element Name: Display title: Description: Recipe: Content RecipeLemontCake Lemon Cheese Cake The best deep filled lemon cheese cake made from all natural ingredients. Lemon Cheese Cake.pdf
222 of 439
something special. Large Image: Small Image: Complimentary Items: Related Items: CeylonTea.jpg
Site area: Riverbend/Key Products Field / Element Name: Display title: Description: Body: Content ChaiCaffeCreme Chai Caffee Creme Spoil yourself with a rich and intense Ceylon tea. We know that every now and then your Caffe Americano doesnt hit the spot, or your usual Late is lacking that something. Our twist on the Swiss style long twice brewed espresso is just right for that moment, Something different for when you need that change.. you never know you may not change back. Large Image: Small Image: Complimentary Items: Related Items: ChaiCaffeeCreme.jpg
Site area: Riverbend/Key Products Field / Element Name: Display title: Description: Body: Large Image: Small Image: Complimentary Items: Related Items: Content CaffeAmericano Caffe Americano Rich, dark and moody. Something to give you a little boost, our darkest shot of expresso with piping hot water will hit the spot every time. CaffeAmericano.jpg
223 of 439
CaffeLatte Caffe Latte Double-shot Caff Latte to kickstart the day. If it's a hot or cold day sometime you need to give yourself a little kickstart, a Caff Latte double-shot is what you need.
We take very hot and pure steamed milk, 2% or semi skimmed and infuse it with a double-shot of our finest roasted coffee ground and brewed in store.
If you want something more, feeling sweet then why not add a drizzle of Caramel or Chocolate. Large Image: Small Image: Complimentary Items: Related Items: CaffeLatte.jpg
Site area: Riverbend/Home/AboutUs/Locations Field / Element Name: Display title: Description: Content InStore In Store Card How to get the most from your store card.
224 of 439
[Component name="Riverbend/DefaultArticleTextWithList"]
Site area: Riverbend/Links/Nutritional Information Field / Element Name: Display title: Description: Link: Content LinkstoStoreCard Links to Store Card Using the Riverbend store card. Riverbend/Riverbend/Home/About Us/Products/What's in our Products
225 of 439
226 of 439
7. In the Type of Page section make sure Standard Portal Layout property is selected (default value). 8. Click OK. 9. In the list of pages, navigate to your created page. 10. Select the Edit Page Layout icon (see the figure below).
In the left column of the window, click Add Portlets. In the Search window, type WCM and click Search. In the returned portlet list, select WCM River Bend Navigator. In the right column, click Add Portlets. In the Search window, type WCM and click Search. Select WCM River Bend. Click OK and click Done. In the Search window, type River and then click Search. 19. Find the River Bend Coffee and Tea page and click the Mark icon.
20. Click on Select Page, click on Content Root, click on Administration, click on WebSphere Portal. 21. Click on the Move button. Now, the page has been moved under Administration and could be accessed from the left navigator.
227 of 439
This section explains how security works in WCM, and how to set up the River Bend site security.
Overview of security
WCM security is based on portal security which provides a module called Virtual Member Manager (VMM). VMM is capable of managing multiple LDAPs and databases for a single portal instance. Portal security provides utilities to create, update, and delete users and groups through the administration interface. Permissions are organized using a tree-like structure. You start by defining a general permission set for all libraries at the IBM JCR repository, refining them for every type in the library (such as components and authoring items), for each item type and finally item by item. By default, access levels are propagated and inherited by using the hierarchy shown in the following figure.
228 of 439
Note: Access control delegation can be applied at a portal page level.This provides the View access to all items on the page (including content), and overrides what has been set elsewhere. AC delegation can be set during page creation (or afterwards) via the administrative interface. The following figure shows access control delegation during the page creation step.
The following figure shows access control delegation during the page edit (after creation) step.
Propagation and inheritance of permissions can be stopped at any level of the tree showing in the security hierarchy. The security levels are based on portal roles. For library security there are five levels: User Cntributor
229 of 439
Editor Manager
Administrator.
Item security has four security levels: User Contributor Editor Approver.
Library security
With library level security, you can establish a common set of permissions that are refined later. Library security is based on portal roles as defined in the following table. Roles User Rendering and authoring portlet access rights Users and groups assigned to this role can: View items in a website or rendering portlet that they have been assigned at least user access to.
Note: The simplest way to assign users to this role is to select any of the default user groups such as "All Authenticated Portal Users" or "Anonymous Portal User". Users will still require "user" access to an item before it will be rendered in a website or rendering portlet. Contributor Users and groups assigned to this role can: Have all user's access right (as described above). View libraries the they have been assigned contributor access to in an authoring portlet. Access the "My Items" and "All Items" views in an authoring portlet for libraries that they have been assigned contributor access to. Access the item type view within the authoring portlet for item types that they been assigned at least user access to. Users and groups assigned to this role can:
Editor
230 of 439
Have all contributor's access rights (as described above). For library item types that user and groups have been assigned at least editor access to, editors can also access the following actions in the authoring portlet: - Create a new item. - Add or remove links. - Apply authoring template. - Copy, delete, edit, link to, and move item type. - Restore a version. - Edit version labels Users and groups assigned to these roles can:
Manager
Have all editor's access rights (as described above). For library item types that they have been assigned manager access to, managers can also perform the following actions in the authoring portlet: - Edit access settings. - Edit next stage. - Purge. - Unlock. - Edit user profile. Users and groups assigned to these roles can:
Administrator
View items in a rendering portlet or servlet-rendered website that they have been assigned at least user access to. View libraries the they have been assigned contributor access to in an authoring portlet. Access the "My Items" and "All Items" views in an authoring portlet for libraries that they have been assigned at least contributor access to. All actions in the authoring portlet for library item types that they have been assigned administrator access to. These roles have no access to WCM items.
To render WCM objects, a user must be granted at least the User role on the library itself, as described above. For details of this requirements, and up to date information, refer to the IBM Portal Wiki, WCM documentation.
231 of 439
areas under the top level, and finally several child site areas under these. See the figure below.
With this security requirements, River Bend has prepared a permission matrix. For every
232 of 439
site area (e.g. Home, Products), there are three table rows shown for readers, editors, and approvers permissions. For simplification, we use the following abbreviation in the table below: RB-Authors - riverbend_ContentAuthors RB-Approvers - riverbend_ContentApprovers (riverbend_ContentApproversHQ, riverbend_ContentApproversHR, riverbend_ContentApproversLegal RB-StoreMgr - riverbend_ContentCreatorsStoreMgr (riverbend_ContentAuthorsStoreMgr) RB-Ops - riverbend_ContentCreatorsOps RB-Marketing - riverbend_ContentCreatorsMarketing DRAFT HOME Author RB-StoreMgr Authors Joint approval from: RB-Approvers RB-Approvers APPROVAL Author RB-Approvers PUBLISH All users EXPIRED RB-Approvers REJECT Author
Autor RB-Approvers
All users
RB-Approvers
Author
Joint approval from: RB-Approvers RB-Approvers Author RB-Approvers All users RB-Approvers Author
ABOUT US COMMUNITY
LINKS RECIPES
No workflow
233 of 439
Authors and Approvers will have contributor access as shown in the following figure.
User permissions are inherited. Contributor permissions are established at the next level, library resources.
234 of 439
Library resources
When a user accesses the Library Explorer, several views are available to access item types managed by WCM, such as authoring templates, components, or content. In a production systems, not all user groups need to access every WCM feature. Therefore, the next level in the permissions hierarchy is the management of access to these item types.
235 of 439
1. Item level security management depends on whether the item has a workflow: Administrator security settings are provided for every item. If the item has a workflow, effective security settings are the combination of inheritance, administrator, and current workflow stage security settings. If the item does not have a workflow, effective security settings are the combination of inheritance, administrator, and user security.
Security settings can be batch processed through the Library Explorer. Every item includes a security section to read. Edit these permissions as shown in the following figure.
The columns displayed in this table depend on whether the item is under a workflow: Workflow items display the administrator defined, workflow, and inheritance. Workflow settings depend on the current workflow stage and cannot be edited. Non-workflow items display the administrator defined, user defined, and inheritance.
Note: Administrator defined permissions do not depend on the current workflow stage. Defined below are the security permissions set to manage who can create content in areas of the River Bend website, these are set in the Properties tab of the site area.
236 of 439
Content elements
It is possible to filter who sees a specific content element for reading or editing, for example an image element on the Products authoring template. At River Bend this level of access is not needed at present, however this is a useful level of security to restrict editing (or reading) of elements on a content item by different user groups or departments.
237 of 439
To set this level of permissions if required, open in edit mode the default content settings of the authoring template. Expand the content element, click the field properties icon , and select the Editors or Viewers you require as shown in the figure below.
238 of 439
The remote rendering portlet (now deprecated) is used to communicate with another WCM server to render its content. The remote rendering portlet can use either LTPA or Credential Vault Slot to transfer user identity: LTPA Token: Exported from one server and imported to the other; current user credentials used Credential Vault Slot: Stored specific value to use for all users accessing the portlet
Note: It is important to note that remote rendering portlet is still available if required but has been replaced. WSRP (Web Services Remote Portlets) should be used against the local Web Content Viewer (JSR 286) portlet.
Workflows are assigned by site designers to one or more authoring templates. Workflows have access permissions so content authors can choose from any of the visible workflows assigned to the current authoring template. This section explains how workflow works in WCM and how to create both a basic workflow and a custom workflow for the River Bend site.
239 of 439
Note: As mentioned previously, workflows have their own security setting which can be used to manage alternative ways to publish the same content. The River Bend site designers use this feature to restrict the use of express publishing to the contentWFExpressUsers group. These users can short-cut the content publishing processing when dealing with exceptions.
Item status
An items status, typically content, controls whether it is visible in the website. A WCM "workflowed" item has three states: Draft - The item is not published yet and is not available on the live website. Publish - The item is published and thus is available on the live website. Expired - The item is no longer published.
A WCM "non-workflowed" item, or one that has no workflow defined has only one state, which is published . Note: When progressing through a workflow, item status can only change in a linear fashion: Draft to published to expired Published to expired Draft to published
Stages
Stages represent a step in the overall workflow process. With the use of stages, site designers can define the actions that will happen with a content and the necessary conditions (approvals) from the time it is created to the time it expires:
240 of 439
Workflows can have one or more stages. Content states happens when a content item reaches a new stage.
More actions can be performed when an item enters or leaves a stage: Workflow stages determine the content security for a particular stage. (Do not confuse this with the security of the stage itself.) Setting approve access is only available through the workflow stage. Such options as "Joint approval" and "Enter comment on approval" are set in the workflow stage. (Enter comment on approval can be across the workflow.)
Approval
User: [authors], riverbend_ContentApproversHR, riverbend_ContentApproversHQ, riverbend_ContentApproversLegal Contributor: Editor: Manager Approver(*): riverbend_ContentApproversHR, riverbend_ContentApproversHQ, riverbend_ContentApproversLegal *= joint approval
Publish
User: [anonymous portal user], [all authenticated portal users] Contributor: Editor: Manager Approver: riverbend_ContentApproversHR, riverbend_ContentApproversHQ, riverbend_ContentApproversLegal
This is the stage where content from the workflow is published. A workflow custom action generates a thumbnail from an existing image for Products and News. The Publish action is triggered and the content is visible on the website. The Scheduled Move action is also triggered
241 of 439
when the Expire Date is reached Expired Expired User: Contributor: Editor: Manager Approver:riverbend_ContentApproversHR, riverbend_ContentApproversHQ, riverbend_ContentApproversLegal, riverbend_ContentCreatorsMarketing, riverbend_ContentCreatorsOps, riverbend_ContentCreatorsStorMgr User: Contributor: Editor: [authors] Manager Approver: The Scheduled Move action moves the content into this stage, where the Expire action stops the document from being visible on the website
Reject
Rejected content reaches this stage. Authors are able to create a new draft from the rejected content.
Actions
Workflow actions can be triggered when an item enters or leaves a workflow stage. WCM provides several types of actions that you can extend by writing your own action, packaging them as EAR or JAR files: Scheduled move action: Used to move workflow items to the next stage based on date E-mail action: Used to e-mail users when an item reaches the stage State change actions: Change the item state to publish or expire Version actions: Create a new version of the item when this action is executed Scheduled move action: Moves an item to the next workflow stage at a specified date and time Custom actions: Allows the ability to create new actions by using Java code and packaging them as EAR or JAR files
Expired E-mail for Schedules the move of any items that meet the defined expiration rejected date Generate thumbnail Creates a thumbnail image for use in menus (and other components) by using a Java-based custom action
242 of 439
Additional actions are required. Use the steps 2 to 4 above, create the actions outlined below: Action Email for rejected Content Expired Move content on expiry date Generate thumbnail Action Type Email Action Expire Action Scheduled Move Action Custom Action
For the "Move content on expiry date" select Expiry Date from the Date Type list and choose an appropriate date to see this action, for example tomorrow's date. For the "Email for rejected Content", select E-mail authors. E-mail Stage Approvers is selected by default. Add an apology message in Additional e-mail text.
243 of 439
244 of 439
Several options are available to do this. The site designer has decided to implement a custom workflow action that reads the product image, generates a reduced image using Java APIs, and saves the new image as part of the content item before it is published. Using this approach introduces an automated process where previously this would have been a manual task.
245 of 439
To use custom workflow actions: 1. Developers create a new Dynamic Web project.
2. After the project is created, they add three classes: com.ibm.itso.redwiki.wcm.wf.Thumbnail - This is a utility class for scaling images. com.ibm.itso.redwiki.wcm.wf.CWFAction - This class holds the actual action. It should implement the CustomWorkflowAction interface. com.ibm.itso.redwiki.wcm.wf.CWFActionFactory - This class manages the creation of action instances. It should implement CustomWorkflowActionFactory interface.
246 of 439
Thumbnail.class
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: package com.ibm.itso.redwiki.wcm.wf; import java.awt.*; import java.awt.geom.*; import java.awt.image.*; import java.io.*; import javax.imageio.*; public class Thumbnail { public static byte [] scale( byte [] data, int width, int height) { // Get system temp String tmp = System. getProperty ( "java.io.tmpdir" ); String src = tmp + "/" + new java.util.Date().getTime() + "_in.jpg" ; String dest = tmp + "/" + new java.util.Date().getTime() + "_out.jpg" ; // Temporay file names File srcFile = new File(src); File destFile = new File(dest); // Generate temporary file for input FileOutputStream fs; try { fs = new FileOutputStream(src); fs.write(data); // Convert byte array to buffered image BufferedImage imgSrc = ImageIO. read (srcFile); BufferedImage imgDest = new BufferedImage(width, height, BufferedImage. TYPE_INT_RGB ); Graphics2D g = imgDest.createGraphics(); AffineTransform at = AffineTransform. getScaleInstance ( ( double ) width / imgSrc.getWidth(), ( double ) height / imgSrc.getHeight()); g.drawRenderedImage(imgSrc, at); // Generate result image ImageIO. write (imgDest, "JPG" , destFile); InputStream is = new FileInputStream(destFile); // Convert result image to byte array long length = destFile.length(); // Will hold resulting byte array byte [] result = new byte [( int ) length]; if (length < Integer. MAX_VALUE ) { // Read in the bytes int offset = 0; int numRead = 0; while (offset < result. length && (numRead = is.read(result, offset, result. length - offset)) >= 0) { offset += numRead;
247 of 439
49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62:
} // Close the input stream and return bytes is.close(); } // Delete temporary files srcFile.delete(); destFile.delete(); return result; } catch (Exception e) { e.printStackTrace(); } return null ; } }
CWFAction.class
1: 2: package com.ibm.itso.redwiki.wcm.wf; 3: import java.util.Date; 4: import javax.naming.InitialContext; 5: import javax.naming.NamingException; 6: import com.ibm.workplace.wcm.api.Content; 7: import com.ibm.workplace.wcm.api.Document; 8: import com.ibm.workplace.wcm.api.ImageComponent; 9: import com.ibm.workplace.wcm.api.WebContentCustomWorkflowService; 10: import com.ibm.workplace.wcm.api.custom.CustomWorkflowAction; 11: import com.ibm.workplace.wcm.api.custom.CustomWorkflowActionResult; 12: import com.ibm.workplace.wcm.api.custom.Directive; 13: import com.ibm.workplace.wcm.api. custom .Directives; 14: import com.ibm.workplace.wcm.api.exceptions.AuthorizationException; 15: import com.ibm.workplace.wcm.api.exceptions.ComponentNotFoundException; 16: import com.ibm.workplace.wcm.api.exceptions.IllegalTypeChangeException; 17: import com.ibm.workplace.wcm.api.exceptions.OperationFailedException; 18: import com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException; 19: public class CWFAction implements CustomWorkflowAction { 20: public CustomWorkflowActionResult execute(Document arg0) { 21: Directive directive = Directives. CONTINUE ; 22: String message = "Action succesfully executed" ; 23: if (arg0 instanceof Content) { 24: // Get current image 25: try {
248 of 439
26: Content wcmItem = (Content) arg0; 27: // Get image element 28: ImageComponent bigImage = (ImageComponent) wcmItem 29: .getComponent( "Image" ); 30: // Check if there is an attached image 31: if (bigImage.getImageFileName()!= null ) { 32: // Get image bytes 33: byte [] arrImg = bigImage.getImage(); 34: // Scale it 35: byte [] arrImgTmb = Thumbnail. scale (arrImg, 100, 50); 36: // Load new image 37: ImageComponent thumbnail = (ImageComponent) wcmItem 38: .getComponent( "Thumbnail" ); 39: thumbnail.setImage( "tmb_" + bigImage.getImageFileName(), 40: arrImgTmb); 41: // Put new width and height 42: thumbnail.setWidth( "100" ); 43: thumbnail.setHeight( "50" ); 44: wcmItem.setComponent( "Thumbnail" , thumbnail); 45: } 46: } catch (ComponentNotFoundException e) { 47: // Dont rollback if a component is not found 48: directive = Directives. CONTINUE ; 49: message = "Image or thumbnail element not found" ; 50: } catch (AuthorizationException e) { 51: directive = Directives. ROLLBACK_DOCUMENT ; 52: e.printStackTrace(); 53: message = e.getMessage(); 54: } catch (PropertyRetrievalException e) { 55: directive = Directives. ROLLBACK_DOCUMENT ; 56: e.printStackTrace(); 57: message = e.getMessage(); 58: } catch (OperationFailedException e) { 59: directive = Directives. ROLLBACK_DOCUMENT ; 60: e.printStackTrace(); 61: message = e.getMessage(); 62: } catch (IllegalTypeChangeException e) { 63: directive = Directives. ROLLBACK_DOCUMENT ; 64: e.printStackTrace(); 65: message = e.getMessage(); 66: } 67: } 68: WebContentCustomWorkflowService webContentCustomWorkflowService = 69: null ; 70: try {
249 of 439
71: 72: 73: 74: 75: 76: ); 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91:
// Construct and inital Context InitialContext ctx = new InitialContext(); // Retrieve Custom Workflow Service webContentCustomWorkflowService = (WebContentCustomWorkflowService) ctx .lookup( "portal:service/wcm/WebContentCustomWorkflowService" } catch (NamingException ne) { // Exception retrieving Service ne.printStackTrace(); return null ; } // Create a result object CustomWorkflowActionResult result = webContentCustomWorkflowService .createResult(directive, message); return result; } public Date getExecuteDate(Document arg0) { return DATE_EXECUTE_NOW ; } }
Note: It is not necessary to save the current content item in the action. Directive. CONTINUE will do that for you.
CWFActionFactory.class
1: 2: package com.ibm.itso.redwiki.wcm.wf; 3: import java.util.Locale; 4: import com.ibm.workplace.wcm.api.Document; 5: import com.ibm.workplace.wcm.api.custom.CustomWorkflowAction; 6: import com.ibm.workplace.wcm.api.custom.CustomWorkflowActionFactory; 7: public class CWFActionFactory implements CustomWorkflowActionFactory { 8: public CustomWorkflowAction getAction(String arg0, Document 9: arg1) { 10: if (arg0.equalsIgnoreCase( "generate_thumbnail" )) { 11: return new CWFAction(); 12: } 13: return null ; 14: } 15: public String getActionDescription(Locale arg0, String arg1) { 16: return "Generates a thumbnail from existing content" ; 17: } 18: public String[] getActionNames() { 19: String names[]={ "generate_thumbnail" };
250 of 439
20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35:
return names; } public String getActionTitle(Locale arg0, String arg1) { if (arg1.equalsIgnoreCase( "generate_thumbnail" )) { return "generate_thumbnail" ; } return null ; } public String getName() { return "CWFActionFactory" ; } public String getTitle(Locale arg0) { return "ITSO WCM 6.1 Redwiki Custom Workflow Action Factory" ; } }
Finally, River Bend developers created the configuration file that registered the action in WCM by creating a new empty file under WEBINF, called plugin.xml with this content: 1: <?xml version="1.0" encoding="UTF-8"?> 2: <plugin id= "com.ibm.workplace.wcm.api.custom" name= "Sample Custom Workflow Action Factory" version= "1.0.0" provider-name= "IBM" > 3: <extension-point id= "CustomWorkflowActionFactory" name="CustomWorkflowActionFactory" /> 4: <extension point="com.ibm.workplace.wcm.api.custom.CustomWorkflowActionFactory" id= "SimpleCustomWorkflowActionFactory" > 5: <provider class= "com.ibm.itso.redwiki.wcm.wf.CWFActionFactory"/> 6: </extension> 7: </plugin>
251 of 439
Configuration
To make the action available for content creators, River Bend developers created a custom workflow action in the same way than any other action. From the Library Explorer interface, using the New button, Workflow > Actions > Custom Action) with the following configuration:
252 of 439
3.3.3. Using collaborative editing tools - Versioning, link management, and locks
This section describes the collaborative editing tools features including versioning, link management, and locks.
Using versions
Content authors, and site designers can follow changes that have occurred to specific items using version control, for example changes to a content item, or updates to an Authoring Template. Additionally, site administrators can also employ version control at a library level. Items that have already been versioned can be saved and restored by Date range or identified Label.
Library versioning
Using library versioning, site administrators can group the items within a library by Label or Date & Time. River Bend administrators use this functionality to create a baseline of the first version of the website as shown in the following figure:
1. Open the Administration page, and navigate to Portal Content and then Web Content Libraries. 2. Click on the button (Additional tasks) for the River Bend library. 3. Click on the button to create a Version Label.
253 of 439
The following figure shows the baseline version of the River Bend library.
The library version is created in the background. You see the status in the Additional Tasks page after applying a label to all the current versioned items in the library as follows:
Additionally, further detail is provided by clicking on the button to view a report of the versioning status (system report for Label All Items) as shown below.
254 of 439
If something goes wrong, the River Bend administrators can rollback to previous versions of Items, selected by Label. Additionally, if needed, site administrators can specify default restore options for non-existing items as shown below.
255 of 439
Note: A library cannot be restored while any Items are currently locked or checked out. Before restoring a library, as an administrator you must view all published Items in the library, unlocking any items marked as checked out or locked.
Item versioning
The behaviour you see when using the versioning capabilities in the Library Explorer can be configured at a global level. You define and manage these authoring options in the WCM WCMConfigService service using the IBM WebSphere Application Server administration console. Global versioning strategy is defined in WCMConfigService. These options are available: versioningStrategy.Default = always | never | manual versioningStrategy.AuthoringTemplate = always | never | manual versioningStrategy.Component = always | never | manual versioningStrategy.Content = always | never | manual versioningStrategy.PresentationTemplate = always | never | manual versioningStrategy.Site = always | never | manual versioningStrategy.Taxonomy = always | never | manual versioningStrategy.Workflow = always | never | manual
256 of 439
The following values specify version control settings for the WCMConfigService described above: always - A version is saved every time a non-workflowed item is saved, or every time a workflowed item is published. manual - Versions will only be saved when a user with at least editor access chooses to save a version. This setting causes the following changes in the interface: The Save Version button is available in the read mode of non-workflowed items and in workflowed items in the published state. The Save and Version button is available in the edit mode of nonworkflowed items and in workflowed items in the published state. never - Disable version control for an item type.
If a version control strategy is not defined for an item type, then the version control strategy specified in by the versioningStrategy.Default property is used. Again the values above should be used to provide a default if required.
Setting Configured default will use the version actions in the versioning strategy properties we set previously.
257 of 439
Note: When you define your workflow stage, you must put Version actions after a Publishing action. You will be prompted if this is missed.
Links management
The View References feature shown below helps authors to keep track of and manage all the links between items.
The River Bend authors can view the references From the Home default content item to other items within the site, additionally using the Show: drop down box authors can see references to this item. The feature is very useful to understand the impact a change, or deletion might have on other items in the site.
258 of 439
Locks
As River Bend authors contribute their content into the site, sometime they may find their items are locked by other users. This happens either because they are being edited by another user who has access, or a draft item has been created. The following figure shows an item being locked by another user.
259 of 439
For site designers, WCM provides the ability to preview other items such as templates, site areas, and components. Previewing options are controlled by the River Bend administrators using the Library Explorer preference settings. Select Allow Authors to preview content in local portal pages. Select specific portal pages from the list. The selected portal pages must contain a Web Content Viewer portlet. To allow users to preview pages using the WCM servlet engine (as a stand-alone web page), select the Preview content in a Web page, option. Note: When using a rendering portlet to preview content, the rendering portlet should be configured to receive links from "Other Portlets and This Portlet". Otherwise the preview will not work. The River Bend website is built using both content from WCM and Portal components, as such authors preview content using Portal pages.
260 of 439
Note: Portal administrators can define several pages for previewing content. Those pages can have different navigation themes to allow authors to preview how content will display in different sites such as River Bend's public website and River Bend's intranet.
261 of 439
Open the content item directly in read mode, click the Preview button. The following figure shows preview from a piece of content.
262 of 439
If there is more than one previewing option, the browser shows a dialog box to allow the author to select where the content should be previewed. See the following figure.
If the author chooses Preview as a Web page, a new browser window that shows a preview of how the selected content will be displayed. Note: If the styling and formatting of the item being previewed is not reference by that item directly, they styling will be missing. This occurs for example when a content item that is previewed as a webpage isolation, but is actually published through a portal page normally. In this situation the styling and formatting references to CSS will be in the Head section of the Theme.
In the case of River Bend, a simple personalization rule and example is implemented to better illustrate the concept. The personalization rule that is implemented is based on dates. If the date the site is accessed is within a range of defined "summer dates", then the home page illustrates a summer-based image of a refreshing iced coffee drink as shown in the following figure. If the date the site is accessed is within a range of defined "winter dates", then the home page illustrates a winter-based image of a hot coffee drink.
263 of 439
264 of 439
Binding rule - Ties the profile and select rules together. Premium users see PremiumOffers, gold customers see GoldOffers, and non-manager employees see NonManagement news. You do not have to coordinate the naming of the profile with the select rule name. However, this convention helps when creating the binding rule.
Any of these rules can be tied to a content spot. To enable your environment to construct these rules, you must install and configure personalization in Web Content Manager.
3. 4. 5. 6. 7.
8.
Select New > Rule. Enter a name for the new rule (for example, Get WCM Content). Leave rule type to be Select Action. Select Web Content as the Resource Collection. Select River Bend as the Location (site area). Select the Authoring Template Locations from the Personalization Picker and the resulting rule is shown in the figure below.
265 of 439
9. Click Save. 10. To show the content returned from this rule, select the Preview tab, as shown in the figure below.
This personalization rule can now be displayed in a Personalization List Portlet, referenced in an WCM component, or included within a Content Spot on a Portal page.
266 of 439
There are two configuration modes: One that configures the Spot information. One that configures the Display Options.
In order for these options to be displayed: 1. On the Personalized List Portlet Menu, select Configure and the following screen is displayed.
267 of 439
2. Click the drop down that says Nothing Selected and you are provided with the following option, as shown in the figure below.
3. Pick the Select content rule that you had created earlier and the following screen is displayed, as shown in the figure below.
To configure the display settings for Personalized List Portlet, do the following: 1. Click Display Options. 2. Choose the Fixed Title attribute for the Title Attribute and choose the Fixed Description attribute for the Detail Attribute. 3. Select 'Locations' for the Categorization Attribute. This groups the content under the site area structure. 4. Click OK .
268 of 439
When you select a title, you get the detail attribute displayed for that title. Note that this list does not use the site area and presentation template to render the content. Instead, it uses just the attribute that you defined in the Portlet configuration. Only Select rule, Binding rule, content spots and custom JSP that has a content spot can be verified using Personalized List portlet. Profiler rules cannot be tested using this portlet.
269 of 439
selected and the image will be displayed. In order for us to create the Personalization component, we need to do the following steps: 1. 2. 3. 4. Create select action rules. Create profiler rule. Create binding rule. Create Personalization Component.
The Portal Personalization engine (often referred as PZN) is composed of five components: Personalization browser Rules engine LikeMinds recommendation engine Resource engine Logging framework
270 of 439
Personalization browser
The Personalization user interface is a portal based application where authorized users: Register resource collections Author rules, campaigns, and content spots Map rules into content spots for a particular campaign
Rules engine
The rules engine evaluates rules created in the Personalization browser. In a portal environment, there are different ways to invoke rules. Personalization rules may be invoked through the personalized list portlet and presented as a list of text and links. The WCM personalization components allow you to invoke a selection rule or content spot and format the results by using WCM tags. Hide rules associated with pages or portlets through portal administration are automatically triggered when a user navigates a portal page.
Resource engine
The resource engine resolves the queries produced by rules into content pieces to be returned. Content for personalization is created using whatever content management tool you choose, or may come from an LDAP or any other database. Content is accessed via a set of Resource Collection classes.
271 of 439
Logging framework
The logging framework is used to record information about website usage to the feedback database and the recommendation engine. It is entirely up to the site developers to decide what information is logged.
Recommended products
In this kind of campaign, there are two sets of content related to coffee and tea products. Marketing department wants to run a campaign in the home page to promote coffee and tea equally by splitting coffee and tea related information equally among visitors. On first request, the view of the portlet is shown by the left figure (first recommendation). If the user logs in again, the view of the portlet changes to show the second campaign item shown on the right figure (second recommendation).
272 of 439
First recommendation
Second recommendation
Their display needs to be divided in an equal ratio. Therefore, for one request to the website, content 1 is displayed and for the next request, content 2 is displayed.
Personalized content
This second scenario shows personalized content based on location of the registered users. Based on a location attribute filled in on the registration page of the registered user, the location specific content is delivered in the "Campaign" portlet in the homepage. Here the left figure (Spain content) shows the portlet seen by the user from Spain. Assume we sign up a new user with CountryName attribute as India. Upon logging in by that user, the right figure (India content ) shows the portlet by the Indian user.
273 of 439
Spain content
India content
3.5. Internationalization
When addressing the requirements to deliver content across multiple languages it is important not only to focus upon the resulting content itself, but also the authoring of that content. Ensuring the content authoring environment is available in the local language is an important step to removing any barriers to the content creation process. To address both of these requirements typically seen within organizations IBM Web Content Manager (WCM) provides the following: Text Providers Multi-lingual Solution (MLS)
274 of 439
See the javadoc for further information. In addition to the WCM API .textprovoider interface, the methods inherited from com.ibm.portal.Localized must also be implemented. public String getTitle(Locale displayLocale) {} This method returns the title for the text provider that will be used to allow selection of the text provider. public ListModel getLocales() This method returns a list of locales that are supported by this text provider. public String getDescription(Locale p_arg0) This method returns a description of the text provider.
Further information for developing text providers can be found on the IBM Portal Wiki.
275 of 439
Workflows which coordinate the lifecycle of content items and their translations. Authoring template extensions to simplify the creation and navigation between translated content items. Site template tools for self-service creation of new sites. Notification system which informs content authors and translators when items need translating and retranslating due to changes to one of the translations. A recommendation capability which informs site owners when new content items are created and enables them to include the content item on their site at the click of a button.
Further information on the MLS solution can be found on the IBM Greenhouse Business Solutions Catalogue.
276 of 439
3. Enter in RiverbendCollection for the location, name, and description fields. Ensure the Summarizer is set to Automatic. See the setting below. Click OK. Note: For the location field, if you do not give a full path, portal will store the data in a predetermined directory (wp_profile/PortalServer/collections).
4.
Click on the RiverbendCollection name to go into the details. There are no content sources yet. Click on New Content Source as shown in the figure below.
277 of 439
5. When creating the new content source, in the drop down select WCM site.
6. In the content source fields, enter the following information: Content Source Name: TopLevelSite Collect documents linked from this URL: http://host:port/seedlist/myserver?SeedlistId=Riverbend/Riverbend&Source=com.ibm .workplace.wcm.plugins.seedlist.retriever.WCMRetrieverFactory&Action=GetDocume nts Level of links to follow: 5 levels Number of documents to collect: unlimited Force complete crawl: checked Stop fetching a document after(sec): 20 See figure below for the setting. Note regarding URL: You are entering in a URL to the seedlist capability of the portal server. When you pass the SeedlistId, you tell the seedlist to get all the content under the Riverbend library in the Riverbend SiteArea. Finally, the source for the seedlist is passed to tell the server to use the WCM seedlist generation capabilities.
278 of 439
7. Leave the rest of the values. Click on the Security tab. In the Define Security Realm, enter in the admin username and password. For the Host Name, enter the host name for your portal. Click the Create button.
8. After creating the security realm, click on the Create button at the bottom of the form.
279 of 439
Once the crawl is complete, we will still have to wait until the indexed documents are available. Here's an example of a search collection that has available content indexed:
280 of 439
Riverbend site framework. However, we can show how the pages will be created in the general case.
4.
In the form, for the title and friendly URL name, enter RiverbendSearchResults, From the Page Template drop down, select Sample Web Content Page Template. This will cause a WCM JSR286 portlet to be automatically deployed on the page. In the Web Content Mappings, choose the top level Riverbend site area in the Riverbend library.
281 of 439
5. Now that the page has been created, all that is left is to change the portlet configuration to allow the portlet to receive links. Navigate to the page that you created, and then in the portlet, click on the Edit Shared Settings.
6.
Down to the bottom of the page, there is a section for Advanced Options. Set the Receive links from to Other portlets and this portlet. Then click OK.
This page will render content for any results under the Riverbend site area. In a real world scenario, you would have more pages with more mappings, but in this example we'll use the top level page as a catch all.
Note that although there are two results that look the same, they are actually to two
282 of 439
different results because of the path to the item. When we click on the search result, because we have the content page mapped and the rendering portlet deployed to it, the result will be displayed on that page. The URL becomes: http://host:port/wps/myportal/RiverbendSearchResults/Home/Products/Tea/Jasmine%20 Tea/!ut/p/b1/hc7RToMwFAbgZ_EB5By6FthlGQRwUAcFR3uzoDgDk83IotKnHxpvpfuT778_wENilHmODY6BGrQxaje2nO3enYvH5n7ew4wbXv2xyjiDuYbOTK50VOMKGwBRXNSs0KrxzH_0v0D1lFPKZui uilEcOEx1WxzBcLzOkvGNCzcC9PsKghBrpTvbTW2IOpuhNbmQ4TrIXayyrKQviWpQhyVppi0Bnc6spw6_70XCS 9Wo6t8GmfSgqnwcqS8cO7kB3j4P1-TRYaDHbc8kS6fys5zJiwzYGEZ-GZxj03R72Iu9oDcXFerkvw!!/dl4/d5/L2dBISEvZ0FBIS9nQSEh/ This shows it being mapped to the proper portal page that we created. Now, if we had not created the page mapping, this search result would have been opened in the WCM servlet instead of to the portal. This is the reason that we want to make the page mappings, assuming we want the content to be displayed within the portal.
To accomplish this, we have to create a piece of content that will hold both the search form and the results of the search. When a search is submitted the form will submit to the page for the results, which the form is also deployed to.
283 of 439
This code renders the three elements that were added to the authoring template in the previous step. Save and close the new presentation template.
284 of 439
285 of 439
1: 2: 3:
286 of 439
In the results field, enter the following: 1: 2: <tr> 3: 4: <td> 5: 6: [AttributeResource attributeName="nameLink" separator=","] 7: 8: ([AttributeResource attributeName="relevance" separator=","]) 9: 10: <br> 11: 12: [AttributeResource attributeName="summary" separator=","] 13: 14: 15: 16: </td> 17: 18: </tr> 19: 20:
In this code, we display the link to the item, its relevance, and a summary of the result. For the footer: 1: </table>
287 of 439
Use the following as the guide for the value of the design elements of the paging component:
288 of 439
Save and close the site area. Secondly, create a new piece of content. Select the at_Search authoring template, name the content "Results", For the Query Form item, select the HTML - Adv Search form component. For the Search Results, select the Search - Search Results component. In
289 of 439
the text field, enter "Please select your search mode and click the button":
Choose a workflow for your content, save and publish the content. As a last step, go back to the Search site area, and set this new content as the default content for the site area.
290 of 439
Note: The results that are displayed have URLs which will bring you to the content within the portal if a page is mapped as in the above documentation, or stay within the servlet if you do not. Just like the portal search center portlet, but this guarantees only WCM results.
Conclusion
In this section, we discussed some different ways in which you can get your WCM content to be indexed in the portal search, and to present the WCM search results within either the portal search center, or a WCM search component. Also, we discussed setting up content page mappings to act as landing pages for the WCM search results once they are retrieved.
291 of 439
292 of 439
IBM Web Content Manager enables contributors and editors to access the most common authoring functions directly from a rendered site. Some examples are: create and edit content items, approve, reject or delete the content item displayed in a Web page. Inline editing improves the usability of the authoring functions by limiting the number of clicks and navigational actions needed to complete a task in the system. Inline editing is enabled by using authoring tools components, which are regular components that can be part of presentation templates, menu element designs, and navigator element designs. The following figure shows an inline editing dialog of a content item.
When a user clicks an inline action, the Web Content Viewer portlet either launches a modal dialog window that opens from the current page (as shown in the above figure) or redirects the user to another portal page that contains the authoring portlet. This behavior can be customized in the authoring tools element design as is specified in the product documentation:
Link to authoring tools reference
Sample scenario
To increase productivity, River Bend designers added an authoring tool component to every presentation template. Thus, when an author accesses an existing content item, a quick menu is displayed (as shown in the following figure) for the author to edit and create new content.
293 of 439
The author only needs to click Edit to access to the current content item in edit mode as shown in the following figure.
The Authoring tool component creation is a simple process: River Bend designers only need to specify the HTML code they want for the action buttons as shown in the following block of code. 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: <Placeholder tag="namelink"/> <Placeholder tag="namelink" format="tag"/> <a href="<Placeholder tag="href"/>"> <Placeholder tag="name"/> </a> <a href="<Placeholder tag="href" format="tag"/>"> <Placeholder tag="name"/> </a>
Several options, such as the authoring template or the site area for new content, are available for the different authoring tools.
Remote actions
IBM Web Content Manager provides a REST like interface to invoke most of the authoring functions by calling specific URL patterns. Consider the following examples of remote action uses: Create content by using a basic HTML form and submitting it against IBM Web Content Manager.
294 of 439
Create your own wizards to accelerate the content creation process. Embed authoring actions in feeds to provide access for open, edit, approve, decline, or delete items actions. Create shortcut for the most used views in the authoring portlet based on user roles.
You can find a list of all available remote actions in the product documentation in this address:
Link to remote actions reference
Sample scenario
To increase productivity, the River Bend designers will create a launch page with shortcuts for several authoring functions by using remote actions with these URL patterns: Create a new item: 1: /wps/myportal/wcmAuthoring?wcmAuthoringAction=new&type=com.i bm.workplace.wcm.api.WCM_Content&wcmfield.content.title=<tit le>&atid=<authoring template id>
Open a content item: 1: /wps/myportal/wcmAuthoring?wcmAuthoringAction=read&docid=com .ibm.workplace.wcm.api.WCM_Content/<content id> Edit a content item: 1: /wps/myportal/wcmAuthoring?wcmAuthoringAction=edit&docid=com. ibm.workplace.wcm.api.WCM_Content/<content id>
Approve a content item:
295 of 439
By combining API calls and remote actions in launch JSPs, you can create shortcuts for views and functions with the authoring portlet user interface.
To develop this custom page, River Bend designers use these steps: 1. Create a JSP file with the content described later. The file is customLaunchPage.jsp and package it in a WAR file under the folder: /jsp/html 2. Deploy the WAR file through WebSphere Administrative Console under the URL contextPath: /RB_WCM_extensions 3. Configure the IBM Web Content Manager Authoring Portlet to launch the new page instead the default workspace: RB_WCM_extensions;/jsp/html/customLaunchPage.jsp
296 of 439
Sample code
The sample code is presented in six sections.
Section 1: Page imports, common Java objects initialization and common JavaScript functions
This section imports required Java packages and creates a WCM workspace to be used throughout the rest of the code. 1: <%@page import="com.ibm.workplace.wcm.api.*, 2: com.ibm.workplace.wcm.api.exceptions.*" %> 3: <% Repository repository = WCM_API.getRepository(); 4: Workspace workspace = repository.getWorkspace(request.getUserPrincipal()); 5: 6: // Set current document Library 7: workspace.setCurrentDocumentLibrary(workspace.getDocumentLibrary("Riv erBend")); 8: %> 9: 10: <script> 11: function display(id) { 12: status=document.getElementById(id).style.display; 13: if (status=="none") { 14: status=document.getElementById(id).style.display = "block"; 15: } else { 16: status=document.getElementById(id).style.display = "none"; 17: } 18: } 19: </script> 20: <h3>Select a task:</h3>
297 of 439
298 of 439
Section 3: My Drafts
An API call retrieves the workflow stage called Draft from the River Bend library. This stage is used together with the current user name to perform a search on all the library content where the user has the author role. Direct actions are composed for open, edit, and approve. 1: <h4><a href="javascript:display('drafts')">My Drafts</a></h4> 2: <div id="drafts" style="display:block"> 3: <table > 4: <% 5: // Get draft workflow stage 6: DocumentIdIterator draftIt = workspace.findByName(DocumentTypes.WorkflowStage,"Draft"); 7: DocumentId draftSt = null; 8: if (draftIt.hasNext()){ 9: draftSt = (DocumentId) draftIt.next(); 10: } 11: 12: if (draftIt!=null) { 13: 14: // Get all the content in this stage 15: DocumentId[] arraySt=new DocumentId[1]; 16: arraySt[0]=draftSt; 17: String[] arrayUsers=new String[1]; 18: arrayUsers[0]=request.getUserPrincipal().getName(); 19: DocumentIdIterator drafts = workspace.findContentByWorkflowStage(arraySt,arrayUsers,Workspace.ROL E_AUTHOR); 20: boolean found=false; 21: while (drafts.hasNext()) { 22: found=true; 23: DocumentId draft = (DocumentId) drafts.next(); 24: out.println("<tr>"); 25: out.println("<td>" + draft.getName() + 26: "</td><td><a href='?wcmAuthoringAction=read&docid=com.ibm.workplace.wcm.api.WCM_Co ntent/" + draft.getId() + "'>Open</a></td>"); 27: out.println("<td><a href='?wcmAuthoringAction=edit&docid=com.ibm.workplace.wcm.api.WCM_Co ntent/" + draft.getId() + "'>Edit</a></td>"); 28: out.println("<td><a href='?wcmAuthoringAction=approve&docid=com.ibm.workplace.wcm.api.WCM _Content/" + draft.getId() + "'>Approve</a></td>"); 29: out.println("</tr>"); 30: } 31: if (!found) { 32: out.println("There are no drafts currently available"); 33: } 34: } 35: %> 36: </table> 37: </div>
299 of 439
300 of 439
33: out.println("</tr>"); 34: } 35: if (!found) { 36: out.println("There are no documents pending for approval"); 37: } 38: } else { 39: out.println("Draft or Approval stages couldn't be found"); 40: } %> 41: </table> </div>
301 of 439
The JSP page must be stored in the WAR file directory for the Authoring portlet, which is was_profile_root/installedApps/ cellname /PA_WCM_Authoring_UI.ear/ilwwcmauthoring.war/jsp/html. In this directory name, cellname is unique to your installation. The JSP page might also need to be stored in the client WAR directory of the servlet or portlet that calls the JSP, such as when using the authoring tool element, or if using the IBM Web Content Manager API. For example, if displaying custom fields in content that is opened by using the edit button on an authoring tool, you also need to save the custom field JSP in the WAR file directory for the local rendering portlet.
4.1.5. WebDAV
Web-based Distributed Authoring and Versioning (WebDAV) is a set of methods based on the Hypertext Transfer Protocol (HTTP) that facilitates collaboration between users in editing and managing documents and files stored on world wide web servers. WebDAV enables you to work with your web content items by leveraging tools like file explorers to create image or file components by dragging a file into a corresponding folder, perform actions on several items at once, editing templates and modifying any item's metadata or access control settings by modifying XML files.
302 of 439
Standard portlets
It is common for third party ECM software to provide standard JSR168 or JSR286 portlets that can be used within the WebSphere Portal environment. This pattern should be considered an entry point to ECM integration because it lacks many features such as search, authorization or personalization integration that can be achieved using richer integration capabilities that we will describe later in this article.
Federated documents are documents that are referenced in WCM but really "live" in another system such as FileNet, Content Manager or Quickr.
303 of 439
To simplify the creation of federated documents rules and links, WCM provides an user friendly dialog box called "Document Picker". The Document Picker makes it easy for content authors to browse an external repository and select the document that they want to link.
For authentication, Document Picker can reuse the SSO mechanisms configured between WCM and the ECM system or allow the authors to enter a different user and password to access the repository. Access to ECM systems is achieved through the Portal AJAX proxy, so it's important to create the right policies to ensure connectivity between them Link to instructions Access to ECM systems may require the deployment of additional software capabilities in the source system such as the Quickr REST services for FileNet.
304 of 439
IBM WCI can be easily understood by describing the various entities involved: Feed Producer: This is a custom application built at the third party ECM level that uses the IBM WCI specification to produce the RSS/ATOM feed. RSS/ATOM Feed: This is the RSS/ATOM Feed that is generated by the third party ECM custom application which contains the META data and data required by WCM. WCI: IBM WCI is a Portal component that consumes the RSS/ATOM feed and uses the META data information from the feed to create new, update existing or delete WCM content.
Sample scenarios where JMS for Web Content can be used are the expiration of custom caching mechanisms, integration of business logic on item change, implementation of audit systems, etc.
305 of 439
Before you start you need to deploy JMS resources in WCM: Link to instructions on creating JMS resources for WCM
To understand this sample it is important that you are familiar with JMS and message driven beans concepts: Link to JMS and MDB basic concepts Then you have to create an EJB project in Rational Application Developer and include on it a message driven bean with this code:
1: 2: package com.ibm.redwiki; 3: 4: import javax.ejb.ActivationConfigProperty; 5: import javax.ejb.MessageDriven; 6: import javax.jms.Message; 7: import javax.jms.MessageListener; 8: 9: /** 10: * Message-Driven Bean implementation class for: WCMItemEJB 11: * 12: */ 13: @MessageDriven( 14: activationConfig = { @ActivationConfigProperty( 15: propertyName = "destinationType", propertyValue = "javax.jms.Topic" 16: 17: ),@ActivationConfigProperty(propertyName="destination", propertyValue="jms/IWKTopics/Items")}, 18: mappedName = "IWKTopics_Items") 19: public class WCMItemEJB implements MessageListener { 20: 21: /** 22: * Default constructor. 23: */ 24: public WCMItemEJB() { 25: } 26: 27: /** 28: * @see MessageListener#onMessage(Message) 29: */ 30: public void onMessage(Message message) { 31: System.out.println(message.toString()); 32: 33: } 34: }
306 of 439
The source code for the message driven bean is very simple to understand; it registers with the WCM JMS Topic queue to be notified every time a content item is changed. When a change event is received, it is logged in the application server console. In order to make this sample work, you need to bind the message driven bean to the JMS activation for WCM topics that is configured in WAS. This is done by creating an XML file under META-INF/ibm-ejb-jar-bnd.xml with this content: 1: 2: <?xml version="1.0" encoding="UTF-8"?> 3: <ejb-jar-bnd 4: xmlns="http://websphere.ibm.com/xml/ns/javaee" 5: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 6: xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-ejb-jar-bnd_1_0.xsd" 7: version="1.0"> 8: 9: <message-driven name="WCMItemEJB"> 10: <jca-adapter activation-spec-bindingname="jms/IWKItemChangeMonitorActivation" destination-bindingname="jms/IWKTopics/Items"/> 11: </message-driven> 12: </ejb-jar-bnd>
Reference
You can find more information on message driven beans coding and configuration details in this article: Link to message driven beans article
Site analytic support in WebSphere Portal is based on the injection of generic microformats (standard HTML tags with specific attributes) into portal pages or web content, eliminating the need for changing themes or skins when adding vendor specific JavaScript for analytics reporting.
307 of 439
This microformats are parsed on run-time by the Portal engine and sent to the analytics provider by an aggregator. An aggregator is a JavaScript function that composes an HTML entity such an image or an AJAX call to send the information that has been logged to the analytics provider. WebSphere Portal ships two sample aggregators that you can review to get started before creating your own:
1: 2: // This is a sample for an Active Site Analytics aggregator. 3: // It injects a 1x1 pixel image into every page that has the metadata item "asa.aggregator" set to "asa_sample.js" 4: // This image contains a list of portlet ids and titles, as well as the page title and canonical URL, as HTTP GET 5: // parameters. 6: 7: // retrieve portlet titles tagged with <span class="asa.portlet.title"/> 8: var portletTitles = new Array(); 9: 10: getElementHTMLByClassName("span", "asa.portlet.title", portletTitles); 11: 12: 13: // retrieve portlet IDs tagged with <span class="asa.portlet.id"/> 14: var portletIDs = new Array();
308 of 439
15: 16: getElementHTMLByClassName("span", "asa.portlet.id", portletIDs); 17: 18: 19: // retrieve the page's link node containing the bookmark 20: var bookmarkElement = null; 21: var links = document.getElementsByTagName("link"); 22: for (var index = 0; index < links.length; index++) { 23: var elem = links[index]; 24: if (elem.getAttribute("rel") == "bookmark") { 25: bookmarkElement = elem; 26: break; 27: } 28: } 29: 30: var imgURL = "http://example.com/analytics/tracking.png" 31: + "?" + "page_title=" + escape(bookmarkElement.getAttribute("title")) 32: + "&" + "page_url=" + escape(bookmarkElement.getAttribute("href")) 33: + "&" + "portlets=" + escape(portletTitles.join(',')) 34: + "&" + "portlet_ids=" + escape(portletIDs.join(',')) 35: //alert("imgURL = " + imgURL); 36: 37: document.write("<img alt='' src='" + imgURL + "' width='1' height='1'>"); 38: 39: 40: function getElementHTMLByClassName(strTagName, strClassName, arrReturnElements){ 41: var arrElements = document.getElementsByTagName(strTagName); 42: strClassName = strClassName.replace(/\-/g, "\\-"); 43: var regex = new RegExp("(^|\\s)" + strClassName + "(\\s|$)"); 44: var elem; 45: for(var i = 0; i < arrElements.length; i++){ 46: elem = arrElements[i]; 47: if(regex.test(elem.className)){ 48: arrReturnElements.push(elem.innerHTML); 49: } 50: } 51: return (arrReturnElements) 52: }
4.2.5. Reference
Enabling Active Site Analytics in WebSphere Portal 7.0 Site analytics and optimization
309 of 439
4.3. Programming
The IBM Web Content Manager API is focused on processing the content programmatically. This section provides an overview of the WCM API, links to the API documentation and Javadoc, and an introduction to the new API features in WCM 7.0.
WCM API
The WCM API is an alternative way to access a site that allows web developers to create, edit, delete, and render WCM objects by using Java code. Additionally, clients can manipulate their site and integrate WCM with other applications in many ways. The API offers only a subset of IBM Web Content Manager's functionality, although it is a very useful subset. Typical API scenarios may include the following examples: Create a taxonomy from a comma delimited file Bulk resource import Content search Perform search and retrieval operations, such as finding a given object by name, or finding content based on a workflow stage Integrate WCM with third-party applications.
The following figure illustrates the way in which the WCM repository is accessed.
Following are a list of sample functions available when using the IBM Web Content Manager API. You can find the complete list in this link: API Overview Find items of given type. Find library components by name Find content by authoring template, category, path, workflow stage, modified between dates.
310 of 439
The ability to create, delete and save the following items: Content, Site Areas, most types of components, Taxonomies and Categories, Projects, Folders. The ability to retrieve the following items: Content, Site areas, Taxonomies and categories, Workflows, Components, Projects, Folders.
The ability to approve or reject content items in a workflow stage. Other item-types do not support this function. WCM API Javadoc is available online or to download in this wiki: Lotus Web Content
Manager API
The WCM API supports the most basic functions of projects such as getting the items that are contained in a project, managing its members or publishing a project. In WCM 7, folders can be used to organize components. This is useful when you have large numbers of items in your library and want to distinguish between different groups of items within each item type view. Working with folders The WCM API also supports navigating folder structures and setting name and titles.
311 of 439
Query API
Query API is a completely new set of classes designed to provide an optimized method to query for content in the WCM repository. The results of a Query API search can be sorted by Author, Date created, Item name, Date modified, Item title and paged. The following terms (selectors) can be combined to compose queries using the API: Item type, ID, name, title Library, Project state Creator, Authors, Owners, Last modifier Modified before / since, Created before / since Categories, Keywords Workflow, Workflow stage, Workflow status, Publish date, Expire date
312 of 439
WCM includes one default text provider but has an extension point to allow site designers to define new sources of translations for a given key such as database tables or XML files. Creating a Text Provider class
313 of 439
without warranty of any kind. IBM shall not be liable for any damages arising out of your use of the sample code, even if they have been advised of the possibility of such damages.
Rendering plugins
See the infocenter
For now, do not worry about the tag details. Just know that we will be using htmlcomponent and folderid values within the custom rendering code, which is why we mention the tag format here. Since we're about to detail the custom rendering code it's important to know what the tag will be passing in.
314 of 439
315 of 439
Once the Web Project has been created, you have to add either the Portal 7 runtime, or the ilwwcm-api.jar to the classpath properties of the project. Right click project in the explorer, and select Java build path. Ensure that a Portal server 7 runtime has been added, or a reference to the ilwwcm-api.jar file from your server:
The reason we need this is that we will need some of the WCM API classes in order to create the custom classes.
316 of 439
Name the package com.riverbend.renderingplugin. Once the package has been created the custom classes can be created. Next, right click on the new package, and select New -> Class. Name the class WCMFilesPlugin, and click Finish.
317 of 439
Once the class has been created, paste the following code in:
1: 2: /** 3: * DISCLAIMER OF WARRANTIES: The accompanying code provided in this section 4: * (and this wiki) is sample code, created by the authors of this wiki. 5: * This sample code is not part of any standard or IBM product and is 6: * provided to you solely for the purpose of assisting you in the development of 7: * your website. The code is provided as is, without warranty of any kind. 8: * IBM shall not be liable for any damages arising out of your use of the 9: * sample code, even if they have been advised of the possibility of such damages. 10: */ 11: package com.riverbend.renderingplugin; 12: 13: import java.io.IOException; 14: import java.io.Writer; 15: import java.util.List; 16: import java.util.Locale; 17: import java.util.Map; 18: 19: import com.ibm.workplace.wcm.api.Document; 20: import com.ibm.workplace.wcm.api.DocumentId; 21: import com.ibm.workplace.wcm.api.Folder; 22: import com.ibm.workplace.wcm.api.LibraryComponent; 23: import com.ibm.workplace.wcm.api.LibraryFileComponent; 24: import com.ibm.workplace.wcm.api.LibraryHTMLComponent; 25: import com.ibm.workplace.wcm.api.RenderingContext; 26: import com.ibm.workplace.wcm.api.WCM_API; 27: import com.ibm.workplace.wcm.api.Workspace; 28: import com.ibm.workplace.wcm.api.exceptions.AuthorizationException; 29: import com.ibm.workplace.wcm.api.exceptions.DocumentIdCreationException; 30: import com.ibm.workplace.wcm.api.exceptions.DocumentRetrievalException; 31: import com.ibm.workplace.wcm.api.exceptions.OperationFailedException; 32: import com.ibm.workplace.wcm.api.exceptions.QueryServiceException; 33: import com.ibm.workplace.wcm.api.exceptions.ServiceNotAvailableException; 34: import com.ibm.workplace.wcm.api.plugin.rendering.RenderingPlugin; 35: import com.ibm.workplace.wcm.api.plugin.rendering.RenderingPluginException;
318 of 439
36: import com.ibm.workplace.wcm.api.plugin.rendering.RenderingPluginModel; 37: import com.ibm.workplace.wcm.api.query.Query; 38: import com.ibm.workplace.wcm.api.query.QueryService; 39: import com.ibm.workplace.wcm.api.query.ResultIterator; 40: import com.ibm.workplace.wcm.api.query.Selectors; 41: 42: /** 43: * A rendering plugin that will display the fileresources containing in a folder 44: * and render out based on a html template 45: */ 46: public class WCMFilesPlugin implements RenderingPlugin { 47: /** 48: * 49: */ 50: private static final long serialVersionUID = 1742627406969994207L; 51: /** The name used for identifying this object */ 52: private static final String PLUGIN_NAME = "WCMFiles"; 53: 54: @Override 55: public boolean isShownInAuthoringUI() { 56: return true; 57: } 58: 59: @Override 60: public String getName() { 61: return PLUGIN_NAME; 62: } 63: 64: @Override 65: public boolean render(RenderingPluginModel p_model) 66: throws RenderingPluginException { 67: boolean success = true; 68: Writer renderWriter = p_model.getWriter(); 69: Map<String, List<String>> pluginParams = p_model.getPluginParameters(); 70: 71: RenderingContext rc = p_model.getRenderingContext(); 72: System.out.println("*** New got rendering context ***"); 73: 74: // Get the defined folder id 75: String folderid = pluginParams.get("folderid").get(0); 76: 77: // Get the id of the html to render the item 78: String htmlcomponent = pluginParams.get("htmlcomponent").get(0); 79: 80: // The output 81: String output = "";
319 of 439
82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: {
// The pattern to replace filename String FILENAMESTR = "FILENAME"; // The pattern to replace url String FILEURLSTR = "FILEURL"; // The html to format results String html = ""; Workspace workspace; if (folderid != null && htmlcomponent != null)
94: try { 95: workspace = WCM_API.getRepository().getWorkspace(); 96: workspace.useUserAccess(true); 97: 98: DocumentId docid = workspace.createDocumentId(folderid); 99: Folder folder = (Folder) workspace.getById(docid); 100: 101: // Get the first matching folder name 102: if (htmlcomponent != null) { 103: 104: html = htmlcomponent; 105: 106: // Get the children of the folder 107: try { 108: ResultIterator children = folder.getChildren(); 109: String filename = ""; 110: String fileurl = ""; 111: 112: while (children.hasNext()) { 113: // Check to see if its a file resource and then 114: // render the results using the html component 115: Document doc = (Document) children.next(); 116: String htmlout = html; 117: 118: //
320 of 439
System.out.println("*** working on output ***"); 119: LibraryComponent lc = (LibraryComponent) doc; 120: if (lc instanceof LibraryFileComponent) { 121: filename = lc.getTitle(); 122: fileurl = workspace.render(rc, lc); 123: htmlout = htmlout 124: 125: htmlout = htmlout.replace(FILEURLSTR, fileurl); 126: output = output + htmlout; 127: } 128: 129: } 130: 131: } catch (QueryServiceException e) { 132: // TODO Autogenerated catch block 133: output = "QueryServiceException"; 134: } 135: 136: } 137: 138: } catch (ServiceNotAvailableException e) { 139: // TODO Auto-generated catch block 140: output = "ServiceNotAvailableException"; 141: } catch (OperationFailedException e) { 142: // TODO Auto-generated catch block 143: output = "OperationFailedException"; 144: } catch (DocumentIdCreationException e) { 145: // TODO Auto-generated catch block 146: e.printStackTrace(); 147: } catch (DocumentRetrievalException e) { 148: // TODO Auto-generated catch block 149: e.printStackTrace(); 150: } catch (AuthorizationException e) { 151: // TODO Auto-generated catch
321 of 439
block 152: e.printStackTrace(); 153: } 154: 155: try { 156: // Render the output 157: renderWriter.append(output); 158: 159: } catch (IOException ioe) { 160: ioe.printStackTrace(); 161: success = false; 162: } 163: } 164: 165: return success; 166: } 167: 168: @Override 169: public String getDescription(Locale p_locale) { 170: return "Renders the contents of a defined folder in WCM"; 171: } 172: 173: @Override 174: public String getTitle(Locale p_locale) { 175: return PLUGIN_NAME; 176: } 177: 178: }
The important part of the code is in the render method. This is what will be invoked when you render the tag for the plugin. In this specific example, what the plugin is doing is finding the folder within WCM for the parameter passed on the tag for folderid, and the html to be used to render the file information. We will pass the html to use directly from the content. Note that in this example tag: 1: 2: [Plugin:WCMFiles update="true" htmlcomponent="[Element context='current' type='content' key='HTMLFilesFormat']" folderid="[Element context='current' type='content' key='WCMFiles']"] We're retrieving the folder and the htmlcomponent directly from content. We will detail how those values are populated later in the article. For now know that the values are retrieved from content and passed in on the tag. What the code is basically doing is retrieving all files within the folder that's been passed, and rendering information about them to the page. The htmlcomponent value is used to determine what is rendered for each match. In this case, we will use the following in the html component: 1: 2:
322 of 439
and the code in the custom rendering plugin will replace FILEURL and FILENAME with the relevant values from each file.
Name the file plugin.xml. Enter the following into the new file: 1: 2: <?xml version="1.0" encoding="UTF-8"?> 3: <plugin 4: id="wcmfiles.plugin" 5: name="WCM Files Plugin" 6: version="1.0.1" 7: provider-name="Riverbend"> 8: <extension point="com.ibm.workplace.wcm.api.RenderingPlugin" id="WCMFilesPlugin"> 9: <provider class="com.riverbend.renderingplugin.WCMFilesPlugin"/> 10: </extension> 11: </plugin> Basically what this does is register the WCMFilesPlugin as a custom rendering plugin within the system. Once the application is installed and deployed, when rendering WCM content and using the rendering plugin tag, WCM will be able to retrieve the relevant information.
323 of 439
324 of 439
Click Next. Note that the URL Mappings: already has a line for /JSONResponse:
Click Finish.
In the servlet class, enter the following code: 1: 2: /** 3: * DISCLAIMER OF WARRANTIES: The accompanying code provided in this section 4: * (and this wiki) is sample code, created by the authors of this wiki. 5: * This sample code is not part of any standard or IBM product and is 6: * provided to you solely for the purpose of assisting you in the development of 7: * your website. The code is provided as is, without warranty of any kind. 8: * IBM shall not be liable for any damages arising out of your use of the 9: * sample code, even if they have been advised of the possibility of such damages.
325 of 439
10: */ 11: package com.riverbend.renderingplugin.servlet; 12: 13: import java.io.IOException; 14: import java.security.Principal; 15: 16: import javax.servlet.ServletException; 17: import javax.servlet.http.HttpServlet; 18: import javax.servlet.http.HttpServletRequest; 19: import javax.servlet.http.HttpServletResponse; 20: 21: import com.ibm.workplace.wcm.api.*; 22: import com.ibm.workplace.wcm.api.exceptions.AuthorizationException; 23: import com.ibm.workplace.wcm.api.exceptions.DocumentIdCreationException; 24: import com.ibm.workplace.wcm.api.exceptions.DocumentRetrievalException; 25: import com.ibm.workplace.wcm.api.exceptions.OperationFailedException; 26: import com.ibm.workplace.wcm.api.exceptions.QueryServiceException; 27: import com.ibm.workplace.wcm.api.exceptions.ServiceNotAvailableException; 28: import com.ibm.workplace.wcm.api.exceptions.WCMException; 29: import com.ibm.workplace.wcm.api.query.QueryService; 30: import com.ibm.workplace.wcm.api.query.ResultIterator; 31: import com.ibm.workplace.wcm.api.query.Query; 32: import com.ibm.workplace.wcm.api.query.Selectors; 33: 34: /** 35: * Servlet implementation class JSONResponse 36: */ 37: public class JSONResponse extends HttpServlet { 38: private static final long serialVersionUID = 1L; 39: 40: /** 41: * @see HttpServlet#HttpServlet() 42: */ 43: public JSONResponse() { 44: super(); 45: // TODO Auto-generated constructor stub 46: } 47: 48: /** 49: * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse 50: * response) 51: */ 52: protected void doGet(HttpServletRequest request, 53: HttpServletResponse response) throws
326 of 439
ServletException, IOException { 54: // TODO Auto-generated method stub 55: } 56: 57: /** 58: * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse 59: * response) 60: */ 61: protected void doPost(HttpServletRequest request, 62: HttpServletResponse response) throws ServletException, IOException { 63: // TODO Auto-generated method stub 64: Principal userPrincipal = request.getUserPrincipal(); 65: 66: String rd = ""; 67: Workspace usersWorkspace = null; 68: if (userPrincipal != null) { 69: // very important is to place user specific workspace key in session 70: usersWorkspace = (Workspace) request.getSession() 71: .getAttribute( 72: userPrincipal.getName() + "_" 73: 74: if (usersWorkspace == null) { 75: try { 76: usersWorkspace = WCM_API.getRepository().getWorkspace( 77: userPrincipal); 78: if (usersWorkspace != null) { 79: request.getSession().setAttribute( 80: userPrincipal.getName() + "_" 81: 82: usersWorkspace); 83: } 84: } catch (OperationFailedException e) { 85: // logger.log(Level.WARNING, e.getMessage(), e); 86: } catch (ServiceNotAvailableException e) { 87: // logger.log(Level.WARNING, e.getMessage(), e);
327 of 439
88: } 89: } else { 90: 91: } 92: } 93: else 94: { 95: // get a system workspace 96: try 97: { 98: usersWorkspace = WCM_API.getRepository().getSystemWorkspace(); 99: } 100: catch(Exception e) 101: { 102: e.printStackTrace(); 103: } 104: } 105: 106: usersWorkspace.logout(); 107: usersWorkspace.login(); 108: 109: // Set-up the query service 110: QueryService queryService = usersWorkspace.getQueryService(); 111: Query query = queryService.createQuery(Folder.class); 112: query.returnObjects(); 113: ResultIterator results = null; 114: String libName = request.getParameter("libName"); 115: 116: DocumentLibrary docLib = usersWorkspace.getDocumentLibrary(libName); 117: // Set the library to the current library. This may cause issues if the 118: // library hasn't been selected. Should add a lib selector in 119: query.addSelector(Selectors.libraryEquals(docLib)); 120: 121: // Get the components folder 122: query.addSelector(Selectors.nameEquals("Components")); 123: 124: // Get all of the children of the component folder and build the json
328 of 439
125: // for the store 126: String parent = ""; 127: 128: try { 129: results = queryService.execute(query); 130: while (results.hasNext()) { 131: // This is the parent folder 132: Folder parentfolder = (Folder) results.next(); 133: // Go get the children 134: rd = getFolderChildren(parentfolder, "", 0); 135: 136: // ok we have a response 137: if (rd.length() != 0) { 138: 139: int returnCode = HttpServletResponse.SC_OK; 140: response.setStatus(returnCode); 141: response.getWriter().write("[" + rd); 142: response.getWriter().flush(); 143: } 144: 145: } 146: } catch (QueryServiceException e1) { 147: // TODO Auto-generated catch block 148: e1.printStackTrace(); 149: } catch (WCMException e) { 150: // TODO Auto-generated catch block 151: e.printStackTrace(); 152: } 153: 154: } 155: 156: private String getFolderChildren(Folder folder, String result, int id) 157: throws WCMException { 158: 159: // Get all of the children 160: ResultIterator children = folder.getChildFolders(); 161: int count = children.getSize(); 162: 163: // If there are no children then return otherwise set these as children
329 of 439
164: // in the json 165: int current = 0; 166: if (count == 0) { 167: return result; 168: } else { 169: if (id != 0) { 170: result = result + ", \"children\":["; 171: } 172: } 173: 174: // Cycle through the children building up the json 175: while (children.hasNext()) { 176: Folder child = (Folder) children.next(); 177: 178: // up the counter 179: current++; 180: // Get the doc id 181: String docId = child.getIdentity().getID().toString(); 182: 183: // Set the label (folder name) and docid 184: result = result + "{ \"label\":\"" + child.getName() 185: + "\", \"id\": \"" + docId + "\""; 186: 187: // go get this folders children 188: result = getFolderChildren(child, result, id++); 189: 190: // If we are on the last one then close off this section else close 191: // this item 192: if (count == current) { 193: result = result + "}]"; 194: } else { 195: result = result + "},"; 196: } 197: 198: } 199: return result; 200: } 201: 202: } At a high level, all this code is doing is grabbing a list of folders in the Components folder of the library that's passed in. So this way, we will have a json object that contains the component folders. This is used to populate the content later with the selected folder you wish to use to render for the custom rendering plugin.
330 of 439
Then hit Finish. Now, right click the WebContent/jsp/html folder, and select new -> other. Select JSP File, you may have to click on show all wizards:
331 of 439
1: 2: <%@ page import="java.util.*, 3: com.ibm.workplace.wcm.api.*, 4: com.ibm.workplace.wcm.api.exceptions.*, 5: com.ibm.workplace.wcm.api.authoring.CustomItemBean, 6: com.ibm.workplace.wcm.api.query.Query, 7: com.ibm.workplace.wcm.api.query.QueryService, 8: com.ibm.workplace.wcm.api.query.ResultIterator, 9: com.ibm.workplace.wcm.api.query.Selectors, 10: javax.naming.InitialContext, 11: javax.naming.NamingException, 12: com.ibm.websphere.cache.DistributedMap, 13: java.util.Iterator" 14: session="true"%> 15: <%@ taglib uri="/WEB-INF/tld/wcm.tld" prefix="wcm" %> 16: <%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix="portletAPI" %> 17: 18: <portletAPI:init /> 19: <wcm:initworkspace user="<%= request.getUserPrincipal() %>" /> 20: 21: <% 22: 23: /* 24: rob.enright@uk.ibm.com July 11 25: Builds a list of the libraries in this instance 26: Makes a call to the servlet to return the folders for the selected library 27: Updates the UI with a dijit tree of the folders 28: Stores the folder id for use with the WCMFiles rendering plug-in 29: 30: */ 31: CustomItemBean customItem = (CustomItemBean) request.getAttribute("CustomItemBean"); 32: customItem.setSubmitFunctionName("myoptionsubmit"); 33: String fvalue = (String)customItem.getFieldValue(); 34: 35: 36: String folderName = ""; 37: String docPath = customItem.getDocumentPath(); 38: String currentLib = ""; 39: String libraries =""; 40: 41: Workspace usersWorkspace = (Workspace) pageContext.getAttribute(Workspace.WCM_WORKSPACE_KEY);
332 of 439
42: 43: 44: //Need to build the raw data with the tree of folders in the component library 45: String rd = ""; 46: String lib = ""; 47: if (usersWorkspace != null) 48: { 49: 50: if(fvalue.length()>0){ 51: 52: DocumentId folderId; 53: try { 54: folderId = usersWorkspace.createDocumentId(fvalue); 55: Document selectedFolder = usersWorkspace.getById(folderId); 56: DocumentLibrary docLib = selectedFolder.getOwnerLibrary(); 57: 58: //get the current library 59: currentLib = docLib.getName(); 60: 61: //Set the folder name 62: folderName = selectedFolder.getName(); 63: } catch (DocumentIdCreationException e) { 64: // TODO Auto-generated catch block 65: e.printStackTrace(); 66: //Reset the values 67: fvalue = ""; 68: } catch (DocumentRetrievalException e) { 69: // TODO Auto-generated catch block 70: e.printStackTrace(); 71: //Reset the values 72: fvalue = ""; 73: } catch (AuthorizationException e) { 74: // TODO Auto-generated catch block 75: e.printStackTrace(); 76: //Reset the values 77: fvalue = ""; 78: } 79: }
333 of 439
80: 81: libraries = "{'identifier': 'libraryName', 'label': 'libraryName', 'items': ["; 82: //Get the current libraries that are avaiable and create a json store 83: for(Iterator<DocumentLibrary> i = usersWorkspace.getDocumentLibraries(); i.hasNext();){ 84: String libraryName = i.next().getName(); 85: libraries = libraries + "{ 'libraryName' : '" + libraryName + "'"; 86: if(i.hasNext()){ 87: libraries = libraries + "},"; 88: } else { 89: libraries = libraries + "}]}"; 90: } 91: } 92: 93: } 94: 95: %> 96: 97: 98: 99: <script language='Javascript'> 100: 101: function myoptionsubmit(){ 102: 103: //Update the field with the holding value 104: document.getElementById('<%=customItem.getFieldName()%>').val ue = document.getElementById('folderID').value 105: 106: } 107: 108: 109: dojo.require("dojo.data.ItemFileReadStore"); 110: dojo.require("dijit.Tree"); 111: dojo.require('dijit.form.Select'); 112: dojo.require("dijit.form.Button"); 113: var treeNum = 0; 114: var treeControl = new Array(); 115: var myTree; 116: var resetTree=true; 117: 118: var clib = "<%=currentLib%>"; 119: 120: 121: function recursiveHunt(lookfor, model, buildme, item) {
334 of 439
122: // console.log(">> recursiveHunt, item ", item, " looking for ", lookfor); 123: var id = model.getIdentity(item); 124: buildme.push(id); 125: if (id == lookfor) { 126: // Return the buildme array, indicating a match was found 127: // console.log("++ FOUND item ", item, " buildme now = ", buildme); 128: return buildme; 129: } 130: for (var idx in item.children) { 131: // start a new branch of buildme, starting with what we have so far 132: var buildmebranch = buildme.slice(0); 133: //console.log("Branching into ", model.store.getValue(item.children[idx], 'name'), ", buildmebranch=", buildmebranch); 134: var r = recursiveHunt(lookfor, model, buildmebranch, item.children[idx]); 135: // If a match was found in that recurse, return it. 136: // This unwinds the recursion on completion. 137: if (r) { 138: return r; 139: } 140: } 141: // Return undefined, indicating no match was found 142: return undefined; 143: } 144: 145: function selectTreeNodeById(tree, lookfor) { 146: //console.log("See model root=", tree.model.root); 147: var buildme = new Array(); 148: var result = recursiveHunt(lookfor, tree.model, buildme, tree.model.root); 149: //console.log("*** FINISHED: result ", result, " buildme ", buildme); 150: //console.dir(result); 151: if (result && result.length > 0) { 152: tree.attr('path', result); 153: } 154: } 155: 156: 157:
335 of 439
158: //Build the dojo tree of folders 159: function fetchChildren(library) { 160: var rawdata; 161: var targetNode = dojo.byId("displayError"); 162: 163: var xhrArgs = { 164: url: "/RiverbendFilesPlugin/JSONResponse", 165: handleAs: "text", 166: content: { libName: library 167: 168: }, 169: load: function(data) { 170: targetNode.innerHTML = ""; 171: buildTree(dojo.fromJson(data), library); 172: }, 173: error: function(error) { 174: targetNode.innerHTML = "No folders found."; 175: if (myTree) { 176: dojo.byId("treeContainer").removeChild(myTree.domNode); 177: resetTree=false; 178: } 179: } 180: }; 181: 182: //Call the asynchronous xhrGet 183: var deferred = dojo.xhrPost(xhrArgs); 184: 185: } 186: 187: function buildTree(rawdata){ 188: 189: var store = new dojo.data.ItemFileReadStore({ 190: data: { 191: identifier: 'id', 192: label: 'label', 193: items: rawdata 194: } 195: }); 196: var treeModel = new dijit.tree.ForestStoreModel({ 197: store: store 198: }); 199: 200: //If this tree has already been created then scratch
336 of 439
201: if (treeNum>0 && resetTree) { 202: //remove the current domNode 203: dojo.byId("treeContainer").removeChild(myTree.domNode); 204: } 205: 206: var holdingField = dojo.byId("folderID"); 207: 208: //Build a new tree 209: myTree = new dijit.Tree({ 210: onClick: function(item, node, evt) { 211: //set the display to be the name of the folder 212: document.getElementById('selectedFolder').innerHTML = item.label[0]; 213: 214: //set the field to be the id of the folder 215: holdingField.value = item.id[0]; 216: }, 217: model: treeModel, 218: id: treeNum, 219: showRoot: false, 220: persist: false 221: }); 222: 223: dojo.byId("treeContainer").appendChild(myTree.domNode); 224: myTree.startup(); 225: selectTreeNodeById(myTree, "<%=fvalue%>"); 226: treeNum = treeNum + 1; 227: resetTree=true; 228: 229: } 230: 231: //Render the list of libraries and update the folders if changed 232: dojo.addOnLoad(function() { 233: 234: var libraries = <%= libraries %>; 235: var myStore = new dojo.data.ItemFileReadStore({ 236: data: libraries 237: });
337 of 439
238: 239: 240: 241: 242: evt) { 243: 244: 245: 246: 247: 248: 249:
var libSelect = new dijit.form.Select({ name: 'libSelect', sortByLabel: false, onChange: function(item, node, fetchChildren(item); } }, "librariesSelect");
libSelect.setStore(myStore, clib);
document.getElementById('selectedFolder').innerHTML = '<%=folderName%>'; 250: 251: 252: }); 253: 254: </script> 255: 256: <style> 257: .tundra .dijitLeaf { 258: background: url("/portal_dojo/v1.4.3/dijit/themes/tundra/images/folderClosed.gif" ) no-repeat scroll 0 0 transparent; 259: } 260: </style> 261: <b>Selected:</b><br/><div id="selectedFolder"><%=folderName%></div><br> 262: <INPUT type="hidden" id="<%=customItem.getFieldName()%>" value="<%=fvalue%>"> 263: <input type="hidden" id="folderID" value="<%=fvalue%>"> 264: <b>Libraries:</b><br/><div id="librariesSelect"></div><br><br> 265: <b>Folders:</b><br/><div id="treeContainer"></div> 266: <div id="displayError"></div> Basically, what this is doing is populating a dojo object with the data being returned from the JSONResponse servlet that we created before. It's beyond the scope of this article to discuss the dojo and json being used, but just know that at a high level this is using dojo to build out the selection mechanism. When you select a folder, it stores the ID of the folder within the content object. One note, the jsp requires the wcm.tld: 1: 2:
We need to import this file into our project. Create the /tld folder in the /WebContent/WEB-INF folder. Once it has been created, copy or import the wcm.tld file from your wcm server into this folder. You can find it in /wp_profile/installedApps/cellname/wcm.ear/ilwwcm.war/WEB-INF/tld folder.
338 of 439
Now that we have the .war file, we need to install it. Navigate to your WebSphere Application Server admin console. Navigate to Applications -> New Application. Select New Enterprise Application. On the next page, in the local file section, choose the .war file you just exported:
339 of 439
Click the Next button. Choose the fast path option, then click on Next button. For the Step 1 options, leave the defaults and click Next.
340 of 439
Also, in the properties for the WCMFiles element, add the following for the path to the custom JSP: 1: 2:
/RiverbendFilesPlugin;/jsp/html/showFolders.jsp
341 of 439
Finally, save and publish the content. Then, when we render the content:
4.3.3. Wrapping it up
In this example, we showed how to integrate and render custom rendering plugins, which are a powerful tool to enhance your WCM environment. Additionally, the technique of using custom JSP within authoring template elements was explored.
342 of 439
Blogs
Blogs and blog libraries are often used to provide personal views, opinion, news and commentary pertinent to your intranet and extranet sites. Blogs and blog libraries typically combine text with graphics and links to other blogs and Web sites. You can see an example of a blog in the following screenshot:
In WCM blogs: The entries are arranged in reverse-chronological order, with the newest entry displayed first.
343 of 439
In WCM blogs, readers can post comments about your entries. Users can manage their own blog entries and comment on other blog entries. Readers can tag and rate blogs. Tags added to a blog are automatically linked through the the Tag Center.
Wikis
Wikis also provide the users of a web site with a collaborative authoring environment where they can pull together a set of documentation about a topic. Wikis can be used to share community content created by a group of authors in a collaborative way. Wikis typically combine text with graphics and links to other wikis and Web sites. Users can monitor and manage their own wiki articles. Readers can tag and rate wikis.
Tagging engine
Users can use the tagging engine to help to classify the site content by adding tags to content items, for example, apply the tag "RiverBend" to a page that provides information about the company.
344 of 439
Once content has been tagged, users can view the tags that have been applied to individual content items or search related items that have been tagged with the same terms. Tags are usually displayed as a cloud, using a bigger and darker font to mark the most used tags.
WCM provides an automatic generated tag cloud for users to browse the tags used on a site: The tag cloud lists the tags in alphabetical order. Different font sizes and colors indicate how often the tags have been applied. Depending on how the administrator has configured the tag cloud, the list can be from across the portal or limited to particular items, for example, portal pages, or books available on the page where the user clicked the tag. Users can switch between different display modes. For example, they can have the tags displayed in a cloud as described above, or in a simple list. When users work with the list of resources, they can have the list sorted by different criteria, for example, title, date, rating. The result list portlet also supports two different view modes: a summary and a detail view.
Rating engine
The rating engine allows the site users to find the most relevant content in a site by applying ratings to individual resources to show how much they rate or "like" them. For example, a user can give a good coffee a rating of 4.
345 of 439
Users can change or remove ratings that they applied themselves. For example, a user can update the previous rating 4 to a 5 and view the ratings that they or other users have applied to the same item.
Social toolbars
Social networks are a key channel to deliver your content to a wider audience. By publishing the updates of your content to networks like Twitter, Facebook or Google+ can have a big impact in the number of visits that your site will receive. Social toolbars are a set of buttons that allow authors and visitors to quicly publish a reference to a content item onto many of the most popular social sites on the Web. Social toolbars offen allow you to display a counter of the number of times that an item has been shared in a social network. This picture shows an example of a social toolbar:
There are many social toolbars services available for free on the Internet. Most offer an easy integration method allowing you to embed them in any HTML page by including an HTML fragment like this: 1: 2: <!-- AddThis Button BEGIN --> 3: <div class="addthis_toolbox addthis_default_style "> 4: <a class="addthis_button_preferred_1"></a> 5: <a class="addthis_button_preferred_2"></a> 6: <a class="addthis_button_preferred_3"></a> 7: <a class="addthis_button_preferred_4"></a> 8: <a class="addthis_button_compact"></a> 9: <a class="addthis_counter addthis_bubble_style"></a> 10: </div> 11: <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa4e7836eb3bb0be8d"></script> 12: <!-- AddThis Button END -->
T
The code from this example comes from the AddThis service: Link to AddThis website but any other toolbar provider might be used as long as it uses a similar approach. WCM HTML components provide an easy way to include a social toolbar in any content type while managing it from a central location.
346 of 439
This example shows the code that Riverbend designers created to include a social toolbar in their content items:
Once created, this HTML component can be included in any presentation template to make possible to share the content in any social network.
For more details, refer to the linked asset in the Portal Solutions Catalog. Link to
multilingual solution .
347 of 439
348 of 439
349 of 439
If the WCM environment has many WCM libraries, you can set the search option to search the specific WCM library you want to manage. The Search by drop down field provides the following options: Name contains (selected by default) Name starts with All available
This is a very useful action that allows the administrator to identify all the WCM items that are locked by users (authors or web developers) across all the WCM libraries. The administrator also has the ability to unlock the selected items from the result view.
System reports
Use this action to display a list of WCM library deletion reports. These reports can be viewed and deleted if required.
350 of 439
Refresh
Use this action to refresh the web content libraries portlet.
For instance, when a WCM library is deleted, the deleted library will still continue to appear in the Web Content libraries portlet with the library status Deleting. Using the Refresh action clears the deleted WCM library from the Web Content libraries portlet view.
Library resources
Use this action to set access permissions to the library resources on the selected WCM library. This controls the access to the views and actions available from within the WCM authoring portlet.
Delete library
Use this action to delete the selected WCM library. This action will be disabled if the WCM library is configured to be prohibited from being deleted.
Additional tasks
Use this action to perform version management related tasks on the WCM library.
351 of 439
1.
2. Select a Language from the dropdown field. 3. If the checkbox Prohibit library from being deleted is enabled, the Delete Libraries action available in the Web Content libraries portlet will be disabled for the respective library. 4. Select the Enabled checkbox to use the WCM library in the Authoring portlet. If the checkbox Enabled is disabled, this WCM library will not be available in the library selection list in the WCM Authoring portlet. If you want to prevent any changes being made to items stored in a library, but would like those items to still appear on a rendered site, you should disable the library instead. 5. If the checkbox Include default items in the new library is enabled, a set of default web content items will be created. 6. Click OK to create the new web content library.
352 of 439
The screenshot below shows the newly created web content library.
This section covers the details of setting access at library level and at the item type in a library. First, let's identify the various roles available within WCM and the two techniques (additive and subtractive) to set access to the WCM library.
353 of 439
WCM roles
WCM v7 identifies a set of roles and each role has certain capabilities. The table below describes these roles along with their capabilities from within the WCM authoring portlet. Roles User Rendering and authoring portlet access rights User and groups assigned to this role can: view items in a website or rendering portlet that they have been assigned at least user access User and groups assigned to this role can: view items in a rendering portlet or servlet-rendered website that they have been assigned at least user access view libraries the they have been assigned contributor access to in an authoring portlet access the "My Items" and "All Items" views in an authoring portlet for libraries that they have been assigned contributor access access the item type view within the authoring portlet for item types that they been assigned at least user access User and groups assigned to this role can: view items in a rendering portlet or servlet-rendered website that they have been assigned at least user access view libraries the they have been assigned contributor access to in an authoring portlet access the "My Items" and "All Items" views in an authoring portlet for libraries that they have been assigned at least contributor access for library item types that user and groups have been assigned at least editor access to, editors can have access to (perform) the following actions in the authoring portlet: * access the item type view * create a new item * add/remove links * apply authoring template * copy * delete * edit * link to * move * restore a version * edit version labels User and groups assigned to this role can: view items in a rendering portlet or servlet-rendered website that they have been assigned at least user access
Contributor
Editor
Manager
354 of 439
view libraries the they have been assigned contributor access to in an authoring portlet access the "My Items" and "All Items" views in an authoring portlet for libraries that they have been assigned at least contributor access for library item types that they have been assigned manager access to, managers can access the all of the actions available to editors and also the following actions in the authoring portlet: * edit access settings * next stage * purge * unlock * edit user profile User and groups assigned to this role can:
Administrator
view items in a rendering portlet or servlet-rendered website that they have been assigned at least user access view libraries the they have been assigned contributor access to in an authoring portlet access the "My Items" and "All Items" views in an authoring portlet for libraries that they have been assigned at least contributor access all actions in the authoring portlet for library item types that they have been assigned administrator access These roles have no access to Web Content Manager items
The following table describes the pre-defined groups that can be assigned roles in a WCM library.
Pre-Defined Group Anonymous portal user All Authenticated Portal Users Users and User Groups All Portal User Groups
Description Select this user to assign a role to anonymous users Select this group to assign a role to users that have logged on to your server Select this group to assign a role to all users and groups Select this group to assign a role to all groups
355 of 439
Additive method
With the additive method, you begin with assigning a user or a group with the lowest possible privileges at the WCM library level and then increase their access rights by assigning them with the higher privileges for specific WCM items.
Subtractive method
With the subtractive method, you begin with assigning a user or a group with higher privileges at the WCM library level and then reducing their access rights at specific WCM object level and de-selecting the inheritance option.
The Resource Permissions page displays the list of Roles, Allow Propagation option, Allow Inheritance option and the action to Edit Roles. Note: Making any changes to the Allow Propagation option and the Allow Inheritance option requires you to use Apply action to ensure your change is applied.
356 of 439
Note: The Display/Modify Owner link is not applicable in the WCM context. To assign a user or a group with the appropriate Roles, use the respective Edit Roles action. The screen shot below illustrates an example of the page that loads up when the Edit Roles action is used to add new Users to the WCM library. In this example, the All Authenticated Portal Users group (see table Pre-Defined Groups above) has already been allocated the User role. You can add additional users/groups by using the Add action. You can also delete the users/groups by using the Delete Inherited column displays if the user/group has inherited the current role. action. The
Setting access permissions on the WCM authoring portlet tasks and views
Setting access permissions on the WCM authoring portlet tasks and views will allow you to control who has access to the various tasks and views from within the WCM authoring portlet. Note that the permissions set for item types in this manner do not automatically give you access to individual items. To apply access permissions to a WCM item type, as an administrator use the Library action available for the WCM library in the Web Content Libraries view. The resources screen shot below illustrates the Library Resources portlet that loads up when the Library resources action is used.
357 of 439
You can control access to the following WCM item types: Authoring Template Components Content Presentation Template Site and Site Areas Taxonomies and Categories Workflow and workflow elements
To apply access permissions to a WCM item type, as an administrator use the Set Permissions action available for the WCM library in the Library Resource view. The screen shot below illustrates the Resource Permissions portlet that loads up when the Set Permissions action is used.
As you can see, this is the same Resource Permissions portlet that has been described in the section Setting Access Permissions on the WCM Library above. Follow the same instructions to add access permissions to the individual WCM item types.
358 of 439
To prevent a user or group from automatically having inherited access to an item, turn off inheritance on that item. You can allow assigned roles to be inherited from parent items up to and including the library. The access roles are inherited in the following hierarchies: Library -> Site -> Site area -> Content item Library -> Taxonomy -> Category Library -> Folder -> Component Library -> Folder -> Authoring Template Library -> Folder -> Presentation Template Library -> Workflow Library -> Workflow Stage Library -> Workflow Action You can stop inheritance at any point in an inheritance hierarchy. For example, you can allow inheritance down to a site area, but assign access roles manually for each content item under that site area. Inheritance from a library is based on the role assigned to the overall library, not on the role assigned to specific item types. For example, you may not have access to the presentation template view on a library, but if you inherit the role of editor to a presentation template, you can view and edit that presentation template from the All Items view. Note: Inheritance does not apply to draft items.
359 of 439
Each property applies to an individual item type thus allowing you to control the versioning behavior at the item type level. It is best practice to disable automatic versioning if it is not required otherwise the WCM authoring performance can be adversely affected. The screenshot below shows the IBM WebSphere Application Server administration console and highlights the versioning properties available under the WCM WCMConfigService service.
360 of 439
361 of 439
2.
The Current versions portlet displays all the versions available for the current item. We select the first version and then use the Restore action version of the presentation template. The Read action you can Restore it. The Edit Label action item version. The Delete action to restore the previous
available allows you you view the selected item version before
3. Once the item is restored you will receive confirmation that the item was restored to the selected version.
362 of 439
View report
This action displays a report of the respective task that you selected to view the report against.
363 of 439
364 of 439
1. As an administrator, log into the the IBM WebSphere Application Server administration console and navigate to the following: Resources -> Resource Environment -> Resource Environment Providers -> WCM WCMConfigService.
2. From the WCM WCMConfigServices page that is loaded, click on Custom properties as shown in the screenshot below.
365 of 439
366 of 439
367 of 439
3.
4. 5. 6.
368 of 439
369 of 439
As an administrator, follow these steps to delete a WCM library using the Web Content Libraries portlet: 1. Click on the Delete Library delete. action available against the WCM library you want to
2. You will be prompted with a dialog box to confirm this operation. Click OK.
3. The screen shot below illustrates the screen visible after the delete action was triggered on the Test library. Notice the view displays the status Deleting against this library.
370 of 439
371 of 439
5. Use the View Report action to view the report of the delete operation.
372 of 439
2. Disable the checkbox Enabled as shown in the screenshot below and click OK.
3. The Web Content Libraries portlet now displays the library status to be Disabled and will no longer be available for selection from the authoring portlet.
373 of 439
Restart the server for these changes to take effect. To run the unlock library module, use the following URL: http://[hostname]:[port_number]/wps/wcm/connect?MOD=UnlockLibrary&library=libraryna me Log in as the Portal administrator when prompted to do so.
5.2. Syndication
Syndication is the method used by IBM Web Content Manager (WCM) to replicate data from a web content library on one server to a web content library on another server. This section introduces syndication and covers the various syndication methods, syndication relationships, and other related topics.
Introduction
IBM Web Content Manager facilitates an environment to design, author and maintain web content. A WCM deployment usually comprises more than one WCM server. For example: One WCM Authoring server, one WCM staging server and one WCM delivery server. A Web Content library on a server can be replicated between all the WCM server using WCM syndication. The source WCM server where content is replicated from is known as at the Syndicator
374 of 439
and the target WCM server where content is replicated to is known as the Subscriber. Syndication is based on the Information and Content Exchange (ICE) protocol, an XMLbased protocol using HTTP as its transport mechanism. Reference: An additional detail about the workings of the ICE protocol is available in the IBM Developerworks article Understanding syndication in IBM Workplace Web Content Management. URL: http://www.ibm.com/developerworks/lotus/library/wwcm-syndication/
Syndication methods
All the items you work with as part of your WCM authoring environment (templates, components, content items, and so forth) are stored in WCM libraries. Syndication takes place at the WCM library level and replicates from the selected WCM library or libraries from the syndicator to the subscriber. There are three syndication methods available when configuring a syndication relationship: Live items syndication Live and projects syndication All items syndication
Live items
Live item syndication is mostly used when syndicating to a staging or delivery server. The following items are syndicated: Published Expired
All items
All item syndication is mostly used when syndicating between servers within an authoring environment. The following items are syndicated:
375 of 439
Published Expired Projects Draft items in a project Other draft items Versions Deleted items
Syndication relationships
WCM library planning should consider how you plan to syndicate libraries between WCM instances. Planning WCM libraries should be done during the information architecture planning stage. Syndication relationships can be of the following kinds: One way relationship Two way relationship Multiple relationships
376 of 439
Multiple relationship
In a multiple syndication relationship, you can have a WCM instance subscribe WCM libraries from multiple WCM instances as illustrated in the figure below. An example of where this setup could be used - if you have multiple WCM authoring instances in multiple locations and a single WCM delivery instance, you can use multiple syndication relationships to syndicate content to a single WCM delivery instance. The following figure illustrates multiple syndication relationships.
377 of 439
Version consistency
All servers participating in syndication must be of the same version for syndication to work as expected and to be in a supported state. Syndication is not supported between versions. For example: Server A with version 7.0.0.0 can be syndicated to Server B with version 7.0.0.1 installed. Server A with version 7.0.0.0 can be syndicated to Server B with version 7.0.1 installed. Server A with version 7.0.1 can be syndicated to Server B with version 7.0.0.0 installed. Syndicating Server A with version 6.1.5 to Server B with version 7.0.0.0 installed is not supported. Syndicating Server A with version 7.0.0.0 to Server B with version 6.1.5 installed is not supported.
378 of 439
syndicated successfully. If you only include Library A in the Syndicator, any items in Library A that reference items in Library B are not syndicated, and syndication errors are generated. If you add a new library to a Syndicator after the initial syndication you will need to click Update to force the new library to be syndicated immediately. If you intend to syndicate a library that contains more than 10000 items, update the maximum Java heap size (at least 1024 MB) used by the portal application server on the subscriber machine. Although it is possible to set up more than one syndication relationship between the same WCM instances, there is no reason to do so. The additional syndication relationships are not required. WCM Event Log is a database table that was created to track changes made to all objects within WCM. This table is separate from the main WCM object library. The Event Log stores attributes about each WCM object. The Event Log can be used to flag candidates for syndication based on the lastModified date, the item gatherer and the library in which the object resides. An item will fail to syndicate if an item it references has been deleted (but not purged). Purge the deletion and rebuild the subscription so that the deleted item is resent. Switching from "all item" syndication to "live item" syndication: When you switch from "all item" syndication to "live and projects" syndication or "live item" syndication, any drafts previously syndicated to the subscriber are not removed. If you move a draft item from a library using "all item" syndication to a library using "live item" syndication, the draft item will also be moved on the subscriber because the action occurred on the library using "all item" syndication. This behavior allows for some draft items to be included in a subscriber library even though "live item" syndication is being used.
Syndication interval
To set up syndication interval, use the following property: Property name = deployment.itemChangedTaskDelay Default value = 30 (seconds) Possible values = 0 (seconds) to 65536 (seconds)
Use this property to change the syndication interval to better suit the needs of your environment. For example, you might shorten the interval in an active authoring environment where users must collaborate heavily and rely on timely replication. Similarly you might lengthen the interval to avoid excessive replication of data that does not change often. A value of 0 will prevent syndication from occurring. If the interval is too short for syndication to complete before the interval expires, syndication will begin again as soon as the previous syndication completes.
379 of 439
Syndication is configured to run automatically by default. You can disable automatic syndication and rely only on manual syndication to have complete control over when syndication occurs. To disable automatic syndication, change the value of this property to false.
Subscriber-only server
To set up subscriber-only server, use the following property: Property name = deployment.subscriberOnly Default value = false Possible values = true or false
A syndicator server uses several processes to gather and queue content for syndication. These processes can sometimes impact server performance when running. However, a subscriber-only server does not require these processes, so performance can be improved on the subscriber-only server by disabling the processes. To configure a subscriber only server, change the value of this property to true.
Subscriber reporting
To set up subscriber reporting, use the following property: Property name = deployment.enableReport Default value = false Possible values = true or false
This enables high level reporting of syndication to the SystemOut.log file on the Subscriber server. It provides a summary of items that were processed, and which items failed syndication to help you troubleshoot syndication issues. To enable subscriber reporting set this property value to true.
380 of 439
update-wcm-service-properties. Refer to the IBM Web Content Manager Infocenter for more details. URL : www.lotus.com/ldd/portalwiki.nsf/dx/xpViewCategories.xsp?lookupName=IBM%20Web%20Content %20Manager%207%20Product%20Documentation
Note:
You will need to restart WebSphere Portal to enable any configuration changes made. When making changes to clustered servers, you will need to ensure the WCM WCMConfigService service section under the Cluster Scope is updated.
381 of 439
To ensure both the Syndicator WCM instance and Subscriber WCM instance were at the same WCM version we looked at the information available in the following file on both the servers \PortalServer\log\VersionInfo.log. Both the environments are on the same build level, as shown below: 1: 2: IBM WebSphere Portal 7.0.0.1 3: Build Level: wp7001CF06_001_15 (2011-07-19 15:33) 4: Server Name: WebSphere_Portal 5: Started at: 9/10/2011 10:47:42:890 EDT 6: Installed Feature Packs: 7: None 8: Installed FixPacks: 9: WP_PTF_7001 (IBM WebSphere Portal, Version 7.0.0.1 Fix Pack) 10: Installed Interim Fixes: 11: PM41442 (IBM WebSphere Portal, 7.0.0.1-WP-WCM-CombinedCFPM41442-CF006) 12: PM43406 (Cumulative iFix 18 for WCM v7.0.0.1)
Note: Cross fix-pack syndication is now supported in WCM version 7.x onwards. This means a server running 7.0.0.0 could be syndicated with a server running 7.0.0.1.
382 of 439
The following figure shows checking the network connectivity from the Syndicator to the Subscriber using the ping command and the ping result.
Web Content Libraries on the Subscriber: The Subscriber has the default libraries as shown in the screenshot below. Notice the subscriber does not have the additional libraries shown on the Syndicator.
383 of 439
Click on Add a vault slot and create a slot. Be sure to use an Administrator id as a userid.
384 of 439
Standalone server: Servers > Server Types > WebSphere application servers > WebSphere_Portal > Java and Process Management > Process definition > Java Virtual Machine Clustered server: System administration > Deployment manager > Java and Process Management > Process Definition > Java Virtual Machine
Update the value in the Maximum Heap Size field. A value of at least 1024 MB is recommended.
385 of 439
Enter the syndicator URL in the form of http://HostName:HostPort/WcmContextRoot. For example: http://wcmwikiauth.itso.ibm.com:10039/wps/wcm a name for the syndicator item. This name is used as the name of the syndicator item created on the syndicator server, so enter a name that helps identify the syndication relationship you are creating. Enter a name for the subscriber item. This name is used as the name of the subscriber item created on the subscriber server, so enter a name that helps identify the syndication relationship you are creating. Select the credential vault slot you created previously and Click Next.
Then select the libraries you want to subscribe and also select a the Syndication Type in the drop down Scope menu.
386 of 439
Click Finish. You will see a Confirmation Message similar to that shown below.
To begin syndication, click either Update Subscriber or Rebuild Subscriber button. You can see the Confirmation once you click Refresh.
After this step, access the Portal Administration Console on the Syndicator node and go to Administration > Portal Content > Syndicators and you will see the Syndicator already created based on the data entered in the Subscriber and also the status.
387 of 439
Update (Syndicator/Subscriber)
Manual action to override the syndication interval and initiate syndication directly. This action is useful when automatic syndication is disabled. Click on the first icon to trigger this action. The Update to Subscriber. action will push the new updates
Rebuild (Syndicator/Subscriber)
Manual action to overrides the syndication interval and trigger the syndicator to send all action is used when the datastore on updates to the subscriber. Generally, the rebuild the subscriber is lost or corrupted. This action is useful when automatic syndication is disabled. You click on the second icon to trigger a rebuild action.
388 of 439
The following figure shows the Web Content Syndicators view with the WcmWikiAuthSyndicator's status being idle.
The table below provides details about the different states and provides a brief description. Status Idle Pending Queued Description The syndication process is idle. The syndicator has received a request, but it has yet to initiate it. The syndicator has sent a request to the syndication application, but syndication is not yet active. This state will not occur if the subscriber has initiated syndication. The status remains as Idle until syndication begins and the status then changes to Active. The syndication process is active. The syndication process is disabled. If syndication was already in process prior to being disabled, the status can be a combination of Disabled and Pending, Queued, or Active.
Active Disabled
Once the syndication process has completed, the Syndicator and Subscriber views display the idle status as illustrated in the screenshots above.
389 of 439
390 of 439
The following table describes the information available in the Syndicator and Subscriber status reports. Field Name Syndicator and subscriber ID, name, and URL Enabled Type Description This information provides identifying details about the syndicator and subscriber that are engaged in syndication.
This field indicates whether syndication is enabled for the syndicator or subscriber. This field indicates whether partial or full syndication occurred. With partial syndication, only those items that have been updated since the last syndication are replicated. Full syndication replicates all items, regardless of whether they have been updated since the last syndication. These fields provide the date and time when syndication started and finished. This field indicates whether syndication was successful. This field provides detailed information about the syndication result, including any errors that occurred during syndication.
391 of 439
Updates sent
This field indicates the number of items that have been updated. This includes new items that have been added and existing items that have been updated. This field indicates the number of items that have been removed. This field displays state information for a syndicator or subscriber before and after syndication occurred. This information is provided for the opposite member of the syndication relationship, so for example if you are viewing syndication results for a syndicator, the old and new states for the subscriber are displayed. If successful, this field indicates the actual change of status. If syndication has failed, this indicates what should have been the change of status. Note: The syndication state only displays a list of item gatherer ids and the current state. It is designed to be used as a diagnostic tool when troubleshooting syndication. This lists: the number of updates sent the number of successful updates the number of failed updated
Removes sent Old state and new state for subscriber or syndicator
Update summary
Note: The number of updates listed here does not directly relate to the number of items updated. For example, if you create a library and then create a taxonomy item in the library, you have updated a single item. However in the Update summary this will be displayed as three updates; one for the library, one for the new taxonomy and one for its version. Update details This section provides additional information to the Update summary section. It lists: the number of items that didn't require an update because they have already been updated the number of new items created the number of items updated the number of failed updates the number of items that didn't require removal because they have already been removed the number of failed removals the number of items removed
392 of 439
393 of 439
The figure below shows the Subscribers file system directory after syndication.
Files can remain in the subscriber directory for any of the following reasons: A failed attempt to save to the database due to a software error Syndication is interrupted or killed before it completes writing to the database WCM is not handling the syndication changes properly
394 of 439
You cannot syndicate to a pre-existing library (on the Subscriber) with the same name as the Syndicator library. Even though the two libraries might have the same name, they have different unique ID's. Search Collections are not syndicated which means they have to be created on both servers. JSP files used by WCM JSP components aren't syndicated, so you need to ensure that they manually copied to any Subscriber servers. It is expected that the Syndicator and the Subscriber should share the same user repository if they use automatic syndication. If this is not the case, disable automatic syndication and perform manual syndication. The latter should be followed by executing the MemberFixer module. Library access control settings are not part of syndication, and hence you must manually set access permissions on the subscriber's library when syndicating for the first time.
395 of 439
When a member that has been given permissions on a library is deleted, the member permissions are removed from the library, so that any inherited permissions for items in the library will also be removed. Therefore, the member fixer task cannot be used to update these permissions to a different member. However, when an LDAP transfer is carried out, the member permissions on the library are maintained. So, the member fixer task can be run after an LDAP transfer to update or remove these permissions.
As an administrator, log into the the IBM WebSphere Application Server administration console and navigate to the following: Resources > Resource Environment > Resource Environment Providers > WCM WCMConfigService.
2. From the WCM WCMConfigServices page that is loaded, click on Custom properties as shown in the screenshot below.
396 of 439
3. Set or update the following properties on the server where you will run the member fixer tool: - connect.businesslogic.module.memberfixer.class = com.aptrix.pluto.security.MemberFixerModule - connect.businesslogic.module.memberfixer.remoteaccess = true - connect.businesslogic.module.memberfixer.autoload = false
4. Save the changes and restart the server for these settings to take effect.
Custom mapping
To update a reference to a member that does not exist with a member that does exist, member mappings can be defined in a custom mapping file. Where the member fixer task does not find a mapping in this file for a member, it will search the user repository for members with the same ID as the member that no longer exists. If such a member is found, it will update the reference with this user or group, or remove the reference, as specified by the -DaltDn parameter described below. If no such member is found, this
397 of 439
member is classified as 'invalid' and will be updated or removed as specified by the DinvalidDn parameter described below. Use these steps to define member mappings in a custom mapping file:
1.
2. As shown in the screenshot, the examples available in the file demonstrate how you can either configure a full replacement of one distinguished name with another or you can configure part replacement of a distinguished names which will change all of the distinguished name except the common name. 3. Once you have defined the member mappings, you can save the file and then run the member fixer task using the -DaltDn option as described below.
398 of 439
PortalAdminId and PortalAdminPwd settings in the wkplc.properties file. Use this parameter in the command to identify the web content library. If this parameter is omitted, the default library that has been configured with the defaultLibrary property in the WCM WCMConfigService service is used. Use this parameter in the command when non-existent users or groups have alternate distinguished names (DNs) available and you want to update the items that reference the non-existent users or groups. Use this parameter in the command when non-existent users or groups have alternate distinguished names (DNs) available and you want to remove the members that reference the users or groups. If users or groups have invalid distinguished names (DNs) the report will list these as "invalid". This means the distinguished name doesn't exist and there is no alternate distinguished name available. Use this parameter in the command to update users and groups that have invalid distinguished names with the portal administrator user's distinguished names. Use this parameter in the command to remove users and groups that have invalid distinguished names. Use this parameter in the command when users or groups have been found with mismatched unique IDs and you want to fix these users and groups with mismatched unique IDs. Use this parameter in the command when users or groups have been found with mismatched unique IDs and you want to remove these users and groups with mismatched unique IDs. Use this parameter in the command to preserve the last modified date of items updated by the member fixer task. Otherwise the last modified date will be updated when the member fixer task is run. Use this parameter in the command to restrict which item types are processed. The member fixer tool can be run against the following item types: content folder project style (for presentation templates) template (for authoring templates) taxonomy category SiteArea Workflow WorkflowStage
-DaltDn=update
-DaltDN=remove
-DinvalidDn=update
DrestrictOn=<ItemType >
399 of 439
If this parameter is not used, the member fixer module will run against all the item types. You can specify more than one item type by separating values with a comma. Example: -DrestrictOn=content,folder,project DsessionTimeOut=<tim eOut> Use this parameter in the command to prevent your session timing out before the task has finished. This sets the number of seconds in which the task must complete before its session will timeout. The default session timeout is 14440 seconds, which is 4 hours. For large repositories you should increase this setting. Example: -DsessionTimeOut=36000, which is 10 hours. In a federated security environment with multiple realms, use this parameter in the command to specify the realm to run the member fixer task on. If this parameter is omitted the default realm will be used. The member fixer task will check whether there are any members and groups referenced in items that are under any of the base distinguished names defined for the specified realm and fix these references. References to members can only be updated with references to members in the specified realm. In a federated security environment with multiple realms, the member fixer task should be run for each realm in turn to make sure that all of the references are fixed. The member fixer task can be used to check whether there are any members and groups referenced in items that are not under any of the base distinguished names defined for any of the realms in the environment and fix these references. To do this, follow the same steps described above for a single realm environment and add -DnoRealmDn=true to the command. Use this parameter in the command to run the member fixer task in fix mode. If this parameter is omitted the member fixer task will run in report mode only.
-Drealm=<realmName>
-DnoRealmDn=true
-Dfix=true
400 of 439
For example: To run the member fixer task in report mode against your library run the following command: ConfigEngine.bat run-wcm-admin-task-member-fixer -DPortalAdminId=<username> DPortalAdminPwd=<password> -Dlibrary="<library name>" 3. Before progressing to the next step and running the member fixer task in fix mode, ensure that the report mode indicates that the updates will happen as you require. A summary of the updates will be shown by the command. A detailed report containing the updates that will be made for each item will be shown in the SystemOut.log file located in <wp_profile_root>\logs\WebSphere_Portal. If the report indicates that the update will not happen as required, change the member fixer task parameters and run the report mode again. Repeat this process until you are satisfied that the fixes will be applied correctly. This is important because the fixes made by the member fixer task when run in fix mode may not be easy to undo if incorrect fixes are applied. Use the parameters available to run the member fixer task as per your requirement.
Example
In the example below we have captured some screenshots of running the member fixer task in report mode against the Sample library which we had imported into our WCM server. 1. We modified the <wp_profile_root>/PortalServer/wcm/shared/app/config/wcmservices/MemberFixerM odule.properties file and added the following value to it: uid=xyzadmin,o=defaultWIMFileBasedRealm -> uid=portaladmin,o=defaultWIMFileBasedRealm 2. Ensuring the WebSphere Portal server was running, we then ran the following command from <wp_profile_root>/ConfigEngine: ConfigEngine.bat run-wcm-admin-task-member-fixer -DPortalAdminId=portaladmin DPortalAdminPwd= -Dlibrary="Sample" The screenshot displays a snippet of the command prompt messages:
401 of 439
3.
Once the process was completed, we checked the SystemOut.log and a snippet of log file is included below for reference.
402 of 439
-DallLibraries=true
DrestrictOn=<ItemType >
403 of 439
style (for presentation templates) template (for authoring templates) taxonomy category SiteArea Workflow WorkflowStage WorkflowAction Cmpnt (for components)
If this parameter is not used, the member fixer module will run against all the item types. You can specify more than one item type by separating values with a comma. Example: -DrestrictOn=content,folder,project DsessionTimeOut=<tim eOut> Use this parameter in the command to prevent your session timing out before the task has finished. This sets the number of seconds in which the task must complete before its session will timeout. The default session timeout is 14,440 seconds, which is 4 hours. For large repositories you should increase this setting. Example: -DsessionTimeOut=36000, which is 10 hours.
404 of 439
2. From the WCM WCMConfigServices page that is loaded, click on Custom properties as shown in the screenshot below.
3. Set or update the following properties on the server where you will run the member fixer tool: connect.businesslogic.module.workflowenablement.class=com.aptrix.pluto.workflow. WorkflowEnablementModule - connect.businesslogic.module.workflowenablement.remoteaccess=true - connect.businesslogic.module.workflowenablement.autoload=false
405 of 439
4. Save the changes and restart the server for these settings to take effect.
&workflow=<workflowname>
&workflowstage=<workflowstagename>
&preserve_dates=true
&restrictOn
406 of 439
folder project style (for presentation templates) template (for authoring templates) taxonomy category SiteArea Workflow WorkflowStage WorkflowAction Cmpnt (for components)
If this parameter is not used, the workflow update tool will run against all the item types. &forceUnlock=true Use this query string parameter to force locked items to be unlocked while running the workflow update tool. Use this query string parameter to prevent your session timing out before the workflow update tool task has finished. This sets the number of seconds in which the task must complete before its session will timeout. The default session timeout is 14440 seconds, which is 4 hours. For large repositories you should increase this setting. Example: &sessionTimeOut=36000, which is 10 hours.
&sessionTimeOut=<timeOut>
407 of 439
2. From the WCM WCMConfigServices page that is loaded, click on Custom properties as shown in the screenshot below.
408 of 439
3. Set or update the following properties on the server where you will run the clear history tool: - connect.businesslogic.module.clearhistory.class=com.aptrix.history.ClearHistoryModule - connect.businesslogic.module.clearhistory.remoteaccess=true - connect.businesslogic.module.clearhistory.autoload=false
Save the changes and restart the server for these settings to take effect.
409 of 439
history entries prior to this date. If no date is specified, then the date will default to one year before the current date. &keep Use this query string parameter to specify the minimum number of history entries to keep. If a number is not specified, then the minimum number of history entries to keep will default to 10. Example: If an item has not been updated for over a year, and you specify to clear all history entries more than a year old, but choose to keep the last five history entries, all the history entries will be cleared except for the last five history entries even though they are over a year old. Use this query string parameter to restrict which item types are processed. The clear history tool can be run against the following item types: content style (for presentation templates) template (for authoring templates) taxonomy category SiteArea Workflow WorkflowStage WorkflowAction Cmpnt (for components)
&restrictOn
If this parameter is not used, the clear history tool will run against all the item types. &library Use this query string parameter to specify the web content library you want to run the clear history tool against. If the library query string parameter is omitted, this tool will run against the default library that has been configured in the WCM WCMConfigService service using the IBM WebSphere Application Server administration console.
410 of 439
&fix
Use this query string parameter to run the clear history tool in report mode or fix mode. If this query string parameter is omitted or set to false, a report listing of which history entries will be cleared is displayed. If set to true, history entries will be cleared as specified.
411 of 439
2. From the WCM WCMConfigServices page that is loaded, click on Custom properties as shown in the screenshot below.
3.
Set or update the following properties on the server where you will run the clear version tool: connect.businesslogic.module.clearversions.class=com.aptrix.versioncontrol.ClearVe rsionsModule - connect.businesslogic.module.clearversions.remoteaccess=true - connect.businesslogic.module.clearversions.autoload=false
412 of 439
4. Save the changes and restart the server for these settings to take effect.
&keep
&restrictOn
413 of 439
content style (for presentation templates) template (for authoring templates) taxonomy category SiteArea Workflow WorkflowStage WorkflowAction Cmpnt (for components)
If this parameter is not used, the clear versions tool will run against all the item types. &library Use this query string parameter to specify the web content library you want to run the clear versions tool against. If the library query string parameter is omitted, this tool will run against the default library that has been configured in the WCM WCMConfigService service using the IBM WebSphere Application Server administration console. Use this query string parameter to run the clear versions tool in report mode or fix mode. If this query string parameter is omitted or set to false, a report listing of which versions will be cleared is displayed. If set to true, versions will be cleared as specified.
&fix
414 of 439
415 of 439
Use the New action to create a new feed configuration and enter a suitable name for this feed configuration.
3. Enter the WCI feed URL. Note that spaces in the URL should be replaced with a + sign and non-ascii characters should be encoded. 4. Select a credential slot for the feed. This will need to be created prior to creating the feed configuration. 5. Select the web content library this feed configuration will save the content. 6. Select a credential slot for the web content library. This will need to be created prior to creating the feed configuration. 7. Select the preferred method to pass the handshake data either in the feed or in the HTTP headers. In the Feed The feed producer puts the information in the feed and the consumer returns the values via the query string. Each time the consumer makes a request for the feed URL, the following query string is appended: ?etag={etag_value}&lastMod={last-modified_value} Feeds sent back from the producer contain the following channel-level elements:
416 of 439
<lastBuildDate>{last-modified_value}</lastBuildDate> <ibmfs:etag>{etag_value}</ibmfs:etag> In the HTTP Headers The handshake data is exchanged using standard HTTP protocol header fields. This is the default and preferred method. Requests from the Consumer contain: If-Modified-Since : {last-modified_value} If-None-Match: {etag_value} Responses from the producer contain: ETag: {etag_value} Last-Modified: {last-modified_value} 8. Select whether to check the publication date or not. If selected, web content items that have the same publish date as the feed source will not be processed. 9. If you want to use an XSLT style sheet, select Enable XSLT and specify the path to the XSL file relative to the /config/xslt directory in the feed Service application. 10. Use either the Save action to save the configuration without consuming the
to do save and consume feed, or Save and Consume action the feed. 11. Look at the SystemOut.log file to see messages from the Consume task. A snippet of the SystemOut.log file is included in the screenshot below.
417 of 439
418 of 439
3. Define how often (minutes, hours or days) you want to run this job by entering and selecting the values in the Run Every field. 4. Select the feed configuration that you have configured from the list.. You can use the Remove action to remove an existing feed configuration selection. 5. Use the Save action to save the configuration.
419 of 439
5.5. Caching
Caching in IBM Web Content Manager (WCM) can be performed at three different levels: Web server: using a caching proxy module part of Websphere Edge components Application Server: using WebSphere Servlet Caching to store the responses generated by the WCM servlet or portlets for future users WCM: Elements can be cached in WCM reducing the number of database calls.
IBM Web Content Manager generated web pages and content from external data sources can be cached by the Web Content Manager application If utilized correctly, Web Content Manager caching can dramatically increase the performance of a site. More details about caching are available in the IBM Web Content Manager product infocenter and in the wiki article Web Content Management Caching and Pre-rendering Reference URL : http://www-10.lotus.com/ldd/portalwiki.nsf/dx/Caching_options_wcm7 and http://www-10.lotus.com/ldd/portalwiki.nsf/dx/web-content-management-caching-and-prerendering
420 of 439
1. Site - This is the same as the basic web content cache except that cache parameters in connect tags and URL requests can be used to override your server's default advanced web content caching settings. 2. Session - When session caching is enabled, a copy of each Web page a user visits is stored in the session cache. The User accesses the cached version of a web page until they start a new session, or until the cached web page is expired from the cache 3. User - When user caching is enabled, a copy of each Web page a user visits is stored in the user cache. The user accesses the cached version of a web page until the cached web page is expired from the cache 4. Secured - Secured caching is used on sites where the item security features are used to grant different users access to different Web pages and components based on the groups they belong to. 5. Personalize - Personalized caching is used to cache web pages of users who have the same "personalization profile". This means that users who have selected the same personalization categories and keywords, and who belong to the same group, share a single cache.
Alternately you can uncomment and update the desired property in the WCMConfigService.properties file in \PortalServer\wcm\shared\app\config\wcmservices directory and then run the config task update-wcm-service-properties. Refer to the IBM Web Content Manager Infocenter for more details. URL : www.lotus.com/ldd/portalwiki.nsf/dx/Setting_service_configuration_properties_exp7
421 of 439
1: 2: # Advance caching 3: connect.moduleconfig.ajpe.contentcache.defaultcontentcache=Secured 4: connect.moduleconfig.ajpe.contentcache.contentcacheexpires=REL 600s 5: # Basic cache 6: #connect.businesslogic.defaultcacheexpires=REL 3D 7: #connect.businesslogic.defaultcache=false Note: You will need to restart WebSphere Portal to enable any configuration changes made. When making changes to clustered servers, you will need to ensure the WCM WCMConfigService service section under the Cluster Scope is updated.
services/cache/iwk/session
You can get the Cache Statistics or review the cache content, invalidate a cache, etc using the WebSphere Application Server extended cache monitor.
422 of 439
Refer to WebSphere Application Server Infocenter for more details on monitoring and managing cache. The below screenshot provide on example on what is seen in the in the cache monitor application when you select the Cache Content option. This enables you to invalidate a specific cache or you you clear all caching the Cache Statistics panel.
5.6. Deployment
This section covers a high level overview of the authoring environment and the various options available for delivery of IBM Web Content Manager (WCM) content.
Authoring environments
The WCM authoring environment is usually the environment in which the content authors and editors will create and update content and approvers will approve the content before it is published. There are various WCM authoring topologies that are possible. Refer to the following wiki article that describes these authoring topologies: http://www-10.lotus.com/ldd/portalwiki.nsf/dx/5.2.2-authoring-environments Note: Even though the link refers to the wiki topic from the previous version of WCM, the authoring topologies described still apply to WCM v7.
Rendering environments
WCM sites can be delivered using one of the following three mechanisms: Porlet rendering (local and remote) Servlet rendering Pre-rendering
423 of 439
2.
Click on Add portlets action 286). Select the portlet and click OK.
424 of 439
3.
The web content viewer is now added to the portal page. The screenshot below displays multiple web content viewer portlets on the portal page.
4.
Click on the Edit shared settings action to configure the web content you want this web content viewer to display.
425 of 439
5. A new window will pop up as shown in the screenshot below. The Content section enables you to select the content from a web content library to display in the portlet. The Profile section contains profiling settings for the JSR 286 web content viewer where you can specifying categories, site areas, and authoring templates that can be used as menu search options. The Portlet Settings section defines additional settings for the JSR 286 web content viewer where you can set the portlet and page display title and configure the portlet cache options. The Advanced Options section allows you to define the broadcast behavior between web content viewers, specify if context processors plug-ins are applied and set the scope of the tag cloud results.
426 of 439
Refer to the following wiki link to understand each of these sections in detail: http://www10.lotus.com/ldd/portalwiki.nsf/dx/Editing_the_settings_of_a_web_content_viewer_por tlet_wcm7
427 of 439
6. Clicking OK to display a preview of the content you selected for the web content viewer portlet.
Remote rendering option Yes (if redirection is setup and fully qualify URLs is disabled) Low
Secondary Consideration WCM server can be placed behind a firewall WCM related CPU activity on the delivery server Complexity of administration Network traffic CPU requirement Dynamic linking using Web Content Pages Tagging and rating
High
More servers to administer Longer network path Less CPU requirement Is not possible Is not available
Less servers to administer Less network activity High CPU requirement Is possible using JSR 286 portlet Is available using JSR
428 of 439
the page to the web content site structure in your Web Content Manager system. When you add the web content viewer to a web content page, the portlet automatically renders the default content of the attached site or site area. In addition to displaying the default content, the web content viewer provides a dynamic broadcasting option that selects the best matching web content page when selecting links to other content items. For additional details on web content pages refer to the following wiki link: http://www-10.lotus.com/ldd/portalwiki.nsf/dx/Working_with_web_content_pages_wcm7
Note: As non-ascii characters can not be used in the query string section of URLs it is important that you do not use such characters in the names field of WCM items. Refer to the following URL for example URLs of Servlet rendering: http://www10.lotus.com/ldd/portalwiki.nsf/dx/Accessing_web_content_via_a_servlet_wcm7
429 of 439
5.6.3. Pre-rendering
The pre-rendering process takes a copy of the entire IBM Web Content Manager (WCM) website and saves the site as static HTML files and resource files (images, CSS etc.). These static pre-rendered files can be delivered by the WCM server or by the HTTP web server. This improves the website delivery performance as the pages are not dynamically rendered on the fly. This section discusses how to configure WCM for pre-rendering.
Important considerations
Carefully read through the following important considerations before you use prerendering as an option: Pre-rendering is ideal when the WCM website content does not change very frequently. A personalized website cannot be pre-rendered. The pre-rendering process is configured to run as a user (connect.moduleconfig.cacher.rendereruser) and hence the website snapshot is taken as per the access privileges available to the selected user. It can take a long time to pre-render a large site. While the site is being pre-rendered WCM authoring portlet users may be locked out of the system until the pre-rendering process is completed. So it is recommended that a dedicated pre-rendering server be responsible for pre-rendering. The entire site must be pre-rendered before it can be used, otherwise there will be broken links. Website using page navigation components and WCM Search components cannot be pre-rendered. The path to the content item cannot exceed the operating systems maximum path length which is 255 characters on Microsoft Windows and 1024 characters on Linux. Invalid Characters in Site, Site Area or Content Names: Sites, Site Areas, and Content objects cannot contain characters that are considered invalid in file names by the operating system where the server will pre-render.
Configuring pre-rendering
Pre-rendering configuration can be done from the IBM WebSphere Application Server administration console:
1.
As an administrator, log into the the IBM WebSphere Application Server administration console and navigate to the following: Resources > Resource Environment > Resource Environment Providers > WCM WCMConfigService.
430 of 439
2.
From the WCM WCMConfigServices page that is loaded, click on Custom properties as shown in the screenshot below.
Note: Refer to the following wiki links to get details on the additional properties that you need to configure for pre-rendering and to learn more about how to pre-render a WCM website respectively: http://www-10.lotus.com/ldd/portalwiki.nsf/dx/Configuring_prerendering_wcm7 http://www-10.lotus.com/ldd/portalwiki.nsf/dx/Prerendering_a_website_wcm7
431 of 439
Save the setting and restart the server for this setting to take effect. Note: You cannot use the local rendering portlet (Web Content Viewer) when prerendering is set as the default module.
Save the setting and restart the server for this setting to take effect.
5.7. Troubleshooting
IBM Web Content Manager (WCM) writes information, warning and error message to logs during configuration and at real time. These message provides details to resolve problems. The product Infocenter, Troubleshooting section provides details on the logging and information about various log files. URL : http://www-10.lotus.com/ldd/portalwiki.nsf/dx/Troubleshooting_wcm7 You can enable logging and tracing for software that is shipped with IBM Web Content
432 of 439
Manager. If you are experiencing a problem, you might want to enable tracing and then recreate the problem to capture more log information.
Enabling tracing
Enabling tracing makes log output more verbose. For example, you can enable tracing within WebSphere Application Server to obtain information about application servers and other processes. Refer to IBM Web Content Manager Infocenter for more details and also to the MustGather data collection lists used in troubleshooting various problems in IBM Web Content Manager. You can enable and disable temporary tracing or setup extended tracing from startup. Refer to WebSphere Portal Family Wiki - Troubleshooting Web Content Manager section for articled that provides more specific details on troubleshooting and resolving various problem with IBM Web Content Manager. (Reference URL : http://www10.lotus.com/ldd/portalwiki.nsf/xpViewCategories.xsp?lookupName=Troubleshooting%20 Web%20Content%20Manager )
Temporary tracing
To enable temporary tracing: 1. Access IBM Web Content Manager as an administrator, then navigate to Administration > WebSphere Portal > Portal Analysis > Enable Tracing. 2. Enter the trace settings for the problem you are trying to troubleshoot and click the icon. Example : com.ibm.workplace.wcm.*=all:com.aptrix.*=all:com.presence.*=all
433 of 439
3. Reproduce the issue and then remove the trace string by selecting the setting you icon. need to remove and click the 4. The trace is written to trace.log file in the application server log directory. Example : C:\IBM\WebSphere\wp_profile\logs\WebSphere_Portal\trace.log.
Extended tracing
Extended/Static tracing is the recommended method of capturing data as it collects data from server startup until problem recreation. You can configure extended tracing as follows: 1. Log into the Integrated Solutions Console as the WebSphere Application Server administrator and navigate to Troubleshooting >Logs and Trace >WebSphere_Portal >Diagnostic Trace. 2. On the Configuration tab, ensure you increase the Maximum File Size and and Maximum Number of Historical Files as needed so that the tracing of the problem recreation is not overwritten due to the amount of traffic on the system and output of the tracing itself. 3. Click Change Log Level Details and enter a trace string. Example : com.ibm.workplace.wcm.*=all:com.aptrix.*=all:com.presence.connect.*=all
434 of 439
followed by:
4. Click OK and save the changes. Restart the WebSphere_Portal application server.
Collecting logs
The location of log files are documented in IBM Web Content Manager Infocenter in section Logging and Tracing. URL : http://www-10.lotus.com/ldd/portalwiki.nsf/dx/Logging_and_tracing_wcm7 If any assistance is required you can contact the IBM Product Support and create a PMR and request assistance. Collecting MustGather data early and submitting this when opening a PMR will help get a resolution much quicker. Run the following script from /PortalServer/bin to collect the data: Windows: wpcollector.bat Linux/Unix/i: wpcollector.sh Note: If you want to use wpcollector to FTP the files to IBM Support, include the -Dpmr= parameter to indicate the relevant PMR #. For example: wpcollector.bat -Dpmr=11111,222,333 If you did not FTP your files via wpcollector, locate the "wp.mustgather.zip" file or the "wp.mustgather-timestamp.zip" file in /filesForAutoPD/ and you can send the logs to IBM Support for review and assist. Details on how to Exchanging information with IBM Technical Support for problem determination is documented in link below. http://www.ibm.com/support/docview.wss?rs=688&uid=swg21201571
435 of 439
Split-second utility
Split-second is an innovative performance troubleshooting tool designed to fill the gap between no-cost but unreliable performance trouble shooting approaches and elaborate but expensive performance monitoring tools. URL : https://greenhouse.lotus.com/plugins/plugincatalog.nsf/assetDetails.xsp?action=editDocu ment&documentId=376ACFB8593EEC0A85257832005A4F8A
436 of 439
One of the main hurdles that developers and support personnel face when debugging performance issues is identifying the problem area(exact method) and also the stack leading up to it. Using Split-Second, anyone can build and deploy an instrumented module with minimal effort containing the suspect packages which would record the method call execution times and dump the thread stack when the times exceeds a certain threshold. The advantage of using this approach is that we do not need to hard code the logic in each and every method. No tracing needs to be enabled for the stack to be dumped and the response threshold times can be made configurable. Split-Second an extremely useful tool in the field to identify the performance bottleneck root cause very quickly. It is not specific to any product and can be used for any java based application. SplitSecond 3.x is currently not compatible with WCM syndication. Before using SplitSecond, disable automatic syndication as per the infocenter instruction.
437 of 439
The screenshot below shows after the data has been captured.
438 of 439
439 of 439