cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically Create Enumeration for XSD

trgerhardt
Champ in-the-making
Champ in-the-making
Hi, I was wondering if it is possible to have a drop-down box in my web-form with all of the files in a folder as options. I think it is possible to do with JSP but i dont know JSP very well and was wondering if someone could help.

<xs:complexType name="files">
  <xs:sequence>
    foreach of the files in the folder {
    <xs:enumeration value="FILENAME" />
    }
  </xs:sequence>
</xs:complexType>

It would have that generated as an outisde XSD file then include it in my schema. Any know JSP well enough to help me out?
5 REPLIES 5

mark_smithson
Champ in-the-making
Champ in-the-making
Hi,

Not really answering your question, but kind of releated.

We are looking at this as well, in terms of providing drop down values from the categories in Alfresco.

The jsp you can include needs to run in the context of your web application. This means that it does not access to the in process Alfresco APIs, which makes things a bit complicated for us. If you are listing the files in folders in your web application then this should work for you.

We are looking at including the schema via a REST API making use of web scripts (which do have access to the in process alfresco repository APIs).

Has anyone else done something similar?

randomman
Champ in-the-making
Champ in-the-making
You can see this kind of stuff in the example WSF thing. I think the file is channel-list.jsp. It builds a dropdown list from the navigation tree xml.

trgerhardt
Champ in-the-making
Champ in-the-making
Where is that channel-list.jsp file located?

Also I dont understand web scripts that well but are they actually able to retrieve the list of files in a folder?

randomman
Champ in-the-making
Champ in-the-making
Assuming you've bulk imported alfresco-wsf-website.war (which is in Alfresco/extras/wcm) into a web project, browse to the views/components/ web folder and you'll see it in the list.

I'm no expert, but it appears to be dynamically generating an XML schema. I'm guessing it's possible to swap the bit that looks for the channel information in the Navigation Tree xml file with something that examines the file system instead.

I found file system examples here:
http://www.rivetlogic.com/content/view/34/59/

I'm guessing you can combine the two in some fashion. I'm pretty new to these technologies so I can't really say if those examples are any good or if the technique will work but good luck anyway!  Smiley Happy

trgerhardt
Champ in-the-making
Champ in-the-making
Random Man that helps me out so much, thanks a bunch. It was exactly what I was looking for.