Search in sources :

Example 6 with WebModuleConfig

use of org.glassfish.web.config.serverbeans.WebModuleConfig in project Payara by payara.

the class SetWebContextParamCommand method setContextParam.

private void setContextParam(final Engine owningEngine, final String paramName, final String paramValue, final String description, final Boolean ignoreDescriptorItem, final ActionReport report) throws PropertyVetoException, TransactionFailure {
    WebModuleConfig config = WebModuleConfig.Duck.webModuleConfig(owningEngine);
    if (config == null) {
        createContextParamOnNewWMC(owningEngine, paramName, paramValue, description, ignoreDescriptorItem);
    } else {
        ContextParam cp = config.getContextParam(paramName);
        if (cp == null) {
            createContextParamOnExistingWMC(config, paramName, paramValue, description, ignoreDescriptorItem);
        } else {
            modifyContextParam(cp, paramValue, description, ignoreDescriptorItem);
            succeed(report, "setWebContextParamOverride", "Previous context-param setting of {0} for application/module {1} was overridden.", name, appNameAndOptionalModuleName());
        }
    }
}
Also used : WebModuleConfig(org.glassfish.web.config.serverbeans.WebModuleConfig) ContextParam(org.glassfish.web.config.serverbeans.ContextParam)

Example 7 with WebModuleConfig

use of org.glassfish.web.config.serverbeans.WebModuleConfig in project Payara by payara.

the class UnsetWebEnvEntryCommand method execute.

public void execute(AdminCommandContext context) {
    ActionReport report = context.getActionReport();
    try {
        WebModuleConfig config = webModuleConfig(report);
        if (config == null) {
            return;
        }
        config.deleteEnvEntry(name);
    } catch (Exception e) {
        fail(report, e, "errUnsetEnvEntry", "Error unsetting env-entry");
    }
}
Also used : WebModuleConfig(org.glassfish.web.config.serverbeans.WebModuleConfig) ActionReport(org.glassfish.api.ActionReport)

Aggregations

WebModuleConfig (org.glassfish.web.config.serverbeans.WebModuleConfig)7 ActionReport (org.glassfish.api.ActionReport)4 ContextParam (org.glassfish.web.config.serverbeans.ContextParam)2 EnvEntry (org.glassfish.web.config.serverbeans.EnvEntry)2 Module (com.sun.enterprise.config.serverbeans.Module)1