⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmsmodule.java

📁 cms是开源的框架
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
            m_actionClass = value;
        }
    }

    /**
     * Sets the author email of this module.<p>
     * 
     * 
     * <i>Please note:</i>It's not possible to set the modules author email once the module
     * configuration has been frozen.<p>
     * 
     * @param value the module description to set
     */
    public void setAuthorEmail(String value) {

        checkFrozen();
        m_authorEmail = value.trim();
    }

    /**
     * Sets the author name of this module.<p>
     * 
     * 
     * <i>Please note:</i>It's not possible to set the modules author name once the module
     * configuration has been frozen.<p>
     * 
     * @param value the module description to set
     */
    public void setAuthorName(String value) {

        checkFrozen();
        m_authorName = value.trim();
    }

    /**
     * Sets the createClassesFolder flag.<p>
     *
     * @param createClassesFolder the createClassesFolder flag to set
     */
    public void setCreateClassesFolder(boolean createClassesFolder) {

        m_createClassesFolder = createClassesFolder;
    }

    /**
     * Sets the createElementsFolder flag.<p>
     *
     * @param createElementsFolder the createElementsFolder flag to set
     */
    public void setCreateElementsFolder(boolean createElementsFolder) {

        m_createElementsFolder = createElementsFolder;
    }

    /**
     * Sets the createLibFolder flag.<p>
     *
     * @param createLibFolder the createLibFolder flag to set
     */
    public void setCreateLibFolder(boolean createLibFolder) {

        m_createLibFolder = createLibFolder;
    }

    /**
     * Sets the createModuleFolder flag.<p>
     *
     * @param createModuleFolder the createModuleFolder flag to set
     */
    public void setCreateModuleFolder(boolean createModuleFolder) {

        m_createModuleFolder = createModuleFolder;
    }

    /**
     * Sets the createResourcesFolder flag.<p>
     *
     * @param createResourcesFolder the createResourcesFolder flag to set
     */
    public void setCreateResourcesFolder(boolean createResourcesFolder) {

        m_createResourcesFolder = createResourcesFolder;
    }

    /**
     * Sets the createTemplateFolder flag .<p>
     *
     * @param createTemplateFolder the createTemplateFolder flag to set
     */
    public void setCreateTemplateFolder(boolean createTemplateFolder) {

        m_createTemplateFolder = createTemplateFolder;
    }

    /**
     * Sets the date created of this module.<p>
     * 
     * 
     * <i>Please note:</i>It's not possible to set the module date created once the module
     * configuration has been frozen.<p>
     * 
     * @param value the date created to set
     */
    public void setDateCreated(long value) {

        checkFrozen();
        m_dateCreated = value;
    }

    /**
     * Sets the installation date of this module.<p>
     * 
     * 
     * <i>Please note:</i>It's not possible to set the installation date once the module
     * configuration has been frozen.<p>
     * 
     * @param value the installation date this module
     */
    public void setDateInstalled(long value) {

        checkFrozen();
        m_dateInstalled = value;
    }

    /**
     * Sets the list of module dependencies.<p>
     *
     * @param dependencies list of module dependencies
     */
    public void setDependencies(List dependencies) {

        checkFrozen();
        m_dependencies = dependencies;
    }

    /**
     * Sets the description of this module.<p>
     * 
     * 
     * <i>Please note:</i>It's not possible to set the modules description once the module
     * configuration has been frozen.<p>
     * 
     * @param value the module description to set
     */
    public void setDescription(String value) {

        checkFrozen();
        m_description = value.trim();
    }

    /**
     * Sets the additional explorer types that belong to this module.<p>
     *
     * @param explorerTypeSettings the explorer type settings.
     */
    public void setExplorerTypes(List explorerTypeSettings) {

        m_explorerTypeSettings = explorerTypeSettings;
    }

    /**
     * Sets the exportpoints of  this module.<p>
     *
     * @param exportPoints the exportpoints of this module.
     */
    public void setExportPoints(List exportPoints) {

        m_exportPoints = exportPoints;
    }

    /**
     * Sets the group name of this module.<p>
     * 
     * 
     * <i>Please note:</i>It's not possible to set the modules group name once the module
     * configuration has been frozen.<p>
     * 
     * @param value the module group name to set
     */
    public void setGroup(String value) {

        checkFrozen();
        m_group = value;
    }

    /**
     * Sets the name of this module.<p>
     * 
     * The module name must be a valid java package name.<p>
     * 
     * <i>Please note:</i>It's not possible to set the modules name once the module
     * configuration has been frozen.<p>
     * 
     * @param value the module name to set
     */
    public void setName(String value) {

        checkFrozen();
        if (!CmsStringUtil.isValidJavaClassName(value)) {
            throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_MODULE_NAME_1, value));
        }
        m_name = value;
    }

    /**
     * Sets the "nice" display name of this module.<p>
     * 
     * <i>Please note:</i>It's not possible to set the modules "nice" name once the module
     * configuration has been frozen.<p> 
     * 
     * @param value the "nice" display name of this module to set
     */
    public void setNiceName(String value) {

        checkFrozen();
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(value)) {
            m_niceName = getName();
        } else {
            m_niceName = value.trim();
        }
    }

    /**
     * Sets the parameters of this module.<p>
     * 
     * 
     * <i>Please note:</i>It's not possible to set the module parameters once the module
     * configuration has been frozen.<p>
     * 
     * @param value the module parameters to set
     */
    public void setParameters(SortedMap value) {

        checkFrozen();
        m_parameters = value;
    }

    /**
     * Sets the resources of this module.<p>
     * 
     * 
     * <i>Please note:</i>It's not possible to set the module resources once the module
     * configuration has been frozen.<p>
     * 
     * @param value the module resources to set
     */
    public void setResources(List value) {

        checkFrozen();
        m_resources = value;
    }

    /**
     * Sets the list of additional resource types that belong to this module.<p>
     *
     * @param resourceTypes list of additional resource types that belong to this module
     */
    public void setResourceTypes(List resourceTypes) {

        m_resourceTypes = Collections.unmodifiableList(resourceTypes);
    }

    /**
     * Sets the user who installed of this module.<p>
     * 
     * 
     * <i>Please note:</i>It's not possible to set the user installed once the module
     * configuration has been frozen.<p>
     * 
     * @param value the user who installed this module
     */
    public void setUserInstalled(String value) {

        checkFrozen();
        m_userInstalled = value.trim();
    }

    /**
     * Checks if this modules configuration is frozen.<p>
     * 
     * @throws CmsIllegalArgumentException in case the configuration is already frozen
     */
    protected void checkFrozen() throws CmsIllegalArgumentException {

        if (m_frozen) {
            throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_MODULE_FROZEN_1, getName()));
        }
    }

    /**
     * Initializes this module, also freezing the module configuration.<p>
     * 
     * @param cms an initialized OpenCms user context
     * 
     * @throws CmsRoleViolationException if the given users does not have the <code>{@link CmsRole#MODULE_MANAGER}</code> role 
     */
    protected void initialize(CmsObject cms) throws CmsRoleViolationException {

        checkFrozen();
        // check if the user has the required permissions
        cms.checkRole(CmsRole.MODULE_MANAGER);

        m_frozen = true;
        m_resources = Collections.unmodifiableList(m_resources);
    }

    /**
     * Sets the module action instance for this module.<p>
     * 
     * @param actionInstance the module action instance for this module
     */
    /*package*/void setActionInstance(I_CmsModuleAction actionInstance) {

        m_actionInstance = actionInstance;

    }

    /**
     * Resolves the module property "additionalresources" to the resource list and
     * vice versa.<p>
     * 
     * This "special" module property is required as long as we do not have a new 
     * GUI for editing of module resource entries. Once we have the new GUI, the 
     * handling of "additionalresources" will be moved to the import of the module 
     * and done only if the imported module is a 5.0 module.<p>
     */
    private void initOldAdditionalResources() {

        SortedMap parameters = new TreeMap(m_parameters);
        List resources = new ArrayList(m_resources);

        String additionalResources;
        additionalResources = (String)parameters.get(MODULE_PROPERTY_ADDITIONAL_RESOURCES);
        if (additionalResources != null) {
            StringTokenizer tok = new StringTokenizer(
                additionalResources,
                MODULE_PROPERTY_ADDITIONAL_RESOURCES_SEPARATOR);
            while (tok.hasMoreTokens()) {
                String resource = tok.nextToken().trim();
                if ((!"-".equals(resource)) && (!resources.contains(resource))) {
                    resources.add(resource);
                }
            }
        }

        m_resources = resources;
    }

    /**
     * Checks if two objects are either both null, or equal.<p>
     * 
     * @param a the first object to check
     * @param b the second object to check 
     * @return true if the two object are either both null, or equal
     */
    private boolean isEqual(Object a, Object b) {

        if (a == null) {
            return (b == null);
        }
        if (b == null) {
            return false;
        }
        return a.equals(b);
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -