cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with the path

bribon
Champ in-the-making
Champ in-the-making
Hi,

I have two schemas, I'm trying to include one inside the another one. However, I have a problem with the path:

This application.xsd, and includes types.xsd:

<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:include schemaLocation="webscript://types.xsd"/>   
  <xs:element name="Application">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="name" type="shortStr" />
        <xs:element name="shortDesc" type="xs:string" />
        <xs:element name="longDesc" type="xs:string" />
        <xs:element name="logo" type="xs:string" />
        <xs:element name="category" type="xs:string" />
        <xs:element name="url" type="urlStr" />
        <xs:element name="ownerName" type="shortStr" />
        <xs:element name="publicFlag" type="xs:boolean" />
        <xs:element name="privateFlag" type="xs:boolean" />
        <xs:element name="upcomingWidget" type="xs:boolean" />
        <xs:element name="featuredWidget" type="xs:boolean" />
        <xs:element name="downloadLink" type="urlStr" />
        <xs:element name="downloadName" type="shortStr" />
        <xs:element name="videoLink" type="urlStr" />
        <xs:element name="videoName" type="shortStr" />
        <xs:element name="links" type="xs:string" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

This is types.xsd:

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <xs:simpleType name="shortStr">
      <xs:restriction base="xs:normalizedString">
         <xs:minLength value="0"/>
         <xs:maxLength value="25"/>
      </xs:restriction>
   </xs:simpleType>

   <xs:simpleType name="urlStr">
      <xs:restriction base="xs:normalizedString">
         <xs:minLength value="0"/>
         <xs:maxLength value="50"/>
      </xs:restriction>
   </xs:simpleType>
</xs:schema>

I have the last file in My sandbox, Staging Sandbox and web scripts. I don't know if I can include it from web scripts in the dictionary data, but I read if it's in Staging Sandbox, I just need to include this: <xs:include schemaLocation="webscript://types.xsd"/>. However, I got this mistake:

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

Please, can someone help me out?? It's very important for me.

Thanks in advance
4 REPLIES 4

kmehta31
Champ in-the-making
Champ in-the-making
you need to add the new return type i.e. xsd in your web-scripts-application-context.xml

e.g.

<bean id="webscripts.cmis.formats" parent="webscripts.formatmap">
      <property name="formats">
         <props>
            <prop key="cmisquery">application/cmisquery+xml</prop>
            <prop key="cmisallowableactions">application/cmisallowableactions+xml</prop>
            <prop key="html">text/html</prop>
            <prop key="text">text/plain</prop>
            <prop key="xml">text/xml</prop>
            <prop key="xsd">text/xml</prop>
             <prop key="xslt">text/xml</prop>
         </props>
      </property>

Also your webscript should have types.get.xsd.ftl containing the xsd definition… i assume your webscript name is types.xsd

If you have already done that then let me know which version you are facing this problem.

bribon
Champ in-the-making
Champ in-the-making
Thanks for you answer, but I'm trying different ways.

I want to build my webforms with different fragments, so I want to include different xslts and htmls files in one webform. I already got to include types.xsd from the external file. However, my problem is different right know. I come straight to the point:

I've tried to include the files with <xsl:include href="", but I haven't got anything:

1. I tried from a external file as: <xsl:include href="www.mysite.com/components/header.xslt". I tried to include the same way a schema file in schema file, as <xs:include schemaLocation="www.mysite.com/types/types.xsd". It worked
2. I tried from my sandbox and staging sandbox as: <xsl:include href="/ROOT/components/header.xslt".
3.  I tried from my sandbox and staging sandbox as: <xsl:include href="/components/header.xslt".
4. I tried to include the file in the same webform, add content, as: <xsl:include href="header.xslt".

Every time I got this error: unable to resolve href http://www.mysite.com/components/header.xslt or /ROOT/components/header.xslt or /components/header.xslt or http://mysite:8080/alfresco/d/d/avm/NYU/-1;www;avm_webapps;ROOT;components;header.html/header.xslt. Error log always says the same

I don't know what else I can do. I've also checked old post which other users have the same problem…

Please, help me out, It's very important to work on my project. I will also appreciate different ways to achieve my goal.

Thanks in advance

kmehta31
Champ in-the-making
Champ in-the-making
xsl:include is working fine on Alfresco 3.1 and 3.1 SP1. I have tested it.

However there is problem in Alfresco 3.0 Sp1. So thats reason I asked for which version of Alfresco you are using.
I have already opened ticket with support for 3.0 and its almost 3 weeks no updates on that ticket.

Just also ensure you have added following entry in web-scripts-application-context.xml, if you are working on 3.1
<prop key="xslt">text/xml</prop>


e.g. we are using following to include global xslt definitions in the xslt that we associate to web form.

<xsl:include href="/common_templates/CRCnetBASE_common_templates_ser.xsl" />

/common_templates/ - is the directory under ROOT of your web project.
You can also include xsl in your web form directory under your Alfresco data dictionary as follows
<xsl:include href="CRCnetBASE_common_templates_ser.xsl" />

And third way is through web script which i guess you are trying. All of these works on 3.1

bribon
Champ in-the-making
Champ in-the-making
Thanks so much for your help. I appreciate it a lot in this forum because the forum is not used much. I tried to achieve the project through different such as, to use freemarker and surf platform. However, my boss changed his mind and we started doing the project with liferay. Even though the wiki at alfresco is great, the community doesn't help a lot. That's the problem with alfresco.

Thanks anyway.