AnsweredAssumed Answered

New Page with components

Question asked by scafa91 on Nov 4, 2015
Hi,
I'm trying to create a page with custom components, using the documentlibrary template. I'm using alfresco community 5.0.d.

file /myModule/src/main/amp/config/alfresco/web-extension/site-data/pages/mypage.xml


<?xml version='1.0' encoding='UTF-8'?>
<page>
   <title>myPageTitle</title>
   <title-id>page.mypage.title</title-id>
   <description>myPage with Tree view</description>
   <description-id>page.mypage.description</description-id>
   <template-instance>mypage</template-instance>
   <authentication>user</authentication>
</page>


file /myModule/src/main/amp/config/alfresco/web-extension/site-data/template-istances/mypage.xml


<?xml version='1.0' encoding='UTF-8'?>
<template-instance>
   <template-type>org/alfresco/documentlibrary</template-type>
   <properties>
      <pageFamily>mypage</pageFamily>
      <container>mypage</container>
   </properties>
   <components>
      <component>
         <region-id>documentlist</region-id>
         <url>/components/mypage/list</url>
         <properties>
            <pagination>true</pagination>
            <dependencyGroup>documentlibrary</dependencyGroup>
         </properties>
      </component>
    </components>
</template-instance>



file /mymodule/src/main/amp/config/alfresco/web-extension/site-webscripts/components/mypage/list.get.desc.xml


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<webscript>
  <shortname>mypage DocumentList</shortname>
  <description>Document Library: Document List Component</description>
  <url>/components/mypage/list</url>
</webscript>


file /mymodule/src/main/amp/config/alfresco/web-extension/site-webscripts/components/mypage/list.get.html.ftl


<div>
   <h1>mypage component</h1>
</div>


I assume that the content of list.get.html.ftl would end in the region-id "documentlist", but seems that my component is ignored. Even adding a file called list.get.js, this is not loaded in the page (I checked with surfbug and the javascript debugger). The result is that I get a page with the corrent template but without my component.

Thanks

Outcomes