Search in sources :

Example 1 with UIMeta

use of org.collectionspace.chain.csp.webui.external.UIMeta in project application by collectionspace.

the class WebUI method configure.

@Override
public void configure(RuleSet rules) throws CSPDependencyException {
    /* MAIN/ui/web -> UI */
    rules.addRule(SECTIONED, new String[] { "ui", "web" }, SECTION_PREFIX + "web", null, new RuleTarget() {

        @Override
        public Object populate(Object parent, ReadOnlySection section) {
            ((CoreConfig) parent).setRoot(WEBUI_ROOT, WebUI.this);
            if (section.getValue("/tmp-schema-path") != null) {
                // XXX
                uispec_path = System.getProperty("java.io.tmpdir") + "/ju-cspace";
            // fix
            } else {
                uispec_path = (String) section.getValue("/schema-path");
            }
            login_dest = (String) section.getValue("/login-dest");
            login_failed_dest = (String) section.getValue("/login-failed-dest");
            front_page = (String) section.getValue("/front-page");
            find_page = (String) section.getValue("/find-page");
            return WebUI.this;
        }
    });
    /* MAIN/ui/web/mappings ->UI */
    rules.addRule(SECTION_PREFIX + "web", new String[] { "mappings", "map" }, SECTION_PREFIX + "uimapping", null, new RuleTarget() {

        @Override
        public Object populate(Object parent, ReadOnlySection section) {
            uiMapping = new UIMapping((WebUI) parent, section);
            addMapping(uiMapping);
            return uiMapping;
        }
    });
    rules.addRule(SECTION_PREFIX + "uimapping", new String[] { "configure", "meta" }, SECTION_PREFIX + "uimetamapping", null, new RuleTarget() {

        @Override
        public Object populate(Object parent, ReadOnlySection section) {
            UIMapping map = (UIMapping) parent;
            uiMeta = new UIMeta((UIMapping) parent, section);
            map.addMetaConfig(uiMeta);
            return uiMeta;
        }
    });
}
Also used : RuleTarget(org.collectionspace.chain.csp.config.RuleTarget) UIMapping(org.collectionspace.chain.csp.webui.external.UIMapping) ReadOnlySection(org.collectionspace.chain.csp.config.ReadOnlySection) UIMeta(org.collectionspace.chain.csp.webui.external.UIMeta)

Aggregations

ReadOnlySection (org.collectionspace.chain.csp.config.ReadOnlySection)1 RuleTarget (org.collectionspace.chain.csp.config.RuleTarget)1 UIMapping (org.collectionspace.chain.csp.webui.external.UIMapping)1 UIMeta (org.collectionspace.chain.csp.webui.external.UIMeta)1