Search in sources :

Example 1 with Rule

use of org.geotoolkit.sld.xml.v100.Rule in project opencms-core by alkacon.

the class CmsWorkplaceConfiguration method addDefaultPreferencesRules.

/**
 * Adds the digester rules for the default-preferences node.<p>
 *
 * @param digester the digester object
 */
protected void addDefaultPreferencesRules(Digester digester) {
    // creation of the default user settings
    digester.addObjectCreate("*/" + N_WORKPLACE + "/" + N_DEFAULTPREFERENCES, CmsDefaultUserSettings.class);
    digester.addSetNext("*/" + N_WORKPLACE + "/" + N_DEFAULTPREFERENCES, "setDefaultUserSettings");
    // TODO: most of these settings are not user dependent, so they should not be stored in the CmsDefaultUserSettings class
    // add workplace preferences general options rules
    String xPathPrefix = "*/" + N_WORKPLACE + "/" + N_DEFAULTPREFERENCES + "/" + N_WORKPLACEPREFERENCES + "/" + N_WORKPLACEGENERALOPTIONS;
    digester.addCallMethod(xPathPrefix + "/" + N_BUTTONSTYLE, "setWorkplaceButtonStyle", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_REPORTTYPE, "setWorkplaceReportType", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_UPLOADAPPLET, "setUploadVariant", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_LISTALLPROJECTS, "setListAllProjects", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_PUBLISHNOTIFICATION, "setShowPublishNotification", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_PUBLISHBUTTONAPPEARANCE, "setPublishButtonAppearance", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_SHOWFILEUPLOADBUTTON, "setShowFileUploadButton", 0);
    // add allow broken relations rule
    digester.addCallMethod(xPathPrefix + "/" + N_ALLOWBROKENRELATIONS, "setAllowBrokenRelations", 0);
    // add publish related resources rule
    digester.addCallMethod(xPathPrefix + "/" + N_PUBLISHRELATEDRESOURCES, "setPublishRelatedResourcesMode", 0);
    // add rules for the new folder dialog settings
    digester.addCallMethod(xPathPrefix + "/" + N_NEWFOLDEREDITPROPERTIES, "setNewFolderEditProperties", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_NEWFOLDERCREATEINDEXPAGE, "setNewFolderCreateIndexPage", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_SHOWUPLOADTYPEDIALOG, "setShowUploadTypeDialog", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_SUBSITEMAP_CREATION_MODE, "setSubsitemapCreationMode", 0);
    // add workplace preferences startup settings rules
    xPathPrefix = "*/" + N_WORKPLACE + "/" + N_DEFAULTPREFERENCES + "/" + N_WORKPLACEPREFERENCES + "/" + N_WORKPLACESTARTUPSETTINGS;
    digester.addCallMethod(xPathPrefix + "/" + N_LOCALE, "setLocale", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_PROJECT, "setStartProject", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_WORKPLACEVIEW, "setStartView", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_FOLDER, "setStartFolder", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_SITE, "setStartSite", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_RESTRICTEXPLORERVIEW, "setRestrictExplorerView", 0);
    // add workplace search rules
    xPathPrefix = "*/" + N_WORKPLACE + "/" + N_DEFAULTPREFERENCES + "/" + N_WORKPLACEPREFERENCES + "/" + N_WORKPLACESEARCH;
    digester.addCallMethod(xPathPrefix + "/" + N_SEARCHINDEXNAME, "setWorkplaceSearchIndexName", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_SEARCHVIEWSTYLE, "setWorkplaceSearchViewStyle", 0);
    // add explorer preferences generaloptions rules
    xPathPrefix = "*/" + N_WORKPLACE + "/" + N_DEFAULTPREFERENCES + "/" + N_EXPLORERPREFERENCES + "/" + N_EXPLORERGENERALOPTIONS;
    digester.addCallMethod(xPathPrefix + "/" + N_BUTTONSTYLE, "setExplorerButtonStyle", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_ENTRIES, "setExplorerFileEntries", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_ENTRYOPTIONS, "setExplorerFileEntryOptions", 0);
    // add explorer display options rules
    xPathPrefix = "*/" + N_WORKPLACE + "/" + N_DEFAULTPREFERENCES + "/" + N_EXPLORERPREFERENCES + "/" + N_EXPLORERDISPLAYOPTIONS;
    digester.addCallMethod(xPathPrefix + "/" + N_TITLE, "setShowExplorerFileTitle", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_NAVTEXT, "setShowExplorerFileNavText", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_TYPE, "setShowExplorerFileType", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_DATELASTMODIFIED, "setShowExplorerFileDateLastModified", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_DATECREATED, "setShowExplorerFileDateCreated", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_LOCKEDBY, "setShowExplorerFileLockedBy", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_PERMISSIONS, "setShowExplorerFilePermissions", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_SIZE, "setShowExplorerFileSize", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_STATE, "setShowExplorerFileState", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_USERLASTMODIFIED, "setShowExplorerFileUserLastModified", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_USERCREATED, "setShowExplorerFileUserCreated", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_DATERELEASED, "setShowExplorerFileDateReleased", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_DATEEXPIRED, "setShowExplorerFileDateExpired", 0);
    // add dialog preferences rules
    xPathPrefix = "*/" + N_WORKPLACE + "/" + N_DEFAULTPREFERENCES + "/" + N_DIALOGSPREFERENCES + "/" + N_DIALOGSDEFAULTSETTINGS;
    digester.addCallMethod(xPathPrefix + "/" + N_FILECOPY, "setDialogCopyFileMode", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_FOLDERCOPY, "setDialogCopyFolderMode", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_FILEDELETION, "setDialogDeleteFileMode", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_DIRECTPUBLISH, "setDialogPublishSiblings", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_SHOWLOCK, "setShowLockDialog", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_SHOWEXPORTSETTINGS, "setShowExportSettingsDialog", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_PERMISSIONSINHERITONFOLDER, "setDialogPermissionsInheritOnFolder", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_EXPANDPERMISSIONSINHERITED, "setDialogExpandInheritedPermissions", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_EXPANDPERMISSIONSUSER, "setDialogExpandUserPermissions", 0);
    // add editor generaloptions rules
    xPathPrefix = "*/" + N_WORKPLACE + "/" + N_DEFAULTPREFERENCES + "/" + N_EDITORPREFERENCES + "/" + N_EDITORGENERALOPTIONS;
    digester.addCallMethod(xPathPrefix + "/" + N_BUTTONSTYLE, "setEditorButtonStyle", 0);
    digester.addCallMethod(xPathPrefix + "/" + N_DIRECTEDITSTYLE, "setDirectEditButtonStyle", 0);
    // add editor preferrededitor rules
    xPathPrefix = "*/" + N_WORKPLACE + "/" + N_DEFAULTPREFERENCES + "/" + N_EDITORPREFERENCES + "/" + N_EDITORPREFERREDEDITORS;
    digester.addCallMethod(xPathPrefix + "/" + N_EDITOR, "setPreferredEditor", 2);
    digester.addCallParam(xPathPrefix + "/" + N_EDITOR, 0, A_TYPE);
    digester.addCallParam(xPathPrefix + "/" + N_EDITOR, 1, A_VALUE);
    // add startgallery rules
    xPathPrefix = "*/" + N_WORKPLACE + "/" + N_DEFAULTPREFERENCES + "/" + N_GALLERIESPREFERENCES + "/" + N_STARTGALLERIES;
    digester.addCallMethod(xPathPrefix + "/" + N_STARTGALLERY, "setStartGallery", 2);
    digester.addCallParam(xPathPrefix + "/" + N_STARTGALLERY, 0, A_TYPE);
    digester.addCallParam(xPathPrefix + "/" + N_STARTGALLERY, 1, A_PATH);
    digester.addRule("*/" + N_WORKPLACE + "/" + N_DEFAULTPREFERENCES + "/preference-tab", new Rule() {

        @Override
        public void begin(String namespace, String name, Attributes attributes) throws Exception {
            getDigester().push(attributes.getValue("name"));
        }

        @Override
        public void end(String namespace, String name) throws Exception {
            getDigester().pop();
        }
    });
    String prefPath = "*/" + N_WORKPLACE + "/" + N_DEFAULTPREFERENCES + "/preference-tab/" + N_PREFERENCE;
    digester.addRule(prefPath, new CallMethodRule(1, "addPreference", 9));
    digester.addCallParam(prefPath, 0, A_NAME);
    digester.addCallParam(prefPath, 1, A_VALUE);
    digester.addCallParam(prefPath, 2, A_WIDGET);
    digester.addCallParam(prefPath, 3, A_WIDGET_CONFIG);
    digester.addCallParam(prefPath, 4, A_NICE_NAME);
    digester.addCallParam(prefPath, 5, A_DESCRIPTION);
    digester.addCallParam(prefPath, 6, A_RULE_REGEX);
    digester.addCallParam(prefPath, 7, A_ERROR);
    digester.addCallParam(prefPath, 8, 0);
}
Also used : Attributes(org.xml.sax.Attributes) CmsIconRule(org.opencms.workplace.explorer.CmsIconRule) CallMethodRule(org.apache.commons.digester3.CallMethodRule) Rule(org.apache.commons.digester3.Rule) CallMethodRule(org.apache.commons.digester3.CallMethodRule)

