Search in sources :

Example 1 with XPath

use of com.twinsoft.convertigo.beans.common.XPath in project convertigo by convertigo.

the class LearnScreenClassWizard method performFinish.

public boolean performFinish() {
    String screenClassName = null;
    String criteriaName = null;
    XPath criteria = null;
    try {
        DatabaseObject parentObject = page2.getParentObject();
        if (parentObject != null) {
            // create new screen class
            htmlScreenClass = new HtmlScreenClass();
            if (htmlScreenClass != null) {
                screenClassName = page2.getScreenClassName();
                if (!StringUtils.isNormalized(screenClassName))
                    throw new EngineException("Screenclass name is not normalized : \"" + screenClassName + "\".");
                htmlScreenClass.setName(screenClassName);
                htmlScreenClass.hasChanged = true;
                htmlScreenClass.priority = parentObject.priority + 1;
                parentObject.add(htmlScreenClass);
                ConvertigoPlugin.logInfo("New screen class named '" + screenClassName + "' has been added!");
                Engine.logBeans.debug("New screen class named '" + screenClassName + "' has been added!", null);
            }
            if (htmlScreenClass != null) {
                criteria = new XPath();
                if (criteria != null) {
                    criteriaName = criteria.getName();
                    criteria.hasChanged = true;
                    try {
                        htmlScreenClass.add(criteria);
                        ConvertigoPlugin.logInfo("New criteria named '" + criteriaName + "' has been added!");
                        Engine.logBeans.debug("New criteria named '" + criteriaName + "' has been added!", null);
                    } catch (EngineException e) {
                        throw e;
                    }
                }
            }
        }
    } catch (EngineException e) {
        String message = "Unable to create new screenclass class!";
        ConvertigoPlugin.logException(e, message);
    }
    return true;
}
Also used : XPath(com.twinsoft.convertigo.beans.common.XPath) EngineException(com.twinsoft.convertigo.engine.EngineException) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) HtmlScreenClass(com.twinsoft.convertigo.beans.screenclasses.HtmlScreenClass)

Example 2 with XPath

use of com.twinsoft.convertigo.beans.common.XPath in project convertigo by convertigo.

the class TreeDropAdapter method createXPath.

private XPath createXPath(String source) throws EngineException {
    XPath xpCriterion = new XPath();
    xpCriterion.setXpath(source);
    xpCriterion.hasChanged = true;
    xpCriterion.bNew = true;
    return xpCriterion;
}
Also used : XPath(com.twinsoft.convertigo.beans.common.XPath)

Example 3 with XPath

use of com.twinsoft.convertigo.beans.common.XPath in project convertigo by convertigo.

the class HtmlConnectorDesignComposite method createCriteria.

private XPath createCriteria(HtmlScreenClass parentObject, String criteriaXpath) {
    XPath criteria = null;
    try {
        criteria = new XPath();
        criteria.setXpath(criteriaXpath);
        criteria.hasChanged = true;
        criteria.bNew = true;
        parentObject.addCriteria(criteria);
        ConvertigoPlugin.logInfo("New criteria named '" + criteria.getName() + "' has been added to '" + parentObject.getName() + "' screenclass");
    } catch (EngineException e) {
        String message = "Unable to create new criteria!";
        ConvertigoPlugin.logException(e, message);
    }
    return criteria;
}
Also used : XPath(com.twinsoft.convertigo.beans.common.XPath) EngineException(com.twinsoft.convertigo.engine.EngineException)

Aggregations

XPath (com.twinsoft.convertigo.beans.common.XPath)3 EngineException (com.twinsoft.convertigo.engine.EngineException)2 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)1 HtmlScreenClass (com.twinsoft.convertigo.beans.screenclasses.HtmlScreenClass)1