diff --git a/core/src/main/cfml/context/admin.cfm b/core/src/main/cfml/context/admin.cfm index 90e86980be..a15b4286fc 100644 --- a/core/src/main/cfml/context/admin.cfm +++ b/core/src/main/cfml/context/admin.cfm @@ -1,8 +1,3 @@ - if(getApplicationSettings().singleContext) { - location url="admin/index.cfm" addtoken="no"; - } - else { - location url="admin/web.cfm" addtoken="no"; - } + location url="admin/index.cfm" addtoken="no"; \ No newline at end of file diff --git a/core/src/main/cfml/context/admin/Application.cfc b/core/src/main/cfml/context/admin/Application.cfc index 18902d3cd2..66849c8b81 100644 --- a/core/src/main/cfml/context/admin/Application.cfc +++ b/core/src/main/cfml/context/admin/Application.cfc @@ -48,8 +48,7 @@ this.xmlFeatures = { disallowDoctypeDecl: true }; -request.singleMode=getApplicationSettings().singleContext; -if(request.singleMode) request.adminType="server"; +request.adminType="server"; public function onRequestStart() { // if not logged in, we only allow access to admin|web|server[.cfm] diff --git a/core/src/main/cfml/context/admin/admin_layout.cfm b/core/src/main/cfml/context/admin/admin_layout.cfm index fecf3fb4e1..746636a720 100644 --- a/core/src/main/cfml/context/admin/admin_layout.cfm +++ b/core/src/main/cfml/context/admin/admin_layout.cfm @@ -29,7 +29,7 @@ - +
@@ -38,12 +38,6 @@ diff --git a/core/src/main/cfml/context/admin/adminmode.cfm b/core/src/main/cfml/context/admin/adminmode.cfm deleted file mode 100755 index 0134151166..0000000000 --- a/core/src/main/cfml/context/admin/adminmode.cfm +++ /dev/null @@ -1,8 +0,0 @@ - \ No newline at end of file diff --git a/core/src/main/cfml/context/admin/debugging.logs.cfm b/core/src/main/cfml/context/admin/debugging.logs.cfm index 2617d4cc3f..f7126d5f30 100755 --- a/core/src/main/cfml/context/admin/debugging.logs.cfm +++ b/core/src/main/cfml/context/admin/debugging.logs.cfm @@ -40,7 +40,6 @@ - - - - - + + - bmbr button reset" name="cancel" value="#stText.Buttons.Cancel#"> - +
- -

#stText.Debug.onlyWebContext#

- +

#stText.Debug.debuggingDisabled#

- - + diff --git a/core/src/main/cfml/context/admin/debugging.settings.cfm b/core/src/main/cfml/context/admin/debugging.settings.cfm index af43778b97..5e4e0dc74f 100755 --- a/core/src/main/cfml/context/admin/debugging.settings.cfm +++ b/core/src/main/cfml/context/admin/debugging.settings.cfm @@ -208,8 +208,7 @@ Redirtect to entry ---> - - + diff --git a/core/src/main/cfml/context/admin/index.cfm b/core/src/main/cfml/context/admin/index.cfm index 09ea0a034c..fdb0348e8b 100644 --- a/core/src/main/cfml/context/admin/index.cfm +++ b/core/src/main/cfml/context/admin/index.cfm @@ -1,8 +1,3 @@ - if(getApplicationSettings().singleContext) { - include "web.cfm"; - } - else { - location url="server.cfm?reinit=true" addtoken="no"; - } + include "web.cfm"; \ No newline at end of file diff --git a/core/src/main/cfml/context/admin/navigation.cfm b/core/src/main/cfml/context/admin/navigation.cfm index f9627559cc..e7b02b2105 100644 --- a/core/src/main/cfml/context/admin/navigation.cfm +++ b/core/src/main/cfml/context/admin/navigation.cfm @@ -103,7 +103,7 @@ padding:2% 1% 2% 2% !important; } .tt-suggestion.tt-selectable:hover{ - background-color: #request.singleMode?'##666':(request.adminType=="web"?'##39c':'##BF4F36')# !important; + background-color: '##666' !important; color: white; } /*show more Results*/ @@ -113,7 +113,7 @@ padding: 2% 1% 2% 1% ; } .navSearch{ - border-color: #request.singleMode?'##666':(request.adminType=="web"?'##39c':'##BF4F36')# !important; + border-color: '##666' !important; background-color: ##fff !important; width: 89% !important; padding: 1px 1px 1px 1px; diff --git a/core/src/main/cfml/context/admin/overview.cfm b/core/src/main/cfml/context/admin/overview.cfm index 65876d7144..54b25761bd 100644 --- a/core/src/main/cfml/context/admin/overview.cfm +++ b/core/src/main/cfml/context/admin/overview.cfm @@ -1,18 +1,6 @@ - - - - - - @@ -345,7 +333,7 @@ Error Output ---> returnVariable="docsWeb"> - +
#stText.Overview.warning.warningMsg# @@ -365,7 +353,6 @@ Error Output ---> - - - -
- -

#stText.Overview[request.singlemode?"modeSingle":"modeMulti"]#

-
#stText.Overview[request.singlemode?"modeSingleDesc":"modeMultiDesc"]#
- - - - - - - - - - - - - - - - -
-

#stText.Overview[request.singlemode?"modeSingleSwitch":"modeMultiSwitch"]#

-#stText.Overview[request.singlemode?"modeSingleSwitchDesc":"modeMultiSwitchDesc"]# -
-
    -
  • - -
    #stText.Overview.switchMergeDesc#
    -
  • -
  • - -
    #stText.Overview.switchLeaveDesc#
    -
  • -
-

- -
#stText.Overview.switchKeep#
-
- -
-
-
@@ -618,14 +553,10 @@ Error Output ---> #stText.Overview.ReleaseDate# #lsDateFormat(server.lucee['release-date'])# - #stText.Overview.label# #info.label?:""# - - - #stText.Overview.InstalledTLs# @@ -634,8 +565,6 @@ Error Output ---> - - #stText.Overview.InstalledFLs# @@ -644,8 +573,6 @@ Error Output ---> - - @@ -687,13 +614,11 @@ Error Output ---> - - - #stText.Overview.hash# - #info.hash?:""# - - - + + #stText.Overview.hash# + #info.hash?:""# + + diff --git a/core/src/main/cfml/context/admin/resources.component.list.cfm b/core/src/main/cfml/context/admin/resources.component.list.cfm index 00879f0034..043f6b5a27 100644 --- a/core/src/main/cfml/context/admin/resources.component.list.cfm +++ b/core/src/main/cfml/context/admin/resources.component.list.cfm @@ -172,8 +172,7 @@ - bmbr button reset" name="cancel" value="#stText.Buttons.cancel#"> - + diff --git a/core/src/main/cfml/context/admin/resources.rest.cfm b/core/src/main/cfml/context/admin/resources.rest.cfm index 3799a63e18..b59ac46fd8 100644 --- a/core/src/main/cfml/context/admin/resources.rest.cfm +++ b/core/src/main/cfml/context/admin/resources.rest.cfm @@ -164,8 +164,7 @@ list all mappings and display necessary edit fields ---> - bmbr button reset" name="cancel" value="#stText.Buttons.Cancel#"> - + diff --git a/core/src/main/cfml/context/admin/resources/menu.cfm b/core/src/main/cfml/context/admin/resources/menu.cfm index da4ca8455d..17dad9cc07 100755 --- a/core/src/main/cfml/context/admin/resources/menu.cfm +++ b/core/src/main/cfml/context/admin/resources/menu.cfm @@ -1,7 +1,6 @@ - - if(isNull(request.singlemode))request.singlemode=false; sHelpURL = "https://www.lucee.org/help/stHelp.json"; param name="request.stLocalHelp" default="#structNew()#"; param name="request.stWebMediaHelp" default="#structNew()#"; @@ -76,8 +75,8 @@ } - stText.menuStruct.web = createMenu( stText.menu, "web",request.singlemode?:false); - stText.menuStruct.server = createMenu( stText.menu, "server",request.singlemode?:false); + stText.menuStruct.web = createMenu( stText.menu, "web"); + stText.menuStruct.server = createMenu( stText.menu, "server"); } else{ languages=application.languages; diff --git a/core/src/main/cfml/context/admin/security.access.cfm b/core/src/main/cfml/context/admin/security.access.cfm index 718df038c1..f32822d938 100755 --- a/core/src/main/cfml/context/admin/security.access.cfm +++ b/core/src/main/cfml/context/admin/security.access.cfm @@ -37,37 +37,6 @@ function checkTheBox(field) { - - - - - password="#session["password"&request.adminType]#" returnVariable="access"> - - -
#stText.Security.desc#
- - - - - - - - - -
#stText.Security.specialDesc#
- - -
-
-
\ No newline at end of file diff --git a/core/src/main/cfml/context/admin/security.access.form.cfm b/core/src/main/cfml/context/admin/security.access.form.cfm index 94dcac4cc7..861ecc97a3 100644 --- a/core/src/main/cfml/context/admin/security.access.form.cfm +++ b/core/src/main/cfml/context/admin/security.access.form.cfm @@ -56,7 +56,7 @@ - +

#stText.Security.WebAdministrator#

#stText.Security.WebAdministratorDescription#
diff --git a/core/src/main/cfml/context/admin/security.password.cfm b/core/src/main/cfml/context/admin/security.password.cfm index 30219e101f..d8af569d52 100755 --- a/core/src/main/cfml/context/admin/security.password.cfm +++ b/core/src/main/cfml/context/admin/security.password.cfm @@ -190,7 +190,7 @@ Error Output ---> - + - + typeChecking="#!isNull(form.typeChecking) and form.typeChecking EQ true#" remoteClients="#request.getRemoteClients()#" > - - - -
@@ -414,23 +405,6 @@ Create Datasource ---> - - - - - Develop Mode - - > - -
#stText.setting.developMode#
- - - @@ -442,8 +416,7 @@ Create Datasource ---> - bmbr button reset" type="reset" name="cancel" value="#stText.Buttons.Cancel#"> - + diff --git a/core/src/main/cfml/context/admin/server.cfm b/core/src/main/cfml/context/admin/server.cfm index fd9cf3a62b..8934f8b73c 100644 --- a/core/src/main/cfml/context/admin/server.cfm +++ b/core/src/main/cfml/context/admin/server.cfm @@ -1,9 +1,3 @@ -if(getApplicationSettings().singleContext) { location url="index.cfm?reinit=true" addtoken=false; -} -else { - param name="request.adminType" default="server"; - include "web.cfm"; -} \ No newline at end of file diff --git a/core/src/main/cfml/context/admin/server.charset.cfm b/core/src/main/cfml/context/admin/server.charset.cfm index e324cb113c..401a23089d 100755 --- a/core/src/main/cfml/context/admin/server.charset.cfm +++ b/core/src/main/cfml/context/admin/server.charset.cfm @@ -151,8 +151,7 @@ Error Output ---> - bmbr button reset" type="reset" name="cancel" value="#stText.Buttons.Cancel#"> - + diff --git a/core/src/main/cfml/context/admin/server.compiler.cfm b/core/src/main/cfml/context/admin/server.compiler.cfm index dfbad01d9c..d189130faf 100755 --- a/core/src/main/cfml/context/admin/server.compiler.cfm +++ b/core/src/main/cfml/context/admin/server.compiler.cfm @@ -302,8 +302,7 @@ Redirtect to entry ---> - bmbr button reset" name="cancel" value="#stText.Buttons.Cancel#"> - + diff --git a/core/src/main/cfml/context/admin/server.error.cfm b/core/src/main/cfml/context/admin/server.error.cfm index 14b2656d62..ed01ef90fb 100755 --- a/core/src/main/cfml/context/admin/server.error.cfm +++ b/core/src/main/cfml/context/admin/server.error.cfm @@ -171,10 +171,7 @@ Error Output ---> - bmbr button reset" name="cancel" value="#stText.Buttons.Cancel#"> - - - + diff --git a/core/src/main/cfml/context/admin/server.output.cfm b/core/src/main/cfml/context/admin/server.output.cfm index 8380ee59dc..56dd126fca 100755 --- a/core/src/main/cfml/context/admin/server.output.cfm +++ b/core/src/main/cfml/context/admin/server.output.cfm @@ -178,8 +178,7 @@ Defaults ---> - bmbr button reset" type="reset" name="cancel" value="#stText.Buttons.Cancel#"> - + diff --git a/core/src/main/cfml/context/admin/server.regex.cfm b/core/src/main/cfml/context/admin/server.regex.cfm index 97fc18630c..388e855ac8 100755 --- a/core/src/main/cfml/context/admin/server.regex.cfm +++ b/core/src/main/cfml/context/admin/server.regex.cfm @@ -146,10 +146,7 @@ Error Output ---> - bmbr button reset" name="cancel" value="#stText.Buttons.Cancel#"> - - - + diff --git a/core/src/main/cfml/context/admin/server.regional.cfm b/core/src/main/cfml/context/admin/server.regional.cfm index 2667819152..fdf719d295 100755 --- a/core/src/main/cfml/context/admin/server.regional.cfm +++ b/core/src/main/cfml/context/admin/server.regional.cfm @@ -193,10 +193,7 @@ Create Datasource ---> - bmbr button reset" type="reset" name="cancel" value="#stText.Buttons.Cancel#"> - - - + diff --git a/core/src/main/cfml/context/admin/server.request.cfm b/core/src/main/cfml/context/admin/server.request.cfm index ea07c98e56..eb6e10813c 100755 --- a/core/src/main/cfml/context/admin/server.request.cfm +++ b/core/src/main/cfml/context/admin/server.request.cfm @@ -286,8 +286,7 @@ Error Output ---> - bmbr button reset" name="cancel" value="#stText.Buttons.Cancel#"> - + @@ -410,8 +409,7 @@ Error Output ---> - bmbr button reset" name="cancel" value="#stText.Buttons.Cancel#"> - + @@ -543,8 +541,7 @@ Error Output ---> - bmbr button reset" name="cancel" value="#stText.Buttons.Cancel#"> - + @@ -688,8 +685,7 @@ Error Output ---> - bmbr button reset" name="cancel" value="#stText.Buttons.Cancel#"> - + diff --git a/core/src/main/cfml/context/admin/server.scope.cfm b/core/src/main/cfml/context/admin/server.scope.cfm index e78df3b36f..102039bab4 100755 --- a/core/src/main/cfml/context/admin/server.scope.cfm +++ b/core/src/main/cfml/context/admin/server.scope.cfm @@ -607,10 +607,7 @@ function test() localMode="#scope.LocalMode#" {} - bmbr button reset" name="cancel" value="#stText.Buttons.Cancel#"> - - - + diff --git a/core/src/main/cfml/context/admin/server.security.cfm b/core/src/main/cfml/context/admin/server.security.cfm index 50686235fa..4e128fa8d6 100755 --- a/core/src/main/cfml/context/admin/server.security.cfm +++ b/core/src/main/cfml/context/admin/server.security.cfm @@ -140,8 +140,7 @@ Error Output ---> - bmbr button reset" type="reset" name="cancel" value="#stText.Buttons.Cancel#"> - + diff --git a/core/src/main/cfml/context/admin/services.ai.list.cfm b/core/src/main/cfml/context/admin/services.ai.list.cfm index bc49e73426..fb458f1990 100755 --- a/core/src/main/cfml/context/admin/services.ai.list.cfm +++ b/core/src/main/cfml/context/admin/services.ai.list.cfm @@ -170,9 +170,7 @@ function defaultValue(field) { blbs button submit" name="mainAction" value="#stText.Buttons.update#"> - - - + diff --git a/core/src/main/cfml/context/admin/services.cache.list.cfm b/core/src/main/cfml/context/admin/services.cache.list.cfm index 4da99cb0c4..f8cda07fd5 100755 --- a/core/src/main/cfml/context/admin/services.cache.list.cfm +++ b/core/src/main/cfml/context/admin/services.cache.list.cfm @@ -300,10 +300,7 @@ this.cache.webservice = "#!hasWSe?"<cache-name>":defaults.webservice#"; - blbs button submit" name="mainAction" value="#stText.Buttons.update#"> - - - + diff --git a/core/src/main/cfml/context/admin/services.certificates.cfm b/core/src/main/cfml/context/admin/services.certificates.cfm index 8925ce97b8..b743a7108d 100755 --- a/core/src/main/cfml/context/admin/services.certificates.cfm +++ b/core/src/main/cfml/context/admin/services.certificates.cfm @@ -96,8 +96,7 @@ Error Output ---> - bmbr button reset" type="reset" name="cancel" value="#stText.Buttons.Cancel#"> - + diff --git a/core/src/main/cfml/context/admin/services.datasource.list.cfm b/core/src/main/cfml/context/admin/services.datasource.list.cfm index af16666c0a..a921c3f7c8 100644 --- a/core/src/main/cfml/context/admin/services.datasource.list.cfm +++ b/core/src/main/cfml/context/admin/services.datasource.list.cfm @@ -124,10 +124,7 @@ Error Output ---> - bmbr reset" name="cancel" value="#stText.Buttons.Cancel#"> - - - + diff --git a/core/src/main/cfml/context/admin/services.gateway.cfm b/core/src/main/cfml/context/admin/services.gateway.cfm index f4707d2703..5e682d5f25 100755 --- a/core/src/main/cfml/context/admin/services.gateway.cfm +++ b/core/src/main/cfml/context/admin/services.gateway.cfm @@ -1,5 +1,3 @@ - - diff --git a/core/src/main/cfml/context/admin/services.mail.settings.cfm b/core/src/main/cfml/context/admin/services.mail.settings.cfm index 21b9c053a9..8e2a264230 100644 --- a/core/src/main/cfml/context/admin/services.mail.settings.cfm +++ b/core/src/main/cfml/context/admin/services.mail.settings.cfm @@ -95,8 +95,7 @@ - bmbr button reset" name="canel" value="#stText.Buttons.Cancel#"> - + diff --git a/core/src/main/cfml/context/admin/services.schedule.cfm b/core/src/main/cfml/context/admin/services.schedule.cfm index 35df2ba22f..c307fb3acb 100755 --- a/core/src/main/cfml/context/admin/services.schedule.cfm +++ b/core/src/main/cfml/context/admin/services.schedule.cfm @@ -1,4 +1,3 @@ - @@ -66,7 +65,6 @@ error.detail=""; - @@ -76,5 +74,4 @@ Defaults ---> -
- \ No newline at end of file + \ No newline at end of file diff --git a/core/src/main/cfml/context/admin/services.search.cfm b/core/src/main/cfml/context/admin/services.search.cfm index 7382a543b7..087b957549 100755 --- a/core/src/main/cfml/context/admin/services.search.cfm +++ b/core/src/main/cfml/context/admin/services.search.cfm @@ -1,4 +1,3 @@ - function sortByValue(struct sct) { var tmp=structNew("ordered"); @@ -39,7 +38,7 @@ secType="search" secValue="yes"> - + diff --git a/core/src/main/cfml/context/admin/services.tasks.cfm b/core/src/main/cfml/context/admin/services.tasks.cfm index 6cffec37a0..e13f74001a 100755 --- a/core/src/main/cfml/context/admin/services.tasks.cfm +++ b/core/src/main/cfml/context/admin/services.tasks.cfm @@ -350,7 +350,6 @@ bmbr button reset" name="canel" value="#stText.Buttons.Cancel#"> - diff --git a/core/src/main/cfml/context/admin/web.cfm b/core/src/main/cfml/context/admin/web.cfm index b641cd4386..ca80037dd7 100755 --- a/core/src/main/cfml/context/admin/web.cfm +++ b/core/src/main/cfml/context/admin/web.cfm @@ -1,8 +1,6 @@ - request.singleMode=getApplicationSettings().singleContext; - - if(request.singleMode && right(cgi.script_name,9)!="index.cfm") { + if(right(cgi.script_name,9)!="index.cfm") { location url="index.cfm" addtoken=false; } @@ -49,7 +47,7 @@ - + if(structKeyExists(url, "reinit") && (url.action?:"") != "logout") { location url="#cgi.SCRIPT_NAME#?action=logout&full=true" addtoken="No"; diff --git a/core/src/main/java/lucee/commons/io/log/LogUtil.java b/core/src/main/java/lucee/commons/io/log/LogUtil.java index 4464791883..cbd153f65f 100644 --- a/core/src/main/java/lucee/commons/io/log/LogUtil.java +++ b/core/src/main/java/lucee/commons/io/log/LogUtil.java @@ -35,7 +35,7 @@ import lucee.runtime.PageSource; import lucee.runtime.config.Config; import lucee.runtime.config.ConfigWeb; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.engine.ThreadLocalPageContext; /** @@ -181,7 +181,7 @@ public static void log(PageContext pc, int level, String logName, String type, S public static void logGlobal(Config config, int level, String type, String msg) { try { - CFMLEngineFactory factory = ConfigWebUtil.getCFMLEngineFactory(config); + CFMLEngineFactory factory = ConfigUtil.getCFMLEngineFactory(config); Resource log; boolean check = false; if (level > Log.LEVEL_DEBUG) { diff --git a/core/src/main/java/lucee/commons/io/log/log4j2/Log4j2Engine.java b/core/src/main/java/lucee/commons/io/log/log4j2/Log4j2Engine.java index b5ffdcf8ba..9ccba18b7b 100644 --- a/core/src/main/java/lucee/commons/io/log/log4j2/Log4j2Engine.java +++ b/core/src/main/java/lucee/commons/io/log/log4j2/Log4j2Engine.java @@ -45,7 +45,7 @@ import lucee.loader.util.Util; import lucee.runtime.config.Config; import lucee.runtime.config.ConfigWeb; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.db.ClassDefinition; import lucee.runtime.engine.ThreadLocalPageContext; import lucee.runtime.exp.ApplicationException; @@ -399,14 +399,14 @@ else if (ResourceAppender.class.getName().equalsIgnoreCase(cd.getClassName())) { String path = Caster.toString(appenderArgs.get("path"), null); if (!StringUtil.isEmpty(path, true)) { path = path.trim(); - path = ConfigWebUtil.translateOldPath(path); - res = ConfigWebUtil.getFile(config, config.getConfigDir(), path, ResourceUtil.TYPE_FILE); + path = ConfigUtil.translateOldPath(path); + res = ConfigUtil.getFile(config, config.getConfigDir(), path, ResourceUtil.TYPE_FILE); if (res != null && res.isDirectory()) { res = res.getRealResource(name + ".log"); } } if (res == null) { - res = ConfigWebUtil.getFile(config, config.getConfigDir(), "logs/" + name + ".log", ResourceUtil.TYPE_FILE); + res = ConfigUtil.getFile(config, config.getConfigDir(), "logs/" + name + ".log", ResourceUtil.TYPE_FILE); } // charset diff --git a/core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java b/core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java index 9d6b874d45..38b2107ab0 100755 --- a/core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java +++ b/core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java @@ -58,7 +58,7 @@ import lucee.runtime.config.Config; import lucee.runtime.config.ConfigWeb; import lucee.runtime.config.ConfigWebPro; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.config.Constants; import lucee.runtime.engine.ThreadLocalPageContext; import lucee.runtime.exp.ExpressionException; @@ -471,7 +471,7 @@ public static Resource createResource(Resource res, short level, short type) { // Parent Resource parent = res.getParentResource(); - if (level >= LEVEL_PARENT_FILE && parent != null && parent.exists() && canRW(parent) && !ConfigWebUtil.hasPlaceholder(res.getAbsolutePath())) { + if (level >= LEVEL_PARENT_FILE && parent != null && parent.exists() && canRW(parent) && !ConfigUtil.hasPlaceholder(res.getAbsolutePath())) { if (asDir) { if (res.mkdirs()) return getCanonicalResourceEL(res); } @@ -484,7 +484,7 @@ public static Resource createResource(Resource res, short level, short type) { // Grand Parent if (level >= LEVEL_GRAND_PARENT_FILE && parent != null) { Resource gparent = parent.getParentResource(); - if (gparent != null && gparent.exists() && canRW(gparent) && !ConfigWebUtil.hasPlaceholder(res.getAbsolutePath())) { + if (gparent != null && gparent.exists() && canRW(gparent) && !ConfigUtil.hasPlaceholder(res.getAbsolutePath())) { if (asDir) { if (res.mkdirs()) return getCanonicalResourceEL(res); } diff --git a/core/src/main/java/lucee/commons/io/res/util/UDFFilter.java b/core/src/main/java/lucee/commons/io/res/util/UDFFilter.java index 3c71ff1b1b..61fdbd86e6 100644 --- a/core/src/main/java/lucee/commons/io/res/util/UDFFilter.java +++ b/core/src/main/java/lucee/commons/io/res/util/UDFFilter.java @@ -49,7 +49,6 @@ public boolean accept(String path) { @Override public boolean accept(Resource file) { Object[] args1 = new Object[3]; - boolean isDir = file.isDirectory(); args1[0] = file.getAbsolutePath(); args1[1] = file.isDirectory() ? "directory" : "file"; args1[2] = file.isDirectory() ? "" : ResourceUtil.getExtension(file, null); diff --git a/core/src/main/java/lucee/commons/lang/MappingUtil.java b/core/src/main/java/lucee/commons/lang/MappingUtil.java index aa557783ff..9001eea0d6 100644 --- a/core/src/main/java/lucee/commons/lang/MappingUtil.java +++ b/core/src/main/java/lucee/commons/lang/MappingUtil.java @@ -33,7 +33,7 @@ import lucee.runtime.PageContext; import lucee.runtime.PageSource; import lucee.runtime.config.Config; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.config.Constants; import lucee.runtime.engine.ThreadLocalPageContext; import lucee.transformer.bytecode.util.ASMUtil; @@ -157,7 +157,7 @@ public static SourceInfo getMatch(PageContext pc, Config config, StackTraceEleme if (pc == null && config == null) config = ThreadLocalPageContext.getConfig(); // PageContext pc = ThreadLocalPageContext.get(); - Mapping[] mappings = pc != null ? ConfigWebUtil.getAllMappings(pc) : ConfigWebUtil.getAllMappings(config); + Mapping[] mappings = pc != null ? ConfigUtil.getAllMappings(pc) : ConfigUtil.getAllMappings(config); if (pc != null) config = pc.getConfig(); Mapping mapping; diff --git a/core/src/main/java/lucee/runtime/MappingImpl.java b/core/src/main/java/lucee/runtime/MappingImpl.java index 6c8c2d3c2c..1fd380ca14 100755 --- a/core/src/main/java/lucee/runtime/MappingImpl.java +++ b/core/src/main/java/lucee/runtime/MappingImpl.java @@ -45,7 +45,7 @@ import lucee.runtime.config.ConfigPro; import lucee.runtime.config.ConfigWeb; import lucee.runtime.config.ConfigWebPro; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.engine.ThreadLocalPageContext; import lucee.runtime.exp.PageException; import lucee.runtime.listener.ApplicationListener; @@ -169,7 +169,7 @@ private void initPhysical() { synchronized (this) { if (physical == null && strPhysical != null) { ServletContext cs = (config instanceof ConfigWeb) ? ((ConfigWeb) config).getServletContext() : null; - physical = ConfigWebUtil.getResource(cs, strPhysical, config.getConfigDir(), FileUtil.TYPE_DIR, config, checkPhysicalFromWebroot, false); + physical = ConfigUtil.getResource(cs, strPhysical, config.getConfigDir(), FileUtil.TYPE_DIR, config, checkPhysicalFromWebroot, false); if (archive == null) this.physicalFirst = true; else if (physical == null) this.physicalFirst = false; } @@ -182,10 +182,10 @@ private void initArchive() { synchronized (this) { if (archive == null && strArchive != null) { ServletContext cs = (config instanceof ConfigWeb) ? ((ConfigWeb) config).getServletContext() : null; - Resource tmp = ConfigWebUtil.getResource(cs, strArchive, config.getConfigDir(), FileUtil.TYPE_FILE, config, checkArchiveFromWebroot, true); + Resource tmp = ConfigUtil.getResource(cs, strArchive, config.getConfigDir(), FileUtil.TYPE_FILE, config, checkArchiveFromWebroot, true); if (tmp == null || archMod == tmp.lastModified()) return; - CFMLEngine engine = ConfigWebUtil.getEngine(config); + CFMLEngine engine = ConfigUtil.getEngine(config); BundleContext bc = engine.getBundleContext(); try { archiveBundle = OSGiUtil.installBundle(bc, tmp, true); @@ -609,7 +609,7 @@ public String toString() { private String toString(boolean forCompare) { return new StringBuilder().append("StrPhysical:").append(getStrPhysical()).append(";StrArchive:").append(getStrArchive()).append(";Virtual:").append(getVirtual()) .append(";Archive:").append(getArchive()).append(";Physical:").append(getPhysical()).append(";topLevel:").append(topLevel).append(";inspect:") - .append(ConfigWebUtil.inspectTemplate(getInspectTemplateRaw(), "")).append(";config-inspect:").append(ConfigWebUtil.inspectTemplate(getConfigInspectTemplate(), "")) + .append(ConfigUtil.inspectTemplate(getInspectTemplateRaw(), "")).append(";config-inspect:").append(ConfigUtil.inspectTemplate(getConfigInspectTemplate(), "")) .append(";physicalFirst:").append(physicalFirst).append(";hidden:").append(hidden).append(";readonly:").append(forCompare ? "" : readonly).append(";").toString(); } diff --git a/core/src/main/java/lucee/runtime/PageSourcePool.java b/core/src/main/java/lucee/runtime/PageSourcePool.java index 8868586047..7c33fbac60 100644 --- a/core/src/main/java/lucee/runtime/PageSourcePool.java +++ b/core/src/main/java/lucee/runtime/PageSourcePool.java @@ -33,7 +33,7 @@ import lucee.commons.io.watch.PageSourcePoolWatcher; import lucee.commons.lang.SerializableObject; import lucee.runtime.config.ConfigPro; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.config.Constants; import lucee.runtime.dump.DumpData; import lucee.runtime.dump.DumpProperties; @@ -323,7 +323,7 @@ public int getMaxSize() { public static void flush(PageContext pc, Resource file) { if (Constants.isCFML(file)) { ApplicationContext ac = pc.getApplicationContext(); - List sources = ConfigWebUtil.toAllLoadedPageSource((ConfigPro) pc.getConfig(), ac == null ? null : ac.getMappings(), file); + List sources = ConfigUtil.toAllLoadedPageSource((ConfigPro) pc.getConfig(), ac == null ? null : ac.getMappings(), file); for (PageSource ps: sources) { ((PageSourceImpl) ps).resetLoaded(); ((PageSourceImpl) ps).flush(); diff --git a/core/src/main/java/lucee/runtime/cache/CacheUtil.java b/core/src/main/java/lucee/runtime/cache/CacheUtil.java index 89ff7fc7f6..a984d275d6 100644 --- a/core/src/main/java/lucee/runtime/cache/CacheUtil.java +++ b/core/src/main/java/lucee/runtime/cache/CacheUtil.java @@ -370,7 +370,7 @@ public static String toType(int type, String defaultValue) { * @return * @throws lucee.runtime.exp.SecurityException */ - public static Password getPassword(PageContext pc, String password, boolean server) throws lucee.runtime.exp.SecurityException { // TODO: move this to a utility class in a more + public static Password getPassword(PageContext pc, String password) throws lucee.runtime.exp.SecurityException { // TODO: move this to a utility class in a more // generic package? // no password passed if (StringUtil.isEmpty(password, true)) { @@ -383,6 +383,6 @@ public static Password getPassword(PageContext pc, String password, boolean serv "A Web Admin Password is required to manipulate Cache connections. " + "You can either pass the password as an argument to this function, or set it in " + (Constants.CFML_APPLICATION_EVENT_HANDLER) + " with the variable [this.webAdminPassword]."); - return PasswordImpl.passwordToCompare(pc.getConfig(), server, password); + return PasswordImpl.passwordToCompare(pc.getConfig(), password); } } \ No newline at end of file diff --git a/core/src/main/java/lucee/runtime/cache/ram/RamCache.java b/core/src/main/java/lucee/runtime/cache/ram/RamCache.java index c25f0e4dbc..944b3ac1de 100755 --- a/core/src/main/java/lucee/runtime/cache/ram/RamCache.java +++ b/core/src/main/java/lucee/runtime/cache/ram/RamCache.java @@ -40,7 +40,7 @@ import lucee.runtime.cache.ram.ref.Ref; import lucee.runtime.cache.ram.ref.SoftRef; import lucee.runtime.config.Config; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.engine.CFMLEngineImpl; import lucee.runtime.engine.ThreadLocalPageContext; import lucee.runtime.op.Caster; @@ -75,7 +75,7 @@ public static void doNotifyAll(CFMLEngineImpl cfmlEngineImpl) { public RamCache() { Config config = ThreadLocalPageContext.getConfig(); if (config != null) { - CFMLEngineImpl engine = CFMLEngineImpl.toCFMLEngineImpl(ConfigWebUtil.getEngine(config), null); + CFMLEngineImpl engine = CFMLEngineImpl.toCFMLEngineImpl(ConfigUtil.getEngine(config), null); if (engine != null) { controller = new Controler(engine, this); controller.start(); @@ -88,7 +88,7 @@ public void init(Config config, String cacheName, Struct arguments) throws IOExc // RamCache is also used without calling init, because of that we have this test in constructor and // here if (controller == null) { - CFMLEngineImpl engine = CFMLEngineImpl.toCFMLEngineImpl(ConfigWebUtil.getEngine(config), null); + CFMLEngineImpl engine = CFMLEngineImpl.toCFMLEngineImpl(ConfigUtil.getEngine(config), null); if (engine != null) { controller = new Controler(engine, this); controller.start(); diff --git a/core/src/main/java/lucee/runtime/component/ComponentLoader.java b/core/src/main/java/lucee/runtime/component/ComponentLoader.java index c5662b4b19..6042eda50f 100755 --- a/core/src/main/java/lucee/runtime/component/ComponentLoader.java +++ b/core/src/main/java/lucee/runtime/component/ComponentLoader.java @@ -47,7 +47,7 @@ import lucee.runtime.StaticScope; import lucee.runtime.SubPage; import lucee.runtime.config.ConfigPro; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.config.Constants; import lucee.runtime.debug.DebugEntryTemplate; import lucee.runtime.exp.ApplicationException; @@ -450,7 +450,7 @@ private static Object _search(PageContext pc, PageSource loadingLocation, String if (returnType == RETURN_TYPE_COMPONENT) { Resource res = ResourceUtil.toResourceExisting(pc, pathWithCFC, true, null); if (res != null) { - ps = ConfigWebUtil.toComponentPageSource(pc, res, null); + ps = ConfigUtil.toComponentPageSource(pc, res, null); if (ps != null) { page = toCIPage(PageSourceImpl.loadPage(pc, new PageSource[] { ps }, null)); if (page != null) { diff --git a/core/src/main/java/lucee/runtime/config/CFConfigImport.java b/core/src/main/java/lucee/runtime/config/CFConfigImport.java index 5f0451838e..31ea2c9851 100644 --- a/core/src/main/java/lucee/runtime/config/CFConfigImport.java +++ b/core/src/main/java/lucee/runtime/config/CFConfigImport.java @@ -127,7 +127,7 @@ public Struct execute(boolean throwException) throws PageException { // dynAttr = (DynamicAttributes) tag; boolean isServer = "server".equalsIgnoreCase(type); - String strPW = ConfigWebUtil.decrypt(password); + String strPW = ConfigUtil.decrypt(password); Password pw; // hash password if if (isServer && config instanceof ConfigWebPro) { pw = ((ConfigWebPro) config).isServerPasswordEqual(strPW); @@ -209,7 +209,7 @@ private boolean setPasswordIfNecessary(ConfigPro config) throws PageException { if (!hasPassword) { // create password try { - if (config instanceof ConfigWebPro && isServer) ((ConfigWebPro) config).updatePassword(isServer, null, password); + if (config instanceof ConfigWebPro && isServer) ((ConfigWebPro) config).updatePassword(null, password); else { PasswordImpl.updatePassword(config, null, password); } diff --git a/core/src/main/java/lucee/runtime/config/ConfigAdmin.java b/core/src/main/java/lucee/runtime/config/ConfigAdmin.java index c6016f0c2d..37fa1b8b14 100755 --- a/core/src/main/java/lucee/runtime/config/ConfigAdmin.java +++ b/core/src/main/java/lucee/runtime/config/ConfigAdmin.java @@ -53,7 +53,7 @@ import com.allaire.cfx.CustomTag; -import lucee.aprint; +import lucee.print; import lucee.commons.digest.MD5; import lucee.commons.io.CharsetUtil; import lucee.commons.io.FileUtil; @@ -215,11 +215,11 @@ public static ConfigAdmin newInstance(Config config, Password password, boolean } private void checkWriteAccess() throws SecurityException { - if (!optionalPW) ConfigWebUtil.checkGeneralWriteAccess(config, password); + if (!optionalPW) ConfigUtil.checkGeneralWriteAccess(config, password); } private void checkReadAccess() throws SecurityException { - if (!optionalPW) ConfigWebUtil.checkGeneralReadAccess(config, password); + if (!optionalPW) ConfigUtil.checkGeneralReadAccess(config, password); } /** @@ -269,7 +269,7 @@ public void removePassword(String contextPath) throws PageException, IOException else { ConfigServerImpl cs = (ConfigServerImpl) config; ConfigWebImpl cw = (ConfigWebImpl) cs.getConfigWeb(contextPath); - if (cw != null) cw.updatePassword(false, cw.getPassword(), null); + // MUST if (cw != null) cw.updatePassword(false, cw.getPassword(), null); } } @@ -325,36 +325,28 @@ public synchronized void storeAndReload() throws PageException, ClassException, private synchronized void _store() throws ConverterException, IOException { JSONConverter json = new JSONConverter(true, CharsetUtil.UTF8, JSONDateFormat.PATTERN_CF, false); String str = json.serialize(null, root, SerializationSettings.SERIALIZE_AS_ROW, true); + print.e(config.getConfigFile()); + print.e(str); IOUtil.write(config.getConfigFile(), str, CharsetUtil.UTF8, false); } private synchronized void _reload() throws PageException, ClassException, IOException, TagLibException, FunctionLibException, BundleException { - + print.e("------------ _reload -----------------"); + print.e(config); // if(storeInMemoryData)XMLCaster.writeTo(doc,config.getConfigFile()); - CFMLEngine engine = ConfigWebUtil.getEngine(config); - if (config instanceof ConfigServerImpl) { - - ConfigServerImpl cs = (ConfigServerImpl) config; - ConfigServerFactory.reloadInstance(engine, cs); - ConfigWeb[] webs = cs.getConfigWebs(); - for (ConfigWeb web: webs) { - ConfigWebFactory.reloadInstance(engine, (ConfigServerImpl) config, (ConfigWebImpl) web, true); - - } + CFMLEngine engine = ConfigUtil.getEngine(config); + ConfigServerImpl cs; + if (config instanceof ConfigWebImpl) { + cs = ((ConfigWebImpl) config).getConfigServerImpl(); } - else if (config instanceof ConfigWebImpl) { - ConfigServerImpl cs = ((ConfigWebImpl) config).getConfigServerImpl(); - ConfigWebFactory.reloadInstance(engine, cs, (ConfigWebImpl) config, false); + else { + cs = (ConfigServerImpl) config; } - else if (config instanceof SingleContextConfigWeb) { - if (true) throw new RuntimeException("important exception, please report to Lucee"); - // TODO remove this this should never happening - aprint.ds(); - SingleContextConfigWeb sccw = (SingleContextConfigWeb) config; - ConfigServerImpl cs = sccw.getConfigServerImpl(); - ConfigServerFactory.reloadInstance(engine, cs); - sccw.reload(); + ConfigServerFactory.reloadInstance(engine, cs); + ConfigWeb[] webs = cs.getConfigWebs(); + for (ConfigWeb web: webs) { + ConfigWebFactory.reloadInstance(engine, cs, (ConfigWebImpl) web, true); } } @@ -366,7 +358,7 @@ else if (config instanceof SingleContextConfigWeb) { public void setTaskMaxThreads(Integer maxThreads) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update task settings"); Struct mail = _getRootElement("remoteClients"); mail.setEL("maxThreads", Caster.toString(maxThreads, "")); @@ -382,12 +374,12 @@ public void setTaskMaxThreads(Integer maxThreads) throws SecurityException { public void setMailLog(Config config, String logFile, String level) throws PageException { ConfigPro ci = (ConfigPro) config; checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_MAIL); if (!hasAccess) throw new SecurityException("no access to update mail server settings"); - ConfigWebUtil.getFile(config, config.getRootDirectory(), logFile, FileUtil.TYPE_FILE); + ConfigUtil.getFile(config, config.getRootDirectory(), logFile, FileUtil.TYPE_FILE); - Struct loggers = ConfigWebUtil.getAsStruct("loggers", root); + Struct loggers = ConfigUtil.getAsStruct("loggers", root); Struct logger = Caster.toStruct(loggers.get(KeyConstants._mail, null), null); if (logger == null) { @@ -414,7 +406,7 @@ public void setMailLog(Config config, String logFile, String level) throws PageE */ public void setMailSpoolEnable(Boolean spoolEnable) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_MAIL); if (!hasAccess) throw new SecurityException("no access to update mail server settings"); root.setEL("mailSpoolEnable", Caster.toString(spoolEnable, "")); @@ -428,7 +420,7 @@ public void setMailSpoolEnable(Boolean spoolEnable) throws SecurityException { */ public void setMailTimeout(Integer timeout) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_MAIL); if (!hasAccess) throw new SecurityException("no access to update mail server settings"); root.setEL("mailConnectionTimeout", Caster.toString(timeout, "")); } @@ -441,7 +433,7 @@ public void setMailTimeout(Integer timeout) throws SecurityException { */ public void setMailDefaultCharset(String charset) throws PageException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_MAIL); if (!hasAccess) throw new SecurityException("no access to update mail server settings"); if (!StringUtil.isEmpty(charset)) { @@ -470,7 +462,7 @@ public void setMailDefaultCharset(String charset) throws PageException { public void updateMailServer(int id, String hostName, String username, String password, int port, boolean tls, boolean ssl, long lifeTimeSpan, long idleTimeSpan, boolean reuseConnections) throws PageException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_MAIL); if (!hasAccess) throw new SecurityException("no access to update mail server settings"); if (port < 1) port = 21; @@ -478,7 +470,7 @@ public void updateMailServer(int id, String hostName, String username, String pa if (hostName == null || hostName.trim().length() == 0) throw new ExpressionException("Host (SMTP) cannot be an empty value"); hostName = hostName.trim(); - Array children = ConfigWebUtil.getAsArray("mailServers", root); + Array children = ConfigUtil.getAsArray("mailServers", root); boolean checkId = id > 0; @@ -512,7 +504,7 @@ public void updateMailServer(int id, String hostName, String username, String pa } server.setEL("smtp", hostName); server.setEL(KeyConstants._username, username); - server.setEL(KeyConstants._password, ConfigWebUtil.encrypt(password)); + server.setEL(KeyConstants._password, ConfigUtil.encrypt(password)); server.setEL(KeyConstants._port, (port)); server.setEL("tls", (tls)); server.setEL("ssl", (ssl)); @@ -529,7 +521,7 @@ public void updateMailServer(int id, String hostName, String username, String pa */ public void removeMailServer(String hostName, String username) throws SecurityException { checkWriteAccess(); - Array children = ConfigWebUtil.getAsArray("mailServers", root); + Array children = ConfigUtil.getAsArray("mailServers", root); Key[] keys = children.keys(); String _hostName, _username; if (children.size() > 0) { @@ -549,7 +541,7 @@ public void removeMailServer(String hostName, String username) throws SecurityEx public void removeLogSetting(String name) throws SecurityException { checkWriteAccess(); - Struct children = ConfigWebUtil.getAsStruct("loggers", root); + Struct children = ConfigUtil.getAsStruct("loggers", root); if (children.size() > 0) { String _name; Key[] keys = children.keys(); @@ -694,8 +686,7 @@ public void updateMapping(String virtual, String physical, String archive, Strin private void _updateMapping(String virtual, String physical, String archive, String primary, short inspect, int inspectTemplateIntervalSlow, int inspectTemplateIntervalFast, boolean toplevel, int listenerMode, int listenerType, boolean readOnly) throws ExpressionException, SecurityException { - - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAPPING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_MAPPING); virtual = virtual.trim(); if (physical == null) physical = ""; else physical = physical.trim(); @@ -719,7 +710,7 @@ private void _updateMapping(String virtual, String physical, String archive, Str if (!isArchive && archive.length() > 0 && physical.length() == 0) isArchive = true; - Struct children = ConfigWebUtil.getAsStruct("mappings", root); + Struct children = ConfigUtil.getAsStruct("mappings", root); Key[] keys = children.keys(); Struct el = null; for (Key key: keys) { @@ -765,7 +756,7 @@ else if (el.containsKey("archive")) { el.setEL("primary", isArchive ? "archive" : "physical"); // listener-type - String type = ConfigWebUtil.toListenerType(listenerType, null); + String type = ConfigUtil.toListenerType(listenerType, null); if (type != null) { el.setEL("listenerType", type); } @@ -774,7 +765,7 @@ else if (el.containsKey("listenerType")) { } // listener-mode - String mode = ConfigWebUtil.toListenerMode(listenerMode, null); + String mode = ConfigUtil.toListenerMode(listenerMode, null); if (mode != null) { el.setEL("listenerMode", mode); } @@ -783,7 +774,7 @@ else if (el.containsKey("listenerMode")) { } // others - String str = ConfigWebUtil.inspectTemplate(inspect, ""); + String str = ConfigUtil.inspectTemplate(inspect, ""); if (!StringUtil.isEmpty(str)) el.setEL("inspectTemplate", str); else el.removeEL(KeyImpl.init("inspectTemplate")); if (ConfigPro.INSPECT_INTERVAL_SLOW != inspectTemplateIntervalSlow && ConfigPro.INSPECT_INTERVAL_UNDEFINED != inspectTemplateIntervalSlow) @@ -798,7 +789,7 @@ else if (el.containsKey("listenerMode")) { // set / to the end if (!update) { - children = ConfigWebUtil.getAsStruct("mappings", root); + children = ConfigUtil.getAsStruct("mappings", root); keys = children.keys(); for (Key key: keys) { Struct tmp = Caster.toStruct(children.get(key, null), null); @@ -814,7 +805,6 @@ else if (el.containsKey("listenerMode")) { } } - } public void updateRestMapping(String virtual, String physical, boolean _default) throws ExpressionException, SecurityException { @@ -836,7 +826,7 @@ public void updateRestMapping(String virtual, String physical, boolean _default) if ((physical.length()) == 0) throw new ExpressionException("physical path cannot be an empty value"); Struct rest = _getRootElement("rest"); - Array children = ConfigWebUtil.getAsArray("mapping", rest); + Array children = ConfigUtil.getAsArray("mapping", rest); // remove existing default if (_default) { @@ -855,7 +845,7 @@ public void updateRestMapping(String virtual, String physical, boolean _default) Struct tmp = Caster.toStruct(children.get(i, null), null); if (tmp == null) continue; - v = ConfigWebUtil.getAsString("virtual", tmp, null); + v = ConfigUtil.getAsString("virtual", tmp, null); if (v != null && v.equals(virtual)) { el = tmp; } @@ -892,7 +882,7 @@ public void _removeMapping(String virtual) throws ExpressionException { if (!virtual.equals("/") && virtual.endsWith("/")) virtual = virtual.substring(0, virtual.length() - 1); if (virtual.charAt(0) != '/') throw new ExpressionException("virtual path must start with [/]"); - Struct children = ConfigWebUtil.getAsStruct("mappings", root); + Struct children = ConfigUtil.getAsStruct("mappings", root); Key[] keys = children.keys(); for (Key key: keys) { Struct tmp = Caster.toStruct(children.get(key, null), null); @@ -918,14 +908,14 @@ public void removeRestMapping(String virtual) throws ExpressionException, Securi if (virtual.endsWith("/")) virtual = virtual.substring(0, virtual.length() - 1); if (virtual.charAt(0) != '/') virtual = "/" + virtual; - Array children = ConfigWebUtil.getAsArray("rest", "mapping", root); + Array children = ConfigUtil.getAsArray("rest", "mapping", root); Key[] keys = children.keys(); for (int i = keys.length - 1; i >= 0; i--) { Key key = keys[i]; Struct tmp = Caster.toStruct(children.get(key, null), null); if (tmp == null) continue; - String v = ConfigWebUtil.getAsString("virtual", tmp, null); + String v = ConfigUtil.getAsString("virtual", tmp, null); if (v != null) { if (!v.equals("/") && v.endsWith("/")) v = v.substring(0, v.length() - 1); if (v != null && v.equals(virtual)) { @@ -944,7 +934,7 @@ public void removeRestMapping(String virtual) throws ExpressionException, Securi public void removeCustomTag(String virtual) throws SecurityException { checkWriteAccess(); - Array mappings = ConfigWebUtil.getAsArray("customTagMappings", root); + Array mappings = ConfigUtil.getAsArray("customTagMappings", root); Key[] keys = mappings.keys(); Struct data; String v; @@ -961,7 +951,7 @@ public void removeCustomTag(String virtual) throws SecurityException { } private void _removeScheduledTask(String name) throws ExpressionException { - Array tasks = ConfigWebUtil.getAsArray("scheduledTasks", root); + Array tasks = ConfigUtil.getAsArray("scheduledTasks", root); Key[] keys = tasks.keys(); Struct data; String n; @@ -983,7 +973,7 @@ private void _removeScheduledTask(String name) throws ExpressionException { public void removeComponentMapping(String virtual) throws SecurityException { checkWriteAccess(); - Array mappings = ConfigWebUtil.getAsArray("componentMappings", root); + Array mappings = ConfigUtil.getAsArray("componentMappings", root); Key[] keys = mappings.keys(); Struct data; String v; @@ -1018,7 +1008,7 @@ public void updateCustomTag(String virtual, String physical, String archive, Str private void _updateCustomTag(String virtual, String physical, String archive, String primary, short inspect, int inspectTemplateIntervalSlow, int inspectTemplateIntervalFast) throws ExpressionException, SecurityException { - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_CUSTOM_TAG); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_CUSTOM_TAG); if (!hasAccess) throw new SecurityException("no access to change custom tag settings"); if (physical == null) physical = ""; if (archive == null) archive = ""; @@ -1034,7 +1024,7 @@ private void _updateCustomTag(String virtual, String physical, String archive, S throw new ExpressionException("physical must have a value when primary has value physical"); } - Array mappings = ConfigWebUtil.getAsArray("customTagMappings", root); + Array mappings = ConfigUtil.getAsArray("customTagMappings", root); Key[] keys = mappings.keys(); // Update String v; @@ -1049,7 +1039,7 @@ private void _updateCustomTag(String virtual, String physical, String archive, S el.setEL("physical", physical); el.setEL("archive", archive); el.setEL("primary", primary.equalsIgnoreCase("archive") ? "archive" : "physical"); - String str = ConfigWebUtil.inspectTemplate(inspect, ""); + String str = ConfigUtil.inspectTemplate(inspect, ""); if (!StringUtil.isEmpty(str)) el.setEL("inspectTemplate", str); else el.removeEL(KeyImpl.init("inspectTemplate")); if (ConfigPro.INSPECT_INTERVAL_SLOW != inspectTemplateIntervalSlow && ConfigPro.INSPECT_INTERVAL_UNDEFINED != inspectTemplateIntervalSlow) @@ -1071,8 +1061,8 @@ private void _updateCustomTag(String virtual, String physical, String archive, S if (archive.length() > 0) el.setEL("archive", archive); el.setEL("primary", primary.equalsIgnoreCase("archive") ? "archive" : "physical"); - String str = ConfigWebUtil.inspectTemplate(inspect, ""); - if (!StringUtil.isEmpty(str)) el.setEL("inspectTemplate", ConfigWebUtil.inspectTemplate(inspect, "")); + String str = ConfigUtil.inspectTemplate(inspect, ""); + if (!StringUtil.isEmpty(str)) el.setEL("inspectTemplate", ConfigUtil.inspectTemplate(inspect, "")); if (ConfigPro.INSPECT_INTERVAL_SLOW != inspectTemplateIntervalSlow && ConfigPro.INSPECT_INTERVAL_UNDEFINED != inspectTemplateIntervalSlow) el.setEL("inspectTemplateIntervalSlow", Caster.toString(inspectTemplateIntervalSlow, "")); if (ConfigPro.INSPECT_INTERVAL_FAST != inspectTemplateIntervalFast && ConfigPro.INSPECT_INTERVAL_UNDEFINED != inspectTemplateIntervalFast) @@ -1081,7 +1071,7 @@ private void _updateCustomTag(String virtual, String physical, String archive, S } private Struct _getScheduledTask(String name, boolean throwWhenNotExist) throws ExpressionException { - Array scheduledTasks = ConfigWebUtil.getAsArray("scheduledTasks", root); + Array scheduledTasks = ConfigUtil.getAsArray("scheduledTasks", root); Key[] keys = scheduledTasks.keys(); // Update Struct data = null; @@ -1107,7 +1097,7 @@ private Struct _getScheduledTask(String name, boolean throwWhenNotExist) throws } private Array _getScheduledTasks() { - return ConfigWebUtil.getAsArray("scheduledTasks", root); + return ConfigUtil.getAsArray("scheduledTasks", root); } public void updateComponentMapping(String virtual, String physical, String archive, String primary, short inspect, int inspectTemplateIntervalSlow, @@ -1133,7 +1123,7 @@ private void _updateComponentMapping(String virtual, String physical, String arc throw new ExpressionException("physical must have a value when primary has value physical"); } - Array componentMappings = ConfigWebUtil.getAsArray("componentMappings", root); + Array componentMappings = ConfigUtil.getAsArray("componentMappings", root); Key[] keys = componentMappings.keys(); Struct el; @@ -1152,7 +1142,7 @@ private void _updateComponentMapping(String virtual, String physical, String arc data.setEL("physical", physical); data.setEL("archive", archive); data.setEL("primary", primary.equalsIgnoreCase("archive") ? "archive" : "physical"); - String str = ConfigWebUtil.inspectTemplate(inspect, ""); + String str = ConfigUtil.inspectTemplate(inspect, ""); if (!StringUtil.isEmpty(str)) data.setEL("inspectTemplate", str); else data.removeEL(KeyImpl.init("inspectTemplate")); if (ConfigPro.INSPECT_INTERVAL_SLOW != inspectTemplateIntervalSlow && ConfigPro.INSPECT_INTERVAL_UNDEFINED != inspectTemplateIntervalSlow) @@ -1172,8 +1162,8 @@ private void _updateComponentMapping(String virtual, String physical, String arc if (physical.length() > 0) el.setEL("physical", physical); if (archive.length() > 0) el.setEL("archive", archive); el.setEL("primary", primary.equalsIgnoreCase("archive") ? "archive" : "physical"); - String str = ConfigWebUtil.inspectTemplate(inspect, ""); - if (!StringUtil.isEmpty(str)) el.setEL("inspectTemplate", ConfigWebUtil.inspectTemplate(inspect, "")); + String str = ConfigUtil.inspectTemplate(inspect, ""); + if (!StringUtil.isEmpty(str)) el.setEL("inspectTemplate", ConfigUtil.inspectTemplate(inspect, "")); if (ConfigPro.INSPECT_INTERVAL_SLOW != inspectTemplateIntervalSlow && ConfigPro.INSPECT_INTERVAL_UNDEFINED != inspectTemplateIntervalSlow) el.setEL("inspectTemplateIntervalSlow", Caster.toString(inspectTemplateIntervalSlow, "")); if (ConfigPro.INSPECT_INTERVAL_FAST != inspectTemplateIntervalFast && ConfigPro.INSPECT_INTERVAL_UNDEFINED != inspectTemplateIntervalFast) @@ -1337,13 +1327,13 @@ static void updateJar(Config config, InputStream is, String name, boolean closeS */ public void updateJavaCFX(String name, ClassDefinition cd) throws PageException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_CFX_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_CFX_SETTING); if (!hasAccess) throw new SecurityException("no access to change cfx settings"); if (name == null || name.length() == 0) throw new ExpressionException("class name can't be an empty value"); - Struct cfxs = ConfigWebUtil.getAsStruct("cfx", root); + Struct cfxs = ConfigUtil.getAsStruct("cfx", root); Key[] keys = cfxs.keys(); // Update for (Key key: keys) { @@ -1352,7 +1342,7 @@ public void updateJavaCFX(String name, ClassDefinition cd) throws PageException if (n != null && n.equalsIgnoreCase(name)) { Struct data = Caster.toStruct(cfxs.get(key, null), null); if (data == null) continue; - if (!"java".equalsIgnoreCase(ConfigWebUtil.getAsString("type", data, ""))) throw new ExpressionException("there is already a c++ cfx tag with this name"); + if (!"java".equalsIgnoreCase(ConfigUtil.getAsString("type", data, ""))) throw new ExpressionException("there is already a c++ cfx tag with this name"); setClass(data, CustomTag.class, "", cd); data.setEL("type", "java"); return; @@ -1410,7 +1400,7 @@ public void removeCFX(String name) throws ExpressionException, SecurityException // check parameters if (name == null || name.length() == 0) throw new ExpressionException("name for CFX Tag can be an empty value"); - Struct cfxs = ConfigWebUtil.getAsStruct("cfx", root); + Struct cfxs = ConfigUtil.getAsStruct("cfx", root); Key[] keys = cfxs.keys(); for (Key key: keys) { String n = key.getString(); @@ -1464,7 +1454,7 @@ else if (access >= SecurityManager.VALUE_1 && access <= SecurityManager.VALUE_10 // check parameters if (name == null || name.length() == 0) throw new ExpressionException("name can't be an empty value"); - Struct children = ConfigWebUtil.getAsStruct("dataSources", root); + Struct children = ConfigUtil.getAsStruct("dataSources", root); Key[] keys = children.keys(); boolean isUpdate = false; @@ -1478,7 +1468,7 @@ else if (access >= SecurityManager.VALUE_1 && access <= SecurityManager.VALUE_10 if (tmp == null) continue; el = tmp; isUpdate = true; - if (password.equalsIgnoreCase("****************")) password = ConfigWebUtil.getAsString("password", el, null); + if (password.equalsIgnoreCase("****************")) password = ConfigUtil.getAsString("password", el, null); if (isNameUpdate) el.setEL("name", newName); setClass(el, null, "", cd); @@ -1488,7 +1478,7 @@ else if (access >= SecurityManager.VALUE_1 && access <= SecurityManager.VALUE_10 el.setEL(KeyConstants._dsn, dsn); el.setEL(KeyConstants._username, username); - el.setEL(KeyConstants._password, ConfigWebUtil.encrypt(password)); + el.setEL(KeyConstants._password, ConfigUtil.encrypt(password)); el.setEL(KeyConstants._host, host); if (!StringUtil.isEmpty(timezone)) el.setEL(KeyConstants._timezone, timezone); @@ -1548,7 +1538,7 @@ else if (access >= SecurityManager.VALUE_1 && access <= SecurityManager.VALUE_10 else if (el.containsKey(KeyConstants._id)) el.removeEL(KeyConstants._id); el.setEL(KeyConstants._username, username); - el.setEL(KeyConstants._password, ConfigWebUtil.encrypt(password)); + el.setEL(KeyConstants._password, ConfigUtil.encrypt(password)); el.setEL("host", host); if (!StringUtil.isEmpty(timezone)) el.setEL("timezone", timezone); @@ -1592,7 +1582,7 @@ private void _removeJDBCDriver(ClassDefinition cd) throws PageException { if (!cd.isBundle()) throw new ApplicationException("missing bundle name"); - Struct children = ConfigWebUtil.getAsStruct("jdbcDrivers", root); + Struct children = ConfigUtil.getAsStruct("jdbcDrivers", root); Key[] keys = children.keys(); // Remove for (Key key: keys) { @@ -1619,7 +1609,7 @@ private void _removeStartupHook(ClassDefinition cd) throws PageException { if (!cd.isBundle()) throw new ApplicationException("missing bundle name"); - Array children = ConfigWebUtil.getAsArray("startupHooks", root); + Array children = ConfigUtil.getAsArray("startupHooks", root); Key[] keys = children.keys(); // Remove for (int i = keys.length - 1; i >= 0; i--) { @@ -1627,7 +1617,7 @@ private void _removeStartupHook(ClassDefinition cd) throws PageException { Struct tmp = Caster.toStruct(children.get(key, null), null); if (tmp == null) continue; - String n = ConfigWebUtil.getAsString("class", tmp, ""); + String n = ConfigUtil.getAsString("class", tmp, ""); if (n.equalsIgnoreCase(cd.getClassName())) { children.removeEL(key); break; @@ -1650,7 +1640,7 @@ private void _removeStartupHook(ClassDefinition cd) throws PageException { private void _removeStartupHook(String component) { - Array children = ConfigWebUtil.getAsArray("startupHooks", root); + Array children = ConfigUtil.getAsArray("startupHooks", root); Key[] keys = children.keys(); // Remove for (int i = keys.length - 1; i >= 0; i--) { @@ -1694,7 +1684,7 @@ private void _updateJDBCDriver(String label, String id, ClassDefinition cd, Stri // check if it is a bundle if (!cd.isBundle()) throw new ApplicationException("missing bundle name for [" + label + "]"); - Struct children = ConfigWebUtil.getAsStruct("jdbcDrivers", root); + Struct children = ConfigUtil.getAsStruct("jdbcDrivers", root); Key[] keys = children.keys(); // Update Struct child = null; @@ -1741,7 +1731,7 @@ private void _updateStartupHook(ClassDefinition cd) throws PageException { // check if it is a bundle if (!cd.isBundle()) throw new ApplicationException("missing bundle info"); - Array children = ConfigWebUtil.getAsArray("startupHooks", root); + Array children = ConfigUtil.getAsArray("startupHooks", root); // Update Struct child = null; @@ -1749,7 +1739,7 @@ private void _updateStartupHook(ClassDefinition cd) throws PageException { Struct tmp = Caster.toStruct(children.get(i, null), null); if (tmp == null) continue; - String n = ConfigWebUtil.getAsString("class", tmp, null); + String n = ConfigUtil.getAsString("class", tmp, null); if (n.equalsIgnoreCase(cd.getClassName())) { child = tmp; break; @@ -1781,7 +1771,7 @@ private void _updateStartupHook(ClassDefinition cd) throws PageException { private void _updateStartupHook(String component) { // unloadStartupIfNecessary(config, cd, false); - Array children = ConfigWebUtil.getAsArray("startupHooks", root); + Array children = ConfigUtil.getAsArray("startupHooks", root); // Update Struct child = null; @@ -1789,7 +1779,7 @@ private void _updateStartupHook(String component) { Struct tmp = Caster.toStruct(children.get(i, null), null); if (tmp == null) continue; - String n = ConfigWebUtil.getAsString("component", tmp, null); + String n = ConfigUtil.getAsString("component", tmp, null); if (n.equalsIgnoreCase(component)) { child = tmp; break; @@ -1809,7 +1799,7 @@ private void _updateStartupHook(String component) { public void updateGatewayEntry(String id, ClassDefinition cd, String componentPath, String listenerCfcPath, int startupMode, Struct custom, boolean readOnly) throws PageException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManagerImpl.TYPE_GATEWAY); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManagerImpl.TYPE_GATEWAY); if (!hasAccess) throw new SecurityException("no access to update gateway entry"); _updateGatewayEntry(id, cd, componentPath, listenerCfcPath, startupMode, custom, readOnly); @@ -1823,7 +1813,7 @@ void _updateGatewayEntry(String id, ClassDefinition cd, String componentPath, St if ((cd == null || StringUtil.isEmpty(cd.getClassName())) && StringUtil.isEmpty(componentPath)) throw new ExpressionException("you must define className or componentPath"); - Struct children = ConfigWebUtil.getAsStruct("gateways", root); + Struct children = ConfigUtil.getAsStruct("gateways", root); Key[] keys = children.keys(); // Update @@ -1987,7 +1977,7 @@ public void updateAIConnection(String name, ClassDefinition cd, String _default, public void updateCacheConnection(String name, ClassDefinition cd, int _default, Struct custom, boolean readOnly, boolean storage) throws PageException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManagerImpl.TYPE_CACHE); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManagerImpl.TYPE_CACHE); if (!hasAccess) throw new SecurityException("no access to update cache connection"); // check parameters @@ -2051,7 +2041,7 @@ else if (_default == ConfigPro.CACHE_TYPE_WEBSERVICE) { // Update // boolean isUpdate=false; - Struct conns = ConfigWebUtil.getAsStruct("caches", root); + Struct conns = ConfigUtil.getAsStruct("caches", root); Iterator it = conns.keyIterator(); Key key; while (it.hasNext()) { @@ -2083,7 +2073,7 @@ private void rem(Struct sct, String key) { public void removeCacheDefaultConnection(int type) throws PageException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManagerImpl.TYPE_CACHE); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManagerImpl.TYPE_CACHE); if (!hasAccess) throw new SecurityException("no access to update cache connections"); Struct parent = _getRootElement("cache"); @@ -2118,7 +2108,7 @@ else if (type == ConfigPro.CACHE_TYPE_WEBSERVICE) { public void updateCacheDefaultConnection(int type, String name) throws PageException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManagerImpl.TYPE_CACHE); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManagerImpl.TYPE_CACHE); if (!hasAccess) throw new SecurityException("no access to update cache default connections"); @@ -2165,7 +2155,7 @@ public void removeResourceProvider(String scheme) throws PageException { public void _removeResourceProvider(String scheme) { - Array children = ConfigWebUtil.getAsArray("resourceProviders", root); + Array children = ConfigUtil.getAsArray("resourceProviders", root); Key[] keys = children.keys(); // remove @@ -2174,7 +2164,7 @@ public void _removeResourceProvider(String scheme) { Struct tmp = Caster.toStruct(children.get(key, null), null); if (tmp == null) continue; - String elScheme = ConfigWebUtil.getAsString("scheme", tmp, ""); + String elScheme = ConfigUtil.getAsString("scheme", tmp, ""); if (elScheme.equalsIgnoreCase(scheme)) { children.removeEL(key); break; @@ -2197,14 +2187,14 @@ public void _updateResourceProvider(String scheme, ClassDefinition cd, Struct ar // check parameters if (StringUtil.isEmpty(scheme)) throw new ExpressionException("scheme can't be an empty value"); - Array children = ConfigWebUtil.getAsArray("resourceProviders", root); + Array children = ConfigUtil.getAsArray("resourceProviders", root); // Update for (int i = 1; i <= children.size(); i++) { Struct el = Caster.toStruct(children.get(i, null), null); if (el == null) continue; - String elScheme = ConfigWebUtil.getAsString("scheme", el, null); + String elScheme = ConfigUtil.getAsString("scheme", el, null); if (elScheme.equalsIgnoreCase(scheme)) { setClass(el, null, "", cd); el.setEL("scheme", scheme); @@ -2229,7 +2219,7 @@ public void updateDefaultResourceProvider(ClassDefinition cd, String arguments) if (!hasAccess) throw new SecurityException("no access to update resources"); - Array children = ConfigWebUtil.getAsArray("defaultResourceProviders", root); + Array children = ConfigUtil.getAsArray("defaultResourceProviders", root); // Update for (int i = 1; i <= children.size(); i++) { @@ -2270,8 +2260,8 @@ private static String encode(String str) { public Query getResourceProviders() throws PageException { checkReadAccess(); // check parameters - Array elProviders = ConfigWebUtil.getAsArray("resourceProviders", root); - Array elDefaultProviders = ConfigWebUtil.getAsArray("defaultResourceProvider", root); + Array elProviders = ConfigUtil.getAsArray("resourceProviders", root); + Array elDefaultProviders = ConfigUtil.getAsArray("defaultResourceProvider", root); ResourceProvider[] providers = config.getResourceProviders(); ResourceProvider defaultProvider = config.getDefaultResourceProvider(); @@ -2294,9 +2284,9 @@ public Query getResourceProviders() throws PageException { private void getResourceProviders(ResourceProvider[] providers, Query qry, Struct p, int row, Boolean def) throws PageException { Array support = new ArrayImpl(); - String cn = ConfigWebUtil.getAsString("class", p, null); - String name = ConfigWebUtil.getAsString("bundleName", p, null); - String version = ConfigWebUtil.getAsString("bundleVersion", p, null); + String cn = ConfigUtil.getAsString("class", p, null); + String name = ConfigUtil.getAsString("bundleName", p, null); + String version = ConfigUtil.getAsString("bundleVersion", p, null); ClassDefinition cd = ClassDefinitionImpl.toClassDefinitionImpl(p, null, false, ThreadLocalPageContext.getConfig().getIdentification()); String scheme = Caster.toString(p.get("scheme", null), null); if (StringUtil.isEmpty(scheme)) { @@ -2332,7 +2322,7 @@ public void removeJDBCDriver(String className) throws ExpressionException, Secur // check parameters if (StringUtil.isEmpty(className)) throw new ExpressionException("class name for jdbc driver cannot be empty"); - Struct children = ConfigWebUtil.getAsStruct("jdbcDrivers", root); + Struct children = ConfigUtil.getAsStruct("jdbcDrivers", root); Key[] keys = children.keys(); for (Key key: keys) { if (key.getString().equalsIgnoreCase(className)) { @@ -2353,7 +2343,7 @@ public void removeDataSource(String name) throws ExpressionException, SecurityEx // check parameters if (name == null || name.length() == 0) throw new ExpressionException("name for Datasource Connection can be an empty value"); - Struct children = ConfigWebUtil.getAsStruct("dataSources", root); + Struct children = ConfigUtil.getAsStruct("dataSources", root); Key[] keys = children.keys(); for (Key key: keys) { Struct tmp = Caster.toStruct(children.get(key, null), null); @@ -2368,7 +2358,7 @@ public void removeDataSource(String name) throws ExpressionException, SecurityEx public void removeCacheConnection(String name) throws ExpressionException, SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManagerImpl.TYPE_CACHE); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManagerImpl.TYPE_CACHE); if (!hasAccess) throw new SecurityException("no access to remove cache connection"); // check parameters @@ -2388,7 +2378,7 @@ public void removeCacheConnection(String name) throws ExpressionException, Secur if (name.equalsIgnoreCase(Caster.toString(parent.get("defaultWebservice", null), null))) rem(parent, "defaultWebservice"); // remove element - Struct children = ConfigWebUtil.getAsStruct("caches", root); + Struct children = ConfigUtil.getAsStruct("caches", root); Key[] keys = children.keys(); for (Key key: keys) { Struct tmp = Caster.toStruct(children.get(key, null), null); @@ -2418,15 +2408,15 @@ public void removeAIConnection(String name) throws ExpressionException, Security public boolean cacheConnectionExists(String name) throws ExpressionException, SecurityException { checkReadAccess(); - if (!ConfigWebUtil.hasAccess(config, SecurityManagerImpl.TYPE_CACHE)) throw new SecurityException("no access to check cache connection"); + if (!ConfigUtil.hasAccess(config, SecurityManagerImpl.TYPE_CACHE)) throw new SecurityException("no access to check cache connection"); if (name == null || name.isEmpty()) throw new ExpressionException("name for Cache Connection can not be an empty value"); - Array children = ConfigWebUtil.getAsArray("cache", "connection", root); + Array children = ConfigUtil.getAsArray("cache", "connection", root); for (int i = 1; i <= children.size(); i++) { Struct tmp = Caster.toStruct(children.get(i, null), null); if (tmp == null) continue; - String n = ConfigWebUtil.getAsString("name", tmp, null); + String n = ConfigUtil.getAsString("name", tmp, null); if (n != null && n.equalsIgnoreCase(name)) return true; } return false; @@ -2435,7 +2425,7 @@ public boolean cacheConnectionExists(String name) throws ExpressionException, Se public void removeGatewayEntry(String name) throws PageException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManagerImpl.TYPE_GATEWAY); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManagerImpl.TYPE_GATEWAY); if (!hasAccess) throw new SecurityException("no access to remove gateway entry"); _removeGatewayEntry(name); @@ -2444,7 +2434,7 @@ public void removeGatewayEntry(String name) throws PageException { protected void _removeGatewayEntry(String name) throws PageException { if (StringUtil.isEmpty(name)) throw new ExpressionException("name for Gateway Id can be an empty value"); - Struct children = ConfigWebUtil.getAsStruct("gateways", root); + Struct children = ConfigUtil.getAsStruct("gateways", root); Key[] keys = children.keys(); // remove element for (Key key: keys) { @@ -2479,20 +2469,20 @@ public void removeRemoteClient(String url) throws ExpressionException, SecurityE // SNSN - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManagerImpl.TYPE_REMOTE); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManagerImpl.TYPE_REMOTE); if (!hasAccess) throw new SecurityException("no access to remove remote client settings"); // check parameters if (StringUtil.isEmpty(url)) throw new ExpressionException("url for Remote Client can be an empty value"); - Array children = ConfigWebUtil.getAsArray("remoteClients", "remoteClient", root); + Array children = ConfigUtil.getAsArray("remoteClients", "remoteClient", root); Key[] keys = children.keys(); for (int i = keys.length - 1; i >= 0; i--) { Key key = keys[i]; Struct tmp = Caster.toStruct(children.get(key, null), null); if (tmp == null) continue; - String n = ConfigWebUtil.getAsString("url", tmp, null); + String n = ConfigUtil.getAsString("url", tmp, null); if (n != null && n.equalsIgnoreCase(url)) { children.removeEL(key); } @@ -2507,7 +2497,7 @@ public void removeRemoteClient(String url) throws ExpressionException, SecurityE */ public void updatePSQ(Boolean psq) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DATASOURCE); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_DATASOURCE); if (!hasAccess) throw new SecurityException("no access to update datasource connections"); @@ -2516,7 +2506,7 @@ public void updatePSQ(Boolean psq) throws SecurityException { public void updateInspectTemplate(String inspectTemplate, int inspectTemplateIntervalSlow, int inspectTemplateIntervalFast) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update"); @@ -2528,7 +2518,7 @@ public void updateInspectTemplate(String inspectTemplate, int inspectTemplateInt public void updateTypeChecking(Boolean typeChecking) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update"); @@ -2539,7 +2529,7 @@ public void updateTypeChecking(Boolean typeChecking) throws SecurityException { public void updateCachedAfterTimeRange(TimeSpan ts) throws SecurityException, ApplicationException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update"); if (ts == null) rem(root, "cachedAfter"); @@ -2557,7 +2547,7 @@ public void updateCachedAfterTimeRange(TimeSpan ts) throws SecurityException, Ap */ public void updateScopeCascadingType(String type) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); @@ -2576,7 +2566,7 @@ public void updateScopeCascadingType(String type) throws SecurityException { */ public void updateScopeCascadingType(short type) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); if (type == ConfigWeb.SCOPE_STRICT) root.setEL("scopeCascading", "strict"); @@ -2593,7 +2583,7 @@ public void updateScopeCascadingType(short type) throws SecurityException { */ public void updateAllowImplicidQueryCall(Boolean allow) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); @@ -2603,7 +2593,7 @@ public void updateAllowImplicidQueryCall(Boolean allow) throws SecurityException public void updateMergeFormAndUrl(Boolean merge) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); @@ -2620,7 +2610,7 @@ public void updateMergeFormAndUrl(Boolean merge) throws SecurityException { */ public void updateRequestTimeout(TimeSpan span) throws SecurityException, ApplicationException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); @@ -2633,7 +2623,7 @@ public void updateRequestTimeout(TimeSpan span) throws SecurityException, Applic public void updateApplicationPathTimeout(TimeSpan span) throws SecurityException, ApplicationException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); @@ -2652,7 +2642,7 @@ public void updateApplicationPathTimeout(TimeSpan span) throws SecurityException */ public void updateSessionTimeout(TimeSpan span) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); @@ -2670,7 +2660,7 @@ public void updateSessionStorage(String storage) throws SecurityException, Appli private void updateStorage(String storageName, String storage) throws SecurityException, ApplicationException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); storage = validateStorage(storage); @@ -2734,7 +2724,7 @@ private String validateStorage(String storage) throws ApplicationException { */ public void updateClientTimeout(TimeSpan span) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); @@ -2744,7 +2734,7 @@ public void updateClientTimeout(TimeSpan span) throws SecurityException { public void updateCFMLWriterType(String writerType) throws SecurityException, ApplicationException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); writerType = writerType.trim(); @@ -2769,7 +2759,7 @@ else if (Decision.isBoolean(writerType)) { public void updateSuppressContent(Boolean value) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); @@ -2778,7 +2768,7 @@ public void updateSuppressContent(Boolean value) throws SecurityException { public void updateShowVersion(Boolean value) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); @@ -2787,7 +2777,7 @@ public void updateShowVersion(Boolean value) throws SecurityException { public void updateAllowCompression(Boolean value) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); @@ -2796,7 +2786,7 @@ public void updateAllowCompression(Boolean value) throws SecurityException { public void updateContentLength(Boolean value) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); @@ -2805,7 +2795,7 @@ public void updateContentLength(Boolean value) throws SecurityException { public void updateBufferOutput(Boolean value) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); @@ -2820,7 +2810,7 @@ public void updateBufferOutput(Boolean value) throws SecurityException { */ public void updateApplicationTimeout(TimeSpan span) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); @@ -2830,7 +2820,7 @@ public void updateApplicationTimeout(TimeSpan span) throws SecurityException { public void updateApplicationListener(String type, String mode) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update listener type"); @@ -2840,7 +2830,7 @@ public void updateApplicationListener(String type, String mode) throws SecurityE public void updateCachedWithin(int type, Object value) throws SecurityException, ApplicationException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update cachedwithin setting"); String t = AppListenerUtil.toCachedWithinType(type, ""); @@ -2852,7 +2842,7 @@ public void updateCachedWithin(int type, Object value) throws SecurityException, public void updateProxy(boolean enabled, String server, int port, String username, String password) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update listener type"); @@ -2882,7 +2872,7 @@ public void updateProxy(boolean enabled, String server, int port, String usernam */ public void updateSessionManagement(Boolean sessionManagement) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); @@ -2897,7 +2887,7 @@ public void updateSessionManagement(Boolean sessionManagement) throws SecurityEx */ public void updateClientManagement(Boolean clientManagement) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); @@ -2912,7 +2902,7 @@ public void updateClientManagement(Boolean clientManagement) throws SecurityExce */ public void updateClientCookies(Boolean clientCookies) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); root.setEL("clientCookies", clientCookies); @@ -2926,7 +2916,7 @@ public void updateClientCookies(Boolean clientCookies) throws SecurityException */ public void updateMode(Boolean developmode) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); root.setEL("developMode", Caster.toString(developmode, "")); @@ -2940,7 +2930,7 @@ public void updateMode(Boolean developmode) throws SecurityException { */ public void updateDomaincookies(Boolean domainCookies) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); root.setEL("domainCookies", Caster.toString(domainCookies, "")); @@ -2954,7 +2944,7 @@ public void updateDomaincookies(Boolean domainCookies) throws SecurityException */ public void updateLocale(String locale) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update regional setting"); root.setEL("locale", locale.trim()); @@ -2971,7 +2961,7 @@ void _updateMonitorEnabled(boolean updateMonitorEnabled) { public void updateScriptProtect(String strScriptProtect) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update script protect"); root.setEL("scriptProtect", strScriptProtect.trim()); @@ -2979,7 +2969,7 @@ public void updateScriptProtect(String strScriptProtect) throws SecurityExceptio public void updateAllowURLRequestTimeout(Boolean allowURLRequestTimeout) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update AllowURLRequestTimeout"); root.setEL("requestTimeoutInURL", Caster.toString(allowURLRequestTimeout, "")); @@ -2997,7 +2987,7 @@ public void updateScriptProtect(int scriptProtect) throws SecurityException { */ public void updateTimeZone(String timeZone) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update regional setting"); root.setEL("timezone", timeZone.trim()); @@ -3027,7 +3017,7 @@ public void updateTimeServer(String timeServer, Boolean useTimeServer) throws Pa } } - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update regional setting"); root.setEL("timeserver", timeServer.trim()); @@ -3037,7 +3027,7 @@ public void updateTimeServer(String timeServer, Boolean useTimeServer) throws Pa public void updateComponentDeepSearch(Boolean deepSearch) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update component setting"); if (deepSearch != null) root.setEL("componentDeepSearch", Caster.toString(deepSearch.booleanValue())); else { @@ -3048,14 +3038,14 @@ public void updateComponentDeepSearch(Boolean deepSearch) throws SecurityExcepti public void updateComponentDefaultImport(String componentDefaultImport) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update component setting"); root.setEL("componentAutoImport", componentDefaultImport); } public void updateReturnFormat(String returnFormat) throws SecurityException, ExpressionException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update component setting"); root.setEL("returnFormat", UDFUtil.toReturnFormat(UDFUtil.toReturnFormat(returnFormat))); // i make a double toReturnFormat to validate the input } @@ -3070,7 +3060,7 @@ public void updateReturnFormat(String returnFormat) throws SecurityException, Ex public void updateComponentDataMemberDefaultAccess(String strAccess) throws SecurityException, ApplicationException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update component setting"); if (StringUtil.isEmpty(strAccess)) { @@ -3089,7 +3079,7 @@ public void updateComponentDataMemberDefaultAccess(String strAccess) throws Secu */ public void updateTriggerDataMember(Boolean triggerDataMember) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update trigger-data-member"); root.setEL("componentImplicitNotation", Caster.toString(triggerDataMember, "")); @@ -3097,7 +3087,7 @@ public void updateTriggerDataMember(Boolean triggerDataMember) throws SecurityEx public void updateComponentUseShadow(Boolean useShadow) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update use-shadow"); root.setEL("componentUseVariablesScope", Caster.toString(useShadow, "")); @@ -3105,7 +3095,7 @@ public void updateComponentUseShadow(Boolean useShadow) throws SecurityException public void updateComponentLocalSearch(Boolean componentLocalSearch) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update component Local Search"); root.setEL("componentLocalSearch", Caster.toString(componentLocalSearch, "")); @@ -3113,7 +3103,7 @@ public void updateComponentLocalSearch(Boolean componentLocalSearch) throws Secu public void updateComponentPathCache(Boolean componentPathCache) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update component Cache Path"); if (!Caster.toBooleanValue(componentPathCache, false)) config.clearComponentCache(); @@ -3122,7 +3112,7 @@ public void updateComponentPathCache(Boolean componentPathCache) throws Security public void updateCTPathCache(Boolean ctPathCache) throws SecurityException { checkWriteAccess(); - if (!ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_CUSTOM_TAG)) throw new SecurityException("no access to update custom tag setting"); + if (!ConfigUtil.hasAccess(config, SecurityManager.TYPE_CUSTOM_TAG)) throw new SecurityException("no access to update custom tag setting"); if (!Caster.toBooleanValue(ctPathCache, false)) config.clearCTCache(); root.setEL("customTagUseCachePath", Caster.toString(ctPathCache, "")); @@ -3151,7 +3141,7 @@ public void updateSecurity(String varUsage, Boolean limitEvaluation) throws Secu public void updateDebug(Boolean debug, Boolean template, Boolean database, Boolean exception, Boolean tracing, Boolean dump, Boolean timer, Boolean implicitAccess, Boolean queryUsage, Boolean thread) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING); if (!hasAccess) throw new SecurityException("no access to change debugging settings"); if (debug != null) root.setEL("debuggingEnabled", debug.booleanValue()); @@ -3187,7 +3177,7 @@ public void updateDebug(Boolean debug, Boolean template, Boolean database, Boole public void updateMonitoring(Boolean debug, Boolean metric, Boolean doc, Boolean test) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING); if (!hasAccess) throw new SecurityException("no access to change monitoring settings"); if (debug != null) root.setEL("showDebug", debug.booleanValue()); @@ -3211,7 +3201,7 @@ public void updateMonitoring(Boolean debug, Boolean metric, Boolean doc, Boolean */ public void updateErrorTemplate(int statusCode, String template) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to change error settings"); if (statusCode == 404) root.setEL("errorMissingTemplate", template); @@ -3220,7 +3210,7 @@ public void updateErrorTemplate(int statusCode, String template) throws Security public void updateErrorStatusCode(Boolean doStatusCode) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to change error settings"); root.setEL("errorStatusCode", Caster.toString(doStatusCode, "")); @@ -3228,7 +3218,7 @@ public void updateErrorStatusCode(Boolean doStatusCode) throws SecurityException public void updateRegexType(String type) throws PageException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to change regex settings"); if (StringUtil.isEmpty(type)) rem(root, "regexType"); @@ -3243,14 +3233,14 @@ public void updateRegexType(String type) throws PageException { */ public void updateComponentDumpTemplate(String template) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update component setting"); root.setEL("componentDumpTemplate", template); } private Struct _getRootElement(String name) { - return ConfigWebUtil.getAsStruct(name, root); + return ConfigUtil.getAsStruct(name, root); } /** @@ -3319,7 +3309,7 @@ public void updateDefaultSecurity(short accessRead, short accessWrite) throws Se } private void removeSecurityFileAccess(Struct parent) { - Array children = ConfigWebUtil.getAsArray("fileAccess", parent); + Array children = ConfigUtil.getAsArray("fileAccess", parent); Key[] keys = children.keys(); // remove existing if (children.size() > 0) { @@ -3336,7 +3326,7 @@ private void updateSecurityFileAccess(Struct parent, Resource[] fileAccess, shor // insert if (!ArrayUtil.isEmpty(fileAccess) && file != SecurityManager.VALUE_ALL) { Struct fa; - Array children = ConfigWebUtil.getAsArray("fileAccess", parent); + Array children = ConfigUtil.getAsArray("fileAccess", parent); for (int i = 0; i < fileAccess.length; i++) { fa = new StructImpl(); fa.setEL("path", fileAccess[i].getAbsolutePath()); @@ -3377,7 +3367,7 @@ public void updateSecurity(String id, short setting, short file, Resource[] file if (!(config instanceof ConfigServer)) throw new SecurityException("can't change security settings from this context"); Struct security = _getRootElement("security"); - Array children = ConfigWebUtil.getAsArray("accessor", security); + Array children = ConfigUtil.getAsArray("accessor", security); Struct accessor = null; for (int i = 1; i <= children.size(); i++) { Struct tmp = Caster.toStruct(children.get(i, null), null); @@ -3453,7 +3443,7 @@ public void removeDefaultPassword() throws SecurityException { */ public void updateSessionType(String type) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); type = type.toLowerCase().trim(); @@ -3463,7 +3453,7 @@ public void updateSessionType(String type) throws SecurityException { public void updateLocalMode(String mode) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); mode = mode.toLowerCase().trim(); @@ -3514,14 +3504,14 @@ public void updateUpdate(String type, String location) throws SecurityException */ public void createSecurityManager(Password password, String id) throws PageException { checkWriteAccess(); - ConfigServerImpl cs = (ConfigServerImpl) ConfigWebUtil.getConfigServer(config, password); + ConfigServerImpl cs = (ConfigServerImpl) ConfigUtil.getConfigServer(config); SecurityManagerImpl dsm = (SecurityManagerImpl) cs.getDefaultSecurityManager().cloneSecurityManager(); cs.setSecurityManager(id, dsm); Struct security = _getRootElement("security"); Struct accessor = null; - Array children = ConfigWebUtil.getAsArray("accessor", security); + Array children = ConfigUtil.getAsArray("accessor", security); for (int i = 1; i <= children.size(); i++) { Struct tmp = Caster.toStruct(children.get(i, null), null); if (tmp == null) continue; @@ -3567,16 +3557,16 @@ public void createSecurityManager(Password password, String id) throws PageExcep */ public void removeSecurityManager(Password password, String id) throws PageException { checkWriteAccess(); - ((ConfigServerImpl) ConfigWebUtil.getConfigServer(config, password)).removeSecurityManager(id); + ((ConfigServerImpl) ConfigUtil.getConfigServer(config)).removeSecurityManager(id); - Array children = ConfigWebUtil.getAsArray("security", "accessor", root); + Array children = ConfigUtil.getAsArray("security", "accessor", root); Key[] keys = children.keys(); for (int i = keys.length - 1; i >= 0; i--) { Key key = keys[i]; Struct tmp = Caster.toStruct(children.get(key, null), null); if (tmp == null) continue; - String n = ConfigWebUtil.getAsString("id", tmp, ""); + String n = ConfigUtil.getAsString("id", tmp, ""); if (id.equals(n)) { children.removeEL(key); } @@ -3588,7 +3578,7 @@ public void removeSecurityManager(Password password, String id) throws PageExcep @Deprecated public void runUpdate(Password password) throws PageException { checkWriteAccess(); - ConfigServerImpl cs = (ConfigServerImpl) ConfigWebUtil.getConfigServer(config, password); + ConfigServerImpl cs = (ConfigServerImpl) ConfigUtil.getConfigServer(config); CFMLEngineFactory factory = cs.getEngine().getCFMLEngineFactory(); synchronized (factory) { @@ -3619,7 +3609,7 @@ public void removeUpdate(Password password) throws PageException { private void _removeUpdate(Password password, boolean onlyLatest) throws PageException { checkWriteAccess(); - ConfigServerImpl cs = (ConfigServerImpl) ConfigWebUtil.getConfigServer(config, password); + ConfigServerImpl cs = (ConfigServerImpl) ConfigUtil.getConfigServer(config); try { CFMLEngineFactory factory = cs.getEngine().getCFMLEngineFactory(); @@ -3637,7 +3627,7 @@ private void _removeUpdate(Password password, boolean onlyLatest) throws PageExc public void changeVersionTo(Version version, Password password, IdentificationWeb id) throws PageException { checkWriteAccess(); - ConfigServerImpl cs = (ConfigServerImpl) ConfigWebUtil.getConfigServer(config, password); + ConfigServerImpl cs = (ConfigServerImpl) ConfigUtil.getConfigServer(config); Log logger = cs.getLog("deploy"); @@ -3687,7 +3677,7 @@ else if (OSGiUtil.isNewerThan(v, version)) { public void mvnChangeVersionTo(Version version, Password password, IdentificationWeb id) throws PageException { checkWriteAccess(); - ConfigServerImpl cs = (ConfigServerImpl) ConfigWebUtil.getConfigServer(config, password); + ConfigServerImpl cs = (ConfigServerImpl) ConfigUtil.getConfigServer(config); Log logger = cs.getLog("deploy"); @@ -3863,7 +3853,7 @@ private File mvnDownloadCore(CFMLEngineFactory factory, Version version, Identif */ public void restart(Password password) throws PageException { checkWriteAccess(); - ConfigServerImpl cs = (ConfigServerImpl) ConfigWebUtil.getConfigServer(config, password); + ConfigServerImpl cs = (ConfigServerImpl) ConfigUtil.getConfigServer(config); CFMLEngineFactory factory = cs.getEngine().getCFMLEngineFactory(); synchronized (factory) { @@ -3938,7 +3928,7 @@ private String checkCharset(String charset) throws PageException { else if ("os".equalsIgnoreCase(charset)) charset = SystemUtil.getCharset().name(); // check access - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) { throw new SecurityException("Access Denied to update regional setting"); } @@ -3980,7 +3970,7 @@ public Object storageGet(Config config, String key) throws ConverterException, I public void updateCustomTagDeepSearch(boolean customTagDeepSearch) throws SecurityException { checkWriteAccess(); - if (!ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_CUSTOM_TAG)) throw new SecurityException("Access Denied to update custom tag setting"); + if (!ConfigUtil.hasAccess(config, SecurityManager.TYPE_CUSTOM_TAG)) throw new SecurityException("Access Denied to update custom tag setting"); root.setEL("customTagDeepSearch", Caster.toString(customTagDeepSearch)); } @@ -3999,13 +3989,13 @@ public void resetId() throws PageException { public void updateCustomTagLocalSearch(boolean customTagLocalSearch) throws SecurityException { checkWriteAccess(); - if (!ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_CUSTOM_TAG)) throw new SecurityException("Access Denied to update custom tag setting"); + if (!ConfigUtil.hasAccess(config, SecurityManager.TYPE_CUSTOM_TAG)) throw new SecurityException("Access Denied to update custom tag setting"); root.setEL("customTagLocalSearch", Caster.toString(customTagLocalSearch)); } public void updateCustomTagExtensions(String extensions) throws PageException { checkWriteAccess(); - if (!ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_CUSTOM_TAG)) throw new SecurityException("Access Denied to update custom tag setting"); + if (!ConfigUtil.hasAccess(config, SecurityManager.TYPE_CUSTOM_TAG)) throw new SecurityException("Access Denied to update custom tag setting"); // check Array arr = ListUtil.listToArrayRemoveEmpty(extensions, ','); @@ -4022,7 +4012,7 @@ public void updateRemoteClient(String label, String url, String type, String sec // SNSN - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManagerImpl.TYPE_REMOTE); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManagerImpl.TYPE_REMOTE); if (!hasAccess) throw new SecurityException("Access Denied to update remote client settings"); Struct clients = _getRootElement("remoteClients"); @@ -4034,14 +4024,14 @@ public void updateRemoteClient(String label, String url, String type, String sec securityKey = securityKey.trim(); adminPassword = adminPassword.trim(); - Array children = ConfigWebUtil.getAsArray("remoteClient", clients); + Array children = ConfigUtil.getAsArray("remoteClient", clients); // Update for (int i = 1; i <= children.size(); i++) { Struct el = Caster.toStruct(children.get(i, null), null); if (el == null) continue; - String _url = ConfigWebUtil.getAsString("url", el, ""); + String _url = ConfigUtil.getAsString("url", el, ""); if (_url != null && _url.equalsIgnoreCase(url)) { el.setEL("label", label); el.setEL("type", type); @@ -4050,10 +4040,10 @@ public void updateRemoteClient(String label, String url, String type, String sec el.setEL("proxyServer", proxyServer); el.setEL("proxyUsername", proxyUsername); el.setEL("proxyPort", proxyPort); - el.setEL("securityKey", ConfigWebUtil.encrypt(securityKey)); - el.setEL("adminPassword", ConfigWebUtil.encrypt(adminPassword)); - el.setEL("serverPassword", ConfigWebUtil.encrypt(serverPassword)); - el.setEL("proxyPassword", ConfigWebUtil.encrypt(proxyPassword)); + el.setEL("securityKey", ConfigUtil.encrypt(securityKey)); + el.setEL("adminPassword", ConfigUtil.encrypt(adminPassword)); + el.setEL("serverPassword", ConfigUtil.encrypt(serverPassword)); + el.setEL("proxyPassword", ConfigUtil.encrypt(proxyPassword)); return; } } @@ -4069,65 +4059,13 @@ public void updateRemoteClient(String label, String url, String type, String sec el.setEL("proxyServer", proxyServer); el.setEL("proxyUsername", proxyUsername); el.setEL("proxyPort", proxyPort); - el.setEL("securityKey", ConfigWebUtil.encrypt(securityKey)); - el.setEL("adminPassword", ConfigWebUtil.encrypt(adminPassword)); - el.setEL("serverPassword", ConfigWebUtil.encrypt(serverPassword)); - el.setEL("proxyPassword", ConfigWebUtil.encrypt(proxyPassword)); + el.setEL("securityKey", ConfigUtil.encrypt(securityKey)); + el.setEL("adminPassword", ConfigUtil.encrypt(adminPassword)); + el.setEL("serverPassword", ConfigUtil.encrypt(serverPassword)); + el.setEL("proxyPassword", ConfigUtil.encrypt(proxyPassword)); children.appendEL(el); } - public void updateUpdateAdminMode(String mode, boolean merge, boolean keep) throws PageException { - checkWriteAccess(); - - if (config.getAdminMode() == ConfigImpl.ADMINMODE_MULTI) { - // copy the content from all web cfconfig into the server cfconfig - if (merge) { - ConfigWeb[] webs = ((ConfigServer) config).getConfigWebs(); - for (ConfigWeb cw: webs) { - try { - - merge(root, ConfigWebFactory.loadDocumentCreateIfFails(cw.getConfigFile(), "web"), EXCLUDE_LIST, ARRAY_INDEX); - } - catch (IOException e) { - throw Caster.toPageException(e); - } - } - } - - // move all extension in installed in web context to available in server context - { - ConfigWeb[] webs = ((ConfigServer) config).getConfigWebs(); - for (ConfigWeb cw: webs) { - try { - for (RHExtension ext: ((ConfigPro) cw).getRHExtensions()) { - ext.addToAvailable(cw); - } - } - catch (Exception e) { - LogUtil.log("deploy", "extension", e); - } - } - } - - // delete all the server configs - if (!keep) { - ConfigWeb[] webs = ((ConfigServer) config).getConfigWebs(); - for (ConfigWeb cw: webs) { - cw.getConfigFile().delete(); - } - } - } - - if (StringUtil.isEmpty(mode, true)) return; - mode = mode.trim(); - - if (mode.equalsIgnoreCase("m") || mode.equalsIgnoreCase("multi") || mode.equalsIgnoreCase("multiple")) mode = "multi"; - else if (mode.equalsIgnoreCase("s") || mode.equalsIgnoreCase("single")) mode = "single"; - else throw new ApplicationException("invalid mode [" + mode + "], valid modes are [single,multi]"); - - root.setEL(KeyConstants._mode, mode); - } - /* * public static void main(String[] args) { * @@ -4224,9 +4162,9 @@ public void updateMonitor(ClassDefinition cd, String type, String name, boolean } void _updateMonitor(ClassDefinition cd, String type, String name, boolean logEnabled) throws PageException { - stopMonitor(ConfigWebUtil.toMonitorType(type, Monitor.TYPE_INTERVAL), name); + stopMonitor(ConfigUtil.toMonitorType(type, Monitor.TYPE_INTERVAL), name); - Struct children = ConfigWebUtil.getAsStruct("monitors", root); + Struct children = ConfigUtil.getAsStruct("monitors", root); Key[] keys = children.keys(); Struct monitor = null; // Update @@ -4273,14 +4211,14 @@ protected static void removeCacheHandler(ConfigPro config, String id, boolean re } private void _removeCache(ClassDefinition cd) { - Array children = ConfigWebUtil.getAsArray("cacheClasses", root); + Array children = ConfigUtil.getAsArray("cacheClasses", root); Key[] keys = children.keys(); for (int i = keys.length - 1; i >= 0; i--) { Key key = keys[i]; Struct el = Caster.toStruct(children.get(key, null), null); if (el == null) continue; - String _class = ConfigWebUtil.getAsString("virtual", el, null); + String _class = ConfigUtil.getAsString("virtual", el, null); if (_class != null && _class.equalsIgnoreCase(cd.getClassName())) { children.removeEL(key); break; @@ -4289,7 +4227,7 @@ private void _removeCache(ClassDefinition cd) { } private void _removeCacheHandler(String id) { - Struct handlers = ConfigWebUtil.getAsStruct("cacheHandlers", root); + Struct handlers = ConfigUtil.getAsStruct("cacheHandlers", root); Key[] keys = handlers.keys(); for (Key key: keys) { String _id = key.getString(); @@ -4308,14 +4246,14 @@ public void updateCacheHandler(String id, ClassDefinition cd) throws PageExcepti } private void _updateCache(ClassDefinition cd) throws PageException { - Array children = ConfigWebUtil.getAsArray("cacheClasses", root); + Array children = ConfigUtil.getAsArray("cacheClasses", root); Struct ch = null; // Update for (int i = 1; i <= children.size(); i++) { Struct el = Caster.toStruct(children.get(i, null), null); if (el == null) continue; - String _class = ConfigWebUtil.getAsString("class", el, null); + String _class = ConfigUtil.getAsString("class", el, null); if (_class != null && _class.equalsIgnoreCase(cd.getClassName())) { ch = el; break; @@ -4331,7 +4269,7 @@ private void _updateCache(ClassDefinition cd) throws PageException { } private void _updateCacheHandler(String id, ClassDefinition cd) throws PageException { - Struct handlers = ConfigWebUtil.getAsStruct("cacheHandlers", root); + Struct handlers = ConfigUtil.getAsStruct("cacheHandlers", root); Iterator> it = handlers.entryIterator(); Struct ch = null; // Update @@ -4369,9 +4307,9 @@ public void removeMonitor(String type, String name) throws SecurityException { void _removeMonitor(String type, String name) { - stopMonitor(ConfigWebUtil.toMonitorType(type, Monitor.TYPE_INTERVAL), name); + stopMonitor(ConfigUtil.toMonitorType(type, Monitor.TYPE_INTERVAL), name); - Array children = ConfigWebUtil.getAsArray("monitors", root); + Array children = ConfigUtil.getAsArray("monitors", root); Key[] keys = children.keys(); for (Key key: keys) { String _name = key.getString(); @@ -4382,7 +4320,7 @@ void _removeMonitor(String type, String name) { } public void removeCacheHandler(String id) { - Struct handlers = ConfigWebUtil.getAsStruct("cacheHandlers", root); + Struct handlers = ConfigUtil.getAsStruct("cacheHandlers", root); Key[] keys = handlers.keys(); for (Key key: keys) { String _id = key.getString(); @@ -4404,7 +4342,7 @@ public void updateRHExtensionProvider(String strUrl) throws MalformedURLExceptio } public void updateExtensionProvider(String strUrl) throws MalformedURLException, PageException { - Array children = ConfigWebUtil.getAsArray("extensionProviders", root); + Array children = ConfigUtil.getAsArray("extensionProviders", root); strUrl = strUrl.trim(); URL _url = HTTPUtil.toURL(strUrl, HTTPUtil.ENCODED_NO); @@ -4426,7 +4364,7 @@ public void updateExtensionProvider(String strUrl) throws MalformedURLException, } public void removeExtensionProvider(String strUrl) { - Array children = ConfigWebUtil.getAsArray("extensionProviders", root); + Array children = ConfigUtil.getAsArray("extensionProviders", root); Key[] keys = children.keys(); strUrl = strUrl.trim(); String url; @@ -4447,7 +4385,7 @@ public void removeRHExtensionProvider(String strUrl) { } public void resetORMSetting() throws SecurityException { - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManagerImpl.TYPE_ORM); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManagerImpl.TYPE_ORM); if (!hasAccess) throw new SecurityException("Access Denied to update ORM Settings"); @@ -4456,7 +4394,7 @@ public void resetORMSetting() throws SecurityException { } public void updateORMSetting(ORMConfiguration oc) throws SecurityException { - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManagerImpl.TYPE_ORM); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManagerImpl.TYPE_ORM); if (!hasAccess) throw new SecurityException("Access Denied to update ORM Settings"); @@ -4500,7 +4438,7 @@ public void removeRHExtension(String id) throws PageException { checkWriteAccess(); if (StringUtil.isEmpty(id, true)) return; - Array children = ConfigWebUtil.getAsArray("extensions", root); + Array children = ConfigUtil.getAsArray("extensions", root); int[] keys = children.intKeys(); Struct child; RHExtension rhe; @@ -4545,7 +4483,7 @@ public static void updateArchive(ConfigPro config, Resource arc, boolean reload) public static void updateCore(ConfigServerImpl config, Resource core, boolean reload) throws PageException { try { // get patches directory - CFMLEngine engine = ConfigWebUtil.getEngine(config); + CFMLEngine engine = ConfigUtil.getEngine(config); ConfigServerImpl cs = config; Version v; v = CFMLEngineFactory.toVersion(core.getName(), null); @@ -4600,10 +4538,10 @@ public void updateArchive(Config config, Resource archive) throws PageException readOnly = Caster.toBooleanValue(StringUtil.unwrap(attr.getValue("mapping-readonly")), false); topLevel = Caster.toBooleanValue(StringUtil.unwrap(attr.getValue("mapping-top-level")), false); - listMode = ConfigWebUtil.toListenerMode(StringUtil.unwrap(attr.getValue("mapping-listener-mode")), -1); - listType = ConfigWebUtil.toListenerType(StringUtil.unwrap(attr.getValue("mapping-listener-type")), -1); + listMode = ConfigUtil.toListenerMode(StringUtil.unwrap(attr.getValue("mapping-listener-mode")), -1); + listType = ConfigUtil.toListenerType(StringUtil.unwrap(attr.getValue("mapping-listener-type")), -1); - inspect = ConfigWebUtil.inspectTemplate(StringUtil.unwrap(attr.getValue("mapping-inspect")), Config.INSPECT_UNDEFINED); + inspect = ConfigUtil.inspectTemplate(StringUtil.unwrap(attr.getValue("mapping-inspect")), Config.INSPECT_UNDEFINED); if (inspect == Config.INSPECT_UNDEFINED) { Boolean trusted = Caster.toBoolean(StringUtil.unwrap(attr.getValue("mapping-trusted")), null); if (trusted != null) { @@ -4736,7 +4674,7 @@ public void updateRHExtension(Config config, RHExtension rhext, boolean reload, boolean reloadNecessary = false; // store to xml - RHExtension.removeDuplicates(ConfigWebUtil.getAsArray("extensions", root)); + RHExtension.removeDuplicates(ConfigUtil.getAsArray("extensions", root)); BundleDefinition[] existing = _updateExtension(ci, rhext); // this must happen after "store" @@ -5048,31 +4986,31 @@ else if (!StringUtil.isEmpty(cfc, true)) { primary = map.get("primary"); // inspect - inspect = ConfigWebUtil.inspectTemplate(map.get("inspect"), Config.INSPECT_UNDEFINED); + inspect = ConfigUtil.inspectTemplate(map.get("inspect"), Config.INSPECT_UNDEFINED); // inspect interval slow String str = map.get("inspect-interval-slow"); if (StringUtil.isEmpty(str, true)) str = map.get("inspectintervalslow"); if (StringUtil.isEmpty(str, true)) str = map.get("inspectIntervalSlow"); - inspectTemplateIntervalSlow = ConfigWebUtil.toListenerType(str, -1); + inspectTemplateIntervalSlow = ConfigUtil.toListenerType(str, -1); // inspect interval fast str = map.get("inspect-interval-fast"); if (StringUtil.isEmpty(str, true)) str = map.get("inspectintervalfast"); if (StringUtil.isEmpty(str, true)) str = map.get("inspectIntervalFast"); - inspectTemplateIntervalFast = ConfigWebUtil.toListenerType(str, -1); + inspectTemplateIntervalFast = ConfigUtil.toListenerType(str, -1); // mode str = map.get("listener-mode"); if (StringUtil.isEmpty(str, true)) str = map.get("listenermode"); if (StringUtil.isEmpty(str, true)) str = map.get("listenerMode"); - lmode = ConfigWebUtil.toListenerMode(str, -1); + lmode = ConfigUtil.toListenerMode(str, -1); // type String strLType = map.get("listener-type"); if (StringUtil.isEmpty(strLType, true)) strLType = map.get("listenertype"); if (StringUtil.isEmpty(strLType, true)) strLType = map.get("listenerType"); - ltype = ConfigWebUtil.toListenerType(strLType, -1); + ltype = ConfigUtil.toListenerType(strLType, -1); toplevel = Caster.toBooleanValue(map.get("toplevel"), false); readonly = Caster.toBooleanValue(map.get("readonly"), false); @@ -5512,7 +5450,7 @@ public void updateFilesystem(String fldDefaultDirectory, String functionDefaultD String functionAddionalDirectory, String tagAddionalDirectory) throws SecurityException { checkWriteAccess(); - Struct fs = ConfigWebUtil.getAsStruct("fileSystem", root); + Struct fs = ConfigUtil.getAsStruct("fileSystem", root); if (!StringUtil.isEmpty(fldDefaultDirectory, true)) { fs.setEL(KeyImpl.init("fldDefaultDirectory"), fldDefaultDirectory); } @@ -5736,14 +5674,14 @@ public boolean updateLabel(String hash, String label) { hash = hash.trim(); label = label.trim(); - Array children = ConfigWebUtil.getAsArray("labels", "label", root); + Array children = ConfigUtil.getAsArray("labels", "label", root); // Update for (int i = 1; i <= children.size(); i++) { Struct tmp = Caster.toStruct(children.get(i, null), null); if (tmp == null) continue; - String h = ConfigWebUtil.getAsString("id", tmp, null); + String h = ConfigUtil.getAsString("id", tmp, null); if (h != null) { if (h.equals(hash)) { if (label.equals(tmp.get("name", null))) return false; @@ -5764,7 +5702,7 @@ public boolean updateLabel(String hash, String label) { public void updateDebugSetting(int maxLogs) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING); if (!hasAccess) throw new SecurityException("Access denied to change debugging settings"); if (maxLogs == -1) rem(root, "debuggingMaxRecordsLogged"); @@ -5773,7 +5711,7 @@ public void updateDebugSetting(int maxLogs) throws SecurityException { public void updateDebugEntry(String type, String iprange, String label, String path, String fullname, Struct custom) throws SecurityException, IOException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING); if (!hasAccess) throw new SecurityException("Access denied to change debugging settings"); // leave this, this method throws an exception when ip range is not valid @@ -5784,7 +5722,7 @@ public void updateDebugEntry(String type, String iprange, String label, String p iprange = iprange.trim(); label = label.trim(); - Array children = ConfigWebUtil.getAsArray("debugTemplates", root); + Array children = ConfigUtil.getAsArray("debugTemplates", root); // Update Struct el = null; @@ -5792,7 +5730,7 @@ public void updateDebugEntry(String type, String iprange, String label, String p Struct tmp = Caster.toStruct(children.get(i, null), null); if (tmp == null) continue; - String _id = ConfigWebUtil.getAsString("id", tmp, null); + String _id = ConfigUtil.getAsString("id", tmp, null); if (_id != null) { if (_id.equals(id)) { el = tmp; @@ -5818,10 +5756,10 @@ public void updateDebugEntry(String type, String iprange, String label, String p public void removeDebugEntry(String id) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING); if (!hasAccess) throw new SecurityException("Access denied to change debugging settings"); - Array children = ConfigWebUtil.getAsArray("debugTemplates", root); + Array children = ConfigUtil.getAsArray("debugTemplates", root); Key[] keys = children.keys(); String _id; if (children.size() > 0) { @@ -5830,7 +5768,7 @@ public void removeDebugEntry(String id) throws SecurityException { Struct el = Caster.toStruct(children.get(key, null), null); if (el == null) continue; - _id = ConfigWebUtil.getAsString("id", el, null); + _id = ConfigUtil.getAsString("id", el, null); if (_id != null && _id.equalsIgnoreCase(id)) { children.removeEL(key); } @@ -5864,7 +5802,7 @@ public void updateLogSettings(String name, int level, ClassDefinition appenderCD catch (Exception e) { throw Caster.toPageException(e); } - Struct children = ConfigWebUtil.getAsStruct("loggers", root); + Struct children = ConfigUtil.getAsStruct("loggers", root); Key[] keys = children.keys(); // Update Struct el = null; @@ -6292,7 +6230,7 @@ public BundleDefinition[] _removeExtension(ConfigPro config, String extensionID, throws IOException, PageException, BundleException, ConverterException { if (!Decision.isUUId(extensionID)) throw new IOException("id [" + extensionID + "] is invalid, it has to be a UUID"); - Array children = ConfigWebUtil.getAsArray("extensions", root); + Array children = ConfigUtil.getAsArray("extensions", root); int[] keys = children.intKeys(); // Update @@ -6310,7 +6248,7 @@ public BundleDefinition[] _removeExtension(ConfigPro config, String extensionID, id = Caster.toString(el.get(KeyConstants._id), null); if (extensionID.equalsIgnoreCase(id)) { - bundles = RHExtension.toBundleDefinitions(ConfigWebUtil.getAsString("bundles", el, null)); // get existing bundles before populate new ones + bundles = RHExtension.toBundleDefinitions(ConfigUtil.getAsString("bundles", el, null)); // get existing bundles before populate new ones // bundles arr = _removeExtensionCheckOtherUsage(children, el, "bundles"); @@ -6362,7 +6300,7 @@ public BundleDefinition[] _removeExtension(ConfigPro config, String extensionID, public static void cleanBundles(RHExtension rhe, ConfigPro config, BundleDefinition[] candiatesToRemove) { if (ArrayUtil.isEmpty(candiatesToRemove)) return; - BundleCollection coreBundles = ConfigWebUtil.getEngine(config).getBundleCollection(); + BundleCollection coreBundles = ConfigUtil.getEngine(config).getBundleCollection(); // core master _cleanBundles(candiatesToRemove, coreBundles.core.getSymbolicName(), coreBundles.core.getVersion()); @@ -6412,7 +6350,7 @@ else if (bd.getVersion() != null && version.equals(bd.getVersion())) { } private String[] _removeExtensionCheckOtherUsage(Array children, Struct curr, String type) { - String currVal = ConfigWebUtil.getAsString(type, curr, null); + String currVal = ConfigUtil.getAsString(type, curr, null); if (StringUtil.isEmpty(currVal)) return null; Key[] keys = children.keys(); String otherVal; @@ -6427,7 +6365,7 @@ private String[] _removeExtensionCheckOtherUsage(Array children, Struct curr, St other = tmp; if (other == curr) continue; - otherVal = ConfigWebUtil.getAsString(type, other, null); + otherVal = ConfigUtil.getAsString(type, other, null); if (StringUtil.isEmpty(otherVal)) continue; otherArr = ListUtil.trimItems(ListUtil.listToStringArray(otherVal, ',')); for (int y = 0; y < otherArr.length; y++) { @@ -6449,7 +6387,7 @@ private String[] _removeExtensionCheckOtherUsage(Array children, Struct curr, St */ public BundleDefinition[] _updateExtension(ConfigPro config, RHExtension ext) throws IOException, BundleException, PageException { if (!Decision.isUUId(ext.getId())) throw new IOException("id [" + ext.getId() + "] is invalid, it has to be a UUID"); - Array children = ConfigWebUtil.getAsArray("extensions", root); + Array children = ConfigUtil.getAsArray("extensions", root); int[] keys = children.intKeys(); int key; // Update @@ -6467,7 +6405,7 @@ public BundleDefinition[] _updateExtension(ConfigPro config, RHExtension ext) th id = Caster.toString(el.get(KeyConstants._id, null), null); if (StringUtil.isEmpty(id)) hasNoneId = true; if (ext.getId().equalsIgnoreCase(id)) { - old = RHExtension.toBundleDefinitions(ConfigWebUtil.getAsString("bundles", el, null)); // get existing bundles before populate new ones + old = RHExtension.toBundleDefinitions(ConfigUtil.getAsString("bundles", el, null)); // get existing bundles before populate new ones ext.populate(el, false); old = minus(old, OSGiUtil.toBundleDefinitions(ext.getBundles())); return old; @@ -6494,7 +6432,7 @@ public BundleDefinition[] _updateExtension(ConfigPro config, RHExtension ext) th try { RHExtension _ext = RHExtension.getInstance(config, r);// TODO not load it again! if (_ext != null && _ext.getId().equalsIgnoreCase(ext.getId())) { - old = RHExtension.toBundleDefinitions(ConfigWebUtil.getAsString("bundles", el, null)); // get existing bundles before populate new ones + old = RHExtension.toBundleDefinitions(ConfigUtil.getAsString("bundles", el, null)); // get existing bundles before populate new ones ext.populate(el, false); old = minus(old, OSGiUtil.toBundleDefinitions(ext.getBundles())); return old; @@ -6535,7 +6473,7 @@ private BundleDefinition[] minus(BundleDefinition[] oldBD, BundleDefinition[] ne } private RHExtension getRHExtension(final ConfigPro config, final String id, final RHExtension defaultValue) { - Array children = ConfigWebUtil.getAsArray("extensions", root); + Array children = ConfigUtil.getAsArray("extensions", root); if (children != null) { int[] keys = children.intKeys(); @@ -6575,7 +6513,7 @@ public static RHExtension hasRHExtensionInstalled(ConfigPro config, ExtensionDef private RHExtension _hasRHExtensionInstalled(ConfigPro config, ExtensionDefintion ed) throws PageException { - Array children = ConfigWebUtil.getAsArray("extensions", root); + Array children = ConfigUtil.getAsArray("extensions", root); int[] keys = children.intKeys(); RHExtension tmp; try { @@ -6732,7 +6670,7 @@ public static boolean doAccept(Resource res) { public void updateQueue(Integer max, Integer timeout, Boolean enable) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("Accces Denied to update queue settings"); // max @@ -6748,7 +6686,7 @@ public void updateQueue(Integer max, Integer timeout, Boolean enable) throws Sec public void updateCGIReadonly(Boolean cgiReadonly) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("Accces Denied to update scope setting"); root.setEL("cgiScopeReadOnly", Caster.toString(cgiReadonly, "")); @@ -6756,7 +6694,7 @@ public void updateCGIReadonly(Boolean cgiReadonly) throws SecurityException { public void updateFormUrlAsStruct(Boolean formUrlAsStruct) throws SecurityException { checkWriteAccess(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("Accces Denied to update scope setting"); root.setEL("formUrlAsStruct", Caster.toString(formUrlAsStruct, "")); diff --git a/core/src/main/java/lucee/runtime/config/ConfigFactory.java b/core/src/main/java/lucee/runtime/config/ConfigFactory.java index f2217cef4c..59244dd837 100644 --- a/core/src/main/java/lucee/runtime/config/ConfigFactory.java +++ b/core/src/main/java/lucee/runtime/config/ConfigFactory.java @@ -261,13 +261,13 @@ else if (old instanceof InputSource) { else { new ConverterException("inputing data is invalid, cannot cast [" + old.getClass().getName() + "] to a Resource or an InputSource"); } - Struct root = ConfigWebUtil.getAsStruct(reader.getData(), false, "cfLuceeConfiguration", "luceeConfiguration", "lucee-configuration"); + Struct root = ConfigUtil.getAsStruct(reader.getData(), false, "cfLuceeConfiguration", "luceeConfiguration", "lucee-configuration"); //////////////////// charset //////////////////// { - Struct charset = ConfigWebUtil.getAsStruct("charset", root); - Struct regional = ConfigWebUtil.getAsStruct("regional", root); - Struct fileSystem = ConfigWebUtil.getAsStruct("fileSystem", root); + Struct charset = ConfigUtil.getAsStruct("charset", root); + Struct regional = ConfigUtil.getAsStruct("regional", root); + Struct fileSystem = ConfigUtil.getAsStruct("fileSystem", root); copy("charset", "templateCharset", fileSystem, root);// deprecated but still supported copy("encoding", "templateCharset", fileSystem, root);// deprecated but still supported move("templateCharset", charset, root); @@ -285,15 +285,15 @@ else if (old instanceof InputSource) { } //////////////////// regional //////////////////// { - Struct regional = ConfigWebUtil.getAsStruct("regional", root); + Struct regional = ConfigUtil.getAsStruct("regional", root); move("timezone", regional, root); move("locale", regional, root); rem("regional", root); } //////////////////// application //////////////////// { - Struct application = ConfigWebUtil.getAsStruct("application", root); - Struct scope = ConfigWebUtil.getAsStruct("scope", root); + Struct application = ConfigUtil.getAsStruct("application", root); + Struct scope = ConfigUtil.getAsStruct("scope", root); move("listenerType", application, root); move("listenerMode", application, root); move("typeChecking", application, root); @@ -316,9 +316,9 @@ else if (old instanceof InputSource) { //////////////////// caches //////////////////// { - Struct cache = ConfigWebUtil.getAsStruct("cache", root); - Struct caches = ConfigWebUtil.getAsStruct("caches", root); - Array conns = ConfigWebUtil.getAsArray("connection", cache); + Struct cache = ConfigUtil.getAsStruct("cache", root); + Struct caches = ConfigUtil.getAsStruct("caches", root); + Array conns = ConfigUtil.getAsArray("connection", cache); // classes move("cache", "cacheClasses", caches, root); @@ -339,8 +339,8 @@ else if (old instanceof InputSource) { //////////////////// cache handlers //////////////////// { - Struct handlers = ConfigWebUtil.getAsStruct("cacheHandlers", root); - Array handler = ConfigWebUtil.getAsArray("cacheHandler", handlers); + Struct handlers = ConfigUtil.getAsStruct("cacheHandlers", root); + Array handler = ConfigUtil.getAsArray("cacheHandler", handlers); Key[] keys = handler.keys(); for (int i = keys.length - 1; i >= 0; i--) { @@ -354,9 +354,9 @@ else if (old instanceof InputSource) { //////////////////// CFX //////////////////// { - Struct extTags = ConfigWebUtil.getAsStruct("extTags", root); - Array extTag = ConfigWebUtil.getAsArray("extTag", extTags); - Struct cfx = ConfigWebUtil.getAsStruct("cfx", root); + Struct extTags = ConfigUtil.getAsStruct("extTags", root); + Array extTag = ConfigUtil.getAsArray("extTag", extTags); + Struct cfx = ConfigUtil.getAsStruct("cfx", root); Iterator it = extTag.getIterator(); while (it.hasNext()) { @@ -369,7 +369,7 @@ else if (old instanceof InputSource) { //////////////////// Compiler //////////////////// { - Struct compiler = ConfigWebUtil.getAsStruct("compiler", root); + Struct compiler = ConfigUtil.getAsStruct("compiler", root); moveAsBool("supressWsBeforeArg", "suppressWhitespaceBeforeArgument", compiler, root);// deprecated but still supported moveAsBool("suppressWsBeforeArg", "suppressWhitespaceBeforeArgument", compiler, root); moveAsBool("dotNotationUpperCase", "dotNotationUpperCase", compiler, root); @@ -382,7 +382,7 @@ else if (old instanceof InputSource) { //////////////////// Component //////////////////// { - Struct component = ConfigWebUtil.getAsStruct("component", root); + Struct component = ConfigUtil.getAsStruct("component", root); move("componentDefaultImport", "componentAutoImport", component, root); move("base", "componentBase", component, root);// deprecated but still supported move("baseCfml", "componentBase", component, root); @@ -398,14 +398,14 @@ else if (old instanceof InputSource) { moveAsBool("useShadow", "componentUseVariablesScope", component, root); // mappings - Array ctMappings = ConfigWebUtil.getAsArray("mapping", component); + Array ctMappings = ConfigUtil.getAsArray("mapping", component); add(ctMappings, "componentMappings", root); rem("mapping", component); } //////////////////// Custom tags //////////////////// { - Struct ct = ConfigWebUtil.getAsStruct("customTag", root); + Struct ct = ConfigUtil.getAsStruct("customTag", root); moveAsBool("customTagUseCachePath", "customTagUseCachePath", ct, root); moveAsBool("useCachePath", "customTagUseCachePath", ct, root); moveAsBool("customTagLocalSearch", "customTagLocalSearch", ct, root); @@ -414,15 +414,15 @@ else if (old instanceof InputSource) { moveAsBool("customTagDeepSearch", "customTagDeepSearch", ct, root); move("extensions", "customTagExtensions", ct, root); move("customTagExtensions", "customTagExtensions", ct, root); - Array ctMappings = ConfigWebUtil.getAsArray("mapping", ct); + Array ctMappings = ConfigUtil.getAsArray("mapping", ct); add(ctMappings, "customTagMappings", root); rem("mapping", ct); } //////////////////// Constants //////////////////// { - Struct constants = ConfigWebUtil.getAsStruct("constants", root); - Array constant = ConfigWebUtil.getAsArray("constant", constants); + Struct constants = ConfigUtil.getAsStruct("constants", root); + Array constant = ConfigUtil.getAsArray("constant", constants); rem("constant", constants); Key[] keys = constant.keys(); @@ -437,9 +437,9 @@ else if (old instanceof InputSource) { //////////////////// JDBC //////////////////// { - Struct jdbc = ConfigWebUtil.getAsStruct("jdbc", root); - Array driver = ConfigWebUtil.getAsArray("driver", jdbc); - Struct jdbcDrivers = ConfigWebUtil.getAsStruct("jdbcDrivers", root); + Struct jdbc = ConfigUtil.getAsStruct("jdbc", root); + Array driver = ConfigUtil.getAsArray("driver", jdbc); + Struct jdbcDrivers = ConfigUtil.getAsStruct("jdbcDrivers", root); Key[] keys = driver.keys(); for (int i = keys.length - 1; i >= 0; i--) { @@ -454,7 +454,7 @@ else if (old instanceof InputSource) { //////////////////// Datasource //////////////////// { - Struct dataSources = ConfigWebUtil.getAsStruct("dataSources", root); + Struct dataSources = ConfigUtil.getAsStruct("dataSources", root); // preserveSingleQuote Boolean b = Caster.toBoolean(dataSources.get("psq", null), null); if (b == null) { @@ -463,7 +463,7 @@ else if (old instanceof InputSource) { } if (b != null) root.setEL("preserveSingleQuote", b.booleanValue()); - Array dataSource = ConfigWebUtil.getAsArray("dataSource", dataSources); + Array dataSource = ConfigUtil.getAsArray("dataSource", dataSources); Key[] keys = dataSource.keys(); for (int i = keys.length - 1; i >= 0; i--) { @@ -477,7 +477,7 @@ else if (old instanceof InputSource) { //////////////////// Debugging //////////////////// { - Struct debugging = ConfigWebUtil.getAsStruct("debugging", root); + Struct debugging = ConfigUtil.getAsStruct("debugging", root); moveAsBool("debug", "debuggingEnabled", debugging, root); moveAsBool("debugLogOutput", "debuggingLogOutput", debugging, root); moveAsBool("database", "debuggingDatabase", debugging, root); @@ -492,22 +492,22 @@ else if (old instanceof InputSource) { moveAsBool("thread", "debuggingThread", debugging, root); moveAsInt("maxRecordsLogged", "debuggingMaxRecordsLogged", debugging, root); - Array entries = ConfigWebUtil.getAsArray("debugEntry", debugging); + Array entries = ConfigUtil.getAsArray("debugEntry", debugging); add(entries, "debugTemplates", root); rem("debugEntry", debugging); } //////////////////// Dump Writer //////////////////// { - Struct dumpWriters = ConfigWebUtil.getAsStruct("dumpWriters", root); - Array dumpWriter = ConfigWebUtil.getAsArray("dumpWriter", dumpWriters); + Struct dumpWriters = ConfigUtil.getAsStruct("dumpWriters", root); + Array dumpWriter = ConfigUtil.getAsArray("dumpWriter", dumpWriters); add(dumpWriter, "dumpWriters", root); rem("dumpWriter", dumpWriters); } //////////////////// Error //////////////////// { - Struct error = ConfigWebUtil.getAsStruct("error", root); + Struct error = ConfigUtil.getAsStruct("error", root); String tmpl = Caster.toString(error.get("template", null), null); String tmpl500 = Caster.toString(error.get("template500", null), null); String tmpl404 = Caster.toString(error.get("template404", null), null); @@ -526,8 +526,8 @@ else if (old instanceof InputSource) { //////////////////// Extensions //////////////////// { - Struct extensions = ConfigWebUtil.getAsStruct("extensions", root); - Array rhextension = ConfigWebUtil.getAsArray("rhextension", extensions); + Struct extensions = ConfigUtil.getAsStruct("extensions", root); + Array rhextension = ConfigUtil.getAsArray("rhextension", extensions); Array newExtensions = new ArrayImpl(); rem("enabled", extensions); rem("extension", extensions); @@ -555,8 +555,8 @@ else if (old instanceof InputSource) { } // providers - Array rhprovider = ConfigWebUtil.getAsArray("rhprovider", extensions); - Array extensionProviders = ConfigWebUtil.getAsArray("extensionProviders", root); + Array rhprovider = ConfigUtil.getAsArray("rhprovider", extensions); + Array extensionProviders = ConfigUtil.getAsArray("extensionProviders", root); Iterator it = rhprovider.valueIterator(); while (it.hasNext()) { Struct data = Caster.toStruct(it.next(), null); @@ -570,8 +570,8 @@ else if (old instanceof InputSource) { //////////////////// Gateway //////////////////// { - Struct gateways = ConfigWebUtil.getAsStruct("gateways", root); - Array gateway = ConfigWebUtil.getAsArray("gateway", gateways); + Struct gateways = ConfigUtil.getAsStruct("gateways", root); + Array gateway = ConfigUtil.getAsArray("gateway", gateways); Key[] keys = gateway.keys(); for (int i = keys.length - 1; i >= 0; i--) { @@ -586,16 +586,16 @@ else if (old instanceof InputSource) { //////////////////// Java //////////////////// { - Struct java = ConfigWebUtil.getAsStruct("java", root); + Struct java = ConfigUtil.getAsStruct("java", root); move("inspectTemplate", java, root); move("compileType", java, root); } //////////////////// Loggers //////////////////// { - Struct logging = ConfigWebUtil.getAsStruct("logging", root); - Array logger = ConfigWebUtil.getAsArray("logger", logging); - Struct loggers = ConfigWebUtil.getAsStruct("loggers", root); + Struct logging = ConfigUtil.getAsStruct("logging", root); + Array logger = ConfigUtil.getAsArray("logger", logging); + Struct loggers = ConfigUtil.getAsStruct("loggers", root); Key[] keys = logger.keys(); for (int i = keys.length - 1; i >= 0; i--) { @@ -609,7 +609,7 @@ else if (old instanceof InputSource) { //////////////////// Login //////////////////// { - Struct login = ConfigWebUtil.getAsStruct("login", root); + Struct login = ConfigUtil.getAsStruct("login", root); moveAsBool("captcha", "loginCaptcha", login, root); moveAsBool("rememberme", "loginRememberme", login, root); moveAsInt("delay", "loginDelay", login, root); @@ -617,7 +617,7 @@ else if (old instanceof InputSource) { //////////////////// Mail //////////////////// { - Struct mail = ConfigWebUtil.getAsStruct("mail", root); + Struct mail = ConfigUtil.getAsStruct("mail", root); moveAsBool("sendPartial", "mailSendPartial", mail, root); moveAsBool("userSet", "mailUserSet", mail, root); moveAsInt("spoolInterval", "mailSpoolInterval", mail, root); @@ -625,7 +625,7 @@ else if (old instanceof InputSource) { moveAsBool("spoolEnable", "mailSpoolEnable", mail, root); moveAsInt("timeout", "mailConnectionTimeout", mail, root); - Array server = ConfigWebUtil.getAsArray("server", mail); + Array server = ConfigUtil.getAsArray("server", mail); add(server, "mailServers", root); rem("mail", root); } @@ -633,8 +633,8 @@ else if (old instanceof InputSource) { //////////////////// Mappings //////////////////// { - Struct mappings = ConfigWebUtil.getAsStruct("mappings", root); - Array mapping = ConfigWebUtil.getAsArray("mapping", mappings); + Struct mappings = ConfigUtil.getAsStruct("mappings", root); + Array mapping = ConfigUtil.getAsArray("mapping", mappings); Key[] keys = mapping.keys(); for (int i = keys.length - 1; i >= 0; i--) { @@ -648,11 +648,11 @@ else if (old instanceof InputSource) { //////////////////// Monitor //////////////////// { - Struct monitoring = ConfigWebUtil.getAsStruct("monitoring", root); - Array monitor = ConfigWebUtil.getAsArray("monitor", monitoring); + Struct monitoring = ConfigUtil.getAsStruct("monitoring", root); + Array monitor = ConfigUtil.getAsArray("monitor", monitoring); moveAsBool("enabled", "monitorEnable", monitoring, root); - Struct monitors = ConfigWebUtil.getAsStruct("monitors", root); + Struct monitors = ConfigUtil.getAsStruct("monitors", root); Key[] keys = monitor.keys(); for (int i = keys.length - 1; i >= 0; i--) { Key k = keys[i]; @@ -665,7 +665,7 @@ else if (old instanceof InputSource) { //////////////////// queue //////////////////// { - Struct queue = ConfigWebUtil.getAsStruct("queue", root); + Struct queue = ConfigUtil.getAsStruct("queue", root); moveAsInt("enable", "requestQueueEnable", queue, root); moveAsInt("max", "requestQueueMax", queue, root); moveAsInt("timeout", "requestQueueTimeout", queue, root); @@ -673,7 +673,7 @@ else if (old instanceof InputSource) { //////////////////// regex //////////////////// { - Struct regex = ConfigWebUtil.getAsStruct("regex", root); + Struct regex = ConfigUtil.getAsStruct("regex", root); move("type", "regexType", regex, root); } @@ -685,15 +685,15 @@ else if (old instanceof InputSource) { //////////////////// scheduler //////////////////// if (config != null) { Resource configDir = config.getConfigDir(); - Struct scheduler = ConfigWebUtil.getAsStruct("scheduler", root); + Struct scheduler = ConfigUtil.getAsStruct("scheduler", root); // set scheduler - Resource schedulerDir = ConfigWebUtil.getFile(config.getRootDirectory(), ConfigWebFactory.getAttr(scheduler, "directory"), "scheduler", configDir, FileUtil.TYPE_DIR, + Resource schedulerDir = ConfigUtil.getFile(config.getRootDirectory(), ConfigWebFactory.getAttr(scheduler, "directory"), "scheduler", configDir, FileUtil.TYPE_DIR, ResourceUtil.LEVEL_GRAND_PARENT_FILE, config); Resource schedulerFile = schedulerDir.getRealResource("scheduler.xml"); if (schedulerFile.isFile()) { Struct schedulerRoot = new XMLConfigReader(schedulerFile, true, new ReadRule(), new NameRule()).getData(); - Array task = ConfigWebUtil.getAsArray("schedule", "task", schedulerRoot); + Array task = ConfigUtil.getAsArray("schedule", "task", schedulerRoot); add(task, "scheduledTasks", root); } rem("scheduler", root); @@ -701,7 +701,7 @@ else if (old instanceof InputSource) { //////////////////// Scope //////////////////// { - Struct scope = ConfigWebUtil.getAsStruct("scope", root); + Struct scope = ConfigUtil.getAsStruct("scope", root); move("localMode", "localScopeMode", scope, root); moveAsBool("cgiReadonly", "cgiScopeReadonly", scope, root); move("sessionType", "sessionType", scope, root); @@ -731,7 +731,7 @@ else if (old instanceof InputSource) { //////////////////// Setting //////////////////// { - Struct setting = ConfigWebUtil.getAsStruct("setting", root); + Struct setting = ConfigUtil.getAsStruct("setting", root); moveAsBool("suppressContent", "suppressContent", setting, root); move("cfmlWriter", "cfmlWriter", setting, root); moveAsBool("showVersion", "showVersion", setting, root); @@ -741,7 +741,7 @@ else if (old instanceof InputSource) { moveAsBool("bufferingOutput", "bufferTagBodyOutput", setting, root); moveAsBool("allowCompression", "allowCompression", setting, root); - Struct _mode = ConfigWebUtil.getAsStruct("mode", root); + Struct _mode = ConfigUtil.getAsStruct("mode", root); moveAsBool("develop", "developMode", _mode, root); // now that mode is free we can use it for the admin mode @@ -752,24 +752,24 @@ else if (old instanceof InputSource) { //////////////////// startup Hooks //////////////////// { - Struct startup = ConfigWebUtil.getAsStruct("startup", root); - Array hook = ConfigWebUtil.getAsArray("hook", startup); + Struct startup = ConfigUtil.getAsStruct("startup", root); + Array hook = ConfigUtil.getAsArray("hook", startup); add(hook, "startupHooks", root); rem("startup", root); } //////////////////// System //////////////////// { - Struct system = ConfigWebUtil.getAsStruct("system", root); + Struct system = ConfigUtil.getAsStruct("system", root); move("out", "systemOut", system, root); move("err", "systemErr", system, root); } //////////////////// Tags //////////////////// { - Struct tags = ConfigWebUtil.getAsStruct("tags", root); - Array _default = ConfigWebUtil.getAsArray("default", tags); - Array tag = ConfigWebUtil.getAsArray("tag", tags); + Struct tags = ConfigUtil.getAsStruct("tags", root); + Array _default = ConfigUtil.getAsArray("default", tags); + Array tag = ConfigUtil.getAsArray("tag", tags); add(_default, "tagDefaults", root); add(tag, "tags", root); @@ -777,21 +777,21 @@ else if (old instanceof InputSource) { //////////////////// System //////////////////// { - Struct fs = ConfigWebUtil.getAsStruct("fileSystem", root); + Struct fs = ConfigUtil.getAsStruct("fileSystem", root); move("tempDirectory", "tempDirectory", fs, root); } //////////////////// Update //////////////////// { - Struct update = ConfigWebUtil.getAsStruct("update", root); + Struct update = ConfigUtil.getAsStruct("update", root); move("location", "updateLocation", update, root); move("type", "updateType", update, root); } //////////////////// Resources //////////////////// { - Struct resources = ConfigWebUtil.getAsStruct("resources", root); - Array providers = ConfigWebUtil.getAsArray("resourceProvider", resources); + Struct resources = ConfigUtil.getAsStruct("resources", root); + Array providers = ConfigUtil.getAsArray("resourceProvider", resources); // Ram -> Cache (Ram is no longer supported) Iterator it = providers.valueIterator(); @@ -816,7 +816,7 @@ else if (old instanceof InputSource) { providers.appendEL(sct); } - Array defaultProviders = ConfigWebUtil.getAsArray("defaultResourceProvider", resources); + Array defaultProviders = ConfigUtil.getAsArray("defaultResourceProvider", resources); add(providers, "resourceProviders", root); add(defaultProviders, "defaultResourceProvider", root); @@ -947,7 +947,7 @@ private static Struct _loadDocument(Resource res) throws IOException, PageExcept // That step is not necessary anymore TODO remove if (StringUtil.endsWithIgnoreCase(name, ".xml.cfm") || StringUtil.endsWithIgnoreCase(name, ".xml")) { try { - return ConfigWebUtil.getAsStruct(new XMLConfigReader(res, true, new ReadRule(), new NameRule()).getData(), false, "cfLuceeConfiguration", "luceeConfiguration", + return ConfigUtil.getAsStruct(new XMLConfigReader(res, true, new ReadRule(), new NameRule()).getData(), false, "cfLuceeConfiguration", "luceeConfiguration", "lucee-configuration"); } catch (SAXException e) { diff --git a/core/src/main/java/lucee/runtime/config/ConfigImpl.java b/core/src/main/java/lucee/runtime/config/ConfigImpl.java index a40b099805..5a19fe6c6d 100755 --- a/core/src/main/java/lucee/runtime/config/ConfigImpl.java +++ b/core/src/main/java/lucee/runtime/config/ConfigImpl.java @@ -84,7 +84,7 @@ import lucee.runtime.component.ImportDefintion; import lucee.runtime.component.ImportDefintionImpl; import lucee.runtime.config.ConfigWebFactory.Path; -import lucee.runtime.config.ConfigWebUtil.CacheElement; +import lucee.runtime.config.ConfigUtil.CacheElement; import lucee.runtime.config.gateway.GatewayMap; import lucee.runtime.customtag.InitFile; import lucee.runtime.db.ClassDefinition; @@ -169,11 +169,6 @@ public abstract class ConfigImpl extends ConfigBase implements ConfigPro { private static final RHExtension[] RHEXTENSIONS_EMPTY = new RHExtension[0]; - // FUTURE add to interface - public static final short ADMINMODE_SINGLE = 1; - public static final short ADMINMODE_MULTI = 2; - public static final short ADMINMODE_AUTO = 4; - private int mode = MODE_CUSTOM; private final Map rpcClassLoaders = new ConcurrentHashMap(); @@ -770,7 +765,7 @@ public Scheduler getScheduler() { if (scheduler == null) { try { - return new SchedulerImpl(ConfigWebUtil.getEngine(this), this, new ArrayImpl()); + return new SchedulerImpl(ConfigUtil.getEngine(this), this, new ArrayImpl()); } catch (PageException e) { } @@ -809,7 +804,7 @@ public Mapping[] getMappings() { protected void setMappings(Mapping[] mappings) { close(this.uncheckedMappings); - this.mappings = initMappings(this.uncheckedMappings = ConfigWebUtil.sort(mappings)); + this.mappings = initMappings(this.uncheckedMappings = ConfigUtil.sort(mappings)); } @Override @@ -891,7 +886,7 @@ public PageSource getPageSource(Mapping[] mappings, String realPath, boolean onl @Override public PageSource getPageSourceExisting(PageContext pc, Mapping[] mappings, String realPath, boolean onlyTopLevel, boolean useSpecialMappings, boolean useDefaultMapping, boolean onlyPhysicalExisting) { - return ConfigWebUtil.getPageSourceExisting(pc, this, mappings, realPath, onlyTopLevel, useSpecialMappings, useDefaultMapping, onlyPhysicalExisting); + return ConfigUtil.getPageSourceExisting(pc, this, mappings, realPath, onlyTopLevel, useSpecialMappings, useDefaultMapping, onlyPhysicalExisting); } @Override @@ -907,13 +902,13 @@ public PageSource[] getPageSources(PageContext pc, Mapping[] mappings, String re public PageSource[] getPageSources(PageContext pc, Mapping[] appMappings, String realPath, boolean onlyTopLevel, boolean useSpecialMappings, boolean useDefaultMapping, boolean useComponentMappings, boolean onlyFirstMatch) { - return ConfigWebUtil.getPageSources(pc, this, appMappings, realPath, onlyTopLevel, useSpecialMappings, useDefaultMapping, useComponentMappings, onlyFirstMatch); + return ConfigUtil.getPageSources(pc, this, appMappings, realPath, onlyTopLevel, useSpecialMappings, useDefaultMapping, useComponentMappings, onlyFirstMatch); } @Override public Resource[] getResources(PageContext pc, Mapping[] mappings, String realPath, boolean onlyTopLevel, boolean useSpecialMappings, boolean useDefaultMapping, boolean useComponentMappings, boolean onlyFirstMatch) { - return ConfigWebUtil.getResources(pc, this, mappings, realPath, onlyTopLevel, useSpecialMappings, useDefaultMapping, useComponentMappings, onlyFirstMatch); + return ConfigUtil.getResources(pc, this, mappings, realPath, onlyTopLevel, useSpecialMappings, useDefaultMapping, useComponentMappings, onlyFirstMatch); } /** @@ -943,7 +938,7 @@ public Resource getPhysicalResourceExisting(PageContext pc, Mapping[] mappings, @Override public PageSource toPageSource(Mapping[] mappings, Resource res, PageSource defaultValue) { - return ConfigWebUtil.toPageSource(this, mappings, res, defaultValue); + return ConfigUtil.toPageSource(this, mappings, res, defaultValue); } @Override @@ -2599,7 +2594,7 @@ protected void setRemoteClientDirectory(Resource remoteClientDirectory) { @Override public Resource getRemoteClientDirectory() { if (remoteClientDirectory == null) { - return ConfigWebUtil.getFile(getRootDirectory(), "client-task", "client-task", getConfigDir(), FileUtil.TYPE_DIR, ResourceUtil.LEVEL_GRAND_PARENT_FILE, this); + return ConfigUtil.getFile(getRootDirectory(), "client-task", "client-task", getConfigDir(), FileUtil.TYPE_DIR, ResourceUtil.LEVEL_GRAND_PARENT_FILE, this); } return remoteClientDirectory; @@ -3107,7 +3102,7 @@ public ORMConfiguration getORMConfig() { } private Map> componentPathCache = null;// new ArrayList(); - private Map> applicationPathCache = null;// new ArrayList(); + private Map> applicationPathCache = null;// new ArrayList(); private Map> ctPatchCache = null;// new ArrayList(); private Map> udfCache = new ConcurrentHashMap>(); @@ -3799,7 +3794,7 @@ public Resource getDeployDirectory() { // config server else { try { - File file = new File(ConfigWebUtil.getCFMLEngineFactory(this).getResourceRoot(), "deploy"); + File file = new File(ConfigUtil.getCFMLEngineFactory(this).getResourceRoot(), "deploy"); if (!file.exists()) file.mkdirs(); deployDir = ResourcesImpl.getFileResourceProvider().getResource(file.getAbsolutePath()); } diff --git a/core/src/main/java/lucee/runtime/config/ConfigPro.java b/core/src/main/java/lucee/runtime/config/ConfigPro.java index a042f60a23..8c2f6c0edf 100644 --- a/core/src/main/java/lucee/runtime/config/ConfigPro.java +++ b/core/src/main/java/lucee/runtime/config/ConfigPro.java @@ -27,6 +27,7 @@ import lucee.runtime.ai.AIEngineFactory; import lucee.runtime.ai.AIEnginePool; import lucee.runtime.cache.tag.CacheHandler; +import lucee.runtime.compiler.CFMLCompilerImpl; import lucee.runtime.component.ImportDefintion; import lucee.runtime.customtag.InitFile; import lucee.runtime.db.ClassDefinition; @@ -353,8 +354,6 @@ public interface ConfigPro extends Config { public void setPassword(Password pw); - public short getAdminMode(); - public PageSource getApplicationPageSource(PageContext pc, String path, String filename, int mode, RefBoolean isCFC); public void putApplicationPageSource(String path, PageSource ps, String filename, int mode, boolean isCFC); @@ -407,4 +406,8 @@ public Resource[] getResources(PageContext pc, Mapping[] mappings, String realPa public AIEnginePool getAIEnginePool(); public CFMLEngine getEngine(); + + public void checkMappings(); + + public CFMLCompilerImpl getCompiler(); } diff --git a/core/src/main/java/lucee/runtime/config/ConfigServerFactory.java b/core/src/main/java/lucee/runtime/config/ConfigServerFactory.java index a142aa332e..f3790c9dfb 100644 --- a/core/src/main/java/lucee/runtime/config/ConfigServerFactory.java +++ b/core/src/main/java/lucee/runtime/config/ConfigServerFactory.java @@ -156,15 +156,14 @@ public static ConfigServerImpl newInstance(CFMLEngineImpl engine, Map labels = new HashMap(); if (children != null) { @@ -259,8 +258,8 @@ private static void loadLabel(ConfigServerImpl configServer, Struct root) { while (it.hasNext()) { data = Caster.toStruct(it.next(), null); if (data == null) continue; - String id = ConfigWebUtil.getAsString("id", data, null); - String name = ConfigWebUtil.getAsString("name", data, null); + String id = ConfigUtil.getAsString("id", data, null); + String name = ConfigUtil.getAsString("name", data, null); if (id != null && name != null) { labels.put(id, name); } diff --git a/core/src/main/java/lucee/runtime/config/ConfigServerImpl.java b/core/src/main/java/lucee/runtime/config/ConfigServerImpl.java index 4a2921643e..094571fb6f 100644 --- a/core/src/main/java/lucee/runtime/config/ConfigServerImpl.java +++ b/core/src/main/java/lucee/runtime/config/ConfigServerImpl.java @@ -53,6 +53,7 @@ import lucee.runtime.MappingImpl; import lucee.runtime.ai.AIEngineFactory; import lucee.runtime.ai.AIEnginePool; +import lucee.runtime.compiler.CFMLCompilerImpl; import lucee.runtime.config.ConfigFactory.UpdateInfo; import lucee.runtime.config.gateway.GatewayMap; import lucee.runtime.db.ClassDefinition; @@ -145,8 +146,6 @@ public final class ConfigServerImpl extends ConfigImpl implements ConfigServer { private GatewayMap gatewayEntries; - private short adminMode = ADMINMODE_SINGLE; - private Resource mvnDir; /** @@ -400,6 +399,8 @@ public Map getLabels() { private AIEnginePool aiEnginePool; + private CFMLCompilerImpl compiler; + public ThreadQueue setThreadQueue(ThreadQueue threadQueue) { return this.threadQueue = threadQueue; } @@ -857,7 +858,7 @@ private long extHash(Resource[] locReses) { @Override public void checkPassword() throws PageException { - CFMLEngine engine = ConfigWebUtil.getEngine(this); + CFMLEngine engine = ConfigUtil.getEngine(this); ConfigWeb[] webs = getConfigWebs(); try { ConfigServerFactory.reloadInstance(engine, this); @@ -872,15 +873,6 @@ public void checkPassword() throws PageException { } - public void setAdminMode(short adminMode) { - this.adminMode = adminMode; - } - - @Override - public short getAdminMode() { - return adminMode; - } - @Override public Resource getMavenDir() { if (mvnDir == null) { @@ -916,4 +908,11 @@ public AIEnginePool getAIEnginePool() { } return aiEnginePool; } + + @Override + public CFMLCompilerImpl getCompiler() { + // most likely this is never used + if (compiler == null) compiler = new CFMLCompilerImpl(); + return compiler; + } } \ No newline at end of file diff --git a/core/src/main/java/lucee/runtime/config/ConfigWebUtil.java b/core/src/main/java/lucee/runtime/config/ConfigUtil.java similarity index 97% rename from core/src/main/java/lucee/runtime/config/ConfigWebUtil.java rename to core/src/main/java/lucee/runtime/config/ConfigUtil.java index 656033ad0b..593473dda0 100755 --- a/core/src/main/java/lucee/runtime/config/ConfigWebUtil.java +++ b/core/src/main/java/lucee/runtime/config/ConfigUtil.java @@ -77,7 +77,7 @@ import lucee.transformer.library.function.FunctionLib; import lucee.transformer.library.tag.TagLib; -public final class ConfigWebUtil { +public final class ConfigUtil { private static String enckey; @@ -131,7 +131,7 @@ public static void deployWeb(ConfigServer cs, ConfigWeb cw, boolean throwError) } catch (IOException ioe) { if (throwError) throw ioe; - LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs), ConfigWebUtil.class.getName(), ioe); + LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs), ConfigUtil.class.getName(), ioe); } } @@ -172,7 +172,7 @@ private static void _deploy(ConfigWeb cw, Resource src, Resource trg) throws IOE if (_src.isFile()) { if (_src.length() != _trg.length()) { _src.copyTo(_trg, false); - LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cw), Log.LEVEL_DEBUG, ConfigWebUtil.class.getName(), "write file:" + _trg); + LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cw), Log.LEVEL_DEBUG, ConfigUtil.class.getName(), "write file:" + _trg); } } @@ -745,9 +745,15 @@ private int slashCount(Mapping l) { return mappings; } - public static ConfigServer getConfigServer(Config config, Password password) throws PageException { + public static ConfigServer getConfigServer(Config config) { if (config instanceof ConfigServer) return (ConfigServer) config; - return ((ConfigWeb) config).getConfigServer(password); + return ((ConfigWebPro) config).getConfigServer(); + } + + public static ConfigServerImpl getConfigServerImpl(Config config) { + if (config instanceof ConfigServerImpl) return (ConfigServerImpl) config; + if (config instanceof ConfigWebPro) return (ConfigServerImpl) ((ConfigWebPro) config).getConfigServer(); + throw new RuntimeException("cannot convert/extract ConfigServer from [" + config + "]"); } protected static TagLib[] duplicate(TagLib[] tlds, boolean deepCopy) { @@ -870,25 +876,6 @@ public static double getAsDouble(String name, Struct sct, double defaultValue) { return Caster.toDoubleValue(obj, false, defaultValue); } - public static short toAdminMode(String mode, short defaultValue) { - if (StringUtil.isEmpty(mode, true)) return defaultValue; - - mode = mode.trim(); - if ("multi".equalsIgnoreCase(mode) || "multiple".equalsIgnoreCase(mode) || "double".equalsIgnoreCase(mode)) return ConfigImpl.ADMINMODE_MULTI; - if ("single".equalsIgnoreCase(mode)) return ConfigImpl.ADMINMODE_SINGLE; - if ("auto".equalsIgnoreCase(mode)) return ConfigImpl.ADMINMODE_AUTO; - - return defaultValue; - } - - public static String toAdminMode(short mode, String defaultValue) { - if (ConfigImpl.ADMINMODE_MULTI == mode) return "multi"; - if (ConfigImpl.ADMINMODE_SINGLE == mode) return "single"; - if (ConfigImpl.ADMINMODE_AUTO == mode) return "auto"; - - return defaultValue; - } - public static Mapping getMapping(Config config, String virtual, Mapping defaultValue) { for (Mapping m: config.getMappings()) { if (m.getVirtualLowerCaseWithSlash().equalsIgnoreCase(virtual) || m.getVirtualLowerCase().equalsIgnoreCase(virtual)) return m; diff --git a/core/src/main/java/lucee/runtime/config/ConfigWebFactory.java b/core/src/main/java/lucee/runtime/config/ConfigWebFactory.java index 4933df2ca2..0f8ffef447 100644 --- a/core/src/main/java/lucee/runtime/config/ConfigWebFactory.java +++ b/core/src/main/java/lucee/runtime/config/ConfigWebFactory.java @@ -54,7 +54,6 @@ import org.osgi.framework.BundleException; import org.xml.sax.SAXException; -import lucee.Info; import lucee.commons.collection.MapFactory; import lucee.commons.date.TimeZoneConstants; import lucee.commons.date.TimeZoneUtil; @@ -67,9 +66,7 @@ import lucee.commons.io.SystemUtil; import lucee.commons.io.log.Log; import lucee.commons.io.log.LogUtil; -import lucee.commons.io.log.LoggerAndSourceData; import lucee.commons.io.res.Resource; -import lucee.commons.io.res.ResourcesImpl; import lucee.commons.io.res.filter.ExtensionResourceFilter; import lucee.commons.io.res.type.cfml.CFMLResourceProvider; import lucee.commons.io.res.type.s3.DummyS3ResourceProvider; @@ -93,8 +90,6 @@ import lucee.runtime.ai.AIEngineFactory; import lucee.runtime.cache.CacheConnection; import lucee.runtime.cache.CacheConnectionImpl; -import lucee.runtime.cache.ServerCacheConnection; -import lucee.runtime.cache.tag.CacheHandler; import lucee.runtime.cache.tag.request.RequestCacheHandler; import lucee.runtime.cache.tag.timespan.TimespanCacheHandler; import lucee.runtime.cfx.customtag.CFXTagClass; @@ -130,7 +125,6 @@ import lucee.runtime.exp.ApplicationException; import lucee.runtime.exp.ExpressionException; import lucee.runtime.exp.PageException; -import lucee.runtime.exp.SecurityException; import lucee.runtime.extension.ExtensionDefintion; import lucee.runtime.extension.RHExtension; import lucee.runtime.extension.RHExtensionProvider; @@ -178,7 +172,6 @@ import lucee.runtime.security.SecurityManager; import lucee.runtime.security.SecurityManagerImpl; import lucee.runtime.spooler.SpoolerEngineImpl; -import lucee.runtime.tag.TagUtil; import lucee.runtime.tag.listener.TagListener; import lucee.runtime.type.Array; import lucee.runtime.type.Collection.Key; @@ -187,7 +180,6 @@ import lucee.runtime.type.UDF; import lucee.runtime.type.dt.TimeSpan; import lucee.runtime.type.scope.Undefined; -import lucee.runtime.type.util.ArrayUtil; import lucee.runtime.type.util.CollectionUtil; import lucee.runtime.type.util.KeyConstants; import lucee.runtime.type.util.ListUtil; @@ -226,103 +218,6 @@ public final class ConfigWebFactory extends ConfigFactory { * @throws ConverterException */ - public static ConfigWebPro newInstanceMulti(CFMLEngine engine, CFMLFactoryImpl factory, ConfigServerImpl configServer, Resource configDir, ServletConfig servletConfig, - ConfigWebImpl existingToUpdate) - throws SAXException, ClassException, PageException, IOException, TagLibException, FunctionLibException, NoSuchAlgorithmException, BundleException, ConverterException { - - // boolean multi = configServer.getAdminMode() == ConfigImpl.ADMINMODE_MULTI; - - // make sure the web context does not point to the same directory as the server context - if (configDir.equals(configServer.getConfigDir())) { - throw new ApplicationException( - "the web context [" + createLabel(configServer, servletConfig) + "] has defined the same configuration directory [" + configDir + "] as the server context"); - } - ConfigWeb[] webs = configServer.getConfigWebs(); - if (!ArrayUtil.isEmpty(webs)) { - for (int i = 0; i < webs.length; i++) { - // not sure this is necessary if(hash.equals(((ConfigWebImpl)webs[i]).getHash())) continue; - if (configDir.equals(webs[i].getConfigDir())) throw new ApplicationException("the web context [" + createLabel(configServer, servletConfig) - + "] has defined the same configuration directory [" + configDir + "] as the web context [" + webs[i].getLabel() + "]"); - } - } - String label = createLabel(configServer, servletConfig); - LogUtil.logGlobal(configServer, Log.LEVEL_INFO, ConfigWebFactory.class.getName(), - "===================================================================\n" + "WEB CONTEXT (" + label + ")\n" - + "-------------------------------------------------------------------\n" + "- config:" + configDir + "\n" + "- webroot:" - + ReqRspUtil.getRootPath(servletConfig.getServletContext()) + "\n" + "- label:" + createLabel(configServer, servletConfig) + "\n" - + "===================================================================\n" - - ); - - boolean doNew = getNew(engine, configDir, false, UpdateInfo.NEW_NONE).updateType != NEW_NONE; - Resource configFileOld = configDir.getRealResource("lucee-web.xml." + TEMPLATE_EXTENSION); - Resource configFileNew = ConfigServerFactory.getConfigFile(configDir, false); - String strPath = servletConfig.getServletContext().getRealPath("/WEB-INF"); - Resource path = ResourcesImpl.getFileResourceProvider().getResource(strPath); - boolean hasConfigOld = false; - boolean hasConfigNew = configFileNew.exists() && configFileNew.length() > 0; - if (!hasConfigNew) { - LogUtil.logGlobal(ThreadLocalPageContext.getConfig(), Log.LEVEL_INFO, ConfigWebFactory.class.getName(), - "has no json web context config for " + label + " at " + "[" + configFileNew + "]"); - hasConfigOld = configFileOld.exists() && configFileOld.length() > 0; - LogUtil.logGlobal(ThreadLocalPageContext.getConfig(), Log.LEVEL_INFO, ConfigWebFactory.class.getName(), - "has " + (hasConfigOld ? "" : "no ") + "xml web context config for " + label + " at " + "[" + configFileOld + "]"); - - } - MultiContextConfigWeb multiweb = new MultiContextConfigWeb(factory, configServer, servletConfig, configDir, configFileNew); - ConfigWebPro configWeb = existingToUpdate != null ? existingToUpdate.setInstance(multiweb) : new ConfigWebImpl(multiweb); - factory.setConfig(configServer, configWeb); - - // translate to new - Struct root = null; - if (!hasConfigNew) { - if (hasConfigOld) { - LogUtil.logGlobal(ThreadLocalPageContext.getConfig(), Log.LEVEL_INFO, ConfigWebFactory.class.getName(), "convert web context xml config to json for " + label); - try { - translateConfigFile(configWeb, configFileOld, configFileNew, "", false); - } - catch (IOException e) { - LogUtil.logGlobal(ThreadLocalPageContext.getConfig(), ConfigWebFactory.class.getName(), e); - throw e; - } - catch (ConverterException e) { - LogUtil.logGlobal(ThreadLocalPageContext.getConfig(), ConfigWebFactory.class.getName(), e); - throw e; - } - catch (SAXException e) { - LogUtil.logGlobal(ThreadLocalPageContext.getConfig(), ConfigWebFactory.class.getName(), e); - throw e; - } - } - // create config file - else { - LogUtil.logGlobal(ThreadLocalPageContext.getConfig(), Log.LEVEL_INFO, ConfigWebFactory.class.getName(), - "create new web context json config file for " + label + " at " + "[" + configFileNew + "]"); - createConfigFile("web", configFileNew); - hasConfigNew = true; - } - } - LogUtil.logGlobal(ThreadLocalPageContext.getConfig(), Log.LEVEL_INFO, ConfigWebFactory.class.getName(), "load config file for " + label); - root = loadDocumentCreateIfFails(configFileNew, "web"); - - // htaccess - if (path.exists()) createHtAccess(path.getRealResource(".htaccess")); - if (configDir.exists()) createHtAccess(configDir.getRealResource(".htaccess")); - - createContextFiles(configDir, doNew); - - load(configServer, multiweb, (ConfigWebImpl) configWeb, root, false, doNew, false); - createContextFilesPost(configDir, configWeb, servletConfig, false, doNew); - ((ThreadQueueImpl) configWeb.getThreadQueue()).setMode(configWeb.getQueueEnable() ? ThreadQueuePro.MODE_ENABLED : ThreadQueuePro.MODE_DISABLED); - - // call web.cfc for this context - ((CFMLEngineImpl) ConfigWebUtil.getEngine(configWeb)).onStart(configWeb, false); - - ((GatewayEngineImpl) configWeb.getGatewayEngine()).autoStart(); - - return configWeb; - } - public static ConfigWebPro newInstanceSingle(CFMLEngine engine, CFMLFactoryImpl factory, ConfigServerImpl configServer, Resource configDirWeb, ServletConfig servletConfig, ConfigWebImpl existingToUpdate) throws PageException { @@ -337,8 +232,8 @@ public static ConfigWebPro newInstanceSingle(CFMLEngine engine, CFMLFactoryImpl ); boolean doNew = configServer.getUpdateInfo().updateType != NEW_NONE; - SingleContextConfigWeb sccw = new SingleContextConfigWeb(factory, configServer, servletConfig, configDirWeb); - ConfigWebPro configWeb = existingToUpdate != null ? existingToUpdate.setInstance(sccw) : new ConfigWebImpl(sccw); + ConfigWebPro configWeb = existingToUpdate != null ? existingToUpdate.update(factory, configServer, servletConfig, configDirWeb) + : new ConfigWebImpl(factory, configServer, servletConfig, configDirWeb); factory.setConfig(configServer, configWeb); // createContextFiles(configDir, servletConfig, doNew); @@ -346,7 +241,7 @@ public static ConfigWebPro newInstanceSingle(CFMLEngine engine, CFMLFactoryImpl ((ThreadQueueImpl) configWeb.getThreadQueue()).setMode(configWeb.getQueueEnable() ? ThreadQueuePro.MODE_ENABLED : ThreadQueuePro.MODE_DISABLED); // call web.cfc for this context - ((CFMLEngineImpl) ConfigWebUtil.getEngine(configWeb)).onStart(configWeb, false); + ((CFMLEngineImpl) ConfigUtil.getEngine(configWeb)).onStart(configWeb, false); ((GatewayEngineImpl) configWeb.getGatewayEngine()).autoStart(); @@ -364,20 +259,6 @@ private static String createLabel(ConfigServerImpl configServer, ServletConfig s return label; } - private static void createHtAccess(Resource htAccess) { - if (!htAccess.exists()) { - htAccess.createNewFile(); - - String content = "AuthName \"WebInf Folder\"\n" + "AuthType Basic\n" + "\n" + "order deny,allow\n" + "deny from all\n" + ""; - try { - IOUtil.copy(new ByteArrayInputStream(content.getBytes()), htAccess, true); - } - catch (Throwable t) { - ExceptionUtil.rethrowIfNecessary(t); - } - } - } - /** * reloads the Config Object * @@ -392,69 +273,9 @@ private static void createHtAccess(Resource htAccess) { * @throws BundleException * @throws NoSuchAlgorithmException */ // MUST - public static void reloadInstance(CFMLEngine engine, ConfigServerImpl cs, ConfigWebImpl cwi, boolean force) - throws ClassException, PageException, IOException, TagLibException, FunctionLibException, BundleException { - - boolean isSingle = cs.getAdminMode() == ConfigImpl.ADMINMODE_SINGLE; - boolean isWebSingle = cwi.isSingle(); - if (isWebSingle) { - // changed from single to mult1 - if (isSingle != isWebSingle) { - // Resource configDir, boolean isConfigDirACustomSetting, - // ServletConfig servletConfig - try { - newInstanceMulti(engine, (CFMLFactoryImpl) cwi.getFactory(), cs, cwi.getWebConfigDir(), cwi.getServletConfig(), cwi); - return; - } - catch (NoSuchAlgorithmException e) { - throw Caster.toPageException(e); - } - catch (SAXException e) { - throw Caster.toPageException(e); - } - catch (ConverterException e) { - throw Caster.toPageException(e); - } - } - - ((SingleContextConfigWeb) cwi.getInstance()).reload(); - return; - } - - // changed from multi to single - if (isSingle != isWebSingle) { - newInstanceSingle(engine, (CFMLFactoryImpl) cwi.getFactory(), cs, cwi.getWebConfigDir(), cwi.getServletConfig(), cwi); - return; - } - - MultiContextConfigWeb mcw = (MultiContextConfigWeb) cwi.getInstance(); - - Resource configFile = cwi.getConfigFile(); - Resource configDir = cwi.getConfigDir(); - - int iDoNew = getNew(engine, configDir, false, UpdateInfo.NEW_NONE).updateType; - boolean doNew = iDoNew != NEW_NONE; - - if (configFile == null) return; - - if (second(cwi.getLoadTime()) > second(configFile.lastModified()) && !force) return; - - Struct root = loadDocumentCreateIfFails(configFile, "web"); - createContextFiles(configDir, doNew); - cwi.reset(); - // TODO handle differtly - load(cs, mcw, cwi, root, true, doNew, false); - createContextFilesPost(configDir, cwi, null, false, doNew); - - ((ThreadQueueImpl) cwi.getThreadQueue()).setMode(cwi.getQueueEnable() ? ThreadQueuePro.MODE_ENABLED : ThreadQueuePro.MODE_DISABLED); - - ((CFMLEngineImpl) ConfigWebUtil.getEngine(cwi)).onStart(cwi, true); - - ((GatewayEngineImpl) cwi.getGatewayEngine()).autoStart(); - } - - private static long second(long ms) { - return ms / 1000; + public static void reloadInstance(CFMLEngine engine, ConfigServer cs, ConfigWebImpl cwi, boolean force) + throws PageException, IOException, TagLibException, FunctionLibException, BundleException { + cwi.reload(); } /** @@ -468,23 +289,21 @@ private static long second(long ms) { * @throws PageException * @throws BundleException */ - synchronized static void load(ConfigServerImpl cs, ConfigImpl config, ConfigWebImpl cwi, Struct root, boolean isReload, boolean doNew, boolean essentialOnly) - throws IOException { - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_INFO, ConfigWebFactory.class.getName(), "start reading config"); + synchronized static void load(ConfigServerImpl config, Struct root, boolean isReload, boolean doNew, boolean essentialOnly) throws IOException { + if (LOG) LogUtil.logGlobal(config, Log.LEVEL_INFO, ConfigWebFactory.class.getName(), "start reading config"); ThreadLocalConfig.register(config); boolean reload = false; // load PW try { if (createSaltAndPW(root, config, essentialOnly)) reload = true; - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "fixed salt"); + if (LOG) LogUtil.logGlobal(config, Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "fixed salt"); // delete to big felix.log (there is also code in the loader to do this, but if the loader is not // updated ...) - if (!essentialOnly && config instanceof ConfigServerImpl) { + if (!essentialOnly) { try { - ConfigServerImpl _cs = (ConfigServerImpl) config; - File rr = _cs.getEngine().getCFMLEngineFactory().getResourceRoot(); + File rr = config.getEngine().getCFMLEngineFactory().getResourceRoot(); File log = new File(rr, "context/logs/felix.log"); if (log.isFile() && log.length() > GB1) { if (log.delete()) ResourceUtil.touch(log); @@ -498,7 +317,7 @@ synchronized static void load(ConfigServerImpl cs, ConfigImpl config, ConfigWebI } // reload when an old version of xml got updated if (reload) { - root = reload(root, config, cs); + root = reload(root, config); reload = false; } @@ -509,200 +328,186 @@ synchronized static void load(ConfigServerImpl cs, ConfigImpl config, ConfigWebI } config.setLastModified(); - if (config instanceof ConfigWeb) { - ConfigWebUtil.deployWebContext(cs, (ConfigWeb) config, false); - ConfigWebUtil.deployWeb(cs, (ConfigWeb) config, false); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "deploy web context"); - } - - if (config instanceof ConfigServerImpl) _loadAdminMode((ConfigServerImpl) config, root); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded admin mode"); - _loadConfig(cs, config, root); + _loadConfig(config, root); int mode = config.getMode(); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded config"); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded config"); if (!essentialOnly) { - _loadConstants(cs, config, root); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded constants"); + _loadConstants(config, root); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded constants"); } - _loadLoggers(cs, config, root, isReload); + _loadLoggers(config, root, isReload); Log log = ThreadLocalPageContext.getLog(config, "application"); // loadServerLibDesc(cs, config, doc,log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded loggers"); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded loggers"); - _loadTempDirectory(cs, config, root, isReload, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded temp dir"); + _loadTempDirectory(config, root, isReload, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded temp dir"); - _loadId(cs, config, cwi, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded id"); + _loadId(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded id"); _loadVersion(config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded version"); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded version"); if (!essentialOnly) { - _loadSecurity(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded security"); + _loadSecurity(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded security"); } if (!essentialOnly) { - _loadJavaSettings(cs, config, root, log); // define compile type - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded java settings"); + _loadJavaSettings(config, root, log); // define compile type + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded java settings"); } - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded lib"); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded lib"); if (!essentialOnly) { - _loadSystem(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded system"); + _loadSystem(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded system"); - _loadResourceProvider(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded resource providers"); + _loadResourceProvider(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded resource providers"); } - _loadFilesystem(cs, config, root, doNew, log); // load this before execute any code, what for example loadxtension does (json) - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded filesystem"); + _loadFilesystem(config, root, doNew, log); // load this before execute any code, what for example loadxtension does (json) + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded filesystem"); if (!essentialOnly) { - _loadExtensionBundles(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded extension"); + _loadExtensionBundles(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded extension"); } else { - _loadExtensionDefinition(cs, config, root, log); - if (LOG) - LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded extension definitions"); + _loadExtensionDefinition(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded extension definitions"); } if (!essentialOnly) { - _loadWS(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded webservice"); + _loadWS(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded webservice"); - _loadORM(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded orm"); + _loadORM(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded orm"); - _loadCacheHandler(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded cache handlers"); + _loadCacheHandler(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded cache handlers"); - _loadCharset(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded charset"); + _loadCharset(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded charset"); } - _loadApplication(cs, config, root, mode, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded application"); + _loadApplication(config, root, mode, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded application"); - _loadJava(cs, config, root, log); // define compile type - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded java"); + _loadJava(config, root, log); // define compile type + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded java"); if (!essentialOnly) { - _loadMappings(cs, config, root, mode, log); // it is important this runs after - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded mappings"); + _loadMappings(config, root, mode, log); // it is important this runs after + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded mappings"); - _loadRest(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded rest"); + _loadRest(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded rest"); - _loadExtensionProviders(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded extensions"); + _loadExtensionProviders(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded extensions"); } if (!essentialOnly) { - _loadDataSources(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded datasources"); + _loadDataSources(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded datasources"); - _loadCache(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded cache"); + _loadCache(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded cache"); - _loadCustomTagsMappings(cs, config, root, mode, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded custom tag mappings"); + _loadCustomTagsMappings(config, root, mode, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded custom tag mappings"); // loadFilesystem(cs, config, doc, doNew); // load tlds } if (!essentialOnly) { - _loadTag(cs, config, root, log); // load tlds - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded tags"); + _loadTag(config, root, log); // load tlds + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded tags"); - _loadRegional(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded regional"); + _loadRegional(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded regional"); - _loadCompiler(cs, config, root, mode, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded compiler"); + _loadCompiler(config, root, mode, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded compiler"); - _loadScope(cs, config, root, mode, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded scope"); + _loadScope(config, root, mode, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded scope"); - _loadMail(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded mail"); + _loadMail(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded mail"); - _loadSearch(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded search"); + _loadSearch(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded search"); - _loadScheduler(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded scheduled tasks"); + _loadScheduler(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded scheduled tasks"); - _loadDebug(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded debug"); + _loadDebug(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded debug"); - _loadError(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded error"); + _loadError(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded error"); - _loadRegex(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded regex"); + _loadRegex(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded regex"); - _loadCFX(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded cfx"); + _loadCFX(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded cfx"); - _loadComponent(cs, config, root, mode, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded component"); + _loadComponent(config, root, mode, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded component"); - _loadUpdate(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded update"); + _loadUpdate(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded update"); - _loadSetting(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded setting"); + _loadSetting(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded setting"); - _loadProxy(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded proxy"); + _loadProxy(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded proxy"); - _loadRemoteClient(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded remote clients"); + _loadRemoteClient(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded remote clients"); settings(config, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded settings2"); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded settings2"); - _loadListener(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded listeners"); + _loadListener(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded listeners"); - _loadDumpWriter(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded dump writers"); + _loadDumpWriter(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded dump writers"); - _loadGatewayEL(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded gateways"); + _loadGatewayEL(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded gateways"); - _loadExeLog(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded exe log"); + _loadExeLog(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded exe log"); - _loadQueue(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded queue"); + _loadQueue(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded queue"); - _loadMonitors(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded monitors"); + _loadMonitors(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded monitors"); - _loadLogin(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded login"); + _loadLogin(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded login"); - _loadAI(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded AI"); + _loadAI(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded AI"); - _loadStartupHook(cs, config, root, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded startup hook"); + _loadStartupHook(config, root, log); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "loaded startup hook"); } config.setLoadTime(System.currentTimeMillis()); - - if (cwi != null) { - TagUtil.addTagMetaData(cwi, log); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_DEBUG, ConfigWebFactory.class.getName(), "added tag meta data"); - } } private static boolean createSaltAndPW(Struct root, Config config, boolean essentialOnly) { @@ -746,25 +551,23 @@ private static boolean createSaltAndPW(Struct root, Config config, boolean essen return rtn; } - private static Struct reload(Struct root, ConfigImpl config, ConfigServerImpl cs) throws PageException, IOException, ConverterException { + private static Struct reload(Struct root, ConfigImpl config) throws PageException, IOException, ConverterException { // store as json JSONConverter json = new JSONConverter(true, CharsetUtil.UTF8, JSONDateFormat.PATTERN_CF, false); String str = json.serialize(null, root, SerializationSettings.SERIALIZE_AS_ROW, true); IOUtil.write(config.getConfigFile(), str, CharsetUtil.UTF8, false); root = ConfigWebFactory.loadDocumentCreateIfFails(config.getConfigFile(), "web"); - if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(cs == null ? config : cs), Log.LEVEL_INFO, ConfigWebFactory.class.getName(), "reloading configuration"); + if (LOG) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_INFO, ConfigWebFactory.class.getName(), "reloading configuration"); return root; } - private static void _loadResourceProvider(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadResourceProvider(ConfigImpl config, Struct root, Log log) { try { - boolean hasCS = configServer != null; config.clearResourceProviders(); - Array providers = ConfigWebUtil.getAsArray("resourceProviders", root); - Array defaultProviders = ConfigWebUtil.getAsArray("defaultResourceProvider", root); + Array providers = ConfigUtil.getAsArray("resourceProviders", root); + Array defaultProviders = ConfigUtil.getAsArray("defaultResourceProvider", root); // Default Resource Provider - if (hasCS) config.setDefaultResourceProvider(configServer.getDefaultResourceProvider()); if (defaultProviders != null && defaultProviders.size() > 0) { Struct defaultProvider = Caster.toStruct(defaultProviders.getE(defaultProviders.size())); ClassDefinition defProv = getClassDefinition(defaultProvider, "", config.getIdentification()); @@ -786,7 +589,6 @@ else if (!StringUtil.isEmpty(strDefaultProviderComponent)) { } } // Resource Provider - if (hasCS) config.setResourceProviderFactories(configServer.getResourceProviderFactories()); boolean hasZip = false; if (providers != null && providers.size() > 0) { ClassDefinition prov; @@ -858,7 +660,7 @@ else if (!StringUtil.isEmpty(strProviderCFC) && !StringUtil.isEmpty(strProviderS } // we make sure we have the default on server level - if (!hasCS && !config.hasResourceProvider("s3")) { + if (!config.hasResourceProvider("s3")) { ClassDefinition s3Class = new ClassDefinitionImpl(DummyS3ResourceProvider.class); Map args = new HashMap<>(); args.put("lock-timeout", "10000"); @@ -895,35 +697,17 @@ private static ClassDefinition getClassDefinition(Struct data, String pre return cd; } - private static void _loadCacheHandler(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadCacheHandler(ConfigImpl config, Struct root, Log log) { try { - boolean hasCS = configServer != null; // !!!! config.clearResourceProviders(); // first of all we make sure we have a request and timespan cachehandler - if (!hasCS) { - config.addCacheHandler("request", new ClassDefinitionImpl(RequestCacheHandler.class)); - config.addCacheHandler("timespan", new ClassDefinitionImpl(TimespanCacheHandler.class)); - } + config.addCacheHandler("request", new ClassDefinitionImpl(RequestCacheHandler.class)); + config.addCacheHandler("timespan", new ClassDefinitionImpl(TimespanCacheHandler.class)); // add CacheHandlers from server context to web context - if (hasCS) { - Iterator>> it = configServer.getCacheHandlers(); - if (it != null) { - Entry> entry; - while (it.hasNext()) { - entry = it.next(); - try { - config.addCacheHandler(entry.getKey(), entry.getValue()); - } - catch (Throwable t) { - ExceptionUtil.rethrowIfNecessary(t); - log(config, log, t); - } - } - } - } - Struct handlers = ConfigWebUtil.getAsStruct("cacheHandlers", root); + + Struct handlers = ConfigUtil.getAsStruct("cacheHandlers", root); if (handlers != null) { ClassDefinition cd; String strId; @@ -963,13 +747,10 @@ private static void _loadCacheHandler(ConfigServerImpl configServer, ConfigImpl } } - private static void _loadAI(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadAI(ConfigImpl config, Struct root, Log log) { try { - boolean hasCS = configServer != null; - // we only load this for the server context - if (hasCS) return; - Struct ai = ConfigWebUtil.getAsStruct(root, false, "ai"); + Struct ai = ConfigUtil.getAsStruct(root, false, "ai"); if (ai != null) { ClassDefinition cd; @@ -1010,31 +791,14 @@ private static void _loadAI(ConfigServerImpl configServer, ConfigImpl config, St } } - private static void _loadDumpWriter(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadDumpWriter(ConfigImpl config, Struct root, Log log) { try { - boolean hasCS = configServer != null; - Array writers = ConfigWebUtil.getAsArray("dumpWriters", root); + Array writers = ConfigUtil.getAsArray("dumpWriters", root); Struct sct = new StructImpl(); boolean hasPlain = false; boolean hasRich = false; - if (hasCS) { - DumpWriterEntry[] entries = configServer.getDumpWritersEntries(); - if (entries != null) { - for (int i = 0; i < entries.length; i++) { - try { - if (entries[i].getDefaultType() == HTMLDumpWriter.DEFAULT_PLAIN) hasPlain = true; - if (entries[i].getDefaultType() == HTMLDumpWriter.DEFAULT_RICH) hasRich = true; - sct.put(entries[i].getName(), entries[i]); - } - catch (Throwable t) { - ExceptionUtil.rethrowIfNecessary(t); - log(config, log, t); - } - } - } - } if (writers != null && writers.size() > 0) { ClassDefinition cd; @@ -1149,11 +913,11 @@ private static String dec(String str, boolean decode) { return URLDecoder.decode(str, false); } - private static void _loadListener(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadListener(ConfigImpl config, Struct root, Log log) { try { if (config instanceof ConfigServer) { ConfigServer cs = (ConfigServer) config; - Struct listener = ConfigWebUtil.getAsStruct("listener", root); + Struct listener = ConfigUtil.getAsStruct("listener", root); ClassDefinition cd = listener != null ? getClassDefinition(listener, "", config.getIdentification()) : null; String strArguments = getAttr(listener, "arguments"); if (strArguments == null) strArguments = ""; @@ -1175,10 +939,6 @@ private static void _loadListener(ConfigServerImpl configServer, ConfigImpl conf } } - else if (configServer != null) { - ConfigListener listener = configServer.getConfigListener(); - if (listener != null) listener.onLoadWebContext(configServer, (ConfigWeb) config); - } } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); @@ -1186,7 +946,7 @@ else if (configServer != null) { } } - private static void settings(ConfigImpl config, Log log) { + private static void settings(ConfigServerImpl config, Log log) { try { doCheckChangesInLibraries(config); } @@ -1207,14 +967,8 @@ private static void _loadVersion(ConfigImpl config, Struct root, Log log) { } } - private static void _loadId(ConfigServerImpl configServer, ConfigImpl config, ConfigWebImpl cwi, Struct root, Log log) { + private static void _loadId(ConfigImpl config, Struct root, Log log) { try { - if (root == null && config instanceof ConfigWebPro) { - Identification id = configServer.getIdentification(); - ((ConfigWebPro) config).setIdentification(new IdentificationWebImpl(cwi, id.getSecurityKey(), id.getApiKey())); - return; - } - // Security key Resource res = config.getConfigDir().getRealResource("id"); String securityKey = null; @@ -1236,14 +990,9 @@ private static void _loadId(ConfigServerImpl configServer, ConfigImpl config, Co String apiKey = null; String str = root != null ? getAttr(root, "apiKey") : null; if (!StringUtil.isEmpty(str, true)) apiKey = str.trim(); - else if (configServer != null) apiKey = configServer.getIdentification().getApiKey(); // if there is no web api key the server api key is used - if (config instanceof ConfigWebPro) { - ((ConfigWebPro) config).setIdentification(new IdentificationWebImpl(cwi, securityKey, apiKey)); - } - else { - ((ConfigServerImpl) config).setIdentification(new IdentificationServerImpl((ConfigServerImpl) config, securityKey, apiKey)); - } + ((ConfigServerImpl) config).setIdentification(new IdentificationServerImpl((ConfigServerImpl) config, securityKey, apiKey)); + config.getIdentification().getId(); } catch (Throwable t) { @@ -1257,67 +1006,26 @@ private static void _loadId(ConfigServerImpl configServer, ConfigImpl config, Co * @param config * @param doc */ - private static void _loadSecurity(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadSecurity(ConfigImpl config, Struct root, Log log) { try { // Security Manger - SecurityManager securityManager = null; - if (config instanceof ConfigServerImpl) { + if (true) { ConfigServerImpl cs = (ConfigServerImpl) config; - boolean isSingle = cs.getAdminMode() == ConfigImpl.ADMINMODE_SINGLE; - Struct security = ConfigWebUtil.getAsStruct("security", root); + Struct security = ConfigUtil.getAsStruct("security", root); // Default SecurityManager - SecurityManagerImpl sm = isSingle ? _toSecurityManagerSingle(security) : _toSecurityManager(security); + SecurityManagerImpl sm = _toSecurityManagerSingle(security); cs.setDefaultSecurityManager(sm); // additional file access directories - if (!isSingle) { - Array elFileAccesses = ConfigWebUtil.getAsArray("fileAccess", security); - sm.setCustomFileAccess(_loadFileAccess(config, elFileAccesses, log)); - - // Web SecurityManager - Array accessors = ConfigWebUtil.getAsArray("", security); - Iterator it = accessors.getIterator(); - Struct ac; - while (it.hasNext()) { - try { - ac = Caster.toStruct(it.next(), null); - if (ac == null) continue; - - String id = getAttr(ac, "id"); - if (id != null) { - sm = _toSecurityManager(ac); - - elFileAccesses = ConfigWebUtil.getAsArray("fileAccess", ac); - sm.setCustomFileAccess(_loadFileAccess(config, elFileAccesses, log)); - cs.setSecurityManager(id, sm); - } - } - catch (Throwable t) { - ExceptionUtil.rethrowIfNecessary(t); - log(config, log, t); - } - } - } } - else if (configServer != null) { - securityManager = configServer.getSecurityManager(config.getIdentification().getId()); - } - if (config instanceof MultiContextConfigWeb) { - if (securityManager == null) securityManager = SecurityManagerImpl.getOpenSecurityManager(); - ((MultiContextConfigWeb) config).setSecurityManager(securityManager); - } - - Struct security = ConfigWebUtil.getAsStruct("security", root); + Struct security = ConfigUtil.getAsStruct("security", root); int vu = ConfigImpl.QUERY_VAR_USAGE_UNDEFINED; if (security != null) { vu = AppListenerUtil.toVariableUsage(getAttr(security, "variableUsage"), ConfigImpl.QUERY_VAR_USAGE_UNDEFINED); if (vu == ConfigImpl.QUERY_VAR_USAGE_UNDEFINED) vu = AppListenerUtil.toVariableUsage(getAttr(security, "varUsage"), ConfigImpl.QUERY_VAR_USAGE_UNDEFINED); } if (vu == ConfigImpl.QUERY_VAR_USAGE_UNDEFINED) { - if (configServer != null) { - vu = configServer.getQueryVarUsage(); - } - else vu = ConfigImpl.QUERY_VAR_USAGE_IGNORE; + vu = ConfigImpl.QUERY_VAR_USAGE_IGNORE; } config.setQueryVarUsage(vu); } @@ -1328,46 +1036,6 @@ else if (configServer != null) { } } - private static Resource[] _loadFileAccess(Config config, Array fileAccesses, Log log) { - if (fileAccesses.size() == 0) return new Resource[0]; - java.util.List reses = new ArrayList(); - String path; - Resource res; - Iterator it = fileAccesses.getIterator(); - Struct fa; - while (it.hasNext()) { - try { - fa = Caster.toStruct(it.next(), null); - if (fa == null) continue; - - path = getAttr(fa, "path"); - if (!StringUtil.isEmpty(path)) { - res = config.getResource(path); - if (res.isDirectory()) reses.add(res); - } - } - catch (Throwable t) { - ExceptionUtil.rethrowIfNecessary(t); - log(config, log, t); - } - } - // temp directory should be always accessible, even when access is local - reses.add(config.getTempDirectory()); - return reses.toArray(new Resource[reses.size()]); - } - - private static SecurityManagerImpl _toSecurityManager(Struct el) { - SecurityManagerImpl sm = new SecurityManagerImpl(_attr(el, "setting", SecurityManager.VALUE_YES), _attr(el, "file", SecurityManager.VALUE_ALL), - _attr(el, "direct_java_access", SecurityManager.VALUE_YES), _attr(el, "mail", SecurityManager.VALUE_YES), _attr(el, "datasource", SecurityManager.VALUE_YES), - _attr(el, "mapping", SecurityManager.VALUE_YES), _attr(el, "remote", SecurityManager.VALUE_YES), _attr(el, "custom_tag", SecurityManager.VALUE_YES), - _attr(el, "cfx_setting", SecurityManager.VALUE_YES), _attr(el, "cfx_usage", SecurityManager.VALUE_YES), _attr(el, "debugging", SecurityManager.VALUE_YES), - _attr(el, "search", SecurityManager.VALUE_YES), _attr(el, "scheduled_task", SecurityManager.VALUE_YES), _attr(el, "tag_execute", SecurityManager.VALUE_YES), - _attr(el, "tag_import", SecurityManager.VALUE_YES), _attr(el, "tag_object", SecurityManager.VALUE_YES), _attr(el, "tag_registry", SecurityManager.VALUE_YES), - _attr(el, "cache", SecurityManager.VALUE_YES), _attr(el, "gateway", SecurityManager.VALUE_YES), _attr(el, "orm", SecurityManager.VALUE_YES), - _attr2(el, "access_read", SecurityManager.ACCESS_PROTECTED), _attr2(el, "access_write", SecurityManager.ACCESS_PROTECTED)); - return sm; - } - private static SecurityManagerImpl _toSecurityManagerSingle(Struct el) { SecurityManagerImpl sm = (SecurityManagerImpl) SecurityManagerImpl.getOpenSecurityManager(); sm.setAccess(SecurityManager.TYPE_ACCESS_READ, _attr2(el, "access_read", SecurityManager.ACCESS_PROTECTED)); @@ -1513,10 +1181,6 @@ public static void createContextFiles(Resource configDir, boolean doNew) throws f = contextDir.getRealResource("component-dump." + TEMPLATE_EXTENSION); if (!f.exists()) createFileFromResourceEL("/resource/context/component-dump." + TEMPLATE_EXTENSION, f); - // Base Component - String badContent = "\n"; - String badVersion = "704b5bd8597be0743b0c99a644b65896"; - // Component.cfc f = contextDir.getRealResource("Component." + COMPONENT_EXTENSION); if (f.exists()) delete(contextDir, "Component." + COMPONENT_EXTENSION); @@ -1653,19 +1317,13 @@ private static void createContextFilesPost(Resource configDir, ConfigWebPro conf } } - private static void doCheckChangesInLibraries(ConfigImpl config) { + private static void doCheckChangesInLibraries(ConfigServerImpl config) { // create current hash from libs TagLib[] tlds = config.getTLDs(); FunctionLib flds = config.getFLDs(); StringBuilder sb = new StringBuilder(); - // version - if (config instanceof ConfigWeb) { - Info info = ((ConfigWeb) config).getFactory().getEngine().getInfo(); - sb.append(info.getVersion().toString()).append(';'); - } - // charset sb.append(config.getTemplateCharset().name()).append(';'); @@ -1709,69 +1367,8 @@ private static void doCheckChangesInLibraries(ConfigImpl config) { // fld sb.append(flds.getHash()); - if (config instanceof MultiContextConfigWeb) { - boolean hasChanged = false; - - sb.append(";").append(((MultiContextConfigWeb) config).getConfigServerImpl().getLibHash()); - try { - String hashValue = HashUtil.create64BitHashAsString(sb.toString()); - // check and compare lib version file - Resource libHash = config.getConfigDir().getRealResource("lib-hash"); - - if (!libHash.exists()) { - libHash.createNewFile(); - IOUtil.write(libHash, hashValue, SystemUtil.getCharset(), false); - hasChanged = true; - } - else if (!IOUtil.toString(libHash, SystemUtil.getCharset()).equals(hashValue)) { - IOUtil.write(libHash, hashValue, SystemUtil.getCharset(), false); - hasChanged = true; - } - } - catch (IOException e) { - } - // change Compile type - if (hasChanged) { - try { - // first we delete the physical classes - config.getClassDirectory().remove(true); - - // now we force the pagepools to flush - flushPageSourcePool(config.getMappings()); - flushPageSourcePool(config.getCustomTagMappings()); - flushPageSourcePool(config.getComponentMappings()); - flushPageSourcePool(config.getFunctionMappings()); - flushPageSourcePool(config.getTagMappings()); - - if (config instanceof MultiContextConfigWeb) { - flushPageSourcePool(((MultiContextConfigWeb) config).getApplicationMappings()); - } - - } - catch (IOException e) { - e.printStackTrace(config.getErrWriter()); - } - } - } - else { - ((ConfigServerImpl) config).setLibHash(HashUtil.create64BitHashAsString(sb.toString())); - } - - } + config.setLibHash(HashUtil.create64BitHashAsString(sb.toString())); - private static void flushPageSourcePool(Mapping... mappings) { - for (int i = 0; i < mappings.length; i++) { - if (mappings[i] instanceof MappingImpl) ((MappingImpl) mappings[i]).flush(); // FUTURE make "flush" part of the interface - } - } - - private static void flushPageSourcePool(Collection mappings) { - Iterator it = mappings.iterator(); - Mapping m; - while (it.hasNext()) { - m = it.next(); - if (m instanceof MappingImpl) ((MappingImpl) m).flush(); // FUTURE make "flush" part of the interface - } } private static void _getDotNotationUpperCase(StringBuilder sb, Mapping... mappings) { @@ -1797,12 +1394,12 @@ private static void _getDotNotationUpperCase(StringBuilder sb, Collection mappings = new HashMap(); lucee.runtime.rest.Mapping tmp; - if (configServer != null && config instanceof ConfigWeb) { - lucee.runtime.rest.Mapping[] sm = configServer.getRestMappings(); - if (sm != null) { - for (int i = 0; i < sm.length; i++) { - try { - if (!sm[i].isHidden()) { - tmp = sm[i].duplicate(config, Boolean.TRUE); - if (tmp.isDefault()) hasDefault = true; - mappings.put(tmp.getVirtual(), tmp); - } - } - catch (Throwable t) { - ExceptionUtil.rethrowIfNecessary(t); - log(config, log, t); - } - } - } - } // get current mappings if (hasAccess && _mappings != null) { @@ -2087,20 +1628,16 @@ else if (hasCS) { } } - private static void _loadLoggers(ConfigServerImpl configServer, ConfigImpl config, Struct root, boolean isReload) { + private static void _loadLoggers(ConfigImpl config, Struct root, boolean isReload) { config.clearLoggers(Boolean.FALSE); - boolean hasCS = configServer != null; Set existing = new HashSet<>(); try { // main logger - String mainLogger = ConfigWebUtil.getAsString("mainLogger", root, null); + String mainLogger = ConfigUtil.getAsString("mainLogger", root, null); if (!StringUtil.isEmpty(mainLogger, true)) { config.setMainLogger(mainLogger.trim()); } - else if (hasCS) { - config.setMainLogger(configServer.getMainLogger()); - } else { mainLogger = SystemUtil.getSystemPropOrEnvVar("lucee.logging.main", null); if (!StringUtil.isEmpty(mainLogger, true)) config.setMainLogger(mainLogger.trim()); @@ -2113,7 +1650,7 @@ else if (hasCS) { try { // loggers - Struct loggers = ConfigWebUtil.getAsStruct("loggers", root); + Struct loggers = ConfigUtil.getAsStruct("loggers", root); String name, tmp; Map appenderArgs, layoutArgs; ClassDefinition cdAppender, cdLayout; @@ -2170,27 +1707,6 @@ else if (!cdLayout.isBundle()) { log(config, null, t); } } - - if (hasCS) { - Iterator> it = configServer.getLoggers().entrySet().iterator(); - Entry e; - LoggerAndSourceData data; - while (it.hasNext()) { - e = it.next(); - try { - // logger only exists in server context - if (!existing.contains(e.getKey().toLowerCase())) { - data = e.getValue(); - config.addLogger(e.getKey(), data.getLevel(), data.getAppenderClassDefinition(), data.getAppenderArgs(false), data.getLayoutClassDefinition(), - data.getLayoutArgs(false), true, false); - } - } - catch (Throwable th) { - ExceptionUtil.rethrowIfNecessary(th); - log(config, null, th); - } - } - } } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); @@ -2198,19 +1714,16 @@ else if (!cdLayout.isBundle()) { } } - private static void _loadExeLog(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadExeLog(ConfigImpl config, Struct root, Log log) { try { - boolean hasServer = configServer != null; - Struct el = ConfigWebUtil.getAsStruct("executionLog", root); + Struct el = ConfigUtil.getAsStruct("executionLog", root); // enabled Boolean bEnabled = Caster.toBoolean(getAttr(el, "enabled"), null); - if (bEnabled == null) { - if (hasServer) config.setExecutionLogEnabled(configServer.getExecutionLogEnabled()); + if (bEnabled != null) { + config.setExecutionLogEnabled(bEnabled.booleanValue()); } - else config.setExecutionLogEnabled(bEnabled.booleanValue()); - boolean hasChanged = false; String val = Caster.toString(config.getExecutionLogEnabled()); try { @@ -2256,18 +1769,18 @@ else if (!IOUtil.toString(exeLog, SystemUtil.getCharset()).equals(val)) { } else { clazz = ConsoleExecutionLog.class; - LogUtil.logGlobal(configServer == null ? config : configServer, Log.LEVEL_ERROR, ConfigWebFactory.class.getName(), + LogUtil.logGlobal(config, Log.LEVEL_ERROR, ConfigWebFactory.class.getName(), "class [" + strClass + "] must implement the interface " + ExecutionLog.class.getName()); } } } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); - LogUtil.logGlobal(ThreadLocalPageContext.getConfig(configServer == null ? config : configServer), ConfigWebFactory.class.getName(), t); + LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), ConfigWebFactory.class.getName(), t); clazz = ConsoleExecutionLog.class; } - if (clazz != null) LogUtil.logGlobal(ThreadLocalPageContext.getConfig(configServer == null ? config : configServer), Log.LEVEL_INFO, - ConfigWebFactory.class.getName(), "loaded ExecutionLog class " + clazz.getName()); + if (clazz != null) + LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_INFO, ConfigWebFactory.class.getName(), "loaded ExecutionLog class " + clazz.getName()); // arguments Map args = toArguments(el, "arguments", true, false); @@ -2276,8 +1789,7 @@ else if (!IOUtil.toString(exeLog, SystemUtil.getCharset()).equals(val)) { config.setExecutionLogFactory(new ExecutionLogFactory(clazz, args)); } else { - if (hasServer) config.setExecutionLogFactory(configServer.getExecutionLogFactory()); - else config.setExecutionLogFactory(new ExecutionLogFactory(ConsoleExecutionLog.class, new HashMap())); + config.setExecutionLogFactory(new ExecutionLogFactory(ConsoleExecutionLog.class, new HashMap())); } } catch (Throwable t) { @@ -2295,35 +1807,17 @@ else if (!IOUtil.toString(exeLog, SystemUtil.getCharset()).equals(val)) { * @throws BundleException * @throws ClassNotFoundException */ - private static void _loadDataSources(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadDataSources(ConfigImpl config, Struct root, Log log) { try { // load JDBC Driver definition - config.setJDBCDrivers(_loadJDBCDrivers(configServer, config, root, log)); + config.setJDBCDrivers(_loadJDBCDrivers(config, root, log)); // When set to true, makes JDBC use a representation for DATE data that // is compatible with the Oracle8i database. System.setProperty("oracle.jdbc.V8Compatible", "true"); - boolean hasCS = configServer != null; Map datasources = new HashMap(); - // Copy Parent datasources as readOnly - if (hasCS) { - Map ds = configServer.getDataSourcesAsMap(); - Iterator> it = ds.entrySet().iterator(); - Entry entry; - while (it.hasNext()) { - entry = it.next(); - try { - if (!entry.getKey().equals(QOQ_DATASOURCE_NAME)) datasources.put(entry.getKey(), entry.getValue().cloneReadOnly()); - } - catch (Throwable t) { - ExceptionUtil.rethrowIfNecessary(t); - log(config, log, t); - } - } - } - // Default query of query DB try { setDatasource(config, datasources, QOQ_DATASOURCE_NAME, @@ -2353,17 +1847,15 @@ else if (access >= SecurityManager.VALUE_1 && access <= SecurityManager.VALUE_10 if (access != SecurityManager.VALUE_NO && !StringUtil.isEmpty(strPSQ)) { config.setPSQL(toBoolean(strPSQ, true)); } - else if (hasCS) config.setPSQL(configServer.getPSQL()); // Data Sources - Struct dataSources = ConfigWebUtil.getAsStruct(root, false, "dataSources"); + Struct dataSources = ConfigUtil.getAsStruct(root, false, "dataSources"); if (accessCount == -1) accessCount = dataSources.size(); if (dataSources.size() < accessCount) accessCount = dataSources.size(); // if(hasAccess) { JDBCDriver jdbc; ClassDefinition cd; - String id; Iterator> it = dataSources.entryIterator(); Entry e; Struct dataSource; @@ -2417,14 +1909,14 @@ else if (!cd.isBundle()) { } setDatasource(config, datasources, e.getKey().getString(), cd, getAttr(dataSource, "host"), getAttr(dataSource, "database"), - Caster.toIntValue(getAttr(dataSource, "port"), -1), dsn, getAttr(dataSource, "username"), ConfigWebUtil.decrypt(getAttr(dataSource, "password")), - null, Caster.toIntValue(getAttr(dataSource, "connectionLimit"), DEFAULT_MAX_CONNECTION), idle, + Caster.toIntValue(getAttr(dataSource, "port"), -1), dsn, getAttr(dataSource, "username"), ConfigUtil.decrypt(getAttr(dataSource, "password")), null, + Caster.toIntValue(getAttr(dataSource, "connectionLimit"), DEFAULT_MAX_CONNECTION), idle, Caster.toIntValue(getAttr(dataSource, "liveTimeout"), defLive), Caster.toIntValue(getAttr(dataSource, "minIdle"), 0), Caster.toIntValue(getAttr(dataSource, "maxIdle"), 0), Caster.toIntValue(getAttr(dataSource, "maxTotal"), 0), Caster.toLongValue(getAttr(dataSource, "metaCacheTimeout"), 60000), toBoolean(getAttr(dataSource, "blob"), true), toBoolean(getAttr(dataSource, "clob"), true), Caster.toIntValue(getAttr(dataSource, "allow"), DataSource.ALLOW_ALL), toBoolean(getAttr(dataSource, "validate"), false), toBoolean(getAttr(dataSource, "storage"), false), getAttr(dataSource, "timezone"), - ConfigWebUtil.getAsStruct(dataSource, true, "custom"), getAttr(dataSource, "dbdriver"), ParamSyntax.toParamSyntax(dataSource, ParamSyntax.DEFAULT), + ConfigUtil.getAsStruct(dataSource, true, "custom"), getAttr(dataSource, "dbdriver"), ParamSyntax.toParamSyntax(dataSource, ParamSyntax.DEFAULT), toBoolean(getAttr(dataSource, "literalTimestampWithTSOffset"), false), toBoolean(getAttr(dataSource, "alwaysSetTimeout"), false), toBoolean(getAttr(dataSource, "requestExclusive"), false), toBoolean(getAttr(dataSource, "alwaysResetConnections"), false) @@ -2480,27 +1972,12 @@ private static ClassDefinition patchJDBCClass(ConfigImpl config, ClassDefinition return cd; } - public static JDBCDriver[] _loadJDBCDrivers(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + public static JDBCDriver[] _loadJDBCDrivers(ConfigImpl config, Struct root, Log log) { Map map = new HashMap(); try { - // first add the server drivers, so they can be overwritten - if (configServer != null) { - JDBCDriver[] sds = configServer.getJDBCDrivers(); - if (sds != null) { - for (JDBCDriver sd: sds) { - try { - map.put(sd.cd.toString(), sd); - } - catch (Throwable t) { - ExceptionUtil.rethrowIfNecessary(t); - log(config, log, t); - } - } - } - } // jdbcDrivers - Struct jdbcDrivers = ConfigWebUtil.getAsStruct("jdbcDrivers", root); + Struct jdbcDrivers = ConfigUtil.getAsStruct("jdbcDrivers", root); Iterator> it = jdbcDrivers.entryIterator(); Entry e; ClassDefinition cd; @@ -2554,33 +2031,19 @@ public static JDBCDriver[] _loadJDBCDrivers(ConfigServerImpl configServer, Confi return map.values().toArray(new JDBCDriver[map.size()]); } - private static void _loadCache(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadCache(ConfigImpl config, Struct root, Log log) { try { - boolean hasCS = configServer != null; - Struct defaultCache = ConfigWebUtil.getAsStruct("cache", root); + Struct defaultCache = ConfigUtil.getAsStruct("cache", root); // load cache defintions { Map map = new HashMap(); // first add the server drivers, so they can be overwritten - if (configServer != null) { - Map cds = configServer.getCacheDefinitions(); - if (cds != null) { - Collection values = cds.values(); - if (values != null) { - Iterator it = values.iterator(); - ClassDefinition cd; - while (it.hasNext()) { - cd = it.next(); - map.put(cd.getClassName(), cd); - } - } - } - } + ClassDefinition cd; - Array caches = ConfigWebUtil.getAsArray("cacheClasses", root); + Array caches = ConfigUtil.getAsArray("cacheClasses", root); if (caches != null) { Iterator it = caches.getIterator(); Struct cache; @@ -2608,7 +2071,7 @@ private static void _loadCache(ConfigServerImpl configServer, ConfigImpl config, Map caches = new HashMap(); - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManagerImpl.TYPE_CACHE); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManagerImpl.TYPE_CACHE); // default cache for (int i = 0; i < ConfigPro.CACHE_TYPES_MAX.length; i++) { @@ -2619,11 +2082,6 @@ private static void _loadCache(ConfigServerImpl configServer, ConfigImpl config, if (hasAccess && !StringUtil.isEmpty(def, true)) { config.setCacheDefaultConnectionName(ConfigPro.CACHE_TYPES_MAX[i], def.trim()); } - else if (hasCS) { - if (defaultCache.containsKey("default" + StringUtil.ucFirst(ConfigPro.STRING_CACHE_TYPES_MAX[i]))) - config.setCacheDefaultConnectionName(ConfigPro.CACHE_TYPES_MAX[i], ""); - else config.setCacheDefaultConnectionName(ConfigPro.CACHE_TYPES_MAX[i], configServer.getCacheDefaultConnectionName(ConfigPro.CACHE_TYPES_MAX[i])); - } else { config.setCacheDefaultConnectionName(+ConfigPro.CACHE_TYPES_MAX[i], ""); } @@ -2636,7 +2094,7 @@ else if (hasCS) { } { - Struct eCaches = ConfigWebUtil.getAsStruct("caches", root); + Struct eCaches = ConfigUtil.getAsStruct("caches", root); // check if we have an update or not StringBuilder sb = new StringBuilder(); @@ -2649,7 +2107,7 @@ else if (hasCS) { sb.append(config.getCacheDefaultConnectionName(ct)).append(';'); } - String md5 = eCaches != null ? getMD5(eCaches, sb.toString(), hasCS ? configServer.getCacheMD5() : "") : ""; + String md5 = eCaches != null ? getMD5(eCaches, sb.toString(), "") : ""; if (md5.equals(config.getCacheMD5())) { return; } @@ -2657,7 +2115,7 @@ else if (hasCS) { } // cache connections - Struct conns = ConfigWebUtil.getAsStruct("caches", root); + Struct conns = ConfigUtil.getAsStruct("caches", root); // if(hasAccess) { ClassDefinition cd; @@ -2681,7 +2139,7 @@ else if (hasCS) { } { - Struct custom = ConfigWebUtil.getAsStruct(data, true, "custom"); + Struct custom = ConfigUtil.getAsStruct(data, true, "custom"); // Workaround for old EHCache class definitions if (cd.getClassName() != null && cd.getClassName().endsWith(".EHCacheLite")) { @@ -2700,8 +2158,7 @@ else if (cd.getClassName() != null if (!StringUtil.isEmpty(name)) { caches.put(name.getLowerString(), cc); } - else LogUtil.logGlobal(ThreadLocalPageContext.getConfig(configServer == null ? config : configServer), Log.LEVEL_ERROR, - ConfigWebFactory.class.getName(), "missing cache name"); + else LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_ERROR, ConfigWebFactory.class.getName(), "missing cache name"); } } @@ -2762,23 +2219,6 @@ else if (cd.getClassName() != null */ } - // Copy Parent caches as readOnly - if (hasCS) { - Map ds = configServer.getCacheConnections(); - Iterator> it = ds.entrySet().iterator(); - Entry entry; - while (it.hasNext()) { - try { - entry = it.next(); - cc = entry.getValue(); - if (!caches.containsKey(entry.getKey())) caches.put(entry.getKey(), new ServerCacheConnection(configServer, cc)); - } - catch (Throwable t) { - ExceptionUtil.rethrowIfNecessary(t); - log(config, log, t); - } - } - } config.setCaches(caches); } catch (Throwable t) { @@ -2796,43 +2236,22 @@ private static String getMD5(Struct data, String cacheDef, String parentMD5) { } } - private static void _loadGatewayEL(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadGatewayEL(ConfigImpl config, Struct root, Log log) { try { - _loadGateway(configServer, config, root, log); + _loadGateway(config, root, log); } catch (Exception e) { log(config, log, e); } } - private static void _loadGateway(ConfigServerImpl configServer, final ConfigImpl config, Struct root, Log log) throws PageException { - boolean hasCS = configServer != null; + private static void _loadGateway(final ConfigImpl config, Struct root, Log log) { GatewayMap mapGateways = new GatewayMap(); - // get from server context - if (hasCS) { - - Map entries = configServer.getGatewayEntries(); - if (entries != null && !entries.isEmpty()) { - Iterator> it = entries.entrySet().iterator(); - Entry e; - while (it.hasNext()) { - try { - e = it.next(); - mapGateways.put(e.getKey(), ((GatewayEntryImpl) e.getValue()).duplicateReadOnly()); - } - catch (Throwable th) { - ExceptionUtil.rethrowIfNecessary(th); - log(config, log, th); - } - } - } - } - - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManagerImpl.TYPE_GATEWAY); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManagerImpl.TYPE_GATEWAY); GatewayEntry ge; // cache connections - Struct gateways = ConfigWebUtil.getAsStruct("gateways", root); + Struct gateways = ConfigUtil.getAsStruct("gateways", root); String id; // caches @@ -2849,15 +2268,14 @@ private static void _loadGateway(ConfigServerImpl configServer, final ConfigImpl id = e.getKey().getLowerString(); ge = new GatewayEntryImpl(id, getClassDefinition(eConnection, "", config.getIdentification()), getAttr(eConnection, "cfcPath"), - getAttr(eConnection, "listenerCFCPath"), getAttr(eConnection, "startupMode"), ConfigWebUtil.getAsStruct(eConnection, true, "custom"), + getAttr(eConnection, "listenerCFCPath"), getAttr(eConnection, "startupMode"), ConfigUtil.getAsStruct(eConnection, true, "custom"), Caster.toBooleanValue(getAttr(eConnection, "readOnly"), false)); if (!StringUtil.isEmpty(id)) { mapGateways.put(id.toLowerCase(), ge); } else { - LogUtil.logGlobal(ThreadLocalPageContext.getConfig(configServer == null ? config : configServer), Log.LEVEL_ERROR, ConfigWebFactory.class.getName(), - "missing id"); + LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), Log.LEVEL_ERROR, ConfigWebFactory.class.getName(), "missing id"); } } @@ -2873,9 +2291,6 @@ private static void _loadGateway(ConfigServerImpl configServer, final ConfigImpl log(config, log, t); } } - else if (hasCS) { - ((GatewayEngineImpl) ((ConfigWebPro) config).getGatewayEngine()).clear(); - } } private static void setDatasource(ConfigImpl config, Map datasources, String datasourceName, ClassDefinition cd, String server, String databasename, @@ -2898,19 +2313,15 @@ private static void setDatasource(ConfigImpl config, Map dat * @param doc * @throws IOException */ - private static void _loadCustomTagsMappings(ConfigServerImpl configServer, ConfigImpl config, Struct root, int mode, Log log) { + private static void _loadCustomTagsMappings(ConfigImpl config, Struct root, int mode, Log log) { try { - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_CUSTOM_TAG); - boolean hasCS = configServer != null; + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_CUSTOM_TAG); // do patch cache String strDoPathcache = getAttr(root, "customTagUseCachePath"); if (hasAccess && !StringUtil.isEmpty(strDoPathcache, true)) { config.setUseCTPathCache(Caster.toBooleanValue(strDoPathcache.trim(), true)); } - else if (hasCS) { - config.setUseCTPathCache(configServer.useCTPathCache()); - } // do custom tag local search if (mode == ConfigPro.MODE_STRICT) { @@ -2921,9 +2332,6 @@ else if (hasCS) { if (hasAccess && !StringUtil.isEmpty(strDoCTLocalSearch)) { config.setDoLocalCustomTag(Caster.toBooleanValue(strDoCTLocalSearch.trim(), true)); } - else if (hasCS) { - config.setDoLocalCustomTag(configServer.doLocalCustomTag()); - } } // do custom tag deep search @@ -2935,9 +2343,6 @@ else if (hasCS) { if (hasAccess && !StringUtil.isEmpty(strDoCTDeepSearch)) { config.setDoCustomTagDeepSearch(Caster.toBooleanValue(strDoCTDeepSearch.trim(), false)); } - else if (hasCS) { - config.setDoCustomTagDeepSearch(configServer.doCustomTagDeepSearch()); - } } // extensions @@ -2954,13 +2359,10 @@ else if (hasCS) { catch (PageException e) { } } - else if (hasCS) { - config.setCustomTagExtensions(configServer.getCustomTagExtensions()); - } } // Struct customTag = ConfigWebUtil.getAsStruct("customTag", root); - Array ctMappings = ConfigWebUtil.getAsArray("customTagMappings", root); + Array ctMappings = ConfigUtil.getAsArray("customTagMappings", root); // Web Mapping boolean hasSet = false; @@ -2999,57 +2401,9 @@ else if (hasCS) { mappings = list.toArray(new Mapping[list.size()]); config.setCustomTagMappings(mappings); } - else if (!hasCS) { - // we make sure we always have that mapping - config.setCustomTagMappings(new Mapping[] { new MappingImpl(config, "/default-customtags", "{lucee-config}/customtags/", null, ConfigPro.INSPECT_UNDEFINED, - ConfigPro.INSPECT_INTERVAL_UNDEFINED, ConfigPro.INSPECT_INTERVAL_UNDEFINED, true, true, true, true, false, true, null, -1, -1) }); - } - } - - // Server Mapping - if (hasCS) { - Mapping[] originals = configServer.getCustomTagMappings(); - if (originals == null) originals = new Mapping[0]; - Mapping[] clones = new Mapping[originals.length]; - LinkedHashMap map = new LinkedHashMap(); - Mapping m; - for (int i = 0; i < clones.length; i++) { - try { - m = ((MappingImpl) originals[i]).cloneReadOnly(config); - map.put(toKey(m), m); - } - catch (Throwable t) { - ExceptionUtil.rethrowIfNecessary(t); - log(config, log, t); - } - } - - if (mappings != null) { - for (int i = 0; i < mappings.length; i++) { - m = mappings[i]; - map.put(toKey(m), m); - } - } - if (originals.length > 0) { - clones = new Mapping[map.size()]; - Iterator it = map.entrySet().iterator(); - Map.Entry entry; - int index = 0; - while (it.hasNext()) { - try { - entry = (Entry) it.next(); - clones[index++] = (Mapping) entry.getValue(); - } - catch (Throwable t) { - ExceptionUtil.rethrowIfNecessary(t); - log(config, log, t); - } - } - hasSet = true; - // print.err("set:"+clones.length); + config.setCustomTagMappings(new Mapping[] { new MappingImpl(config, "/default-customtags", "{lucee-config}/customtags/", null, ConfigPro.INSPECT_UNDEFINED, + ConfigPro.INSPECT_INTERVAL_UNDEFINED, ConfigPro.INSPECT_INTERVAL_UNDEFINED, true, true, true, true, false, true, null, -1, -1) }); - config.setCustomTagMappings(clones); - } } if (!hasSet) { @@ -3066,11 +2420,6 @@ else if (!hasCS) { } - private static Object toKey(Mapping m) { - if (!StringUtil.isEmpty(m.getStrPhysical(), true)) return m.getVirtual() + ":" + m.getStrPhysical().toLowerCase().trim(); - return (m.getVirtual() + ":" + m.getStrPhysical() + ":" + m.getStrArchive()).toLowerCase(); - } - /** * @param configServer * @param config @@ -3079,7 +2428,7 @@ private static Object toKey(Mapping m) { * @throws IOException * @throws NoSuchAlgorithmException */ - private static void _loadConfig(ConfigServerImpl configServer, ConfigImpl config, Struct root) { + private static void _loadConfig(ConfigImpl config, Struct root) { String salt = null; Password pw = null; @@ -3089,20 +2438,12 @@ private static void _loadConfig(ConfigServerImpl configServer, ConfigImpl config if (StringUtil.isEmpty(salt, true)) throw new RuntimeException("context is invalid, there is no salt!"); config.setSalt(salt = salt.trim()); // password - pw = PasswordImpl.readFromStruct(root, salt, false, configServer == null); + pw = PasswordImpl.readFromStruct(root, salt, false, true); if (pw != null) { config.setPassword(pw); - if (config instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) config).setPasswordSource(ConfigWebImpl.PASSWORD_ORIGIN_WEB); - } - else if (configServer != null) { - - ((MultiContextConfigWeb) config) - .setPasswordSource(configServer.hasCustomDefaultPassword() ? ConfigWebImpl.PASSWORD_ORIGIN_DEFAULT : ConfigWebImpl.PASSWORD_ORIGIN_SERVER); - if (configServer.getDefaultPassword() != null) config.setPassword(configServer.getDefaultPassword()); } - if (config instanceof ConfigServerImpl) { - ConfigServerImpl csi = (ConfigServerImpl) config; + if (true) { String keyList = getAttr(root, "authKeys"); if (!StringUtil.isEmpty(keyList)) { String[] keys = ListUtil.trimItems(ListUtil.toStringArray(ListUtil.toListRemoveEmpty(keyList, ','))); @@ -3114,13 +2455,13 @@ else if (configServer != null) { } } - csi.setAuthenticationKeys(keys); + ((ConfigServerImpl) config).setAuthenticationKeys(keys); } } // default password if (config instanceof ConfigServerImpl) { - pw = PasswordImpl.readFromStruct(root, salt, true, configServer == null); + pw = PasswordImpl.readFromStruct(root, salt, true, true); if (pw != null) ((ConfigServerImpl) config).setDefaultPassword(pw); } @@ -3131,24 +2472,18 @@ else if (configServer != null) { if ("custom".equalsIgnoreCase(mode)) config.setMode(ConfigPro.MODE_CUSTOM); if ("strict".equalsIgnoreCase(mode)) config.setMode(ConfigPro.MODE_STRICT); } - else if (configServer != null) { - config.setMode(configServer.getMode()); - } // check config file for changes String cFc = getAttr(root, "checkForChanges"); if (!StringUtil.isEmpty(cFc, true)) { config.setCheckForChangesInConfigFile(Caster.toBooleanValue(cFc.trim(), false)); } - else if (configServer != null) { - config.setCheckForChangesInConfigFile(configServer.checkForChangesInConfigFile()); - } } - private static void _loadTag(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadTag(ConfigImpl config, Struct root, Log log) { try { { - Array tags = ConfigWebUtil.getAsArray("tags", root); + Array tags = ConfigUtil.getAsArray("tags", root); Struct tag; ClassDefinition cd; String nss, ns, n; @@ -3174,13 +2509,12 @@ private static void _loadTag(ConfigServerImpl configServer, ConfigImpl config, S } // set tag default values - Array defaults = ConfigWebUtil.getAsArray("tagDefaults", root); + Array defaults = ConfigUtil.getAsArray("tagDefaults", root); if (defaults.size() > 0) { Struct def; String tagName, attrName, attrValue; Struct tags = new StructImpl(), tag; Iterator it = defaults.getIterator(); - Map> trg = new HashMap>(); while (it.hasNext()) { try { def = Caster.toStruct(it.next(), null); @@ -3213,26 +2547,18 @@ private static void _loadTag(ConfigServerImpl configServer, ConfigImpl config, S } } - private static void _loadTempDirectory(ConfigServerImpl configServer, ConfigImpl config, Struct root, boolean isReload, Log log) { + private static void _loadTempDirectory(ConfigImpl config, Struct root, boolean isReload, Log log) { try { - if (configServer != null && root == null) { - config.setTempDirectory(configServer.getTempDirectory(), !isReload); - return; - } - Resource configDir = config.getConfigDir(); - boolean hasCS = configServer != null; - String strTempDirectory = ConfigWebUtil.translateOldPath(getAttr(root, "tempDirectory")); + String strTempDirectory = ConfigUtil.translateOldPath(getAttr(root, "tempDirectory")); Resource cst = null; // Temp Dir if (!StringUtil.isEmpty(strTempDirectory)) - cst = ConfigWebUtil.getFile(configDir, strTempDirectory, null, configDir, FileUtil.TYPE_DIR, ResourceUtil.LEVEL_GRAND_PARENT_FILE, config); - - if (cst == null && hasCS) cst = configServer.getTempDirectory(); + cst = ConfigUtil.getFile(configDir, strTempDirectory, null, configDir, FileUtil.TYPE_DIR, ResourceUtil.LEVEL_GRAND_PARENT_FILE, config); - if (cst == null) cst = ConfigWebUtil.getFile(configDir, "temp", null, configDir, FileUtil.TYPE_DIR, ResourceUtil.LEVEL_GRAND_PARENT_FILE, config); + if (cst == null) cst = ConfigUtil.getFile(configDir, "temp", null, configDir, FileUtil.TYPE_DIR, ResourceUtil.LEVEL_GRAND_PARENT_FILE, config); config.setTempDirectory(cst, !isReload); } @@ -3250,17 +2576,10 @@ private static void _loadTempDirectory(ConfigServerImpl configServer, ConfigImpl * @throws TagLibException * @throws FunctionLibException */ - private static void _loadFilesystem(ConfigServerImpl configServer, ConfigImpl config, Struct root, boolean doNew, Log log) { + private static void _loadFilesystem(ConfigImpl config, Struct root, boolean doNew, Log log) { try { - if (configServer != null) { - Resource src = configServer.getConfigDir().getRealResource("distribution"); - Resource trg = config.getConfigDir().getRealResource("context/"); - copyContextFiles(src, trg); - } Resource configDir = config.getConfigDir(); - boolean hasCS = configServer != null; - String strAllowRealPath = null; String strDeployDirectory = null; // String strTempDirectory=null; @@ -3274,36 +2593,33 @@ private static void _loadFilesystem(ConfigServerImpl configServer, ConfigImpl co String strTagDirectory = null; // only read in server context - if (!hasCS) { - strDefaultFLDDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.fld", null); - strDefaultTLDDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.tld", null); - strDefaultFuncDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.function", null); - strDefaultTagDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.tag", null); - if (StringUtil.isEmpty(strDefaultFLDDirectory)) strDefaultFLDDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.default.fld", null); - if (StringUtil.isEmpty(strDefaultTLDDirectory)) strDefaultTLDDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.default.tld", null); - if (StringUtil.isEmpty(strDefaultFuncDirectory)) strDefaultFuncDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.default.function", null); - if (StringUtil.isEmpty(strDefaultTagDirectory)) strDefaultTagDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.default.tag", null); - strFuncDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.additional.function", null); - strTagDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.additional.tag", null); - - } - - Struct fileSystem = ConfigWebUtil.getAsStruct("fileSystem", root); + strDefaultFLDDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.fld", null); + strDefaultTLDDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.tld", null); + strDefaultFuncDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.function", null); + strDefaultTagDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.tag", null); + if (StringUtil.isEmpty(strDefaultFLDDirectory)) strDefaultFLDDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.default.fld", null); + if (StringUtil.isEmpty(strDefaultTLDDirectory)) strDefaultTLDDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.default.tld", null); + if (StringUtil.isEmpty(strDefaultFuncDirectory)) strDefaultFuncDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.default.function", null); + if (StringUtil.isEmpty(strDefaultTagDirectory)) strDefaultTagDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.default.tag", null); + strFuncDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.additional.function", null); + strTagDirectory = SystemUtil.getSystemPropOrEnvVar("lucee.library.additional.tag", null); + + Struct fileSystem = ConfigUtil.getAsStruct("fileSystem", root); // get library directories if (fileSystem != null) { strAllowRealPath = getAttr(fileSystem, "allowRealpath"); - strDeployDirectory = ConfigWebUtil.translateOldPath(getAttr(fileSystem, "deployDirectory")); - if (StringUtil.isEmpty(strDefaultTLDDirectory)) strDefaultTLDDirectory = ConfigWebUtil.translateOldPath(getAttr(fileSystem, "tldDirectory")); - if (StringUtil.isEmpty(strDefaultFLDDirectory)) strDefaultFLDDirectory = ConfigWebUtil.translateOldPath(getAttr(fileSystem, "flddirectory")); - if (StringUtil.isEmpty(strDefaultTagDirectory)) strDefaultTagDirectory = ConfigWebUtil.translateOldPath(getAttr(fileSystem, "tagDirectory")); - if (StringUtil.isEmpty(strDefaultFuncDirectory)) strDefaultFuncDirectory = ConfigWebUtil.translateOldPath(getAttr(fileSystem, "functionDirectory")); - if (StringUtil.isEmpty(strDefaultTLDDirectory)) strDefaultTLDDirectory = ConfigWebUtil.translateOldPath(getAttr(fileSystem, "tldDefaultDirectory")); - if (StringUtil.isEmpty(strDefaultFLDDirectory)) strDefaultFLDDirectory = ConfigWebUtil.translateOldPath(getAttr(fileSystem, "fldDefaultDirectory")); - if (StringUtil.isEmpty(strDefaultTagDirectory)) strDefaultTagDirectory = ConfigWebUtil.translateOldPath(getAttr(fileSystem, "tagDefaultDirectory")); - if (StringUtil.isEmpty(strDefaultFuncDirectory)) strDefaultFuncDirectory = ConfigWebUtil.translateOldPath(getAttr(fileSystem, "functionDefaultDirectory")); - if (StringUtil.isEmpty(strTagDirectory)) strTagDirectory = ConfigWebUtil.translateOldPath(getAttr(fileSystem, "tagAddionalDirectory")); - if (StringUtil.isEmpty(strFuncDirectory)) strFuncDirectory = ConfigWebUtil.translateOldPath(getAttr(fileSystem, "functionAddionalDirectory")); + strDeployDirectory = ConfigUtil.translateOldPath(getAttr(fileSystem, "deployDirectory")); + if (StringUtil.isEmpty(strDefaultTLDDirectory)) strDefaultTLDDirectory = ConfigUtil.translateOldPath(getAttr(fileSystem, "tldDirectory")); + if (StringUtil.isEmpty(strDefaultFLDDirectory)) strDefaultFLDDirectory = ConfigUtil.translateOldPath(getAttr(fileSystem, "flddirectory")); + if (StringUtil.isEmpty(strDefaultTagDirectory)) strDefaultTagDirectory = ConfigUtil.translateOldPath(getAttr(fileSystem, "tagDirectory")); + if (StringUtil.isEmpty(strDefaultFuncDirectory)) strDefaultFuncDirectory = ConfigUtil.translateOldPath(getAttr(fileSystem, "functionDirectory")); + if (StringUtil.isEmpty(strDefaultTLDDirectory)) strDefaultTLDDirectory = ConfigUtil.translateOldPath(getAttr(fileSystem, "tldDefaultDirectory")); + if (StringUtil.isEmpty(strDefaultFLDDirectory)) strDefaultFLDDirectory = ConfigUtil.translateOldPath(getAttr(fileSystem, "fldDefaultDirectory")); + if (StringUtil.isEmpty(strDefaultTagDirectory)) strDefaultTagDirectory = ConfigUtil.translateOldPath(getAttr(fileSystem, "tagDefaultDirectory")); + if (StringUtil.isEmpty(strDefaultFuncDirectory)) strDefaultFuncDirectory = ConfigUtil.translateOldPath(getAttr(fileSystem, "functionDefaultDirectory")); + if (StringUtil.isEmpty(strTagDirectory)) strTagDirectory = ConfigUtil.translateOldPath(getAttr(fileSystem, "tagAddionalDirectory")); + if (StringUtil.isEmpty(strFuncDirectory)) strFuncDirectory = ConfigUtil.translateOldPath(getAttr(fileSystem, "functionAddionalDirectory")); } // set default directories if necessary @@ -3313,49 +2629,30 @@ private static void _loadFilesystem(ConfigServerImpl configServer, ConfigImpl co if (StringUtil.isEmpty(strDefaultTagDirectory)) strDefaultTagDirectory = "{lucee-config}/library/tag/"; // Deploy Dir - Resource dd = ConfigWebUtil.getFile(configDir, strDeployDirectory, "cfclasses", configDir, FileUtil.TYPE_DIR, ResourceUtil.LEVEL_GRAND_PARENT_FILE, config); + Resource dd = ConfigUtil.getFile(configDir, strDeployDirectory, "cfclasses", configDir, FileUtil.TYPE_DIR, ResourceUtil.LEVEL_GRAND_PARENT_FILE, config); config.setDeployDirectory(dd); // TAG // init TLDS - if (hasCS) { - config.setTLDs(ConfigWebUtil.duplicate(configServer.getTLDs(), false)); - } - else { - ConfigServerImpl cs = (ConfigServerImpl) config; - config.setTLDs(ConfigWebUtil.duplicate(new TagLib[] { cs.coreTLDs }, false)); - } + ConfigServerImpl cs = (ConfigServerImpl) config; + config.setTLDs(ConfigUtil.duplicate(new TagLib[] { cs.coreTLDs }, false)); // TLD Dir if (!StringUtil.isEmpty(strDefaultTLDDirectory)) { - Resource tld = ConfigWebUtil.getFile(config, configDir, strDefaultTLDDirectory, FileUtil.TYPE_DIR); + Resource tld = ConfigUtil.getFile(config, configDir, strDefaultTLDDirectory, FileUtil.TYPE_DIR); if (tld != null) config.setTldFile(tld); } // Tag Directory List listTags = new ArrayList(); if (!StringUtil.isEmpty(strDefaultTagDirectory)) { - Resource dir = ConfigWebUtil.getFile(config, configDir, strDefaultTagDirectory, FileUtil.TYPE_DIR); + Resource dir = ConfigUtil.getFile(config, configDir, strDefaultTagDirectory, FileUtil.TYPE_DIR); createTagFiles(config, configDir, dir, doNew); listTags.add(new Path(strDefaultTagDirectory, dir)); } // addional tags Map mapTags = new LinkedHashMap(); - if (hasCS) { - Collection mappings = configServer.getTagMappings(); - if (mappings != null && !mappings.isEmpty()) { - Iterator it = mappings.iterator(); - Mapping m; - while (it.hasNext()) { - m = it.next(); - if ((m.getPhysical() == null || !m.getPhysical().exists()) && ConfigWebUtil.hasPlaceholder(m.getStrPhysical())) { - mapTags.put(m.getStrPhysical(), ""); - } - } - } - } - if (!StringUtil.isEmpty(strTagDirectory) || !mapTags.isEmpty()) { String[] arr = ListUtil.listToStringArray(strTagDirectory, ','); for (String str: arr) { @@ -3365,7 +2662,7 @@ private static void _loadFilesystem(ConfigServerImpl configServer, ConfigImpl co try { str = str.trim(); if (StringUtil.isEmpty(str)) continue; - Resource dir = ConfigWebUtil.getFile(config, configDir, str, FileUtil.TYPE_DIR); + Resource dir = ConfigUtil.getFile(config, configDir, str, FileUtil.TYPE_DIR); listTags.add(new Path(str, dir)); } catch (Throwable t) { @@ -3377,9 +2674,6 @@ private static void _loadFilesystem(ConfigServerImpl configServer, ConfigImpl co config.setTagDirectory(listTags); // allow realpath - if (hasCS) { - config.setAllowRealPath(configServer.allowRealPath()); - } if (!StringUtil.isEmpty(strAllowRealPath, true)) { config.setAllowRealPath(Caster.toBooleanValue(strAllowRealPath, true)); } @@ -3387,44 +2681,24 @@ private static void _loadFilesystem(ConfigServerImpl configServer, ConfigImpl co // FUNCTIONS // Init flds - if (hasCS) { - config.setFLDs(configServer.getFLDs().duplicate(false)); - } - else { - ConfigServerImpl cs = (ConfigServerImpl) config; - config.setFLDs(cs.coreFLDs.duplicate(false)); - - } + config.setFLDs(cs.coreFLDs.duplicate(false)); // FLDs if (!StringUtil.isEmpty(strDefaultFLDDirectory)) { - Resource fld = ConfigWebUtil.getFile(config, configDir, strDefaultFLDDirectory, FileUtil.TYPE_DIR); + Resource fld = ConfigUtil.getFile(config, configDir, strDefaultFLDDirectory, FileUtil.TYPE_DIR); if (fld != null) config.setFldFile(fld); } // Function files (CFML) List listFuncs = new ArrayList(); if (!StringUtil.isEmpty(strDefaultFuncDirectory)) { - Resource dir = ConfigWebUtil.getFile(config, configDir, strDefaultFuncDirectory, FileUtil.TYPE_DIR); + Resource dir = ConfigUtil.getFile(config, configDir, strDefaultFuncDirectory, FileUtil.TYPE_DIR); createFunctionFiles(config, configDir, dir, doNew); listFuncs.add(new Path(strDefaultFuncDirectory, dir)); // if (dir != null) config.setFunctionDirectory(dir); } // function additonal Map mapFunctions = new LinkedHashMap(); - if (hasCS) { - Collection mappings = configServer.getFunctionMappings(); - if (mappings != null && !mappings.isEmpty()) { - Iterator it = mappings.iterator(); - Mapping m; - while (it.hasNext()) { - m = it.next(); - if ((m.getPhysical() == null || !m.getPhysical().exists()) && ConfigWebUtil.hasPlaceholder(m.getStrPhysical())) { - mapFunctions.put(m.getStrPhysical(), ""); - } - } - } - } if (!StringUtil.isEmpty(strFuncDirectory) || !mapFunctions.isEmpty()) { String[] arr = ListUtil.listToStringArray(strFuncDirectory, ','); for (String str: arr) { @@ -3434,7 +2708,7 @@ private static void _loadFilesystem(ConfigServerImpl configServer, ConfigImpl co try { str = str.trim(); if (StringUtil.isEmpty(str)) continue; - Resource dir = ConfigWebUtil.getFile(config, configDir, str, FileUtil.TYPE_DIR); + Resource dir = ConfigUtil.getFile(config, configDir, str, FileUtil.TYPE_DIR); listFuncs.add(new Path(str, dir)); } catch (Throwable t) { @@ -3534,37 +2808,12 @@ private static void createFunctionFiles(Config config, Resource configDir, Resou } } - private static void copyContextFiles(Resource src, Resource trg) { - // directory - if (src.isDirectory()) { - if (trg.exists()) trg.mkdirs(); - Resource[] children = src.listResources(); - for (int i = 0; i < children.length; i++) { - copyContextFiles(children[i], trg.getRealResource(children[i].getName())); - } - } - // file - else if (src.isFile()) { - if (src.lastModified() > trg.lastModified()) { - try { - if (trg.exists()) trg.remove(true); - trg.createFile(true); - src.copyTo(trg, false); - } - catch (IOException e) { - LogUtil.logGlobal(ThreadLocalPageContext.getConfig(), ConfigWebFactory.class.getName(), e); - } - } - - } - } - /** * @param configServer * @param config * @param doc */ - private static void _loadUpdate(ConfigServer configServer, Config config, Struct root, Log log) { + private static void _loadUpdate(Config config, Struct root, Log log) { try { // Server if (config instanceof ConfigServer && root != null) { @@ -3590,35 +2839,9 @@ private static void _loadUpdate(ConfigServer configServer, Config config, Struct } } - /** - * @param configServer - * @param config - * @param doc - */ - private static void _loadAdminMode(ConfigServerImpl config, Struct root) { - final short undefined = -1; - short am = undefined; - - // force by env var - String str = SystemUtil.getSystemPropOrEnvVar("lucee.admin.mode", null); - if (!StringUtil.isEmpty(str, true)) { - am = ConfigWebUtil.toAdminMode(str, undefined); - } - - // when not forced - if (am == undefined) { - am = ConfigWebUtil.toAdminMode(getAttr(root, "mode"), undefined); - if (am == undefined) { - am = ConfigWebUtil.toAdminMode(SystemUtil.getSystemPropOrEnvVar("lucee.admin.mode.default", null), ConfigImpl.ADMINMODE_SINGLE); - } - } - config.setAdminMode(am); - } - - private static void _loadSetting(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadSetting(ConfigImpl config, Struct root, Log log) { try { - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); - boolean hasCS = configServer != null; + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); // suppress whitespace String str = getAttr(root, "suppressContent"); @@ -3626,7 +2849,6 @@ private static void _loadSetting(ConfigServerImpl configServer, ConfigImpl confi if (!StringUtil.isEmpty(str) && hasAccess) { config.setSuppressContent(toBoolean(str, false)); } - else if (hasCS) config.setSuppressContent(configServer.isSuppressContent()); // CFML Writer str = SystemUtil.getSystemPropOrEnvVar("lucee.cfml.writer", null); @@ -3639,35 +2861,30 @@ private static void _loadSetting(ConfigServerImpl configServer, ConfigImpl confi else if ("regular".equalsIgnoreCase(str)) config.setCFMLWriterType(ConfigPro.CFML_WRITER_REFULAR); // FUTURE add support for classes implementing CFMLWriter interface } - else if (hasCS) config.setCFMLWriterType(configServer.getCFMLWriterType()); // show version str = getAttr(root, "showVersion"); if (!StringUtil.isEmpty(str) && hasAccess) { config.setShowVersion(toBoolean(str, false)); } - else if (hasCS) config.setShowVersion(configServer.isShowVersion()); // close connection str = getAttr(root, "closeConnection"); if (!StringUtil.isEmpty(str) && hasAccess) { config.setCloseConnection(toBoolean(str, false)); } - else if (hasCS) config.setCloseConnection(configServer.closeConnection()); // content-length str = getAttr(root, "contentLength"); if (!StringUtil.isEmpty(str) && hasAccess) { config.setContentLength(toBoolean(str, true)); } - else if (hasCS) config.setContentLength(configServer.contentLength()); str = getAttr(root, "bufferTagBodyOutput"); Boolean b = Caster.toBoolean(str, null); if (b != null && hasAccess) { config.setBufferOutput(b.booleanValue()); } - else if (hasCS) config.setBufferOutput(configServer.getBufferOutput()); // allow-compression str = SystemUtil.getSystemPropOrEnvVar("lucee.allow.compression", null); @@ -3677,14 +2894,12 @@ private static void _loadSetting(ConfigServerImpl configServer, ConfigImpl confi if (!StringUtil.isEmpty(str) && hasAccess) { config.setAllowCompression(toBoolean(str, true)); } - else if (hasCS) config.setAllowCompression(configServer.allowCompression()); // mode String developMode = getAttr(root, "developMode"); if (!StringUtil.isEmpty(developMode) && hasAccess) { config.setDevelopMode(toBoolean(developMode, false)); } - else if (hasCS) config.setDevelopMode(configServer.isDevelopMode()); } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); @@ -3692,45 +2907,35 @@ private static void _loadSetting(ConfigServerImpl configServer, ConfigImpl confi } } - private static void _loadRemoteClient(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadRemoteClient(ConfigImpl config, Struct root, Log log) { try { - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManagerImpl.TYPE_REMOTE); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManagerImpl.TYPE_REMOTE); // SNSN // RemoteClientUsage - Struct _clients = ConfigWebUtil.getAsStruct("remoteClients", root); + Struct _clients = ConfigUtil.getAsStruct("remoteClients", root); // usage - Struct sct = ConfigWebUtil.getAsStruct(_clients, true, "usage");// config.setRemoteClientUsage(toStruct(strUsage)); - // TODO make this generic - if (configServer != null) { - String sync = Caster.toString(configServer.getRemoteClientUsage().get("synchronisation", ""), ""); - if (!StringUtil.isEmpty(sync)) { - sct.setEL("synchronisation", sync); - } - } + Struct sct = ConfigUtil.getAsStruct(_clients, true, "usage");// config.setRemoteClientUsage(toStruct(strUsage)); + config.setRemoteClientUsage(sct); // max-threads int maxThreads = Caster.toIntValue(getAttr(_clients, "maxThreads"), -1); - if (maxThreads < 1 && configServer != null) { - SpoolerEngineImpl engine = (SpoolerEngineImpl) configServer.getSpoolerEngine(); - if (engine != null) maxThreads = engine.getMaxThreads(); - } if (maxThreads < 1) maxThreads = 20; // directory String strDir = SystemUtil.getSystemPropOrEnvVar("lucee.task.directory", null); if (StringUtil.isEmpty(strDir)) strDir = _clients != null ? getAttr(_clients, "directory") : null; - Resource file = ConfigWebUtil.getFile(config.getRootDirectory(), strDir, "client-task", config.getConfigDir(), FileUtil.TYPE_DIR, ResourceUtil.LEVEL_GRAND_PARENT_FILE, + Resource file = ConfigUtil.getFile(config.getRootDirectory(), strDir, "client-task", config.getConfigDir(), FileUtil.TYPE_DIR, ResourceUtil.LEVEL_GRAND_PARENT_FILE, config); config.setRemoteClientDirectory(file); Array clients = null; Struct client; - if (hasAccess && _clients != null) clients = ConfigWebUtil.getAsArray("remoteClient", _clients); + if (hasAccess && _clients != null) clients = ConfigUtil.getAsArray("remoteClient", _clients); java.util.List list = new ArrayList(); if (clients != null) { @@ -3748,9 +2953,9 @@ private static void _loadRemoteClient(ConfigServerImpl configServer, ConfigImpl String label = getAttr(client, "label"); if (StringUtil.isEmpty(label)) label = url; String sUser = getAttr(client, "serverUsername"); - String sPass = ConfigWebUtil.decrypt(getAttr(client, "serverPassword")); - String aPass = ConfigWebUtil.decrypt(getAttr(client, "adminPassword")); - String aCode = ConfigWebUtil.decrypt(getAttr(client, "securityKey")); + String sPass = ConfigUtil.decrypt(getAttr(client, "serverPassword")); + String aPass = ConfigUtil.decrypt(getAttr(client, "adminPassword")); + String aCode = ConfigUtil.decrypt(getAttr(client, "securityKey")); // if(aCode!=null && aCode.indexOf('-')!=-1)continue; String usage = getAttr(client, "usage"); if (usage == null) usage = ""; @@ -3758,7 +2963,7 @@ private static void _loadRemoteClient(ConfigServerImpl configServer, ConfigImpl String pUrl = getAttr(client, "proxyServer"); int pPort = Caster.toIntValue(getAttr(client, "proxyPort"), -1); String pUser = getAttr(client, "proxyUsername"); - String pPass = ConfigWebUtil.decrypt(getAttr(client, "proxyPassword")); + String pPass = ConfigUtil.decrypt(getAttr(client, "proxyPassword")); ProxyData pd = null; if (!StringUtil.isEmpty(pUrl, true)) { pd = new ProxyDataImpl(); @@ -3795,10 +3000,6 @@ private static void _loadRemoteClient(ConfigServerImpl configServer, ConfigImpl se.setPersisDirectory(dir); se.setMaxThreads(maxThreads); } - if (config instanceof ConfigWeb) { - se.init((ConfigWeb) config); - } - } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); @@ -3806,21 +3007,9 @@ private static void _loadRemoteClient(ConfigServerImpl configServer, ConfigImpl } } - private static void _loadSystem(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadSystem(ConfigImpl config, Struct root, Log log) { try { - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); - // Struct sys = ConfigWebUtil.getAsStruct("system", root); - - boolean hasCS = configServer != null; - - // web context - if (hasCS) { - config.setOut(config.getOutWriter()); - config.setErr(config.getErrWriter()); - return; - } - String out = null, err = null; // sys prop or env var out = SystemUtil.getSystemPropOrEnvVar("lucee.system.out", null); @@ -3868,8 +3057,8 @@ else if (StringUtil.startsWithIgnoreCase(streamtype, "class:")) { else if (StringUtil.startsWithIgnoreCase(streamtype, "file:")) { String strRes = streamtype.substring(5); try { - strRes = ConfigWebUtil.translateOldPath(strRes); - Resource res = ConfigWebUtil.getFile(config, config.getConfigDir(), strRes, ResourceUtil.TYPE_FILE); + strRes = ConfigUtil.translateOldPath(strRes); + Resource res = ConfigUtil.getFile(config, config.getConfigDir(), strRes, ResourceUtil.TYPE_FILE); if (res != null) return new PrintStream(res.getOutputStream(), true); } catch (Throwable t) { @@ -3878,7 +3067,7 @@ else if (StringUtil.startsWithIgnoreCase(streamtype, "file:")) { } else if (StringUtil.startsWithIgnoreCase(streamtype, "log")) { try { - CFMLEngineFactory factory = ConfigWebUtil.getCFMLEngineFactory(config); + CFMLEngineFactory factory = ConfigUtil.getCFMLEngineFactory(config); Resource root = ResourceUtil.toResource(factory.getResourceRoot()); Resource log = root.getRealResource("context/logs/" + (iserror ? "err" : "out") + ".log"); if (!log.isFile()) { @@ -3901,30 +3090,24 @@ else if (StringUtil.startsWithIgnoreCase(streamtype, "log")) { * @param config * @param doc */ - private static void _loadCharset(ConfigServer configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadCharset(ConfigImpl config, Struct root, Log log) { try { - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); - boolean hasCS = configServer != null; // template String template = SystemUtil.getSystemPropOrEnvVar("lucee.template.charset", null); if (StringUtil.isEmpty(template)) template = getAttr(root, "templateCharset"); if (!StringUtil.isEmpty(template)) config.setTemplateCharset(template); - else if (hasCS) config.setTemplateCharset(configServer.getTemplateCharset()); // web String web = SystemUtil.getSystemPropOrEnvVar("lucee.web.charset", null); if (StringUtil.isEmpty(web)) web = getAttr(root, "webCharset"); if (!StringUtil.isEmpty(web)) config.setWebCharset(web); - else if (hasCS) config.setWebCharset(configServer.getWebCharset()); // resource String resource = null; resource = SystemUtil.getSystemPropOrEnvVar("lucee.resource.charset", null); if (StringUtil.isEmpty(resource)) resource = getAttr(root, "resourceCharset"); if (!StringUtil.isEmpty(resource)) config.setResourceCharset(resource); - else if (hasCS) config.setResourceCharset(configServer.getResourceCharset()); - } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); @@ -3932,36 +3115,27 @@ private static void _loadCharset(ConfigServer configServer, ConfigImpl config, S } } - private static void _loadQueue(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadQueue(ConfigImpl config, Struct root, Log log) { try { - // Server - if (config instanceof ConfigServerImpl) { + // max + Integer max = Caster.toInteger(SystemUtil.getSystemPropOrEnvVar("lucee.queue.max", null), null); + if (max == null) max = Caster.toInteger(getAttr(root, "requestQueueMax"), null); + config.setQueueMax(Caster.toIntValue(max, 100)); - // max - Integer max = Caster.toInteger(SystemUtil.getSystemPropOrEnvVar("lucee.queue.max", null), null); - if (max == null) max = Caster.toInteger(getAttr(root, "requestQueueMax"), null); - config.setQueueMax(Caster.toIntValue(max, 100)); + // timeout + Long timeout = Caster.toLong(SystemUtil.getSystemPropOrEnvVar("lucee.queue.timeout", null), null); + if (timeout == null) timeout = Caster.toLong(getAttr(root, "requestQueueTimeout"), null); + config.setQueueTimeout(Caster.toLongValue(timeout, 0L)); - // timeout - Long timeout = Caster.toLong(SystemUtil.getSystemPropOrEnvVar("lucee.queue.timeout", null), null); - if (timeout == null) timeout = Caster.toLong(getAttr(root, "requestQueueTimeout"), null); - config.setQueueTimeout(Caster.toLongValue(timeout, 0L)); + // enable + Boolean enable = Caster.toBoolean(SystemUtil.getSystemPropOrEnvVar("lucee.queue.enable", null), null); + if (enable == null) enable = Caster.toBoolean(getAttr(root, "requestQueueEnable"), null); + config.setQueueEnable(Caster.toBooleanValue(enable, false)); - // enable - Boolean enable = Caster.toBoolean(SystemUtil.getSystemPropOrEnvVar("lucee.queue.enable", null), null); - if (enable == null) enable = Caster.toBoolean(getAttr(root, "requestQueueEnable"), null); - config.setQueueEnable(Caster.toBooleanValue(enable, false)); + // ((ConfigServerImpl) config).setThreadQueue(new ThreadQueueImpl(config.getQueueEnable() ? + // ThreadQueuePro.MODE_ENABLED : ThreadQueuePro.MODE_DISABLED, null)); - // ((ConfigServerImpl) config).setThreadQueue(new ThreadQueueImpl(config.getQueueEnable() ? - // ThreadQueuePro.MODE_ENABLED : ThreadQueuePro.MODE_DISABLED, null)); - } - // Web - else { - config.setQueueMax(configServer.getQueueMax()); - config.setQueueTimeout(configServer.getQueueTimeout()); - config.setQueueEnable(configServer.getQueueEnable()); - } } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); @@ -3974,17 +3148,13 @@ private static void _loadQueue(ConfigServerImpl configServer, ConfigImpl config, * @param config * @param doc */ - private static void _loadRegional(ConfigServer configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadRegional(ConfigImpl config, Struct root, Log log) { try { - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); - boolean hasCS = configServer != null; - // timeZone String strTimeZone = null; strTimeZone = getAttr(root, new String[] { "timezone", "thisTimezone" }); if (!StringUtil.isEmpty(strTimeZone)) config.setTimeZone(TimeZone.getTimeZone(strTimeZone)); - else if (hasCS) config.setTimeZone(configServer.getTimeZone()); else { TimeZone def = TimeZone.getDefault(); if (def == null) { @@ -3999,7 +3169,6 @@ private static void _loadRegional(ConfigServer configServer, ConfigImpl config, // locale String strLocale = getAttr(root, new String[] { "locale", "thisLocale" }); if (!StringUtil.isEmpty(strLocale)) config.setLocale(strLocale); - else if (hasCS) config.setLocale(configServer.getLocale()); else config.setLocale(Locale.US); } catch (Throwable t) { @@ -4008,16 +3177,14 @@ private static void _loadRegional(ConfigServer configServer, ConfigImpl config, } } - private static void _loadWS(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadWS(ConfigImpl config, Struct root, Log log) { try { - Struct ws = ConfigWebUtil.getAsStruct("webservice", root); + Struct ws = ConfigUtil.getAsStruct("webservice", root); ClassDefinition cd = ws != null ? getClassDefinition(ws, "", config.getIdentification()) : null; if (cd != null && !StringUtil.isEmpty(cd.getClassName())) { config.setWSHandlerClassDefinition(cd); } - else if (configServer != null) { - config.setWSHandlerClassDefinition(configServer.getWSHandlerClassDefinition()); - } + } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); @@ -4025,11 +3192,9 @@ else if (configServer != null) { } } - private static void _loadORM(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadORM(ConfigImpl config, Struct root, Log log) { try { - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManagerImpl.TYPE_ORM); - Struct orm = ConfigWebUtil.getAsStruct("orm", root); - boolean hasCS = configServer != null; + Struct orm = ConfigUtil.getAsStruct("orm", root); // engine ClassDefinition cdDefault = new ClassDefinitionImpl(DummyORMEngine.class); @@ -4044,8 +3209,7 @@ private static void _loadORM(ConfigServerImpl configServer, ConfigImpl config, S } if (cd == null || !cd.hasClass()) { - if (configServer != null) cd = configServer.getORMEngineClass(); - else cd = cdDefault; + cd = cdDefault; } // load class (removed because this unnecessary loads the orm engine) @@ -4057,8 +3221,7 @@ private static void _loadORM(ConfigServerImpl configServer, ConfigImpl config, S config.setORMEngineClass(cd); // config - ORMConfiguration def = hasCS ? configServer.getORMConfig() : null; - ORMConfiguration ormConfig = root == null ? def : ORMConfigurationImpl.load(config, null, orm, config.getRootDirectory(), def); + ORMConfiguration ormConfig = root == null ? null : ORMConfigurationImpl.load(config, null, orm, config.getRootDirectory(), null); config.setORMConfig(ormConfig); } catch (Throwable t) { @@ -4074,10 +3237,9 @@ private static void _loadORM(ConfigServerImpl configServer, ConfigImpl config, S * @throws PageException * @throws IOException */ - private static void _loadScope(ConfigServerImpl configServer, ConfigImpl config, Struct root, int mode, Log log) { + private static void _loadScope(ConfigImpl config, Struct root, int mode, Log log) { try { - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); - boolean hasCS = configServer != null; + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); // Local Mode if (mode == ConfigPro.MODE_STRICT) { @@ -4089,7 +3251,6 @@ private static void _loadScope(ConfigServerImpl configServer, ConfigImpl config, if (hasAccess && !StringUtil.isEmpty(strLocalMode)) { config.setLocalMode(strLocalMode); } - else if (hasCS) config.setLocalMode(configServer.getLocalMode()); } // CGI readonly @@ -4097,14 +3258,12 @@ private static void _loadScope(ConfigServerImpl configServer, ConfigImpl config, if (hasAccess && !StringUtil.isEmpty(strCGIReadonly)) { config.setCGIScopeReadonly(Caster.toBooleanValue(strCGIReadonly, true)); } - else if (hasCS) config.setCGIScopeReadonly(configServer.getCGIScopeReadonly()); // Session-Type String strSessionType = getAttr(root, "sessionType"); if (hasAccess && !StringUtil.isEmpty(strSessionType)) { - config.setSessionType(AppListenerUtil.toSessionType(strSessionType, hasCS ? configServer.getSessionType() : Config.SESSION_TYPE_APPLICATION)); + config.setSessionType(AppListenerUtil.toSessionType(strSessionType, Config.SESSION_TYPE_APPLICATION)); } - else if (hasCS) config.setSessionType(configServer.getSessionType()); // Cascading if (mode == ConfigPro.MODE_STRICT) { @@ -4113,9 +3272,8 @@ private static void _loadScope(ConfigServerImpl configServer, ConfigImpl config, else { String strScopeCascadingType = getAttr(root, "scopeCascading"); if (hasAccess && !StringUtil.isEmpty(strScopeCascadingType)) { - config.setScopeCascadingType(ConfigWebUtil.toScopeCascading(strScopeCascadingType, Config.SCOPE_STANDARD)); + config.setScopeCascadingType(ConfigUtil.toScopeCascading(strScopeCascadingType, Config.SCOPE_STANDARD)); } - else if (hasCS) config.setScopeCascadingType(configServer.getScopeCascadingType()); } // cascade-to-resultset @@ -4128,7 +3286,6 @@ private static void _loadScope(ConfigServerImpl configServer, ConfigImpl config, if (hasAccess && allowImplicidQueryCall != null) { config.setAllowImplicidQueryCall(allowImplicidQueryCall.booleanValue()); } - else if (hasCS) config.setAllowImplicidQueryCall(configServer.allowImplicidQueryCall()); } // limit isdefined @@ -4141,7 +3298,7 @@ private static void _loadScope(ConfigServerImpl configServer, ConfigImpl config, if (limitEvaluation == null) limitEvaluation = Caster.toBoolean(SystemUtil.getSystemPropOrEnvVar("lucee.isdefined.limit", null), null); if (limitEvaluation == null) { - Struct security = ConfigWebUtil.getAsStruct("security", root); + Struct security = ConfigUtil.getAsStruct("security", root); if (security != null) { limitEvaluation = Caster.toBoolean(getAttr(security, "limitEvaluation"), null); } @@ -4149,7 +3306,6 @@ private static void _loadScope(ConfigServerImpl configServer, ConfigImpl config, if (hasAccess && limitEvaluation != null) { config.setLimitEvaluation(limitEvaluation.booleanValue()); } - else if (hasCS) config.setLimitEvaluation(configServer.limitEvaluation()); } // Merge url and Form @@ -4157,7 +3313,6 @@ private static void _loadScope(ConfigServerImpl configServer, ConfigImpl config, if (hasAccess && !StringUtil.isEmpty(strMergeFormAndURL)) { config.setMergeFormAndURL(toBoolean(strMergeFormAndURL, false)); } - else if (hasCS) config.setMergeFormAndURL(configServer.mergeFormAndURL()); // Client-Storage { @@ -4165,7 +3320,6 @@ private static void _loadScope(ConfigServerImpl configServer, ConfigImpl config, if (hasAccess && !StringUtil.isEmpty(clientStorage)) { config.setClientStorage(clientStorage); } - else if (hasCS) config.setClientStorage(configServer.getClientStorage()); } // Session-Storage @@ -4174,7 +3328,6 @@ private static void _loadScope(ConfigServerImpl configServer, ConfigImpl config, if (hasAccess && !StringUtil.isEmpty(sessionStorage)) { config.setSessionStorage(sessionStorage); } - else if (hasCS) config.setSessionStorage(configServer.getSessionStorage()); } // Client Timeout @@ -4182,35 +3335,31 @@ private static void _loadScope(ConfigServerImpl configServer, ConfigImpl config, if (hasAccess && !StringUtil.isEmpty(clientTimeout)) { config.setClientTimeout(clientTimeout); } - else if (hasCS) config.setClientTimeout(configServer.getClientTimeout()); // Session Timeout String sessionTimeout = getAttr(root, "sessionTimeout"); if (hasAccess && !StringUtil.isEmpty(sessionTimeout)) { config.setSessionTimeout(sessionTimeout); } - else if (hasCS) config.setSessionTimeout(configServer.getSessionTimeout()); // App Timeout String appTimeout = getAttr(root, "applicationTimeout"); if (hasAccess && !StringUtil.isEmpty(appTimeout)) { config.setApplicationTimeout(appTimeout); } - else if (hasCS) config.setApplicationTimeout(configServer.getApplicationTimeout()); // Client Type String strClientType = getAttr(root, "clientType"); if (hasAccess && !StringUtil.isEmpty(strClientType)) { config.setClientType(strClientType); } - else if (hasCS) config.setClientType(configServer.getClientType()); // Client Resource configDir = config.getConfigDir(); String strClientDirectory = getAttr(root, "clientDirectory"); if (hasAccess && !StringUtil.isEmpty(strClientDirectory)) { - strClientDirectory = ConfigWebUtil.translateOldPath(strClientDirectory); - Resource res = ConfigWebUtil.getFile(configDir, strClientDirectory, "client-scope", configDir, FileUtil.TYPE_DIR, ResourceUtil.LEVEL_PARENT_FILE, config); + strClientDirectory = ConfigUtil.translateOldPath(strClientDirectory); + Resource res = ConfigUtil.getFile(configDir, strClientDirectory, "client-scope", configDir, FileUtil.TYPE_DIR, ResourceUtil.LEVEL_PARENT_FILE, config); config.setClientScopeDir(res); } else { @@ -4221,35 +3370,30 @@ private static void _loadScope(ConfigServerImpl configServer, ConfigImpl config, if (hasAccess && !StringUtil.isEmpty(strMax)) { config.setClientScopeDirSize(ByteSizeParser.parseByteSizeDefinition(strMax, config.getClientScopeDirSize())); } - else if (hasCS) config.setClientScopeDirSize(configServer.getClientScopeDirSize()); // Session Management String strSessionManagement = getAttr(root, "sessionManagement"); if (hasAccess && !StringUtil.isEmpty(strSessionManagement)) { config.setSessionManagement(toBoolean(strSessionManagement, true)); } - else if (hasCS) config.setSessionManagement(configServer.isSessionManagement()); // Client Management String strClientManagement = getAttr(root, "clientManagement"); if (hasAccess && !StringUtil.isEmpty(strClientManagement)) { config.setClientManagement(toBoolean(strClientManagement, false)); } - else if (hasCS) config.setClientManagement(configServer.isClientManagement()); // Client Cookies String strClientCookies = getAttr(root, "clientCookies"); if (hasAccess && !StringUtil.isEmpty(strClientCookies)) { config.setClientCookies(toBoolean(strClientCookies, true)); } - else if (hasCS) config.setClientCookies(configServer.isClientCookies()); // Domain Cookies String strDomainCookies = getAttr(root, "domainCookies"); if (hasAccess && !StringUtil.isEmpty(strDomainCookies)) { config.setDomainCookies(toBoolean(strDomainCookies, false)); } - else if (hasCS) config.setDomainCookies(configServer.isDomainCookies()); // FormUrlAsStruct String formUrlAsStruct = getAttr(root, "formUrlAsStruct"); @@ -4257,7 +3401,6 @@ private static void _loadScope(ConfigServerImpl configServer, ConfigImpl config, if (hasAccess && !StringUtil.isEmpty(formUrlAsStruct)) { config.setFormUrlAsStruct(toBoolean(formUrlAsStruct, true)); } - else if (hasCS) config.setFormUrlAsStruct(configServer.getFormUrlAsStruct()); } catch (Throwable t) { @@ -4266,22 +3409,17 @@ private static void _loadScope(ConfigServerImpl configServer, ConfigImpl config, } } - private static void _loadJava(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadJava(ConfigImpl config, Struct root, Log log) { try { - boolean hasCS = configServer != null; String strInspectTemplate = getAttr(root, "inspectTemplate"); int inspectTemplateAutoIntervalSlow = Caster.toIntValue(getAttr(root, "inspectTemplateIntervalSlow"), ConfigPro.INSPECT_INTERVAL_SLOW); int inspectTemplateAutoIntervalFast = Caster.toIntValue(getAttr(root, "inspectTemplateIntervalFast"), ConfigPro.INSPECT_INTERVAL_FAST); if (!StringUtil.isEmpty(strInspectTemplate, true)) { - config.setInspectTemplate(ConfigWebUtil.inspectTemplate(strInspectTemplate, ConfigPro.INSPECT_AUTO)); + config.setInspectTemplate(ConfigUtil.inspectTemplate(strInspectTemplate, ConfigPro.INSPECT_AUTO)); config.setInspectTemplateAutoInterval(inspectTemplateAutoIntervalSlow, inspectTemplateAutoIntervalFast); } - else if (hasCS) { - config.setInspectTemplate(configServer.getInspectTemplate()); - config.setInspectTemplateAutoInterval(configServer.getInspectTemplateAutoInterval(true), configServer.getInspectTemplateAutoInterval(false)); - } String strCompileType = getAttr(root, "compileType"); if (!StringUtil.isEmpty(strCompileType)) { @@ -4293,9 +3431,6 @@ else if (strCompileType.equals("always")) { config.setCompileType(Config.RECOMPILE_ALWAYS); } } - else if (hasCS) { - config.setCompileType(configServer.getCompileType()); - } } catch (Throwable t) { @@ -4304,7 +3439,7 @@ else if (hasCS) { } } - private static void _loadJavaSettings(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadJavaSettings(ConfigImpl config, Struct root, Log log) { try { if (config instanceof ConfigServerImpl) { @@ -4312,7 +3447,7 @@ private static void _loadJavaSettings(ConfigServerImpl configServer, ConfigImpl Resource[] libs = lib.listResources(ExtensionResourceFilter.EXTENSION_JAR_NO_DIR); ConfigServerImpl csi = (ConfigServerImpl) config; - Struct javasettings = ConfigWebUtil.getAsStruct(root, false, "javasettings"); + Struct javasettings = ConfigUtil.getAsStruct(root, false, "javasettings"); if (javasettings != null && javasettings.size() > 0) { JavaSettings js = JavaSettingsImpl.getInstance(config, javasettings, libs); @@ -4326,17 +3461,13 @@ private static void _loadJavaSettings(ConfigServerImpl configServer, ConfigImpl } } - private static void _loadConstants(ConfigServerImpl configServer, ConfigImpl config, Struct root) { + private static void _loadConstants(ConfigImpl config, Struct root) { try { - boolean hasCS = configServer != null; - Struct constants = ConfigWebUtil.getAsStruct("constants", root); + Struct constants = ConfigUtil.getAsStruct("constants", root); // Constants Struct sct = null; - if (hasCS) { - sct = configServer.getConstants(); - if (sct != null) sct = (Struct) sct.duplicate(false); - } + if (sct == null) sct = new StructImpl(); Key name; if (constants != null) { @@ -4382,19 +3513,18 @@ public static void log(Config config, Log log, Throwable e) { } } - private static void _loadLogin(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadLogin(ConfigImpl config, Struct root, Log log) { try { // server context - if (config instanceof ConfigServer) { - boolean captcha = Caster.toBooleanValue(getAttr(root, "loginCaptcha"), false); - boolean rememberme = Caster.toBooleanValue(getAttr(root, "loginRememberme"), true); + boolean captcha = Caster.toBooleanValue(getAttr(root, "loginCaptcha"), false); + boolean rememberme = Caster.toBooleanValue(getAttr(root, "loginRememberme"), true); + + int delay = Caster.toIntValue(getAttr(root, "loginDelay"), 1); + ConfigServerImpl cs = (ConfigServerImpl) config; + cs.setLoginDelay(delay); + cs.setLoginCaptcha(captcha); + cs.setRememberMe(rememberme); - int delay = Caster.toIntValue(getAttr(root, "loginDelay"), 1); - ConfigServerImpl cs = (ConfigServerImpl) config; - cs.setLoginDelay(delay); - cs.setLoginCaptcha(captcha); - cs.setRememberMe(rememberme); - } } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); @@ -4402,9 +3532,9 @@ private static void _loadLogin(ConfigServerImpl configServer, ConfigImpl config, } } - private static void _loadStartupHook(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadStartupHook(ConfigImpl config, Struct root, Log log) { try { - Array children = ConfigWebUtil.getAsArray("startupHooks", root); + Array children = ConfigUtil.getAsArray("startupHooks", root); if (children == null || children.size() == 0) return; @@ -4461,11 +3591,9 @@ private static void _loadStartupHook(ConfigServerImpl configServer, ConfigImpl c * @param doc * @throws IOException */ - private static void _loadMail(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { // does no init values + private static void _loadMail(ConfigImpl config, Struct root, Log log) { // does no init values try { - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); - - boolean hasCS = configServer != null; + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_MAIL); // Send partial { @@ -4473,7 +3601,6 @@ private static void _loadMail(ConfigServerImpl configServer, ConfigImpl config, if (!StringUtil.isEmpty(strSendPartial) && hasAccess) { config.setMailSendPartial(toBoolean(strSendPartial, false)); } - else if (hasCS) config.setMailSendPartial(configServer.isMailSendPartial()); } // User set { @@ -4481,7 +3608,6 @@ private static void _loadMail(ConfigServerImpl configServer, ConfigImpl config, if (!StringUtil.isEmpty(strUserSet) && hasAccess) { config.setUserSet(toBoolean(strUserSet, false)); } - else if (hasCS) config.setUserSet(configServer.isUserset()); } // Spool Interval @@ -4489,45 +3615,25 @@ private static void _loadMail(ConfigServerImpl configServer, ConfigImpl config, if (!StringUtil.isEmpty(strSpoolInterval) && hasAccess) { config.setMailSpoolInterval(Caster.toIntValue(strSpoolInterval, 30)); } - else if (hasCS) config.setMailSpoolInterval(configServer.getMailSpoolInterval()); String strEncoding = getAttr(root, "mailDefaultEncoding"); if (!StringUtil.isEmpty(strEncoding) && hasAccess) config.setMailDefaultEncoding(strEncoding); - else if (hasCS) config.setMailDefaultEncoding(configServer.getMailDefaultCharset()); // Spool Enable String strSpoolEnable = getAttr(root, "mailSpoolEnable"); if (!StringUtil.isEmpty(strSpoolEnable) && hasAccess) { config.setMailSpoolEnable(toBoolean(strSpoolEnable, false)); } - else if (hasCS) config.setMailSpoolEnable(configServer.isMailSpoolEnable()); // Timeout String strTimeout = getAttr(root, "mailConnectionTimeout"); if (!StringUtil.isEmpty(strTimeout) && hasAccess) { config.setMailTimeout(Caster.toIntValue(strTimeout, 60)); } - else if (hasCS) config.setMailTimeout(configServer.getMailTimeout()); // Servers - int index = 0; - // Server[] servers = null; - Array elServers = ConfigWebUtil.getAsArray("mailServers", root); + Array elServers = ConfigUtil.getAsArray("mailServers", root); List servers = new ArrayList(); - if (hasCS) { - Server[] readOnlyServers = configServer.getMailServers(); - if (readOnlyServers != null) { - for (int i = 0; i < readOnlyServers.length; i++) { - try { - servers.add(readOnlyServers[index++].cloneReadOnly()); - } - catch (Throwable t) { - ExceptionUtil.rethrowIfNecessary(t); - log(config, log, t); - } - } - } - } // TODO get mail servers from env var if (hasAccess) { Iterator it = elServers.getIterator(); @@ -4540,9 +3646,9 @@ private static void _loadMail(ConfigServerImpl configServer, ConfigImpl config, i++; servers.add(i, new ServerImpl(Caster.toIntValue(getAttr(el, "id"), i + 1), getAttr(el, "smtp"), Caster.toIntValue(getAttr(el, "port"), 25), - getAttr(el, "username"), ConfigWebUtil.decrypt(getAttr(el, "password")), toLong(getAttr(el, "life"), 1000 * 60 * 5), + getAttr(el, "username"), ConfigUtil.decrypt(getAttr(el, "password")), toLong(getAttr(el, "life"), 1000 * 60 * 5), toLong(getAttr(el, "idle"), 1000 * 60 * 1), toBoolean(getAttr(el, "tls"), false), toBoolean(getAttr(el, "ssl"), false), - toBoolean(getAttr(el, "reuseConnection"), true), hasCS ? ServerImpl.TYPE_LOCAL : ServerImpl.TYPE_GLOBAL)); + toBoolean(getAttr(el, "reuseConnection"), true), ServerImpl.TYPE_GLOBAL)); } catch (Throwable t) { @@ -4559,16 +3665,15 @@ private static void _loadMail(ConfigServerImpl configServer, ConfigImpl config, } } - private static void _loadMonitors(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadMonitors(ConfigImpl config, Struct root, Log log) { try { // only load in server context - if (configServer != null) return; - configServer = (ConfigServerImpl) config; - Struct parent = ConfigWebUtil.getAsStruct("monitoring", root); + ConfigServerImpl configServer = (ConfigServerImpl) config; + Struct parent = ConfigUtil.getAsStruct("monitoring", root); Boolean enabled = Caster.toBoolean(getAttr(parent, "enabled"), null); if (enabled != null) configServer.setMonitoringEnabled(enabled.booleanValue()); - Array children = ConfigWebUtil.getAsArray("monitor", parent); + Array children = ConfigUtil.getAsArray("monitor", parent); java.util.List intervalls = new ArrayList(); java.util.List requests = new ArrayList(); @@ -4652,22 +3757,20 @@ else if (type == Monitor.TYPE_ACTION) { * @param doc * @throws PageException */ - private static void _loadSearch(ConfigServer configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadSearch(ConfigImpl config, Struct root, Log log) { try { - Struct search = ConfigWebUtil.getAsStruct("search", root); + Struct search = ConfigUtil.getAsStruct("search", root); // class ClassDefinition cd = search != null ? getClassDefinition(search, "engine", config.getIdentification()) : null; if (cd == null || !cd.hasClass() || "lucee.runtime.search.lucene.LuceneSearchEngine".equals(cd.getClassName())) { - if (configServer != null) cd = (configServer).getSearchEngineClassDefinition(); - else cd = new ClassDefinitionImpl(DummySearchEngine.class); + cd = new ClassDefinitionImpl(DummySearchEngine.class); } // directory String dir = search != null ? getAttr(search, "directory") : null; if (StringUtil.isEmpty(dir)) { - if (configServer != null) dir = (configServer).getSearchEngineDirectory(); - else dir = "{lucee-web}/search/"; + dir = "{lucee-web}/search/"; } config.setSearchEngine(cd, dir); @@ -4686,17 +3789,10 @@ private static void _loadSearch(ConfigServer configServer, ConfigImpl config, St * @throws IOException * @throws PageException */ - private static void _loadScheduler(ConfigServer configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadScheduler(ConfigImpl config, Struct root, Log log) { try { - if (config instanceof ConfigServer) { - short mode = ((ConfigServerImpl) config).getAdminMode(); - // short mode = ConfigWebUtil.toAdminMode(getAttr(root, "mode"), ConfigImpl.ADMINMODE_SINGLE); - if (mode == ConfigImpl.ADMINMODE_MULTI) return; - } - - Resource configDir = config.getConfigDir(); - Array scheduledTasks = ConfigWebUtil.getAsArray("scheduledTasks", root); - config.setScheduler(configServer != null ? configServer.getEngine() : ((ConfigServer) config).getEngine(), scheduledTasks); + Array scheduledTasks = ConfigUtil.getAsArray("scheduledTasks", root); + config.setScheduler(((ConfigServer) config).getEngine(), scheduledTasks); } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); @@ -4709,27 +3805,14 @@ private static void _loadScheduler(ConfigServer configServer, ConfigImpl config, * @param config * @param doc */ - private static void _loadDebug(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadDebug(ConfigImpl config, Struct root, Log log) { try { - boolean hasCS = configServer != null; - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING); // Entries // Struct debugging = ConfigWebUtil.getAsStruct("debugging", root); - Array entries = ConfigWebUtil.getAsArray("debugTemplates", root); + Array entries = ConfigUtil.getAsArray("debugTemplates", root); Map list = new HashMap(); - if (hasCS) { - DebugEntry[] _entries = configServer.getDebugEntries(); - for (int i = 0; i < _entries.length; i++) { - try { - list.put(_entries[i].getId(), _entries[i].duplicate(true)); - } - catch (Throwable t) { - ExceptionUtil.rethrowIfNecessary(t); - log(config, log, t); - } - } - } String id; if (entries != null) { Iterator it = entries.getIterator(); @@ -4740,7 +3823,7 @@ private static void _loadDebug(ConfigServerImpl configServer, ConfigImpl config, if (e == null) continue; id = getAttr(e, "id"); list.put(id, new DebugEntry(id, getAttr(e, "type"), getAttr(e, "iprange"), getAttr(e, "label"), getAttr(e, "path"), getAttr(e, "fullname"), - ConfigWebUtil.getAsStruct(e, true, "custom"))); + ConfigUtil.getAsStruct(e, true, "custom"))); } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); @@ -4752,12 +3835,11 @@ private static void _loadDebug(ConfigServerImpl configServer, ConfigImpl config, { // monitoring debug String str = getAttr(root, "showDebug"); - if (!hasCS && StringUtil.isEmpty(str, true)) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.showDebug", null); + if (StringUtil.isEmpty(str, true)) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.showDebug", null); if (hasAccess && !StringUtil.isEmpty(str)) { config.setShowDebug(toBoolean(str, false)); } - else if (hasCS) config.setShowDebug(configServer.getShowDebug()); // monitoring doc str = getAttr(root, "showDoc"); @@ -4765,120 +3847,108 @@ private static void _loadDebug(ConfigServerImpl configServer, ConfigImpl config, if (StringUtil.isEmpty(str, true)) str = getAttr(root, "doc"); if (StringUtil.isEmpty(str, true)) str = getAttr(root, "documentation"); if (StringUtil.isEmpty(str, true)) str = getAttr(root, "reference"); - if (!hasCS && StringUtil.isEmpty(str, true)) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.showDoc", null); + if (StringUtil.isEmpty(str, true)) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.showDoc", null); if (hasAccess && !StringUtil.isEmpty(str)) { config.setShowDoc(toBoolean(str, false)); } - else if (hasCS) config.setShowDoc(configServer.getShowDoc()); // monitoring metric str = getAttr(root, "showMetric"); if (StringUtil.isEmpty(str, true)) str = getAttr(root, "showMetrics"); if (StringUtil.isEmpty(str, true)) str = getAttr(root, "metric"); if (StringUtil.isEmpty(str, true)) str = getAttr(root, "metrics"); - if (!hasCS && StringUtil.isEmpty(str, true)) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.showMetric", null); + if (StringUtil.isEmpty(str, true)) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.showMetric", null); if (hasAccess && !StringUtil.isEmpty(str)) { config.setShowMetric(toBoolean(str, false)); } - else if (hasCS) config.setShowMetric(configServer.getShowMetric()); // monitoring test str = getAttr(root, "showTest"); if (StringUtil.isEmpty(str, true)) str = getAttr(root, "showTests"); if (StringUtil.isEmpty(str, true)) str = getAttr(root, "test"); - if (!hasCS && StringUtil.isEmpty(str, true)) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.showTest", null); + if (StringUtil.isEmpty(str, true)) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.showTest", null); if (hasAccess && !StringUtil.isEmpty(str)) { config.setShowTest(toBoolean(str, false)); } - else if (hasCS) config.setShowTest(configServer.getShowTest()); } // debug-log-output String strDLO = getAttr(root, "debuggingLogOutput"); if (hasAccess && !StringUtil.isEmpty(strDLO)) { config.setDebugLogOutput(toBoolean(strDLO, false) ? ConfigImpl.CLIENT_BOOLEAN_TRUE : ConfigImpl.CLIENT_BOOLEAN_FALSE); } - else if (hasCS) config.setDebugLogOutput(configServer.debugLogOutput() ? ConfigImpl.SERVER_BOOLEAN_TRUE : ConfigImpl.SERVER_BOOLEAN_FALSE); // debug options - String strDebugOption = hasCS ? null : SystemUtil.getSystemPropOrEnvVar("lucee.debugging.options", null); + String strDebugOption = SystemUtil.getSystemPropOrEnvVar("lucee.debugging.options", null); String[] debugOptions = StringUtil.isEmpty(strDebugOption) ? null : ListUtil.listToStringArray(strDebugOption, ','); int options = 0; String str = getAttr(root, "debuggingDatabase"); if (StringUtil.isEmpty(str)) str = getAttr(root, "debuggingShowDatabase"); - if (StringUtil.isEmpty(str) && !hasCS) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.debuggingDatabase", null); + if (StringUtil.isEmpty(str)) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.debuggingDatabase", null); if (hasAccess && !StringUtil.isEmpty(str)) { if (toBoolean(str, false)) options += ConfigPro.DEBUG_DATABASE; } else if (debugOptions != null && extractDebugOption("database", debugOptions)) options += ConfigPro.DEBUG_DATABASE; - else if (hasCS && configServer.hasDebugOptions(ConfigPro.DEBUG_DATABASE)) options += ConfigPro.DEBUG_DATABASE; str = getAttr(root, "debuggingException"); if (StringUtil.isEmpty(str)) str = getAttr(root, "debuggingShowException"); - if (StringUtil.isEmpty(str) && !hasCS) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.debuggingException", null); + if (StringUtil.isEmpty(str)) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.debuggingException", null); if (hasAccess && !StringUtil.isEmpty(str)) { if (toBoolean(str, false)) options += ConfigPro.DEBUG_EXCEPTION; } else if (debugOptions != null && extractDebugOption("exception", debugOptions)) options += ConfigPro.DEBUG_EXCEPTION; - else if (hasCS && configServer.hasDebugOptions(ConfigPro.DEBUG_EXCEPTION)) options += ConfigPro.DEBUG_EXCEPTION; str = getAttr(root, "debuggingTemplate"); if (StringUtil.isEmpty(str)) str = getAttr(root, "debuggingShowTemplate"); - if (StringUtil.isEmpty(str) && !hasCS) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.debuggingTemplate", null); + if (StringUtil.isEmpty(str)) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.debuggingTemplate", null); if (hasAccess && !StringUtil.isEmpty(str)) { if (toBoolean(str, false)) options += ConfigPro.DEBUG_TEMPLATE; } else if (debugOptions != null && extractDebugOption("template", debugOptions)) options += ConfigPro.DEBUG_TEMPLATE; - else if (hasCS && configServer.hasDebugOptions(ConfigPro.DEBUG_TEMPLATE)) options += ConfigPro.DEBUG_TEMPLATE; str = getAttr(root, "debuggingDump"); if (StringUtil.isEmpty(str)) str = getAttr(root, "debuggingShowDump"); - if (StringUtil.isEmpty(str) && !hasCS) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.debuggingDump", null); + if (StringUtil.isEmpty(str)) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.debuggingDump", null); if (hasAccess && !StringUtil.isEmpty(str)) { if (toBoolean(str, false)) options += ConfigPro.DEBUG_DUMP; } else if (debugOptions != null && extractDebugOption("dump", debugOptions)) options += ConfigPro.DEBUG_DUMP; - else if (hasCS && configServer.hasDebugOptions(ConfigPro.DEBUG_DUMP)) options += ConfigPro.DEBUG_DUMP; str = getAttr(root, "debuggingTracing"); if (StringUtil.isEmpty(str)) str = getAttr(root, "debuggingShowTracing"); if (StringUtil.isEmpty(str)) str = getAttr(root, "debuggingShowTrace"); - if (StringUtil.isEmpty(str) && !hasCS) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.debuggingTracing", null); + if (StringUtil.isEmpty(str)) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.debuggingTracing", null); if (hasAccess && !StringUtil.isEmpty(str)) { if (toBoolean(str, false)) options += ConfigPro.DEBUG_TRACING; } else if (debugOptions != null && extractDebugOption("tracing", debugOptions)) options += ConfigPro.DEBUG_TRACING; - else if (hasCS && configServer.hasDebugOptions(ConfigPro.DEBUG_TRACING)) options += ConfigPro.DEBUG_TRACING; str = getAttr(root, "debuggingTimer"); if (StringUtil.isEmpty(str)) str = getAttr(root, "debuggingShowTimer"); - if (StringUtil.isEmpty(str) && !hasCS) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.debuggingTimer", null); + if (StringUtil.isEmpty(str)) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.debuggingTimer", null); if (hasAccess && !StringUtil.isEmpty(str)) { if (toBoolean(str, false)) options += ConfigPro.DEBUG_TIMER; } else if (debugOptions != null && extractDebugOption("timer", debugOptions)) options += ConfigPro.DEBUG_TIMER; - else if (hasCS && configServer.hasDebugOptions(ConfigPro.DEBUG_TIMER)) options += ConfigPro.DEBUG_TIMER; str = getAttr(root, "debuggingImplicitAccess"); if (StringUtil.isEmpty(str)) str = getAttr(root, "debuggingShowImplicitAccess"); - if (StringUtil.isEmpty(str) && !hasCS) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.debuggingImplicitAccess", null); + if (StringUtil.isEmpty(str)) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.debuggingImplicitAccess", null); if (hasAccess && !StringUtil.isEmpty(str)) { if (toBoolean(str, false)) options += ConfigPro.DEBUG_IMPLICIT_ACCESS; } else if (debugOptions != null && extractDebugOption("implicit-access", debugOptions)) options += ConfigPro.DEBUG_IMPLICIT_ACCESS; - else if (hasCS && configServer.hasDebugOptions(ConfigPro.DEBUG_IMPLICIT_ACCESS)) options += ConfigPro.DEBUG_IMPLICIT_ACCESS; str = getAttr(root, "debuggingQueryUsage"); if (StringUtil.isEmpty(str)) str = getAttr(root, "debuggingShowQueryUsage"); - if (StringUtil.isEmpty(str) && !hasCS) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.debuggingQueryUsage", null); + if (StringUtil.isEmpty(str)) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.debuggingQueryUsage", null); if (hasAccess && !StringUtil.isEmpty(str)) { if (toBoolean(str, false)) options += ConfigPro.DEBUG_QUERY_USAGE; } else if (debugOptions != null && extractDebugOption("queryUsage", debugOptions)) options += ConfigPro.DEBUG_QUERY_USAGE; - else if (hasCS && configServer.hasDebugOptions(ConfigPro.DEBUG_QUERY_USAGE)) options += ConfigPro.DEBUG_QUERY_USAGE; str = getAttr(root, "debuggingThread"); - if (StringUtil.isEmpty(str) && !hasCS) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.debuggingThread", null); + if (StringUtil.isEmpty(str)) str = SystemUtil.getSystemPropOrEnvVar("lucee.monitoring.debuggingThread", null); if (hasAccess && !StringUtil.isEmpty(str)) { if (toBoolean(str, false)) options += ConfigPro.DEBUG_THREAD; } @@ -4889,7 +3959,6 @@ private static void _loadDebug(ConfigServerImpl configServer, ConfigImpl config, if (hasAccess && !StringUtil.isEmpty(strMax)) { config.setDebugMaxRecordsLogged(Caster.toIntValue(strMax, 10)); } - else if (hasCS) config.setDebugMaxRecordsLogged(configServer.getDebugMaxRecordsLogged()); config.setDebugOptions(options); } @@ -4911,34 +3980,17 @@ private static boolean extractDebugOption(String name, String[] values) { * @param config * @param doc */ - private static void _loadCFX(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadCFX(ConfigImpl config, Struct root, Log log) { try { - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_CFX_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_CFX_SETTING); Map map = MapFactory.getConcurrentMap(); - if (configServer != null) { - try { - if (configServer.getCFXTagPool() != null) { - Map classes = configServer.getCFXTagPool().getClasses(); - Iterator> it = classes.entrySet().iterator(); - Entry e; - while (it.hasNext()) { - e = it.next(); - map.put(e.getKey(), e.getValue().cloneReadOnly()); - } - } - } - catch (SecurityException e) { - } - } if (hasAccess) { - if (configServer == null) { - System.setProperty("cfx.bin.path", config.getConfigDir().getRealResource("bin").getAbsolutePath()); - } + System.setProperty("cfx.bin.path", config.getConfigDir().getRealResource("bin").getAbsolutePath()); // Java CFX Tags - Struct cfxs = ConfigWebUtil.getAsStruct("cfx", root); + Struct cfxs = ConfigUtil.getAsStruct("cfx", root); Iterator> it = cfxs.entryIterator(); Struct cfxTag; Entry entry; @@ -4983,15 +4035,15 @@ private static void _loadCFX(ConfigServerImpl configServer, ConfigImpl config, S * @param doc * @param log */ - private static void _loadExtensionBundles(ConfigServerImpl cs, ConfigImpl config, Struct root, Log log) { + private static void _loadExtensionBundles(ConfigImpl config, Struct root, Log log) { Log deployLog = config.getLog("deploy"); if (deployLog != null) log = deployLog; try { boolean changed = false; if (config instanceof ConfigServer) { - changed = ConfigFactory.modeChange(config.getConfigDir(), config.getAdminMode() == ConfigImpl.ADMINMODE_MULTI ? "multi" : "single", false); + changed = ConfigFactory.modeChange(config.getConfigDir(), "single", false); } - Array children = ConfigWebUtil.getAsArray("extensions", root); + Array children = ConfigUtil.getAsArray("extensions", root); String md5 = CollectionUtil.md5(children); if (!changed) { if (md5.equals(config.getExtensionsMD5())) { @@ -5009,12 +4061,10 @@ private static void _loadExtensionBundles(ConfigServerImpl cs, ConfigImpl config log(config, log, t); } - String strBundles; List extensions = new ArrayList(); RHExtension rhe; Iterator it = children.valueIterator(); - Entry e; Struct child; String id; Set installedFiles = new HashSet<>(); @@ -5024,7 +4074,6 @@ private static void _loadExtensionBundles(ConfigServerImpl cs, ConfigImpl config child = Caster.toStruct(it.next(), null); if (child == null) continue; id = Caster.toString(child.get(KeyConstants._id, null), null); - BundleInfo[] bfsq; try { String res = Caster.toString(child.get(KeyConstants._resource, null), null); if (StringUtil.isEmpty(res)) res = Caster.toString(child.get(KeyConstants._path, null), null); @@ -5097,13 +4146,13 @@ private static void _loadExtensionBundles(ConfigServerImpl cs, ConfigImpl config } } - private static void _loadExtensionDefinition(ConfigServerImpl cs, ConfigImpl config, Struct root, Log log) { + private static void _loadExtensionDefinition(ConfigImpl config, Struct root, Log log) { if (!(config instanceof ConfigServer)) return; try { Log deployLog = config.getLog("deploy"); if (deployLog != null) log = deployLog; - Array children = ConfigWebUtil.getAsArray("extensions", root); + Array children = ConfigUtil.getAsArray("extensions", root); // set Map child; Struct childSct; @@ -5134,14 +4183,13 @@ private static void _loadExtensionDefinition(ConfigServerImpl cs, ConfigImpl con } } - private static void _loadExtensionProviders(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadExtensionProviders(ConfigImpl config, Struct root, Log log) { try { // RH Providers { // providers - Array xmlProviders = ConfigWebUtil.getAsArray("extensionProviders", root); - String strProvider; + Array xmlProviders = ConfigUtil.getAsArray("extensionProviders", root); Map providers = new LinkedHashMap(); for (int i = 0; i < Constants.RH_EXTENSION_PROVIDERS.length; i++) { @@ -5158,7 +4206,7 @@ private static void _loadExtensionProviders(ConfigServerImpl configServer, Confi providers.put(new RHExtensionProvider(url.trim(), false), ""); } catch (MalformedURLException e) { - LogUtil.logGlobal(ThreadLocalPageContext.getConfig(configServer == null ? config : configServer), ConfigWebFactory.class.getName(), e); + LogUtil.logGlobal(ThreadLocalPageContext.getConfig(config), ConfigWebFactory.class.getName(), e); } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); @@ -5181,26 +4229,18 @@ private static void _loadExtensionProviders(ConfigServerImpl configServer, Confi * @param doc * @throws IOException */ - private static void _loadComponent(ConfigServer configServer, ConfigImpl config, Struct root, int mode, Log log) { + private static void _loadComponent(ConfigImpl config, Struct root, int mode, Log log) { try { - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); boolean hasSet = false; - boolean hasCS = configServer != null; if (hasAccess) { // component default return format String strRF = getAttr(root, "returnFormat"); if (!StringUtil.isEmpty(strRF, true)) config.setReturnFormat(UDFUtil.toReturnFormat(strRF, UDF.RETURN_FORMAT_WDDX)); - else if (configServer != null) { - ConfigServerImpl csi = (ConfigServerImpl) configServer; - config.setReturnFormat(csi.getReturnFormat()); - } // component-default-import String strCDI = getAttr(root, "componentAutoImport"); - if (StringUtil.isEmpty(strCDI, true) && configServer != null) { - strCDI = ((ConfigServerImpl) configServer).getComponentDefaultImport().toString(); - } if (!StringUtil.isEmpty(strCDI, true)) config.setComponentDefaultImport(strCDI); // Base CFML @@ -5215,16 +4255,12 @@ else if (configServer != null) { if (!StringUtil.isEmpty(strDeepSearch)) { config.setDoComponentDeepSearch(Caster.toBooleanValue(strDeepSearch.trim(), false)); } - else if (hasCS) { - config.setDoComponentDeepSearch(((ConfigServerImpl) configServer).doComponentDeepSearch()); - } } // Dump-Template String strDumpRemplate = getAttr(root, "componentDumpTemplate"); if (StringUtil.isEmpty(strDumpRemplate, true)) { - if (configServer != null) strDumpRemplate = configServer.getComponentDumpTemplate(); - else strDumpRemplate = "/lucee/component-dump.cfm"; + strDumpRemplate = "/lucee/component-dump.cfm"; } config.setComponentDumpTemplate(strDumpRemplate.trim()); @@ -5241,9 +4277,6 @@ else if (hasCS) { else if (strDmda.equals("package")) config.setComponentDataMemberDefaultAccess(Component.ACCESS_PACKAGE); else if (strDmda.equals("private")) config.setComponentDataMemberDefaultAccess(Component.ACCESS_PRIVATE); } - else if (configServer != null) { - config.setComponentDataMemberDefaultAccess(configServer.getComponentDataMemberDefaultAccess()); - } } // trigger-properties @@ -5253,9 +4286,7 @@ else if (configServer != null) { else { Boolean tp = Caster.toBoolean(getAttr(root, "componentImplicitNotation"), null); if (tp != null) config.setTriggerComponentDataMember(tp.booleanValue()); - else if (configServer != null) { - config.setTriggerComponentDataMember(configServer.getTriggerComponentDataMember()); - } + } // local search @@ -5265,17 +4296,12 @@ else if (configServer != null) { else { Boolean ls = Caster.toBoolean(getAttr(root, "componentLocalSearch"), null); if (ls != null) config.setComponentLocalSearch(ls.booleanValue()); - else if (configServer != null) { - config.setComponentLocalSearch(((ConfigServerImpl) configServer).getComponentLocalSearch()); - } + } // use cache path Boolean ucp = Caster.toBoolean(getAttr(root, "componentUseCachePath"), null); if (ucp != null) config.setUseComponentPathCache(ucp.booleanValue()); - else if (configServer != null) { - config.setUseComponentPathCache(((ConfigServerImpl) configServer).useComponentPathCache()); - } // use component shadow if (mode == ConfigPro.MODE_STRICT) { @@ -5284,23 +4310,9 @@ else if (configServer != null) { else { Boolean ucs = Caster.toBoolean(getAttr(root, "componentUseVariablesScope"), null); if (ucs != null) config.setUseComponentShadow(ucs.booleanValue()); - else if (configServer != null) { - config.setUseComponentShadow(configServer.useComponentShadow()); - } - } - } - else if (configServer != null) { - config.setBaseComponentTemplate(((ConfigPro) configServer).getBaseComponentTemplate()); - config.setComponentDumpTemplate(configServer.getComponentDumpTemplate()); - if (mode == ConfigPro.MODE_STRICT) { - config.setComponentDataMemberDefaultAccess(Component.ACCESS_PRIVATE); - config.setTriggerComponentDataMember(true); - } - else { - config.setComponentDataMemberDefaultAccess(configServer.getComponentDataMemberDefaultAccess()); - config.setTriggerComponentDataMember(configServer.getTriggerComponentDataMember()); } + } if (mode == ConfigPro.MODE_STRICT) { @@ -5313,7 +4325,7 @@ else if (configServer != null) { } // Web Mapping - Array compMappings = ConfigWebUtil.getAsArray("componentMappings", root); + Array compMappings = ConfigUtil.getAsArray("componentMappings", root); hasSet = false; Mapping[] mappings = null; if (hasAccess) { @@ -5335,12 +4347,12 @@ else if (configServer != null) { String strListMode = getAttr(cMapping, "listenerMode"); if (StringUtil.isEmpty(strListMode)) strListMode = getAttr(cMapping, "listener-mode"); if (StringUtil.isEmpty(strListMode)) strListMode = getAttr(cMapping, "listenermode"); - int listMode = ConfigWebUtil.toListenerMode(strListMode, -1); + int listMode = ConfigUtil.toListenerMode(strListMode, -1); String strListType = getAttr(cMapping, "listenerType"); if (StringUtil.isEmpty(strListType)) strListMode = getAttr(cMapping, "listener-type"); if (StringUtil.isEmpty(strListType)) strListMode = getAttr(cMapping, "listenertype"); - int listType = ConfigWebUtil.toListenerType(strListType, -1); + int listType = ConfigUtil.toListenerType(strListType, -1); short inspTemp = inspectTemplate(cMapping); int insTempSlow = Caster.toIntValue(getAttr(cMapping, "inspectTemplateIntervalSlow"), -1); @@ -5361,51 +4373,13 @@ else if (configServer != null) { mappings = list.toArray(new Mapping[list.size()]); config.setComponentMappings(mappings); } - else if (!hasCS) { + else { // we make sure we always have that mapping config.setComponentMappings(new Mapping[] { new MappingImpl(config, "/default-component", "{lucee-config}/components/", null, ConfigPro.INSPECT_UNDEFINED, ConfigPro.INSPECT_INTERVAL_UNDEFINED, ConfigPro.INSPECT_INTERVAL_UNDEFINED, true, true, true, true, false, true, null, -1, -1) }); } } - // Server Mapping - if (hasCS) { - Mapping[] originals = ((ConfigServerImpl) configServer).getComponentMappings(); - Mapping[] clones = new Mapping[originals.length]; - LinkedHashMap map = new LinkedHashMap(); - Mapping m; - for (int i = 0; i < clones.length; i++) { - try { - m = ((MappingImpl) originals[i]).cloneReadOnly(config); - map.put(toKey(m), m); - } - catch (Throwable t) { - ExceptionUtil.rethrowIfNecessary(t); - log(config, log, t); - } - } - - if (mappings != null) { - for (int i = 0; i < mappings.length; i++) { - m = mappings[i]; - map.put(toKey(m), m); - } - } - if (originals.length > 0) { - clones = new Mapping[map.size()]; - Iterator it = map.entrySet().iterator(); - Map.Entry entry; - int index = 0; - while (it.hasNext()) { - entry = (Entry) it.next(); - clones[index++] = (Mapping) entry.getValue(); - // print.out("c:"+clones[index-1]); - } - hasSet = true; - config.setComponentMappings(clones); - } - } - if (!hasSet) { MappingImpl m = new MappingImpl(config, "/default", "{lucee-config}/components/", null, ConfigPro.INSPECT_UNDEFINED, ConfigPro.INSPECT_INTERVAL_UNDEFINED, ConfigPro.INSPECT_INTERVAL_UNDEFINED, true, false, false, true, false, true, null, -1, -1); @@ -5419,11 +4393,10 @@ else if (!hasCS) { } } - private static void _loadProxy(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadProxy(ConfigImpl config, Struct root, Log log) { try { - boolean hasCS = configServer != null; - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); - Struct proxy = ConfigWebUtil.getAsStruct("proxy", root); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + Struct proxy = ConfigUtil.getAsStruct("proxy", root); // proxy server boolean enabled = Caster.toBooleanValue(getAttr(proxy, "enabled"), true); @@ -5443,7 +4416,6 @@ private static void _loadProxy(ConfigServerImpl configServer, ConfigImpl config, config.setProxyData(pd); } - else if (hasCS) config.setProxyData(configServer.getProxyData()); } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); @@ -5451,11 +4423,10 @@ private static void _loadProxy(ConfigServerImpl configServer, ConfigImpl config, } } - private static void _loadError(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadError(ConfigImpl config, Struct root, Log log) { try { // Struct error = ConfigWebUtil.getAsStruct("error", root); - boolean hasCS = configServer != null; - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING); // 500 String template500 = getAttr(root, "errorGeneralTemplate"); @@ -5463,7 +4434,6 @@ private static void _loadError(ConfigServerImpl configServer, ConfigImpl config, if (hasAccess && !StringUtil.isEmpty(template500)) { config.setErrorTemplate(500, template500); } - else if (hasCS) config.setErrorTemplate(500, configServer.getErrorTemplate(500)); else config.setErrorTemplate(500, "/lucee/templates/error/error." + TEMPLATE_EXTENSION); // 404 @@ -5472,7 +4442,6 @@ private static void _loadError(ConfigServerImpl configServer, ConfigImpl config, if (hasAccess && !StringUtil.isEmpty(template404)) { config.setErrorTemplate(404, template404); } - else if (hasCS) config.setErrorTemplate(404, configServer.getErrorTemplate(404)); else config.setErrorTemplate(404, "/lucee/templates/error/error." + TEMPLATE_EXTENSION); // status code @@ -5482,7 +4451,6 @@ private static void _loadError(ConfigServerImpl configServer, ConfigImpl config, if (bStausCode != null && hasAccess) { config.setErrorStatusCode(bStausCode.booleanValue()); } - else if (hasCS) config.setErrorStatusCode(configServer.getErrorStatusCode()); } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); @@ -5491,11 +4459,10 @@ private static void _loadError(ConfigServerImpl configServer, ConfigImpl config, } - private static void _loadRegex(ConfigServerImpl configServer, ConfigImpl config, Struct root, Log log) { + private static void _loadRegex(ConfigImpl config, Struct root, Log log) { try { // Struct regex = ConfigWebUtil.getAsStruct("regex", root); - boolean hasCS = configServer != null; - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); String strType = getAttr(root, "regexType"); int type = StringUtil.isEmpty(strType) ? RegexFactory.TYPE_UNDEFINED : RegexFactory.toType(strType, RegexFactory.TYPE_UNDEFINED); @@ -5503,7 +4470,6 @@ private static void _loadRegex(ConfigServerImpl configServer, ConfigImpl config, if (hasAccess && type != RegexFactory.TYPE_UNDEFINED) { config.setRegex(RegexFactory.toRegex(type, null)); } - else if (hasCS) config.setRegex(configServer.getRegex()); else config.setRegex(RegexFactory.toRegex(RegexFactory.TYPE_PERL, null)); } @@ -5514,9 +4480,8 @@ private static void _loadRegex(ConfigServerImpl configServer, ConfigImpl config, } - private static void _loadCompiler(ConfigServerImpl configServer, ConfigImpl config, Struct root, int mode, Log log) { + private static void _loadCompiler(ConfigImpl config, Struct root, int mode, Log log) { try { - boolean hasCS = configServer != null; // suppress WS between cffunction and cfargument if (mode == ConfigPro.MODE_STRICT) { @@ -5529,9 +4494,6 @@ private static void _loadCompiler(ConfigServerImpl configServer, ConfigImpl conf if (!StringUtil.isEmpty(suppress, true)) { config.setSuppressWSBeforeArg(Caster.toBooleanValue(suppress, true)); } - else if (hasCS) { - config.setSuppressWSBeforeArg(configServer.getSuppressWSBeforeArg()); - } } // do dot notation keys upper case @@ -5540,24 +4502,19 @@ else if (hasCS) { } else { // Env Var - if (!hasCS) { - Boolean tmp = Caster.toBoolean(SystemUtil.getSystemPropOrEnvVar("lucee.preserve.case", null), null); - if (tmp != null) { - config.setDotNotationUpperCase(!tmp.booleanValue()); - } + Boolean tmp = Caster.toBoolean(SystemUtil.getSystemPropOrEnvVar("lucee.preserve.case", null), null); + if (tmp != null) { + config.setDotNotationUpperCase(!tmp.booleanValue()); } String _case = getAttr(root, "dotNotationUpperCase"); if (!StringUtil.isEmpty(_case, true)) { config.setDotNotationUpperCase(Caster.toBooleanValue(_case, true)); } - else if (hasCS) { - config.setDotNotationUpperCase(configServer.getDotNotationUpperCase()); - } } // full null support // if (!hasCS) { - boolean fns = hasCS ? configServer.getFullNullSupport() : false; + boolean fns = false; if (mode == ConfigPro.MODE_STRICT) { fns = true; } @@ -5566,7 +4523,7 @@ else if (hasCS) { if (StringUtil.isEmpty(str, true)) str = SystemUtil.getSystemPropOrEnvVar("lucee.full.null.support", null); if (!StringUtil.isEmpty(str, true)) { - fns = Caster.toBooleanValue(str, hasCS ? configServer.getFullNullSupport() : false); + fns = Caster.toBooleanValue(str, false); } } // when FNS is true or the lucee dialect is disabled we have no flip flop within a request. FNS is @@ -5574,7 +4531,7 @@ else if (hasCS) { config.setFullNullSupport(fns); // precise math - boolean pm = hasCS ? configServer.getPreciseMath() : true; + boolean pm = true; if (mode == ConfigPro.MODE_STRICT) { pm = true; } @@ -5583,7 +4540,7 @@ else if (hasCS) { if (StringUtil.isEmpty(str, true)) str = SystemUtil.getSystemPropOrEnvVar("lucee.precise.math", null); if (!StringUtil.isEmpty(str, true)) { - pm = Caster.toBooleanValue(str, hasCS ? configServer.getPreciseMath() : true); + pm = Caster.toBooleanValue(str, true); } } config.setPreciseMath(pm); @@ -5593,18 +4550,12 @@ else if (hasCS) { if (!StringUtil.isEmpty(output, true)) { config.setDefaultFunctionOutput(Caster.toBooleanValue(output, true)); } - else if (hasCS) { - config.setDefaultFunctionOutput(configServer.getDefaultFunctionOutput()); - } // suppress WS between cffunction and cfargument String str = getAttr(root, "externalizeStringGte"); if (Decision.isNumber(str)) { config.setExternalizeStringGTE(Caster.toIntValue(str, -1)); } - else if (hasCS) { - config.setExternalizeStringGTE(configServer.getExternalizeStringGTE()); - } // Handle Unquoted Attribute Values As String if (mode == ConfigPro.MODE_STRICT) { @@ -5615,9 +4566,6 @@ else if (hasCS) { if (str != null && Decision.isBoolean(str)) { config.setHandleUnQuotedAttrValueAsString(Caster.toBooleanValue(str, true)); } - else if (hasCS) { - config.setHandleUnQuotedAttrValueAsString(configServer.getHandleUnQuotedAttrValueAsString()); - } } } catch (Throwable t) { @@ -5633,10 +4581,9 @@ else if (hasCS) { * @throws IOException * @throws PageException */ - private static void _loadApplication(ConfigServerImpl configServer, ConfigImpl config, Struct root, int mode, Log log) { + private static void _loadApplication(ConfigImpl config, Struct root, int mode, Log log) { try { - boolean hasCS = configServer != null; - boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); + boolean hasAccess = ConfigUtil.hasAccess(config, SecurityManager.TYPE_SETTING); // Listener type ApplicationListener listener; @@ -5647,9 +4594,8 @@ private static void _loadApplication(ConfigServerImpl configServer, ConfigImpl c String strLT = SystemUtil.getSystemPropOrEnvVar("lucee.listener.type", null); if (StringUtil.isEmpty(strLT)) strLT = SystemUtil.getSystemPropOrEnvVar("lucee.application.listener", null); if (StringUtil.isEmpty(strLT)) strLT = getAttr(root, new String[] { "listenerType", "applicationListener" }); - listener = ConfigWebUtil.loadListener(strLT, null); + listener = ConfigUtil.loadListener(strLT, null); if (listener == null) { - if (hasCS && configServer.getApplicationListener() != null) listener = ConfigWebUtil.loadListener(configServer.getApplicationListener().getType(), null); if (listener == null) listener = new MixedAppListener(); } } @@ -5659,7 +4605,6 @@ private static void _loadApplication(ConfigServerImpl configServer, ConfigImpl c try { String cw = getAttr(root, "cachedWithin" + StringUtil.ucFirst(ConfigPro.STRING_CACHE_TYPES[i])); if (!StringUtil.isEmpty(cw, true)) config.setCachedWithin(ConfigPro.CACHE_TYPES[i], cw); - else if (hasCS) config.setCachedWithin(ConfigPro.CACHE_TYPES[i], configServer.getCachedWithin(ConfigPro.CACHE_TYPES[i])); } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); @@ -5672,7 +4617,6 @@ private static void _loadApplication(ConfigServerImpl configServer, ConfigImpl c if (typeChecking == null) typeChecking = Caster.toBoolean(SystemUtil.getSystemPropOrEnvVar("lucee.udf.type.checking", null), null); if (typeChecking == null) typeChecking = Caster.toBoolean(getAttr(root, new String[] { "typeChecking", "UDFTypeChecking" }), null); if (typeChecking != null) config.setTypeChecking(typeChecking.booleanValue()); - else if (hasCS) config.setTypeChecking(configServer.getTypeChecking()); // cached after TimeSpan ts = null; @@ -5681,17 +4625,15 @@ private static void _loadApplication(ConfigServerImpl configServer, ConfigImpl c if (!StringUtil.isEmpty(ca)) ts = Caster.toTimespan(ca); } if (ts != null) config.setCachedAfterTimeRange(ts); - else if (hasCS) config.setCachedAfterTimeRange(configServer.getCachedAfterTimeRange()); else config.setCachedAfterTimeRange(null); // Listener Mode String strLM = SystemUtil.getSystemPropOrEnvVar("lucee.listener.mode", null); if (StringUtil.isEmpty(strLM)) strLM = SystemUtil.getSystemPropOrEnvVar("lucee.application.mode", null); if (StringUtil.isEmpty(strLM)) strLM = getAttr(root, new String[] { "listenerMode", "applicationMode" }); - int listenerMode = ConfigWebUtil.toListenerMode(strLM, -1); + int listenerMode = ConfigUtil.toListenerMode(strLM, -1); if (listenerMode == -1) { - if (hasCS) listenerMode = configServer.getApplicationListener() == null ? ApplicationListener.MODE_CURRENT2ROOT : configServer.getApplicationListener().getMode(); - else listenerMode = ApplicationListener.MODE_CURRENT2ROOT; + listenerMode = ApplicationListener.MODE_CURRENT2ROOT; } listener.setMode(listenerMode); @@ -5706,7 +4648,6 @@ private static void _loadApplication(ConfigServerImpl configServer, ConfigImpl c if (hasAccess && !StringUtil.isEmpty(allowURLReqTimeout)) { config.setAllowURLRequestTimeout(Caster.toBooleanValue(allowURLReqTimeout, false)); } - else if (hasCS) config.setAllowURLRequestTimeout(configServer.isAllowURLRequestTimeout()); } // Req Timeout @@ -5717,7 +4658,6 @@ private static void _loadApplication(ConfigServerImpl configServer, ConfigImpl c if (!StringUtil.isEmpty(reqTimeout)) ts = Caster.toTimespan(reqTimeout); } if (ts != null && ts.getMillis() > 0) config.setRequestTimeout(ts); - else if (hasCS) config.setRequestTimeout(configServer.getRequestTimeout()); // application Path Timeout ts = null; @@ -5727,7 +4667,6 @@ private static void _loadApplication(ConfigServerImpl configServer, ConfigImpl c if (!StringUtil.isEmpty(reqTimeout)) ts = Caster.toTimespan(reqTimeout); } if (ts != null && ts.getMillis() > 0) config.setApplicationPathCacheTimeout(ts.getMillis()); - else if (hasCS) config.setApplicationPathCacheTimeout(configServer.getApplicationPathCacheTimeout()); // script-protect String strScriptProtect = SystemUtil.getSystemPropOrEnvVar("lucee.script.protect", null); @@ -5735,7 +4674,6 @@ private static void _loadApplication(ConfigServerImpl configServer, ConfigImpl c if (hasAccess && !StringUtil.isEmpty(strScriptProtect)) { config.setScriptProtect(AppListenerUtil.translateScriptProtect(strScriptProtect)); } - else if (hasCS) config.setScriptProtect(configServer.getScriptProtect()); // classic-date-parsing if (config instanceof ConfigServer) { @@ -5754,8 +4692,8 @@ private static void _loadApplication(ConfigServerImpl configServer, ConfigImpl c Resource configDir = config.getConfigDir(); String strCacheDirectory = getAttr(root, "cacheDirectory"); if (hasAccess && !StringUtil.isEmpty(strCacheDirectory)) { - strCacheDirectory = ConfigWebUtil.translateOldPath(strCacheDirectory); - Resource res = ConfigWebUtil.getFile(configDir, strCacheDirectory, "cache", configDir, FileUtil.TYPE_DIR, ResourceUtil.LEVEL_GRAND_PARENT_FILE, config); + strCacheDirectory = ConfigUtil.translateOldPath(strCacheDirectory); + Resource res = ConfigUtil.getFile(configDir, strCacheDirectory, "cache", configDir, FileUtil.TYPE_DIR, ResourceUtil.LEVEL_GRAND_PARENT_FILE, config); config.setCacheDir(res); } else { @@ -5767,7 +4705,6 @@ private static void _loadApplication(ConfigServerImpl configServer, ConfigImpl c if (hasAccess && !StringUtil.isEmpty(strMax)) { config.setCacheDirSize(ByteSizeParser.parseByteSizeDefinition(strMax, config.getCacheDirSize())); } - else if (hasCS) config.setCacheDirSize(configServer.getCacheDirSize()); // admin sync ClassDefinition asc = getClassDefinition(root, "adminSync", config.getIdentification()); @@ -5783,11 +4720,10 @@ private static void _loadApplication(ConfigServerImpl configServer, ConfigImpl c } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); - LogUtil.logGlobal(configServer == null ? config : configServer, ConfigWebFactory.class.getName(), t); + LogUtil.logGlobal(config, ConfigWebFactory.class.getName(), t); } } - else if (hasCS) config.setAdminSyncClass(configServer.getAdminSyncClass()); } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); @@ -5823,7 +4759,7 @@ public static long toLong(String value, long defaultValue) { } public static String getAttr(Struct data, String name) { - String v = ConfigWebUtil.getAsString(name, data, null); + String v = ConfigUtil.getAsString(name, data, null); if (v == null) { return null; } @@ -5832,8 +4768,8 @@ public static String getAttr(Struct data, String name) { } public static String getAttr(Struct data, String name, String alias) { - String v = ConfigWebUtil.getAsString(name, data, null); - if (v == null) v = ConfigWebUtil.getAsString(alias, data, null); + String v = ConfigUtil.getAsString(name, data, null); + if (v == null) v = ConfigUtil.getAsString(alias, data, null); if (v == null) return null; if (StringUtil.isEmpty(v)) return ""; return replaceConfigPlaceHolder(v); @@ -5842,7 +4778,7 @@ public static String getAttr(Struct data, String name, String alias) { public static String getAttr(Struct data, String[] names) { String v; for (String name: names) { - v = ConfigWebUtil.getAsString(name, data, null); + v = ConfigUtil.getAsString(name, data, null); if (!StringUtil.isEmpty(v)) return replaceConfigPlaceHolder(v); } return null; diff --git a/core/src/main/java/lucee/runtime/config/ConfigWebHelper.java b/core/src/main/java/lucee/runtime/config/ConfigWebHelper.java index c30c28b996..de6dd7ae97 100644 --- a/core/src/main/java/lucee/runtime/config/ConfigWebHelper.java +++ b/core/src/main/java/lucee/runtime/config/ConfigWebHelper.java @@ -133,7 +133,7 @@ public SearchEngine getSearchEngine(PageContext pc) throws PageException { if (o instanceof SearchEngine) searchEngine = (SearchEngine) o; else throw new ApplicationException("class [" + o.getClass().getName() + "] does not implement the interface SearchEngine"); - searchEngine.init(cw, ConfigWebUtil.getFile(cw.getConfigDir(), ConfigWebUtil.translateOldPath(cw.getSearchEngineDirectory()), "search", cw.getConfigDir(), + searchEngine.init(cw, ConfigUtil.getFile(cw.getConfigDir(), ConfigUtil.translateOldPath(cw.getSearchEngineDirectory()), "search", cw.getConfigDir(), FileUtil.TYPE_DIR, ResourceUtil.LEVEL_GRAND_PARENT_FILE, cw)); } catch (Exception e) { diff --git a/core/src/main/java/lucee/runtime/config/ConfigWebImpl.java b/core/src/main/java/lucee/runtime/config/ConfigWebImpl.java index ce470a5a1e..d9b1492b94 100644 --- a/core/src/main/java/lucee/runtime/config/ConfigWebImpl.java +++ b/core/src/main/java/lucee/runtime/config/ConfigWebImpl.java @@ -1,1969 +1,2127 @@ package lucee.runtime.config; import java.io.IOException; +import java.io.PrintWriter; +import java.io.Serializable; +import java.net.URL; +import java.nio.charset.Charset; import java.util.Collection; +import java.util.Enumeration; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TimeZone; import javax.servlet.ServletConfig; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.osgi.framework.BundleException; -import org.xml.sax.SAXException; +import org.osgi.framework.Version; +import lucee.commons.collection.MapFactory; +import lucee.commons.io.SystemUtil; +import lucee.commons.io.cache.Cache; +import lucee.commons.io.log.Log; +import lucee.commons.io.log.LogEngine; +import lucee.commons.io.log.LogUtil; +import lucee.commons.io.log.LoggerAndSourceData; import lucee.commons.io.res.Resource; +import lucee.commons.io.res.ResourceProvider; +import lucee.commons.io.res.ResourcesImpl; import lucee.commons.io.res.ResourcesImpl.ResourceProviderFactory; +import lucee.commons.io.res.type.compress.Compress; +import lucee.commons.io.res.util.ResourceUtil; +import lucee.commons.lang.CharSet; +import lucee.commons.lang.ClassException; import lucee.commons.lang.PhysicalClassLoader; +import lucee.commons.lang.types.RefBoolean; +import lucee.commons.lock.KeyLock; import lucee.loader.engine.CFMLEngine; +import lucee.runtime.CFMLFactory; +import lucee.runtime.CFMLFactoryImpl; +import lucee.runtime.CIPage; +import lucee.runtime.Mapping; +import lucee.runtime.MappingImpl; +import lucee.runtime.PageContext; +import lucee.runtime.PageSource; import lucee.runtime.ai.AIEngineFactory; import lucee.runtime.ai.AIEnginePool; +import lucee.runtime.cache.CacheConnection; +import lucee.runtime.cache.tag.CacheHandler; +import lucee.runtime.cache.tag.CacheHandlerCollection; +import lucee.runtime.cfx.CFXTagPool; +import lucee.runtime.compiler.CFMLCompilerImpl; +import lucee.runtime.component.ImportDefintion; import lucee.runtime.config.gateway.GatewayMap; +import lucee.runtime.customtag.InitFile; +import lucee.runtime.db.ClassDefinition; +import lucee.runtime.db.DataSource; +import lucee.runtime.db.JDBCDriver; +import lucee.runtime.debug.DebuggerPool; +import lucee.runtime.dump.DumpWriter; +import lucee.runtime.dump.DumpWriterEntry; +import lucee.runtime.engine.ExecutionLogFactory; +import lucee.runtime.engine.ThreadQueue; +import lucee.runtime.exp.DatabaseException; +import lucee.runtime.exp.DeprecatedException; +import lucee.runtime.exp.ExpressionException; import lucee.runtime.exp.PageException; +import lucee.runtime.exp.PageRuntimeException; +import lucee.runtime.exp.SecurityException; +import lucee.runtime.exp.TemplateException; +import lucee.runtime.extension.Extension; +import lucee.runtime.extension.ExtensionDefintion; +import lucee.runtime.extension.ExtensionProvider; +import lucee.runtime.extension.RHExtension; +import lucee.runtime.extension.RHExtensionProvider; +import lucee.runtime.gateway.GatewayEngine; +import lucee.runtime.listener.ApplicationListener; import lucee.runtime.listener.JavaSettings; +import lucee.runtime.lock.LockManager; +import lucee.runtime.monitor.ActionMonitor; +import lucee.runtime.monitor.ActionMonitorCollector; +import lucee.runtime.monitor.IntervallMonitor; +import lucee.runtime.monitor.RequestMonitor; +import lucee.runtime.net.amf.AMFEngine; +import lucee.runtime.net.http.ReqRspUtil; +import lucee.runtime.net.mail.Server; +import lucee.runtime.net.proxy.ProxyData; +import lucee.runtime.net.rpc.WSHandler; +import lucee.runtime.op.Caster; +import lucee.runtime.orm.ORMConfiguration; +import lucee.runtime.orm.ORMEngine; +import lucee.runtime.osgi.OSGiUtil.BundleDefinition; +import lucee.runtime.regex.Regex; +import lucee.runtime.rest.RestSettings; +import lucee.runtime.schedule.Scheduler; +import lucee.runtime.search.SearchEngine; +import lucee.runtime.security.SecurityManager; +import lucee.runtime.spooler.SpoolerEngine; +import lucee.runtime.tag.TagHandlerPool; +import lucee.runtime.type.Collection.Key; +import lucee.runtime.type.Struct; +import lucee.runtime.type.UDF; +import lucee.runtime.type.dt.TimeSpan; +import lucee.runtime.type.scope.Cluster; import lucee.runtime.writer.CFMLWriter; +import lucee.transformer.library.function.FunctionLib; +import lucee.transformer.library.tag.TagLib; -public class ConfigWebImpl implements ConfigWebPro { - private ConfigWebInner instance; +public class ConfigWebImpl extends ConfigBase implements ConfigWebPro { - public ConfigWebImpl(ConfigWebInner instance) { - this.instance = instance; + private ConfigServerImpl cs; + protected Password password; + private ConfigWebHelper helper; + private ServletConfig config; + private CFMLFactoryImpl factory; + private SCCWIdentificationWeb id; + private Resource rootDir; + private Mapping[] mappings; + private lucee.runtime.rest.Mapping[] restMappings; + private Resource configDirWeb; + + public ConfigWebImpl(CFMLFactoryImpl factory, ConfigServerImpl cs, ServletConfig config, Resource configDirWeb) { + update(factory, cs, config, configDirWeb); } - @Override - public lucee.commons.io.res.Resource getExtensionDirectory() { - return instance.getExtensionDirectory(); + public ConfigWebImpl update(CFMLFactoryImpl factory, ConfigServerImpl cs, ServletConfig config, Resource configDirWeb) { + this.factory = factory; + this.cs = cs; + this.config = config; + this.configDirWeb = configDirWeb; + ResourceProvider frp = ResourcesImpl.getFileResourceProvider(); + this.rootDir = frp.getResource(ReqRspUtil.getRootPath(config.getServletContext())); + + // Fix for tomcat + if (this.rootDir.getName().equals(".") || this.rootDir.getName().equals("..")) this.rootDir = this.rootDir.getParentResource(); + + helper = new ConfigWebHelper(cs, this); + + reload(); + return this; } - @Override - public lucee.commons.io.res.Resource getSecurityDirectory() { - return instance.getSecurityDirectory(); + public ConfigServerImpl getConfigServerImpl() { + return cs; } @Override - public java.nio.charset.Charset getMailDefaultCharset() { - return instance.getMailDefaultCharset(); + public ConfigServer getConfigServer() { + return cs; } @Override - public java.lang.String getDebugTemplate() { - return instance.getDebugTemplate(); + public boolean isAllowURLRequestTimeout() { + return cs.isAllowURLRequestTimeout(); } @Override - public lucee.runtime.gateway.GatewayEngine getGatewayEngine() throws PageException { - return instance.getGatewayEngine(); + public short getCompileType() { + return cs.getCompileType(); } @Override - public boolean isProxyEnableFor(java.lang.String arg0) { - return instance.isProxyEnableFor(arg0); + @Deprecated + public void reloadTimeServerOffset() { + cs.reloadTimeServerOffset(); } @Override - public lucee.commons.io.res.Resource getPhysical(lucee.runtime.Mapping[] arg0, java.lang.String arg1, boolean arg2) { - return instance.getPhysical(arg0, arg1, arg2); + public long lastModified() { + return cs.lastModified(); } @Override - public void setIdentification(lucee.runtime.config.IdentificationWeb arg0) { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).setIdentification(arg0); - else((SingleContextConfigWeb) instance).setIdentification(arg0); - // ignored for Single, should not be called anyway + public short getScopeCascadingType() { + return cs.getScopeCascadingType(); } @Override - public boolean equals(java.lang.Object arg0) { - if (instance instanceof MultiContextConfigWeb) return instance.equals(arg0); - else return (instance).equals(arg0); + public FunctionLib getFLDs() { + return cs.getFLDs(); } @Override - public boolean hasResourceProvider(java.lang.String arg0) { - return instance.hasResourceProvider(arg0); + public FunctionLib[] getFLDs(int dialect) { // used in image extension + return cs.getFLDs(dialect); } @Override - public java.lang.String getPasswordSalt() { - return instance.getPasswordSalt(); + public TagLib[] getTLDs() { + return cs.getTLDs(); } - public java.lang.Object[] getConsoleLayouts() throws lucee.runtime.exp.PageException { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getConsoleLayouts(); - else return ((SingleContextConfigWeb) instance).getConsoleLayouts(); + @Override + public boolean allowImplicidQueryCall() { + return cs.allowImplicidQueryCall(); } - public java.lang.String getServerSalt() { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getServerSalt(); - else return ((SingleContextConfigWeb) instance).getServerSalt(); + @Override + public boolean limitEvaluation() { + return cs.limitEvaluation(); } @Override - public lucee.runtime.PageSource getApplicationPageSource(lucee.runtime.PageContext arg0, java.lang.String arg1, java.lang.String arg2, int arg3, - lucee.commons.lang.types.RefBoolean arg4) { - return instance.getApplicationPageSource(arg0, arg1, arg2, arg3, arg4); + public boolean mergeFormAndURL() { + return cs.mergeFormAndURL(); } @Override - public short getSessionType() { - return instance.getSessionType(); + public TimeSpan getApplicationTimeout() { + return cs.getApplicationTimeout(); } @Override - public short getClientType() { - return instance.getClientType(); + public TimeSpan getSessionTimeout() { + return cs.getSessionTimeout(); } @Override - public java.lang.String getSearchEngineDirectory() { - return instance.getSearchEngineDirectory(); + public TimeSpan getClientTimeout() { + return cs.getClientTimeout(); } @Override - public lucee.runtime.PageSource getBaseComponentPageSource(lucee.runtime.PageContext arg1, boolean force) { - return instance.getBaseComponentPageSource(arg1, force); + public TimeSpan getRequestTimeout() { + return cs.getRequestTimeout(); } @Override - public lucee.commons.io.res.ResourceProvider getDefaultResourceProvider() { - return instance.getDefaultResourceProvider(); + public boolean isClientCookies() { + return cs.isClientCookies(); } - public lucee.commons.lang.CharSet getMailDefaultCharSet() { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getMailDefaultCharSet(); - else return ((SingleContextConfigWeb) instance).getMailDefaultCharSet(); + @Override + public boolean isDevelopMode() { + return cs.isDevelopMode(); } @Override - public lucee.commons.io.res.Resource getFldFile() { - return instance.getFldFile(); + public boolean isClientManagement() { + return cs.isClientManagement(); } @Override - public lucee.commons.io.res.Resource getTldFile() { - return instance.getTldFile(); + public boolean isDomainCookies() { + return cs.isDomainCookies(); } @Override - public lucee.commons.io.res.Resource[] getPhysicalResources(lucee.runtime.PageContext arg0, lucee.runtime.Mapping[] arg1, java.lang.String arg2, boolean arg3, boolean arg4, - boolean arg5) { - return instance.getPhysicalResources(arg0, arg1, arg2, arg3, arg4, arg5); + public boolean isSessionManagement() { + return cs.isSessionManagement(); } @Override - public double getVersion() { - return instance.getVersion(); + public boolean isMailSpoolEnable() { + return cs.isMailSpoolEnable(); } @Override - public lucee.transformer.library.function.FunctionLib getFLDs() { - return instance.getFLDs(); + public boolean isMailSendPartial() { + return cs.isMailSendPartial(); } @Override - public lucee.transformer.library.function.FunctionLib[] getFLDs(int dialect) { // used in image extension - return instance.getFLDs(dialect); + public boolean isUserset() { + return cs.isUserset(); } @Override - public java.io.PrintWriter getOutWriter() { - return instance.getOutWriter(); + public Server[] getMailServers() { + return cs.getMailServers(); } @Override - public lucee.runtime.listener.ApplicationListener getApplicationListener() { - return instance.getApplicationListener(); + public int getMailTimeout() { + return cs.getMailTimeout(); } @Override - public int getComponentDataMemberDefaultAccess() { - return instance.getComponentDataMemberDefaultAccess(); + public boolean getPSQL() { + return cs.getPSQL(); } @Override - public long getCacheDirSize() { - return instance.getCacheDirSize(); + public int getQueryVarUsage() { + return cs.getQueryVarUsage(); } @Override - public lucee.runtime.engine.ThreadQueue getThreadQueue() { - return instance.getThreadQueue(); + public ClassLoader getClassLoader() { + return cs.getClassLoader(); } @Override - public lucee.runtime.config.DebugEntry[] getDebugEntries() { - return instance.getDebugEntries(); + public ClassLoader getClassLoaderEnv() { + return cs.getClassLoaderEnv(); } - public int getDebugOptions() { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getDebugOptions(); - else return ((SingleContextConfigWeb) instance).getDebugOptions(); + @Override + public ClassLoader getClassLoaderCore() { + return cs.getClassLoaderCore(); } @Override - public lucee.commons.io.res.Resource getDeployDirectory() { - return instance.getDeployDirectory(); + public Locale getLocale() { + return cs.getLocale(); } @Override - public short getAdminMode() { - return instance.getAdminMode(); + public boolean debug() { + return cs.debug(); } @Override - public long getApplicationPathCacheTimeout() { - return instance.getApplicationPathCacheTimeout(); + public boolean getShowDebug() { + return cs.getShowDebug(); } - public java.util.Map getGatewayEntries() { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getGatewayEntries(); - else return ((SingleContextConfigWeb) instance).getGatewayEntries(); + @Override + public boolean getShowDoc() { + return cs.getShowDoc(); } @Override - public int getScriptProtect() { - return instance.getScriptProtect(); + public boolean getShowMetric() { + return cs.getShowMetric(); } - public lucee.runtime.Mapping getScriptMapping() { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getScriptMapping(); - else return ((SingleContextConfigWeb) instance).getScriptMapping(); + @Override + public boolean getShowTest() { + return cs.getShowTest(); } @Override - public lucee.runtime.monitor.IntervallMonitor[] getIntervallMonitors() { - return instance.getIntervallMonitors(); + public boolean debugLogOutput() { + return cs.debugLogOutput(); } - public void resetRPCClassLoader() { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).resetRPCClassLoader(); - else((SingleContextConfigWeb) instance).resetRPCClassLoader(); + @Override + public Resource getTempDirectory() { + return cs.getTempDirectory(); } @Override - public lucee.runtime.dump.DumpWriter getDumpWriter(java.lang.String arg0) throws PageException { - return instance.getDumpWriter(arg0); + public int getMailSpoolInterval() { + return cs.getMailSpoolInterval(); } @Override - public boolean useCTPathCache() { - return instance.useCTPathCache(); + public TimeZone getTimeZone() { + return cs.getTimeZone(); } @Override - public boolean getFullNullSupport() { - return instance.getFullNullSupport(); + @Deprecated + public long getTimeServerOffset() { + return cs.getTimeServerOffset(); } @Override - public boolean isSessionManagement() { - return instance.isSessionManagement(); + public Scheduler getScheduler() { + return cs.getScheduler(); } @Override - public boolean allowRealPath() { - return instance.allowRealPath(); + public Password isPasswordEqual(String password) { + return cs.isPasswordEqual(password); } @Override - public lucee.commons.io.res.Resource getClientScopeDir() { - return instance.getClientScopeDir(); + public boolean hasPassword() { + return cs.hasPassword(); } @Override - public lucee.runtime.schedule.Scheduler getScheduler() { - return instance.getScheduler(); + public boolean passwordEqual(Password password) { + return cs.passwordEqual(password); } @Override - public short getCompileType() { - return instance.getCompileType(); + public Mapping[] getMappings() { + if (mappings == null) { + synchronized (this) { + if (mappings == null) createMapping(); + } + } + return mappings;// cs.getMappings(); } @Override - public lucee.commons.io.res.Resource getPhysicalResourceExisting(lucee.runtime.PageContext arg0, lucee.runtime.Mapping[] arg1, java.lang.String arg2, boolean arg3, - boolean arg4, boolean arg5) { - return instance.getPhysicalResourceExisting(arg0, arg1, arg2, arg3, arg4, arg5); + public lucee.runtime.rest.Mapping[] getRestMappings() { + if (restMappings == null) { + synchronized (this) { + if (restMappings == null) createRestMapping(); + } + } + return restMappings; } @Override - public java.util.Enumeration getInitParameterNames() { - return instance.getInitParameterNames(); + public PageSource getPageSource(Mapping[] mappings, String realPath, boolean onlyTopLevel) { + throw new PageRuntimeException(new DeprecatedException("method not supported")); } @Override - public boolean getRestList() { - return instance.getRestList(); + public PageSource getPageSourceExisting(PageContext pc, Mapping[] mappings, String realPath, boolean onlyTopLevel, boolean useSpecialMappings, boolean useDefaultMapping, + boolean onlyPhysicalExisting) { + return ConfigUtil.getPageSourceExisting(pc, this, mappings, realPath, onlyTopLevel, useSpecialMappings, useDefaultMapping, onlyPhysicalExisting); } @Override - public int getCFMLWriterType() { - return instance.getCFMLWriterType(); + public PageSource[] getPageSources(PageContext pc, Mapping[] mappings, String realPath, boolean onlyTopLevel, boolean useSpecialMappings, boolean useDefaultMapping) { + return ConfigUtil.getPageSources(pc, this, mappings, realPath, onlyTopLevel, useSpecialMappings, useDefaultMapping, false, onlyFirstMatch); } @Override - public java.lang.ClassLoader getClassLoaderCore() { - return instance.getClassLoaderCore(); + public PageSource[] getPageSources(PageContext pc, Mapping[] mappings, String realPath, boolean onlyTopLevel, boolean useSpecialMappings, boolean useDefaultMapping, + boolean useComponentMappings) { + return ConfigUtil.getPageSources(pc, this, mappings, realPath, onlyTopLevel, useSpecialMappings, useDefaultMapping, useComponentMappings, onlyFirstMatch); } @Override - public ServletContext getServletContext() { - return instance.getServletContext(); + public Resource[] getResources(PageContext pc, Mapping[] mappings, String realPath, boolean onlyTopLevel, boolean useSpecialMappings, boolean useDefaultMapping, + boolean useComponentMappings, boolean onlyFirstMatch) { + return ConfigUtil.getResources(pc, this, mappings, realPath, onlyTopLevel, useSpecialMappings, useDefaultMapping, useComponentMappings, onlyFirstMatch); } @Override - public java.lang.String getSalt() { - return instance.getSalt(); + public Resource getPhysical(Mapping[] mappings, String realPath, boolean alsoDefaultMapping) { + throw new PageRuntimeException(new DeprecatedException("method not supported")); } - public lucee.runtime.PageSource[] getPageSources(lucee.runtime.PageContext arg0, lucee.runtime.Mapping[] arg1, java.lang.String arg2, boolean arg3, boolean arg4, boolean arg5, - boolean arg6, boolean arg7) { - - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getPageSources(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); - else return ((SingleContextConfigWeb) instance).getPageSources(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); + @Override + public Resource[] getPhysicalResources(PageContext pc, Mapping[] mappings, String realPath, boolean onlyTopLevel, boolean useSpecialMappings, boolean useDefaultMapping) { + throw new PageRuntimeException(new DeprecatedException("method not supported")); } @Override - public lucee.runtime.Mapping getServerTagMapping(java.lang.String arg0) { - return instance.getServerTagMapping(arg0); + public Resource getPhysicalResourceExisting(PageContext pc, Mapping[] mappings, String realPath, boolean onlyTopLevel, boolean useSpecialMappings, boolean useDefaultMapping) { + throw new PageRuntimeException(new DeprecatedException("method not supported")); } @Override - public lucee.runtime.db.JDBCDriver getJDBCDriverByCD(lucee.runtime.db.ClassDefinition arg0, lucee.runtime.db.JDBCDriver arg1) { - return instance.getJDBCDriverByCD(arg0, arg1); + public PageSource toPageSource(Mapping[] mappings, Resource res, PageSource defaultValue) { + return ConfigUtil.toPageSource(this, mappings, res, defaultValue); } @Override - public void removeDatasourceConnectionPool(lucee.runtime.db.DataSource arg0) { - instance.removeDatasourceConnectionPool(arg0); + public Resource getConfigDir() { + return cs.getConfigDir(); } @Override - public lucee.runtime.cache.tag.CacheHandlerCollection getCacheHandlerCollection(int arg0, lucee.runtime.cache.tag.CacheHandlerCollection arg1) { - return instance.getCacheHandlerCollection(arg0, arg1); + public Resource getConfigFile() { + return cs.getConfigFile(); } @Override - public void setPassword(lucee.runtime.config.Password arg0) { - instance.setPassword(arg0); + public TagLib getCoreTagLib() { + return cs.getCoreTagLib(); } @Override - public boolean isUserset() { - return instance.isUserset(); + public Mapping[] getCustomTagMappings() { + return cs.getCustomTagMappings(); } @Override - public lucee.runtime.tag.TagHandlerPool getTagHandlerPool() { - return instance.getTagHandlerPool(); + public long getLoadTime() { + return cs.getLoadTime(); } @Override - public java.nio.charset.Charset getWebCharset() { - return instance.getWebCharset(); + public CFXTagPool getCFXTagPool() throws SecurityException { + return cs.getCFXTagPool(); } @Override - public lucee.runtime.type.UDF getFromFunctionCache(java.lang.String arg0) { - return instance.getFromFunctionCache(arg0); + public String getBaseComponentTemplate(int dialect) { // FUTURE remove + return cs.getBaseComponentTemplate(dialect); } @Override - public lucee.runtime.db.JDBCDriver getJDBCDriverByBundle(java.lang.String arg0, org.osgi.framework.Version arg1, lucee.runtime.db.JDBCDriver arg2) { - return instance.getJDBCDriverByBundle(arg0, arg1, arg2); + public String getBaseComponentTemplate() { + return cs.getBaseComponentTemplate(); } @Override - public void checkPermGenSpace(boolean arg0) { - instance.checkPermGenSpace(arg0); + public PageSource getBaseComponentPageSource(int dialect) { // FUTURE remove + return cs.getBaseComponentPageSource(dialect); } @Override - public java.lang.String getDefaultEncoding() { - return instance.getDefaultEncoding(); + public PageSource getBaseComponentPageSource(PageContext pc, boolean force) { + return cs.getBaseComponentPageSource(pc, force); } @Override - public lucee.runtime.CIPage getBaseComponentPage(lucee.runtime.PageContext arg1) throws lucee.runtime.exp.PageException { - return instance.getBaseComponentPage(arg1); + public boolean getRestList() { + return cs.getRestList(); } @Override - public lucee.commons.io.log.Log getLog(java.lang.String arg0, boolean arg1) throws lucee.runtime.exp.PageException { - return instance.getLog(arg0, arg1); + public short getClientType() { + return cs.getClientType(); } @Override - public boolean isApplicationMapping(lucee.runtime.Mapping arg0) { - return instance.isApplicationMapping(arg0); + public ClassDefinition getSearchEngineClassDefinition() { + return cs.getSearchEngineClassDefinition(); } @Override - public boolean getSuppressWSBeforeArg() { - return instance.getSuppressWSBeforeArg(); + public String getSearchEngineDirectory() { + return cs.getSearchEngineDirectory(); } @Override - public java.util.Collection getServerFunctionMappings() { - return instance.getServerFunctionMappings(); + public int getComponentDataMemberDefaultAccess() { + return cs.getComponentDataMemberDefaultAccess(); } - public void clearComponentMetadata() { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).clearComponentMetadata(); - else((SingleContextConfigWeb) instance).clearComponentMetadata(); + @Override + public String getTimeServer() { + return cs.getTimeServer(); } @Override - public boolean getPSQL() { - return instance.getPSQL(); + public String getComponentDumpTemplate() { + return cs.getComponentDumpTemplate(); } - public java.lang.Object[] getResourceLayouts() throws lucee.runtime.exp.PageException { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getResourceLayouts(); - else return ((SingleContextConfigWeb) instance).getResourceLayouts(); + @Override + public String getDebugTemplate() { + return cs.getDebugTemplate(); } @Override - public void updatePassword(boolean arg0, java.lang.String arg1, java.lang.String arg2) throws lucee.runtime.exp.PageException, IOException, SAXException, BundleException { - instance.updatePassword(this, arg0, arg1, arg2); + public String getErrorTemplate(int statusCode) { + return cs.getErrorTemplate(statusCode); } @Override - public lucee.runtime.dump.DumpWriter getDumpWriter(java.lang.String arg0, int arg1) throws PageException { - return instance.getDumpWriter(arg0, arg1); + public short getSessionType() { + return cs.getSessionType(); } @Override - public int getLocalMode() { - return instance.getLocalMode(); + public String getUpdateType() { + return null; } @Override - public long getQueueTimeout() { - return instance.getQueueTimeout(); + public URL getUpdateLocation() { + return null; } @Override - public java.util.Collection getExtensionBundleDefintions() { - return instance.getExtensionBundleDefintions(); + public Resource getClassDirectory() { + return cs.getClassDirectory(); } @Override - public lucee.runtime.Mapping getApplicationMapping(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3, boolean arg4, boolean arg5, - boolean arg6, boolean arg7) { - return instance.getApplicationMapping(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); + public Resource getLibraryDirectory() { + return cs.getLibraryDirectory(); } @Override - public boolean getCGIScopeReadonly() { - return instance.getCGIScopeReadonly(); + public Resource getEventGatewayDirectory() { + return cs.getEventGatewayDirectory(); } @Override - public boolean getComponentRootSearch() { - return instance.getComponentRootSearch(); + public Resource getClassesDirectory() { + return cs.getClassesDirectory(); } @Override - public java.lang.String getCacheDefaultConnectionName(int arg0) { - return instance.getCacheDefaultConnectionName(arg0); + public Resource getRootDirectory() { + return rootDir; } @Override - public java.util.Collection getDatasourceConnectionPools() { - return instance.getDatasourceConnectionPools(); + public boolean isSuppressWhitespace() { + return cs.isSuppressWhitespace(); } @Override - public lucee.runtime.extension.ExtensionProvider[] getExtensionProviders() { - return instance.getExtensionProviders(); + public boolean isSuppressContent() { + return cs.isSuppressContent(); } - public void flushComponentPathCache() { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).flushComponentPathCache(); - else((SingleContextConfigWeb) instance).flushComponentPathCache(); + @Override + public String getDefaultEncoding() { + return cs.getDefaultEncoding(); } @Override - public boolean isMailSpoolEnable() { - return instance.isMailSpoolEnable(); + public Charset getTemplateCharset() { + return cs.getTemplateCharset(); } @Override - public java.lang.Boolean getHandleUnQuotedAttrValueAsString() { - return instance.getHandleUnQuotedAttrValueAsString(); + public Charset getWebCharset() { + return cs.getWebCharset(); } @Override - public java.lang.String getBaseComponentTemplate(int arg0) { - return instance.getBaseComponentTemplate(arg0); + public CharSet getWebCharSet() { + return cs.getWebCharSet(); } @Override - public String getBaseComponentTemplate() { - return instance.getBaseComponentTemplate(); + public Charset getResourceCharset() { + return cs.getResourceCharset(); } @Override - public java.lang.Class getClusterClass() { - return instance.getClusterClass(); + public CharSet getResourceCharSet() { + return cs.getResourceCharSet(); } - public java.lang.String createSecurityToken() { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).createSecurityToken(); - else return ((SingleContextConfigWeb) instance).createSecurityToken(); + @Override + public SecurityManager getSecurityManager() { + return cs.getSecurityManager(); } @Override - public void reset() { - instance.reset(); + public Resource getFldFile() { + return cs.getFldFile(); } @Override - public lucee.runtime.dump.DumpWriter getDefaultDumpWriter(int arg0) { - return instance.getDefaultDumpWriter(arg0); + public Resource getTldFile() { + return cs.getTldFile(); } @Override - public lucee.runtime.cfx.CFXTagPool getCFXTagPool() throws PageException { - return instance.getCFXTagPool(); + public DataSource[] getDataSources() { + return cs.getDataSources(); } - public lucee.commons.io.res.Resource getServerConfigDir() { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getServerConfigDir(); - else return ((SingleContextConfigWeb) instance).getServerConfigDir(); + @Override + public Map getDataSourcesAsMap() { + return cs.getDataSourcesAsMap(); } @Override - public void clearFunctionCache() { - instance.clearFunctionCache(); + public Charset getMailDefaultCharset() { + return cs.getMailDefaultCharset(); } - @Override - public lucee.runtime.PageSource[] getPageSources(lucee.runtime.PageContext arg0, lucee.runtime.Mapping[] arg1, java.lang.String arg2, boolean arg3, boolean arg4, boolean arg5, - boolean arg6) { - return instance.getPageSources(arg0, arg1, arg2, arg3, arg4, arg5, arg6); + public CharSet getMailDefaultCharSet() { + return cs.getMailDefaultCharSet(); } @Override - public IdentificationWeb getIdentification() { - return instance.getIdentification(); + public ResourceProvider getDefaultResourceProvider() { + return cs.getDefaultResourceProvider(); } @Override - public java.util.Locale getLocale() { - return instance.getLocale(); + public Iterator>> getCacheHandlers() { + return cs.getCacheHandlers(); } @Override - public java.util.Map getCacheConnections() { - return instance.getCacheConnections(); + public ResourceProvider[] getResourceProviders() { + return cs.getResourceProviders(); } - public java.lang.String getCacheMD5() { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getCacheMD5(); - else return ((SingleContextConfigWeb) instance).getCacheMD5(); + @Override + public ResourceProviderFactory[] getResourceProviderFactories() { + return cs.getResourceProviderFactories(); } @Override - public boolean hasIndividualSecurityManager() { - return instance.hasIndividualSecurityManager(this); + public boolean hasResourceProvider(String scheme) { + return cs.hasResourceProvider(scheme); } @Override - public lucee.commons.io.res.Resource getLibraryDirectory() { - return instance.getLibraryDirectory(); + public Resource getResource(String path) { + return cs.getResource(path); } @Override - public boolean isDevelopMode() { - return instance.isDevelopMode(); + public ApplicationListener getApplicationListener() { + return cs.getApplicationListener(); } @Override - public lucee.runtime.db.JDBCDriver[] getJDBCDrivers() { - return instance.getJDBCDrivers(); + public int getScriptProtect() { + return cs.getScriptProtect(); } @Override - public lucee.runtime.rest.RestSettings getRestSetting() { - return instance.getRestSetting(); + public ProxyData getProxyData() { + return cs.getProxyData(); } @Override - public lucee.runtime.db.ClassDefinition getSearchEngineClassDefinition() { - return instance.getSearchEngineClassDefinition(); + public boolean isProxyEnableFor(String host) { + return cs.isProxyEnableFor(host); } @Override - public java.lang.Class getVideoExecuterClass() { - return instance.getVideoExecuterClass(); + public boolean getTriggerComponentDataMember() { + return cs.getTriggerComponentDataMember(); } @Override - public boolean closeConnection() { - return instance.closeConnection(); + public Resource getClientScopeDir() { + return cs.getClientScopeDir(); } @Override - public lucee.runtime.Mapping getDefaultFunctionMapping() { - return instance.getDefaultFunctionMapping(); + public Resource getSessionScopeDir() { + return cs.getSessionScopeDir(); } @Override - public boolean debugLogOutput() { - return instance.debugLogOutput(); + public long getClientScopeDirSize() { + return cs.getClientScopeDirSize(); } @Override - public void releaseCacheHandlers(lucee.runtime.PageContext arg0) { - instance.releaseCacheHandlers(arg0); + public ClassLoader getRPCClassLoader(boolean reload) throws IOException { + return cs.getRPCClassLoader(reload); } @Override - public boolean allowImplicidQueryCall() { - return instance.allowImplicidQueryCall(); + public ClassLoader getRPCClassLoader(boolean reload, JavaSettings js, ClassLoader parent) throws IOException { + return cs.getRPCClassLoader(reload, js, parent); } @Override - public boolean limitEvaluation() { - return instance.limitEvaluation(); + public PhysicalClassLoader getDirectClassLoader(boolean reload) throws IOException { + return cs.getDirectClassLoader(reload); } @Override - public lucee.runtime.customtag.InitFile getCTInitFile(lucee.runtime.PageContext arg0, java.lang.String arg1) { - return instance.getCTInitFile(arg0, arg1); + public Resource getCacheDir() { + return cs.getCacheDir(); } @Override - public java.lang.ClassLoader getClassLoader() { - return instance.getClassLoader(); + public long getCacheDirSize() { + return cs.getCacheDirSize(); } @Override - public lucee.runtime.config.DatasourceConnPool getDatasourceConnectionPool(lucee.runtime.db.DataSource arg0, java.lang.String arg1, java.lang.String arg2) { - return instance.getDatasourceConnectionPool(arg0, arg1, arg2); + public DumpWriter getDefaultDumpWriter(int defaultType) { + return cs.getDefaultDumpWriter(defaultType); } @Override - public lucee.runtime.db.DataSource getDataSource(java.lang.String arg0, lucee.runtime.db.DataSource arg1) { - return instance.getDataSource(arg0, arg1); + public DumpWriter getDumpWriter(String name) throws DeprecatedException { + return cs.getDumpWriter(name); } @Override - public lucee.runtime.rest.Mapping[] getRestMappings() { - return instance.getRestMappings(); + public DumpWriter getDumpWriter(String name, int defaultType) throws ExpressionException { + return cs.getDumpWriter(name, defaultType); } @Override - public boolean useComponentPathCache() { - return instance.useComponentPathCache(); + public boolean useComponentShadow() { + return cs.useComponentShadow(); } @Override - public lucee.runtime.orm.ORMEngine resetORMEngine(lucee.runtime.PageContext arg0, boolean arg1) throws lucee.runtime.exp.PageException { - return instance.resetORMEngine(arg0, arg1); + public boolean useComponentPathCache() { + return cs.useComponentPathCache(); } @Override - public lucee.runtime.config.Password isServerPasswordEqual(java.lang.String arg0) { - return instance.isServerPasswordEqual(arg0); + public boolean useCTPathCache() { + return cs.useCTPathCache(); } @Override - public lucee.runtime.monitor.IntervallMonitor getIntervallMonitor(java.lang.String arg0) throws lucee.runtime.exp.PageException { - return instance.getIntervallMonitor(arg0); + public DataSource getDataSource(String datasource) throws DatabaseException { + return cs.getDataSource(datasource); } @Override - public boolean isSuppressContent() { - return instance.isSuppressContent(); + public DataSource getDataSource(String datasource, DataSource defaultValue) { + return cs.getDataSource(datasource, defaultValue); } - public ComponentMetaData getComponentMetadata(java.lang.String arg0) { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getComponentMetadata(arg0); - else return ((SingleContextConfigWeb) instance).getComponentMetadata(arg0); + @Override + public PrintWriter getErrWriter() { + return cs.getErrWriter(); } @Override - public void resetBaseComponentPage() { - instance.resetBaseComponentPage(); + public PrintWriter getOutWriter() { + return cs.getOutWriter(); } @Override - public lucee.commons.io.res.Resource getConfigFile() { - return instance.getConfigFile(); + public DatasourceConnPool getDatasourceConnectionPool(DataSource ds, String user, String pass) { + return cs.getDatasourceConnectionPool(ds, user, pass); } @Override - public java.nio.charset.Charset getResourceCharset() { - return instance.getResourceCharset(); + public Collection getDatasourceConnectionPools() { + return cs.getDatasourceConnectionPools(); } @Override public boolean doLocalCustomTag() { - return instance.doLocalCustomTag(); + return cs.doLocalCustomTag(); } @Override - public lucee.runtime.PageSource getPageSource(lucee.runtime.Mapping[] arg0, java.lang.String arg1, boolean arg2) { - return instance.getPageSource(arg0, arg1, arg2); + public String[] getCustomTagExtensions() { + return cs.getCustomTagExtensions(); } - public lucee.commons.io.cache.Cache createRAMCache(lucee.runtime.type.Struct arg0) throws java.io.IOException { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).createRAMCache(arg0); - else return ((SingleContextConfigWeb) instance).createRAMCache(arg0); + @Override + public boolean doComponentDeepSearch() { + return cs.doComponentDeepSearch(); } @Override public boolean doCustomTagDeepSearch() { - return instance.doCustomTagDeepSearch(); + return cs.doCustomTagDeepSearch(); } @Override - public lucee.commons.io.res.Resource getConfigServerDir() { - return instance.getConfigServerDir(); + public double getVersion() { + return cs.getVersion(); } @Override - public short getScopeCascadingType() { - return instance.getScopeCascadingType(); + public boolean contentLength() { + return cs.contentLength(); } @Override - public java.lang.String toString() { - return instance.toString(); + public boolean allowCompression() { + return cs.allowCompression(); } @Override - public boolean preserveCase() { - return instance.preserveCase(); + public Struct getConstants() { + return cs.getConstants(); } @Override - public java.lang.String getUpdateType() { - return instance.getUpdateType(); + public boolean isShowVersion() { + return cs.isShowVersion(); } @Override - public boolean getQueueEnable() { - return instance.getQueueEnable(); + public RemoteClient[] getRemoteClients() { + return cs.getRemoteClients(); } @Override - public lucee.runtime.Mapping[] getApplicationMappings() { - return instance.getApplicationMappings(); + public SpoolerEngine getSpoolerEngine() { + return cs.getSpoolerEngine(); + /* + * if (spoolerEngine == null) { Resource dir = getRemoteClientDirectory(); if (dir != null && + * !dir.exists()) dir.mkdirs(); SpoolerEngineImpl se = (SpoolerEngineImpl) cs.getSpoolerEngine(); + * spoolerEngine = new SpoolerEngineImpl(this, dir, "Remote Client Spooler", getLog("remoteclient"), + * se.getMaxThreads()); } return spoolerEngine; + */ } @Override - public java.lang.String getComponentDumpTemplate() { - return instance.getComponentDumpTemplate(); + public Resource getRemoteClientDirectory() { + return cs.getRemoteClientDirectory(); + /* + * if (remoteClientDirectory == null) { return remoteClientDirectory = + * ConfigWebUtil.getFile(getRootDirectory(), "client-task", "client-task", getConfigDir(), + * FileUtil.TYPE_DIR, this); } return remoteClientDirectory; + */ } @Override - public lucee.commons.io.res.Resource getAntiSamyPolicy() { - return instance.getAntiSamyPolicy(); + public boolean getErrorStatusCode() { + return cs.getErrorStatusCode(); } @Override - public lucee.runtime.component.ImportDefintion getComponentDefaultImport() { - return instance.getComponentDefaultImport(); + public int getLocalMode() { + return cs.getLocalMode(); } @Override - public lucee.commons.io.res.ResourceProvider[] getResourceProviders() { - return instance.getResourceProviders(); + public Resource getVideoDirectory() { + return cs.getVideoDirectory(); } @Override - public lucee.runtime.config.ConfigServer getConfigServer(java.lang.String arg0, long arg1) throws lucee.runtime.exp.PageException { - return instance.getConfigServer(arg0, arg1); + public Resource getExtensionDirectory() { + return cs.getExtensionDirectory(); } @Override - public ClassLoader getRPCClassLoader(boolean arg0, JavaSettings arg1, ClassLoader parent) throws java.io.IOException { - return instance.getRPCClassLoader(arg0, arg1, parent); + public ExtensionProvider[] getExtensionProviders() { + return cs.getExtensionProviders(); } @Override - public PhysicalClassLoader getDirectClassLoader(boolean reload) throws IOException { - return instance.getDirectClassLoader(reload); + public RHExtensionProvider[] getRHExtensionProviders() { + return cs.getRHExtensionProviders(); } @Override - public lucee.runtime.config.MockPool getDatasourceConnectionPool() { - return instance.getDatasourceConnectionPool(); + public Extension[] getExtensions() { + return cs.getExtensions(); } @Override - public int getServerPasswordType() { - return instance.getServerPasswordType(); + public RHExtension[] getRHExtensions() { + return cs.getRHExtensions(); } @Override - public lucee.runtime.PageSource getBaseComponentPageSource(int arg0) { - return instance.getBaseComponentPageSource(arg0); + public boolean isExtensionEnabled() { + return cs.isExtensionEnabled(); } @Override - public boolean checkForChangesInConfigFile() { - return instance.checkForChangesInConfigFile(); + public boolean allowRealPath() { + return cs.allowRealPath(); } @Override - public lucee.runtime.PageSource toPageSource(lucee.runtime.Mapping[] arg0, lucee.commons.io.res.Resource arg1, lucee.runtime.PageSource arg2) { - return instance.toPageSource(arg0, arg1, arg2); + public Class getClusterClass() { + return cs.getClusterClass(); } @Override - public lucee.runtime.monitor.RequestMonitor[] getRequestMonitors() { - return instance.getRequestMonitors(); - } - - public void setAllowURLRequestTimeout(boolean arg0) { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).setAllowURLRequestTimeout(arg0); - else((SingleContextConfigWeb) instance).setAllowURLRequestTimeout(arg0); + public Struct getRemoteClientUsage() { + return cs.getRemoteClientUsage(); } @Override - public java.lang.String getHash() { - return instance.getHash(); - } - - public void updatePassword(boolean arg0, lucee.runtime.config.Password arg1, lucee.runtime.config.Password arg2) throws lucee.runtime.exp.PageException { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).updatePassword(this, arg0, arg1, arg2); - // TODO what do do here? + public Class getAdminSyncClass() { + return cs.getAdminSyncClass(); } @Override - public short getInspectTemplate() { - return instance.getInspectTemplate(); + public AdminSync getAdminSync() throws ClassException { + return cs.getAdminSync(); } @Override - public lucee.runtime.monitor.ActionMonitor getActionMonitor(java.lang.String arg0) throws lucee.runtime.exp.PageException { - return instance.getActionMonitor(arg0); + public Class getVideoExecuterClass() { + return cs.getVideoExecuterClass(); } @Override - public boolean getTypeChecking() { - return instance.getTypeChecking(); + public Collection getTagMappings() { + return cs.getTagMappings(); } @Override - public lucee.runtime.config.RemoteClient[] getRemoteClients() { - return instance.getRemoteClients(); + public Mapping getTagMapping(String mappingName) { + return cs.getTagMapping(mappingName); } @Override - public boolean getComponentLocalSearch() { - return instance.getComponentLocalSearch(); + public Mapping getDefaultTagMapping() { + return cs.getDefaultTagMapping(); } @Override - public lucee.runtime.regex.Regex getRegex() { - return instance.getRegex(); + public Mapping getFunctionMapping(String mappingName) { + return cs.getFunctionMapping(mappingName); } @Override - public lucee.runtime.type.scope.Cluster createClusterScope() throws lucee.runtime.exp.PageException { - return instance.createClusterScope(); + public Mapping getDefaultFunctionMapping() { + return cs.getDefaultFunctionMapping(); } @Override - public lucee.runtime.type.dt.TimeSpan getRequestTimeout() { - return instance.getRequestTimeout(); + public Collection getFunctionMappings() { + return cs.getFunctionMappings(); } @Override - public java.lang.String getSerialNumber() { - return instance.getSerialNumber(); + public String getDefaultDataSource() { + return cs.getDefaultDataSource(); } @Override - public java.lang.String getInitParameter(java.lang.String arg0) { - return instance.getInitParameter(arg0); - } - - protected void setPasswordSource(short arg0) { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).setPasswordSource(arg0); - + public short getInspectTemplate() { + return cs.getInspectTemplate(); } @Override - public lucee.runtime.config.Password isPasswordEqual(java.lang.String arg0) { - return instance.isPasswordEqual(arg0); + public boolean getTypeChecking() { + return cs.getTypeChecking(); } @Override - public lucee.commons.lang.CharSet getWebCharSet() { - return instance.getWebCharSet(); + public String getSerialNumber() { + return cs.getSerialNumber(); } @Override - public lucee.runtime.Mapping getTagMapping(java.lang.String arg0) { - return instance.getTagMapping(arg0); + public Map getCacheConnections() { + return cs.getCacheConnections(); } @Override - public java.lang.String getDefaultDataSource() { - return instance.getDefaultDataSource(); + public CacheConnection getCacheDefaultConnection(int type) { + return cs.getCacheDefaultConnection(type); } @Override - public java.io.PrintWriter getErrWriter() { - return instance.getErrWriter(); + public String getCacheDefaultConnectionName(int type) { + return cs.getCacheDefaultConnectionName(type); } @Override - public boolean isClientCookies() { - return instance.isClientCookies(); + public boolean getExecutionLogEnabled() { + return cs.getExecutionLogEnabled(); } @Override - public java.util.Collection getServerTagMappings() { - return instance.getServerTagMappings(); + public ExecutionLogFactory getExecutionLogFactory() { + return cs.getExecutionLogFactory(); } @Override - public int getMailTimeout() { - return instance.getMailTimeout(); + public ORMEngine resetORMEngine(PageContext pc, boolean force) throws PageException { + return cs.resetORMEngine(pc, force); } @Override - public java.util.Map getAllLabels() { - return instance.getAllLabels(); + public ORMEngine getORMEngine(PageContext pc) throws PageException { + return cs.getORMEngine(pc); } @Override - public void putCTInitFile(java.lang.String arg0, lucee.runtime.customtag.InitFile arg1) { - instance.putCTInitFile(arg0, arg1); + public ClassDefinition getORMEngineClassDefintion() { + return cs.getORMEngineClassDefintion(); } @Override - public void resetServerFunctionMappings() { - instance.resetServerFunctionMappings(); + public Mapping[] getComponentMappings() { + return cs.getComponentMappings(); } @Override - public lucee.runtime.Mapping getDefaultTagMapping() { - return instance.getDefaultTagMapping(); + public ORMConfiguration getORMConfig() { + return cs.getORMConfig(); } @Override - public lucee.runtime.Mapping getDefaultServerTagMapping() { - return instance.getDefaultServerTagMapping(); + public CIPage getCachedPage(PageContext pc, String pathWithCFC) throws TemplateException { + return cs.getCachedPage(pc, pathWithCFC); } @Override - public lucee.runtime.lock.LockManager getLockManager() { - return instance.getLockManager(); + public void putCachedPageSource(String pathWithCFC, PageSource ps) { + cs.putCachedPageSource(pathWithCFC, ps); } @Override - public boolean getDefaultFunctionOutput() { - return instance.getDefaultFunctionOutput(); + public InitFile getCTInitFile(PageContext pc, String key) { + return cs.getCTInitFile(pc, key); } @Override - public boolean isClientManagement() { - return instance.isClientManagement(); + public void putCTInitFile(String key, InitFile initFile) { + cs.putCTInitFile(key, initFile); } @Override - public lucee.runtime.type.dt.TimeSpan getClientTimeout() { - return instance.getClientTimeout(); + public Struct listCTCache() { + return cs.listCTCache(); } @Override - public java.util.TimeZone getTimeZone() { - return instance.getTimeZone(); + public void clearCTCache() { + cs.clearCTCache(); } @Override - public boolean getPreciseMath() { - return instance.getPreciseMath(); + public void clearFunctionCache() { + cs.clearFunctionCache(); } @Override - public lucee.runtime.type.Struct listCTCache() { - return instance.listCTCache(); + public UDF getFromFunctionCache(String key) { + return cs.getFromFunctionCache(key); } @Override - public boolean passwordEqual(lucee.runtime.config.Password arg0) { - return instance.passwordEqual(arg0); + public void putToFunctionCache(String key, UDF udf) { + cs.putToFunctionCache(key, udf); } @Override - public boolean doComponentDeepSearch() { - return instance.doComponentDeepSearch(); + public Struct listComponentCache() { + return cs.listComponentCache(); } @Override - public lucee.commons.io.res.Resource getLocalExtensionProviderDirectory() { - return instance.getLocalExtensionProviderDirectory(); + public void clearComponentCache() { + cs.clearComponentCache(); } @Override - public java.lang.Class getAdminSyncClass() { - return instance.getAdminSyncClass(); + public void clearApplicationCache() { + cs.clearApplicationCache(); } @Override - public boolean hasPassword() { - return instance.hasPassword(); + public ImportDefintion getComponentDefaultImport() { + return cs.getComponentDefaultImport(); } @Override - public boolean getDotNotationUpperCase() { - return instance.getDotNotationUpperCase(); + public boolean getComponentLocalSearch() { + return cs.getComponentLocalSearch(); } @Override - public int getDebugMaxRecordsLogged() { - return instance.getDebugMaxRecordsLogged(); + public boolean getComponentRootSearch() { + return cs.getComponentRootSearch(); } @Override - public java.util.Collection getFunctionMappings() { - return instance.getFunctionMappings(); + public Compress getCompressInstance(Resource zipFile, int format, boolean caseSensitive) throws IOException { + return cs.getCompressInstance(zipFile, format, caseSensitive); } @Override - public lucee.runtime.net.amf.AMFEngine getAMFEngine() { - return instance.getAMFEngine(); + public boolean getSessionCluster() { + return cs.getSessionCluster(); } @Override - public lucee.runtime.type.dt.TimeSpan getCachedAfterTimeRange() { - return instance.getCachedAfterTimeRange(); + public boolean getClientCluster() { + return cs.getClientCluster(); } @Override - public lucee.runtime.db.ClassDefinition getCacheDefinition(java.lang.String arg0) { - return instance.getCacheDefinition(arg0); + public String getClientStorage() { + return cs.getClientStorage(); } @Override - public java.util.Iterator getCacheHandlers() { - return instance.getCacheHandlers(); + public String getSessionStorage() { + return cs.getSessionStorage(); } @Override - public java.lang.ClassLoader getClassLoaderEnv() { - return instance.getClassLoaderEnv(); + public DebugEntry[] getDebugEntries() { + return cs.getDebugEntries(); } @Override - public boolean getSessionCluster() { - return instance.getSessionCluster(); + public DebugEntry getDebugEntry(String ip, DebugEntry defaultValue) { + return cs.getDebugEntry(ip, defaultValue); } @Override - public lucee.commons.io.res.Resource getConfigDir() { - return instance.getConfigDir(); + public int getDebugMaxRecordsLogged() { + return cs.getDebugMaxRecordsLogged(); } @Override - public lucee.runtime.db.DataSource getDataSource(java.lang.String arg0) throws PageException { - return instance.getDataSource(arg0); + public boolean getDotNotationUpperCase() { + return cs.getDotNotationUpperCase(); } @Override - public lucee.runtime.net.rpc.WSHandler getWSHandler() throws lucee.runtime.exp.PageException { - return instance.getWSHandler(); + public boolean preserveCase() { + return cs.preserveCase(); } @Override - public lucee.runtime.Mapping getServerFunctionMapping(java.lang.String arg0) { - return instance.getServerFunctionMapping(arg0); + public boolean getDefaultFunctionOutput() { + return cs.getDefaultFunctionOutput(); } @Override - public lucee.runtime.debug.DebuggerPool getDebuggerPool() { - return instance.getDebuggerPool(); + public boolean getSuppressWSBeforeArg() { + return cs.getSuppressWSBeforeArg(); } @Override - public boolean mergeFormAndURL() { - return instance.mergeFormAndURL(); + public RestSettings getRestSetting() { + return cs.getRestSetting(); } @Override - public int getMailSpoolInterval() { - return instance.getMailSpoolInterval(); + public int getCFMLWriterType() { + return cs.getCFMLWriterType(); } @Override - public long getLoadTime() { - return instance.getLoadTime(); + public boolean getBufferOutput() { + return cs.getBufferOutput(); } @Override - public lucee.runtime.net.mail.Server[] getMailServers() { - return instance.getMailServers(); + public boolean hasDebugOptions(int debugOption) { + return cs.hasDebugOptions(debugOption); } @Override - public lucee.commons.io.res.Resource getPluginDirectory() { - return instance.getPluginDirectory(); + public boolean checkForChangesInConfigFile() { + return cs.checkForChangesInConfigFile(); } @Override - public int getQueueMax() { - return instance.getQueueMax(); + public int getExternalizeStringGTE() { + return cs.getExternalizeStringGTE(); } @Override - public lucee.runtime.Mapping[] getComponentMappings() { - return instance.getComponentMappings(); - } - - public lucee.runtime.Mapping getDefaultServerFunctionMapping() { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getDefaultServerFunctionMapping(); - else return ((SingleContextConfigWeb) instance).getDefaultServerFunctionMapping(); + public Map getLoggers() { + return cs.getLoggers(); } @Override - public java.lang.String getErrorTemplate(int arg0) { - return instance.getErrorTemplate(arg0); + public Log getLog(String name) { + return cs.getLog(name); } @Override - public lucee.runtime.PageSource[] getPageSources(lucee.runtime.PageContext arg0, lucee.runtime.Mapping[] arg1, java.lang.String arg2, boolean arg3, boolean arg4, - boolean arg5) { - return instance.getPageSources(arg0, arg1, arg2, arg3, arg4, arg5); + public Log getLog(String name, boolean createIfNecessary) throws PageException { + return cs.getLog(name, createIfNecessary); } @Override - public Resource[] getResources(lucee.runtime.PageContext arg0, lucee.runtime.Mapping[] arg1, java.lang.String arg2, boolean arg3, boolean arg4, boolean arg5, boolean arg6, - boolean arg7) { - return instance.getResources(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); + public Map> getTagDefaultAttributeValues() { + return cs.getTagDefaultAttributeValues(); } @Override - public lucee.runtime.engine.ExecutionLogFactory getExecutionLogFactory() { - return instance.getExecutionLogFactory(); + public Boolean getHandleUnQuotedAttrValueAsString() { + return cs.getHandleUnQuotedAttrValueAsString(); } @Override - public boolean contentLength() { - return instance.contentLength(); - } - - public void flushApplicationPathCache() { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).flushApplicationPathCache(); - else((SingleContextConfigWeb) instance).flushApplicationPathCache(); + public Object getCachedWithin(int type) { + return cs.getCachedWithin(type); } @Override - public boolean isMailSendPartial() { - return instance.isMailSendPartial(); - } - - public lucee.runtime.config.ConfigServerImpl getConfigServerImpl() { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getConfigServerImpl(); - return ((SingleContextConfigWeb) instance).getConfigServerImpl(); + public Resource getPluginDirectory() { + return cs.getPluginDirectory(); } @Override - public lucee.runtime.net.proxy.ProxyData getProxyData() { - return instance.getProxyData(); + public Resource getLogDirectory() { + return cs.getLogDirectory(); } @Override - public lucee.commons.io.log.Log getLog(java.lang.String arg0) { - return instance.getLog(arg0); + public String getSalt() { + return cs.getSalt(); } @Override - @Deprecated - public java.lang.String getTimeServer() { - return instance.getTimeServer(); + public int getPasswordType() { + return cs.getPasswordType(); } @Override - public boolean allowRequestTimeout() { - return instance.allowRequestTimeout(); - } - - public void createTag(lucee.transformer.library.tag.TagLib arg0, java.lang.String arg1, java.lang.String arg2) { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).createTag(arg0, arg1, arg2); - else((SingleContextConfigWeb) instance).createTag(arg0, arg1, arg2); + public String getPasswordSalt() { + return cs.getPasswordSalt(); } - public lucee.commons.lang.CharSet getTemplateCharSet() { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getTemplateCharSet(); - else return ((SingleContextConfigWeb) instance).getTemplateCharSet(); + @Override + public int getPasswordOrigin() { + return cs.getPasswordOrigin(); } @Override - public lucee.commons.lock.KeyLock getContextLock() { - return instance.getContextLock(); + public Collection getExtensionBundleDefintions() { + return cs.getExtensionBundleDefintions(); } @Override - public lucee.runtime.type.dt.TimeSpan getApplicationTimeout() { - return instance.getApplicationTimeout(); + public JDBCDriver[] getJDBCDrivers() { + return cs.getJDBCDrivers(); } @Override - public java.lang.String getSessionStorage() { - return instance.getSessionStorage(); + public JDBCDriver getJDBCDriverByClassName(String className, JDBCDriver defaultValue) { + return cs.getJDBCDriverByClassName(className, defaultValue); } @Override - public lucee.runtime.config.ConfigServer getConfigServer(String password) throws lucee.runtime.exp.PageException { - return instance.getConfigServer(this, password); + public JDBCDriver getJDBCDriverById(String id, JDBCDriver defaultValue) { + return cs.getJDBCDriverById(id, defaultValue); } - public void setCacheMD5(java.lang.String arg0) { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).setCacheMD5(arg0); - + @Override + public JDBCDriver getJDBCDriverByBundle(String bundleName, Version version, JDBCDriver defaultValue) { + return cs.getJDBCDriverByBundle(bundleName, version, defaultValue); } @Override - public lucee.runtime.spooler.SpoolerEngine getSpoolerEngine() { - return instance.getSpoolerEngine(); + public JDBCDriver getJDBCDriverByCD(ClassDefinition cd, JDBCDriver defaultValue) { + return cs.getJDBCDriverByCD(cd, defaultValue); } @Override - public lucee.commons.io.res.Resource getEventGatewayDirectory() { - return instance.getEventGatewayDirectory(); + public int getQueueMax() { + return cs.getQueueMax(); } @Override - public boolean debug() { - return instance.debug(); + public long getQueueTimeout() { + return cs.getQueueTimeout(); } @Override - public boolean getShowDebug() { - return instance.getShowDebug(); + public boolean getQueueEnable() { + return cs.getQueueEnable(); } @Override - public boolean getShowDoc() { - return instance.getShowDoc(); + public boolean getCGIScopeReadonly() { + return cs.getCGIScopeReadonly(); } @Override - public boolean getShowMetric() { - return instance.getShowMetric(); + public Resource getDeployDirectory() { + return cs.getDeployDirectory(); } @Override - public boolean getShowTest() { - return instance.getShowTest(); + public Map getCacheDefinitions() { + return cs.getCacheDefinitions(); } @Override - public lucee.runtime.Mapping getFunctionMapping(java.lang.String arg0) { - return instance.getFunctionMapping(arg0); + public ClassDefinition getCacheDefinition(String className) { + return cs.getCacheDefinition(className); } @Override - public java.util.Collection getTagMappings() { - return instance.getTagMappings(); + public Resource getAntiSamyPolicy() { + return cs.getAntiSamyPolicy(); } @Override - public lucee.commons.io.res.type.compress.Compress getCompressInstance(lucee.commons.io.res.Resource arg0, int arg1, boolean arg2) throws java.io.IOException { - return instance.getCompressInstance(arg0, arg1, arg2); + public LogEngine getLogEngine() { + return cs.getLogEngine(); } @Override - public lucee.commons.io.res.Resource getTempDirectory() { - return instance.getTempDirectory(); + public TimeSpan getCachedAfterTimeRange() { + return cs.getCachedAfterTimeRange(); } @Override - public lucee.runtime.type.Struct listComponentCache() { - return instance.listComponentCache(); + public Map getStartups() { + return cs.getStartups(); } @Override - public void putToFunctionCache(java.lang.String arg0, lucee.runtime.type.UDF arg1) { - instance.putToFunctionCache(arg0, arg1); + public Regex getRegex() { + return cs.getRegex(); } @Override - public int getLoginDelay() { - return instance.getLoginDelay(); + public RHExtension[] getServerRHExtensions() { + return cs.getRHExtensions(); } @Override - public java.util.Map getDataSourcesAsMap() { - return instance.getDataSourcesAsMap(); + public Cluster createClusterScope() throws PageException { + return cs.createClusterScope(); } - public void flushCTPathCache() { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).flushCTPathCache(); - else((SingleContextConfigWeb) instance).flushCTPathCache(); + @Override + public PageSource getApplicationPageSource(PageContext pc, String path, String filename, int mode, RefBoolean isCFC) { + return cs.getApplicationPageSource(pc, path, filename, mode, isCFC); } @Override - public lucee.runtime.CIPage getCachedPage(lucee.runtime.PageContext arg0, java.lang.String arg1) throws lucee.runtime.exp.TemplateException { - return instance.getCachedPage(arg0, arg1); + public void putApplicationPageSource(String path, PageSource ps, String filename, int mode, boolean isCFC) { + cs.putApplicationPageSource(path, ps, filename, mode, isCFC); } @Override - public java.util.Map getTagDefaultAttributeValues() { - return instance.getTagDefaultAttributeValues(); + public Collection getAllExtensionBundleDefintions() { + return cs.getAllExtensionBundleDefintions(); } @Override - public lucee.runtime.config.ConfigServer getConfigServer(lucee.runtime.config.Password arg0) throws lucee.runtime.exp.PageException { - return instance.getConfigServer(arg0); + public void checkPassword() throws PageException { + cs.checkPassword(); } @Override - public void clearApplicationCache() { - instance.clearApplicationCache(); + public List loadLocalExtensions(boolean validate) { + return cs.loadLocalExtensions(validate); } @Override - public java.util.Map getCacheDefinitions() { - return instance.getCacheDefinitions(); + public Collection getAllRHExtensions() { + return cs.getAllRHExtensions(); } @Override - public boolean isExtensionEnabled() { - return instance.isExtensionEnabled(); + public boolean allowRequestTimeout() { + return cs.allowRequestTimeout(); } @Override - public short getPasswordSource() { - return instance.getPasswordSource(); + public boolean closeConnection() { + return cs.closeConnection(); } @Override - public lucee.runtime.db.JDBCDriver getJDBCDriverByClassName(java.lang.String arg0, lucee.runtime.db.JDBCDriver arg1) { - return instance.getJDBCDriverByClassName(arg0, arg1); + public void checkPermGenSpace(boolean check) { + cs.checkPermGenSpace(check); } @Override - public void clearCTCache() { - instance.clearCTCache(); + public ActionMonitor getActionMonitor(String arg0) throws PageException { + return cs.getActionMonitor(arg0); } - public void putComponentMetadata(java.lang.String arg0, ComponentMetaData arg1) { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).putComponentMetadata(arg0, arg1); - else((SingleContextConfigWeb) instance).putComponentMetadata(arg0, arg1); + @Override + public ConfigServer getConfigServer(String arg0) throws PageException { + return cs.getConfigServer(arg0); } @Override - public boolean isAllowURLRequestTimeout() { - return instance.isAllowURLRequestTimeout(); + public ConfigServer getConfigServer(String arg0, long arg1) throws PageException { + return cs.getConfigServer(arg0, arg1); } @Override - public java.util.Map getStartups() { - return instance.getStartups(); + public boolean getFullNullSupport() { + return cs.getFullNullSupport(); } @Override - public java.lang.String getLabel() { - return instance.getLabel(); + public IdentificationWeb getIdentification() { + if (id == null) id = new SCCWIdentificationWeb(cs.getIdentification()); + return id; } - public java.lang.String[] getLogNames() { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getLogNames(); - else return ((SingleContextConfigWeb) instance).getLogNames(); + @Override + public IntervallMonitor getIntervallMonitor(String arg0) throws PageException { + return cs.getIntervallMonitor(arg0); } @Override - public lucee.commons.io.res.Resource getClassesDirectory() { - return instance.getClassesDirectory(); + public IntervallMonitor[] getIntervallMonitors() { + return cs.getIntervallMonitors(); } @Override - public lucee.runtime.extension.Extension[] getExtensions() { - return instance.getExtensions(); + public Resource getLocalExtensionProviderDirectory() { + return cs.getLocalExtensionProviderDirectory(); } @Override - @Deprecated - public long getTimeServerOffset() { - return instance.getTimeServerOffset(); + public boolean getLoginCaptcha() { + return cs.getLoginCaptcha(); } @Override - public int getQueryVarUsage() { - return instance.getQueryVarUsage(); + public int getLoginDelay() { + return cs.getLoginDelay(); } @Override - public ResourceProviderFactory[] getResourceProviderFactories() { - return instance.getResourceProviderFactories(); + public boolean getRememberMe() { + return cs.getRememberMe(); } @Override - public long lastModified() { - return instance.lastModified(); + public RequestMonitor getRequestMonitor(String arg0) throws PageException { + return cs.getRequestMonitor(arg0); } @Override - public lucee.runtime.compiler.CFMLCompilerImpl getCompiler() { - return instance.getCompiler(); + public RequestMonitor[] getRequestMonitors() { + return cs.getRequestMonitors(); } @Override - public boolean isMonitoringEnabled() { - return instance.isMonitoringEnabled(); + public Resource getSecurityDirectory() { + return cs.getSecurityDirectory(); } @Override - public boolean hasDebugOptions(int arg0) { - return instance.hasDebugOptions(arg0); + public ThreadQueue getThreadQueue() { + return cs.getThreadQueue(); } @Override - public java.lang.String getClientStorage() { - return instance.getClientStorage(); + public boolean hasServerPassword() { + return cs.hasServerPassword(); } @Override - public lucee.runtime.cache.CacheConnection getCacheDefaultConnection(int arg0) { - return instance.getCacheDefaultConnection(arg0); + public boolean isMonitoringEnabled() { + return cs.isMonitoringEnabled(); } @Override - public void putApplicationPageSource(java.lang.String arg0, lucee.runtime.PageSource arg1, java.lang.String arg2, int arg3, boolean arg4) { - instance.putApplicationPageSource(arg0, arg1, arg2, arg3, arg4); + public AMFEngine getAMFEngine() { + return helper.getAMFEngine(); } - protected void setAMFEngine(lucee.runtime.net.amf.AMFEngine arg0) { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).setAMFEngine(arg0); - + @Override + public ConfigServer getConfigServer(Password password) throws PageException { + cs.checkAccess(password); + return cs; } @Override - public boolean getBufferOutput() { - return instance.getBufferOutput(); + public Resource getConfigServerDir() { + return cs.getConfigDir(); } @Override - @Deprecated - public void reloadTimeServerOffset() { - instance.reloadTimeServerOffset(); + public CFMLFactory getFactory() { + return factory; } @Override - public boolean isSuppressWhitespace() { - return instance.isSuppressWhitespace(); + public String getLabel() { + return helper.getLabel(); } @Override - public lucee.runtime.search.SearchEngine getSearchEngine(lucee.runtime.PageContext arg0) throws lucee.runtime.exp.PageException { - return instance.getSearchEngine(arg0); + public LockManager getLockManager() { + return helper.getLockManager(); } @Override - public lucee.runtime.Mapping[] getCustomTagMappings() { - return instance.getCustomTagMappings(); + public SearchEngine getSearchEngine(PageContext pc) throws PageException { + return helper.getSearchEngine(pc); } @Override - public lucee.runtime.config.Password updatePasswordIfNecessary(boolean arg0, java.lang.String arg1) { - return instance.updatePasswordIfNecessary(arg0, arg1); + public CFMLWriter getWriter(PageContext pc, HttpServletRequest req, HttpServletResponse rsp) { + return getCFMLWriter(pc, req, rsp); } @Override - public java.util.List loadLocalExtensions(boolean arg0) { - return instance.loadLocalExtensions(arg0); + public String getInitParameter(String name) { + return config.getInitParameter(name); } @Override - public boolean isShowVersion() { - return instance.isShowVersion(); + public Enumeration getInitParameterNames() { + return config.getInitParameterNames(); } @Override - public lucee.commons.lang.CharSet getResourceCharSet() { - return instance.getResourceCharSet(); + public ServletContext getServletContext() { + return config.getServletContext(); } @Override - public java.net.URL getUpdateLocation() { - return instance.getUpdateLocation(); + public long getApplicationPathCacheTimeout() { + return cs.getApplicationPathCacheTimeout(); } @Override - public lucee.runtime.extension.RHExtension[] getServerRHExtensions() { - return instance.getServerRHExtensions(); + public String getServletName() { + return config.getServletName(); } @Override - public java.lang.String getServerPasswordSalt() { - return instance.getServerPasswordSalt(); + public Mapping getDefaultServerTagMapping() { + return cs.defaultTagMapping; } - protected void setGatewayEntries(GatewayMap entries) { - // TODO i think that method is never used - if (instance instanceof ConfigImpl) ((ConfigImpl) instance).setGatewayEntries(entries); + // FYI used by Extensions, do not remove + public Mapping getApplicationMapping(String virtual, String physical) { + return getApplicationMapping("application", virtual, physical, null, true, false); } @Override - public lucee.runtime.orm.ORMEngine getORMEngine(lucee.runtime.PageContext arg0) throws lucee.runtime.exp.PageException { - return instance.getORMEngine(arg0); + public Mapping getApplicationMapping(String type, String virtual, String physical, String archive, boolean physicalFirst, boolean ignoreVirtual) { + return getApplicationMapping(type, virtual, physical, archive, physicalFirst, ignoreVirtual, true, true); } - public long getSessionScopeDirSize() { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getSessionScopeDirSize(); - else return ((SingleContextConfigWeb) instance).getSessionScopeDirSize(); + @Override + public Collection getServerFunctionMappings() { + return helper.getServerFunctionMappings(); } @Override - public int getPasswordOrigin() { - return instance.getPasswordOrigin(); + public Mapping getServerFunctionMapping(String mappingName) { + return helper.getServerFunctionMapping(mappingName); } - public void clearResourceProviders() { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).clearResourceProviders(); - + @Override + public Collection getServerTagMappings() { + return helper.getServerTagMappings(); } @Override - public lucee.runtime.db.ClassDefinition getORMEngineClassDefintion() { - return instance.getORMEngineClassDefintion(); + public Mapping getServerTagMapping(String mappingName) { + return helper.getServerTagMapping(mappingName); } @Override - public lucee.commons.io.res.Resource getSessionScopeDir() { - return instance.getSessionScopeDir(); + public Map getAllLabels() { + return cs.getLabels(); } @Override - public lucee.commons.io.res.Resource getRemoteClientDirectory() { - return instance.getRemoteClientDirectory(); + public boolean isDefaultPassword() { + // TODO no sure about this + return false; } @Override - public java.lang.String getServletName() { - return instance.getServletName(); + public int getServerPasswordType() { + return cs.getPasswordType(); } @Override - public lucee.commons.io.res.Resource getResource(java.lang.String arg0) { - return instance.getResource(arg0); + public String getServerPasswordSalt() { + return cs.getPasswordSalt(); } @Override - public boolean getClientCluster() { - return instance.getClientCluster(); + public int getServerPasswordOrigin() { + return cs.getPasswordOrigin(); } @Override - public lucee.transformer.library.tag.TagLib[] getTLDs() { - return instance.getTLDs(); + public GatewayEngine getGatewayEngine() throws PageException { + return helper.getGatewayEngineImpl(getGatewayEntries()); } - public lucee.runtime.Mapping getApplicationMapping(java.lang.String arg0, java.lang.String arg1) { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getApplicationMapping(arg0, arg1); - else return ((SingleContextConfigWeb) instance).getApplicationMapping(arg0, arg1); + @Override + public WSHandler getWSHandler() throws PageException { + return helper.getWSHandler(); } @Override - public lucee.commons.io.res.Resource getRootDirectory() { - return instance.getRootDirectory(); + public CFMLCompilerImpl getCompiler() { + return helper.getCompiler(); } @Override - public void clearComponentCache() { - instance.clearComponentCache(); + public Mapping getApplicationMapping(String type, String virtual, String physical, String archive, boolean physicalFirst, boolean ignoreVirtual, + boolean checkPhysicalFromWebroot, boolean checkArchiveFromWebroot) { + return helper.getApplicationMapping(type, virtual, physical, archive, physicalFirst, ignoreVirtual, checkPhysicalFromWebroot, checkArchiveFromWebroot); } @Override - public java.nio.charset.Charset getTemplateCharset() { - return instance.getTemplateCharset(); + public Mapping[] getApplicationMappings() { + return helper.getApplicationMappings(); } - public int getMode() { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getMode(); - else return ((SingleContextConfigWeb) instance).getMode(); + @Override + public boolean isApplicationMapping(Mapping mapping) { + return helper.isApplicationMapping(mapping); } @Override - public lucee.runtime.Mapping[] getMappings() { - return instance.getMappings(); + public CIPage getBaseComponentPage(PageContext pc) throws PageException { + return helper.getBaseComponentPage(pc); } @Override - public lucee.commons.io.res.Resource getVideoDirectory() { - return instance.getVideoDirectory(); + public void resetBaseComponentPage() { + helper.resetBaseComponentPage(); } @Override - public lucee.commons.io.log.LogEngine getLogEngine() { - return instance.getLogEngine(); + public ActionMonitorCollector getActionMonitorCollector() { + return cs.getActionMonitorCollector(); } @Override - public java.lang.String[] getCustomTagExtensions() { - return instance.getCustomTagExtensions(); + public KeyLock getContextLock() { + return helper.getContextLock(); } @Override - public lucee.runtime.extension.RHExtensionProvider[] getRHExtensionProviders() { - return instance.getRHExtensionProviders(); - } + public CacheHandlerCollection getCacheHandlerCollection(int type, CacheHandlerCollection defaultValue) { + return helper.getCacheHandlerCollection(type, defaultValue); - public void setCacheDefinitions(java.util.Map arg0) { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).setCacheDefinitions(arg0); } @Override - public boolean isDefaultPassword() { - return instance.isDefaultPassword(); + public void releaseCacheHandlers(PageContext pc) { + helper.releaseCacheHandlers(pc); } @Override - public lucee.runtime.orm.ORMConfiguration getORMConfig() { - return instance.getORMConfig(); + public DebuggerPool getDebuggerPool() { + return helper.getDebuggerPool(); } @Override - public lucee.runtime.db.JDBCDriver getJDBCDriverById(java.lang.String arg0, lucee.runtime.db.JDBCDriver arg1) { - return instance.getJDBCDriverById(arg0, arg1); + public CFMLWriter getCFMLWriter(PageContext pc, HttpServletRequest req, HttpServletResponse rsp) { + return helper.getCFMLWriter(pc, req, rsp); } @Override - public java.lang.Object getCachedWithin(int arg0) { - return instance.getCachedWithin(arg0); + public TagHandlerPool getTagHandlerPool() { + return helper.getTagHandlerPool(); } @Override - public lucee.runtime.Mapping getApplicationMapping(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3, boolean arg4, boolean arg5) { - return instance.getApplicationMapping(arg0, arg1, arg2, arg3, arg4, arg5); + public String getHash() { + return SystemUtil.hash(getServletContext()); } @Override - public int getPasswordType() { - return instance.getPasswordType(); + public void updatePassword(String passwordOld, String passwordNew) throws PageException { + try { + PasswordImpl.updatePassword(cs, passwordOld, passwordNew); + } + catch (Exception e) { + throw Caster.toPageException(e); + } } - public lucee.runtime.db.ClassDefinition getORMEngineClass() { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getORMEngineClass(); - else return ((SingleContextConfigWeb) instance).getORMEngineClass(); + @Override + public Password updatePasswordIfNecessary(String passwordRaw) { + return PasswordImpl.updatePasswordIfNecessary(cs, cs.password, passwordRaw); } @Override - public lucee.runtime.monitor.RequestMonitor getRequestMonitor(java.lang.String arg0) throws lucee.runtime.exp.PageException { - return instance.getRequestMonitor(arg0); + public Password isServerPasswordEqual(String password) { + return cs.isPasswordEqual(password); } @Override - public boolean getExecutionLogEnabled() { - return instance.getExecutionLogEnabled(); + public boolean hasIndividualSecurityManager() { + return false; } @Override - public CFMLWriter getWriter(lucee.runtime.PageContext arg0, HttpServletRequest arg1, HttpServletResponse arg2) { - return instance.getCFMLWriter(arg0, arg1, arg2); + public short getPasswordSource() { + return ConfigWebPro.PASSWORD_ORIGIN_SERVER; } @Override - public boolean allowCompression() { - return instance.allowCompression(); + public void reset() { + helper.reset(); } @Override - public lucee.runtime.config.DebugEntry getDebugEntry(java.lang.String arg0, lucee.runtime.config.DebugEntry arg1) { - return instance.getDebugEntry(arg0, arg1); + public void setPassword(Password pw) { + cs.setPassword(pw); } - public void createFunction(lucee.transformer.library.function.FunctionLib arg0, java.lang.String arg1, java.lang.String arg2) { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).createFunction(arg0, arg1, arg2); + private static class SCCWIdentificationWeb implements IdentificationWeb, Serializable { - } + private static final long serialVersionUID = -9020697769127921035L; - @Override - public lucee.runtime.security.SecurityManager getSecurityManager() { - return instance.getSecurityManager(); - } + private IdentificationServer id; - @Override - public lucee.runtime.writer.CFMLWriter getCFMLWriter(lucee.runtime.PageContext arg0, HttpServletRequest arg1, HttpServletResponse arg2) { - return instance.getCFMLWriter(arg0, arg1, arg2); - } + public SCCWIdentificationWeb(IdentificationServer id) { + this.id = id; + } - @Override - public lucee.runtime.CFMLFactory getFactory() { - return instance.getFactory(); - } + @Override + public String getApiKey() { + return id.getApiKey(); + } - @Override - public lucee.commons.io.res.Resource getClassDirectory() { - return instance.getClassDirectory(); + @Override + public String getId() { + return id.getId(); + } + + @Override + public String getSecurityKey() { + return id.getSecurityKey(); + } + + @Override + public String getSecurityToken() { + return id.getSecurityToken(); + } + + @Override + public String toQueryString() { + return id.toQueryString(); + } + + @Override + public IdentificationServer getServerIdentification() { + return id; + } } - public lucee.runtime.dump.DumpWriterEntry[] getDumpWritersEntries() { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getDumpWritersEntries(); - else return ((SingleContextConfigWeb) instance).getDumpWritersEntries(); + public void reload() { + synchronized (this) { + createMapping(); + createRestMapping(); + } } - protected void setSecurityManager(lucee.runtime.security.SecurityManager arg0) { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).setSecurityManager(arg0); + private void createMapping() { + Map existing = getExistingMappings(); + + // Mapping + Map mappings = MapFactory.getConcurrentMap(); + Mapping tmp; + boolean finished = false; + Mapping ex; + Mapping[] sm = cs.getMappings(); + if (sm != null) { + for (int i = 0; i < sm.length; i++) { + if (!sm[i].isHidden()) { + if ("/".equals(sm[i].getVirtual())) finished = true; + ex = existing.get(sm[i].getVirtualLowerCase()); + if (ex != null && ex.equals(sm[i])) { + mappings.put(ex.getVirtualLowerCase(), ex); + continue; + } + else if (sm[i] instanceof MappingImpl) { + tmp = ((MappingImpl) sm[i]).cloneReadOnly(this); + mappings.put(tmp.getVirtualLowerCase(), tmp); + + } + else { + tmp = sm[i]; + mappings.put(tmp.getVirtualLowerCase(), tmp); + } + + if (ex instanceof MappingImpl) { + ((MappingImpl) ex).flush(); + } + + } + } + } + if (!finished) { + Mapping m; + if (ResourceUtil.isUNCPath(getRootDirectory().getPath())) { + m = new MappingImpl(this, "/", getRootDirectory().getPath(), null, ConfigPro.INSPECT_UNDEFINED, ConfigPro.INSPECT_INTERVAL_UNDEFINED, + ConfigPro.INSPECT_INTERVAL_UNDEFINED, true, true, true, true, false, false, null, -1, -1); + } + else { + m = new MappingImpl(this, "/", "/", null, ConfigPro.INSPECT_UNDEFINED, ConfigPro.INSPECT_INTERVAL_UNDEFINED, ConfigPro.INSPECT_INTERVAL_UNDEFINED, true, true, true, + true, false, false, null, -1, -1, true, true); + } + ex = existing.get("/"); + if (ex != null && ex.equals(m)) { + m = ex; + } + mappings.put("/", m); + } + this.mappings = ConfigUtil.sort(mappings.values().toArray(new Mapping[mappings.size()])); + } + + private void createRestMapping() { + Map mappings = MapFactory.getConcurrentMap(); + lucee.runtime.rest.Mapping[] sm = cs.getRestMappings(); + lucee.runtime.rest.Mapping tmp; + if (sm != null) { + for (int i = 0; i < sm.length; i++) { + try { + // if (!sm[i].isHidden()) { + tmp = sm[i].duplicate(this, Boolean.TRUE); + mappings.put(tmp.getVirtual(), tmp); + // } + } + catch (Exception e) { + + } + } + } + this.restMappings = mappings.values().toArray(new lucee.runtime.rest.Mapping[mappings.size()]); } - @Override - public java.util.Collection getAllExtensionBundleDefintions() { - return instance.getAllExtensionBundleDefintions(); + private Map getExistingMappings() { + Map mappings = MapFactory.getConcurrentMap(); + + if (this.mappings != null) { + for (Mapping m: this.mappings) { + mappings.put(m.getVirtualLowerCase(), m); + } + } + return mappings; } @Override - public lucee.runtime.db.DataSource[] getDataSources() { - return instance.getDataSources(); + public void removeDatasourceConnectionPool(DataSource ds) { + cs.removeDatasourceConnectionPool(ds); } @Override - public lucee.commons.io.res.Resource getLogDirectory() { - return instance.getLogDirectory(); + public MockPool getDatasourceConnectionPool() { + return cs.getDatasourceConnectionPool(); } @Override - public boolean hasServerPassword() { - return instance.hasServerPassword(); + public boolean getPreciseMath() { + return cs.getPreciseMath(); } @Override - public lucee.runtime.type.Struct getRemoteClientUsage() { - return instance.getRemoteClientUsage(); + public void resetServerFunctionMappings() { + } @Override - public java.lang.ClassLoader getRPCClassLoader(boolean arg0) throws java.io.IOException { - return instance.getRPCClassLoader(arg0); + public Resource getWebConfigDir() { + return this.configDirWeb; } @Override - public java.util.Collection getAllRHExtensions() { - return instance.getAllRHExtensions(); + public ServletConfig getServletConfig() { + return config; } @Override - public long getClientScopeDirSize() { - return instance.getClientScopeDirSize(); + public void setLastModified() { + cs.setLastModified(); } - @Override - public boolean useComponentShadow() { - return instance.useComponentShadow(); + public Object[] getConsoleLayouts() throws PageException { + return cs.getConsoleLayouts(); } - @Override - public lucee.runtime.PageSource getPageSourceExisting(lucee.runtime.PageContext arg0, lucee.runtime.Mapping[] arg1, java.lang.String arg2, boolean arg3, boolean arg4, - boolean arg5, boolean arg6) { - return instance.getPageSourceExisting(arg0, arg1, arg2, arg3, arg4, arg5, arg6); + public String getServerSalt() { + return cs.getSalt(); } - @Override - public boolean getRememberMe() { - return instance.getRememberMe(); + public int getDebugOptions() { + return cs.getDebugOptions(); } - @Override - public int getExternalizeStringGTE() { - return instance.getExternalizeStringGTE(); + public GatewayMap getGatewayEntries() { + return cs.getGatewayEntries(); } - @Override - public lucee.runtime.config.AdminSync getAdminSync() throws lucee.commons.lang.ClassException { - return instance.getAdminSync(); + public Mapping getScriptMapping() { + return cs.getScriptMapping(); } - @Override - public lucee.runtime.monitor.ActionMonitorCollector getActionMonitorCollector() { - return instance.getActionMonitorCollector(); + public void resetRPCClassLoader() { + cs.resetRPCClassLoader(); } - @Override - public void putCachedPageSource(java.lang.String arg0, lucee.runtime.PageSource arg1) { - instance.putCachedPageSource(arg0, arg1); + public PageSource[] getPageSources(PageContext arg0, Mapping[] arg1, String arg2, boolean arg3, boolean arg4, boolean arg5, boolean arg6, boolean arg7) { + return cs.getPageSources(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); } - @Override - public boolean getLoginCaptcha() { - return instance.getLoginCaptcha(); + public Object[] getResourceLayouts() throws PageException { + return cs.getResourceLayouts(); } - @Override - public boolean getErrorStatusCode() { - return instance.getErrorStatusCode(); + public void clearComponentMetadata() { + cs.clearComponentMetadata(); } - @Override - public lucee.runtime.type.dt.TimeSpan getSessionTimeout() { - return instance.getSessionTimeout(); + public void flushComponentPathCache() { + cs.flushApplicationPathCache(); } - @Override - public lucee.commons.io.res.Resource getCacheDir() { - return instance.getCacheDir(); + public String createSecurityToken() { + return cs.createSecurityToken(); } - @Override - public void checkPassword() throws lucee.runtime.exp.PageException { - instance.checkPassword(); + public Resource getServerConfigDir() { + return cs.getConfigDir(); } - @Override - public int getServerPasswordOrigin() { - return instance.getServerPasswordOrigin(); + public String getCacheMD5() { + return cs.getCacheMD5(); } - @Override - public lucee.runtime.type.Struct getConstants() { - return instance.getConstants(); + public ComponentMetaData getComponentMetadata(String arg0) { + return cs.getComponentMetadata(arg0); } - @Override - public boolean getTriggerComponentDataMember() { - return instance.getTriggerComponentDataMember(); + public Cache createRAMCache(Struct arg0) throws IOException { + return cs.createRAMCache(arg0); } - @Override - public lucee.runtime.extension.RHExtension[] getRHExtensions() { - return instance.getRHExtensions(); + public void setAllowURLRequestTimeout(boolean arg0) { + cs.setAllowURLRequestTimeout(arg0); } - @Override - public java.util.Map getLoggers() { - return instance.getLoggers(); + public Mapping getDefaultServerFunctionMapping() { + return cs.getDefaultFunctionMapping(); } - @Override - public boolean isDomainCookies() { - return instance.isDomainCookies(); + public void flushApplicationPathCache() { + cs.flushApplicationPathCache(); } - @Override - public lucee.transformer.library.tag.TagLib getCoreTagLib() { - return instance.getCoreTagLib(); + public void createTag(TagLib arg0, String arg1, String arg2) { + cs.createTag(arg0, arg1, arg2); } - protected void setMode(int mode) { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).setMode(mode); + public CharSet getTemplateCharSet() { + return cs.getTemplateCharSet(); } - protected void setSalt(String salt) { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).setSalt(salt); + public void flushCTPathCache() { + cs.flushCTPathCache(); } - protected void setCheckForChangesInConfigFile(boolean checkForChangesInConfigFile) { - if (instance instanceof MultiContextConfigWeb) ((MultiContextConfigWeb) instance).setCheckForChangesInConfigFile(checkForChangesInConfigFile); + public void putComponentMetadata(String arg0, ComponentMetaData arg1) { + cs.putComponentMetadata(arg0, arg1); } - public ConfigWebPro getInstance() { - return instance; + public String[] getLogNames() { + return cs.getLogNames(); } - public ConfigWebImpl setInstance(ConfigWebInner instance) { - if (this.instance != null) { - this.instance.reset(); - } - this.instance = instance; - return this; + public long getSessionScopeDirSize() { + return cs.getSessionScopeDirSize(); } - @Override - public boolean isSingle() { - return instance.isSingle(); + public int getMode() { + return cs.getMode(); } - @Override - public Resource getWebConfigDir() { - return instance.getWebConfigDir(); + public ClassDefinition getORMEngineClass() { + return cs.getORMEngineClass(); } - public Password getPassword() { - if (instance instanceof MultiContextConfigWeb) return ((MultiContextConfigWeb) instance).getPassword(); - else return ((SingleContextConfigWeb) instance).getPassword(); + public DumpWriterEntry[] getDumpWritersEntries() { + return cs.getDumpWritersEntries(); } @Override - public ServletConfig getServletConfig() { - return instance.getServletConfig(); + public Password getPassword() { + return cs.getPassword(); } @Override - public void setLastModified() { - instance.setLastModified(); + public void setIdentification(IdentificationWeb arg0) { + // ignore it, should not happen + LogUtil.log(Log.LEVEL_FATAL, "loading", "setting a web id for single context"); } @Override public void checkMappings() { - instance.checkMappings(); + cs.checkMappings(); } @Override public String getMainLogger() { - return instance.getMainLogger(); + return cs.getMainLogger(); } @Override public int getInspectTemplateAutoInterval(boolean slow) { - return instance.getInspectTemplateAutoInterval(slow); + return cs.getInspectTemplateAutoInterval(slow); } @Override public boolean getFormUrlAsStruct() { - return instance.getFormUrlAsStruct(); + return cs.getFormUrlAsStruct(); } @Override public int getReturnFormat() { - return instance.getReturnFormat(); + return cs.getReturnFormat(); } @Override public JavaSettings getJavaSettings(String id) { - return instance.getJavaSettings(id); + return cs.getJavaSettings(id); } @Override public void setJavaSettings(String id, JavaSettings js) { - instance.setJavaSettings(id, js); + cs.setJavaSettings(id, js); } @Override public Resource getMavenDir() { - return instance.getMavenDir(); + return cs.getMavenDir(); } @Override public JavaSettings getJavaSettings() { - return instance.getJavaSettings(); + return cs.getJavaSettings(); } @Override public Resource getExtensionInstalledDir() { - return instance.getExtensionInstalledDir(); + return cs.getExtensionInstalledDir(); } @Override public Resource getExtensionAvailableDir() { - return instance.getExtensionAvailableDir(); + return cs.getExtensionAvailableDir(); } @Override public Collection getAIEngineFactoryNames() { - return instance.getAIEngineFactoryNames(); + return cs.getAIEngineFactoryNames(); } @Override public AIEngineFactory getAIEngineFactory(String name) { - return instance.getAIEngineFactory(name); + return cs.getAIEngineFactory(name); } @Override public AIEnginePool getAIEnginePool() { - return instance.getAIEnginePool(); + return cs.getAIEnginePool(); } @Override public CFMLEngine getEngine() { - return instance.getEngine(); + return cs.getEngine(); } -} +} \ No newline at end of file diff --git a/core/src/main/java/lucee/runtime/config/ConfigWebInner.java b/core/src/main/java/lucee/runtime/config/ConfigWebInner.java deleted file mode 100644 index b2eb8adaa0..0000000000 --- a/core/src/main/java/lucee/runtime/config/ConfigWebInner.java +++ /dev/null @@ -1,12 +0,0 @@ -package lucee.runtime.config; - -import lucee.runtime.exp.ExpressionException; -import lucee.runtime.exp.PageException; - -public interface ConfigWebInner extends ConfigWebPro { - public void updatePassword(ConfigWebImpl outer, boolean server, String passwordOld, String passwordNew) throws PageException; - - public ConfigServer getConfigServer(ConfigWebImpl outer, String password) throws ExpressionException; - - public boolean hasIndividualSecurityManager(ConfigWebImpl outer); -} diff --git a/core/src/main/java/lucee/runtime/config/ConfigWebPro.java b/core/src/main/java/lucee/runtime/config/ConfigWebPro.java index 280b9a5211..94fbaec347 100644 --- a/core/src/main/java/lucee/runtime/config/ConfigWebPro.java +++ b/core/src/main/java/lucee/runtime/config/ConfigWebPro.java @@ -16,7 +16,6 @@ import lucee.runtime.CIPage; import lucee.runtime.Mapping; import lucee.runtime.PageContext; -import lucee.runtime.compiler.CFMLCompilerImpl; import lucee.runtime.debug.DebuggerPool; import lucee.runtime.exp.PageException; import lucee.runtime.gateway.GatewayEngine; @@ -58,8 +57,6 @@ public interface ConfigWebPro extends ConfigWeb, ConfigPro { public GatewayEngine getGatewayEngine() throws PageException; - public CFMLCompilerImpl getCompiler(); - public Mapping getApplicationMapping(String type, String virtual, String physical, String archive, boolean physicalFirst, boolean ignoreVirtual, boolean checkPhysicalFromWebroot, boolean checkArchiveFromWebroot); @@ -85,9 +82,11 @@ public Mapping getApplicationMapping(String type, String virtual, String physica public String getHash(); - public void updatePassword(boolean server, String passwordOld, String passwordNew) throws PageException, IOException, SAXException, BundleException; + public void updatePassword(String passwordOld, String passwordNew) throws PageException, IOException, SAXException, BundleException; + + public Password getPassword(); - public Password updatePasswordIfNecessary(boolean server, String passwordRaw); + public Password updatePasswordIfNecessary(String passwordRaw); public Password isServerPasswordEqual(String password); @@ -97,13 +96,11 @@ public Mapping getApplicationMapping(String type, String virtual, String physica public void resetServerFunctionMappings(); - public boolean isSingle(); - public Resource getWebConfigDir(); public ServletConfig getServletConfig(); public void setIdentification(IdentificationWeb id); - public void checkMappings(); + public ConfigServer getConfigServer(); } diff --git a/core/src/main/java/lucee/runtime/config/DeployHandler.java b/core/src/main/java/lucee/runtime/config/DeployHandler.java index 31d7f1c527..3497985b4a 100644 --- a/core/src/main/java/lucee/runtime/config/DeployHandler.java +++ b/core/src/main/java/lucee/runtime/config/DeployHandler.java @@ -127,7 +127,7 @@ public static void deploy(Config config, Log log, boolean force) { if (config instanceof ConfigServer) { String extensionIds = StringUtil.unwrap(SystemUtil.getSystemPropOrEnvVar("lucee-extensions", null)); // old no longer used if (StringUtil.isEmpty(extensionIds, true)) extensionIds = StringUtil.unwrap(SystemUtil.getSystemPropOrEnvVar("lucee.extensions", null)); - CFMLEngineImpl engine = (CFMLEngineImpl) ConfigWebUtil.getEngine(config); + CFMLEngineImpl engine = (CFMLEngineImpl) ConfigUtil.getEngine(config); if (engine != null && !StringUtil.isEmpty(extensionIds, true) && !extensionIds.equals(engine.getEnvExt())) { try { engine.setEnvExt(extensionIds); @@ -303,7 +303,7 @@ public static RHExtension deployExtension(Config config, ExtensionDefintion ed, // check if the zip is valid if (res instanceof File) { if (!IsZipFile.invoke((File) res)) { - CFMLEngineImpl engine = CFMLEngineImpl.toCFMLEngineImpl(ConfigWebUtil.getEngine(config)); + CFMLEngineImpl engine = CFMLEngineImpl.toCFMLEngineImpl(ConfigUtil.getEngine(config)); engine.deployBundledExtension(true); if (IsZipFile.invoke((File) res)) { continue; // we start over that part diff --git a/core/src/main/java/lucee/runtime/config/ExportImportHandler.java b/core/src/main/java/lucee/runtime/config/ExportImportHandler.java index 6ac21b5765..ef6c7ab78f 100644 --- a/core/src/main/java/lucee/runtime/config/ExportImportHandler.java +++ b/core/src/main/java/lucee/runtime/config/ExportImportHandler.java @@ -137,7 +137,7 @@ private static List exportMapping(Mapping[] mappings, Resource dir, Stri m = new HashMap(); list.add(m); m.put("virtual", mapping.getVirtual()); - m.put("inspect", ConfigWebUtil.inspectTemplate(mi.getInspectTemplateRaw(), "")); + m.put("inspect", ConfigUtil.inspectTemplate(mi.getInspectTemplateRaw(), "")); m.put("toplevel", mapping.isTopLevel()); m.put("readonly", mapping.isReadonly()); m.put("hidden", mapping.isHidden()); diff --git a/core/src/main/java/lucee/runtime/config/MultiContextConfigWeb.java b/core/src/main/java/lucee/runtime/config/MultiContextConfigWeb.java deleted file mode 100644 index e9a99f0d67..0000000000 --- a/core/src/main/java/lucee/runtime/config/MultiContextConfigWeb.java +++ /dev/null @@ -1,641 +0,0 @@ -/** - * Copyright (c) 2014, the Railo Company Ltd. - * Copyright (c) 2015, Lucee Association Switzerland - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - */ -package lucee.runtime.config; - -import java.net.URL; -import java.util.Collection; -import java.util.Enumeration; -import java.util.List; -import java.util.Map; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import lucee.commons.io.SystemUtil; -import lucee.commons.io.res.Resource; -import lucee.commons.io.res.ResourceProvider; -import lucee.commons.io.res.ResourcesImpl; -import lucee.commons.lock.KeyLock; -import lucee.loader.engine.CFMLEngine; -import lucee.runtime.CFMLFactory; -import lucee.runtime.CFMLFactoryImpl; -import lucee.runtime.CIPage; -import lucee.runtime.Mapping; -import lucee.runtime.PageContext; -import lucee.runtime.ai.AIEngineFactory; -import lucee.runtime.ai.AIEnginePool; -import lucee.runtime.cache.tag.CacheHandlerCollection; -import lucee.runtime.cfx.CFXTagPool; -import lucee.runtime.compiler.CFMLCompilerImpl; -import lucee.runtime.debug.DebuggerPool; -import lucee.runtime.engine.ThreadLocalPageContext; -import lucee.runtime.engine.ThreadQueue; -import lucee.runtime.exp.ExpressionException; -import lucee.runtime.exp.PageException; -import lucee.runtime.exp.SecurityException; -import lucee.runtime.extension.ExtensionDefintion; -import lucee.runtime.extension.RHExtension; -import lucee.runtime.gateway.GatewayEngine; -import lucee.runtime.lock.LockManager; -import lucee.runtime.monitor.ActionMonitor; -import lucee.runtime.monitor.ActionMonitorCollector; -import lucee.runtime.monitor.IntervallMonitor; -import lucee.runtime.monitor.RequestMonitor; -import lucee.runtime.net.amf.AMFEngine; -import lucee.runtime.net.http.ReqRspUtil; -import lucee.runtime.net.rpc.WSHandler; -import lucee.runtime.op.Caster; -import lucee.runtime.osgi.OSGiUtil.BundleDefinition; -import lucee.runtime.search.SearchEngine; -import lucee.runtime.security.SecurityManager; -import lucee.runtime.security.SecurityManagerImpl; -import lucee.runtime.tag.TagHandlerPool; -import lucee.runtime.type.scope.Cluster; -import lucee.runtime.writer.CFMLWriter; - -/** - * Web Context - */ -class MultiContextConfigWeb extends ConfigImpl implements ServletConfig, ConfigWebInner { - - private final ServletConfig config; - private final ConfigServerImpl configServer; - private SecurityManager securityManager; - - private Resource rootDir; - - private final CFMLFactoryImpl factory; - - private final ConfigWebHelper helper; - private short passwordSource; - - // private File deployDirectory; - - /** - * constructor of the class - * - * @param configServer - * @param config - * @param configDir - * @param configFile - * @param cloneServer - */ - MultiContextConfigWeb(CFMLFactoryImpl factory, ConfigServerImpl configServer, ServletConfig config, Resource configDir, Resource configFile) { - super(configDir, configFile); - this.configServer = configServer; - this.config = config; - this.factory = factory; - ResourceProvider frp = ResourcesImpl.getFileResourceProvider(); - - this.rootDir = frp.getResource(ReqRspUtil.getRootPath(config.getServletContext())); - - // Fix for tomcat - if (this.rootDir.getName().equals(".") || this.rootDir.getName().equals("..")) this.rootDir = this.rootDir.getParentResource(); - helper = new ConfigWebHelper(configServer, this); - } - - @Override - public void reset() { - super.reset(); - factory.resetPageContext(); - helper.reset(); - } - - @Override - public String getServletName() { - return config.getServletName(); - } - - @Override - public ServletContext getServletContext() { - return config.getServletContext(); - } - - @Override - public String getInitParameter(String name) { - return config.getInitParameter(name); - } - - @Override - public Enumeration getInitParameterNames() { - return config.getInitParameterNames(); - } - - protected ConfigServerImpl getConfigServerImpl() { - return configServer; - } - - @Override - @Deprecated - public ConfigServer getConfigServer(String password) throws ExpressionException { - return getConfigServer((ConfigWebImpl) ThreadLocalPageContext.getConfig(), password); - } - - @Override - public ConfigServer getConfigServer(ConfigWebImpl outer, String password) throws ExpressionException { - Password pw = isServerPasswordEqual(password); - if (pw == null) pw = PasswordImpl.passwordToCompare(outer, true, password); - return getConfigServer(pw); - } - - @Override - public ConfigServer getConfigServer(Password password) throws ExpressionException { - configServer.checkAccess(password); - return configServer; - } - - @Override - public ConfigServer getConfigServer(String key, long timeNonce) throws PageException { - configServer.checkAccess(key, timeNonce); - return configServer; - } - - public Resource getServerConfigDir() { - return configServer.getConfigDir(); - } - - /** - * @return Returns the accessor. - */ - @Override - public SecurityManager getSecurityManager() { - return securityManager; - } - - /** - * @param securityManager The accessor to set. - */ - protected void setSecurityManager(SecurityManager securityManager) { - ((SecurityManagerImpl) securityManager).setRootDirectory(getRootDirectory()); - this.securityManager = securityManager; - } - - @Override - public CFXTagPool getCFXTagPool() throws SecurityException { - if (securityManager.getAccess(SecurityManager.TYPE_CFX_USAGE) == SecurityManager.VALUE_YES) return super.getCFXTagPool(); - throw new SecurityException("no access to cfx functionality", "disabled by security settings"); - } - - /** - * @return Returns the rootDir. - */ - @Override - public Resource getRootDirectory() { - return rootDir; - } - - @Override - public String getUpdateType() { - return configServer.getUpdateType(); - } - - @Override - public URL getUpdateLocation() { - return configServer.getUpdateLocation(); - } - - @Override - public LockManager getLockManager() { - return helper.getLockManager(); - } - - /** - * @return the compiler - */ - @Override - public CFMLCompilerImpl getCompiler() { - return helper.getCompiler(); - } - - @Override - public CIPage getBaseComponentPage(PageContext pc) throws PageException { - return helper.getBaseComponentPage(pc); - } - - @Override - public void resetBaseComponentPage() { - helper.resetBaseComponentPage(); - } - - @Override - public Collection getServerTagMappings() { - return helper.getServerTagMappings(); - } - - @Override - public Mapping getDefaultServerTagMapping() { - return getConfigServerImpl().defaultTagMapping; - } - - @Override - public Mapping getServerTagMapping(String mappingName) { - return helper.getServerTagMapping(mappingName); - } - - @Override - public Collection getServerFunctionMappings() { - return helper.getServerFunctionMappings(); - } - - @Override - public void resetServerFunctionMappings() { - helper.resetServerFunctionMappings(); - } - - @Override - public Mapping getServerFunctionMapping(String mappingName) { - return helper.getServerFunctionMapping(mappingName); - } - - public Mapping getDefaultServerFunctionMapping() { - return getConfigServerImpl().defaultFunctionMapping; - } - - // FYI used by Extensions, do not remove - public Mapping getApplicationMapping(String virtual, String physical) { - return getApplicationMapping("application", virtual, physical, null, true, false); - } - - @Override - public boolean isApplicationMapping(Mapping mapping) { - return helper.isApplicationMapping(mapping); - } - - @Override - public Mapping getApplicationMapping(String type, String virtual, String physical, String archive, boolean physicalFirst, boolean ignoreVirtual) { - return getApplicationMapping(type, virtual, physical, archive, physicalFirst, ignoreVirtual, true, true); - } - - @Override - public Mapping getApplicationMapping(String type, String virtual, String physical, String archive, boolean physicalFirst, boolean ignoreVirtual, - boolean checkPhysicalFromWebroot, boolean checkArchiveFromWebroot) { - return helper.getApplicationMapping(type, virtual, physical, archive, physicalFirst, ignoreVirtual, checkPhysicalFromWebroot, checkArchiveFromWebroot); - } - - @Override - public Mapping[] getApplicationMappings() { - return helper.getApplicationMappings(); - } - - @Override - public String getLabel() { - return helper.getLabel(); - } - - @Override - public String getHash() { - return SystemUtil.hash(getServletContext()); - } - - @Override - public KeyLock getContextLock() { - return helper.getContextLock(); - } - - @Override - public GatewayEngine getGatewayEngine() throws PageException { - return helper.getGatewayEngineImpl(getGatewayEntries()); - } - - @Override - public TagHandlerPool getTagHandlerPool() { - return helper.getTagHandlerPool(); - } - - @Override - public DebuggerPool getDebuggerPool() { - return helper.getDebuggerPool(); - } - - @Override - public ThreadQueue getThreadQueue() { - return configServer.getThreadQueue(); - } - - @Override - public int getLoginDelay() { - return configServer.getLoginDelay(); - } - - @Override - public boolean getLoginCaptcha() { - return configServer.getLoginCaptcha(); - } - - @Override - public boolean getRememberMe() { - return configServer.getRememberMe(); - } - - @Override - public Resource getSecurityDirectory() { - return configServer.getSecurityDirectory(); - } - - @Override - public boolean isMonitoringEnabled() { - return configServer.isMonitoringEnabled(); - } - - @Override - public RequestMonitor[] getRequestMonitors() { - return configServer.getRequestMonitors(); - } - - @Override - public RequestMonitor getRequestMonitor(String name) throws PageException { - return configServer.getRequestMonitor(name); - } - - @Override - public IntervallMonitor[] getIntervallMonitors() { - return configServer.getIntervallMonitors(); - } - - @Override - public IntervallMonitor getIntervallMonitor(String name) throws PageException { - return configServer.getIntervallMonitor(name); - } - - @Override - public void checkPermGenSpace(boolean check) { - configServer.checkPermGenSpace(check); - } - - @Override - public Cluster createClusterScope() throws PageException { - return configServer.createClusterScope(); - } - - @Override - public boolean hasServerPassword() { - return configServer.hasPassword(); - } - - @Override - @Deprecated - public void updatePassword(boolean server, String passwordOld, String passwordNew) throws PageException { - updatePassword((ConfigWebImpl) ThreadLocalPageContext.getConfig(), server, passwordOld, passwordNew); - } - - @Override - public void updatePassword(ConfigWebImpl outer, boolean server, String passwordOld, String passwordNew) throws PageException { - try { - PasswordImpl.updatePassword(server ? configServer : outer, passwordOld, passwordNew); - } - catch (Exception e) { - throw Caster.toPageException(e); - } - } - - public void updatePassword(ConfigWebImpl outer, boolean server, Password passwordOld, Password passwordNew) throws PageException { - try { - PasswordImpl.updatePassword(server ? configServer : outer, passwordOld, passwordNew); - } - catch (Exception e) { - throw Caster.toPageException(e); - } - } - - @Override - public Password updatePasswordIfNecessary(boolean server, String passwordRaw) { - ConfigPro config = server ? configServer : this; - return PasswordImpl.updatePasswordIfNecessary(config, ((ConfigImpl) config).password, passwordRaw); - } - - @Override - public Resource getConfigServerDir() { - return configServer.getConfigDir(); - } - - @Override - public Map getAllLabels() { - return configServer.getLabels(); - } - - @Override - public boolean allowRequestTimeout() { - return configServer.allowRequestTimeout(); - } - - @Override - public CFMLWriter getCFMLWriter(PageContext pc, HttpServletRequest req, HttpServletResponse rsp) { - return helper.getCFMLWriter(pc, req, rsp); - } - - @Override - public CFMLWriter getWriter(PageContext pc, HttpServletRequest req, HttpServletResponse rsp) { - return getCFMLWriter(pc, req, rsp); - } - - @Override - public ActionMonitorCollector getActionMonitorCollector() { - return configServer.getActionMonitorCollector(); - } - - @Override - public boolean hasIndividualSecurityManager() { - return hasIndividualSecurityManager((ConfigWebImpl) ThreadLocalPageContext.getConfig()); - } - - @Override - public boolean hasIndividualSecurityManager(ConfigWebImpl outer) { - return helper.hasIndividualSecurityManager(outer); - } - - @Override - public CFMLFactory getFactory() { - return factory; - } - - @Override - public CacheHandlerCollection getCacheHandlerCollection(int type, CacheHandlerCollection defaultValue) { - return helper.getCacheHandlerCollection(type, defaultValue); - } - - @Override - public void releaseCacheHandlers(PageContext pc) { - helper.releaseCacheHandlers(pc); - } - - @Override - public void setIdentification(IdentificationWeb id) { - helper.setIdentification(id); - } - - @Override - public IdentificationWeb getIdentification() { - IdentificationWeb id = helper.getIdentification(); - if (id != null) return id; - - // MUST patch for LDEV-4568 remove asap - Config cw = ThreadLocalPageContext.getConfig(); - if (cw instanceof ConfigWebImpl) { - ConfigWebImpl cwi = (ConfigWebImpl) cw; - ConfigServerImpl csi = cwi.getConfigServerImpl(); - return new IdentificationWebImpl(cwi, csi.getIdentification().getSecurityKey(), csi.getIdentification().getApiKey()); - } - return null; - } - - @Override - public int getServerPasswordType() { - return configServer.getPasswordType(); - } - - @Override - public String getServerPasswordSalt() { - return configServer.getPasswordSalt(); - } - - @Override - public int getServerPasswordOrigin() { - return configServer.getPasswordOrigin(); - } - - public String getServerSalt() { - return configServer.getSalt(); - } - - @Override - public Password isServerPasswordEqual(String password) { - return configServer.isPasswordEqual(password); - } - - @Override - public boolean isDefaultPassword() { - if (password == null) return false; - return password == configServer.defaultPassword; - } - - @Override - public Collection getAllExtensionBundleDefintions() { - return configServer.getAllExtensionBundleDefintions(); - } - - @Override - public Collection getAllRHExtensions() { - return configServer.getAllRHExtensions(); - } - - @Override - public SearchEngine getSearchEngine(PageContext pc) throws PageException { - return helper.getSearchEngine(pc); - } - - @Override - public ActionMonitor getActionMonitor(String name) { - return configServer.getActionMonitor(name); - } - - @Override - public Resource getLocalExtensionProviderDirectory() { - return configServer.getLocalExtensionProviderDirectory(); - } - - protected void setAMFEngine(AMFEngine engine) { - helper.setAMFEngine(engine); - } - - @Override - public AMFEngine getAMFEngine() { - return helper.getAMFEngine(); - } - - /* - * public boolean installServerExtension(ExtensionDefintion ed) throws PageException { return - * configServer.installExtension(ed); } - */ - - @Override - public RHExtension[] getServerRHExtensions() { - return configServer.getRHExtensions(); - } - - @Override - public List loadLocalExtensions(boolean validate) { - return configServer.loadLocalExtensions(validate); - } - - @Override - public WSHandler getWSHandler() throws PageException { - return helper.getWSHandler(); - } - - protected void setPasswordSource(short passwordSource) { - this.passwordSource = passwordSource; - } - - @Override - public short getPasswordSource() { - return passwordSource; - } - - @Override - public void checkPassword() throws PageException { - configServer.checkPassword(); - } - - @Override - public short getAdminMode() { - return configServer.getAdminMode(); - } - - @Override - public boolean isSingle() { - return false; - } - - @Override - public Resource getWebConfigDir() { - return getConfigDir(); - } - - @Override - public ServletConfig getServletConfig() { - return config; - } - - @Override - public Resource getMavenDir() { - return configServer.getMavenDir(); - } - - @Override - public Collection getAIEngineFactoryNames() { - return configServer.getAIEngineFactoryNames(); - } - - @Override - public AIEngineFactory getAIEngineFactory(String name) { - return configServer.getAIEngineFactory(name); - } - - @Override - public AIEnginePool getAIEnginePool() { - return configServer.getAIEnginePool(); - } - - @Override - public CFMLEngine getEngine() { - return configServer.getEngine(); - } -} \ No newline at end of file diff --git a/core/src/main/java/lucee/runtime/config/PasswordImpl.java b/core/src/main/java/lucee/runtime/config/PasswordImpl.java index 036ab09705..460cee5b90 100644 --- a/core/src/main/java/lucee/runtime/config/PasswordImpl.java +++ b/core/src/main/java/lucee/runtime/config/PasswordImpl.java @@ -285,27 +285,21 @@ public static void updatePassword(ConfigPro config, Password passwordOld, Passwo admin.storeAndReload(); } else { - ConfigWebUtil.checkPassword(config, "write", passwordOld); - ConfigWebUtil.checkGeneralWriteAccess(config, passwordOld); + ConfigUtil.checkPassword(config, "write", passwordOld); + ConfigUtil.checkGeneralWriteAccess(config, passwordOld); ConfigAdmin admin = ConfigAdmin.newInstance(config, passwordOld); admin.setPassword(passwordNew); admin.storeAndReload(); } } - public static Password passwordToCompare(ConfigWeb cw, boolean server, String rawPassword) { + public static Password passwordToCompare(ConfigWeb cw, String rawPassword) { if (StringUtil.isEmpty(rawPassword, true)) return null; ConfigWebPro cwi = (ConfigWebPro) cw; int pwType; String pwSalt; - if (server) { - pwType = cwi.getServerPasswordType(); - pwSalt = cwi.getServerPasswordSalt(); - } - else { - pwType = cwi.getPasswordType(); - pwSalt = cwi.getPasswordSalt(); - } + pwType = cwi.getPasswordType(); + pwSalt = cwi.getPasswordSalt(); // if the internal password is not using the salt yet, this hash should eigther String salt = pwType == Password.HASHED ? null : pwSalt; diff --git a/core/src/main/java/lucee/runtime/config/SingleContextConfigWeb.java b/core/src/main/java/lucee/runtime/config/SingleContextConfigWeb.java deleted file mode 100644 index cecf50466f..0000000000 --- a/core/src/main/java/lucee/runtime/config/SingleContextConfigWeb.java +++ /dev/null @@ -1,2146 +0,0 @@ -package lucee.runtime.config; - -import java.io.IOException; -import java.io.PrintWriter; -import java.io.Serializable; -import java.net.URL; -import java.nio.charset.Charset; -import java.util.Collection; -import java.util.Enumeration; -import java.util.Iterator; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Map.Entry; -import java.util.TimeZone; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.osgi.framework.Version; - -import lucee.commons.collection.MapFactory; -import lucee.commons.io.SystemUtil; -import lucee.commons.io.cache.Cache; -import lucee.commons.io.log.Log; -import lucee.commons.io.log.LogEngine; -import lucee.commons.io.log.LogUtil; -import lucee.commons.io.log.LoggerAndSourceData; -import lucee.commons.io.res.Resource; -import lucee.commons.io.res.ResourceProvider; -import lucee.commons.io.res.ResourcesImpl; -import lucee.commons.io.res.ResourcesImpl.ResourceProviderFactory; -import lucee.commons.io.res.type.compress.Compress; -import lucee.commons.io.res.util.ResourceUtil; -import lucee.commons.lang.CharSet; -import lucee.commons.lang.ClassException; -import lucee.commons.lang.PhysicalClassLoader; -import lucee.commons.lang.types.RefBoolean; -import lucee.commons.lock.KeyLock; -import lucee.loader.engine.CFMLEngine; -import lucee.runtime.CFMLFactory; -import lucee.runtime.CFMLFactoryImpl; -import lucee.runtime.CIPage; -import lucee.runtime.Mapping; -import lucee.runtime.MappingImpl; -import lucee.runtime.PageContext; -import lucee.runtime.PageSource; -import lucee.runtime.ai.AIEngineFactory; -import lucee.runtime.ai.AIEnginePool; -import lucee.runtime.cache.CacheConnection; -import lucee.runtime.cache.tag.CacheHandler; -import lucee.runtime.cache.tag.CacheHandlerCollection; -import lucee.runtime.cfx.CFXTagPool; -import lucee.runtime.compiler.CFMLCompilerImpl; -import lucee.runtime.component.ImportDefintion; -import lucee.runtime.config.gateway.GatewayMap; -import lucee.runtime.customtag.InitFile; -import lucee.runtime.db.ClassDefinition; -import lucee.runtime.db.DataSource; -import lucee.runtime.db.JDBCDriver; -import lucee.runtime.debug.DebuggerPool; -import lucee.runtime.dump.DumpWriter; -import lucee.runtime.dump.DumpWriterEntry; -import lucee.runtime.engine.ExecutionLogFactory; -import lucee.runtime.engine.ThreadQueue; -import lucee.runtime.exp.DatabaseException; -import lucee.runtime.exp.DeprecatedException; -import lucee.runtime.exp.ExpressionException; -import lucee.runtime.exp.PageException; -import lucee.runtime.exp.PageRuntimeException; -import lucee.runtime.exp.SecurityException; -import lucee.runtime.exp.TemplateException; -import lucee.runtime.extension.Extension; -import lucee.runtime.extension.ExtensionDefintion; -import lucee.runtime.extension.ExtensionProvider; -import lucee.runtime.extension.RHExtension; -import lucee.runtime.extension.RHExtensionProvider; -import lucee.runtime.gateway.GatewayEngine; -import lucee.runtime.listener.ApplicationListener; -import lucee.runtime.listener.JavaSettings; -import lucee.runtime.lock.LockManager; -import lucee.runtime.monitor.ActionMonitor; -import lucee.runtime.monitor.ActionMonitorCollector; -import lucee.runtime.monitor.IntervallMonitor; -import lucee.runtime.monitor.RequestMonitor; -import lucee.runtime.net.amf.AMFEngine; -import lucee.runtime.net.http.ReqRspUtil; -import lucee.runtime.net.mail.Server; -import lucee.runtime.net.proxy.ProxyData; -import lucee.runtime.net.rpc.WSHandler; -import lucee.runtime.op.Caster; -import lucee.runtime.orm.ORMConfiguration; -import lucee.runtime.orm.ORMEngine; -import lucee.runtime.osgi.OSGiUtil.BundleDefinition; -import lucee.runtime.regex.Regex; -import lucee.runtime.rest.RestSettings; -import lucee.runtime.schedule.Scheduler; -import lucee.runtime.search.SearchEngine; -import lucee.runtime.security.SecurityManager; -import lucee.runtime.spooler.SpoolerEngine; -import lucee.runtime.tag.TagHandlerPool; -import lucee.runtime.type.Collection.Key; -import lucee.runtime.type.Struct; -import lucee.runtime.type.UDF; -import lucee.runtime.type.dt.TimeSpan; -import lucee.runtime.type.scope.Cluster; -import lucee.runtime.writer.CFMLWriter; -import lucee.transformer.library.function.FunctionLib; -import lucee.transformer.library.tag.TagLib; - -class SingleContextConfigWeb extends ConfigBase implements ConfigWebInner { - - private ConfigServerImpl cs; - protected Password password; - private final ConfigWebHelper helper; - private final ServletConfig config; - private final CFMLFactoryImpl factory; - private SCCWIdentificationWeb id; - private Resource rootDir; - private Mapping[] mappings; - private lucee.runtime.rest.Mapping[] restMappings; - private Resource configDirWeb; - - public SingleContextConfigWeb(CFMLFactoryImpl factory, ConfigServerImpl cs, ServletConfig config, Resource configDirWeb) { - this.factory = factory; - this.cs = cs; - this.config = config; - this.configDirWeb = configDirWeb; - ResourceProvider frp = ResourcesImpl.getFileResourceProvider(); - this.rootDir = frp.getResource(ReqRspUtil.getRootPath(config.getServletContext())); - - // Fix for tomcat - if (this.rootDir.getName().equals(".") || this.rootDir.getName().equals("..")) this.rootDir = this.rootDir.getParentResource(); - - helper = new ConfigWebHelper(cs, this); - - reload(); - } - - public ConfigServerImpl getConfigServerImpl() { - return cs; - } - - @Override - public boolean isAllowURLRequestTimeout() { - return cs.isAllowURLRequestTimeout(); - } - - @Override - public short getCompileType() { - return cs.getCompileType(); - } - - @Override - @Deprecated - public void reloadTimeServerOffset() { - cs.reloadTimeServerOffset(); - } - - @Override - public long lastModified() { - return cs.lastModified(); - } - - @Override - public short getScopeCascadingType() { - return cs.getScopeCascadingType(); - } - - @Override - public FunctionLib getFLDs() { - return cs.getFLDs(); - } - - @Override - public FunctionLib[] getFLDs(int dialect) { // used in image extension - return cs.getFLDs(dialect); - } - - @Override - public TagLib[] getTLDs() { - return cs.getTLDs(); - } - - @Override - public boolean allowImplicidQueryCall() { - return cs.allowImplicidQueryCall(); - } - - @Override - public boolean limitEvaluation() { - return cs.limitEvaluation(); - } - - @Override - public boolean mergeFormAndURL() { - return cs.mergeFormAndURL(); - } - - @Override - public TimeSpan getApplicationTimeout() { - return cs.getApplicationTimeout(); - } - - @Override - public TimeSpan getSessionTimeout() { - return cs.getSessionTimeout(); - } - - @Override - public TimeSpan getClientTimeout() { - return cs.getClientTimeout(); - } - - @Override - public TimeSpan getRequestTimeout() { - return cs.getRequestTimeout(); - } - - @Override - public boolean isClientCookies() { - return cs.isClientCookies(); - } - - @Override - public boolean isDevelopMode() { - return cs.isDevelopMode(); - } - - @Override - public boolean isClientManagement() { - return cs.isClientManagement(); - } - - @Override - public boolean isDomainCookies() { - return cs.isDomainCookies(); - } - - @Override - public boolean isSessionManagement() { - return cs.isSessionManagement(); - } - - @Override - public boolean isMailSpoolEnable() { - return cs.isMailSpoolEnable(); - } - - @Override - public boolean isMailSendPartial() { - return cs.isMailSendPartial(); - } - - @Override - public boolean isUserset() { - return cs.isUserset(); - } - - @Override - public Server[] getMailServers() { - return cs.getMailServers(); - } - - @Override - public int getMailTimeout() { - return cs.getMailTimeout(); - } - - @Override - public boolean getPSQL() { - return cs.getPSQL(); - } - - @Override - public int getQueryVarUsage() { - return cs.getQueryVarUsage(); - } - - @Override - public ClassLoader getClassLoader() { - return cs.getClassLoader(); - } - - @Override - public ClassLoader getClassLoaderEnv() { - return cs.getClassLoaderEnv(); - } - - @Override - public ClassLoader getClassLoaderCore() { - return cs.getClassLoaderCore(); - } - - @Override - public Locale getLocale() { - return cs.getLocale(); - } - - @Override - public boolean debug() { - return cs.debug(); - } - - @Override - public boolean getShowDebug() { - return cs.getShowDebug(); - } - - @Override - public boolean getShowDoc() { - return cs.getShowDoc(); - } - - @Override - public boolean getShowMetric() { - return cs.getShowMetric(); - } - - @Override - public boolean getShowTest() { - return cs.getShowTest(); - } - - @Override - public boolean debugLogOutput() { - return cs.debugLogOutput(); - } - - @Override - public Resource getTempDirectory() { - return cs.getTempDirectory(); - } - - @Override - public int getMailSpoolInterval() { - return cs.getMailSpoolInterval(); - } - - @Override - public TimeZone getTimeZone() { - return cs.getTimeZone(); - } - - @Override - @Deprecated - public long getTimeServerOffset() { - return cs.getTimeServerOffset(); - } - - @Override - public Scheduler getScheduler() { - return cs.getScheduler(); - } - - @Override - public Password isPasswordEqual(String password) { - return cs.isPasswordEqual(password); - } - - @Override - public boolean hasPassword() { - return cs.hasPassword(); - } - - @Override - public boolean passwordEqual(Password password) { - return cs.passwordEqual(password); - } - - @Override - public Mapping[] getMappings() { - if (mappings == null) { - synchronized (this) { - if (mappings == null) createMapping(); - } - } - return mappings;// cs.getMappings(); - } - - @Override - public lucee.runtime.rest.Mapping[] getRestMappings() { - if (restMappings == null) { - synchronized (this) { - if (restMappings == null) createRestMapping(); - } - } - return restMappings; - } - - @Override - public PageSource getPageSource(Mapping[] mappings, String realPath, boolean onlyTopLevel) { - throw new PageRuntimeException(new DeprecatedException("method not supported")); - } - - @Override - public PageSource getPageSourceExisting(PageContext pc, Mapping[] mappings, String realPath, boolean onlyTopLevel, boolean useSpecialMappings, boolean useDefaultMapping, - boolean onlyPhysicalExisting) { - return ConfigWebUtil.getPageSourceExisting(pc, this, mappings, realPath, onlyTopLevel, useSpecialMappings, useDefaultMapping, onlyPhysicalExisting); - } - - @Override - public PageSource[] getPageSources(PageContext pc, Mapping[] mappings, String realPath, boolean onlyTopLevel, boolean useSpecialMappings, boolean useDefaultMapping) { - return ConfigWebUtil.getPageSources(pc, this, mappings, realPath, onlyTopLevel, useSpecialMappings, useDefaultMapping, false, onlyFirstMatch); - } - - @Override - public PageSource[] getPageSources(PageContext pc, Mapping[] mappings, String realPath, boolean onlyTopLevel, boolean useSpecialMappings, boolean useDefaultMapping, - boolean useComponentMappings) { - return ConfigWebUtil.getPageSources(pc, this, mappings, realPath, onlyTopLevel, useSpecialMappings, useDefaultMapping, useComponentMappings, onlyFirstMatch); - } - - @Override - public Resource[] getResources(PageContext pc, Mapping[] mappings, String realPath, boolean onlyTopLevel, boolean useSpecialMappings, boolean useDefaultMapping, - boolean useComponentMappings, boolean onlyFirstMatch) { - return ConfigWebUtil.getResources(pc, this, mappings, realPath, onlyTopLevel, useSpecialMappings, useDefaultMapping, useComponentMappings, onlyFirstMatch); - } - - @Override - public Resource getPhysical(Mapping[] mappings, String realPath, boolean alsoDefaultMapping) { - throw new PageRuntimeException(new DeprecatedException("method not supported")); - } - - @Override - public Resource[] getPhysicalResources(PageContext pc, Mapping[] mappings, String realPath, boolean onlyTopLevel, boolean useSpecialMappings, boolean useDefaultMapping) { - throw new PageRuntimeException(new DeprecatedException("method not supported")); - } - - @Override - public Resource getPhysicalResourceExisting(PageContext pc, Mapping[] mappings, String realPath, boolean onlyTopLevel, boolean useSpecialMappings, boolean useDefaultMapping) { - throw new PageRuntimeException(new DeprecatedException("method not supported")); - } - - @Override - public PageSource toPageSource(Mapping[] mappings, Resource res, PageSource defaultValue) { - return ConfigWebUtil.toPageSource(this, mappings, res, defaultValue); - } - - @Override - public Resource getConfigDir() { - return cs.getConfigDir(); - } - - @Override - public Resource getConfigFile() { - return cs.getConfigFile(); - } - - @Override - public TagLib getCoreTagLib() { - return cs.getCoreTagLib(); - } - - @Override - public Mapping[] getCustomTagMappings() { - return cs.getCustomTagMappings(); - } - - @Override - public long getLoadTime() { - return cs.getLoadTime(); - } - - @Override - public CFXTagPool getCFXTagPool() throws SecurityException { - return cs.getCFXTagPool(); - } - - @Override - public String getBaseComponentTemplate(int dialect) { // FUTURE remove - return cs.getBaseComponentTemplate(dialect); - } - - @Override - public String getBaseComponentTemplate() { - return cs.getBaseComponentTemplate(); - } - - @Override - public PageSource getBaseComponentPageSource(int dialect) { // FUTURE remove - return cs.getBaseComponentPageSource(dialect); - } - - @Override - public PageSource getBaseComponentPageSource(PageContext pc, boolean force) { - return cs.getBaseComponentPageSource(pc, force); - } - - @Override - public boolean getRestList() { - return cs.getRestList(); - } - - @Override - public short getClientType() { - return cs.getClientType(); - } - - @Override - public ClassDefinition getSearchEngineClassDefinition() { - return cs.getSearchEngineClassDefinition(); - } - - @Override - public String getSearchEngineDirectory() { - return cs.getSearchEngineDirectory(); - } - - @Override - public int getComponentDataMemberDefaultAccess() { - return cs.getComponentDataMemberDefaultAccess(); - } - - @Override - public String getTimeServer() { - return cs.getTimeServer(); - } - - @Override - public String getComponentDumpTemplate() { - return cs.getComponentDumpTemplate(); - } - - @Override - public String getDebugTemplate() { - return cs.getDebugTemplate(); - } - - @Override - public String getErrorTemplate(int statusCode) { - return cs.getErrorTemplate(statusCode); - } - - @Override - public short getSessionType() { - return cs.getSessionType(); - } - - @Override - public String getUpdateType() { - return null; - } - - @Override - public URL getUpdateLocation() { - return null; - } - - @Override - public Resource getClassDirectory() { - return cs.getClassDirectory(); - } - - @Override - public Resource getLibraryDirectory() { - return cs.getLibraryDirectory(); - } - - @Override - public Resource getEventGatewayDirectory() { - return cs.getEventGatewayDirectory(); - } - - @Override - public Resource getClassesDirectory() { - return cs.getClassesDirectory(); - } - - @Override - public Resource getRootDirectory() { - return rootDir; - } - - @Override - public boolean isSuppressWhitespace() { - return cs.isSuppressWhitespace(); - } - - @Override - public boolean isSuppressContent() { - return cs.isSuppressContent(); - } - - @Override - public String getDefaultEncoding() { - return cs.getDefaultEncoding(); - } - - @Override - public Charset getTemplateCharset() { - return cs.getTemplateCharset(); - } - - @Override - public Charset getWebCharset() { - return cs.getWebCharset(); - } - - @Override - public CharSet getWebCharSet() { - return cs.getWebCharSet(); - } - - @Override - public Charset getResourceCharset() { - return cs.getResourceCharset(); - } - - @Override - public CharSet getResourceCharSet() { - return cs.getResourceCharSet(); - } - - @Override - public SecurityManager getSecurityManager() { - return cs.getSecurityManager(); - } - - @Override - public Resource getFldFile() { - return cs.getFldFile(); - } - - @Override - public Resource getTldFile() { - return cs.getTldFile(); - } - - @Override - public DataSource[] getDataSources() { - return cs.getDataSources(); - } - - @Override - public Map getDataSourcesAsMap() { - return cs.getDataSourcesAsMap(); - } - - @Override - public Charset getMailDefaultCharset() { - return cs.getMailDefaultCharset(); - } - - public CharSet getMailDefaultCharSet() { - return cs.getMailDefaultCharSet(); - } - - @Override - public ResourceProvider getDefaultResourceProvider() { - return cs.getDefaultResourceProvider(); - } - - @Override - public Iterator>> getCacheHandlers() { - return cs.getCacheHandlers(); - } - - @Override - public ResourceProvider[] getResourceProviders() { - return cs.getResourceProviders(); - } - - @Override - public ResourceProviderFactory[] getResourceProviderFactories() { - return cs.getResourceProviderFactories(); - } - - @Override - public boolean hasResourceProvider(String scheme) { - return cs.hasResourceProvider(scheme); - } - - @Override - public Resource getResource(String path) { - return cs.getResource(path); - } - - @Override - public ApplicationListener getApplicationListener() { - return cs.getApplicationListener(); - } - - @Override - public int getScriptProtect() { - return cs.getScriptProtect(); - } - - @Override - public ProxyData getProxyData() { - return cs.getProxyData(); - } - - @Override - public boolean isProxyEnableFor(String host) { - return cs.isProxyEnableFor(host); - } - - @Override - public boolean getTriggerComponentDataMember() { - return cs.getTriggerComponentDataMember(); - } - - @Override - public Resource getClientScopeDir() { - return cs.getClientScopeDir(); - } - - @Override - public Resource getSessionScopeDir() { - return cs.getSessionScopeDir(); - } - - @Override - public long getClientScopeDirSize() { - return cs.getClientScopeDirSize(); - } - - @Override - public ClassLoader getRPCClassLoader(boolean reload) throws IOException { - return cs.getRPCClassLoader(reload); - } - - @Override - public ClassLoader getRPCClassLoader(boolean reload, JavaSettings js, ClassLoader parent) throws IOException { - return cs.getRPCClassLoader(reload, js, parent); - } - - @Override - public PhysicalClassLoader getDirectClassLoader(boolean reload) throws IOException { - return cs.getDirectClassLoader(reload); - } - - @Override - public Resource getCacheDir() { - return cs.getCacheDir(); - } - - @Override - public long getCacheDirSize() { - return cs.getCacheDirSize(); - } - - @Override - public DumpWriter getDefaultDumpWriter(int defaultType) { - return cs.getDefaultDumpWriter(defaultType); - } - - @Override - public DumpWriter getDumpWriter(String name) throws DeprecatedException { - return cs.getDumpWriter(name); - } - - @Override - public DumpWriter getDumpWriter(String name, int defaultType) throws ExpressionException { - return cs.getDumpWriter(name, defaultType); - } - - @Override - public boolean useComponentShadow() { - return cs.useComponentShadow(); - } - - @Override - public boolean useComponentPathCache() { - return cs.useComponentPathCache(); - } - - @Override - public boolean useCTPathCache() { - return cs.useCTPathCache(); - } - - @Override - public DataSource getDataSource(String datasource) throws DatabaseException { - return cs.getDataSource(datasource); - } - - @Override - public DataSource getDataSource(String datasource, DataSource defaultValue) { - return cs.getDataSource(datasource, defaultValue); - } - - @Override - public PrintWriter getErrWriter() { - return cs.getErrWriter(); - } - - @Override - public PrintWriter getOutWriter() { - return cs.getOutWriter(); - } - - @Override - public DatasourceConnPool getDatasourceConnectionPool(DataSource ds, String user, String pass) { - return cs.getDatasourceConnectionPool(ds, user, pass); - } - - @Override - public Collection getDatasourceConnectionPools() { - return cs.getDatasourceConnectionPools(); - } - - @Override - public boolean doLocalCustomTag() { - return cs.doLocalCustomTag(); - } - - @Override - public String[] getCustomTagExtensions() { - return cs.getCustomTagExtensions(); - } - - @Override - public boolean doComponentDeepSearch() { - return cs.doComponentDeepSearch(); - } - - @Override - public boolean doCustomTagDeepSearch() { - return cs.doCustomTagDeepSearch(); - } - - @Override - public double getVersion() { - return cs.getVersion(); - } - - @Override - public boolean contentLength() { - return cs.contentLength(); - } - - @Override - public boolean allowCompression() { - return cs.allowCompression(); - } - - @Override - public Struct getConstants() { - return cs.getConstants(); - } - - @Override - public boolean isShowVersion() { - return cs.isShowVersion(); - } - - @Override - public RemoteClient[] getRemoteClients() { - return cs.getRemoteClients(); - } - - @Override - public SpoolerEngine getSpoolerEngine() { - return cs.getSpoolerEngine(); - /* - * if (spoolerEngine == null) { Resource dir = getRemoteClientDirectory(); if (dir != null && - * !dir.exists()) dir.mkdirs(); SpoolerEngineImpl se = (SpoolerEngineImpl) cs.getSpoolerEngine(); - * spoolerEngine = new SpoolerEngineImpl(this, dir, "Remote Client Spooler", getLog("remoteclient"), - * se.getMaxThreads()); } return spoolerEngine; - */ - } - - @Override - public Resource getRemoteClientDirectory() { - return cs.getRemoteClientDirectory(); - /* - * if (remoteClientDirectory == null) { return remoteClientDirectory = - * ConfigWebUtil.getFile(getRootDirectory(), "client-task", "client-task", getConfigDir(), - * FileUtil.TYPE_DIR, this); } return remoteClientDirectory; - */ - } - - @Override - public boolean getErrorStatusCode() { - return cs.getErrorStatusCode(); - } - - @Override - public int getLocalMode() { - return cs.getLocalMode(); - } - - @Override - public Resource getVideoDirectory() { - return cs.getVideoDirectory(); - } - - @Override - public Resource getExtensionDirectory() { - return cs.getExtensionDirectory(); - } - - @Override - public ExtensionProvider[] getExtensionProviders() { - return cs.getExtensionProviders(); - } - - @Override - public RHExtensionProvider[] getRHExtensionProviders() { - return cs.getRHExtensionProviders(); - } - - @Override - public Extension[] getExtensions() { - return cs.getExtensions(); - } - - @Override - public RHExtension[] getRHExtensions() { - return cs.getRHExtensions(); - } - - @Override - public boolean isExtensionEnabled() { - return cs.isExtensionEnabled(); - } - - @Override - public boolean allowRealPath() { - return cs.allowRealPath(); - } - - @Override - public Class getClusterClass() { - return cs.getClusterClass(); - } - - @Override - public Struct getRemoteClientUsage() { - return cs.getRemoteClientUsage(); - } - - @Override - public Class getAdminSyncClass() { - return cs.getAdminSyncClass(); - } - - @Override - public AdminSync getAdminSync() throws ClassException { - return cs.getAdminSync(); - } - - @Override - public Class getVideoExecuterClass() { - return cs.getVideoExecuterClass(); - } - - @Override - public Collection getTagMappings() { - return cs.getTagMappings(); - } - - @Override - public Mapping getTagMapping(String mappingName) { - return cs.getTagMapping(mappingName); - } - - @Override - public Mapping getDefaultTagMapping() { - return cs.getDefaultTagMapping(); - } - - @Override - public Mapping getFunctionMapping(String mappingName) { - return cs.getFunctionMapping(mappingName); - } - - @Override - public Mapping getDefaultFunctionMapping() { - return cs.getDefaultFunctionMapping(); - } - - @Override - public Collection getFunctionMappings() { - return cs.getFunctionMappings(); - } - - @Override - public String getDefaultDataSource() { - return cs.getDefaultDataSource(); - } - - @Override - public short getInspectTemplate() { - return cs.getInspectTemplate(); - } - - @Override - public boolean getTypeChecking() { - return cs.getTypeChecking(); - } - - @Override - public String getSerialNumber() { - return cs.getSerialNumber(); - } - - @Override - public Map getCacheConnections() { - return cs.getCacheConnections(); - } - - @Override - public CacheConnection getCacheDefaultConnection(int type) { - return cs.getCacheDefaultConnection(type); - } - - @Override - public String getCacheDefaultConnectionName(int type) { - return cs.getCacheDefaultConnectionName(type); - } - - @Override - public boolean getExecutionLogEnabled() { - return cs.getExecutionLogEnabled(); - } - - @Override - public ExecutionLogFactory getExecutionLogFactory() { - return cs.getExecutionLogFactory(); - } - - @Override - public ORMEngine resetORMEngine(PageContext pc, boolean force) throws PageException { - return cs.resetORMEngine(pc, force); - } - - @Override - public ORMEngine getORMEngine(PageContext pc) throws PageException { - return cs.getORMEngine(pc); - } - - @Override - public ClassDefinition getORMEngineClassDefintion() { - return cs.getORMEngineClassDefintion(); - } - - @Override - public Mapping[] getComponentMappings() { - return cs.getComponentMappings(); - } - - @Override - public ORMConfiguration getORMConfig() { - return cs.getORMConfig(); - } - - @Override - public CIPage getCachedPage(PageContext pc, String pathWithCFC) throws TemplateException { - return cs.getCachedPage(pc, pathWithCFC); - } - - @Override - public void putCachedPageSource(String pathWithCFC, PageSource ps) { - cs.putCachedPageSource(pathWithCFC, ps); - } - - @Override - public InitFile getCTInitFile(PageContext pc, String key) { - return cs.getCTInitFile(pc, key); - } - - @Override - public void putCTInitFile(String key, InitFile initFile) { - cs.putCTInitFile(key, initFile); - } - - @Override - public Struct listCTCache() { - return cs.listCTCache(); - } - - @Override - public void clearCTCache() { - cs.clearCTCache(); - } - - @Override - public void clearFunctionCache() { - cs.clearFunctionCache(); - } - - @Override - public UDF getFromFunctionCache(String key) { - return cs.getFromFunctionCache(key); - } - - @Override - public void putToFunctionCache(String key, UDF udf) { - cs.putToFunctionCache(key, udf); - } - - @Override - public Struct listComponentCache() { - return cs.listComponentCache(); - } - - @Override - public void clearComponentCache() { - cs.clearComponentCache(); - } - - @Override - public void clearApplicationCache() { - cs.clearApplicationCache(); - } - - @Override - public ImportDefintion getComponentDefaultImport() { - return cs.getComponentDefaultImport(); - } - - @Override - public boolean getComponentLocalSearch() { - return cs.getComponentLocalSearch(); - } - - @Override - public boolean getComponentRootSearch() { - return cs.getComponentRootSearch(); - } - - @Override - public Compress getCompressInstance(Resource zipFile, int format, boolean caseSensitive) throws IOException { - return cs.getCompressInstance(zipFile, format, caseSensitive); - } - - @Override - public boolean getSessionCluster() { - return cs.getSessionCluster(); - } - - @Override - public boolean getClientCluster() { - return cs.getClientCluster(); - } - - @Override - public String getClientStorage() { - return cs.getClientStorage(); - } - - @Override - public String getSessionStorage() { - return cs.getSessionStorage(); - } - - @Override - public DebugEntry[] getDebugEntries() { - return cs.getDebugEntries(); - } - - @Override - public DebugEntry getDebugEntry(String ip, DebugEntry defaultValue) { - return cs.getDebugEntry(ip, defaultValue); - } - - @Override - public int getDebugMaxRecordsLogged() { - return cs.getDebugMaxRecordsLogged(); - } - - @Override - public boolean getDotNotationUpperCase() { - return cs.getDotNotationUpperCase(); - } - - @Override - public boolean preserveCase() { - return cs.preserveCase(); - } - - @Override - public boolean getDefaultFunctionOutput() { - return cs.getDefaultFunctionOutput(); - } - - @Override - public boolean getSuppressWSBeforeArg() { - return cs.getSuppressWSBeforeArg(); - } - - @Override - public RestSettings getRestSetting() { - return cs.getRestSetting(); - } - - @Override - public int getCFMLWriterType() { - return cs.getCFMLWriterType(); - } - - @Override - public boolean getBufferOutput() { - return cs.getBufferOutput(); - } - - @Override - public boolean hasDebugOptions(int debugOption) { - return cs.hasDebugOptions(debugOption); - } - - @Override - public boolean checkForChangesInConfigFile() { - return cs.checkForChangesInConfigFile(); - } - - @Override - public int getExternalizeStringGTE() { - return cs.getExternalizeStringGTE(); - } - - @Override - public Map getLoggers() { - return cs.getLoggers(); - } - - @Override - public Log getLog(String name) { - return cs.getLog(name); - } - - @Override - public Log getLog(String name, boolean createIfNecessary) throws PageException { - return cs.getLog(name, createIfNecessary); - } - - @Override - public Map> getTagDefaultAttributeValues() { - return cs.getTagDefaultAttributeValues(); - } - - @Override - public Boolean getHandleUnQuotedAttrValueAsString() { - return cs.getHandleUnQuotedAttrValueAsString(); - } - - @Override - public Object getCachedWithin(int type) { - return cs.getCachedWithin(type); - } - - @Override - public Resource getPluginDirectory() { - return cs.getPluginDirectory(); - } - - @Override - public Resource getLogDirectory() { - return cs.getLogDirectory(); - } - - @Override - public String getSalt() { - return cs.getSalt(); - } - - @Override - public int getPasswordType() { - return cs.getPasswordType(); - } - - @Override - public String getPasswordSalt() { - return cs.getPasswordSalt(); - } - - @Override - public int getPasswordOrigin() { - return cs.getPasswordOrigin(); - } - - @Override - public Collection getExtensionBundleDefintions() { - return cs.getExtensionBundleDefintions(); - } - - @Override - public JDBCDriver[] getJDBCDrivers() { - return cs.getJDBCDrivers(); - } - - @Override - public JDBCDriver getJDBCDriverByClassName(String className, JDBCDriver defaultValue) { - return cs.getJDBCDriverByClassName(className, defaultValue); - } - - @Override - public JDBCDriver getJDBCDriverById(String id, JDBCDriver defaultValue) { - return cs.getJDBCDriverById(id, defaultValue); - } - - @Override - public JDBCDriver getJDBCDriverByBundle(String bundleName, Version version, JDBCDriver defaultValue) { - return cs.getJDBCDriverByBundle(bundleName, version, defaultValue); - } - - @Override - public JDBCDriver getJDBCDriverByCD(ClassDefinition cd, JDBCDriver defaultValue) { - return cs.getJDBCDriverByCD(cd, defaultValue); - } - - @Override - public int getQueueMax() { - return cs.getQueueMax(); - } - - @Override - public long getQueueTimeout() { - return cs.getQueueTimeout(); - } - - @Override - public boolean getQueueEnable() { - return cs.getQueueEnable(); - } - - @Override - public boolean getCGIScopeReadonly() { - return cs.getCGIScopeReadonly(); - } - - @Override - public Resource getDeployDirectory() { - return cs.getDeployDirectory(); - } - - @Override - public Map getCacheDefinitions() { - return cs.getCacheDefinitions(); - } - - @Override - public ClassDefinition getCacheDefinition(String className) { - return cs.getCacheDefinition(className); - } - - @Override - public Resource getAntiSamyPolicy() { - return cs.getAntiSamyPolicy(); - } - - @Override - public LogEngine getLogEngine() { - return cs.getLogEngine(); - } - - @Override - public TimeSpan getCachedAfterTimeRange() { - return cs.getCachedAfterTimeRange(); - } - - @Override - public Map getStartups() { - return cs.getStartups(); - } - - @Override - public Regex getRegex() { - return cs.getRegex(); - } - - @Override - public RHExtension[] getServerRHExtensions() { - return cs.getRHExtensions(); - } - - @Override - public Cluster createClusterScope() throws PageException { - return cs.createClusterScope(); - } - - @Override - public PageSource getApplicationPageSource(PageContext pc, String path, String filename, int mode, RefBoolean isCFC) { - return cs.getApplicationPageSource(pc, path, filename, mode, isCFC); - } - - @Override - public void putApplicationPageSource(String path, PageSource ps, String filename, int mode, boolean isCFC) { - cs.putApplicationPageSource(path, ps, filename, mode, isCFC); - } - - @Override - public Collection getAllExtensionBundleDefintions() { - return cs.getAllExtensionBundleDefintions(); - } - - @Override - public void checkPassword() throws PageException { - cs.checkPassword(); - } - - @Override - public List loadLocalExtensions(boolean validate) { - return cs.loadLocalExtensions(validate); - } - - @Override - public Collection getAllRHExtensions() { - return cs.getAllRHExtensions(); - } - - @Override - public boolean allowRequestTimeout() { - return cs.allowRequestTimeout(); - } - - @Override - public boolean closeConnection() { - return cs.closeConnection(); - } - - @Override - public void checkPermGenSpace(boolean check) { - cs.checkPermGenSpace(check); - } - - @Override - public ActionMonitor getActionMonitor(String arg0) throws PageException { - return cs.getActionMonitor(arg0); - } - - @Override - public ConfigServer getConfigServer(String arg0) throws PageException { - return cs.getConfigServer(arg0); - } - - @Override - public ConfigServer getConfigServer(ConfigWebImpl outer, String password) throws ExpressionException { - return cs.getConfigServer(password); - } - - @Override - public ConfigServer getConfigServer(String arg0, long arg1) throws PageException { - return cs.getConfigServer(arg0, arg1); - } - - @Override - public boolean getFullNullSupport() { - return cs.getFullNullSupport(); - } - - @Override - public IdentificationWeb getIdentification() { - if (id == null) id = new SCCWIdentificationWeb(cs.getIdentification()); - return id; - } - - @Override - public IntervallMonitor getIntervallMonitor(String arg0) throws PageException { - return cs.getIntervallMonitor(arg0); - } - - @Override - public IntervallMonitor[] getIntervallMonitors() { - return cs.getIntervallMonitors(); - } - - @Override - public Resource getLocalExtensionProviderDirectory() { - return cs.getLocalExtensionProviderDirectory(); - } - - @Override - public boolean getLoginCaptcha() { - return cs.getLoginCaptcha(); - } - - @Override - public int getLoginDelay() { - return cs.getLoginDelay(); - } - - @Override - public boolean getRememberMe() { - return cs.getRememberMe(); - } - - @Override - public RequestMonitor getRequestMonitor(String arg0) throws PageException { - return cs.getRequestMonitor(arg0); - } - - @Override - public RequestMonitor[] getRequestMonitors() { - return cs.getRequestMonitors(); - } - - @Override - public Resource getSecurityDirectory() { - return cs.getSecurityDirectory(); - } - - @Override - public ThreadQueue getThreadQueue() { - return cs.getThreadQueue(); - } - - @Override - public boolean hasServerPassword() { - return cs.hasServerPassword(); - } - - @Override - public boolean isMonitoringEnabled() { - return cs.isMonitoringEnabled(); - } - - @Override - public AMFEngine getAMFEngine() { - return helper.getAMFEngine(); - } - - @Override - public ConfigServer getConfigServer(Password password) throws PageException { - cs.checkAccess(password); - return cs; - } - - @Override - public Resource getConfigServerDir() { - return cs.getConfigDir(); - } - - @Override - public CFMLFactory getFactory() { - return factory; - } - - @Override - public String getLabel() { - return helper.getLabel(); - } - - @Override - public LockManager getLockManager() { - return helper.getLockManager(); - } - - @Override - public SearchEngine getSearchEngine(PageContext pc) throws PageException { - return helper.getSearchEngine(pc); - } - - @Override - public CFMLWriter getWriter(PageContext pc, HttpServletRequest req, HttpServletResponse rsp) { - return getCFMLWriter(pc, req, rsp); - } - - @Override - public String getInitParameter(String name) { - return config.getInitParameter(name); - } - - @Override - public Enumeration getInitParameterNames() { - return config.getInitParameterNames(); - } - - @Override - public ServletContext getServletContext() { - return config.getServletContext(); - } - - @Override - public long getApplicationPathCacheTimeout() { - return cs.getApplicationPathCacheTimeout(); - } - - @Override - public String getServletName() { - return config.getServletName(); - } - - @Override - public Mapping getDefaultServerTagMapping() { - return cs.defaultTagMapping; - } - - // FYI used by Extensions, do not remove - public Mapping getApplicationMapping(String virtual, String physical) { - return getApplicationMapping("application", virtual, physical, null, true, false); - } - - @Override - public Mapping getApplicationMapping(String type, String virtual, String physical, String archive, boolean physicalFirst, boolean ignoreVirtual) { - return getApplicationMapping(type, virtual, physical, archive, physicalFirst, ignoreVirtual, true, true); - } - - @Override - public Collection getServerFunctionMappings() { - return helper.getServerFunctionMappings(); - } - - @Override - public Mapping getServerFunctionMapping(String mappingName) { - return helper.getServerFunctionMapping(mappingName); - } - - @Override - public Collection getServerTagMappings() { - return helper.getServerTagMappings(); - } - - @Override - public Mapping getServerTagMapping(String mappingName) { - return helper.getServerTagMapping(mappingName); - } - - @Override - public Map getAllLabels() { - return cs.getLabels(); - } - - @Override - public boolean isDefaultPassword() { - // TODO no sure about this - return false; - } - - @Override - public short getAdminMode() { - return cs.getAdminMode(); - } - - @Override - public int getServerPasswordType() { - return cs.getPasswordType(); - } - - @Override - public String getServerPasswordSalt() { - return cs.getPasswordSalt(); - } - - @Override - public int getServerPasswordOrigin() { - return cs.getPasswordOrigin(); - } - - @Override - public GatewayEngine getGatewayEngine() throws PageException { - return helper.getGatewayEngineImpl(getGatewayEntries()); - } - - @Override - public WSHandler getWSHandler() throws PageException { - return helper.getWSHandler(); - } - - @Override - public CFMLCompilerImpl getCompiler() { - return helper.getCompiler(); - } - - @Override - public Mapping getApplicationMapping(String type, String virtual, String physical, String archive, boolean physicalFirst, boolean ignoreVirtual, - boolean checkPhysicalFromWebroot, boolean checkArchiveFromWebroot) { - return helper.getApplicationMapping(type, virtual, physical, archive, physicalFirst, ignoreVirtual, checkPhysicalFromWebroot, checkArchiveFromWebroot); - } - - @Override - public Mapping[] getApplicationMappings() { - return helper.getApplicationMappings(); - } - - @Override - public boolean isApplicationMapping(Mapping mapping) { - return helper.isApplicationMapping(mapping); - } - - @Override - public CIPage getBaseComponentPage(PageContext pc) throws PageException { - return helper.getBaseComponentPage(pc); - } - - @Override - public void resetBaseComponentPage() { - helper.resetBaseComponentPage(); - } - - @Override - public ActionMonitorCollector getActionMonitorCollector() { - return cs.getActionMonitorCollector(); - } - - @Override - public KeyLock getContextLock() { - return helper.getContextLock(); - } - - @Override - public CacheHandlerCollection getCacheHandlerCollection(int type, CacheHandlerCollection defaultValue) { - return helper.getCacheHandlerCollection(type, defaultValue); - - } - - @Override - public void releaseCacheHandlers(PageContext pc) { - helper.releaseCacheHandlers(pc); - } - - @Override - public DebuggerPool getDebuggerPool() { - return helper.getDebuggerPool(); - } - - @Override - public CFMLWriter getCFMLWriter(PageContext pc, HttpServletRequest req, HttpServletResponse rsp) { - return helper.getCFMLWriter(pc, req, rsp); - } - - @Override - public TagHandlerPool getTagHandlerPool() { - return helper.getTagHandlerPool(); - } - - @Override - public String getHash() { - return SystemUtil.hash(getServletContext()); - } - - @Override - public void updatePassword(boolean server, String passwordOld, String passwordNew) throws PageException { - try { - PasswordImpl.updatePassword(cs, passwordOld, passwordNew); - } - catch (Exception e) { - throw Caster.toPageException(e); - } - } - - @Override - public void updatePassword(ConfigWebImpl outer, boolean server, String passwordOld, String passwordNew) throws PageException { - try { - PasswordImpl.updatePassword(cs, passwordOld, passwordNew); - } - catch (Exception e) { - throw Caster.toPageException(e); - } - } - - @Override - public Password updatePasswordIfNecessary(boolean server, String passwordRaw) { - return PasswordImpl.updatePasswordIfNecessary(cs, cs.password, passwordRaw); - } - - @Override - public Password isServerPasswordEqual(String password) { - return cs.isPasswordEqual(password); - } - - @Override - public boolean hasIndividualSecurityManager() { - return false; - } - - @Override - public boolean hasIndividualSecurityManager(ConfigWebImpl outer) { - return false; - } - - @Override - public short getPasswordSource() { - return MultiContextConfigWeb.PASSWORD_ORIGIN_SERVER; - } - - @Override - public void reset() { - helper.reset(); - } - - @Override - public void setPassword(Password pw) { - cs.setPassword(pw); - } - - private static class SCCWIdentificationWeb implements IdentificationWeb, Serializable { - - private static final long serialVersionUID = -9020697769127921035L; - - private IdentificationServer id; - - public SCCWIdentificationWeb(IdentificationServer id) { - this.id = id; - } - - @Override - public String getApiKey() { - return id.getApiKey(); - } - - @Override - public String getId() { - return id.getId(); - } - - @Override - public String getSecurityKey() { - return id.getSecurityKey(); - } - - @Override - public String getSecurityToken() { - return id.getSecurityToken(); - } - - @Override - public String toQueryString() { - return id.toQueryString(); - } - - @Override - public IdentificationServer getServerIdentification() { - return id; - } - } - - public void reload() { - synchronized (this) { - createMapping(); - createRestMapping(); - } - } - - private void createMapping() { - Map existing = getExistingMappings(); - - // Mapping - Map mappings = MapFactory.getConcurrentMap(); - Mapping tmp; - boolean finished = false; - Mapping ex; - Mapping[] sm = cs.getMappings(); - if (sm != null) { - for (int i = 0; i < sm.length; i++) { - if (!sm[i].isHidden()) { - if ("/".equals(sm[i].getVirtual())) finished = true; - ex = existing.get(sm[i].getVirtualLowerCase()); - if (ex != null && ex.equals(sm[i])) { - mappings.put(ex.getVirtualLowerCase(), ex); - continue; - } - else if (sm[i] instanceof MappingImpl) { - tmp = ((MappingImpl) sm[i]).cloneReadOnly(this); - mappings.put(tmp.getVirtualLowerCase(), tmp); - - } - else { - tmp = sm[i]; - mappings.put(tmp.getVirtualLowerCase(), tmp); - } - - if (ex instanceof MappingImpl) { - ((MappingImpl) ex).flush(); - } - - } - } - } - if (!finished) { - Mapping m; - if (ResourceUtil.isUNCPath(getRootDirectory().getPath())) { - m = new MappingImpl(this, "/", getRootDirectory().getPath(), null, ConfigPro.INSPECT_UNDEFINED, ConfigPro.INSPECT_INTERVAL_UNDEFINED, - ConfigPro.INSPECT_INTERVAL_UNDEFINED, true, true, true, true, false, false, null, -1, -1); - } - else { - m = new MappingImpl(this, "/", "/", null, ConfigPro.INSPECT_UNDEFINED, ConfigPro.INSPECT_INTERVAL_UNDEFINED, ConfigPro.INSPECT_INTERVAL_UNDEFINED, true, true, true, - true, false, false, null, -1, -1, true, true); - } - ex = existing.get("/"); - if (ex != null && ex.equals(m)) { - m = ex; - } - mappings.put("/", m); - } - this.mappings = ConfigWebUtil.sort(mappings.values().toArray(new Mapping[mappings.size()])); - } - - private void createRestMapping() { - Map mappings = MapFactory.getConcurrentMap(); - lucee.runtime.rest.Mapping[] sm = cs.getRestMappings(); - lucee.runtime.rest.Mapping tmp; - if (sm != null) { - for (int i = 0; i < sm.length; i++) { - try { - // if (!sm[i].isHidden()) { - tmp = sm[i].duplicate(this, Boolean.TRUE); - mappings.put(tmp.getVirtual(), tmp); - // } - } - catch (Exception e) { - - } - } - } - this.restMappings = mappings.values().toArray(new lucee.runtime.rest.Mapping[mappings.size()]); - } - - private Map getExistingMappings() { - Map mappings = MapFactory.getConcurrentMap(); - - if (this.mappings != null) { - for (Mapping m: this.mappings) { - mappings.put(m.getVirtualLowerCase(), m); - } - } - return mappings; - } - - @Override - public void removeDatasourceConnectionPool(DataSource ds) { - cs.removeDatasourceConnectionPool(ds); - } - - @Override - public MockPool getDatasourceConnectionPool() { - return cs.getDatasourceConnectionPool(); - } - - @Override - public boolean getPreciseMath() { - return cs.getPreciseMath(); - } - - @Override - public void resetServerFunctionMappings() { - - } - - @Override - public boolean isSingle() { - return true; - } - - @Override - public Resource getWebConfigDir() { - return this.configDirWeb; - } - - @Override - public ServletConfig getServletConfig() { - return config; - } - - @Override - public void setLastModified() { - cs.setLastModified(); - } - - public Object[] getConsoleLayouts() throws PageException { - return cs.getConsoleLayouts(); - } - - public String getServerSalt() { - return cs.getSalt(); - } - - public int getDebugOptions() { - return cs.getDebugOptions(); - } - - public GatewayMap getGatewayEntries() { - return cs.getGatewayEntries(); - } - - public Mapping getScriptMapping() { - return cs.getScriptMapping(); - } - - public void resetRPCClassLoader() { - cs.resetRPCClassLoader(); - } - - public PageSource[] getPageSources(PageContext arg0, Mapping[] arg1, String arg2, boolean arg3, boolean arg4, boolean arg5, boolean arg6, boolean arg7) { - return cs.getPageSources(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); - } - - public Object[] getResourceLayouts() throws PageException { - return cs.getResourceLayouts(); - } - - public void clearComponentMetadata() { - cs.clearComponentMetadata(); - } - - public void flushComponentPathCache() { - cs.flushApplicationPathCache(); - } - - public String createSecurityToken() { - return cs.createSecurityToken(); - } - - public Resource getServerConfigDir() { - return cs.getConfigDir(); - } - - public String getCacheMD5() { - return cs.getCacheMD5(); - } - - public ComponentMetaData getComponentMetadata(String arg0) { - return cs.getComponentMetadata(arg0); - } - - public Cache createRAMCache(Struct arg0) throws IOException { - return cs.createRAMCache(arg0); - } - - public void setAllowURLRequestTimeout(boolean arg0) { - cs.setAllowURLRequestTimeout(arg0); - } - - public Mapping getDefaultServerFunctionMapping() { - return cs.getDefaultFunctionMapping(); - } - - public void flushApplicationPathCache() { - cs.flushApplicationPathCache(); - } - - public void createTag(TagLib arg0, String arg1, String arg2) { - cs.createTag(arg0, arg1, arg2); - } - - public CharSet getTemplateCharSet() { - return cs.getTemplateCharSet(); - } - - public void flushCTPathCache() { - cs.flushCTPathCache(); - } - - public void putComponentMetadata(String arg0, ComponentMetaData arg1) { - cs.putComponentMetadata(arg0, arg1); - } - - public String[] getLogNames() { - return cs.getLogNames(); - } - - public long getSessionScopeDirSize() { - return cs.getSessionScopeDirSize(); - } - - public int getMode() { - return cs.getMode(); - } - - public ClassDefinition getORMEngineClass() { - return cs.getORMEngineClass(); - } - - public DumpWriterEntry[] getDumpWritersEntries() { - return cs.getDumpWritersEntries(); - } - - public Password getPassword() { - return cs.getPassword(); - } - - @Override - public void setIdentification(IdentificationWeb arg0) { - // ignore it, should not happen - LogUtil.log(Log.LEVEL_FATAL, "loading", "setting a web id for single context"); - } - - @Override - public void checkMappings() { - cs.checkMappings(); - } - - @Override - public String getMainLogger() { - return cs.getMainLogger(); - } - - @Override - public int getInspectTemplateAutoInterval(boolean slow) { - return cs.getInspectTemplateAutoInterval(slow); - } - - @Override - public boolean getFormUrlAsStruct() { - return cs.getFormUrlAsStruct(); - } - - @Override - public int getReturnFormat() { - return cs.getReturnFormat(); - } - - @Override - public JavaSettings getJavaSettings(String id) { - return cs.getJavaSettings(id); - } - - @Override - public void setJavaSettings(String id, JavaSettings js) { - cs.setJavaSettings(id, js); - } - - @Override - public Resource getMavenDir() { - return cs.getMavenDir(); - } - - @Override - public JavaSettings getJavaSettings() { - return cs.getJavaSettings(); - } - - @Override - public Resource getExtensionInstalledDir() { - return cs.getExtensionInstalledDir(); - } - - @Override - public Resource getExtensionAvailableDir() { - return cs.getExtensionAvailableDir(); - } - - @Override - public Collection getAIEngineFactoryNames() { - return cs.getAIEngineFactoryNames(); - } - - @Override - public AIEngineFactory getAIEngineFactory(String name) { - return cs.getAIEngineFactory(name); - } - - @Override - public AIEnginePool getAIEnginePool() { - return cs.getAIEnginePool(); - } - - @Override - public CFMLEngine getEngine() { - return cs.getEngine(); - } -} \ No newline at end of file diff --git a/core/src/main/java/lucee/runtime/db/ApplicationDataSource.java b/core/src/main/java/lucee/runtime/db/ApplicationDataSource.java index 1156e9aef0..f91dc6858a 100644 --- a/core/src/main/java/lucee/runtime/db/ApplicationDataSource.java +++ b/core/src/main/java/lucee/runtime/db/ApplicationDataSource.java @@ -22,7 +22,7 @@ import lucee.commons.io.log.Log; import lucee.runtime.config.Config; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.engine.ThreadLocalPageContext; import lucee.runtime.exp.ApplicationException; import lucee.runtime.exp.PageRuntimeException; @@ -36,7 +36,7 @@ public class ApplicationDataSource extends DataSourceSupport { private ApplicationDataSource(Config config, String name, ClassDefinition cd, String connStr, String username, String password, TagListener listener, boolean blob, boolean clob, int connectionLimit, int idleTimeout, int liveTimeout, int minIdle, int maxIdle, int maxTotal, long metaCacheTimeout, TimeZone timezone, int allow, boolean storage, boolean readOnly, boolean validate, boolean requestExclusive, boolean alwaysResetConnections, boolean literalTimestampWithTSOffset, Log log) { - super(config, name, cd, username, ConfigWebUtil.decrypt(password), listener, blob, clob, connectionLimit, idleTimeout, liveTimeout, minIdle, maxIdle, maxTotal, + super(config, name, cd, username, ConfigUtil.decrypt(password), listener, blob, clob, connectionLimit, idleTimeout, liveTimeout, minIdle, maxIdle, maxTotal, metaCacheTimeout, timezone, allow < 0 ? ALLOW_ALL : allow, storage, readOnly, validate, requestExclusive, alwaysResetConnections, literalTimestampWithTSOffset, log); diff --git a/core/src/main/java/lucee/runtime/db/DataSourceImpl.java b/core/src/main/java/lucee/runtime/db/DataSourceImpl.java index 54ae0d259e..82e7487d6d 100644 --- a/core/src/main/java/lucee/runtime/db/DataSourceImpl.java +++ b/core/src/main/java/lucee/runtime/db/DataSourceImpl.java @@ -29,7 +29,7 @@ import lucee.commons.lang.ClassException; import lucee.commons.lang.StringUtil; import lucee.runtime.config.Config; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.engine.ThreadLocalPageContext; import lucee.runtime.op.Caster; import lucee.runtime.tag.listener.TagListener; @@ -91,7 +91,7 @@ public DataSourceImpl(Config config, String name, ClassDefinition cd, String hos boolean literalTimestampWithTSOffset, boolean alwaysSetTimeout, boolean requestExclusive, boolean alwaysResetConnections, Log log) throws BundleException, ClassException, SQLException { - super(config, name, cd, username, ConfigWebUtil.decrypt(password), listener, blob, clob, connectionLimit, idleTimeout, liveTimeout, minIdle, maxIdle, maxTotal, + super(config, name, cd, username, ConfigUtil.decrypt(password), listener, blob, clob, connectionLimit, idleTimeout, liveTimeout, minIdle, maxIdle, maxTotal, metaCacheTimeout, timezone, allow < 0 ? ALLOW_ALL : allow, storage, readOnly, validate, requestExclusive, alwaysResetConnections, literalTimestampWithTSOffset, log); diff --git a/core/src/main/java/lucee/runtime/engine/CFMLEngineImpl.java b/core/src/main/java/lucee/runtime/engine/CFMLEngineImpl.java index 15c4a24167..c98e3c4176 100644 --- a/core/src/main/java/lucee/runtime/engine/CFMLEngineImpl.java +++ b/core/src/main/java/lucee/runtime/engine/CFMLEngineImpl.java @@ -104,7 +104,6 @@ import lucee.runtime.config.ConfigAdmin; import lucee.runtime.config.ConfigFactory; import lucee.runtime.config.ConfigFactory.UpdateInfo; -import lucee.runtime.config.ConfigImpl; import lucee.runtime.config.ConfigPro; import lucee.runtime.config.ConfigServer; import lucee.runtime.config.ConfigServerFactory; @@ -895,16 +894,9 @@ private CFMLFactoryImpl loadJSPFactory(ConfigServerImpl configServer, ServletCon CFMLFactoryImpl factory = new CFMLFactoryImpl(this, sg); if (ConfigWebFactory.LOG) LogUtil.log(configServer, Log.LEVEL_INFO, "startup", "Init factory"); - boolean multi = configServer.getAdminMode() == ConfigImpl.ADMINMODE_MULTI; - ConfigWebPro config; RefBoolean isCustomSetting = new RefBooleanImpl(); Resource configDir = getConfigDirectory(sg, configServer, countExistingContextes, isCustomSetting); - if (multi) { - config = ConfigWebFactory.newInstanceMulti(this, factory, configServer, configDir, sg, null); - } - else { - config = ConfigWebFactory.newInstanceSingle(this, factory, configServer, configDir, sg, null); - } + ConfigWebPro config = ConfigWebFactory.newInstanceSingle(this, factory, configServer, configDir, sg, null); if (ConfigWebFactory.LOG) LogUtil.log(configServer, Log.LEVEL_INFO, "startup", "Loaded config"); factory.setConfig(configServer, config); diff --git a/core/src/main/java/lucee/runtime/extension/RHExtension.java b/core/src/main/java/lucee/runtime/extension/RHExtension.java index a96d32222c..6888c24301 100644 --- a/core/src/main/java/lucee/runtime/extension/RHExtension.java +++ b/core/src/main/java/lucee/runtime/extension/RHExtension.java @@ -60,15 +60,13 @@ import lucee.commons.lang.types.RefBooleanImpl; import lucee.commons.lang.types.RefInteger; import lucee.commons.lang.types.RefIntegerImpl; -import lucee.loader.util.Util; import lucee.runtime.config.Config; import lucee.runtime.config.ConfigAdmin; -import lucee.runtime.config.ConfigImpl; import lucee.runtime.config.ConfigPro; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.config.ConfigWeb; import lucee.runtime.config.ConfigWebFactory; import lucee.runtime.config.ConfigWebPro; -import lucee.runtime.config.ConfigWebUtil; import lucee.runtime.config.Constants; import lucee.runtime.config.DeployHandler; import lucee.runtime.converter.ConverterException; @@ -563,7 +561,7 @@ private void readManifestConfig(Config config, Manifest manifest, String label, boolean isWeb = config instanceof ConfigWeb; type = isWeb ? "web" : "server"; Log logger = ThreadLocalPageContext.getLog(config, "deploy"); - Info info = ConfigWebUtil.getEngine(config).getInfo(); + Info info = ConfigUtil.getEngine(config).getInfo(); Attributes attr = manifest.getMainAttributes(); @@ -573,7 +571,6 @@ private void readManifestConfig(Config config, Manifest manifest, String label, readVersion(label, StringUtil.unwrap(attr.getValue("version"))); label += " : " + version; readId(label, StringUtil.unwrap(attr.getValue("id"))); - readReleaseType(config, label, StringUtil.unwrap(attr.getValue("release-type")), isWeb); description = StringUtil.unwrap(attr.getValue("description")); trial = Caster.toBooleanValue(StringUtil.unwrap(attr.getValue("trial")), false); if (_img == null) _img = StringUtil.unwrap(attr.getValue("image")); @@ -604,7 +601,7 @@ private void readManifestConfig(Config config, String id, Struct data, String la type = isWeb ? "web" : "server"; Log logger = ThreadLocalPageContext.getLog(config, "deploy"); - Info info = ConfigWebUtil.getEngine(config).getInfo(); + Info info = ConfigUtil.getEngine(config).getInfo(); readSymbolicName(label, ConfigWebFactory.getAttr(data, "symbolicName", "symbolic-name")); readName(label, ConfigWebFactory.getAttr(data, "name")); @@ -612,7 +609,6 @@ private void readManifestConfig(Config config, String id, Struct data, String la readVersion(label, ConfigWebFactory.getAttr(data, "version")); label += " : " + version; readId(label, StringUtil.isEmpty(id) ? ConfigWebFactory.getAttr(data, "id") : id); - readReleaseType(config, label, ConfigWebFactory.getAttr(data, "releaseType", "release-type"), isWeb); description = ConfigWebFactory.getAttr(data, "description"); trial = Caster.toBooleanValue(ConfigWebFactory.getAttr(data, "trial"), false); if (_img == null) _img = ConfigWebFactory.getAttr(data, "image"); @@ -755,7 +751,7 @@ private void readCoreVersion(String label, String str, Info info) { } public void validate(Config config) throws ApplicationException { - validate(ConfigWebUtil.getEngine(config).getInfo()); + validate(ConfigUtil.getEngine(config).getInfo()); } public void validate(Info info) throws ApplicationException { @@ -787,22 +783,6 @@ private void readCategories(String label, String cat) { else categories = null; } - private void readReleaseType(Config config, String label, String str, boolean isWeb) throws ApplicationException { - if (((ConfigPro) ThreadLocalPageContext.getConfig(config)).getAdminMode() == ConfigImpl.ADMINMODE_SINGLE) return; - // release type - int rt = RELEASE_TYPE_ALL; - if (!Util.isEmpty(str)) { - str = str.trim(); - if ("server".equalsIgnoreCase(str)) rt = RELEASE_TYPE_SERVER; - else if ("web".equalsIgnoreCase(str)) rt = RELEASE_TYPE_WEB; - } - if ((rt == RELEASE_TYPE_SERVER && isWeb) || (rt == RELEASE_TYPE_WEB && !isWeb)) { - throw new ApplicationException( - "Cannot install the Extension [" + label + "] in the " + type + " context, this Extension has the release type [" + toReleaseType(rt, "") + "]."); - } - releaseType = rt; - } - private void readId(String label, String id) throws ApplicationException { this.id = StringUtil.unwrap(id); if (!Decision.isUUId(id)) { @@ -949,7 +929,7 @@ public int compare(Pair l, Pair r) } } - if (config instanceof ConfigWebPro && ((ConfigWebPro) config).isSingle()) return; + if (config instanceof ConfigWebPro) return; // extension defined in xml RHExtension[] xmlArrExtensions = ((ConfigPro) config).getRHExtensions(); if (xmlArrExtensions.length == getPhysicalExtensionCount(config)) return; // all is OK diff --git a/core/src/main/java/lucee/runtime/format/TimeFormat.java b/core/src/main/java/lucee/runtime/format/TimeFormat.java index 1231842c83..4892ae3da3 100644 --- a/core/src/main/java/lucee/runtime/format/TimeFormat.java +++ b/core/src/main/java/lucee/runtime/format/TimeFormat.java @@ -108,10 +108,8 @@ else if (lcMask.equals("beat")) { break; // RFC 822 TimeZone case 'Z': { - int count = 1; while (mask.length() > pos + 1 && mask.charAt(pos + 1) == 'Z') { pos++; - count++; } formated.append(lucee.runtime.format.DateFormat.Z(time, tz)); } diff --git a/core/src/main/java/lucee/runtime/functions/cache/CacheRegionExists.java b/core/src/main/java/lucee/runtime/functions/cache/CacheRegionExists.java index 9f0f2c0184..1ab01720ee 100644 --- a/core/src/main/java/lucee/runtime/functions/cache/CacheRegionExists.java +++ b/core/src/main/java/lucee/runtime/functions/cache/CacheRegionExists.java @@ -36,7 +36,7 @@ public class CacheRegionExists extends BIF { private static final long serialVersionUID = 5966166102856736134L; public static boolean call(PageContext pc, String cacheName, String strWebAdminPassword) throws PageException { - Password webAdminPassword = CacheUtil.getPassword(pc, strWebAdminPassword, false); + Password webAdminPassword = CacheUtil.getPassword(pc, strWebAdminPassword); try { ConfigAdmin adminConfig = ConfigAdmin.newInstance(pc.getConfig(), webAdminPassword); return adminConfig.cacheConnectionExists(cacheName); diff --git a/core/src/main/java/lucee/runtime/functions/cache/CacheRegionNew.java b/core/src/main/java/lucee/runtime/functions/cache/CacheRegionNew.java index 37036d3a61..a5c8f1f516 100644 --- a/core/src/main/java/lucee/runtime/functions/cache/CacheRegionNew.java +++ b/core/src/main/java/lucee/runtime/functions/cache/CacheRegionNew.java @@ -74,7 +74,7 @@ public Object invoke(PageContext pc, Object[] args) throws PageException { } static String _call(PageContext pc, String cacheName, Struct properties, Boolean throwOnError, String strWebAdminPassword) throws PageException { - Password webAdminPassword = CacheUtil.getPassword(pc, strWebAdminPassword, false); + Password webAdminPassword = CacheUtil.getPassword(pc, strWebAdminPassword); try { ConfigAdmin adminConfig = ConfigAdmin.newInstance(pc.getConfig(), webAdminPassword);// TODO why we have here EHCache? adminConfig.updateCacheConnection(cacheName, new ClassDefinitionImpl("org.lucee.extension.cache.eh.EHCache", null, null, pc.getConfig().getIdentification()), diff --git a/core/src/main/java/lucee/runtime/functions/cache/CacheRegionRemove.java b/core/src/main/java/lucee/runtime/functions/cache/CacheRegionRemove.java index 87b67613a9..ce7ce90c84 100644 --- a/core/src/main/java/lucee/runtime/functions/cache/CacheRegionRemove.java +++ b/core/src/main/java/lucee/runtime/functions/cache/CacheRegionRemove.java @@ -42,7 +42,7 @@ public static String call(PageContext pc, String cacheName) throws PageException } static String _call(PageContext pc, String cacheName, String strWebAdminPassword) throws PageException { - Password webAdminPassword = CacheUtil.getPassword(pc, strWebAdminPassword, false); + Password webAdminPassword = CacheUtil.getPassword(pc, strWebAdminPassword); try { ConfigAdmin adminConfig = ConfigAdmin.newInstance(pc.getConfig(), webAdminPassword); adminConfig.removeCacheConnection(cacheName); diff --git a/core/src/main/java/lucee/runtime/functions/other/SystemOutput.java b/core/src/main/java/lucee/runtime/functions/other/SystemOutput.java index bc2f18b873..5dc2777866 100644 --- a/core/src/main/java/lucee/runtime/functions/other/SystemOutput.java +++ b/core/src/main/java/lucee/runtime/functions/other/SystemOutput.java @@ -29,7 +29,7 @@ import lucee.runtime.engine.CFMLEngineImpl; import lucee.runtime.exp.PageException; import lucee.runtime.ext.function.Function; -import lucee.runtime.functions.dynamicEvaluation.Serialize; +import lucee.runtime.functions.conversion.SerializeJSON; import lucee.runtime.op.Caster; import lucee.runtime.op.Decision; @@ -47,7 +47,7 @@ public static boolean call(PageContext pc, Object obj, boolean addNewLine, boole if (Decision.isSimpleValue(obj)) string = Caster.toString(obj); else { try { - string = Serialize.call(pc, obj); + string = SerializeJSON.call(pc, obj, "", pc.getWebCharset(), false); } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); diff --git a/core/src/main/java/lucee/runtime/functions/rest/RestDeleteApplication.java b/core/src/main/java/lucee/runtime/functions/rest/RestDeleteApplication.java index 1648028dfc..7af819e244 100644 --- a/core/src/main/java/lucee/runtime/functions/rest/RestDeleteApplication.java +++ b/core/src/main/java/lucee/runtime/functions/rest/RestDeleteApplication.java @@ -37,7 +37,7 @@ public static String call(PageContext pc, String dirPath) throws PageException { } public static String call(PageContext pc, String dirPath, String strWebAdminPassword) throws PageException { - Password webAdminPassword = CacheUtil.getPassword(pc, strWebAdminPassword, false); + Password webAdminPassword = CacheUtil.getPassword(pc, strWebAdminPassword); Resource dir = RestDeleteApplication.toResource(pc, dirPath); ConfigWebPro config = (ConfigWebPro) pc.getConfig(); diff --git a/core/src/main/java/lucee/runtime/functions/rest/RestInitApplication.java b/core/src/main/java/lucee/runtime/functions/rest/RestInitApplication.java index 016b477720..e75e72079f 100644 --- a/core/src/main/java/lucee/runtime/functions/rest/RestInitApplication.java +++ b/core/src/main/java/lucee/runtime/functions/rest/RestInitApplication.java @@ -69,14 +69,14 @@ public static String _call(PageContext pc, String dirPath, String serviceMapping if (mapping.getVirtualWithSlash().equals(virtual)) { // directory has changed if (!RestUtil.isMatch(pc, mapping, dir) || (defaultMapping != null && mapping.isDefault() != defaultMapping.booleanValue())) { - update(pc, dir, virtual, CacheUtil.getPassword(pc, webAdminPassword, false), defaultMapping == null ? mapping.isDefault() : defaultMapping.booleanValue()); + update(pc, dir, virtual, CacheUtil.getPassword(pc, webAdminPassword), defaultMapping == null ? mapping.isDefault() : defaultMapping.booleanValue()); } mapping.reset(pc); hasResetted = true; } } if (!hasResetted) { - update(pc, dir, virtual, CacheUtil.getPassword(pc, webAdminPassword, false), defaultMapping == null ? false : defaultMapping.booleanValue()); + update(pc, dir, virtual, CacheUtil.getPassword(pc, webAdminPassword), defaultMapping == null ? false : defaultMapping.booleanValue()); } return null; diff --git a/core/src/main/java/lucee/runtime/functions/system/ConfigImport.java b/core/src/main/java/lucee/runtime/functions/system/ConfigImport.java index 0b961ec3a7..26bbb1ce2b 100644 --- a/core/src/main/java/lucee/runtime/functions/system/ConfigImport.java +++ b/core/src/main/java/lucee/runtime/functions/system/ConfigImport.java @@ -10,8 +10,6 @@ import lucee.commons.lang.StringUtil; import lucee.runtime.PageContext; import lucee.runtime.config.CFConfigImport; -import lucee.runtime.config.ConfigImpl; -import lucee.runtime.config.ConfigPro; import lucee.runtime.config.ConfigServerFactory; import lucee.runtime.exp.FunctionException; import lucee.runtime.exp.PageException; @@ -37,11 +35,9 @@ else throw new FunctionException(pc, "ConfigFileImport", "first", "pathOrData", null); // type - boolean singleMode = ((ConfigPro) pc.getConfig()).getAdminMode() == ConfigImpl.ADMINMODE_SINGLE; if (StringUtil.isEmpty(type)) type = "server"; - else if (!"server".equalsIgnoreCase(type) && (singleMode || !"web".equalsIgnoreCase(type))) { - throw new FunctionException(pc, "ConfigFileImport", "second", "type", "Invalid value for argument type (" + type + "), valid values are [" - + (singleMode ? "server" : "server,web") + "] in " + (singleMode ? "single" : "multi") + " mode", null); + else if (!"server".equalsIgnoreCase(type)) { + throw new FunctionException(pc, "ConfigFileImport", "second", "type", "Invalid value for argument type (" + type + "), valid values are [server] in single mode", null); } // password diff --git a/core/src/main/java/lucee/runtime/functions/system/ExpandPath.java b/core/src/main/java/lucee/runtime/functions/system/ExpandPath.java index 5da21d3245..3bcd5903c6 100644 --- a/core/src/main/java/lucee/runtime/functions/system/ExpandPath.java +++ b/core/src/main/java/lucee/runtime/functions/system/ExpandPath.java @@ -35,7 +35,7 @@ import lucee.runtime.config.ConfigPro; import lucee.runtime.config.ConfigWeb; import lucee.runtime.config.ConfigWebPro; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.exp.PageException; import lucee.runtime.ext.function.Function; import lucee.runtime.net.http.ReqRspUtil; @@ -100,7 +100,7 @@ else if (!SystemUtil.isWindows()) { // cwi.getPhysicalResources(pc,pc.getApplicationContext().getMappings(),realPath,false,pci.useSpecialMappings(),true); } - relPath = ConfigWebUtil.replacePlaceholder(relPath, config); + relPath = ConfigUtil.replacePlaceholder(relPath, config); res = pc.getConfig().getResource(relPath); if (res.isAbsolute()) return toReturnValue(relPath, res); diff --git a/core/src/main/java/lucee/runtime/functions/system/GetApplicationSettings.java b/core/src/main/java/lucee/runtime/functions/system/GetApplicationSettings.java index 2a467a6bf4..65e64dfbce 100644 --- a/core/src/main/java/lucee/runtime/functions/system/GetApplicationSettings.java +++ b/core/src/main/java/lucee/runtime/functions/system/GetApplicationSettings.java @@ -35,7 +35,7 @@ import lucee.runtime.config.Config; import lucee.runtime.config.ConfigPro; import lucee.runtime.config.ConfigWebPro; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.db.ClassDefinition; import lucee.runtime.db.DataSource; import lucee.runtime.db.DataSourceImpl; @@ -199,7 +199,7 @@ public static Struct call(PageContext pc, boolean suppressFunctions, boolean onl sct.setEL("enableNullSupport", ((ApplicationContextSupport) ac).getFullNullSupport()); // scope cascading - sct.setEL("scopeCascading", ConfigWebUtil.toScopeCascading(ac.getScopeCascading(), null)); + sct.setEL("scopeCascading", ConfigUtil.toScopeCascading(ac.getScopeCascading(), null)); if (ac.getScopeCascading() != Config.SCOPE_SMALL) { sct.setEL("searchImplicitScopes", ac.getScopeCascading() == Config.SCOPE_STANDARD); @@ -208,8 +208,6 @@ public static Struct call(PageContext pc, boolean suppressFunctions, boolean onl sct.setEL("preciseMath", Caster.toBoolean(acs.getPreciseMath())); sct.setEL("dotNotationUpperCase", Caster.toBoolean(((ConfigPro) pc.getConfig()).getDotNotationUpperCase())); - // adminMode - sct.setEL("singleContext", ConfigWebUtil.toAdminMode(((ConfigPro) pc.getConfig()).getAdminMode(), "single") == "single"); Struct cs = new StructImpl(Struct.TYPE_LINKED); cs.setEL("web", pc.getWebCharset().name()); diff --git a/core/src/main/java/lucee/runtime/functions/system/GetUsageData.java b/core/src/main/java/lucee/runtime/functions/system/GetUsageData.java index 3bbac7bdf8..481a01b5ab 100644 --- a/core/src/main/java/lucee/runtime/functions/system/GetUsageData.java +++ b/core/src/main/java/lucee/runtime/functions/system/GetUsageData.java @@ -39,7 +39,7 @@ import lucee.runtime.config.ConfigServer; import lucee.runtime.config.ConfigWeb; import lucee.runtime.config.ConfigWebPro; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.config.DatasourceConnPool; import lucee.runtime.debug.ActiveLock; import lucee.runtime.debug.ActiveQuery; @@ -177,7 +177,7 @@ public static Struct call(PageContext pc) throws PageException { } // Template Cache - Mapping[] mappings = ConfigWebUtil.getAllMappings(web); + Mapping[] mappings = ConfigUtil.getAllMappings(web); long[] tce = templateCacheElements(mappings); row = tc.addRow(); tc.setAt(KeyConstants._web, row, web.getLabel()); diff --git a/core/src/main/java/lucee/runtime/functions/system/PagePoolList.java b/core/src/main/java/lucee/runtime/functions/system/PagePoolList.java index 1ec1480939..a20a13793c 100644 --- a/core/src/main/java/lucee/runtime/functions/system/PagePoolList.java +++ b/core/src/main/java/lucee/runtime/functions/system/PagePoolList.java @@ -25,7 +25,7 @@ import lucee.runtime.Mapping; import lucee.runtime.MappingImpl; import lucee.runtime.PageContext; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.exp.PageException; import lucee.runtime.ext.function.Function; import lucee.runtime.type.Array; @@ -37,7 +37,7 @@ public final class PagePoolList implements Function { public static Array call(PageContext pc) throws PageException { ArrayImpl arr = new ArrayImpl(); - fill(arr, ConfigWebUtil.getAllMappings(pc)); + fill(arr, ConfigUtil.getAllMappings(pc)); return arr; } diff --git a/core/src/main/java/lucee/runtime/instrumentation/InstrumentationFactory.java b/core/src/main/java/lucee/runtime/instrumentation/InstrumentationFactory.java index d39f415c94..03efe88412 100644 --- a/core/src/main/java/lucee/runtime/instrumentation/InstrumentationFactory.java +++ b/core/src/main/java/lucee/runtime/instrumentation/InstrumentationFactory.java @@ -44,7 +44,7 @@ import lucee.commons.lang.types.RefBooleanImpl; import lucee.loader.engine.CFMLEngineFactory; import lucee.runtime.config.Config; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.config.Constants; import lucee.runtime.engine.InfoImpl; import lucee.runtime.engine.ThreadLocalPageContext; @@ -221,14 +221,14 @@ else if (SystemUtil.isSolaris()) { } private static Resource getDeployDirectory(Config config) { - Resource dir = ConfigWebUtil.getConfigServerDirectory(config); + Resource dir = ConfigUtil.getConfigServerDirectory(config); if (dir == null || !dir.isWriteable() || !dir.isReadable()) dir = ResourceUtil.toResource(CFMLEngineFactory.getClassLoaderRoot(SystemUtil.getLoaderClassLoader())); return dir; } private static Resource getBinDirectory(Config config) { - Resource dir = ConfigWebUtil.getConfigServerDirectory(config); + Resource dir = ConfigUtil.getConfigServerDirectory(config); if (dir == null || !dir.isWriteable() || !dir.isReadable()) dir = ResourceUtil.toResource(CFMLEngineFactory.getClassLoaderRoot(SystemUtil.getLoaderClassLoader())); else { dir = dir.getRealResource("bin"); diff --git a/core/src/main/java/lucee/runtime/listener/AppListenerUtil.java b/core/src/main/java/lucee/runtime/listener/AppListenerUtil.java index a674a8e7fa..16bdcd072d 100755 --- a/core/src/main/java/lucee/runtime/listener/AppListenerUtil.java +++ b/core/src/main/java/lucee/runtime/listener/AppListenerUtil.java @@ -41,7 +41,7 @@ import lucee.runtime.config.ConfigPro; import lucee.runtime.config.ConfigWeb; import lucee.runtime.config.ConfigWebPro; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.db.ApplicationDataSource; import lucee.runtime.db.ClassDefinition; import lucee.runtime.db.DBUtil; @@ -297,7 +297,7 @@ public static Mapping[] toMappings(ConfigWeb cw, Object o, Resource source) thro MappingData md = toMappingData(e.getValue(), source); mappings.add(config.getApplicationMapping("application", virtual, md.physical, md.archive, md.physicalFirst, false, !md.physicalMatch, !md.archiveMatch)); } - return ConfigWebUtil.sort(mappings.toArray(new Mapping[mappings.size()])); + return ConfigUtil.sort(mappings.toArray(new Mapping[mappings.size()])); } public static Mapping[] toMappingsIgnoreInvalid(ConfigWeb cw, Object o, Resource source) { @@ -321,7 +321,7 @@ public static Mapping[] toMappingsIgnoreInvalid(ConfigWeb cw, Object o, Resource } } - return ConfigWebUtil.sort(mappings.toArray(new Mapping[mappings.size()])); + return ConfigUtil.sort(mappings.toArray(new Mapping[mappings.size()])); } private static MappingData toMappingData(Object value, Resource source) throws PageException { @@ -794,7 +794,7 @@ public static Server toMailServer(Config config, Struct data, Server defaultValu String username = Caster.toString(data.get(KeyConstants._username, null), null); if (StringUtil.isEmpty(username, true)) username = Caster.toString(data.get(KeyConstants._user, null), null); - String password = ConfigWebUtil.decrypt(Caster.toString(data.get(KeyConstants._password, null), null)); + String password = ConfigUtil.decrypt(Caster.toString(data.get(KeyConstants._password, null), null)); username = translateValue(username); password = translateValue(password); diff --git a/core/src/main/java/lucee/runtime/listener/ModernApplicationContext.java b/core/src/main/java/lucee/runtime/listener/ModernApplicationContext.java index fca2567db0..d272340fa0 100644 --- a/core/src/main/java/lucee/runtime/listener/ModernApplicationContext.java +++ b/core/src/main/java/lucee/runtime/listener/ModernApplicationContext.java @@ -57,7 +57,7 @@ import lucee.runtime.config.Config; import lucee.runtime.config.ConfigPro; import lucee.runtime.config.ConfigWeb; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.db.ClassDefinition; import lucee.runtime.db.DataSource; import lucee.runtime.engine.ThreadLocalPageContext; @@ -417,11 +417,11 @@ public ModernApplicationContext(PageContext pc, Component cfc, RefBoolean throws public void initScopeCascading() { Object o = get(component, SCOPE_CASCADING, null); if (o != null) { - scopeCascading = ConfigWebUtil.toScopeCascading(Caster.toString(o, null), (short) -1); + scopeCascading = ConfigUtil.toScopeCascading(Caster.toString(o, null), (short) -1); } else { Boolean b = Caster.toBoolean(get(component, SEARCH_IMPLICIT_SCOPES, null), null); - if (b != null) scopeCascading = ConfigWebUtil.toScopeCascading(b); + if (b != null) scopeCascading = ConfigUtil.toScopeCascading(b); } } diff --git a/core/src/main/java/lucee/runtime/osgi/OSGiUtil.java b/core/src/main/java/lucee/runtime/osgi/OSGiUtil.java index 95da845433..8eb6e04f43 100644 --- a/core/src/main/java/lucee/runtime/osgi/OSGiUtil.java +++ b/core/src/main/java/lucee/runtime/osgi/OSGiUtil.java @@ -72,7 +72,7 @@ import lucee.loader.util.Util; import lucee.runtime.config.Config; import lucee.runtime.config.ConfigWebFactory; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.config.Identification; import lucee.runtime.config.s3.BundleProvider; import lucee.runtime.engine.CFMLEngineImpl; @@ -1305,7 +1305,7 @@ private static void _add(List children, Resource[] reses) { * @return */ public static List getBundleDefinitions() { - CFMLEngine engine = ConfigWebUtil.getEngine(ThreadLocalPageContext.getConfig()); + CFMLEngine engine = ConfigUtil.getEngine(ThreadLocalPageContext.getConfig()); return getBundleDefinitions(engine.getBundleContext()); } @@ -1318,7 +1318,7 @@ public static List getBundleDefinitions(BundleContext bc) { set.add(b.getSymbolicName() + ":" + b.getVersion()); } // is it in jar directory but not loaded - CFMLEngineFactory factory = ConfigWebUtil.getCFMLEngineFactory(ThreadLocalPageContext.getConfig()); + CFMLEngineFactory factory = ConfigUtil.getCFMLEngineFactory(ThreadLocalPageContext.getConfig()); try { File[] children = factory.getBundleDirectory().listFiles(JAR_EXT_FILTER); BundleFile bf; @@ -1339,7 +1339,7 @@ public static List getBundleDefinitions(BundleContext bc) { } public static Bundle getBundleLoaded(String name, Version version, Bundle defaultValue) { - CFMLEngine engine = ConfigWebUtil.getEngine(ThreadLocalPageContext.getConfig()); + CFMLEngine engine = ConfigUtil.getEngine(ThreadLocalPageContext.getConfig()); return getBundleLoaded(engine.getBundleContext(), name, version, defaultValue); } @@ -1358,7 +1358,7 @@ public static Bundle getBundleLoaded(BundleContext bc, String name, Version vers } public static Bundle loadBundleFromLocal(String name, Version version, List addional, boolean loadIfNecessary, Bundle defaultValue) { - CFMLEngine engine = ConfigWebUtil.getEngine(ThreadLocalPageContext.getConfig()); + CFMLEngine engine = ConfigUtil.getEngine(ThreadLocalPageContext.getConfig()); return loadBundleFromLocal(engine.getBundleContext(), name, version, addional, loadIfNecessary, defaultValue); } @@ -1376,7 +1376,7 @@ public static Bundle loadBundleFromLocal(BundleContext bc, String name, Version // is it in jar directory but not loaded - CFMLEngineFactory factory = ConfigWebUtil.getCFMLEngineFactory(ThreadLocalPageContext.getConfig()); + CFMLEngineFactory factory = ConfigUtil.getCFMLEngineFactory(ThreadLocalPageContext.getConfig()); BundleFile bf = _getBundleFile(factory, name, version, addional, null); if (bf != null) { try { @@ -2326,7 +2326,7 @@ public static BundleDefinition[] toBundleDefinitions(BundleInfo[] bundles) { } public static Bundle getFrameworkBundle(Config config, Bundle defaultValue) { - Bundle[] bundles = ConfigWebUtil.getEngine(config).getBundleContext().getBundles(); + Bundle[] bundles = ConfigUtil.getEngine(config).getBundleContext().getBundles(); Bundle b = null; for (int i = 0; i < bundles.length; i++) { b = bundles[i]; diff --git a/core/src/main/java/lucee/runtime/rest/Mapping.java b/core/src/main/java/lucee/runtime/rest/Mapping.java index f5e8fffb65..1c6fe84b74 100644 --- a/core/src/main/java/lucee/runtime/rest/Mapping.java +++ b/core/src/main/java/lucee/runtime/rest/Mapping.java @@ -37,7 +37,7 @@ import lucee.runtime.component.ComponentLoader; import lucee.runtime.config.Config; import lucee.runtime.config.ConfigWeb; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.config.Constants; import lucee.runtime.exp.PageException; import lucee.runtime.op.Caster; @@ -81,7 +81,7 @@ public Mapping(Config config, String virtual, String physical, boolean hidden, b if (!(config instanceof ConfigWeb)) return; ConfigWeb cw = (ConfigWeb) config; - this.physical = ConfigWebUtil.getResource(cw.getServletContext(), physical, cw.getConfigDir(), FileUtil.TYPE_DIR, cw, true, true); + this.physical = ConfigUtil.getResource(cw.getServletContext(), physical, cw.getConfigDir(), FileUtil.TYPE_DIR, cw, true, true); } diff --git a/core/src/main/java/lucee/runtime/security/SecurityManagerImpl.java b/core/src/main/java/lucee/runtime/security/SecurityManagerImpl.java index d5c696faad..2fa6c678d0 100644 --- a/core/src/main/java/lucee/runtime/security/SecurityManagerImpl.java +++ b/core/src/main/java/lucee/runtime/security/SecurityManagerImpl.java @@ -25,12 +25,11 @@ import lucee.runtime.PageContext; import lucee.runtime.PageContextImpl; import lucee.runtime.config.Config; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.config.ConfigWeb; -import lucee.runtime.config.ConfigWebUtil; import lucee.runtime.config.Password; import lucee.runtime.config.PasswordImpl; import lucee.runtime.engine.ThreadLocalPageContext; -import lucee.runtime.exp.PageException; import lucee.runtime.exp.SecurityException; import lucee.runtime.type.util.ArrayUtil; @@ -326,7 +325,7 @@ public void checkFileLocation(ConfigWeb cw, Resource res, String strServerPasswo if (getAccess(TYPE_FILE) == VALUE_ALL) return; cw = (ConfigWeb) ThreadLocalPageContext.getConfig(cw); - Password serverPassword = PasswordImpl.passwordToCompare(cw, true, strServerPassword); + Password serverPassword = PasswordImpl.passwordToCompare(cw, strServerPassword); // Local if (getAccess(TYPE_FILE) == VALUE_LOCAL) { @@ -409,13 +408,8 @@ private boolean isValid(Config config, Password spw) { config = ThreadLocalPageContext.getConfig(config); if (config == null || spw == null) return false; - try { - ConfigWebUtil.getConfigServer(config, spw); - return true; - } - catch (PageException e) { - return false; - } + ConfigUtil.getConfigServer(config); + return true; } @Override diff --git a/core/src/main/java/lucee/runtime/services/ServiceSupport.java b/core/src/main/java/lucee/runtime/services/ServiceSupport.java index fa7da1c7c2..ffdc3470f5 100644 --- a/core/src/main/java/lucee/runtime/services/ServiceSupport.java +++ b/core/src/main/java/lucee/runtime/services/ServiceSupport.java @@ -26,7 +26,7 @@ import coldfusion.server.ServiceMetaData; import lucee.runtime.PageContext; import lucee.runtime.config.ConfigPro; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.engine.ThreadLocalPageContext; import lucee.runtime.exp.SecurityException; @@ -69,11 +69,11 @@ public Map getResourceBundle() { } protected void checkWriteAccess() throws SecurityException { - ConfigWebUtil.checkGeneralWriteAccess(config(), null); + ConfigUtil.checkGeneralWriteAccess(config(), null); } protected void checkReadAccess() throws SecurityException { - ConfigWebUtil.checkGeneralReadAccess(config(), null); + ConfigUtil.checkGeneralReadAccess(config(), null); } protected ConfigPro config() { diff --git a/core/src/main/java/lucee/runtime/spooler/SpoolerEngineImpl.java b/core/src/main/java/lucee/runtime/spooler/SpoolerEngineImpl.java index 377c16aa30..bbe77423c6 100755 --- a/core/src/main/java/lucee/runtime/spooler/SpoolerEngineImpl.java +++ b/core/src/main/java/lucee/runtime/spooler/SpoolerEngineImpl.java @@ -41,7 +41,7 @@ import lucee.loader.engine.CFMLEngineFactory; import lucee.runtime.config.Config; import lucee.runtime.config.ConfigWeb; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.converter.JavaConverter; import lucee.runtime.engine.ThreadLocalConfig; import lucee.runtime.engine.ThreadLocalPageContext; @@ -128,7 +128,7 @@ private int calculateSize(Resource res) { @Override public synchronized void add(SpoolerTask task) { - add(ConfigWebUtil.toConfigWeb(ThreadLocalPageContext.getConfig()), task); + add(ConfigUtil.toConfigWeb(ThreadLocalPageContext.getConfig()), task); } public synchronized void add(ConfigWeb config, SpoolerTask task) { @@ -558,7 +558,7 @@ public void run() { */ @Override public void remove(SpoolerTask task) { - unstore(ConfigWebUtil.toConfigWeb(ThreadLocalPageContext.getConfig()), task); + unstore(ConfigUtil.toConfigWeb(ThreadLocalPageContext.getConfig()), task); // if(!openTasks.remove(task))closedTasks.remove(task); } @@ -609,7 +609,7 @@ public PageException execute(String id) { @Override public PageException execute(SpoolerTask task) { - return execute(ConfigWebUtil.toConfigWeb(ThreadLocalPageContext.getConfig()), task); + return execute(ConfigUtil.toConfigWeb(ThreadLocalPageContext.getConfig()), task); } public PageException execute(ConfigWeb config, SpoolerTask task) { diff --git a/core/src/main/java/lucee/runtime/tag/Admin.java b/core/src/main/java/lucee/runtime/tag/Admin.java index 0915be3533..f839e3053e 100755 --- a/core/src/main/java/lucee/runtime/tag/Admin.java +++ b/core/src/main/java/lucee/runtime/tag/Admin.java @@ -96,14 +96,13 @@ import lucee.runtime.config.AdminSync; import lucee.runtime.config.Config; import lucee.runtime.config.ConfigAdmin; -import lucee.runtime.config.ConfigImpl; import lucee.runtime.config.ConfigPro; import lucee.runtime.config.ConfigServer; import lucee.runtime.config.ConfigServerImpl; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.config.ConfigWeb; import lucee.runtime.config.ConfigWebFactory; import lucee.runtime.config.ConfigWebPro; -import lucee.runtime.config.ConfigWebUtil; import lucee.runtime.config.Constants; import lucee.runtime.config.DatasourceConnPool; import lucee.runtime.config.DebugEntry; @@ -239,8 +238,6 @@ public final class Admin extends TagImpl implements DynamicAttributes { private Struct attributes = new StructImpl(); private String action = null; - private short type; - private boolean singleMode; private Password password; private ConfigAdmin admin; private ConfigPro config = null; @@ -320,13 +317,9 @@ public int doStartTag() throws PageException { return SKIP_BODY; } - // Type - singleMode = config.getAdminMode() == ConfigImpl.ADMINMODE_SINGLE; - type = singleMode ? TYPE_SERVER : toType(getString("type", "web"), true); - // has Password if (action.equals("haspassword")) { - boolean hasPassword = type == TYPE_WEB ? pageContext.getConfig().hasPassword() : pageContext.getConfig().hasServerPassword(); + boolean hasPassword = pageContext.getConfig().hasPassword(); pageContext.setVariable(getString("admin", action, "returnVariable", true), Caster.toBoolean(hasPassword)); return SKIP_BODY; @@ -347,7 +340,7 @@ else if (action.equals("checkpassword")) { else if (action.equals("updatepassword")) { try { - ((ConfigWebPro) pageContext.getConfig()).updatePassword(type != TYPE_WEB, getString("oldPassword", null), getString("admin", action, "newPassword", true)); + ((ConfigWebPro) pageContext.getConfig()).updatePassword(getString("oldPassword", null), getString("admin", action, "newPassword", true)); } catch (Exception e) { throw Caster.toPageException(e); @@ -548,13 +541,11 @@ private void _doStartTag() throws PageException, IOException { } if (action.equals("getextension")) { - if (type == TYPE_SERVER) doGetRHServerExtension(); - else doGetRHExtension(); + doGetRHExtension(); return; } if (action.equals("getextensions") || action.equals("getrhextensions")) { - if (type == TYPE_SERVER) doGetRHServerExtensions(); - else doGetRHExtensions(); + doGetRHExtensions(); return; } if (action.equals("getserverextensions") || action.equals("getrhserverextensions")) { @@ -562,11 +553,11 @@ private void _doStartTag() throws PageException, IOException { return; } - if (check("hashpassword", ACCESS_FREE)) { + if (check("hashpassword")) { String raw = getString("admin", action, "pw"); - Password pw = PasswordImpl.passwordToCompare(pageContext.getConfig(), type != TYPE_WEB, raw); + Password pw = PasswordImpl.passwordToCompare(pageContext.getConfig(), raw); - Password changed = ((ConfigWebPro) pageContext.getConfig()).updatePasswordIfNecessary(type == TYPE_SERVER, raw); + Password changed = ((ConfigWebPro) pageContext.getConfig()).updatePasswordIfNecessary(raw); if (changed != null) pw = changed; pageContext.setVariable(getString("admin", action, "returnVariable"), pw.getPassword()); @@ -576,16 +567,13 @@ private void _doStartTag() throws PageException, IOException { try { // Password String strPW = getString("password", ""); - Password tmp = type == TYPE_SERVER ? configWeb.isServerPasswordEqual(strPW) : config.isPasswordEqual(strPW); // hash password if + Password tmp = config.isPasswordEqual(strPW); // hash password if // necessary (for // backward // compatibility) if (tmp != null) password = tmp; else password = null; - // Config - if (type == TYPE_SERVER) config = (ConfigPro) pageContext.getConfig().getConfigServer(password); - adminSync = config.getAdminSync(); admin = ConfigAdmin.newInstance(config, password); } @@ -593,9 +581,9 @@ private void _doStartTag() throws PageException, IOException { throw Caster.toPageException(e); } - if (check("connect", ACCESS_FREE)) { - ConfigWebUtil.checkPassword(config, null, password); - ConfigWebUtil.checkGeneralReadAccess(config, password); + if (check("connect")) { + ConfigUtil.checkPassword(config, null, password); + ConfigUtil.checkGeneralReadAccess(config, password); try { if (config instanceof ConfigServer) ((PageContextImpl) pageContext).setServerPassword(password); @@ -604,268 +592,267 @@ private void _doStartTag() throws PageException, IOException { ExceptionUtil.rethrowIfNecessary(t); } } - else if (check("getinfo", ACCESS_FREE) && check2(ACCESS_READ)) doGetInfo(); - else if (check("surveillance", ACCESS_FREE) && check2(ACCESS_READ)) doSurveillance(); - else if (check("getRegional", ACCESS_FREE) && check2(ACCESS_READ)) doGetRegional(); - else if (check("isMonitorEnabled", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_READ)) doIsMonitorEnabled(); - else if (check("resetORMSetting", ACCESS_FREE) && check2(ACCESS_READ)) doResetORMSetting(); - else if (check("getORMSetting", ACCESS_FREE) && check2(ACCESS_READ)) doGetORMSetting(); - else if (check("getORMEngine", ACCESS_FREE) && check2(ACCESS_READ)) doGetORMEngine(); - else if (check("updateORMSetting", ACCESS_FREE) && check2(ACCESS_READ)) doUpdateORMSetting(); - else if (check("getApplicationListener", ACCESS_FREE) && check2(ACCESS_READ)) doGetApplicationListener(); - else if (check("getProxy", ACCESS_FREE) && check2(ACCESS_READ)) doGetProxy(); - else if (check("getCharset", ACCESS_FREE) && check2(ACCESS_READ)) doGetCharset(); - else if (check("getComponent", ACCESS_FREE) && check2(ACCESS_READ)) doGetComponent(); - else if (check("getScope", ACCESS_FREE) && check2(ACCESS_READ)) doGetScope(); - else if (check("getDevelopMode", ACCESS_FREE) && check2(ACCESS_READ)) doGetDevelopMode(); - else if (check("getApplicationSetting", ACCESS_FREE) && check2(ACCESS_READ)) doGetApplicationSetting(); - else if (check("getQueueSetting", ACCESS_FREE) && check2(ACCESS_READ)) doGetQueueSetting(); - else if (check("getOutputSetting", ACCESS_FREE) && check2(ACCESS_READ)) doGetOutputSetting(); - else if (check("getDatasourceSetting", ACCESS_FREE) && check2(ACCESS_READ)) doGetDatasourceSetting(); - else if (check("getCustomTagSetting", ACCESS_FREE) && check2(ACCESS_READ)) doGetCustomTagSetting(); - else if (check("getDatasource", ACCESS_FREE) && check2(ACCESS_READ)) doGetDatasource(); - else if (check("getDatasources", ACCESS_FREE) && check2(ACCESS_READ)) doGetDatasources(); - else if (check("getJDBCDrivers", ACCESS_FREE) && check2(ACCESS_READ)) doGetJDBCDrivers(); - else if (check("getCacheConnections", ACCESS_FREE) && check2(ACCESS_READ)) doGetCacheConnections(); - else if (check("getCacheConnection", ACCESS_FREE) && check2(ACCESS_READ)) doGetCacheConnection(); - else if (check("getCacheDefaultConnection", ACCESS_FREE) && check2(ACCESS_READ)) doGetCacheDefaultConnection(); - else if (check("getAIConnections", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_READ)) doGetAIConnections(); - else if (check("getRemoteClients", ACCESS_FREE) && check2(ACCESS_READ)) doGetRemoteClients(); - else if (check("getRemoteClient", ACCESS_FREE) && check2(ACCESS_READ)) doGetRemoteClient(); - else if (check("hasRemoteClientUsage", ACCESS_FREE) && check2(ACCESS_READ)) doHasRemoteClientUsage(); - else if (check("getRemoteClientUsage", ACCESS_FREE) && check2(ACCESS_READ)) doGetRemoteClientUsage(); - else if (check("getSpoolerTasks", ACCESS_FREE) && check2(ACCESS_READ)) doGetSpoolerTasks(); - else if (check("getPerformanceSettings", ACCESS_FREE) && check2(ACCESS_READ)) doGetPerformanceSettings(); - else if (check("getLogSettings", ACCESS_FREE) && check2(ACCESS_READ)) doGetLogSettings(); - else if (check("getCompilerSettings", ACCESS_FREE) && check2(ACCESS_READ)) doGetCompilerSettings(); - else if (check("updatePerformanceSettings", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdatePerformanceSettings(); - else if (check("updateCompilerSettings", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateCompilerSettings(); - else if (check("getGatewayentries", ACCESS_NOT_WHEN_SERVER) && check2(ACCESS_READ)) doGetGatewayEntries(); - else if (check("getGatewayentry", ACCESS_NOT_WHEN_SERVER) && check2(ACCESS_READ)) doGetGatewayEntry(); - else if (check("getRunningThreads", ACCESS_FREE) && check2(ACCESS_READ)) doGetRunningThreads(); - else if (check("getMonitors", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_READ)) doGetMonitors(); - else if (check("getMonitor", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_READ)) doGetMonitor(); - else if (check("getBundles", ACCESS_FREE) && check2(ACCESS_READ)) doGetBundles(); - else if (check("getBundle", ACCESS_FREE) && check2(ACCESS_READ)) doGetBundle(); - else if (check("getExecutionLog", ACCESS_FREE) && check2(ACCESS_READ)) doGetExecutionLog(); - else if (check("gateway", ACCESS_NOT_WHEN_SERVER) && check2(ACCESS_READ)) doGateway(); + else if (check("getinfo") && check2(ACCESS_READ)) doGetInfo(); + else if (check("surveillance") && check2(ACCESS_READ)) doSurveillance(); + else if (check("getRegional") && check2(ACCESS_READ)) doGetRegional(); + else if (check("isMonitorEnabled") && check2(ACCESS_READ)) doIsMonitorEnabled(); + else if (check("resetORMSetting") && check2(ACCESS_READ)) doResetORMSetting(); + else if (check("getORMSetting") && check2(ACCESS_READ)) doGetORMSetting(); + else if (check("getORMEngine") && check2(ACCESS_READ)) doGetORMEngine(); + else if (check("updateORMSetting") && check2(ACCESS_READ)) doUpdateORMSetting(); + else if (check("getApplicationListener") && check2(ACCESS_READ)) doGetApplicationListener(); + else if (check("getProxy") && check2(ACCESS_READ)) doGetProxy(); + else if (check("getCharset") && check2(ACCESS_READ)) doGetCharset(); + else if (check("getComponent") && check2(ACCESS_READ)) doGetComponent(); + else if (check("getScope") && check2(ACCESS_READ)) doGetScope(); + else if (check("getDevelopMode") && check2(ACCESS_READ)) doGetDevelopMode(); + else if (check("getApplicationSetting") && check2(ACCESS_READ)) doGetApplicationSetting(); + else if (check("getQueueSetting") && check2(ACCESS_READ)) doGetQueueSetting(); + else if (check("getOutputSetting") && check2(ACCESS_READ)) doGetOutputSetting(); + else if (check("getDatasourceSetting") && check2(ACCESS_READ)) doGetDatasourceSetting(); + else if (check("getCustomTagSetting") && check2(ACCESS_READ)) doGetCustomTagSetting(); + else if (check("getDatasource") && check2(ACCESS_READ)) doGetDatasource(); + else if (check("getDatasources") && check2(ACCESS_READ)) doGetDatasources(); + else if (check("getJDBCDrivers") && check2(ACCESS_READ)) doGetJDBCDrivers(); + else if (check("getCacheConnections") && check2(ACCESS_READ)) doGetCacheConnections(); + else if (check("getCacheConnection") && check2(ACCESS_READ)) doGetCacheConnection(); + else if (check("getCacheDefaultConnection") && check2(ACCESS_READ)) doGetCacheDefaultConnection(); + else if (check("getAIConnections") && check2(ACCESS_READ)) doGetAIConnections(); + else if (check("getRemoteClients") && check2(ACCESS_READ)) doGetRemoteClients(); + else if (check("getRemoteClient") && check2(ACCESS_READ)) doGetRemoteClient(); + else if (check("hasRemoteClientUsage") && check2(ACCESS_READ)) doHasRemoteClientUsage(); + else if (check("getRemoteClientUsage") && check2(ACCESS_READ)) doGetRemoteClientUsage(); + else if (check("getSpoolerTasks") && check2(ACCESS_READ)) doGetSpoolerTasks(); + else if (check("getPerformanceSettings") && check2(ACCESS_READ)) doGetPerformanceSettings(); + else if (check("getLogSettings") && check2(ACCESS_READ)) doGetLogSettings(); + else if (check("getCompilerSettings") && check2(ACCESS_READ)) doGetCompilerSettings(); + else if (check("updatePerformanceSettings") && check2(ACCESS_WRITE)) doUpdatePerformanceSettings(); + else if (check("updateCompilerSettings") && check2(ACCESS_WRITE)) doUpdateCompilerSettings(); + else if (check("getGatewayentries") && check2(ACCESS_READ)) doGetGatewayEntries(); + else if (check("getGatewayentry") && check2(ACCESS_READ)) doGetGatewayEntry(); + else if (check("getRunningThreads") && check2(ACCESS_READ)) doGetRunningThreads(); + else if (check("getMonitors") && check2(ACCESS_READ)) doGetMonitors(); + else if (check("getMonitor") && check2(ACCESS_READ)) doGetMonitor(); + else if (check("getBundles") && check2(ACCESS_READ)) doGetBundles(); + else if (check("getBundle") && check2(ACCESS_READ)) doGetBundle(); + else if (check("getExecutionLog") && check2(ACCESS_READ)) doGetExecutionLog(); + else if (check("gateway") && check2(ACCESS_READ)) doGateway(); // alias for getSpoolerTasks - else if (check("getRemoteClientTasks", ACCESS_FREE) && check2(ACCESS_READ)) doGetSpoolerTasks(); - else if (check("getDatasourceDriverList", ACCESS_FREE) && check2(ACCESS_READ)) doGetDatasourceDriverList(); - else if (check("getDebuggingList", ACCESS_FREE) && check2(ACCESS_READ)) doGetDebuggingList(); - else if (check("getLoggedDebugData", ACCESS_FREE)) // no password necessary for this + else if (check("getRemoteClientTasks") && check2(ACCESS_READ)) doGetSpoolerTasks(); + else if (check("getDatasourceDriverList") && check2(ACCESS_READ)) doGetDatasourceDriverList(); + else if (check("getDebuggingList") && check2(ACCESS_READ)) doGetDebuggingList(); + else if (check("getLoggedDebugData")) // no password necessary for this doGetLoggedDebugData(); - else if (check("PurgeDebugPool", ACCESS_FREE) && check2(ACCESS_WRITE)) doPurgeDebugPool(); - else if (check("PurgeExpiredSessions", ACCESS_FREE) && check2(ACCESS_WRITE)) doPurgeExpiredSessions(); - else if (check("getDebugSetting", ACCESS_FREE) && check2(ACCESS_READ)) doGetDebugSetting(); - else if (check("getSSLCertificate", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_READ)) doGetSSLCertificate(); - else if (check("getPluginDirectory", ACCESS_FREE) && check2(ACCESS_READ)) doGetPluginDirectory(); - else if (check("getPlugins", ACCESS_FREE) && check2(ACCESS_READ)) doGetPlugins(); - else if (check("updatePlugin", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdatePlugin(); - else if (check("removePlugin", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemovePlugin(); - - else if (check("getContextDirectory", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_READ)) getContextDirectory(); - else if (check("updateContext", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doUpdateContext(); - else if (check("removeContext", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doRemoveContext(); - - else if (check("getJars", ACCESS_FREE) && check2(ACCESS_READ)) doGetJars(); - else if (check("getFlds", ACCESS_FREE) && check2(ACCESS_READ)) doGetFLDs(); - else if (check("getTlds", ACCESS_FREE) && check2(ACCESS_READ)) doGetTLDs(); - else if (check("getLocalExtension", ACCESS_FREE) && check2(ACCESS_READ)) doGetLocalExtension(); - else if (check("getLocalExtensions", ACCESS_FREE) && check2(ACCESS_READ)) doGetLocalExtensions(); - else if (check("getMailSetting", ACCESS_FREE) && check2(ACCESS_READ)) doGetMailSetting(); - else if (check("getTaskSetting", ACCESS_FREE) && check2(ACCESS_READ)) doGetTaskSetting(); - else if (check("getMailServers", ACCESS_FREE) && check2(ACCESS_READ)) doGetMailServers(); - else if (check("getMapping", ACCESS_FREE) && check2(ACCESS_READ)) doGetMapping(); - else if (check("getMappings", ACCESS_FREE) && check2(ACCESS_READ)) doGetMappings(); - else if (check("getRestMappings", ACCESS_FREE) && check2(ACCESS_READ)) doGetRestMappings(); - else if (check("getRestSettings", ACCESS_FREE) && check2(ACCESS_READ)) doGetRestSettings(); - else if ((check("getRHExtensionProviders", ACCESS_FREE) || check("getExtensionProviders", ACCESS_FREE)) && check2(ACCESS_READ)) doGetRHExtensionProviders(); - - else if (check("getCustomTagMappings", ACCESS_FREE) && check2(ACCESS_READ)) doGetCustomTagMappings(); - else if (check("getComponentMappings", ACCESS_FREE) && check2(ACCESS_READ)) doGetComponentMappings(); - else if (check("getCfxTags", ACCESS_FREE) && check2(ACCESS_READ)) doGetCFXTags(); - else if (check("getJavaCfxTags", ACCESS_FREE) && check2(ACCESS_READ)) doGetJavaCFXTags(); - else if (check("getDebug", ACCESS_FREE) && check2(ACCESS_READ)) doGetDebug(); - else if (check("getMonitoring", ACCESS_FREE) && check2(ACCESS_READ)) doGetMonitoring(); - else if (check("getSecurity", ACCESS_FREE) && check2(ACCESS_READ)) doGetSecurity(); - else if (check("getDebugEntry", ACCESS_FREE)) doGetDebugEntry(); - else if (check("getError", ACCESS_FREE) && check2(ACCESS_READ)) doGetError(); - else if (check("getRegex", ACCESS_FREE) && check2(ACCESS_READ)) doGetRegex(); - else if (check("verifyremoteclient", ACCESS_FREE) && check2(ACCESS_READ)) doVerifyRemoteClient(); - else if (check("verifyDatasource", ACCESS_FREE) && check2(ACCESS_READ)) doVerifyDatasource(); - else if (check("verifyCacheConnection", ACCESS_FREE) && check2(ACCESS_READ)) doVerifyCacheConnection(); - else if (check("verifyAIConnection", ACCESS_FREE) && check2(ACCESS_READ)) doVerifyAIConnection(); - else if (check("verifyMailServer", ACCESS_FREE) && check2(ACCESS_READ)) doVerifyMailServer(); - else if (check("verifyExtensionProvider", ACCESS_FREE) && check2(ACCESS_READ)) doVerifyExtensionProvider(); - else if (check("verifyJavaCFX", ACCESS_FREE) && check2(ACCESS_READ)) doVerifyJavaCFX(); - else if (check("verifyCFX", ACCESS_FREE) && check2(ACCESS_READ)) doVerifyCFX(); - - else if (check("resetId", ACCESS_FREE) && check2(ACCESS_WRITE)) doResetId(); - else if (check("updateLoginSettings", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doUpdateLoginSettings(); - else if (check("updateLogSettings", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateLogSettings(); - else if (check("updateJar", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateJar(); - else if (check("updateSSLCertificate", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doUpdateSSLCertificate(); - else if (check("updateMonitorEnabled", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doUpdateMonitorEnabled(); - else if (check("updateTLD", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateTLD(); - else if (check("updateFLD", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateFLD(); - else if (check("updateFilesystem", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateFilesystem(); - else if (check("updateregional", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateRegional(); - else if (check("updateApplicationListener", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateApplicationListener(); - else if (check("updateCachedWithin", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateCachedWithin(); - else if (check("updateproxy", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateProxy(); - else if (check("updateCharset", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateCharset(); - else if (check("updatecomponent", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateComponent(); - else if (check("updatescope", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateScope(); - else if (check("updateDevelopMode", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateDevelopMode(); - else if (check("updateRestSettings", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateRestSettings(); - else if (check("updateRestMapping", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateRestMapping(); - else if (check("removeRestMapping", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveRestMapping(); - else if (check("updateApplicationSetting", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateApplicationSettings(); - else if (check("updateOutputSetting", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateOutputSettings(); - else if (check("updateQueueSetting", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doUpdateQueueSettings(); - else if (check("updatepsq", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdatePSQ(); - else if (check("updatedatasource", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateDatasource(); - else if (check("updateJDBCDriver", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateJDBCDriver(); - else if (check("updateCacheDefaultConnection", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateCacheDefaultConnection(); - else if (check("updateCacheConnection", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateCacheConnection(); - else if (check("updateAIConnection", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateAIConnection(); - else if (check("updateremoteclient", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateRemoteClient(); - else if (check("updateRemoteClientUsage", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateRemoteClientUsage(); - else if (check("updatemailsetting", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateMailSetting(); - else if (check("updatemailserver", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateMailServer(); - else if (check("updatetasksetting", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateTaskSetting(); - else if (check("updatemapping", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateMapping(); - else if (check("updatecustomtag", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateCustomTag(); - else if (check("updateComponentMapping", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateComponentMapping(); - else if (check("stopThread", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doStopThread(); - else if (check("updateAdminMode", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doUpdateAdminMode(); - - else if (check("updatejavacfx", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateJavaCFX(); - else if (check("updatedebug", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateDebug(); - else if (check("updatemonitoring", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateMonitoring(); - else if (check("updatesecurity", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateSecurity(); - else if (check("updatedebugentry", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateDebugEntry(); - else if (check("updatedebugsetting", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateDebugSetting(); - - else if (check("updateerror", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateError(); - else if (check("updateregex", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateRegex(); - else if (check("updateCustomTagSetting", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateCustomTagSetting(); - // else if(check("updateExtension", ACCESS_FREE) && check2(ACCESS_WRITE)) + else if (check("PurgeDebugPool") && check2(ACCESS_WRITE)) doPurgeDebugPool(); + else if (check("PurgeExpiredSessions") && check2(ACCESS_WRITE)) doPurgeExpiredSessions(); + else if (check("getDebugSetting") && check2(ACCESS_READ)) doGetDebugSetting(); + else if (check("getSSLCertificate") && check2(ACCESS_READ)) doGetSSLCertificate(); + else if (check("getPluginDirectory") && check2(ACCESS_READ)) doGetPluginDirectory(); + else if (check("getPlugins") && check2(ACCESS_READ)) doGetPlugins(); + else if (check("updatePlugin") && check2(ACCESS_WRITE)) doUpdatePlugin(); + else if (check("removePlugin") && check2(ACCESS_WRITE)) doRemovePlugin(); + + else if (check("getContextDirectory") && check2(ACCESS_READ)) getContextDirectory(); + else if (check("updateContext") && check2(ACCESS_WRITE)) doUpdateContext(); + else if (check("removeContext") && check2(ACCESS_WRITE)) doRemoveContext(); + + else if (check("getJars") && check2(ACCESS_READ)) doGetJars(); + else if (check("getFlds") && check2(ACCESS_READ)) doGetFLDs(); + else if (check("getTlds") && check2(ACCESS_READ)) doGetTLDs(); + else if (check("getLocalExtension") && check2(ACCESS_READ)) doGetLocalExtension(); + else if (check("getLocalExtensions") && check2(ACCESS_READ)) doGetLocalExtensions(); + else if (check("getMailSetting") && check2(ACCESS_READ)) doGetMailSetting(); + else if (check("getTaskSetting") && check2(ACCESS_READ)) doGetTaskSetting(); + else if (check("getMailServers") && check2(ACCESS_READ)) doGetMailServers(); + else if (check("getMapping") && check2(ACCESS_READ)) doGetMapping(); + else if (check("getMappings") && check2(ACCESS_READ)) doGetMappings(); + else if (check("getRestMappings") && check2(ACCESS_READ)) doGetRestMappings(); + else if (check("getRestSettings") && check2(ACCESS_READ)) doGetRestSettings(); + else if ((check("getRHExtensionProviders") || check("getExtensionProviders")) && check2(ACCESS_READ)) doGetRHExtensionProviders(); + + else if (check("getCustomTagMappings") && check2(ACCESS_READ)) doGetCustomTagMappings(); + else if (check("getComponentMappings") && check2(ACCESS_READ)) doGetComponentMappings(); + else if (check("getCfxTags") && check2(ACCESS_READ)) doGetCFXTags(); + else if (check("getJavaCfxTags") && check2(ACCESS_READ)) doGetJavaCFXTags(); + else if (check("getDebug") && check2(ACCESS_READ)) doGetDebug(); + else if (check("getMonitoring") && check2(ACCESS_READ)) doGetMonitoring(); + else if (check("getSecurity") && check2(ACCESS_READ)) doGetSecurity(); + else if (check("getDebugEntry")) doGetDebugEntry(); + else if (check("getError") && check2(ACCESS_READ)) doGetError(); + else if (check("getRegex") && check2(ACCESS_READ)) doGetRegex(); + else if (check("verifyremoteclient") && check2(ACCESS_READ)) doVerifyRemoteClient(); + else if (check("verifyDatasource") && check2(ACCESS_READ)) doVerifyDatasource(); + else if (check("verifyCacheConnection") && check2(ACCESS_READ)) doVerifyCacheConnection(); + else if (check("verifyAIConnection") && check2(ACCESS_READ)) doVerifyAIConnection(); + else if (check("verifyMailServer") && check2(ACCESS_READ)) doVerifyMailServer(); + else if (check("verifyExtensionProvider") && check2(ACCESS_READ)) doVerifyExtensionProvider(); + else if (check("verifyJavaCFX") && check2(ACCESS_READ)) doVerifyJavaCFX(); + else if (check("verifyCFX") && check2(ACCESS_READ)) doVerifyCFX(); + + else if (check("resetId") && check2(ACCESS_WRITE)) doResetId(); + else if (check("updateLoginSettings") && check2(ACCESS_WRITE)) doUpdateLoginSettings(); + else if (check("updateLogSettings") && check2(ACCESS_WRITE)) doUpdateLogSettings(); + else if (check("updateJar") && check2(ACCESS_WRITE)) doUpdateJar(); + else if (check("updateSSLCertificate") && check2(ACCESS_WRITE)) doUpdateSSLCertificate(); + else if (check("updateMonitorEnabled") && check2(ACCESS_WRITE)) doUpdateMonitorEnabled(); + else if (check("updateTLD") && check2(ACCESS_WRITE)) doUpdateTLD(); + else if (check("updateFLD") && check2(ACCESS_WRITE)) doUpdateFLD(); + else if (check("updateFilesystem") && check2(ACCESS_WRITE)) doUpdateFilesystem(); + else if (check("updateregional") && check2(ACCESS_WRITE)) doUpdateRegional(); + else if (check("updateApplicationListener") && check2(ACCESS_WRITE)) doUpdateApplicationListener(); + else if (check("updateCachedWithin") && check2(ACCESS_WRITE)) doUpdateCachedWithin(); + else if (check("updateproxy") && check2(ACCESS_WRITE)) doUpdateProxy(); + else if (check("updateCharset") && check2(ACCESS_WRITE)) doUpdateCharset(); + else if (check("updatecomponent") && check2(ACCESS_WRITE)) doUpdateComponent(); + else if (check("updatescope") && check2(ACCESS_WRITE)) doUpdateScope(); + else if (check("updateDevelopMode") && check2(ACCESS_WRITE)) doUpdateDevelopMode(); + else if (check("updateRestSettings") && check2(ACCESS_WRITE)) doUpdateRestSettings(); + else if (check("updateRestMapping") && check2(ACCESS_WRITE)) doUpdateRestMapping(); + else if (check("removeRestMapping") && check2(ACCESS_WRITE)) doRemoveRestMapping(); + else if (check("updateApplicationSetting") && check2(ACCESS_WRITE)) doUpdateApplicationSettings(); + else if (check("updateOutputSetting") && check2(ACCESS_WRITE)) doUpdateOutputSettings(); + else if (check("updateQueueSetting") && check2(ACCESS_WRITE)) doUpdateQueueSettings(); + else if (check("updatepsq") && check2(ACCESS_WRITE)) doUpdatePSQ(); + else if (check("updatedatasource") && check2(ACCESS_WRITE)) doUpdateDatasource(); + else if (check("updateJDBCDriver") && check2(ACCESS_WRITE)) doUpdateJDBCDriver(); + else if (check("updateCacheDefaultConnection") && check2(ACCESS_WRITE)) doUpdateCacheDefaultConnection(); + else if (check("updateCacheConnection") && check2(ACCESS_WRITE)) doUpdateCacheConnection(); + else if (check("updateAIConnection") && check2(ACCESS_WRITE)) doUpdateAIConnection(); + else if (check("updateremoteclient") && check2(ACCESS_WRITE)) doUpdateRemoteClient(); + else if (check("updateRemoteClientUsage") && check2(ACCESS_WRITE)) doUpdateRemoteClientUsage(); + else if (check("updatemailsetting") && check2(ACCESS_WRITE)) doUpdateMailSetting(); + else if (check("updatemailserver") && check2(ACCESS_WRITE)) doUpdateMailServer(); + else if (check("updatetasksetting") && check2(ACCESS_WRITE)) doUpdateTaskSetting(); + else if (check("updatemapping") && check2(ACCESS_WRITE)) doUpdateMapping(); + else if (check("updatecustomtag") && check2(ACCESS_WRITE)) doUpdateCustomTag(); + else if (check("updateComponentMapping") && check2(ACCESS_WRITE)) doUpdateComponentMapping(); + else if (check("stopThread") && check2(ACCESS_WRITE)) doStopThread(); + + else if (check("updatejavacfx") && check2(ACCESS_WRITE)) doUpdateJavaCFX(); + else if (check("updatedebug") && check2(ACCESS_WRITE)) doUpdateDebug(); + else if (check("updatemonitoring") && check2(ACCESS_WRITE)) doUpdateMonitoring(); + else if (check("updatesecurity") && check2(ACCESS_WRITE)) doUpdateSecurity(); + else if (check("updatedebugentry") && check2(ACCESS_WRITE)) doUpdateDebugEntry(); + else if (check("updatedebugsetting") && check2(ACCESS_WRITE)) doUpdateDebugSetting(); + + else if (check("updateerror") && check2(ACCESS_WRITE)) doUpdateError(); + else if (check("updateregex") && check2(ACCESS_WRITE)) doUpdateRegex(); + else if (check("updateCustomTagSetting") && check2(ACCESS_WRITE)) doUpdateCustomTagSetting(); + // else if(check("updateExtension") && check2(ACCESS_WRITE)) // doUpdateExtension(); - else if ((check("updateRHExtension", ACCESS_FREE) || check("updateExtension", ACCESS_FREE)) && check2(ACCESS_WRITE)) doUpdateRHExtension(true); - else if ((check("removeRHExtension", ACCESS_FREE) || check("removeExtension", ACCESS_FREE)) && check2(ACCESS_WRITE)) doRemoveRHExtension(); - else if (check("updateExtensionProvider", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateExtensionProvider(); - else if ((check("updateRHExtensionProvider", ACCESS_FREE) || check("updateExtensionProvider", ACCESS_FREE)) && check2(ACCESS_WRITE)) doUpdateRHExtensionProvider(); - else if (check("updateExtensionInfo", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateExtensionInfo(); - else if (check("updateGatewayEntry", ACCESS_NOT_WHEN_SERVER) && check2(ACCESS_WRITE)) doUpdateGatewayEntry(); - // else if(check("updateLogSettings", ACCESS_FREE) && check2(ACCESS_WRITE )) + else if ((check("updateRHExtension") || check("updateExtension")) && check2(ACCESS_WRITE)) doUpdateRHExtension(true); + else if ((check("removeRHExtension") || check("removeExtension")) && check2(ACCESS_WRITE)) doRemoveRHExtension(); + else if (check("updateExtensionProvider") && check2(ACCESS_WRITE)) doUpdateExtensionProvider(); + else if ((check("updateRHExtensionProvider") || check("updateExtensionProvider")) && check2(ACCESS_WRITE)) doUpdateRHExtensionProvider(); + else if (check("updateExtensionInfo") && check2(ACCESS_WRITE)) doUpdateExtensionInfo(); + else if (check("updateGatewayEntry") && check2(ACCESS_WRITE)) doUpdateGatewayEntry(); + // else if(check("updateLogSettings") && check2(ACCESS_WRITE )) // doUpdateUpdateLogSettings(); - else if (check("updateMonitor", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doUpdateMonitor(); - else if (check("updateCacheHandler", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doUpdateCacheHandler(); - else if (check("updateORMEngine", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateORMEngine(); - else if (check("updateExecutionLog", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateExecutionLog(); + else if (check("updateMonitor") && check2(ACCESS_WRITE)) doUpdateMonitor(); + else if (check("updateCacheHandler") && check2(ACCESS_WRITE)) doUpdateCacheHandler(); + else if (check("updateORMEngine") && check2(ACCESS_WRITE)) doUpdateORMEngine(); + else if (check("updateExecutionLog") && check2(ACCESS_WRITE)) doUpdateExecutionLog(); // else if(check("removeproxy", ACCESS_NOT_WHEN_SERVER )) doRemoveProxy(); - else if (check("removeMonitor", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doRemoveMonitor(); - else if (check("removeCacheHandler", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doRemoveCacheHandler(); - else if (check("removeORMEngine", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveORMEngine(); - else if (check("removebundle", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveBundle(); - else if (check("removeTLD", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveTLD(); - else if (check("removeFLD", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveFLD(); - else if (check("removeJDBCDriver", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveJDBCDriver(); - else if (check("removedatasource", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveDatasource(); - else if (check("removeCacheConnection", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveCacheConnection(); - else if (check("removeAIConnection", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveAIConnection(); - else if (check("removeremoteclient", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveRemoteClient(); - else if (check("removeRemoteClientUsage", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveRemoteClientUsage(); - else if (check("removeSpoolerTask", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveSpoolerTask(); - else if (check("removeAllSpoolerTask", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveAllSpoolerTask(); + else if (check("removeMonitor") && check2(ACCESS_WRITE)) doRemoveMonitor(); + else if (check("removeCacheHandler") && check2(ACCESS_WRITE)) doRemoveCacheHandler(); + else if (check("removeORMEngine") && check2(ACCESS_WRITE)) doRemoveORMEngine(); + else if (check("removebundle") && check2(ACCESS_WRITE)) doRemoveBundle(); + else if (check("removeTLD") && check2(ACCESS_WRITE)) doRemoveTLD(); + else if (check("removeFLD") && check2(ACCESS_WRITE)) doRemoveFLD(); + else if (check("removeJDBCDriver") && check2(ACCESS_WRITE)) doRemoveJDBCDriver(); + else if (check("removedatasource") && check2(ACCESS_WRITE)) doRemoveDatasource(); + else if (check("removeCacheConnection") && check2(ACCESS_WRITE)) doRemoveCacheConnection(); + else if (check("removeAIConnection") && check2(ACCESS_WRITE)) doRemoveAIConnection(); + else if (check("removeremoteclient") && check2(ACCESS_WRITE)) doRemoveRemoteClient(); + else if (check("removeRemoteClientUsage") && check2(ACCESS_WRITE)) doRemoveRemoteClientUsage(); + else if (check("removeSpoolerTask") && check2(ACCESS_WRITE)) doRemoveSpoolerTask(); + else if (check("removeAllSpoolerTask") && check2(ACCESS_WRITE)) doRemoveAllSpoolerTask(); // alias for executeSpoolerTask - else if (check("removeRemoteClientTask", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveSpoolerTask(); - else if (check("executeSpoolerTask", ACCESS_FREE) && check2(ACCESS_WRITE)) doExecuteSpoolerTask(); + else if (check("removeRemoteClientTask") && check2(ACCESS_WRITE)) doRemoveSpoolerTask(); + else if (check("executeSpoolerTask") && check2(ACCESS_WRITE)) doExecuteSpoolerTask(); // alias for executeSpoolerTask - else if (check("executeRemoteClientTask", ACCESS_FREE) && check2(ACCESS_WRITE)) doExecuteSpoolerTask(); - else if (check("removemailserver", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveMailServer(); - else if (check("removemapping", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveMapping(); - else if (check("removecustomtag", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveCustomTag(); - else if (check("removecomponentmapping", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveComponentMapping(); - else if (check("removecfx", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveCFX(); - else if (check("removeExtension", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveExtension(); - else if (check("removeExtensionProvider", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveExtensionProvider(); - else if (check("removeRHExtensionProvider", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveRHExtensionProvider(); - else if (check("removeDefaultPassword", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveDefaultPassword(); - else if (check("removeGatewayEntry", ACCESS_NOT_WHEN_SERVER) && check2(ACCESS_WRITE)) doRemoveGatewayEntry(); - else if (check("removeDebugEntry", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveDebugEntry(); - else if (check("removeCacheDefaultConnection", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveCacheDefaultConnection(); - else if (check("removeLogSetting", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveLogSetting(); - - else if (check("storageGet", ACCESS_FREE) && check2(ACCESS_READ)) doStorageGet(); - else if (check("storageSet", ACCESS_FREE) && check2(ACCESS_WRITE)) doStorageSet(); - - else if (check("getdefaultpassword", ACCESS_FREE) && check2(ACCESS_READ)) doGetDefaultPassword(); - else if (check("getContexts", ACCESS_FREE) && check2(ACCESS_READ)) doGetContexts(); - else if (check("getContextes", ACCESS_FREE) && check2(ACCESS_READ)) doGetContexts(); - else if (check("updatedefaultpassword", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateDefaultPassword(); - else if (check("hasindividualsecurity", ACCESS_FREE) && check2(ACCESS_READ)) doHasIndividualSecurity(); - else if (check("resetpassword", ACCESS_FREE) && check2(ACCESS_WRITE)) doResetPassword(); - else if (check("stopThread", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doStopThread(); - - else if (check("updateAuthKey", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doUpdateAuthKey(); - else if (check("removeAuthKey", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doRemoveAuthKey(); - else if (check("listAuthKey", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doListAuthKey(); - - else if (check("updateAPIKey", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateAPIKey(); - else if (check("removeAPIKey", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveAPIKey(); - else if (check("getAPIKey", ACCESS_FREE) && check2(ACCESS_READ)) doGetAPIKey(); - - else if (check("createsecuritymanager", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doCreateSecurityManager(); - else if (check("getsecuritymanager", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_READ)) doGetSecurityManager(); - else if (check("removesecuritymanager", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doRemoveSecurityManager(); - else if (check("getdefaultsecuritymanager", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_READ)) doGetDefaultSecurityManager(); - else if (check("updatesecuritymanager", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doUpdateSecurityManager(); - else if (check("updatedefaultsecuritymanager", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doUpdateDefaultSecurityManager(); - else if (check("compileMapping", ACCESS_FREE) && check2(ACCESS_WRITE)) doCompileMapping(); - else if (check("compileComponentMapping", ACCESS_FREE) && check2(ACCESS_WRITE)) doCompileComponentMapping(); - else if (check("compileCTMapping", ACCESS_FREE) && check2(ACCESS_WRITE)) doCompileCTMapping(); - else if (check("createArchive", ACCESS_FREE) && check2(ACCESS_WRITE)) doCreateArchive(MAPPING_REGULAR); - else if (check("createComponentArchive", ACCESS_FREE) && check2(ACCESS_WRITE)) doCreateArchive(MAPPING_CFC); - else if (check("createCTArchive", ACCESS_FREE) && check2(ACCESS_WRITE)) doCreateArchive(MAPPING_CT); - else if (check("reload", ACCESS_FREE) && check2(ACCESS_WRITE)) doReload(); - - else if (check("getResourceProviders", ACCESS_FREE) && check2(ACCESS_READ)) doGetResourceProviders(); - else if (check("updateResourceProvider", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateResourceProvider(); - else if (check("updateDefaultResourceProvider", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateDefaultResourceProvider(); - else if (check("removeResourceProvider", ACCESS_FREE) && check2(ACCESS_WRITE)) doRemoveResourceProvider(); - else if (check("getAdminSyncClass", ACCESS_FREE) && check2(ACCESS_READ)) doGetAdminSyncClass(); - else if (check("updateAdminSyncClass", ACCESS_FREE) && check2(ACCESS_WRITE)) doUpdateAdminSyncClass(); - - else if (check("terminateRunningThread", ACCESS_FREE) && check2(ACCESS_WRITE)) doTerminateRunningThread(); - - else if (check("updateLabel", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doUpdateLabel(); - else if (check("restart", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doRestart(); - else if (check("runUpdate", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doRunUpdate(); - else if (check("removeUpdate", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doRemoveUpdate(); - else if (check("changeVersionTo", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doChangeVersionTo(); - else if (check("mvnChangeVersionTo", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doMvnChangeVersionTo(); - else if (check("getUpdate", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doGetUpdate(); - else if (check("getMinVersion", ACCESS_FREE) && check2(ACCESS_READ)) getMinVersion(); - else if (check("getLoaderInfo", ACCESS_FREE) && check2(ACCESS_READ)) getLoaderInfo(); - else if (check("listPatches", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_READ)) listPatches(); - else if (check("updateupdate", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doUpdateUpdate(); - else if (check("getSerial", ACCESS_FREE) && check2(ACCESS_READ)) doGetSerial(); - else if (check("updateSerial", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doUpdateSerial(); - else if (check("heapDump", ACCESS_NOT_WHEN_WEB) && check2(ACCESS_WRITE)) doHeapDump(); - else if (check("securitymanager", ACCESS_FREE) && check2(ACCESS_READ)) doSecurityManager(); + else if (check("executeRemoteClientTask") && check2(ACCESS_WRITE)) doExecuteSpoolerTask(); + else if (check("removemailserver") && check2(ACCESS_WRITE)) doRemoveMailServer(); + else if (check("removemapping") && check2(ACCESS_WRITE)) doRemoveMapping(); + else if (check("removecustomtag") && check2(ACCESS_WRITE)) doRemoveCustomTag(); + else if (check("removecomponentmapping") && check2(ACCESS_WRITE)) doRemoveComponentMapping(); + else if (check("removecfx") && check2(ACCESS_WRITE)) doRemoveCFX(); + else if (check("removeExtension") && check2(ACCESS_WRITE)) doRemoveExtension(); + else if (check("removeExtensionProvider") && check2(ACCESS_WRITE)) doRemoveExtensionProvider(); + else if (check("removeRHExtensionProvider") && check2(ACCESS_WRITE)) doRemoveRHExtensionProvider(); + else if (check("removeDefaultPassword") && check2(ACCESS_WRITE)) doRemoveDefaultPassword(); + else if (check("removeGatewayEntry") && check2(ACCESS_WRITE)) doRemoveGatewayEntry(); + else if (check("removeDebugEntry") && check2(ACCESS_WRITE)) doRemoveDebugEntry(); + else if (check("removeCacheDefaultConnection") && check2(ACCESS_WRITE)) doRemoveCacheDefaultConnection(); + else if (check("removeLogSetting") && check2(ACCESS_WRITE)) doRemoveLogSetting(); + + else if (check("storageGet") && check2(ACCESS_READ)) doStorageGet(); + else if (check("storageSet") && check2(ACCESS_WRITE)) doStorageSet(); + + else if (check("getdefaultpassword") && check2(ACCESS_READ)) doGetDefaultPassword(); + else if (check("getContexts") && check2(ACCESS_READ)) doGetContexts(); + else if (check("getContextes") && check2(ACCESS_READ)) doGetContexts(); + else if (check("updatedefaultpassword") && check2(ACCESS_WRITE)) doUpdateDefaultPassword(); + else if (check("hasindividualsecurity") && check2(ACCESS_READ)) doHasIndividualSecurity(); + else if (check("resetpassword") && check2(ACCESS_WRITE)) doResetPassword(); + else if (check("stopThread") && check2(ACCESS_WRITE)) doStopThread(); + + else if (check("updateAuthKey") && check2(ACCESS_WRITE)) doUpdateAuthKey(); + else if (check("removeAuthKey") && check2(ACCESS_WRITE)) doRemoveAuthKey(); + else if (check("listAuthKey") && check2(ACCESS_WRITE)) doListAuthKey(); + + else if (check("updateAPIKey") && check2(ACCESS_WRITE)) doUpdateAPIKey(); + else if (check("removeAPIKey") && check2(ACCESS_WRITE)) doRemoveAPIKey(); + else if (check("getAPIKey") && check2(ACCESS_READ)) doGetAPIKey(); + + else if (check("createsecuritymanager") && check2(ACCESS_WRITE)) doCreateSecurityManager(); + else if (check("getsecuritymanager") && check2(ACCESS_READ)) doGetSecurityManager(); + else if (check("removesecuritymanager") && check2(ACCESS_WRITE)) doRemoveSecurityManager(); + else if (check("getdefaultsecuritymanager") && check2(ACCESS_READ)) doGetDefaultSecurityManager(); + else if (check("updatesecuritymanager") && check2(ACCESS_WRITE)) doUpdateSecurityManager(); + else if (check("updatedefaultsecuritymanager") && check2(ACCESS_WRITE)) doUpdateDefaultSecurityManager(); + else if (check("compileMapping") && check2(ACCESS_WRITE)) doCompileMapping(); + else if (check("compileComponentMapping") && check2(ACCESS_WRITE)) doCompileComponentMapping(); + else if (check("compileCTMapping") && check2(ACCESS_WRITE)) doCompileCTMapping(); + else if (check("createArchive") && check2(ACCESS_WRITE)) doCreateArchive(MAPPING_REGULAR); + else if (check("createComponentArchive") && check2(ACCESS_WRITE)) doCreateArchive(MAPPING_CFC); + else if (check("createCTArchive") && check2(ACCESS_WRITE)) doCreateArchive(MAPPING_CT); + else if (check("reload") && check2(ACCESS_WRITE)) doReload(); + + else if (check("getResourceProviders") && check2(ACCESS_READ)) doGetResourceProviders(); + else if (check("updateResourceProvider") && check2(ACCESS_WRITE)) doUpdateResourceProvider(); + else if (check("updateDefaultResourceProvider") && check2(ACCESS_WRITE)) doUpdateDefaultResourceProvider(); + else if (check("removeResourceProvider") && check2(ACCESS_WRITE)) doRemoveResourceProvider(); + else if (check("getAdminSyncClass") && check2(ACCESS_READ)) doGetAdminSyncClass(); + else if (check("updateAdminSyncClass") && check2(ACCESS_WRITE)) doUpdateAdminSyncClass(); + + else if (check("terminateRunningThread") && check2(ACCESS_WRITE)) doTerminateRunningThread(); + + else if (check("updateLabel") && check2(ACCESS_WRITE)) doUpdateLabel(); + else if (check("restart") && check2(ACCESS_WRITE)) doRestart(); + else if (check("runUpdate") && check2(ACCESS_WRITE)) doRunUpdate(); + else if (check("removeUpdate") && check2(ACCESS_WRITE)) doRemoveUpdate(); + else if (check("changeVersionTo") && check2(ACCESS_WRITE)) doChangeVersionTo(); + else if (check("mvnChangeVersionTo") && check2(ACCESS_WRITE)) doMvnChangeVersionTo(); + else if (check("getUpdate") && check2(ACCESS_WRITE)) doGetUpdate(); + else if (check("getMinVersion") && check2(ACCESS_READ)) getMinVersion(); + else if (check("getLoaderInfo") && check2(ACCESS_READ)) getLoaderInfo(); + else if (check("listPatches") && check2(ACCESS_READ)) listPatches(); + else if (check("updateupdate") && check2(ACCESS_WRITE)) doUpdateUpdate(); + else if (check("getSerial") && check2(ACCESS_READ)) doGetSerial(); + else if (check("updateSerial") && check2(ACCESS_WRITE)) doUpdateSerial(); + else if (check("heapDump") && check2(ACCESS_WRITE)) doHeapDump(); + else if (check("securitymanager") && check2(ACCESS_READ)) doSecurityManager(); else throw new ApplicationException("Invalid action [" + action + "] for tag admin"); } private boolean check2(short accessRW) throws SecurityException { - if (accessRW == ACCESS_READ) ConfigWebUtil.checkGeneralReadAccess(config, password); - else if (accessRW == ACCESS_WRITE) ConfigWebUtil.checkGeneralWriteAccess(config, password); + if (accessRW == ACCESS_READ) ConfigUtil.checkGeneralReadAccess(config, password); + else if (accessRW == ACCESS_WRITE) ConfigUtil.checkGeneralWriteAccess(config, password); /* * else if(accessRW==CHECK_PW) { ConfigWebUtil.checkGeneralReadAccess(config,password); * ConfigWebUtil.checkPassword(config,null,password); } @@ -873,21 +860,8 @@ private boolean check2(short accessRW) throws SecurityException { return true; } - private boolean check(String action, short access) throws ApplicationException { + private boolean check(String action) { if (this.action.equalsIgnoreCase(action)) { - if (access == ACCESS_FREE) { - } - else if (access == ACCESS_NOT_WHEN_SERVER) { - throwNoAccessWhenServer(); - } - - else if (access == ACCESS_NOT_WHEN_WEB) { - throwNoAccessWhenWeb(); - } - else if (access == ACCESS_NEVER) { - throwNoAccessWhenServer(); - throwNoAccessWhenServer(); - } return true; } return false; @@ -1009,9 +983,9 @@ else if (addNonCFMLFiles) { attrs.putValue("mapping-physical-first", Caster.toString(mapping.isPhysicalFirst())); attrs.putValue("mapping-readonly", Caster.toString(mapping.isReadonly())); attrs.putValue("mapping-top-level", Caster.toString(mapping.isTopLevel())); - attrs.putValue("mapping-inspect", ConfigWebUtil.inspectTemplate(mapping.getInspectTemplateRaw(), "")); - attrs.putValue("mapping-listener-type", ConfigWebUtil.toListenerType(mapping.getListenerType(), "")); - attrs.putValue("mapping-listener-mode", ConfigWebUtil.toListenerMode(mapping.getListenerMode(), "")); + attrs.putValue("mapping-inspect", ConfigUtil.inspectTemplate(mapping.getInspectTemplateRaw(), "")); + attrs.putValue("mapping-listener-type", ConfigUtil.toListenerType(mapping.getListenerType(), "")); + attrs.putValue("mapping-listener-mode", ConfigUtil.toListenerMode(mapping.getListenerMode(), "")); mani.createFile(true); IOUtil.write(mani, ManifestUtil.toString(mf, 100, null, null), "UTF-8", false); @@ -1077,8 +1051,7 @@ private Mapping doCompileMapping(short mappingType, String virtual, boolean stop else if (mappingType == MAPPING_CT) mappings = config.getCustomTagMappings(); else mappings = config.getMappings(); - for (int i = 0; i < mappings.length; i++) { - Mapping mapping = mappings[i]; + for (Mapping mapping: mappings) { if (mapping.getVirtualLowerCaseWithSlash().equals(virtual)) { Map errors = stoponerror ? null : MapFactory.getConcurrentMap(); doCompileFile(mapping, mapping.getPhysical(), "", errors, ignoreScopes); @@ -1204,7 +1177,7 @@ private void doRemoveAuthKey() throws PageException { } private void doListAuthKey() throws PageException { - ConfigServerImpl cs = config instanceof ConfigServer ? (ConfigServerImpl) config : (ConfigServerImpl) ConfigWebUtil.getConfigServer(config, password); + ConfigServerImpl cs = ConfigUtil.getConfigServerImpl(config); pageContext.setVariable(getString("admin", action, "returnVariable"), Caster.toArray(cs.getAuthenticationKeys())); } @@ -1214,7 +1187,7 @@ private void doListAuthKey() throws PageException { private void doGetContexts() throws PageException { CFMLFactory[] factories; if (config instanceof ConfigServerImpl) { - ConfigServerImpl cs = (ConfigServerImpl) config; + ConfigServerImpl cs = ConfigUtil.getConfigServerImpl(config); factories = cs.getJSPFactories(); } else { @@ -1281,9 +1254,8 @@ private void doGetSerial() throws PageException { pageContext.setVariable(getString("admin", action, "returnVariable"), config.getSerialNumber()); } - private Resource getContextDirectory() throws PageException { - ConfigServerImpl cs = (ConfigServerImpl) ConfigWebUtil.getConfigServer(config, password); - Resource dist = cs.getConfigDir().getRealResource("distribution"); + private Resource getContextDirectory() { + Resource dist = config.getConfigDir().getRealResource("distribution"); dist.mkdirs(); return dist; } @@ -1313,9 +1285,9 @@ private void doUpdateContext() throws PageException, IOException { String strRealpath = getString("admin", action, "destination"); Resource src = ResourceUtil.toResourceExisting(pageContext, strSrc); - ConfigServerImpl server = (ConfigServerImpl) ConfigWebUtil.getConfigServer(config, password); + ConfigServerImpl cs = ConfigUtil.getConfigServerImpl(config); Resource trg, p; - Resource deploy = server.getConfigDir().getRealResource("web-context-deployment"); + Resource deploy = config.getConfigDir().getRealResource("web-context-deployment"); deploy.mkdirs(); // deploy it @@ -1326,18 +1298,18 @@ private void doUpdateContext() throws PageException, IOException { src.copyTo(trg, false); store(); - ConfigWeb[] webs = server.getConfigWebs(); + ConfigWeb[] webs = cs.getConfigWebs(); for (int i = 0; i < webs.length; i++) { - ConfigWebUtil.deployWebContext(server, webs[i], true); + ConfigUtil.deployWebContext(cs, webs[i], true); } } private void doRemoveContext() throws PageException { String strRealpath = getString("admin", action, "destination"); - ConfigServerImpl server = config instanceof ConfigServer ? (ConfigServerImpl) config : (ConfigServerImpl) ConfigWebUtil.getConfigServer(config, password); + ConfigServerImpl cs = ConfigUtil.getConfigServerImpl(config); try { - admin.removeContext(server, true, ThreadLocalPageContext.getLog(pageContext, "deploy"), strRealpath); + admin.removeContext(cs, true, ThreadLocalPageContext.getLog(pageContext, "deploy"), strRealpath); } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); @@ -1516,11 +1488,6 @@ private void doGetDebugData() throws PageException { } private void doGetLoggedDebugData() throws PageException { - - // to get logged debugging data config should be a ConfigWebPro, - // for singleMode config is always ConfigServer so config must be redefine if it was singleMode - if (singleMode) config = configWeb = (ConfigWebPro) pageContext.getConfig(); - ConfigWebPro cw = configWeb; String id = getString("id", null); Array data = cw.getDebuggerPool().getData(pageContext); @@ -1547,7 +1514,8 @@ private void doPurgeDebugPool() { } private void doPurgeExpiredSessions() { - ConfigServer cs = (ConfigServer) config; + ConfigServer cs = ConfigUtil.getConfigServerImpl(config); + ; ConfigWeb[] webs = cs.getConfigWebs(); for (int i = 0; i < webs.length; i++) { @@ -1634,15 +1602,7 @@ private short fb2(String key) throws PageException { } private void doUpdateDefaultSecurityManager() throws PageException { - if (singleMode) { - admin.updateDefaultSecurity(fb2("access_read"), fb2("access_write")); - } - else { - admin.updateDefaultSecurity(fb("setting"), SecurityManagerImpl.toShortAccessValue(getString("admin", action, "file")), getFileAcces(), fb("direct_java_access"), - fb("mail"), SecurityManagerImpl.toShortAccessValue(getString("admin", action, "datasource")), fb("mapping"), fb("remote"), fb("custom_tag"), fb("cfx_setting"), - fb("cfx_usage"), fb("debugging"), fb("search"), fb("scheduled_task"), fb("tag_execute"), fb("tag_import"), fb("tag_object"), fb("tag_registry"), fb("cache"), - fb("gateway"), fb("orm"), fb2("access_read"), fb2("access_write")); - } + admin.updateDefaultSecurity(fb2("access_read"), fb2("access_write")); store(); adminSync.broadcast(attributes, config); } @@ -1680,14 +1640,14 @@ private void doUpdateSecurityManager() throws PageException { * */ private void doGetDefaultSecurityManager() throws PageException { - ConfigServer cs = ConfigWebUtil.getConfigServer(config, password); + ConfigServer cs = ConfigUtil.getConfigServer(config); SecurityManager dsm = cs.getDefaultSecurityManager(); _fillSecData(dsm); } private void doGetSecurityManager() throws PageException { - ConfigServer cs = ConfigWebUtil.getConfigServer(config, password); + ConfigServer cs = ConfigUtil.getConfigServer(config); SecurityManager sm = cs.getSecurityManager(getString("admin", action, "id")); _fillSecData(sm); } @@ -1970,7 +1930,7 @@ private void doGetCFXTags() throws PageException { */ private void doUpdateComponentMapping() throws PageException { admin.updateComponentMapping(getString("virtual", ""), getString("physical", ""), getString("archive", ""), getString("primary", "physical"), - ConfigWebUtil.inspectTemplate(getString("inspect", ""), ConfigPro.INSPECT_UNDEFINED), getInt("inspectTemplateIntervalSlow", ConfigPro.INSPECT_INTERVAL_UNDEFINED), + ConfigUtil.inspectTemplate(getString("inspect", ""), ConfigPro.INSPECT_UNDEFINED), getInt("inspectTemplateIntervalSlow", ConfigPro.INSPECT_INTERVAL_UNDEFINED), getInt("inspectTemplateIntervalFast", ConfigPro.INSPECT_INTERVAL_UNDEFINED)); store(); adminSync.broadcast(attributes, config); @@ -1991,7 +1951,7 @@ private void doRemoveComponentMapping() throws PageException { */ private void doUpdateCustomTag() throws PageException { admin.updateCustomTag(getString("admin", action, "virtual"), getString("admin", action, "physical"), getString("admin", action, "archive"), - getString("admin", action, "primary"), ConfigWebUtil.inspectTemplate(getString("inspect", ""), ConfigPro.INSPECT_UNDEFINED), + getString("admin", action, "primary"), ConfigUtil.inspectTemplate(getString("inspect", ""), ConfigPro.INSPECT_UNDEFINED), getInt("inspectTemplateIntervalSlow", ConfigPro.INSPECT_INTERVAL_UNDEFINED), getInt("inspectTemplateIntervalFast", ConfigPro.INSPECT_INTERVAL_UNDEFINED)); store(); adminSync.broadcast(attributes, config); @@ -2027,7 +1987,7 @@ private void doGetCustomTagMappings() throws PageException { qry.setAt("hidden", row, Caster.toBoolean(m.isHidden())); qry.setAt("physicalFirst", row, Caster.toBoolean(m.isPhysicalFirst())); qry.setAt("readonly", row, Caster.toBoolean(m.isReadonly())); - qry.setAt("inspect", row, ConfigWebUtil.inspectTemplate(m.getInspectTemplateRaw(), "")); + qry.setAt("inspect", row, ConfigUtil.inspectTemplate(m.getInspectTemplateRaw(), "")); qry.setAt("inspectTemplateIntervalSlow", row, m.getInspectTemplateAutoInterval(true)); qry.setAt("inspectTemplateIntervalFast", row, m.getInspectTemplateAutoInterval(false)); } @@ -2050,7 +2010,7 @@ private void doGetComponentMappings() throws PageException { qry.setAt("hidden", row, Caster.toBoolean(m.isHidden())); qry.setAt("physicalFirst", row, Caster.toBoolean(m.isPhysicalFirst())); qry.setAt("readonly", row, Caster.toBoolean(m.isReadonly())); - qry.setAt("inspect", row, ConfigWebUtil.inspectTemplate(m.getInspectTemplateRaw(), "")); + qry.setAt("inspect", row, ConfigUtil.inspectTemplate(m.getInspectTemplateRaw(), "")); qry.setAt("inspectTemplateIntervalSlow", row, m.getInspectTemplateAutoInterval(true)); qry.setAt("inspectTemplateIntervalFast", row, m.getInspectTemplateAutoInterval(false)); } @@ -2088,10 +2048,10 @@ private void doRemoveRestMapping() throws PageException { private void doUpdateMapping() throws PageException { admin.updateMapping(getString("admin", action, "virtual"), getString("admin", action, "physical"), getString("admin", action, "archive"), - getString("admin", action, "primary"), ConfigWebUtil.inspectTemplate(getString("inspect", ""), ConfigPro.INSPECT_UNDEFINED), + getString("admin", action, "primary"), ConfigUtil.inspectTemplate(getString("inspect", ""), ConfigPro.INSPECT_UNDEFINED), getInt("inspectTemplateIntervalSlow", ConfigPro.INSPECT_INTERVAL_UNDEFINED), getInt("inspectTemplateIntervalFast", ConfigPro.INSPECT_INTERVAL_UNDEFINED), - Caster.toBooleanValue(getString("toplevel", "true")), ConfigWebUtil.toListenerMode(getString("listenerMode", ""), -1), - ConfigWebUtil.toListenerType(getString("listenerType", ""), -1), Caster.toBooleanValue(getString("readonly", "false")) + Caster.toBooleanValue(getString("toplevel", "true")), ConfigUtil.toListenerMode(getString("listenerMode", ""), -1), + ConfigUtil.toListenerType(getString("listenerType", ""), -1), Caster.toBooleanValue(getString("readonly", "false")) ); store(); @@ -2120,7 +2080,7 @@ private void doGetMapping() throws PageException { sct.set(KeyConstants._hidden, Caster.toBoolean(m.isHidden())); sct.set("physicalFirst", Caster.toBoolean(m.isPhysicalFirst())); sct.set("readonly", Caster.toBoolean(m.isReadonly())); - sct.set("inspect", ConfigWebUtil.inspectTemplate(m.getInspectTemplateRaw(), "")); + sct.set("inspect", ConfigUtil.inspectTemplate(m.getInspectTemplateRaw(), "")); sct.set("inspectTemplateIntervalSlow", m.getInspectTemplateAutoInterval(true)); sct.set("inspectTemplateIntervalFast", m.getInspectTemplateAutoInterval(false)); sct.set("toplevel", Caster.toBoolean(m.isTopLevel())); @@ -2162,12 +2122,12 @@ private void doGetMappings() throws PageException { qry.setAt("hidden", row, Caster.toBoolean(m.isHidden())); qry.setAt("physicalFirst", row, Caster.toBoolean(m.isPhysicalFirst())); qry.setAt("readonly", row, Caster.toBoolean(m.isReadonly())); - qry.setAt("inspect", row, ConfigWebUtil.inspectTemplate(m.getInspectTemplateRaw(), "")); + qry.setAt("inspect", row, ConfigUtil.inspectTemplate(m.getInspectTemplateRaw(), "")); qry.setAt("inspectTemplateIntervalSlow", row, m.getInspectTemplateAutoInterval(true)); qry.setAt("inspectTemplateIntervalFast", row, m.getInspectTemplateAutoInterval(false)); qry.setAt("toplevel", row, Caster.toBoolean(m.isTopLevel())); - qry.setAt("listenerType", row, ConfigWebUtil.toListenerType(m.getListenerType(), "inherit")); - qry.setAt("listenerMode", row, ConfigWebUtil.toListenerMode(m.getListenerMode(), "inherit")); + qry.setAt("listenerType", row, ConfigUtil.toListenerType(m.getListenerType(), "inherit")); + qry.setAt("listenerMode", row, ConfigUtil.toListenerMode(m.getListenerMode(), "inherit")); } pageContext.setVariable(getString("admin", action, "returnVariable"), qry); } @@ -2280,7 +2240,7 @@ private void doUpdateTaskSetting() throws PageException { private void listPatches() throws PageException { try { - pageContext.setVariable(getString("admin", action, "returnVariable"), Caster.toArray(((ConfigServerImpl) config).getInstalledPatches())); + pageContext.setVariable(getString("admin", action, "returnVariable"), Caster.toArray(ConfigUtil.getConfigServerImpl(config).getInstalledPatches())); } catch (Exception e) { throw Caster.toPageException(e); @@ -2323,7 +2283,7 @@ private void doGetMailServers() throws PageException { qry.setAt("id", row, s instanceof ServerImpl ? ((ServerImpl) s).getId() : -1); qry.setAt("hostname", row, s.getHostName()); qry.setAt("password", row, s.isReadOnly() ? "" : s.getPassword()); - qry.setAt("passwordEncrypted", row, s.isReadOnly() ? "" : ConfigWebUtil.encrypt(s.getPassword())); + qry.setAt("passwordEncrypted", row, s.isReadOnly() ? "" : ConfigUtil.encrypt(s.getPassword())); qry.setAt("username", row, s.isReadOnly() ? "" : s.getUsername()); qry.setAt("port", row, Caster.toInteger(s.getPort())); qry.setAt("readonly", row, Caster.toBoolean(s.isReadOnly())); @@ -2344,15 +2304,10 @@ private void doGetRunningThreads() throws PageException { lucee.runtime.type.Query qry = new QueryImpl(new String[] { "Id", "Start", "Timeout", "ThreadType", "StackTrace", "TagContext", "Label", "RootPath", "ConfigFile", "URL" }, 0, "query"); - if (type == TYPE_WEB) { - fillGetRunningThreads(qry, pageContext.getConfig()); - } - else { - ConfigServer cs = pageContext.getConfig().getConfigServer(password); - ConfigWeb[] webs = cs.getConfigWebs(); - for (int i = 0; i < webs.length; i++) { - fillGetRunningThreads(qry, webs[i]); - } + ConfigServer cs = pageContext.getConfig().getConfigServer(password); + ConfigWeb[] webs = cs.getConfigWebs(); + for (int i = 0; i < webs.length; i++) { + fillGetRunningThreads(qry, webs[i]); } pageContext.setVariable(getString("admin", action, "returnVariable"), qry); } @@ -2468,10 +2423,6 @@ private void doGetTLDs() throws PageException { pageContext.setVariable(getString("admin", action, "returnVariable"), qry); } - private void doGetRHServerExtension() throws PageException { - _doGetRHExtension(config.getServerRHExtensions()); - } - private void doGetRHExtension() throws PageException { _doGetRHExtension(config.getRHExtensions()); } @@ -2897,9 +2848,8 @@ private void doVerifyRemoteClient() throws PageException { if (!StringUtil.isEmpty(proxyPassword)) pd.setPassword(proxyPassword); if (proxyPort != -1) pd.setPort(proxyPort); } - RemoteClient client = new RemoteClientImpl(getString("admin", action, "label"), type == TYPE_WEB ? "web" : "server", getString("admin", action, "url"), - getString("serverUsername", null), getString("serverPassword", null), getString("admin", action, "adminPassword"), pd, getString("admin", action, "securityKey"), - getString("admin", action, "usage") + RemoteClient client = new RemoteClientImpl(getString("admin", action, "label"), "web", getString("admin", action, "url"), getString("serverUsername", null), + getString("serverPassword", null), getString("admin", action, "adminPassword"), pd, getString("admin", action, "securityKey"), getString("admin", action, "usage") ); @@ -2972,16 +2922,12 @@ private void doRemoveDatasource() throws PageException { private void doTerminateRunningThread() throws PageException { int id = getInt("admin", "RemoveRunningThread", "id"); - if (type == TYPE_WEB) { - terminateRunningThread(pageContext.getConfig(), id); - } - else { - ConfigServer cs = pageContext.getConfig().getConfigServer(password); - ConfigWeb[] webs = cs.getConfigWebs(); - for (int i = 0; i < webs.length; i++) { - if (terminateRunningThread(webs[i], id)) break; - } + ConfigServer cs = pageContext.getConfig().getConfigServer(password); + ConfigWeb[] webs = cs.getConfigWebs(); + for (int i = 0; i < webs.length; i++) { + if (terminateRunningThread(webs[i], id)) break; } + } private static boolean terminateRunningThread(ConfigWeb configWeb, int id) { @@ -3328,7 +3274,7 @@ private void doGetBundle() throws PageException { } } - CFMLEngine engine = ConfigWebUtil.getEngine(config); + CFMLEngine engine = ConfigUtil.getEngine(config); BundleCollection coreBundles = engine.getBundleCollection(); java.util.Collection extBundles = config.getAllExtensionBundleDefintions(); @@ -3405,7 +3351,7 @@ private void doGetBundle() throws PageException { } private void doGetBundles() throws PageException { - CFMLEngine engine = ConfigWebUtil.getEngine(config); + CFMLEngine engine = ConfigUtil.getEngine(config); BundleCollection coreBundles = engine.getBundleCollection(); java.util.Collection extBundles = config.getAllExtensionBundleDefintions(); @@ -3577,7 +3523,7 @@ private boolean _eq(String lName, Version lVersion, String rName, Version rVersi private void doGetMonitors() throws PageException { if (!(config instanceof ConfigServerImpl)) throw new ApplicationException("invalid context for this action"); - ConfigServerImpl cs = (ConfigServerImpl) config; + ConfigServerImpl cs = ConfigUtil.getConfigServerImpl(config); IntervallMonitor[] intervalls = cs.getIntervallMonitors(); RequestMonitor[] requests = cs.getRequestMonitors(); @@ -3590,7 +3536,7 @@ private void doGetMonitors() throws PageException { private void doGetMonitor() throws PageException { if (!(config instanceof ConfigServerImpl)) throw new ApplicationException("invalid context for this action"); - ConfigServerImpl cs = (ConfigServerImpl) config; + ConfigServerImpl cs = ConfigUtil.getConfigServerImpl(config); String type = getString("admin", action, "monitorType"); String name = getString("admin", action, "name"); @@ -3906,7 +3852,7 @@ private void doGetDatasource() throws PageException { sct.setEL(KeyConstants._dsnTranslated, d.getDsnTranslated()); sct.setEL(KeyConstants._timezone, toStringTimeZone(d.getTimeZone())); sct.setEL(KeyConstants._password, d.getPassword()); - sct.setEL(KeyConstants._passwordEncrypted, ConfigWebUtil.encrypt(d.getPassword())); + sct.setEL(KeyConstants._passwordEncrypted, ConfigUtil.encrypt(d.getPassword())); sct.setEL(KeyConstants._username, d.getUsername()); sct.setEL(KeyConstants._readonly, Caster.toBoolean(d.isReadOnly())); sct.setEL(KeyConstants._select, Boolean.valueOf(d.hasAllow(DataSource.ALLOW_SELECT))); @@ -4118,7 +4064,7 @@ private void doGetDatasources() throws PageException { qry.setAt("timezone", row, toStringTimeZone(d.getTimeZone())); qry.setAt(KeyConstants._password, row, d.getPassword()); - qry.setAt("passwordEncrypted", row, ConfigWebUtil.encrypt(d.getPassword())); + qry.setAt("passwordEncrypted", row, ConfigUtil.encrypt(d.getPassword())); qry.setAt(KeyConstants._username, row, d.getUsername()); qry.setAt(KeyConstants._readonly, row, Caster.toBoolean(d.isReadOnly())); qry.setAt(KeyConstants._select, row, Boolean.valueOf(d.hasAllow(DataSource.ALLOW_SELECT))); @@ -4240,13 +4186,6 @@ private void doUpdateCustomTagSetting() throws PageException { adminSync.broadcast(attributes, config); } - private void doUpdateAdminMode() throws PageException { - admin.updateUpdateAdminMode(getString("admin", "updateAdminMode", "mode"), getBool("admin", "updateAdminMode", "merge"), getBool("admin", "updateAdminMode", "keep")); - ((GatewayEngineImpl) configWeb.getGatewayEngine()).stop(); - store(); - adminSync.broadcast(attributes, config); - } - private void doUpdateMonitor() throws PageException { ClassDefinition cd = ClassDefinitionImpl.toClassDefinitionImpl(attributes, null, true, config.getIdentification()); @@ -4979,18 +4918,8 @@ private void doRemoveRemoteClientUsage() throws PageException { store(); } - private String getCallerId() throws IOException { - if (type == TYPE_WEB) { - return config.getIdentification().getId(); - } - if (config instanceof ConfigWeb) { - ConfigWeb cw = (ConfigWeb) config; - return cw.getIdentification().getServerIdentification().getId(); - } - if (config instanceof ConfigServer) { - return config.getIdentification().getId(); - } - throw new IOException("can not create id"); + private String getCallerId() { + return config.getIdentification().getId(); } private void doUpdateApplicationListener() throws PageException { @@ -5116,7 +5045,7 @@ private void doGetRegional() throws PageException { private void doIsMonitorEnabled() throws PageException { if (config instanceof ConfigServerImpl) { - ConfigServerImpl cs = (ConfigServerImpl) config; + ConfigServerImpl cs = ConfigUtil.getConfigServerImpl(config); pageContext.setVariable(getString("admin", action, "returnVariable"), Caster.toBoolean(cs.isMonitoringEnabled())); } } @@ -5383,14 +5312,4 @@ private Object emptyIfNull(String str) { if (str == null) return ""; return str; } - - private void throwNoAccessWhenWeb() throws ApplicationException { - if (!singleMode && type == TYPE_WEB) throw new ApplicationException("Action [" + action + "] is not available for Web Admin ( Server Admin only )"); - } - - private void throwNoAccessWhenServer() throws ApplicationException { - if (!singleMode && type == TYPE_SERVER) { - throw new ApplicationException("Action [" + action + "] is not available for Server Admin ( Web Admin only )"); - } - } } diff --git a/core/src/main/java/lucee/runtime/tag/Application.java b/core/src/main/java/lucee/runtime/tag/Application.java index 3b4ee7e7e2..da072cd7d3 100644 --- a/core/src/main/java/lucee/runtime/tag/Application.java +++ b/core/src/main/java/lucee/runtime/tag/Application.java @@ -37,7 +37,7 @@ import lucee.runtime.cache.CacheConnection; import lucee.runtime.config.Config; import lucee.runtime.config.ConfigPro; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.engine.ThreadLocalPageContext; import lucee.runtime.exp.ApplicationException; import lucee.runtime.exp.ExpressionException; @@ -424,7 +424,7 @@ public void setPsq(boolean psq) { public void setScopecascading(String scopeCascading) throws ApplicationException { if (StringUtil.isEmpty(scopeCascading)) return; short NULL = -1; - short tmp = ConfigWebUtil.toScopeCascading(scopeCascading, NULL); + short tmp = ConfigUtil.toScopeCascading(scopeCascading, NULL); if (tmp == NULL) throw new ApplicationException("invalid value (" + scopeCascading + ") for attribute [ScopeCascading], valid values are [strict,small,standard]"); this.scopeCascading = tmp; } @@ -434,7 +434,7 @@ public void setSearchQueries(boolean searchQueries) { } public void setSearchimplicitscopes(boolean searchImplicitScopes) { - short tmp = ConfigWebUtil.toScopeCascading(searchImplicitScopes); + short tmp = ConfigUtil.toScopeCascading(searchImplicitScopes); this.scopeCascading = tmp; } diff --git a/core/src/main/java/lucee/runtime/type/scope/ServerImpl.java b/core/src/main/java/lucee/runtime/type/scope/ServerImpl.java index 39a3cfb5f7..4268a343f9 100755 --- a/core/src/main/java/lucee/runtime/type/scope/ServerImpl.java +++ b/core/src/main/java/lucee/runtime/type/scope/ServerImpl.java @@ -28,8 +28,6 @@ import lucee.commons.lang.ExceptionUtil; import lucee.commons.lang.StringUtil; import lucee.runtime.PageContext; -import lucee.runtime.config.ConfigPro; -import lucee.runtime.config.ConfigWebUtil; import lucee.runtime.engine.ThreadLocalPageContext; import lucee.runtime.exp.ExpressionException; import lucee.runtime.exp.PageException; @@ -164,7 +162,7 @@ public void reload(PageContext pc, Boolean jsr223) { lucee.setEL(ENVIRONMENT, jsr223 != null && jsr223.booleanValue() ? "jsr223" : "servlet"); // singleContext admin Mode - lucee.setEL(ADMIN_MODE, ConfigWebUtil.toAdminMode(((ConfigPro) pc.getConfig()).getAdminMode(), "single") == "single"); + lucee.setEL(ADMIN_MODE, true); lucee.setReadOnly(true); super.setEL(KeyConstants._lucee, lucee); diff --git a/core/src/main/java/lucee/transformer/bytecode/expression/var/VariableImpl.java b/core/src/main/java/lucee/transformer/bytecode/expression/var/VariableImpl.java index 72a4b548d3..44f01a9a4b 100644 --- a/core/src/main/java/lucee/transformer/bytecode/expression/var/VariableImpl.java +++ b/core/src/main/java/lucee/transformer/bytecode/expression/var/VariableImpl.java @@ -276,7 +276,6 @@ else if (listener != null) { } private Type _writeOutListener(BytecodeContext bc, int mode, Boolean asCollection) throws TransformerException { - GeneratorAdapter ga = bc.getAdapter(); TagThread tt = new TagThread(bc.getFactory(), getStart(), listener.getEnd()); TagLibTag tlt = TagUtil.getTagLibTag((ConfigPro) ThreadLocalPageContext.getConfig(), "cf", "thread"); tt.outputName(); diff --git a/core/src/main/java/lucee/transformer/cfml/evaluator/impl/Import.java b/core/src/main/java/lucee/transformer/cfml/evaluator/impl/Import.java index 9ed83effd6..fd4eb6dd4c 100755 --- a/core/src/main/java/lucee/transformer/cfml/evaluator/impl/Import.java +++ b/core/src/main/java/lucee/transformer/cfml/evaluator/impl/Import.java @@ -32,7 +32,7 @@ import lucee.commons.lang.StringUtil; import lucee.runtime.PageSource; import lucee.runtime.config.Config; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.exp.TemplateException; import lucee.transformer.bytecode.statement.tag.Attribute; import lucee.transformer.bytecode.statement.tag.Tag; @@ -96,7 +96,7 @@ private TagLib executePT(Config config, Tag tag, TagLibTag libTag, FunctionLib f if (textTagLib == null) throw new TemplateException(sc, "attribute [taglib] must be a constant value"); textTagLib = textTagLib.replace('\\', '/'); - textTagLib = ConfigWebUtil.replacePlaceholder(textTagLib, config); + textTagLib = ConfigUtil.replacePlaceholder(textTagLib, config); // File TagLib String ext = ResourceUtil.getExtension(textTagLib, null); boolean hasTldExtension = "tld".equalsIgnoreCase(ext) || "tldx".equalsIgnoreCase(ext); diff --git a/core/src/main/java/lucee/transformer/cfml/tag/CFMLTransformer.java b/core/src/main/java/lucee/transformer/cfml/tag/CFMLTransformer.java index a407d4ebe1..d29716207e 100755 --- a/core/src/main/java/lucee/transformer/cfml/tag/CFMLTransformer.java +++ b/core/src/main/java/lucee/transformer/cfml/tag/CFMLTransformer.java @@ -33,7 +33,7 @@ import lucee.runtime.MappingImpl; import lucee.runtime.PageSource; import lucee.runtime.config.ConfigPro; -import lucee.runtime.config.ConfigWebUtil; +import lucee.runtime.config.ConfigUtil; import lucee.runtime.config.Constants; import lucee.runtime.config.Identification; import lucee.runtime.exp.ApplicationException; @@ -280,7 +280,7 @@ public Page transform(Factory factory, ConfigPro config, SourceCode sc, TagLib[] _tlibs[TAG_LIB_PAGE] = new TagLib[0]; } - Page page = new Page(factory, config, sc, null, ConfigWebUtil.getEngine(config).getInfo().getFullVersionInfo(), sourceLastModified, sc.getWriteLog(), + Page page = new Page(factory, config, sc, null, ConfigUtil.getEngine(config).getInfo().getFullVersionInfo(), sourceLastModified, sc.getWriteLog(), config.getSuppressWSBeforeArg(), config.getDefaultFunctionOutput(), returnValue, ignoreScope); TransfomerSettings settings = new TransfomerSettings(dnuc, config.getHandleUnQuotedAttrValueAsString(), ignoreScope); diff --git a/loader/build.xml b/loader/build.xml index 113091b928..855019411e 100644 --- a/loader/build.xml +++ b/loader/build.xml @@ -2,7 +2,7 @@ - + diff --git a/loader/pom.xml b/loader/pom.xml index 3462678a62..455ae76e99 100644 --- a/loader/pom.xml +++ b/loader/pom.xml @@ -3,7 +3,7 @@ org.lucee lucee - 6.2.0.91-SNAPSHOT + 7.0.0.0-SNAPSHOT jar Lucee Loader Build