AnsweredAssumed Answered

Error creating site with custom site type (presets)

Question asked by alejandrogarciaseco on Nov 5, 2012
Latest reply on Oct 6, 2013 by purohitsumit
Hi folks,

I have defined the my custom site type in a file named custom-site-presets.xml with this content:


<?xml version='1.0' encoding='UTF-8'?>
<presets>
   <preset id="tacit-knowledge-workgroup-content">
      <components>        
         title
         <component>
            <scope>page</scope>
            <region-id>title</region-id>
            <source-id>site/${siteid}/content</source-id>
            <url>/components/title/collaboration-title</url>
         </component>
         navigation
         <component>
            <scope>page</scope>
            <region-id>navigation</region-id>
            <source-id>site/${siteid}/content</source-id>
            <url>/components/navigation/collaboration-navigation</url>
         </component>
         dashboard components
         <component>
            <scope>page</scope>
            <region-id>full-width-dashlet</region-id>
            <source-id>site/${siteid}/content</source-id>
            <url>/components/dashlets/dynamic-welcome</url>
            <properties>
               <dashboardType>site</dashboardType>
            </properties>
         </component>
         <component>
            <scope>page</scope>
            <region-id>component-1-1</region-id>
            <source-id>site/${siteid}/content</source-id>
            <url>/components/dashlets/colleagues</url>
            <properties>
               <height>504</height>
            </properties>
         </component>
         <component>
            <scope>page</scope>
            <region-id>component-2-1</region-id>
            <source-id>site/${siteid}/content</source-id>
            <url>/components/dashlets/docsummary</url>
            <url>/components/dashlets/colleagues</url>
         </component>
         <component>
            <scope>page</scope>
            <region-id>component-2-2</region-id>
            <source-id>site/${siteid}/content</source-id>
            <url>/components/dashlets/activityfeed</url>
         <url>/components/dashlets/colleagues</url>
         </component>
      </components>
      <pages>
         <page id="site/${siteid}/content">
            <title>Tacit Knowledge WorkGroup Content</title>
            <title-id>page.workGroupContent.title</title-id>
            <description>Tacit Knowledge WorkGroup's content page</description>
            <description-id>page.workGroupContent.description</description-id>
            <template-instance>dashboard-2-columns-wide-right</template-instance>
            <authentication>user</authentication>
            <properties>
               <sitePages>[{"pageId":"documentlibrary"}]</sitePages>
            </properties>
         </page>
      </pages>
   </preset>
</presets>

I have added the required code in the file create-site.get.js (I have edited the original file deployed by Alfresco Share only for testing purposes, then when it works I'll create the proper extension module) and I'm deploying the XML in a JAR file, placed in the shared/lib directory.

When I create the site, my custom site type appears in the drop-down menu but in the creation process I get this error:


SEVERE: Servlet.service() for servlet [Spring Surf Dispatcher Servlet] in context with path [/share] threw exception [Could not resolve view with name 'site/test/dashboard' in servlet with name 'Spring Surf Dispatcher Servlet'] with root cause
javax.servlet.ServletException: Could not resolve view with name 'site/test/dashboard' in servlet with name 'Spring Surf Dispatcher Servlet'
   at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1029)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.alfresco.web.site.servlet.MTAuthenticationFilter.doFilter(MTAuthenticationFilter.java:74)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.alfresco.web.site.servlet.SSOAuthenticationFilter.doFilter(SSOAuthenticationFilter.java:374)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
   at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
   at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
   at java.lang.Thread.run(Thread.java:722)

2012-11-05 09:35:44,189  ERROR [alfresco.web.site] [http-bio-8080-exec-10] javax.servlet.ServletException: Could not resolve view with name 'site/test/dashboard' in servlet with name 'Spring Surf Dispatcher Servlet'

I have been reading different blogs and articles about how to create custom site types and I believe I'm not missing anything, so does anybody have any idea about what could be wrong?

Thanks in advance.

Outcomes