cancel
Showing results for 
Search instead for 
Did you mean: 

Where do static files go?

davidbalt
Champ in-the-making
Champ in-the-making
I'm trying to move an existing web script off an older version of Alfresco, and along the way I've moved models and xml files into the data dictionary rather than storing them in the classpath.

There are also a number of images, css, and javascript files that need to be linked into the application but which are expanded overtop of webapps\alfresco\, which can't be the best practice.  Where should these files go in the data dictionary so that the script can access them through dynamic URL addressing (images/blah.jpg).  I'd like to avoid a bunch of "spacestore/xxx-xxx…" style filenames if I can.

I'm sure this is well-trodden territory so I apologize for what might seem redundant, rest assured I've Googled and haven't found a clear answer.
1 REPLY 1

jpotts
World-Class Innovator
World-Class Innovator
If the images and CSS files are used as part of the look-and-feel of the output of the web script, they can either go in webapps/alfresco or webapps/share, preferably under a uniquely-named directory so as not to get confused with Alfresco or others' code, or they can be placed in a JAR file within META-INF. The JAR file then goes in /webapps/alfresco/WEB-INF/lib.

If you go the JAR file route you must change the references to use /res. So a CSS file, foo.css, in a JAR file under META-INF/styles/foo.css would be referred to from an Alfresco tier web script as /alfresco/res/styles/foo.css and from a Share web script as /share/res/styles/foo.css.

Jeff