cancel
Showing results for 
Search instead for 
Did you mean: 

custom wizard

nicola_raglia
Champ in-the-making
Champ in-the-making
Hello to everyone im trying to make a custom-wizard on alfresco, but i get back an exception when i try to validate a web-client-config-custom.xml:

<alfresco-config>
<wizard name="totosiFrontpageConfigurator" managed-bean="TotosiFrontpageConfiguratorWizard"
                 title-id="totosi_frontpage_configurator_title" description-id="totosi_frontpage_configurator_desc"
                 icon="/images/icons/new_content_large.gif">
            <step name="totosi_bcs_details" title-id="totosi_frontpage_bcs_details"
                  description-id="totosi_frontpage_configurator_step1_desc">
               <page path="/jsp/extension/custom-wizard/betportalConfigurator/bcsTotosi/bcs_details.jsp"
                     title-id="totosi_frontpage_configurator_step1_title"
                     description-id="totosi_frontpage_configurator_step1_desc"
                     instruction-id="default_instruction" />
            </step>
            <step name="totosi_spcs_details" title-id="totosi_frontpage_spcs_details"
                  description-id="totosi_frontpage_configurator_step2_desc">
               <page path="/jsp/extension/custom-wizard/betportalConfigurator/spcsTotosi/spcs_details.jsp"
                     title-id="totosi_frontpage_configurator_step2_title"
                     description-id="totosi_frontpage_configurator_step2_desc"
                     instruction-id="default_instruction" />
            </step>
         </wizard>
</alfresco-config>


The error is:
is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'alfresco-config'.
Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'alfresco-config'.
   at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
   at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)




I really don't understand the cause. Could ,everyone help me?
Thanks
Nicola
10 REPLIES 10

jayjayecl
Confirmed Champ
Confirmed Champ
Hi, you forgot some tags. Have a look at the following

<alfresco-config>
<config>
<wizards>

<wizard name="totosiFrontpageConfigurator" etc …



</wizards>
</config>
</alfresco-config>

nicola_raglia
Champ in-the-making
Champ in-the-making
thanks, i added the tags config and wizard but i catch the same exception:
is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'alfresco-config'.
Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'alfresco-config'.
   at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
   at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

this,now, is the file:
<alfresco-config>

   <config>
      <wizards>
         <wizard name="createContent" managed-bean="CustomCreateContentWizard"
                 title-id="custom_create_content_wizard_title"
                 description-id="create_content_desc"
                 icon="/images/icons/new_content_large.gif">
            <step name="details" title-id="details" description-id="create_content_step1_desc">
               <page path="/jsp/content/create-content-wizard/details.jsp"
                     title-id="create_content_step1_title"
                     description-id="create_content_step1_desc"
                     instruction-id="default_instruction" />
            </step>
            <step name="content" title-id="enter_content" description-id="create_content_step2_desc">
               <condition if="#{CreateContentWizard.mimeType == 'text/html'}">
                  <page path="/jsp/content/create-content-wizard/create-html.jsp"
                        title-id="create_content_step2_title"
                        description-id="create_content_step2_desc"
                        instruction-id="default_instruction" />
               </condition>
               <!– Default to the inline text editor –>
               <page path="/jsp/content/create-content-wizard/create-text.jsp"
                     title-id="create_content_step2_title"
                     description-id="create_content_step2_desc"
                     instruction-id="default_instruction" />
            </step>
            <step name="aspect" title-id="select_aspect" description-id="create_content_step3_desc">
               <page path="/jsp/extension/select-aspect.jsp"
                     title-id="create_content_step3_title"
                     description-id="create_content_step3_desc"
                     instruction-id="default_instruction" />
            </step>
            <step name="summary" title-id="summary" description-id="summary_step_description">
               <page path="/jsp/wizard/summary.jsp"
                     title-id="summary"
                     description-id="summary_desc"
                     instruction-id="content_finish_instruction" />
            </step>
         </wizard>
      </wizards>
   </config>
</alfresco-config>


I don't know the reason.

jayjayecl
Confirmed Champ
Confirmed Champ
can you give us the full stack-trace ?

And is this the whole content of your file web-client-config-custom.xml ?

could send me your web-client-config-custom.xml so that I will test it in my environment : romain(dot)delalande(at)smile(dot)fr

nicola_raglia
Champ in-the-making
Champ in-the-making
yes this is the full web-client-config-custom-context.xml:


