[opencms-dev] Upgrade to OpenCMS 10: Template questions

John Bieling john.bieling at gmx.de
Thu Apr 21 00:32:17 CEST 2016


I am reading all the documentation I can find, but I am not able to 
migrate my template. As a first step, I am trying to create a new and 
very simple OpenCMS 10 template following

http://documentation.opencms.org/opencms-documentation/creating-a-website/creating-a-template-jsp/

I am lost at step 9.

I now have a very simple container page template:

<%@pagebuffer="none"session="false"trimDirectiveWhitespaces="true"%> <%@ 
taglib prefix="cms"uri="http://www.opencms.org/taglib/cms"%> <%@ taglib 
prefix="fmt"uri="http://java.sun.com/jsp/jstl/fmt"%> <%@ taglib 
prefix="fn"uri="http://java.sun.com/jsp/jstl/functions"%> <%@ taglib 
prefix="c"uri="http://java.sun.com/jsp/jstl/core"%>
<html>
     <head>
         <title>Test</title>
         <cms:enable-ade />
     </head>
     <body>
         <div id="HEADER">header</div>
         <div id="NAVIGATION">navigation</div>
         <cms:container name="CENTERCOLUMN" type="center" width="100" />
         <div id="FOOTER">footer</div>
     </body>
</html>

The root folder of my test site has a "template" property pointing to 
that container page template.


For the first test, I want to use a very simple custom content type with 
the following schema:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
elementFormDefault="qualified">

     <xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd"/>
     <xsd:element name="SimplePageTypes" type="OpenCmsSimplePageTypes"/>

     <xsd:complexType name="OpenCmsSimplePageTypes">
         <xsd:sequence>
             <xsd:element name="SimplePageType" 
type="OpenCmsSimplePageType" minOccurs="0" maxOccurs="unbounded"/>
         </xsd:sequence>
     </xsd:complexType>

     <xsd:complexType name="OpenCmsSimplePageType">
         <xsd:sequence>
             <xsd:element name="Menu" type="OpenCmsString" minOccurs="0" 
maxOccurs="1" />
             <xsd:element name="Author" type="OpenCmsString" />
             <xsd:element name="Release" type="OpenCmsDateTime" />
         </xsd:sequence>
         <xsd:attribute name="language" type="OpenCmsLocale" 
use="optional" />
     </xsd:complexType>

     <xsd:annotation>
         <xsd:appinfo>
             <mappings>
                 <mapping element="Release" 
mapto="attribute:datereleased" />
                 <mapping element="Menu" mapto="property:NavText" />
             </mappings>
             <defaults>
                 <default element="Author" 
value="${currentuser.firstname} ${currentuser.lastname}"/>
                 <default element="Release" value="${currenttime}"/>
             </defaults>
             <formatters>
                 <formatter minwidth="100" 
uri="/system/modules/mymodule/formatters/container-formatter.jsp"/>
             </formatters>
         </xsd:appinfo>
     </xsd:annotation>

</xsd:schema>

The formatter is also very simple and looks as follows:

<%@ taglib prefix="cms" uri=http://www.opencms.org/taglib/cms" %>
<cms:formatter var="content">
     <div class="article">
         <h1>${content.value.Menu}</h1>
     </div>
</cms:formatter>



And now what? I can create a new container page, but do not see how to 
link it to my XSD /Resource-Type. It is not showing any "containers" or 
anything to enter content.

Any ideas?

Thanks
John

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20160421/515564f6/attachment.htm>


More information about the opencms-dev mailing list