Edit web forms for renditions

You have added associate web forms and template to a web project. Now you want to update the templates and preview it. Follow these steps:

  1. Navigate to Company Home | Data Dictionary | Web Forms | blog <Web Form Name> space.
  2. You can update/edit the template using two options.

First option: Using edit
  1. Click on the View Details action of the blog.ftl file as shown in the following screenshot:
    First option: Using edit
  2. Click on the Allow Inline Editing option. It will add one more action, Edit Online, in the right-hand side action pane as shown in the following screenshot:
    First option: Using edit
  3. Clicking on Edit Online will open Edit window in which you can edit your template file. After editing, click on Save.
    First option: Using edit
  4. You can click on the Done Editing action to save the changes.
    First option: Using edit
Second option: Using update
  1. Click on the Update action under the More Actions menu of the blog.ftl file:
    Second option: Using update
  2. Clicking on Update will open a window to browse and upload the updated rendering template:
    Second option: Using update
  3. Click on Update.
  4. Now the template is updated. In the next screen, you can select the Regenerate Renditions action under the More Action menu:
    Second option: Using update
  5. Also, you can select Regenerate Renditions from the blog space itself as seen in the following screenshot:
    Second option: Using update
  6. In the next screen, you can select for which web project you want to update the renditions. See the following screenshot:
    Second option: Using update
  7. If the content is deployed on the staging server, you can preview the content from there.

Associating a .xml file to the web form

Suppose you want to do data migration of content from other systems to Alfresco WCM. There is a manageable way by which you can easily move content as XML in WCM and link it to a web form. You can do this through the API or web client extension. Follow these steps to perform the procedure using the web client extension.

  1. Upload an .xml file to the web project. This XML file should have the structure similar to the web forms. Go to the Cignex web project. In My Sandbox, click on the Browse Website link to browse to the folders created in the web project.
    Associating a .xml file to the web form
  2. Go to the common | inc folder. Click on Add Content to upload an .xml file of the same structure as the news or blog.xsd.
    Associating a .xml file to the web form
  3. The uploaded file will be shown under the Browse Files folder. Click on the Edit action for the EditNews.xml file as shown in the following screenshot:
    Associating a .xml file to the web form
  4. Opening this will show a link: To edit this file using a Web Form, click here.
    Associating a .xml file to the web form
  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 file. Click on OK.
    Associating a .xml file to the web form
  6. You will see the news web form. You can fill 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.
    Associating a .xml file to the web form

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 files and populate these with the downloaded code from the Packt website.

Note

Download the complete code samples from the Packt website.

  1. To create and configure 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.
    Static and dynamic include of content
  2. On clicking Create Content, add values as shown in the following screenshot.
    Static and dynamic include of content
  3. Click on Next. Add values as shown in the next screenshot:
    Static and dynamic include of content

    Note

    Do not proceed to the subsequent sections without first 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 defining 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 defined:
    <xs:element name="ContentType" type="trn:newsType" >
    <xs:annotation>
    <xs:appinfo>
    <alf:appearance>minimal</alf:appearance>
    </xs:appinfo>
    </xs:annotation>
    </xs:element>
    
  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.
    Static and dynamic include of content
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset