Package org.apache.pluto.descriptors.portlet

Examples of org.apache.pluto.descriptors.portlet.PortletDD


       
        for (Iterator it = portletAppDD.getPortlets().iterator();
            it.hasNext(); ) {
           
          // Read portlet definition.
          PortletDD portlet = (PortletDD) it.next();
            String name = portlet.getPortletName();
           
            // Create servlet definition element.
            Element servlet = webXmlDoc.createElement("servlet");
            Element servletName = webXmlDoc.createElement("servlet-name");
            servletName.appendChild(webXmlDoc.createTextNode(name));
View Full Code Here


     * @param roleName the name of the role
     * @return true if it is determined the user has the given role.
     */
    public boolean isUserInRole(String roleName) {
        PortletEntity entity = internalPortletWindow.getPortletEntity();
        PortletDD def = entity.getPortletDefinition();

        SecurityRoleRefDD ref = null;
        Iterator refs = def.getSecurityRoleRefs().iterator();
        while (refs.hasNext()) {
            SecurityRoleRefDD r = (SecurityRoleRefDD) refs.next();
            if (r.getRoleName().equals(roleName)) {
                ref = r;
                break;
View Full Code Here

    }

    public Enumeration getResponseContentTypes() {
        if (contentTypes == null) {
            contentTypes = new Vector();
            PortletDD dd = internalPortletWindow.getPortletEntity().getPortletDefinition();
            Iterator supports = dd.getSupports().iterator();
            while (supports.hasNext()) {
                SupportsDD sup = (SupportsDD) supports.next();
                contentTypes.add(sup.getMimeType());
            }
            if (contentTypes.size() < 1) {
View Full Code Here

    private boolean isPortletModeAllowedByPortlet(PortletMode mode) {
        if (isPortletModeMandatory(mode)) {
            return true;
        }

        PortletDD dd = internalPortletWindow.getPortletEntity()
            .getPortletDefinition();

        Iterator mimes = dd.getSupports().iterator();
        while (mimes.hasNext()) {
            Iterator modes = ((SupportsDD) mimes.next()).getPortletModes().iterator();
            while (modes.hasNext()) {
                String m = (String) modes.next();
                if (m.equalsIgnoreCase(mode.toString())) {
View Full Code Here

     * @return true if the content type is valid, false otherwise.
     */
    private boolean isValidContentType(String contentType) {
        boolean valid = false;

        PortletDD portletDD = getInternalPortletWindow().getPortletEntity()
            .getPortletDefinition();
        for (Iterator it = portletDD.getSupports().iterator();
             !valid && it.hasNext();) {

            SupportsDD supportsDD = (SupportsDD) it.next();
            String supportedType = supportsDD.getMimeType();

View Full Code Here

     *
     * @see org.apache.pluto.descriptors.portlet.PortletPreferenceDD
     */
    public InternalPortletPreference[] getDefaultPreferences() {
        if (defaultPreferences == null) {
            PortletDD portletDD = getPortletDefinition();
            PortletPreferencesDD prefsDD = portletDD.getPortletPreferences();
            if (prefsDD != null) {
              List prefs = new ArrayList();
              for (Iterator it = prefsDD.getPortletPreferences().iterator();
                  it.hasNext(); ) {
                PortletPreferenceDD prefDD = (PortletPreferenceDD) it.next();
View Full Code Here

        // Load PortletAppDD and find out the portlet definition.
        try {
            PortletAppDD appDD = PortletDescriptorRegistry.getRegistry()
                .getPortletAppDD(crossContext);
            for (Iterator it = appDD.getPortlets().iterator(); it.hasNext(); ) {
                PortletDD portletDD = (PortletDD) it.next();
                if (portletDD.getPortletName().equals(portletName)) {
                  portletDefinition = portletDD;
                  break;
                }
            }
        } catch (PortletContainerException ex) {
View Full Code Here

        final PortletUrl portletUrl = this.portletRequestParameterManager.getPortletRequestInfo(httpServletRequest, portletWindowId);
        if (portletUrl != null) {
            return false;
        }
       
        final PortletDD portletDescriptor;
        try {
            portletDescriptor = this.getPortletDD(httpServletRequest, portletWindowId);
        }
        catch (PortletContainerException pce) {
            this.logger.warn("Could not retrieve PortletDD for portlet window '" + portletWindowId + "' to determine caching configuration. Marking content cache invalid and continuing.", pce);
            return false;
        }
       
        if (portletDescriptor == null) {
            this.logger.warn("Could not retrieve PortletDD for portlet window '" + portletWindow + "' to determine caching configuration. Marking content cache invalid and continuing.");
            return false;
        }
       
        //If the descriptor value is unset return immediately
        final int descriptorExpirationCache = portletDescriptor.getExpirationCache();
        if (descriptorExpirationCache == PortletDD.EXPIRATION_CACHE_UNSET) {
            return false;
        }
       
        //Use value from window if it is set
View Full Code Here

       
       
        final ChannelRuntimeData channelRuntimeData = new ChannelRuntimeData();
       
       
        final PortletDD portletDD = new PortletDD();
        portletDD.setSecurityRoleRefs(Collections.EMPTY_LIST);
       
       
        final IPortletDefinitionRegistry portletDefinitionRegistry = createMock(IPortletDefinitionRegistry.class);
        final IPortletEntityRegistry portletEntityRegistry = createMock(IPortletEntityRegistry.class);
View Full Code Here

        expect(portletWindowRegistry.getPortletWindow(pcsRequest, portletWindowId)).andReturn(portletWindow);
        expect(portletWindowRegistry.getParentPortletEntity(pcsRequest, portletWindowId)).andReturn(portletEntity);
        expect(portletRequestParameterManager.getPortletRequestInfo(pcsRequest, portletWindowId)).andReturn(null);
       
       
        final PortletDD portletDD = new PortletDD();
       
       
        final IPortletDefinitionRegistry portletDefinitionRegistry = createMock(IPortletDefinitionRegistry.class);
        expect(portletDefinitionRegistry.getParentPortletDescriptor(portletDefinitionId)).andReturn(portletDD);
View Full Code Here

TOP

Related Classes of org.apache.pluto.descriptors.portlet.PortletDD

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.