Web Content Production with Web Forms [ 152 ] 3. The uploaded le will be shown under the Browse Files folder. Click on the Edit action for the EditNews.xml le as shown in the following screenshot: 4. Opening this will show a link: To edit this le using a Web Form, click here. 5. Clicking on this link will show a next screen in which you can select a web form to be associated with the uploaded XML le. Click on OK. Download from Wow! eBook <www.wowebook.com> Chapter 4 [ 153 ] 6. You will see the news web form. You can ll the content for the news web form and select Next. The summary page will be open, which will display details about the web form and content. You can preview content (to preview content, note that the virtual server should be running). Also, you can submit the content to the staging server (you will learn in detail about the staging server in later chapters). Click on Finish. Static and dynamic include of content This section is in reference to the Advance schema attributes section of the web form. In the previous section, we discussed only the syntax to be used for include. Consider a scenario where you want to populate a dynamic combo box. Let's create a web form to input values for populating the combo box. Create the newstype.xsd and newsType.ftl les and populate these with the downloaded code from the Packt website. Download the complete code samples from the Packt website. Download from Wow! eBook <www.wowebook.com> Web Content Production with Web Forms [ 154 ] 1. To create and congure web forms to the Cignex web project, see the section Creating web forms. Create web content using the newsType web form. Click on the Create Content action. 2. On clicking Create Content, add values as shown in the following screenshot. 3. Click on Next. Add values as shown in the next screenshot: Download from Wow! eBook <www.wowebook.com> Chapter 4 [ 155 ] Do not proceed to the subsequent sections without rst creating web content using the news Type web form. Please specify the output path pattern as shown in the earlier screenshots. Provide common/inc/${name}.xml as the output path pattern for XSD and ${name}.jsp for template. Also, keep your virtual server running. 4. Edit news.xsd and add the following line of code before dening a root element. We are including one JSP into the other XSD. <xs:include schemaLocation="/common/inc/NewsType.jsp" /> 5. Add the following block of code anywhere after the root element is dened: <xs:element name="ContentType" type="trn:newsType" > <xs:annotation> <xs:appinfo> <alf:appearance>minimal</alf:appearance> </xs:appinfo> </xs:annotation> </xs:element> Download from Wow! eBook <www.wowebook.com> Web Content Production with Web Forms [ 156 ] 6. Now create content using the news web form. You will see the combo box populated with the values you added while creating content for the NewsType web form. Web publishing dashlets Alfresco provides two new dashboard components, My Web Forms and My Web Files, which put the needed set of publishing operations at the ngertips of any knowledge worker, helping them to access and speed through the publishing process while masking the underlying process and structure of the Web Content Management system. Follow the next steps to congure dashlets: 1. In the Alfresco Explorer user interface, the My Alfresco area is known as the Dashboard. 2. Click on the My Alfresco menu link in the toolbar to view your personal dashboard. 3. To start conguring your dashboard, click on the Congure icon given in the My Alfresco dashboard. The Congure Dashboard Wizard will open up a screen, allowing you to select the dashboard layout and dashlets. Select the style of layout you wish to have for your dashboard. Click on the Next button to move to the next step, selecting the dashboard components. Download from Wow! eBook <www.wowebook.com> Chapter 4 [ 157 ] 4. Select the following components: ° My Tasks To Do: Lists all the tasks assigned to you that are pending ° My Web Forms: Lists all the web forms available to the web project and can create content directly from here ° My Web Files: Lists all the web forms available to the web project and can edit content directly from here 5. Click on the Next or Finish button to save your selection. The selection is effective immediately, and you can see the dashboard with your selections, as shown in the next screenshot: Download from Wow! eBook <www.wowebook.com> Web Content Production with Web Forms [ 158 ] Summary In this chapter, we have learned how Alfresco WCM makes it simpler to manage content through a user-friendly and technology-neutral (as much as possible) interface: • Alfresco web forms enable users to create XML content from a simple browser-based form. • There are three types of renditions available: FTL, XSLT, and XSL-FO. With renditions, you can manage the content in various formats. • A dynamic website can be developed easily with the web forms. • Web forms can associate with specic/multiple projects. • Web content can be searched using a query. • Dashlets are provided to access easily and speed through the publishing process. In the next chapter, we are going to learn about WCM Workows. Workows can be congured for any web form. Through workow, web content can be submitted to the Staging Sandbox. From the Staging Sandbox it can deployed to servers. Download from Wow! eBook <www.wowebook.com> WCM Workows Workow is an automation of a business process, during which documents are passed from one participant to another for action, according to a set of procedural rules. Every content management system implementation will have workow requirements. Workow provides ownership and control on the content and processes. Alfresco web project uses workows to support any set of changes, either automated or user-driven steps, in a business process before nal commit to the Staging Sandbox. WCM Workows can be congured for each form or for any arbitrary set of non-form assets. In this chapter, you will understand the basic out-of- the-box workow capabilities of the Alfresco WCM and the ways to extend it as per your business requirements. By the end of this chapter you will have seen the: • Advantages of workow • Introduction to the workow process • Out-of-the-box workows • Associating workows to web forms • Associating workows to web projects • Dynamically changing workow for each snapshot submission • Process of dening and using your custom workow • Use of expiration date Download from Wow! eBook <www.wowebook.com> WCM Workows [ 160 ] Why workows are required Consider that we want to develop any website; so our rst step will be to create web content, and the next step will be to get the approval of the reviewers in order to publish content onto live servers. We would also like to set up a test server so that one can preview the changes and nally the content can be pushed to the staging servers and then live servers. At each stage it seems we require a set of processes to be followed to get our approval completed and go to the next stage. This can be achieved using WCM Workows. WCM Workows are required to follow the user approval process for submitted content, to publish them on the Staging Sandbox. You must deal with the approval of content items that are routed through workow and the submission of the items to staging servers and then the live server. Submitted changes are routed via workow (assume workow is congured for the web project) for one or multiple users to review and approve, either serially or in parallel, using Alfresco's out-of-the-box workow (or any custom-built WCM Workow). On approval of the item, content is submitted to the Staging Sandbox. Even if we don't congure workow for any item, the submission takes place in the background using workow and each content item remains in the Modied Items list until its submission is complete. To verify this you can see a workow task in the My Task To Do dashlet of the content reviewer for a fraction of a second. Refresh the page as necessary, to see if the workow task has been removed from the My Task To Do dashlet and that the Modied Items list of the user's sandbox is empty. The additional advantage you get from workow is that you can congure the launch date and expiration date when promoting content to staging. Prior to this launch date, users can preview the changes and cancel the pending launch if required. In the Staging box, it will be reected in Content Awaiting Launch. Upon expiration, users can see that item as a task in their My Tasks To Do dashlet to decide whether the content should be updated or removed from the site. This content expiration also works in conjunction with Alfresco's new Links Validation service, ensuring that the site's link integrity is incrementally tested against the new pending update. In this manner, content cannot only be regularly refreshed through an automated, task-driven review process, but can also be tested upon change so that no errors are accidentally introduced in the form of broken links. Another advantage is that once the content is approved, a snapshot is taken to the Staging box. For each submission a snapshot is maintained, which gives the advantage to roll back to any submission at any point of time. Download from Wow! eBook <www.wowebook.com> Chapter 5 [ 161 ] In the previous chapter you learned how to create content. At this point, your web project is populated with content items, some imported and some created. Now you want to submit the content to the Staging box. You must congure a workow process to get the approval, so the content is now routed through workow to content reviewers for approval. Once you have approved all of your content, modied items are deployed to the staging server. Introduction to the workow The WCM Workow uses the JBoss Business Process Management (jBPM) engine in its core. jBPM is an open source, standalone workow engine. It can run in any servlet container—it doesn't require the JBoss Application Server. The jBPM engine is responsible for managing deployed processes, instantiating and executing processes, persisting process state and metadata to a relational database (via Hibernate), and tracking task assignment and task lists. JBoss jBPM is a exible, extensible workow management system with an intuitive process language to express business processes graphically in terms of tasks, wait states for asynchronous communication, timers, and automated actions. With jBPM, the Alfresco platform is extended to support complex, task-oriented processes. jBPM is built on the idea that any process can be described as a graph or a set of connected nodes. jBPM maintains a list of tasks assigned to each participant. How users interact with the task list is up to each application. In Alfresco, a dashlet displays a to-do list for the currently logged in user. As users complete their tasks the tasks are removed from the to-do list. Download from Wow! eBook <www.wowebook.com> . downloaded code from the Packt website. Download the complete code samples from the Packt website. Download from Wow! eBook <www.wowebook.com> Web Content Production with Web Forms [ 154 ] 1. To. Forms [ 154 ] 1. To create and congure web forms to the Cignex web project, see the section Creating web forms. Create web content using the newsType web form. Click on the Create Content action. 2 workow • Introduction to the workow process • Out-of-the-box workows • Associating workows to web forms • Associating workows to web projects • Dynamically changing workow for each