Package de.innovationgate.wga.common.beans.csconfig.v1

Examples of de.innovationgate.wga.common.beans.csconfig.v1.MediaKey


   
        bind(form, SWTBinder.BINDING_STRATEGY_AS_YOU_TYPE);
  }

  private void handleAddACLRole() {
    ACLRole role = new ACLRole();
    role.setName("<role name>");
    role.setDefaultManagerRole(false);
    _aclRolesModel.add(role);
  }
View Full Code Here


            acl.createUserEntry("*", csConfig.getDefaultAccessLevel());
        }
       
        Iterator roles = csConfig.getRoles().iterator();
        while (roles.hasNext()) {
            ACLRole role = (ACLRole) roles.next();
            _log.info("Adding role '" + role.getName() + "' to ACL");
            acl.createRoleEntry(role.getName());
            if (role.isDefaultManagerRole()) {
                assingRoleToDefaultManager(db, acl, role);
            }
        }
       
    }
View Full Code Here

        }
       
        // Validate role names
        Iterator<ACLRole> roles = getACLRoles().iterator();
        while (roles.hasNext()) {
            ACLRole role = (ACLRole) roles.next();
            if (!Constants.PATTERN_ROLENAMES.matcher(role.getName()).matches()) {
                errors.add(new ValidationError("Role name '" + role.getName() + "' is invalid. Use only international alphanumeric characters and the symbols -, _, $, #, [ and ]",
                        new String[] { "aclRoles" }));
            }
        }

        if (_csConfig instanceof de.innovationgate.wga.common.beans.csconfig.v2.CSConfig) {
View Full Code Here

    }

    public static Configuration loadConfiguration(File file) throws FileNotFoundException, IOException, InvalidCSConfigVersionException {
       
        DesignDefinition syncInfo = null;
        CSConfig csConfig = null;
        String licenseText = null;
       
        // Normal plugin file
        if (file.isFile()) {
            ZipInputStream zipIn = new ZipInputStream(new FileInputStream(file));
            try {
                ZipEntry entry;
                while ((entry = zipIn.getNextEntry()) != null) {
                   
                    String entryName = entry.getName();
                    if (entryName.equals(DesignDirectory.DESIGN_DEFINITION_FILE) || entryName.equals(DesignDirectory.SYNCINFO_FILE)) {
                        TemporaryFile tempFile = new TemporaryFile("design", zipIn, null);
                        syncInfo = DesignDefinition.load(tempFile.getFile());
                        tempFile.delete();
                    }
                    else if (entryName.equals(SystemContainerManager.CSCONFIG_PATH)) {
                        TemporaryFile tempFile = new TemporaryFile("csconfig", zipIn, null);
                        csConfig = CSConfig.load(tempFile.getFile());
                        tempFile.delete();
                    }
                    else if (entryName.equals(SystemContainerManager.LICENSE_PATH)) {
                        licenseText = WGUtils.readString(new InputStreamReader(zipIn,  "UTF-8")).trim();
                    }
                   
                    if (syncInfo != null && csConfig != null) {
                        break;
                    }
                }
            }
            finally {
                zipIn.close();
            }
        }
       
        // Developer plugin folder
        else {
            File syncInfoFile = DesignDirectory.getDesignDefinitionFile(file);
            if (syncInfoFile.exists()) {
                syncInfo = DesignDefinition.load(syncInfoFile);
            }
            File csConfigFile = new File(file, SystemContainerManager.CSCONFIG_PATH);
            if (csConfigFile.exists()) {
                csConfig = CSConfig.load(csConfigFile);
            }
            File licenseTextFile = new File(file, SystemContainerManager.LICENSE_PATH);
            if (licenseTextFile.exists()) {
                Reader reader = new InputStreamReader(new FileInputStream(licenseTextFile) , "UTF-8");
                licenseText = WGUtils.readString(reader).trim();
                reader.close();
            }
           
        }
       
        if (syncInfo != null && csConfig != null && csConfig.getPluginConfig() != null) {
            return new Configuration(syncInfo, csConfig, licenseText);
        }
        else {
            return null;
        }
View Full Code Here

    }

    public String getValueTitle(String value, Locale locale) {
       
        WGDatabase pluginDB = _core.getContentdbs().get(value);
        CSConfig csConfig = (CSConfig) pluginDB.getAttribute(WGACore.DBATTRIB_CSCONFIG);
        if (csConfig != null && csConfig.getPluginConfig() != null) {
            return csConfig.getPluginConfig().getTitle() + " (" + csConfig.getPluginConfig().getId().getUniqueName() + ")";
        }
       
        return value;
       
    }
View Full Code Here

            // Create TMLForm, if form information was issued
            if (form != null) {
                FormInfo formInfo = new FormInfo(form.getId(), false, false);
                formInfo.setSource("none");
                formInfo.setKeepOnValidate(false);
                CSConfig csConfig = (CSConfig) db.getAttribute(WGACore.DBATTRIB_CSCONFIG);
                if (csConfig != null) {
                    formInfo.setVersionCompliance(csConfig.getVersionCompliance());
                }
                de.innovationgate.wgpublisher.webtml.utils.TMLForm tmlForm = context.createform(formInfo);
                tmlForm.importServicesForm(form);
            }
           
