importing XSD in web forms

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2009 12:54 PM
Hi,
We are trying to include a XSD file from the home directory to alfresco template. We have shared.xsd in alfresco home and we are importing it in other xsds for webforms.
If we import XSD as,
<xs:import schemaLocation="/shared.xsd" namespace="http://www.myhome.com'/>
Alfresco somehow replaces it as following.
<xs:import namespace="http://www.myhome.com" schemaLocation="http://user-name.company-home.www--sandbox.127-0-0-1.ip.alfrescodemo.net:8180/shared.xsd'/>
And we can not create the content, because it can not resolve elements in shared.xsd. Anyone knows how to import XSDs in webforms?
Thanks,
Unmesh
We are trying to include a XSD file from the home directory to alfresco template. We have shared.xsd in alfresco home and we are importing it in other xsds for webforms.
If we import XSD as,
<xs:import schemaLocation="/shared.xsd" namespace="http://www.myhome.com'/>
Alfresco somehow replaces it as following.
<xs:import namespace="http://www.myhome.com" schemaLocation="http://user-name.company-home.www--sandbox.127-0-0-1.ip.alfrescodemo.net:8180/shared.xsd'/>
And we can not create the content, because it can not resolve elements in shared.xsd. Anyone knows how to import XSDs in webforms?
Thanks,
Unmesh
Labels:
- Labels:
-
Archive
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2009 02:01 AM
Hi,
Looking at the alfresco source code, I found following
// It's a web project asset include / import
final String baseURI = (uri.charAt(0) == '/'
? AVMUtil.getPreviewURI(AVMUtil.getStoreName(cwdAvmPath))
: AVMUtil.getPreviewURI(cwdAvmPath));
finalURI = baseURI + uri;
So alfresco replaces inline callouts with preview url.
I tried previewing the shared XSD file from alfresco web UI. But I am unable to. When I click on "preview" icon, it opens up browser with following url
http://user.webproject.www--sandbox.127-0-0-1.ip.alfrescodemo.net:8180/services/shared.xsd
If I click on the file directly. (not the 'preview' button), it opens up the file correctly with following url in browser
http://localhost:8180/alfresco/d/d/avm/webproject--user/-1;www;avm_webapps;services;shared.xsd/share...
Is this a bug with alfresco? Or we need to do some setting so that preview urls are correctly generated, so that inline includes/imports work in WCM?
I am using alfresco version 2.2
Thanks,
Unmesh
Looking at the alfresco source code, I found following
// It's a web project asset include / import
final String baseURI = (uri.charAt(0) == '/'
? AVMUtil.getPreviewURI(AVMUtil.getStoreName(cwdAvmPath))
: AVMUtil.getPreviewURI(cwdAvmPath));
finalURI = baseURI + uri;
So alfresco replaces inline callouts with preview url.
I tried previewing the shared XSD file from alfresco web UI. But I am unable to. When I click on "preview" icon, it opens up browser with following url
http://user.webproject.www--sandbox.127-0-0-1.ip.alfrescodemo.net:8180/services/shared.xsd
If I click on the file directly. (not the 'preview' button), it opens up the file correctly with following url in browser
http://localhost:8180/alfresco/d/d/avm/webproject--user/-1;www;avm_webapps;services;shared.xsd/share...
Is this a bug with alfresco? Or we need to do some setting so that preview urls are correctly generated, so that inline includes/imports work in WCM?
I am using alfresco version 2.2
Thanks,
Unmesh

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2009 07:44 AM
Well I needed to start virtualization server. I do not know if its documented anywhere.
If you need to import/include local XSD in webforms, you need to start virtualization server.
A simple looking XSD import like
<xs:include schemaLocation="/shared.xsd">
gets translated to
<xs:include schemaLocation="http://admin.webproject.www--sandbox.127.0.0.1.ip.alfrescodemo.net:8180/shared.xsd'/>
Only after you start the virtualization server (./virtual_start.sh), this works.
If you need to import/include local XSD in webforms, you need to start virtualization server.
A simple looking XSD import like
<xs:include schemaLocation="/shared.xsd">
gets translated to
<xs:include schemaLocation="http://admin.webproject.www--sandbox.127.0.0.1.ip.alfrescodemo.net:8180/shared.xsd'/>
Only after you start the virtualization server (./virtual_start.sh), this works.
