ch.interlis.ilirepository
Class IliManager

java.lang.Object
  extended by ch.interlis.ilirepository.IliManager

public class IliManager
extends java.lang.Object

Enables cached access to a web of model repositories. Usage:


 import ch.interlis.ili2c.Ili2c;
 import ch.interlis.ili2c.config.Configuration;
 import ch.interlis.ili2c.metamodel.TransferDescription;
 // create repository manager
 IliManager manager=new IliManager();
 // set list of repositories to search
 String repositories[]=new String[]{"http://models.interlis.ch/"};
 manager.setRepositories(repositories);
 // get list of ili-files for a given model
 ArrayList modelNames=new ArrayList();
 modelNames.add("DM01");
 Configuration config=manager.getConfig(modelNames,1.0); // 1.0=ili 1 modell
 // compile models
 TransferDescritpion td=Ili2c.runCompiler(config);
 

Author:
ceis

Field Summary
static java.lang.String ILIMODELS_XML
          name of ilimodels.xml file.
static java.lang.String ILISITE_XML
          name of ilisite.xml file.
 
Constructor Summary
IliManager()
           
 
Method Summary
 ch.interlis.ili2c.config.Configuration getConfig(java.util.ArrayList requiredModels, double iliVersion)
          creates a compiler configuration, given a set of model names and ili-version.
 ch.interlis.ili2c.config.Configuration getConfigWithFiles(java.util.ArrayList requiredIliFileNames)
          creates a compiler configuration, given a set of local ili-filepaths.
static void main(java.lang.String[] args)
           
 void setCache(java.io.File localdir)
          sets the folder used to cache files from remote repositories.
 void setRepositories(java.lang.String[] uri)
          sets the list of repositories to start search for models.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ILISITE_XML

public static final java.lang.String ILISITE_XML
name of ilisite.xml file.

See Also:
Constant Field Values

ILIMODELS_XML

public static final java.lang.String ILIMODELS_XML
name of ilimodels.xml file.

See Also:
Constant Field Values
Constructor Detail

IliManager

public IliManager()
Method Detail

setRepositories

public void setRepositories(java.lang.String[] uri)
sets the list of repositories to start search for models.


setCache

public void setCache(java.io.File localdir)
sets the folder used to cache files from remote repositories.


getConfigWithFiles

public ch.interlis.ili2c.config.Configuration getConfigWithFiles(java.util.ArrayList requiredIliFileNames)
                                                          throws ch.interlis.ili2c.Ili2cException
creates a compiler configuration, given a set of local ili-filepaths.

Parameters:
requiredIliFileNames - list list of local filenames
Throws:
ch.interlis.ili2c.Ili2cException

getConfig

public ch.interlis.ili2c.config.Configuration getConfig(java.util.ArrayList requiredModels,
                                                        double iliVersion)
                                                 throws ch.interlis.ili2c.Ili2cException
creates a compiler configuration, given a set of model names and ili-version.

Parameters:
requiredModels - list list of model names
iliVersion - ili version (e.g. 1.0) or 0.0 for auto-detection.
Returns:
compiler configuration
Throws:
ch.interlis.ili2c.Ili2cException

main

public static void main(java.lang.String[] args)