AnsweredAssumed Answered

Customizing

Question asked by freedev on Oct 29, 2007
Hi all,

thank you for reading my post.

Under web projects I have created a new webapp based on the WCM2_1-Product-Evaluation-Guide.pdf
so I have created 2 new forms based on company-footer and press-release web forms.

The web-form team.xsd is based on the company-footer.xsd:
<?xml version="1.0"?>
<!–
Describes a soccer or basket team asset.
–>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:pr="http://www.alfresco.org/alfresco/pr"
           targetNamespace="http://www.alfresco.org/alfresco/pr"
           elementFormDefault="qualified">
  <!– defines the form for creating a team –>
  <xs:element name="team">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="name" type="xs:normalizedString"/>
        <xs:element name="description" type="xs:normalizedString" minOccurs="1"/>
        <xs:element name="sponsor" type="xs:normalizedString" minOccurs="0"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
the web form event.xsd is based on the press-release.xsd
<?xml version="1.0"?>
<!–
Describes a press release and related assets.
–>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:pr="http://www.alfresco.org/alfresco/pr"
           targetNamespace="http://www.alfresco.org/alfresco/pr"
           elementFormDefault="qualified">

  <!– dynamically loads the company footer choices simple type –>
  <xs:include schemaLocation="/get_team_choices_simple_type.jsp"/>

  <xs:simpleType name="category">
    <xs:restriction base="xs:normalizedString">
      <xs:enumeration value="Product"/>
      <xs:enumeration value="Partnership"/>
      <xs:enumeration value="Company"/>
      <xs:enumeration value="Event"/>
      <xs:enumeration value="Training"/>
    </xs:restriction>
  </xs:simpleType>

  <!– defines the form for creating a press release –>
  <xs:element name="event">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="title" type="xs:normalizedString"/>
        <xs:element name="abstract" type="xs:normalizedString"/>
        <xs:element name="location" type="xs:normalizedString"/>
                <xs:element name="include_team_a" type="pr:team_choices" />
                <xs:element name="include_team_b" type="pr:team_choices" />
                <xs:element name="category" type="pr:category" default="Company"/>
                <xs:element name="launch_date" type="xs:date"/>
                <xs:element name="expiration_date" type="xs:date"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
I have also written the get_team_choices_simple_type.jsp included into the event.xsd accordly with the WCM sample
<xs:include schemaLocation="/get_team_choices_simple_type.jsp"/>
but if I try to open the event web form i receive this error:
org.alfresco.web.forms.FormProcessor$ProcessingException: org.alfresco.web.forms.xforms.FormBuilderException: error parsing schema: at line 28 column 61: src-resolve: Cannot resolve the name 'pr:team_choices' to a(n) 'type definition' component.
into the tomcat/logs/catalina.out i found:
17:16:40,355 ERROR [forms.xforms.XFormsProcessor]org.alfresco.web.forms.xforms.FormBuilderException: error parsing schema:
at line 28 column 61: src-resolve: Cannot resolve the name 'pr:team_choices' to a(n) 'type definition' component.

17:16:40,355 ERROR [ui.common.Utils] org.alfresco.web.forms.xforms.FormBuilderException: error parsing schema:
at line 28 column 61: src-resolve: Cannot resolve the name 'pr:team_choices' to a(n) 'type definition' component.

org.alfresco.web.forms.FormProcessor$ProcessingException: org.alfresco.web.forms.xforms.FormBuilderException: error parsing schema:
at line 28 column 61: src-resolve: Cannot resolve the name 'pr:team_choices' to a(n) 'type definition' component.

        at org.alfresco.web.forms.xforms.XFormsProcessor.process(XFormsProcessor.java:145)
        at org.alfresco.web.forms.xforms.XFormsProcessor.process(XFormsProcessor.java:121)
        at org.alfresco.web.ui.wcm.component.UIFormProcessor.encodeBegin(UIFormProcessor.java:123)
        at javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:467)
        at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:320)
        at org.apache.jsp.jsp.wcm.create_002dweb_002dcontent_002dwizard.create_002dxml_jsp._jspx_meth_wcm_005fformProcessor_005f0(create_002dxml_jsp.java:106)
        at org.apache.jsp.jsp.wcm.create_002dweb_002dcontent_002dwizard.create_002dxml_jsp._jspService(create_002dxml_jsp.java:77)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:594)
        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505)
        at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:965)
        at org.apache.jsp.jsp.wizard.container_jsp._jspService(container_jsp.java:523)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
        at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419)
        at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
        at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
        at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
        at java.lang.Thread.run(Thread.java:595)
Caused by: org.alfresco.web.forms.xforms.FormBuilderException: error parsing schema:
at line 28 column 61: src-resolve: Cannot resolve the name 'pr:team_choices' to a(n) 'type definition' component.

        at org.alfresco.web.forms.xforms.SchemaUtil.parseSchema(SchemaUtil.java:265)
        at org.alfresco.web.forms.xforms.Schema2XForms.buildXForm(Schema2XForms.java:143)
        at org.alfresco.web.forms.xforms.XFormsBean.getXFormsDocument(XFormsBean.java:653)
        at org.alfresco.web.forms.xforms.XFormsBean.setXFormsSession(XFormsBean.java:210)
        at org.alfresco.web.forms.xforms.XFormsProcessor.process(XFormsProcessor.java:140)
        … 53 more

And if I try to call the get_team_choices_simple_type.jsp into the My Sandbox i receive this error:

java.lang.NoClassDefFoundError: org/alfresco/web/forms/FormDataFunctions
   java.lang.Class.getDeclaredMethods0(Native Method)
   java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
   java.lang.Class.getDeclaredMethod(Class.java:1907)
   org.apache.jasper.compiler.Validator$1MapperELVisitor.visit(Validator.java:1373)
   org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:123)
   org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:194)
   org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:235)
   org.apache.jasper.compiler.ELNode$Root.accept(ELNode.java:54)
   org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:194)
   org.apache.jasper.compiler.Validator$ValidateVisitor.getFunctionMapper(Validator.java:1391)
   org.apache.jasper.compiler.Validator$ValidateVisitor.getJspAttribute(Validator.java:1109)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:625)
   org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1186)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2164)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2214)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:636)
   org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1186)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2164)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2214)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:636)
   org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1186)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2164)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2214)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:636)
   org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1186)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2164)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2214)
   org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:406)
   org.apache.jasper.compiler.Node$JspRoot.accept(Node.java:526)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2164)
   org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2214)
   org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2220)
   org.apache.jasper.compiler.Node$Root.accept(Node.java:457)
   org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2164)
   org.apache.jasper.compiler.Validator.validate(Validator.java:1484)
   org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:167)
   org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
   org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
   org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
   org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   org.alfresco.filter.CacheControlFilter.doFilter(CacheControlFilter.java:187)


and the jsp work well if I call it from the Staging sandbox?
Now I can you explain me where is deployed the get_team_choices_simple_type.jsp when the events.xsd is parsed to build the web form?

Thanks in advance,
Vincenzo

Outcomes