How to get list of available styles and languages

Is there any API method to get list of available style sheets and languages ?

…no. We cannot really find out because the location of style sheets is up to customer. Our default location is:

cis/styles/xyz.css

…inside the web application that contains CAI.

You could check for files in this directory with extension “.css”. Please pay attention: you might not have access to the file system (dependent on servlet container) and thus should go via ServletContext-methods dealing with resources.

Bjoern

PS: How do you get access to ServletContext - please register a certain part of your application at startup phase of CAI server - see Developer’s Guide for more information, search for “IServletInitHandler”.

I used enclosed codes to get list of styles and languge options in my adapter class.It seems working …
Thank you :slight_smile:

[i]String langrdir = findServletContext().getRealPath(“/ADFManager/multilanguage”);
File langNames = FileManager.getDirectoriesOfDirectory(langrdir);
for (int i = 0; i < langNames.length; i++) {
if (langNames[i].getName().trim().compareTo(“tr”) == 0){
m_validLanguages.addValidValue(“tr”,"T

Thanks for adding this. One remark: this may not run with other servlet engines than Tomcat.

Backgroudn: the fuction getRealPath(…) with the servlet context is only optional. It typically is available with all servelt engines deploying to the file system (i.e. if the .war file is somehow extracted into some subdirectory of the app server). but it does not work with these servers that deploy in a different way (e.g. JBoss stores deployment in some zip files).

Either check your deployment scenarios (“always Tomcat”), or use the Resource-funtions of the servlet context.

Bjoern