Example 2 with Rule

use of org.geotoolkit.sld.xml.v100.Rule in project opencms-core by alkacon.

the class CmsSitesConfiguration method addXmlDigesterRules.

/**
 * @see org.opencms.configuration.I_CmsXmlConfiguration#addXmlDigesterRules(org.apache.commons.digester3.Digester)
 */
public void addXmlDigesterRules(Digester digester) {
    // add site configuration rule
    digester.addObjectCreate("*/" + N_SITES, CmsSiteManagerImpl.class);
    digester.addCallMethod("*/" + N_SITES + "/" + N_WORKPLACE_SERVER, "addWorkplaceServer", 2);
    digester.addCallParam("*/" + N_SITES + "/" + N_WORKPLACE_SERVER, 0);
    digester.addCallParam("*/" + N_SITES + "/" + N_WORKPLACE_SERVER, 1, A_SSL);
    digester.addCallMethod("*/" + N_SITES + "/" + N_DEFAULT_URI, "setDefaultUri", 0);
    digester.addCallMethod("*/" + N_SITES + "/" + N_OLD_STYLE_SECURE_SERVER, "setOldStyleSecureServerAllowed", 0);
    String configApachePath = "*/" + N_SITES + "/" + N_WEBSERVERSCRIPTING;
    digester.addCallMethod(configApachePath, "setWebServerScripting", 6);
    digester.addCallParam(configApachePath + "/" + N_WEBSERVERSCRIPTING_WEBSERVERSCRIPT, 0);
    digester.addCallParam(configApachePath + "/" + N_WEBSERVERSCRIPTING_TARGETPATH, 1);
    digester.addCallParam(configApachePath + "/" + N_WEBSERVERSCRIPTING_CONFIGTEMPLATE, 2);
    digester.addCallParam(configApachePath + "/" + N_WEBSERVERSCRIPTING_SECURETEMPLATE, 3);
    digester.addCallParam(configApachePath + "/" + N_WEBSERVERSCRIPTING_FILENAMEPREFIX, 4);
    digester.addCallParam(configApachePath + "/" + N_WEBSERVERSCRIPTING_LOGGINGDIR, 5);
    digester.addSetNext("*/" + N_SITES, "setSiteManager");
    // add site configuration rule
    String siteXpath = "*/" + N_SITES + "/" + N_SITE;
    digester.addRule(siteXpath, new CallMethodRule("addSiteInternally", 15, new Class[] { String.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class, SortedMap.class, List.class, Optional.class }) {

        @Override
        public void begin(String namespace, String name, Attributes attributes) throws Exception {
            super.begin(namespace, name, attributes);
            getDigester().peekParams()[12] = new TreeMap();
            getDigester().peekParams()[13] = new ArrayList();
            // non-string parameters must be initialized to a non-null value, so we have to use Optional
            getDigester().peekParams()[14] = Optional.empty();
        }
    });
    digester.addCallParam(siteXpath, 0, A_SERVER);
    digester.addCallParam(siteXpath, 1, A_URI);
    digester.addCallParam(siteXpath, 2, A_TITLE);
    digester.addCallParam(siteXpath, 3, A_POSITION);
    digester.addCallParam(siteXpath, 4, A_ERROR_PAGE);
    digester.addCallParam(siteXpath, 5, A_WEBSERVER);
    digester.addCallParam(siteXpath, 6, A_SSL);
    digester.addCallParam("*/" + N_SITES + "/" + N_SITE + "/" + N_SECURE, 7, A_SERVER);
    digester.addCallParam("*/" + N_SITES + "/" + N_SITE + "/" + N_SECURE, 8, A_EXCLUSIVE);
    digester.addCallParam("*/" + N_SITES + "/" + N_SITE + "/" + N_SECURE, 9, A_ERROR);
    digester.addCallParam("*/" + N_SITES + "/" + N_SITE + "/" + N_SECURE, 10, A_USE_PERMANENT_REDIRECTS);
    digester.addCallParam(siteXpath, 11, A_SUBSITE_SELECTION);
    digester.addRule(siteXpath + "/" + N_PARAMETERS, new ObjectCreateRule(TreeMap.class) {

        @Override
        public void end(String namespace, String name) throws Exception {
            getDigester().peekParams()[12] = getDigester().peek();
            super.end(namespace, name);
        }
    });
    digester.addCallMethod(siteXpath + "/" + N_PARAMETERS + "/" + N_PARAM, "put", 2);
    digester.addCallParam(siteXpath + "/" + N_PARAMETERS + "/" + N_PARAM, 0, A_NAME);
    digester.addCallParam(siteXpath + "/" + N_PARAMETERS + "/" + N_PARAM, 1);
    digester.addRule("*/" + N_SITES + "/" + N_SITE + "/" + N_ALIAS, new Rule() {

        @Override
        public void begin(String namespace, String name, Attributes attributes) throws Exception {
            String server = attributes.getValue(A_SERVER);
            String redirect = attributes.getValue(A_REDIRECT);
            String offset = attributes.getValue(A_OFFSET);
            CmsSiteMatcher matcher = CmsSiteManagerImpl.createAliasSiteMatcher(server, redirect, offset);
            Object[] params = getDigester().peekParams();
            ((ArrayList) params[13]).add(matcher);
        }
    });
    try {
        digester.addRule("*/" + N_SITES + "/" + N_SITE + "/" + CmsAlternativeSiteRootMapping.N_ALTERNATIVE_SITE_ROOT_MAPPING, new NodeCreateRule() {

            @Override
            public void end(String namespace, String name) throws Exception {
                org.w3c.dom.Element elem = (org.w3c.dom.Element) digester.peek();
                String uri = elem.getAttribute(I_CmsXmlConfiguration.A_URI);
                String titlePrefix = elem.getAttribute(CmsAlternativeSiteRootMapping.A_TITLE_SUFFIX);
                NodeList nodes = elem.getElementsByTagName(CmsAlternativeSiteRootMapping.N_PATH);
                List<String> paths = new ArrayList<>();
                for (int i = 0; i < nodes.getLength(); i++) {
                    org.w3c.dom.Element pathElem = (org.w3c.dom.Element) nodes.item(i);
                    String path = pathElem.getTextContent().trim();
                    paths.add(path);
                }
                CmsAlternativeSiteRootMapping mapping = new CmsAlternativeSiteRootMapping(uri, paths, titlePrefix);
                getDigester().peekParams()[14] = Optional.of(mapping);
                super.end(namespace, name);
            }
        });
    } catch (ParserConfigurationException e) {
        throw new RuntimeException(e);
    }
    digester.addCallMethod("*/" + N_SITES + "/" + N_SHARED_FOLDER, "setSharedFolder", 0);
}
Also used : Optional(java.util.Optional) Element(org.dom4j.Element) NodeList(org.w3c.dom.NodeList) CmsAlternativeSiteRootMapping(org.opencms.site.CmsAlternativeSiteRootMapping) Attributes(org.xml.sax.Attributes) ArrayList(java.util.ArrayList) NodeCreateRule(org.apache.commons.digester3.NodeCreateRule) CallMethodRule(org.apache.commons.digester3.CallMethodRule) TreeMap(java.util.TreeMap) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) SortedMap(java.util.SortedMap) ArrayList(java.util.ArrayList) NodeList(org.w3c.dom.NodeList) List(java.util.List) CmsSiteMatcher(org.opencms.site.CmsSiteMatcher) ObjectCreateRule(org.apache.commons.digester3.ObjectCreateRule) CallMethodRule(org.apache.commons.digester3.CallMethodRule) Rule(org.apache.commons.digester3.Rule) NodeCreateRule(org.apache.commons.digester3.NodeCreateRule) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) ObjectCreateRule(org.apache.commons.digester3.ObjectCreateRule)