View Full Code Here

        }
    }
   
    protected boolean mayCallAction(WGDatabase db, String actionID) throws WGAPIException {
       
        CSConfig csConfig = (CSConfig) db.getAttribute(WGACore.DBATTRIB_CSCONFIG);
       
        // No cs config: All designers are permitted
        if (csConfig == null) {
            return db.getSessionContext().isDesigner();           
        }
       
        RemoteAction action = csConfig.findRemoteAction(actionID);
        if (action == null) {
            return false;
        }
       
        if (db.isMemberOfUserList(action.getCallers())) {
View Full Code Here

            status.formInfo.setDefinitionModule(getStatus().getTMLModuleName());
            status.formInfo.setDefinitionDatabase(getDesignDBKey());
           
            WGDatabase designDB = getCore().getContentdbs().get(getDesignDBKey());
            if (designDB != null) { // May be in StaticTML
                CSConfig csConfig = (CSConfig) designDB.getAttribute(WGACore.DBATTRIB_CSCONFIG);
                if (csConfig != null) {
                    status.formInfo.setVersionCompliance(csConfig.getVersionCompliance());
                }
            }
           
            updateDefaultAction(status.formInfo);
           
View Full Code Here

       
        Map metaMappings = (Map) db.getAttribute(DBATTRIB_META_MAPPINGS);
        Map itemMappings = (Map) db.getAttribute(DBATTRIB_ITEM_MAPPINGS);
        Map pluginShortcuts = (Map) db.getAttribute(DBATTRIB_PLUGIN_SHORTCUTS);
       
        CSConfig csconfig = (CSConfig) db.getAttribute(DBATTRIB_CSCONFIG);
        if (csconfig != null && csconfig instanceof de.innovationgate.wga.common.beans.csconfig.v2.CSConfig) {
            de.innovationgate.wga.common.beans.csconfig.v2.CSConfig v2 = (de.innovationgate.wga.common.beans.csconfig.v2.CSConfig) csconfig;
            Iterator shortcuts = v2.getShortcuts().iterator();
            while (shortcuts.hasNext()) {
                Shortcut shortcut = (Shortcut) shortcuts.next();
View Full Code Here

            updateLibraryLoader();
            info.setEnfordedLibraryUpdate(true);
        }
       
        // If no cxconfig.xml we are finished here
        CSConfig csConfig = info.getCsConfig();
        if (csConfig == null) {
            return;
        }
       
        // WGA wide configurations, that can be bypassed if the system file container is from a provider DB
        // (because they already were enforced by the provider db)
        if (!info.isFromProviderDB()) {
       
            // Add encoder mappings
            Iterator encoderMappings = csConfig.getEncoderMappings().iterator();
            while (encoderMappings.hasNext()) {
                EncoderMapping mapping = (EncoderMapping) encoderMappings.next();
                getLog().info("Adding WebTML encoder '" + mapping.getName() + "'");
                if (addEncoderMapping(mapping.getName(), mapping.getImplementationClass(), false)) {
                    info.getEnforcedEncoderMappings().add(mapping.getName());
                }
            }
           
           
            // Add element mappings
            Iterator elementMappings = csConfig.getElementMappings().iterator();
            while (elementMappings.hasNext()) {
                ElementMapping mapping = (ElementMapping) elementMappings.next();
                getLog().info("Adding WebTML element '" + mapping.getName() + "'");
                if (addElementMapping(mapping.getName(), mapping.getImplementationClass(), false)) {
                    info.getEnforcedElementMappings().add(mapping.getName());
                }
            }
           
            // Add media keys
            Iterator mediaKeys = csConfig.getMediaKeys().iterator();
            while (mediaKeys.hasNext()) {
                de.innovationgate.wga.common.beans.csconfig.v1.MediaKey mediaKey = (de.innovationgate.wga.common.beans.csconfig.v1.MediaKey) mediaKeys.next();
                getLog().info("Adding WebTML media key '" + mediaKey.getKey() + "' for MIME type '" + mediaKey.getMimeType() + "'");
                addMediaMapping(mediaKey, false);
                info.getEnforcedMediaMappings().add(mediaKey.getKey());
            }
           

            if (csConfig instanceof de.innovationgate.wga.common.beans.csconfig.v2.CSConfig) {
               
                // Add TMLScript global shortcuts
                de.innovationgate.wga.common.beans.csconfig.v2.CSConfig v2 = (de.innovationgate.wga.common.beans.csconfig.v2.CSConfig) csConfig;
                Iterator shortcuts = v2.getShortcuts().iterator();
                while (shortcuts.hasNext()) {
                    Shortcut shortcut = (Shortcut) shortcuts.next();
                    if (shortcut.getType() == Shortcut.TYPE_TMLSCRIPT_GLOBAL) {
                        getTmlscriptGlobalRegistry().registerGlobal(new TMLScriptGlobal(shortcut.getShortcut(), TMLScriptGlobal.TYPE_PACKAGE_OR_CLASS, shortcut.getReference()));
                    }
                }
               
            }
           
        }
       
        // Set WGA version compliance if not explicitly set via first level db option
        Set firstLevelOptions = (Set) db.getAttribute(DBATTRIB_FIRSTLEVELDBOPTIONS);
        if (!firstLevelOptions.contains(WGDatabase.COPTION_NOITEMBEHAVIOUR)) {
            db.getNoItemBehaviour().compliantTo(csConfig.getVersionCompliance());
        }
       
        // Add jobs
        Iterator jobs = csConfig.getJobDefinitions().iterator();
        while (jobs.hasNext()) {
            JobDefinition job = (JobDefinition) jobs.next();
            String jobName = db.getDbReference() + "." + job.getName();
            try {
                Task task = null;
View Full Code Here

TOP

Related Classes of de.innovationgate.wga.common.beans.csconfig.v1.MediaKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.