Search in sources :

Example 26 with WalkHelper

use of com.twinsoft.convertigo.engine.helpers.WalkHelper in project convertigo by convertigo.

the class DatabaseObjectsManager method symbolsUpdated.

private void symbolsUpdated() {
    try {
        Properties symbolsToStore = new Properties();
        Enumeration<String> propsEnum = GenericUtils.cast(symbolsProperties.propertyNames());
        while (propsEnum.hasMoreElements()) {
            String name = propsEnum.nextElement();
            symbolsToStore.put(name, symbolsGetValueStore(name));
        }
        System.out.println("symbolsUpdated: " + symbolsToStore + " to:" + globalSymbolsFilePath);
        PropertiesUtils.store(symbolsToStore, globalSymbolsFilePath, "global symbols");
    } catch (Exception e) {
        Engine.logEngine.error("Failed to store symbols!", e);
    }
    for (Project project : projects.values()) {
        getProjectLoadingData().undefinedGlobalSymbol = false;
        try {
            new WalkHelper() {

                @Override
                protected void walk(DatabaseObject databaseObject) throws Exception {
                    databaseObject.updateSymbols();
                    super.walk(databaseObject);
                }
            }.init(project);
        } catch (Exception e) {
            Engine.logDatabaseObjectManager.error("Failed to update symbols of '" + project.getName() + "' project.", e);
        }
        project.undefinedGlobalSymbols = getProjectLoadingData().undefinedGlobalSymbol;
    }
}
Also used : Project(com.twinsoft.convertigo.beans.core.Project) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) WalkHelper(com.twinsoft.convertigo.engine.helpers.WalkHelper) Properties(java.util.Properties) FileNotFoundException(java.io.FileNotFoundException) SAXException(org.xml.sax.SAXException) IOException(java.io.IOException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException)

Aggregations

WalkHelper (com.twinsoft.convertigo.engine.helpers.WalkHelper)26 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)25 Project (com.twinsoft.convertigo.beans.core.Project)14 EngineException (com.twinsoft.convertigo.engine.EngineException)10 IOException (java.io.IOException)9 InvocationTargetException (java.lang.reflect.InvocationTargetException)9 CoreException (org.eclipse.core.runtime.CoreException)9 ArrayList (java.util.ArrayList)8 Transaction (com.twinsoft.convertigo.beans.core.Transaction)7 Step (com.twinsoft.convertigo.beans.core.Step)6 JSONException (org.codehaus.jettison.json.JSONException)6 Connector (com.twinsoft.convertigo.beans.core.Connector)5 Criteria (com.twinsoft.convertigo.beans.core.Criteria)5 ScreenClass (com.twinsoft.convertigo.beans.core.ScreenClass)5 Sequence (com.twinsoft.convertigo.beans.core.Sequence)5 Sheet (com.twinsoft.convertigo.beans.core.Sheet)5 Statement (com.twinsoft.convertigo.beans.core.Statement)5 TestCase (com.twinsoft.convertigo.beans.core.TestCase)5 TreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject)5 HashMap (java.util.HashMap)5