<alfresco-config>

   <config>
      <wizards>
         <wizard name="createContent" managed-bean="CustomCreateContentWizard"
                 title-id="custom_create_content_wizard_title"
                 description-id="create_content_desc"
                 icon="/images/icons/new_content_large.gif">
            <step name="details" title-id="details" description-id="create_content_step1_desc">
               <page path="/jsp/content/create-content-wizard/details.jsp"
                     title-id="create_content_step1_title"
                     description-id="create_content_step1_desc"
                     instruction-id="default_instruction" />
            </step>
            <step name="content" title-id="enter_content" description-id="create_content_step2_desc">
               <condition if="#{CreateContentWizard.mimeType == 'text/html'}">
                  <page path="/jsp/content/create-content-wizard/create-html.jsp"
                        title-id="create_content_step2_title"
                        description-id="create_content_step2_desc"
                        instruction-id="default_instruction" />
               </condition>
               <!– Default to the inline text editor –>
               <page path="/jsp/content/create-content-wizard/create-text.jsp"
                     title-id="create_content_step2_title"
                     description-id="create_content_step2_desc"
                     instruction-id="default_instruction" />
            </step>
            <step name="aspect" title-id="select_aspect" description-id="create_content_step3_desc">
               <page path="/jsp/extension/select-aspect.jsp"
                     title-id="create_content_step3_title"
                     description-id="create_content_step3_desc"
                     instruction-id="default_instruction" />
            </step>
            <step name="summary" title-id="summary" description-id="summary_step_description">
               <page path="/jsp/wizard/summary.jsp"
                     title-id="summary"
                     description-id="summary_desc"
                     instruction-id="content_finish_instruction" />
            </step>
         </wizard>
      </wizards>
   </config>

   <config evaluator="string-compare" condition="Content Wizards">
      <aspects>
         <aspect name="dublincore"/>
         <aspect name="effectivity"/>
      </aspects>
   </config>

</alfresco-config>

Thanks , thanks a lot

jayjayecl
Confirmed Champ
Confirmed Champ
can you give us the full stack-trace ?
could send me your web-client-config-custom.xml so that I will test it in my environment : romain(dot)delalande(at)smile(dot)fr

nicola_raglia
Champ in-the-making
Champ in-the-making
i forgot, this is the stack trace:
15:35:23,523  ERROR [web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath*:alfresco/extension/*-context.xml]
Offending resource: class path resource [alfresco/application-context.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 1 in XML document from file [/opt/alfresco-labs3e-tomcat/tomcat/shared/classes/alfresco/extension/web-client-config-custom-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'alfresco-config'.
Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 1 in XML document from file [/opt/alfresco-labs3e-tomcat/tomcat/shared/classes/alfresco/extension/web-client-config-custom-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'alfresco-config'.
Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'alfresco-config'.
   at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
   at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
   at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
   at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
   at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
   at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:351)
   at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
   at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)
   at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)
   at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)
   at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:171)
   at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:145)
   at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:130)
   at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90)
   at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:458)
   at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:353)
   at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
   at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)
   at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)
   at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)
   at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
   at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
   at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101)
   at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:389)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:324)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)

jayjayecl
Confirmed Champ
Confirmed Champ
would you mind sending me your file ?

nicola_raglia
Champ in-the-making
Champ in-the-making
i re-post it. I don't have your mail address. Tis is the file:
<alfresco-config>

   <config>
      <wizards>
         <wizard name="createContent" managed-bean="CustomCreateContentWizard"
                 title-id="custom_create_content_wizard_title"
                 description-id="create_content_desc"
                 icon="/images/icons/new_content_large.gif">
            <step name="details" title-id="details" description-id="create_content_step1_desc">
               <page path="/jsp/content/create-content-wizard/details.jsp"
                     title-id="create_content_step1_title"
                     description-id="create_content_step1_desc"
                     instruction-id="default_instruction" />
            </step>
            <step name="content" title-id="enter_content" description-id="create_content_step2_desc">
               <condition if="#{CreateContentWizard.mimeType == 'text/html'}">
                  <page path="/jsp/content/create-content-wizard/create-html.jsp"
                        title-id="create_content_step2_title"
                        description-id="create_content_step2_desc"
                        instruction-id="default_instruction" />
               </condition>
               <!– Default to the inline text editor –>
               <page path="/jsp/content/create-content-wizard/create-text.jsp"
                     title-id="create_content_step2_title"
                     description-id="create_content_step2_desc"
                     instruction-id="default_instruction" />
            </step>
            <step name="aspect" title-id="select_aspect" description-id="create_content_step3_desc">
               <page path="/jsp/extension/select-aspect.jsp"
                     title-id="create_content_step3_title"
                     description-id="create_content_step3_desc"
                     instruction-id="default_instruction" />
            </step>
            <step name="summary" title-id="summary" description-id="summary_step_description">
               <page path="/jsp/wizard/summary.jsp"
                     title-id="summary"
                     description-id="summary_desc"
                     instruction-id="content_finish_instruction" />
            </step>
         </wizard>
      </wizards>
   </config>

   <config evaluator="string-compare" condition="Content Wizards">
      <aspects>
         <aspect name="dublincore"/>
         <aspect name="effectivity"/>
      </aspects>
   </config>

</alfresco-config>

jayjayecl
Confirmed Champ
Confirmed Champ
can you give us the full stack-trace ?
could send me your web-client-config-custom.xml so that I will test it in my environment : romain(dot)delalande(at)smile(dot)fr