Example 3 with Rule

use of org.geotoolkit.sld.xml.v100.Rule in project opencms-core by alkacon.

the class CmsSystemConfiguration method addXmlDigesterRules.

/**
 * @see org.opencms.configuration.I_CmsXmlConfiguration#addXmlDigesterRules(org.apache.commons.digester3.Digester)
 */
public void addXmlDigesterRules(Digester digester) {
    // add finish rule
    digester.addCallMethod("*/" + N_SYSTEM, "initializeFinished");
    // add rule for internationalization
    digester.addObjectCreate("*/" + N_SYSTEM + "/" + N_I18N, CmsLocaleManager.class);
    digester.addSetNext("*/" + N_SYSTEM + "/" + N_I18N, "setLocaleManager");
    // add locale handler creation rule
    digester.addObjectCreate("*/" + N_SYSTEM + "/" + N_I18N + "/" + N_LOCALEHANDLER, CmsConfigurationException.class.getName(), A_CLASS);
    digester.addSetNext("*/" + N_SYSTEM + "/" + N_I18N + "/" + N_LOCALEHANDLER, "setLocaleHandler");
    // add locale rules
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_I18N + "/" + N_LOCALESCONFIGURED + "/" + N_LOCALE, "addAvailableLocale", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_I18N + "/" + N_LOCALESDEFAULT + "/" + N_LOCALE, "addDefaultLocale", 0);
    // add time zone rule
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_I18N + "/" + N_TIMEZONE, "setTimeZone", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_I18N + "/" + N_REUSE_ELEMENTS, "setReuseElements", 0);
    // add version history rules
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_VERSIONHISTORY, "setHistorySettings", 3);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_VERSIONHISTORY, 0, A_ENABLED);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_VERSIONHISTORY, 1, A_COUNT);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_VERSIONHISTORY, 2, A_DELETED);
    // add mail configuration rule
    digester.addObjectCreate("*/" + N_SYSTEM + "/" + N_MAIL, CmsMailSettings.class);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_MAIL + "/" + N_MAILFROM, "setMailFromDefault", 0);
    digester.addSetNext("*/" + N_SYSTEM + "/" + N_MAIL, "setMailSettings");
    // add mail host configuration rule
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_MAIL + "/" + N_MAILHOST, "addMailHost", 7);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_MAIL + "/" + N_MAILHOST, 0, A_NAME);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_MAIL + "/" + N_MAILHOST, 1, A_PORT);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_MAIL + "/" + N_MAILHOST, 2, A_ORDER);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_MAIL + "/" + N_MAILHOST, 3, A_PROTOCOL);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_MAIL + "/" + N_MAILHOST, 4, A_SECURITY);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_MAIL + "/" + N_MAILHOST, 5, A_USER);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_MAIL + "/" + N_MAILHOST, 6, A_PASSWORD);
    // add event classes
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_EVENTS + "/" + N_EVENTMANAGER, "addEventManager", 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_EVENTS + "/" + N_EVENTMANAGER, 0, A_CLASS);
    // use array so we can modify it in the inner class and give each resource init handler a fresh CmsParameterConfiguration instance
    CmsParameterConfiguration[] resourceHandlerParams = new CmsParameterConfiguration[] { null };
    digester.addRule("*/" + N_SYSTEM + "/" + N_RESOURCEINIT + "/" + N_RESOURCEINITHANDLER, new Rule() {

        private String m_class;

        @Override
        public void begin(String namespace, String name, Attributes attributes) throws Exception {
            m_class = attributes.getValue(A_CLASS);
            resourceHandlerParams[0] = new CmsParameterConfiguration();
        }

        @Override
        public void end(String namespace, String name) throws Exception {
            addResourceInitHandler(m_class, resourceHandlerParams[0]);
        }
    });
    digester.addRule("*/" + N_SYSTEM + "/" + N_RESOURCEINIT + "/" + N_RESOURCEINITHANDLER + "/" + N_PARAM, new Rule() {

        private String m_name;

        private String m_value;

        @Override
        public void begin(String namespace, String name, Attributes attributes) throws Exception {
            m_name = attributes.getValue(A_NAME);
            m_value = null;
        }

        @Override
        public void body(String namespace, String name, String text) throws Exception {
            m_value = text;
        }

        @Override
        public void end(String namespace, String name) throws Exception {
            resourceHandlerParams[0].add(m_name, m_value);
        }
    });
    CmsParameterConfiguration[] requestHandlerParams = new CmsParameterConfiguration[] { null };
    digester.addRule("*/" + N_SYSTEM + "/" + N_REQUESTHANDLERS + "/" + N_REQUESTHANDLER + "/" + N_PARAM, new Rule() {

        private String m_name;

        private String m_value;

        @Override
        public void begin(String namespace, String name, Attributes attributes) throws Exception {
            m_name = attributes.getValue(A_NAME);
            m_value = null;
        }

        @Override
        public void body(String namespace, String name, String text) throws Exception {
            m_value = text;
        }

        @Override
        public void end(String namespace, String name) throws Exception {
            requestHandlerParams[0].add(m_name, m_value);
        }
    });
    digester.addRule("*/" + N_SYSTEM + "/" + N_REQUESTHANDLERS + "/" + N_REQUESTHANDLER, new Rule() {

        private String m_class;

        @Override
        public void begin(String namespace, String name, Attributes attributes) throws Exception {
            m_class = attributes.getValue(A_CLASS);
            requestHandlerParams[0] = new CmsParameterConfiguration();
        }

        @Override
        public void end(String namespace, String name) throws Exception {
            addRequestHandler(m_class, requestHandlerParams[0]);
        }
    });
    // add password handler creation rule
    digester.addObjectCreate("*/" + N_SYSTEM + "/" + N_PASSWORDHANDLER, CmsConfigurationException.class.getName(), A_CLASS);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_PASSWORDHANDLER, I_CmsConfigurationParameterHandler.INIT_CONFIGURATION_METHOD);
    digester.addBeanPropertySetter("*/" + N_SYSTEM + "/" + N_PASSWORDHANDLER + "/" + N_PASSWORDENCODING, "inputEncoding");
    digester.addBeanPropertySetter("*/" + N_SYSTEM + "/" + N_PASSWORDHANDLER + "/" + N_DIGESTTYPE, "digestType");
    digester.addSetNext("*/" + N_SYSTEM + "/" + N_PASSWORDHANDLER, "setPasswordHandler");
    // add generic parameter rules for password handler
    digester.addCallMethod("*/" + I_CmsXmlConfiguration.N_PARAM, I_CmsConfigurationParameterHandler.ADD_PARAMETER_METHOD, 2);
    digester.addCallParam("*/" + I_CmsXmlConfiguration.N_PARAM, 0, I_CmsXmlConfiguration.A_NAME);
    digester.addCallParam("*/" + I_CmsXmlConfiguration.N_PARAM, 1);
    // add validation handler creation rules
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_VALIDATIONHANDLER, "setValidationHandler", 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_VALIDATIONHANDLER, 0, A_CLASS);
    // add login manager creation rules
    digester.addCallMethod("*/" + N_LOGINMANAGER, "setLoginManager", 9);
    digester.addCallParam("*/" + N_LOGINMANAGER + "/" + N_DISABLEMINUTES, 0);
    digester.addCallParam("*/" + N_LOGINMANAGER + "/" + N_MAXBADATTEMPTS, 1);
    digester.addCallParam("*/" + N_LOGINMANAGER + "/" + N_ENABLESCURITY, 2);
    digester.addCallParam("*/" + N_LOGINMANAGER + "/" + N_TOKEN_LIFETIME, 3);
    digester.addCallParam("*/" + N_LOGINMANAGER + "/" + N_MAX_INACTIVE_TIME, 4);
    digester.addCallParam("*/" + N_LOGINMANAGER + "/" + N_PASSWORD_CHANGE_INTERVAL, 5);
    digester.addCallParam("*/" + N_LOGINMANAGER + "/" + N_USER_DATA_CHECK_INTERVAL, 6);
    digester.addCallParam("*/" + N_LOGINMANAGER + "/" + N_REQUIRE_ORGUNIT, 7);
    digester.addCallParam("*/" + N_LOGINMANAGER + "/" + N_LOGOUT_URI, 8);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_SAX_IMPL_SYSTEM_PROPERTIES, "setUseSaxImplSystemProperties", 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_SAX_IMPL_SYSTEM_PROPERTIES, 0);
    // add compatibility parameter rules
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RUNTIMEPROPERTIES + "/" + N_PARAM, I_CmsConfigurationParameterHandler.ADD_PARAMETER_METHOD, 2);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_RUNTIMEPROPERTIES + "/" + N_PARAM, 0, I_CmsXmlConfiguration.A_NAME);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_RUNTIMEPROPERTIES + "/" + N_PARAM, 1);
    // add runtime classes configuration rules
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RUNTIMECLASSES + "/" + N_RUNTIMEINFO, "setRuntimeInfoFactory", 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_RUNTIMECLASSES + "/" + N_RUNTIMEINFO, 0, A_CLASS);
    // add default users rule
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_DEFAULTUSERS, "setCmsDefaultUsers", 7);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_DEFAULTUSERS + "/" + N_USER_ADMIN, 0);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_DEFAULTUSERS + "/" + N_USER_GUEST, 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_DEFAULTUSERS + "/" + N_USER_EXPORT, 2);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_DEFAULTUSERS + "/" + N_USER_DELETEDRESOURCE, 3);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_DEFAULTUSERS + "/" + N_GROUP_ADMINISTRATORS, 4);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_DEFAULTUSERS + "/" + N_GROUP_USERS, 5);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_DEFAULTUSERS + "/" + N_GROUP_GUESTS, 6);
    // add defaultContentEncoding rule
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_DEFAULT_CONTENT_ENCODING, "setDefaultContentEncoding", 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_DEFAULT_CONTENT_ENCODING, 0);
    // add memorymonitor configuration rule
    digester.addObjectCreate("*/" + N_SYSTEM + "/" + N_MEMORYMONITOR, CmsMemoryMonitorConfiguration.class);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_MEMORYMONITOR, "initialize", 5);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_MEMORYMONITOR, 0, A_CLASS);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_MEMORYMONITOR + "/" + N_MAXUSAGE_PERCENT, 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_MEMORYMONITOR + "/" + N_LOG_INTERVAL, 2);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_MEMORYMONITOR + "/" + N_EMAIL_INTERVAL, 3);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_MEMORYMONITOR + "/" + N_WARNING_INTERVAL, 4);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_MEMORYMONITOR + "/" + N_EMAIL_SENDER, "setEmailSender", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_MEMORYMONITOR + "/" + N_EMAIL_RECEIVER + "/" + N_RECEIVER, "addEmailReceiver", 0);
    // set the MemoryMonitorConfiguration initialized once before
    digester.addSetNext("*/" + N_SYSTEM + "/" + N_MEMORYMONITOR, "setCmsMemoryMonitorConfiguration");
    // add flexcache configuration rule
    digester.addObjectCreate("*/" + N_SYSTEM + "/" + N_FLEXCACHE, CmsFlexCacheConfiguration.class);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_FLEXCACHE, "initialize", 6);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_FLEXCACHE + "/" + N_CACHE_ENABLED, 0);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_FLEXCACHE + "/" + N_CACHE_OFFLINE, 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_FLEXCACHE + "/" + N_MAXCACHEBYTES, 2);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_FLEXCACHE + "/" + N_AVGCACHEBYTES, 3);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_FLEXCACHE + "/" + N_MAXENTRYBYTES, 4);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_FLEXCACHE + "/" + N_MAXKEYS, 5);
    // add flexcache device selector
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_FLEXCACHE + "/" + N_DEVICESELECTOR, "setDeviceSelectorConfiguration", 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_FLEXCACHE + "/" + N_DEVICESELECTOR, 0, A_CLASS);
    // set the FlexCacheConfiguration initialized once before
    digester.addSetNext("*/" + N_SYSTEM + "/" + N_FLEXCACHE, "setCmsFlexCacheConfiguration");
    // add http basic authentication rules
    digester.addObjectCreate("*/" + N_SYSTEM + "/" + N_HTTP_AUTHENTICATION, CmsHttpAuthenticationSettings.class);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_HTTP_AUTHENTICATION + "/" + N_BROWSER_BASED, "setUseBrowserBasedHttpAuthentication", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_HTTP_AUTHENTICATION + "/" + N_FORM_BASED, "setFormBasedHttpAuthenticationUri", 0);
    digester.addSetNext("*/" + N_SYSTEM + "/" + N_HTTP_AUTHENTICATION, "setHttpAuthenticationSettings");
    // cache rules
    digester.addObjectCreate("*/" + N_SYSTEM + "/" + N_RESULTCACHE, CmsCacheSettings.class);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RESULTCACHE + "/" + N_KEYGENERATOR, "setCacheKeyGenerator", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RESULTCACHE + "/" + N_SIZE_USERS, "setUserCacheSize", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RESULTCACHE + "/" + N_SIZE_GROUPS, "setGroupCacheSize", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RESULTCACHE + "/" + N_SIZE_ORGUNITS, "setOrgUnitCacheSize", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RESULTCACHE + "/" + N_SIZE_USERGROUPS, "setUserGroupsCacheSize", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RESULTCACHE + "/" + N_SIZE_PROJECTS, "setProjectCacheSize", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RESULTCACHE + "/" + N_SIZE_PROJECTRESOURCES, "setProjectResourcesCacheSize", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RESULTCACHE + "/" + N_SIZE_RESOURCES, "setResourceCacheSize", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RESULTCACHE + "/" + N_SIZE_ROLES, "setRolesCacheSize", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RESULTCACHE + "/" + N_SIZE_RESOURCELISTS, "setResourcelistCacheSize", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RESULTCACHE + "/" + N_SIZE_PROPERTIES, "setPropertyCacheSize", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RESULTCACHE + "/" + N_SIZE_PROPERTYLISTS, "setPropertyListsCacheSize", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RESULTCACHE + "/" + N_SIZE_ACLS, "setAclCacheSize", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RESULTCACHE + "/" + N_SIZE_PERMISSIONS, "setPermissionCacheSize", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RESULTCACHE + "/" + N_SIZE_CONTAINERPAGE_OFFLINE, "setContainerPageOfflineSize", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RESULTCACHE + "/" + N_SIZE_CONTAINERPAGE_ONLINE, "setContainerPageOnlineSize", 0);
    digester.addSetNext("*/" + N_SYSTEM + "/" + N_RESULTCACHE, "setCacheSettings");
    // set the notification time
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_CONTENT_NOTIFICATION + "/" + N_NOTIFICATION_TIME, "setNotificationTime", 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_CONTENT_NOTIFICATION + "/" + N_NOTIFICATION_TIME, 0);
    // set the notification project
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_CONTENT_NOTIFICATION + "/" + N_NOTIFICATION_PROJECT, "setNotificationProject", 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_CONTENT_NOTIFICATION + "/" + N_NOTIFICATION_PROJECT, 0);
    // add authorization handler creation rules
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_AUTHORIZATIONHANDLER, "setAuthorizationHandler", 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_AUTHORIZATIONHANDLER, 0, A_CLASS);
    String apiAuthPath = "*/system/" + N_API_AUTHORIZATIONS + "/" + N_API_AUTHORIZATION;
    digester.addRule(apiAuthPath, new Rule() {

        @Override
        public void begin(String namespace, String name, Attributes attributes) throws Exception {
            digester.push(new ApiAuthorizationConfig());
        }

        @Override
        public void end(String namespace, String name) throws Exception {
            ApiAuthorizationConfig config = (ApiAuthorizationConfig) digester.pop();
            addApiAuthorization(config);
        }
    });
    String namePath = apiAuthPath + "/name";
    digester.addCallMethod(namePath, "setName", 1);
    digester.addCallParam(namePath, 0);
    String classNamePath = apiAuthPath + "/class";
    digester.addCallMethod(classNamePath, "setClassName", 1);
    digester.addCallParam(classNamePath, 0);
    String paramPath = apiAuthPath + "/param";
    digester.addCallMethod(paramPath, "setParam", 2);
    digester.addCallParam(paramPath, 0, "name");
    digester.addCallParam(paramPath, 1);
    // add publish manager configuration rule
    digester.addObjectCreate("*/" + N_SYSTEM + "/" + N_PUBLISHMANAGER, CmsPublishManager.class);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_PUBLISHMANAGER + "/" + N_HISTORYSIZE, "setPublishHistorySize", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_PUBLISHMANAGER + "/" + N_QUEUEPERSISTANCE, "setPublishQueuePersistance", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_PUBLISHMANAGER + "/" + N_QUEUESHUTDOWNTIME, "setPublishQueueShutdowntime", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_PUBLISHMANAGER + "/" + N_AUTO_CLEANUP_HISTORY_ENTRIES, "setAutoCleanupHistoryEntries", 0);
    digester.addSetNext("*/" + N_SYSTEM + "/" + N_PUBLISHMANAGER, "setPublishManager");
    // add rule for session storage provider
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_SESSION_STORAGEPROVIDER, "setSessionStorageProvider", 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_SESSION_STORAGEPROVIDER, 0, A_CLASS);
    // add rule for permission handler
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_PERMISSIONHANDLER, "setPermissionHandler", 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_PERMISSIONHANDLER, 0, A_CLASS);
    // add rules for servlet container settings
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_SERVLETCONTAINERSETTINGS + "/" + N_PREVENTRESPONSEFLUSH, "setPreventResponseFlush", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_SERVLETCONTAINERSETTINGS + "/" + N_RELEASETAGSAFTEREND, "setReleaseTagsAfterEnd", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_SERVLETCONTAINERSETTINGS + "/" + N_REQUESTERRORPAGEATTRIBUTE, "setRequestErrorPageAttribute", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_SERVLETCONTAINERSETTINGS, "setServletContainerSettingsMode", 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_SERVLETCONTAINERSETTINGS, 0, A_MODE);
    // add rule for ADE cache settings
    String adeCachePath = "*/" + N_SYSTEM + "/" + N_ADE + "/" + N_ADE_CACHE;
    digester.addObjectCreate(adeCachePath, CmsADECacheSettings.class);
    // container page cache
    digester.addCallMethod(adeCachePath + "/" + N_CONTAINERPAGES, "setContainerPageOfflineSize", 1);
    digester.addCallParam(adeCachePath + "/" + N_CONTAINERPAGES, 0, A_OFFLINE);
    digester.addCallMethod(adeCachePath + "/" + N_CONTAINERPAGES, "setContainerPageOnlineSize", 1);
    digester.addCallParam(adeCachePath + "/" + N_CONTAINERPAGES, 0, A_ONLINE);
    // groupcontainer cache
    digester.addCallMethod(adeCachePath + "/" + N_GROUPCONTAINERS, "setGroupContainerOfflineSize", 1);
    digester.addCallParam(adeCachePath + "/" + N_GROUPCONTAINERS, 0, A_OFFLINE);
    digester.addCallMethod(adeCachePath + "/" + N_GROUPCONTAINERS, "setGroupContainerOnlineSize", 1);
    digester.addCallParam(adeCachePath + "/" + N_GROUPCONTAINERS, 0, A_ONLINE);
    // set the settings
    digester.addSetNext(adeCachePath, "setAdeCacheSettings");
    String adeParamPath = "*/" + N_SYSTEM + "/" + N_ADE + "/" + N_PARAMETERS + "/" + N_PARAM;
    digester.addCallMethod(adeParamPath, "addAdeParameter", 2);
    digester.addCallParam(adeParamPath, 0, I_CmsXmlConfiguration.A_NAME);
    digester.addCallParam(adeParamPath, 1);
    // add rule for subscription manager settings
    digester.addObjectCreate("*/" + N_SYSTEM + "/" + N_SUBSCRIPTIONMANAGER, CmsSubscriptionManager.class);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_SUBSCRIPTIONMANAGER, "setEnabled", 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_SUBSCRIPTIONMANAGER, 0, A_ENABLED);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_SUBSCRIPTIONMANAGER, "setPoolName", 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_SUBSCRIPTIONMANAGER, 0, A_POOLNAME);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_SUBSCRIPTIONMANAGER, "setMaxVisitedCount", 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_SUBSCRIPTIONMANAGER, 0, A_MAXVISITED);
    digester.addSetNext("*/" + N_SYSTEM + "/" + N_SUBSCRIPTIONMANAGER, "setSubscriptionManager");
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_PUBLISH_LIST_REMOVE_MODE, "setPublishListRemoveMode", 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_PUBLISH_LIST_REMOVE_MODE, 0, A_MODE);
    String workflowXpath = "*/" + N_SYSTEM + "/" + N_WORKFLOW;
    digester.addObjectCreate(workflowXpath, CmsDefaultWorkflowManager.class.getName(), A_CLASS);
    digester.addObjectCreate(workflowXpath + "/" + N_PARAMETERS, LinkedHashMap.class);
    digester.addCallMethod(workflowXpath + "/" + N_PARAMETERS + "/" + N_PARAM, "put", 2);
    digester.addCallParam(workflowXpath + "/" + N_PARAMETERS + "/" + N_PARAM, 0, A_NAME);
    digester.addCallParam(workflowXpath + "/" + N_PARAMETERS + "/" + N_PARAM, 1);
    digester.addSetNext(workflowXpath + "/" + N_PARAMETERS, "setParameters");
    digester.addSetNext(workflowXpath, "setWorkflowManager");
    CmsLetsEncryptConfiguration.CONFIG_HELPER.addRules(digester);
    digester.addSetNext(CmsLetsEncryptConfiguration.CONFIG_HELPER.getBasePath(), "setLetsEncryptConfig");
    digester.addRule("*/" + N_SYSTEM + "/" + N_ENCRYPTION + "/" + N_TEXT_ENCRYPTION, new Rule() {

        @Override
        public void begin(String namespace, String name, Attributes attributes) throws Exception {
            String className = attributes.getValue(A_CLASS);
            String instanceName = attributes.getValue(A_NAME);
            I_CmsTextEncryption encrypter = (I_CmsTextEncryption) Class.forName(className).newInstance();
            encrypter.setName(instanceName);
            digester.push(encrypter);
        }

        @Override
        public void end(String namespace, String name) throws Exception {
            I_CmsTextEncryption encrypter = (I_CmsTextEncryption) digester.pop();
            m_textEncryptions.put(encrypter.getName(), encrypter);
        }
    });
    // make sure that a 'default' text encryption exists, but attach the rule to the system element
    // because the <encryption> element doesn't necessarily exist,
    digester.addRule("*/" + N_SYSTEM, new Rule() {

        public void end(String namespace, String name) throws Exception {
            if (m_textEncryptions.get("default") == null) {
                CmsAESTextEncryption defaultEncryption = new CmsAESTextEncryption();
                defaultEncryption.setName("default");
                defaultEncryption.addConfigurationParameter(CmsAESTextEncryption.PARAM_SECRET, RandomStringUtils.randomAlphanumeric(24));
                m_textEncryptions.put("default", defaultEncryption);
            }
        }
    });
    String userSessionPath = "*/" + N_SYSTEM + "/" + N_USER_SESSION_MODE;
    digester.addCallMethod(userSessionPath, "setUserSessionMode", 0);
    String credentialsResolverPath = "*/" + N_SYSTEM + "/" + N_CREDENTIALS_RESOLVER;
    digester.addCallMethod(credentialsResolverPath, "setCredentialsResolver", 0);
    digester.addCallMethod("*/" + N_SYSTEM + "/" + N_RESTRICT_DETAIL_CONTENTS, "setRestrictDetailContents", 1);
    digester.addCallParam("*/" + N_SYSTEM + "/" + N_RESTRICT_DETAIL_CONTENTS, 0);
    String shellServerPath = "*/" + N_SYSTEM + "/" + N_SHELL_SERVER;
    digester.addCallMethod(shellServerPath, "setShellServerOptions", 2);
    digester.addCallParam(shellServerPath, 0, A_ENABLED);
    digester.addCallParam(shellServerPath, 1, A_PORT);
    String detailPageHandlerPath = "*/" + N_SYSTEM + "/" + N_DETAIL_PAGE_HANDLER;
    digester.addObjectCreate(detailPageHandlerPath, CmsDefaultDetailPageHandler.class.getName(), A_CLASS);
    digester.addSetNext(detailPageHandlerPath, "setDetailPageHandler");
    String userdataPath = "*/" + N_SYSTEM + "/" + CmsUserDataRequestManager.N_USERDATA;
    CmsUserDataRequestManager.addDigesterRules(digester, userdataPath);
    digester.addSetNext(userdataPath, "setUserDataRequestManager");
}
Also used : CmsDefaultWorkflowManager(org.opencms.workflow.CmsDefaultWorkflowManager) I_CmsTextEncryption(org.opencms.crypto.I_CmsTextEncryption) Attributes(org.xml.sax.Attributes) CmsDefaultDetailPageHandler(org.opencms.ade.detailpage.CmsDefaultDetailPageHandler) CmsAESTextEncryption(org.opencms.crypto.CmsAESTextEncryption) Rule(org.apache.commons.digester3.Rule)

