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

📄 portlettype.java

📁 portal越来越流行了
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
        getInitParams();
        initParam.add(param);
        return param;
    }
    
    public int getExpirationCache()
    {
        return expirationCache != null ? expirationCache.intValue() : 0;
    }

    public void setExpirationCache(int value)
    {
        expirationCache = new Integer(value);
    }

    /**
     * Caching scope, allowed values are "private" indicating that the content should not be shared across users and
     * "public" indicating that the content may be shared across users. The default value if not present is "private".
     */
    public String getCacheScope()
    {
        return cacheScope != null ? cacheScope : "private";
    }

    public void setCacheScope(String cacheScope)
    {
        this.cacheScope = cacheScope;
    }

    public Supports getSupports(String mimeType)
    {
        for (Supports s : getSupports())
        {
            if (s.getMimeType().equals(mimeType))
            {
                return s;
            }
        }
        return null;
    }
    
    public List<? extends Supports> getSupports()
    {
        if (supports == null)
        {
            supports = new ArrayList<SupportsType>();
        }
        return supports;
    }
    
    public Supports addSupports(String mimeType)
    {
        if (getSupports(mimeType) != null)
        {
            throw new IllegalArgumentException("Supports for mime type: "+mimeType+" already defined");
        }
        SupportsType s = new SupportsType();
        s.setMimeType(mimeType);
        supports.add(s);
        return s;        
    }
    
    public List<String> getSupportedLocales()
    {
        if (supportedLocale == null)
        {
            supportedLocale = new ArrayList<String>();
        }
        return supportedLocale;
    }
    
    public void addSupportedLocale(String lang)
    {
        for (String l : getSupportedLocales())
        {
            if (l.equals(lang))
            {
                throw new IllegalArgumentException("Supported locale: "+lang+" already defined");
            }
        }
        supportedLocale.add(lang);    
    }

    public String getResourceBundle()
    {
        return resourceBundle;
    }

    public void setResourceBundle(String value)
    {
        resourceBundle = value;
    }

    public PortletInfo getPortletInfo()
    {
        if (portletInfo == null)
        {
            portletInfo = new PortletInfoType();
        }
        return portletInfo;
    }

    public Preferences getPortletPreferences()
    {
        if (portletPreferences == null)
        {
            portletPreferences = new PortletPreferencesType();
        }
        return portletPreferences;
    }
    
    public SecurityRoleRef getSecurityRoleRef(String roleName)
    {
        for (SecurityRoleRef ref : getSecurityRoleRefs())
        {
            if (ref.getRoleName().equals(roleName))
            {
                return ref;
            }
        }
        return null;
    }

    public List<? extends SecurityRoleRef> getSecurityRoleRefs()
    {
        if (securityRoleRef == null)
        {
            securityRoleRef = new ArrayList<SecurityRoleRefType>();
        }
        return securityRoleRef;
    }
    
    public SecurityRoleRef addSecurityRoleRef(String roleName)
    {
        if (getSecurityRoleRef(roleName) != null)
        {
            throw new IllegalArgumentException("Security role reference for role: "+roleName+" already defined");
        }
        SecurityRoleRefType srr = new SecurityRoleRefType();
        srr.setRoleName(roleName);
        securityRoleRef.add(srr);
        return srr;        
    }
    
    public List<? extends EventDefinitionReference> getSupportedProcessingEvents()
    {
        if (supportedProcessingEvent == null)
        {
            supportedProcessingEvent = new ArrayList<EventDefinitionReferenceType>();            
        }
        return supportedProcessingEvent;
    }

    public EventDefinitionReference addSupportedProcessingEvent(QName qname)
    {
        // TODO: check duplicates
        getSupportedProcessingEvents();
        EventDefinitionReferenceType edr = new EventDefinitionReferenceType();
        edr.setQName(qname);
        supportedProcessingEvent.add(edr);
        return edr;
    }
    
    public EventDefinitionReference addSupportedProcessingEvent(String name)
    {
        // TODO check duplicates
        getSupportedProcessingEvents();
        EventDefinitionReferenceType edr = new EventDefinitionReferenceType();
        edr.setName(name);
        supportedProcessingEvent.add(edr);
        return edr;
    }
        
    public List<? extends EventDefinitionReference> getSupportedPublishingEvents()
    {
        if (supportedPublishingEvent == null)
        {
            supportedPublishingEvent = new ArrayList<EventDefinitionReferenceType>();            
        }
        return supportedPublishingEvent;
    }

    public EventDefinitionReference addSupportedPublishingEvent(QName qname)
    {
        // TODO: check duplicates
        getSupportedPublishingEvents();
        EventDefinitionReferenceType edr = new EventDefinitionReferenceType();
        edr.setQName(qname);
        supportedPublishingEvent.add(edr);
        return edr;
    }
    
    public EventDefinitionReference addSupportedPublishingEvent(String name)
    {
        // TODO check duplicates
        getSupportedPublishingEvents();
        EventDefinitionReferenceType edr = new EventDefinitionReferenceType();
        edr.setName(name);
        supportedPublishingEvent.add(edr);
        return edr;
    }
        
    public List<String> getSupportedPublicRenderParameters()
    {
        if (supportedPublicRenderParameter == null)
        {
            supportedPublicRenderParameter = new ArrayList<String>();
        }
        return supportedPublicRenderParameter;
    }
    
    public void addSupportedPublicRenderParameter(String identifier)
    {
        for (String ident : getSupportedPublicRenderParameters())
        {
            if (ident.equals(identifier))
            {
                throw new IllegalArgumentException("Support for public render parameter with identifier: "+identifier+" already defined");
            }
        }
        supportedPublicRenderParameter.add(identifier);
    }

    public ContainerRuntimeOption getContainerRuntimeOption(String name)
    {
        for (ContainerRuntimeOption cro : getContainerRuntimeOptions())
        {
            if (cro.getName().equals(name))
            {
                return cro;
            }
        }
        return null;
    }
    
    public List<? extends ContainerRuntimeOption> getContainerRuntimeOptions()
    {
        if (containerRuntimeOption == null)
        {
            containerRuntimeOption = new ArrayList<ContainerRuntimeOptionType>();
        }
        return containerRuntimeOption;
    }
    
    public ContainerRuntimeOption addContainerRuntimeOption(String name)
    {
        if (getContainerRuntimeOption(name) != null)
        {
            throw new IllegalArgumentException("Container runtime option with name: "+name+" already defined");
        }
        ContainerRuntimeOptionType cro = new ContainerRuntimeOptionType();
        cro.setName(name);
        containerRuntimeOption.add(cro);
        return cro;        
    }
    
    public void afterUnmarshal(Unmarshaller u, Object parent) {
        application = (PortletApplicationDefinition)parent;
    }
}

⌨️ 快捷键说明

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