Search in sources :

Example 26 with Context

use of org.kie.workbench.common.dmn.api.definition.v1_1.Context in project webtools.servertools by eclipse.

the class Tomcat50Configuration method modifyWebModule.

/**
 * Change a web module.
 * @param index int
 * @param docBase java.lang.String
 * @param path java.lang.String
 * @param reloadable boolean
 */
public void modifyWebModule(int index, String docBase, String path, boolean reloadable) {
    try {
        Context context = serverInstance.getContext(index);
        if (context != null) {
            context.setPath(path);
            context.setDocBase(docBase);
            context.setReloadable(reloadable ? "true" : "false");
            isServerDirty = true;
            WebModule module = new WebModule(path, docBase, null, reloadable);
            firePropertyChangeEvent(MODIFY_WEB_MODULE_PROPERTY, new Integer(index), module);
        }
    } catch (Exception e) {
        Trace.trace(Trace.SEVERE, "Error modifying web module " + index, e);
    }
}
Also used : Context(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context) CoreException(org.eclipse.core.runtime.CoreException)

Example 27 with Context

use of org.kie.workbench.common.dmn.api.definition.v1_1.Context in project webtools.servertools by eclipse.

the class Tomcat55Configuration method modifyWebModule.

/**
 * Change a web module.
 * @param index int
 * @param docBase java.lang.String
 * @param path java.lang.String
 * @param reloadable boolean
 */
public void modifyWebModule(int index, String docBase, String path, boolean reloadable) {
    try {
        Context context = serverInstance.getContext(index);
        if (context != null) {
            context.setPath(path);
            context.setDocBase(docBase);
            context.setReloadable(reloadable ? "true" : "false");
            isServerDirty = true;
            WebModule module = new WebModule(path, docBase, null, reloadable);
            firePropertyChangeEvent(MODIFY_WEB_MODULE_PROPERTY, new Integer(index), module);
        }
    } catch (Exception e) {
        Trace.trace(Trace.SEVERE, "Error modifying web module " + index, e);
    }
}
Also used : Context(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context) CoreException(org.eclipse.core.runtime.CoreException)

Example 28 with Context

use of org.kie.workbench.common.dmn.api.definition.v1_1.Context in project webtools.servertools by eclipse.

the class Tomcat55Configuration method addWebModule.

/**
 * @see ITomcatConfigurationWorkingCopy#addWebModule(int, ITomcatWebModule)
 */
public void addWebModule(int index, ITomcatWebModule module) {
    try {
        Context context = serverInstance.createContext(index);
        if (context != null) {
            context.setDocBase(module.getDocumentBase());
            context.setPath(module.getPath());
            context.setReloadable(module.isReloadable() ? "true" : "false");
            if (module.getMemento() != null && module.getMemento().length() > 0)
                context.setSource(module.getMemento());
            isServerDirty = true;
            firePropertyChangeEvent(ADD_WEB_MODULE_PROPERTY, null, module);
        }
    } catch (Exception e) {
        Trace.trace(Trace.SEVERE, "Error adding web module " + module.getPath(), e);
    }
}
Also used : Context(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context) CoreException(org.eclipse.core.runtime.CoreException)

Example 29 with Context

use of org.kie.workbench.common.dmn.api.definition.v1_1.Context in project webtools.servertools by eclipse.

the class Tomcat60Configuration method addWebModule.

/**
 * @see ITomcatConfigurationWorkingCopy#addWebModule(int, ITomcatWebModule)
 */
public void addWebModule(int index, ITomcatWebModule module) {
    try {
        Context context = serverInstance.createContext(index);
        if (context != null) {
            context.setDocBase(module.getDocumentBase());
            context.setPath(module.getPath());
            context.setReloadable(module.isReloadable() ? "true" : "false");
            if (module.getMemento() != null && module.getMemento().length() > 0)
                context.setSource(module.getMemento());
            isServerDirty = true;
            firePropertyChangeEvent(ADD_WEB_MODULE_PROPERTY, null, module);
        }
    } catch (Exception e) {
        Trace.trace(Trace.SEVERE, "Error adding web module " + module.getPath(), e);
    }
}
Also used : Context(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context) CoreException(org.eclipse.core.runtime.CoreException)

Example 30 with Context

use of org.kie.workbench.common.dmn.api.definition.v1_1.Context in project webtools.servertools by eclipse.

the class Tomcat70Configuration method addWebModule.

/**
 * @see ITomcatConfigurationWorkingCopy#addWebModule(int, ITomcatWebModule)
 */
public void addWebModule(int index, ITomcatWebModule module) {
    try {
        Context context = serverInstance.createContext(index);
        if (context != null) {
            context.setDocBase(module.getDocumentBase());
            context.setPath(module.getPath());
            context.setReloadable(module.isReloadable() ? "true" : "false");
            if (module.getMemento() != null && module.getMemento().length() > 0)
                context.setSource(module.getMemento());
            isServerDirty = true;
            firePropertyChangeEvent(ADD_WEB_MODULE_PROPERTY, null, module);
        }
    } catch (Exception e) {
        Trace.trace(Trace.SEVERE, "Error adding web module " + module.getPath(), e);
    }
}
Also used : Context(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context) CoreException(org.eclipse.core.runtime.CoreException)

Aggregations

Context (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context)58 Context (com.microsoft.z3.Context)36 CoreException (org.eclipse.core.runtime.CoreException)34 Test (org.junit.Test)25 BoolExpr (com.microsoft.z3.BoolExpr)23 List (java.util.List)21 IOException (java.io.IOException)18 ServerInstance (org.eclipse.jst.server.tomcat.core.internal.xml.server40.ServerInstance)17 Context (org.kie.workbench.common.dmn.api.definition.v1_1.Context)17 HashMap (java.util.HashMap)16 ArrayList (java.util.ArrayList)15 Map (java.util.Map)14 File (java.io.File)13 Solver (com.microsoft.z3.Solver)12 Status (com.microsoft.z3.Status)12 IPath (org.eclipse.core.runtime.IPath)11 IStatus (org.eclipse.core.runtime.IStatus)11 Status (org.eclipse.core.runtime.Status)11 Factory (org.eclipse.jst.server.tomcat.core.internal.xml.Factory)11 LiteralExpression (org.kie.workbench.common.dmn.api.definition.v1_1.LiteralExpression)10