Example 4 with Rule

use of org.geotoolkit.sld.xml.v100.Rule in project opencms-core by alkacon.

the class CmsImportVersion10 method addXmlDigesterRules.

/**
 * Adds the XML digester rules for a single import file.<p>
 *
 * @param digester the digester to add the rules to
 */
public void addXmlDigesterRules(Digester digester) {
    // first accounts
    String xpath = CmsImportExportManager.N_EXPORT + "/" + N_ACCOUNTS + "/" + N_ORGUNITS + "/" + N_ORGUNIT + "/";
    addAccountsOrgunitRules(digester, xpath);
    addAccountsGroupRules(digester, xpath);
    addAccountsUserRules(digester, xpath);
    digester.addCallMethod(CmsImportExportManager.N_EXPORT + "/" + N_ACCOUNTS + "/" + N_ORGUNITS + "/" + N_ORGUNIT, "setMembership");
    // then resources
    // When encountering opening files tag, initialize some fields which keep track of multiple resources'  data
    digester.addRule(CmsImportExportManager.N_EXPORT + "/" + N_FILES, new Rule() {

        @SuppressWarnings("synthetic-access")
        @Override
        public void begin(String namespace, String name, Attributes attributes) throws Exception {
            m_indexToStructureId = new HashMap<>();
            m_relationData = ArrayListMultimap.create();
        }
    });
    digester.addRule(CmsImportExportManager.N_EXPORT + "/" + N_FILES + "/" + N_FILE, new Rule() {

        @Override
        public void begin(String namespace, String name, Attributes attributes) throws Exception {
            m_importACEs = true;
            m_resourceBuilder = new CmsResourceBuilder();
            m_resourceBuilder.setDateLastModified(DATE_LAST_MODIFICATION_UNSPECIFIED);
            m_resourceBuilder.setDateReleased(CmsResource.DATE_RELEASED_DEFAULT);
            m_resourceBuilder.setDateExpired(CmsResource.DATE_EXPIRED_DEFAULT);
            m_resourceBuilder.setDateCreated(DATE_CREATED_UNSPECIFIED);
            m_resourceBuilder.setUserCreated(CmsUUID.getNullUUID());
            m_relationsForResource = new ArrayList<>();
            m_hasStructureId = false;
            m_hasDateLastModified = false;
        }
    });
    xpath = CmsImportExportManager.N_EXPORT + "/" + N_FILES + "/" + N_FILE + "/";
    addResourceAttributesRules(digester, xpath);
    digester.addCallMethod(xpath, "importResourceAll");
    addResourcePropertyRules(digester, xpath);
    addResourceRelationRules(digester, xpath);
    addResourceAceRules(digester, xpath);
    digester.addCallMethod(CmsImportExportManager.N_EXPORT + "/" + N_FILES, "importRelations");
    digester.addCallMethod(CmsImportExportManager.N_EXPORT + "/" + N_FILES, "rewriteParseables");
    // and now the organizational unit resources
    digester.addCallMethod(CmsImportExportManager.N_EXPORT + "/" + N_FILES, "associateOrgUnitResources");
    // then projects
    xpath = CmsImportExportManager.N_EXPORT + "/" + N_PROJECTS + "/" + N_PROJECT + "/";
    addProjectRules(digester, xpath);
}
Also used : CmsResourceBuilder(org.opencms.file.CmsResourceBuilder) HashMap(java.util.HashMap) Attributes(org.xml.sax.Attributes) ArrayList(java.util.ArrayList) Rule(org.apache.commons.digester3.Rule) CmsIllegalStateException(org.opencms.main.CmsIllegalStateException) CmsDbEntryNotFoundException(org.opencms.db.CmsDbEntryNotFoundException) ParseException(java.text.ParseException) CmsDataAccessException(org.opencms.file.CmsDataAccessException) CmsException(org.opencms.main.CmsException) CmsVfsResourceNotFoundException(org.opencms.file.CmsVfsResourceNotFoundException) SAXException(org.xml.sax.SAXException) CmsLoaderException(org.opencms.loader.CmsLoaderException) IOException(java.io.IOException)

Example 5 with Rule

use of org.geotoolkit.sld.xml.v100.Rule in project opencms-core by alkacon.

the class CmsModuleXmlHandler method addXmlDigesterRules.

/**
 * Adds the XML digester rules for a single module.<p>
 *
 * @param digester the digester to add the rules to
 */
public static void addXmlDigesterRules(Digester digester) {
    // add class generation rule
    digester.addObjectCreate("*/" + N_MODULE, CmsModuleXmlHandler.class);
    digester.addSetNext("*/" + N_MODULE, "setModule");
    // add rules for base module information
    // NOTE: If you change the order of parameters here or add new ones, you may
    // also need to change the corresponding parameter indexes in the method addXmlDigesterRulesForVersion5Modules.
    digester.addCallMethod("*/" + N_MODULE, "createdModule", 15);
    digester.addCallParam("*/" + N_MODULE + "/" + N_NAME, 0);
    digester.addCallParam("*/" + N_MODULE + "/" + N_NICENAME, 1);
    digester.addCallParam("*/" + N_MODULE + "/" + N_GROUP, 2);
    digester.addCallParam("*/" + N_MODULE + "/" + N_CLASS, 3);
    digester.addCallParam("*/" + N_MODULE + "/" + N_IMPORT_SCRIPT, 4);
    digester.addCallParam("*/" + N_MODULE + "/" + N_IMPORT_SITE, 5);
    digester.addCallParam("*/" + N_MODULE + "/" + N_SITE, 6);
    digester.addCallParam("*/" + N_MODULE + "/" + N_EXPORT_MODE, 7, I_CmsXmlConfiguration.A_NAME);
    digester.addCallParam("*/" + N_MODULE + "/" + N_DESCRIPTION, 8);
    digester.addCallParam("*/" + N_MODULE + "/" + N_VERSION, 9);
    digester.addCallParam("*/" + N_MODULE + "/" + N_AUTHORNAME, 10);
    digester.addCallParam("*/" + N_MODULE + "/" + N_AUTHOREMAIL, 11);
    digester.addCallParam("*/" + N_MODULE + "/" + N_DATECREATED, 12);
    digester.addCallParam("*/" + N_MODULE + "/" + N_USERINSTALLED, 13);
    digester.addCallParam("*/" + N_MODULE + "/" + N_DATEINSTALLED, 14);
    digester.addRule("*/" + N_MODULE + "/" + N_AUTOINCREMENT, new Rule() {

        @Override
        public void body(String namespace, String name, String text) throws Exception {
            CmsModuleXmlHandler handler = (CmsModuleXmlHandler) (getDigester().peek());
            handler.setAutoIncrement(Boolean.parseBoolean(text.trim()));
        }
    });
    digester.addRule("*/" + N_MODULE + "/" + N_CHECKPOINT_TIME, new Rule() {

        @Override
        public void body(String namespace, String name, String text) throws Exception {
            CmsModuleXmlHandler handler = (CmsModuleXmlHandler) (getDigester().peek());
            handler.setCheckpointTime(Long.parseLong(text.trim()));
        }
    });
    // add rules for module dependencies
    digester.addCallMethod("*/" + N_MODULE + "/" + N_DEPENDENCIES + "/" + N_DEPENDENCY, "addDependency", 2);
    digester.addCallParam("*/" + N_MODULE + "/" + N_DEPENDENCIES + "/" + N_DEPENDENCY, 0, I_CmsXmlConfiguration.A_NAME);
    digester.addCallParam("*/" + N_MODULE + "/" + N_DEPENDENCIES + "/" + N_DEPENDENCY, 1, A_VERSION);
    // add rules for the module export points
    digester.addCallMethod("*/" + N_MODULE + "/" + I_CmsXmlConfiguration.N_EXPORTPOINTS + "/" + I_CmsXmlConfiguration.N_EXPORTPOINT, "addExportPoint", 2);
    digester.addCallParam("*/" + N_MODULE + "/" + I_CmsXmlConfiguration.N_EXPORTPOINTS + "/" + I_CmsXmlConfiguration.N_EXPORTPOINT, 0, I_CmsXmlConfiguration.A_URI);
    digester.addCallParam("*/" + N_MODULE + "/" + I_CmsXmlConfiguration.N_EXPORTPOINTS + "/" + I_CmsXmlConfiguration.N_EXPORTPOINT, 1, I_CmsXmlConfiguration.A_DESTINATION);
    // add rules for the module resources
    digester.addCallMethod("*/" + N_MODULE + "/" + N_RESOURCES + "/" + I_CmsXmlConfiguration.N_RESOURCE, "addResource", 1);
    digester.addCallParam("*/" + N_MODULE + "/" + N_RESOURCES + "/" + I_CmsXmlConfiguration.N_RESOURCE, 0, I_CmsXmlConfiguration.A_URI);
    // add rules for the module exclude resources
    digester.addCallMethod("*/" + N_MODULE + "/" + N_EXCLUDERESOURCES + "/" + I_CmsXmlConfiguration.N_RESOURCE, "addExcludeResource", 1);
    digester.addCallParam("*/" + N_MODULE + "/" + N_EXCLUDERESOURCES + "/" + I_CmsXmlConfiguration.N_RESOURCE, 0, I_CmsXmlConfiguration.A_URI);
    // add rules for the module parameters
    digester.addCallMethod("*/" + N_MODULE + "/" + N_PARAMETERS + "/" + I_CmsXmlConfiguration.N_PARAM, "addParameter", 2);
    digester.addCallParam("*/" + N_MODULE + "/" + N_PARAMETERS + "/" + I_CmsXmlConfiguration.N_PARAM, 0, I_CmsXmlConfiguration.A_NAME);
    digester.addCallParam("*/" + N_MODULE + "/" + N_PARAMETERS + "/" + I_CmsXmlConfiguration.N_PARAM, 1);
    // generic <param> parameter rules
    digester.addCallMethod("*/" + I_CmsXmlConfiguration.N_PARAM, I_CmsConfigurationParameterHandler.ADD_PARAMETER_METHOD, 2);
    digester.addCallParam("*/" + I_CmsXmlConfiguration.N_PARAM, 0, I_CmsXmlConfiguration.A_NAME);
    digester.addCallParam("*/" + I_CmsXmlConfiguration.N_PARAM, 1);
    // add resource type rules from VFS
    CmsVfsConfiguration.addResourceTypeXmlRules(digester);
    // add explorer type rules from workplace
    CmsWorkplaceConfiguration.addExplorerTypeXmlRules(digester);
    // finally add all rules for backward compatibility with OpenCms 5.0
    addXmlDigesterRulesForVersion5Modules(digester);
}
Also used : Rule(org.apache.commons.digester3.Rule) ParseException(java.text.ParseException)

Aggregations

Rule (org.apache.commons.digester3.Rule)9 Attributes (org.xml.sax.Attributes)5 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 CallMethodRule (org.apache.commons.digester3.CallMethodRule)3 CmsException (org.opencms.main.CmsException)3 SAXException (org.xml.sax.SAXException)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 FileInputStream (java.io.FileInputStream)2 InputStream (java.io.InputStream)2 ParseException (java.text.ParseException)2 List (java.util.List)2 Digester (org.apache.commons.digester3.Digester)2 CmsConfigurationException (org.opencms.configuration.CmsConfigurationException)2 CmsMessageContainer (org.opencms.i18n.CmsMessageContainer)2 CmsImportExportException (org.opencms.importexport.CmsImportExportException)2 CmsRoleViolationException (org.opencms.security.CmsRoleViolationException)2 CmsSecurityException (org.opencms.security.CmsSecurityException)2 File (java.io.File)1 HashMap (java.util.HashMap)1