Package org.apache.pluto.container.om.portlet

Examples of org.apache.pluto.container.om.portlet.PortletDefinition


                    ServletConfig config = new ServletConfigWrapper(getServletConfig(), fragment.getName());
                    String applicationName =  contextService.register(config);
                    portletContext = contextService.getPortletContext(applicationName);
                    List<? extends PortletDefinition> portlets = contextService.getPortletContext(applicationName).getPortletApplicationDefinition().getPortlets();
                    for (Iterator iterator = portlets.iterator(); iterator.hasNext();) {
                        PortletDefinition portletDD = (PortletDefinition) iterator.next();
                        portletConfigs.put(Jahia.getContextPath() + "/" + fragment.getName() + "." + portletDD.getPortletName(), contextService.getPortletConfig(applicationName, portletDD.getPortletName()));
                    }
                } catch (Exception ex) {
                    log("Error while registering portlet", ex);
                }
            }
            started = true;

            for (Map.Entry<String, DriverPortletConfig> entry : portletConfigs.entrySet()) {
                DriverPortletConfig portletConfig = entry.getValue();
                PortletDefinition portletDD = portletConfig.getPortletDefinition();

                //          Create and initialize the portlet wrapped in the servlet.
                try {
                    Class<?> clazz = paClassLoader.loadClass((portletDD.getPortletClass()));
                    Portlet portlet = (Portlet) clazz.newInstance();

                    String rootPath = portletConfig.getInitParameter("rootPath");
                    String realPath = portletConfig.getPortletContext().getRealPath(rootPath + "/definitions.cnd");
                    if (new File(realPath).exists()) {
View Full Code Here


   
    @Override
    protected Preference load()
    {
        PortletApplication app = locator.getPortletRegistry().getPortletApplication(paNodeBean.getApplicationName());
        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
        Preference preference = (Preference) def.getPortletPreferences().getPortletPreference(name);
        return preference;
    }
View Full Code Here

    public Enumeration<String> getResponseContentTypes()
    {
        if (contentTypes == null)
        {
            contentTypes = new ArrayList<String>();
            PortletDefinition dd = getPortletWindow().getPortletDefinition();
            for (Supports sup : dd.getSupports())
            {
                contentTypes.add(sup.getMimeType());
            }
            if (contentTypes.isEmpty())
            {
View Full Code Here

            return true;
        }

        String modeName = mode.toString();

        PortletDefinition dd = getPortletWindow().getPortletDefinition();

        for (Supports sup : dd.getSupports())
        {
            for (String m : sup.getPortletModes())
            {
                if (m.equalsIgnoreCase(modeName))
                {
                    // check if a portlet managed mode which is always allowed.
                    CustomPortletMode cpm = dd.getApplication().getCustomPortletMode(modeName);
                    if (cpm != null && !cpm.isPortalManaged())
                    {
                        return true;
                    }
                    Enumeration<PortletMode> supportedModes = portalContext.getSupportedPortletModes();
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)
    {
        PortletDefinition def = getPortletWindow().getPortletDefinition();
        String link = roleName;

        for (SecurityRoleRef r : def.getSecurityRoleRefs())
        {
            if (r.getRoleName().equals(roleName))
            {
                if (r.getRoleLink() != null)
                {
View Full Code Here

     */
    protected final void internalStore() throws IOException, ValidatorException {
        // Validate the preferences before storing, if a validator is defined.
        //   If the preferences cannot pass the validation,
        //   an ValidatorException will be thrown out.
        PortletDefinition portletD = window.getPortletDefinition();
        PreferencesValidator validator = preferencesService.getPreferencesValidator(portletD);
        if (validator != null)
        {
            validator.validate(this);
        }
View Full Code Here

   
  public MimeResponseImpl(PortletMimeResponseContext responseContext)
  {
    super(responseContext);
    this.responseContext = responseContext;
    PortletDefinition portletDefinition = getPortletWindow().getPortletDefinition();
    getCacheControl().setExpirationTime(portletDefinition.getExpirationCache());
    getCacheControl().setPublicScope(PUBLIC_SCOPE.equals(portletDefinition.getCacheScope()));
  }
View Full Code Here

    protected List<String> getResponseContentTypes()
    {
        if (responseContentTypes == null)
        {
            responseContentTypes = new ArrayList<String>();
            PortletDefinition dd = getPortletWindow().getPortletDefinition();
            for (Supports sup : dd.getSupports())
            {
                responseContentTypes.add(sup.getMimeType());
            }
            if (responseContentTypes.isEmpty())
            {
View Full Code Here

        app.setVersion(version);
        if (portlet != null)
        {
            for (PortletType src : portlet)
            {
                PortletDefinition target = app.addPortlet(src.portletName);
                upgradePortlet(src, target);
            }
        }
        if (customPortletMode != null)
        {
            for (CustomPortletModeType src : customPortletMode)
            {
                CustomPortletMode target = app.addCustomPortletMode(src.portletMode);
                if (src.description != null)
                {
                    for (DescriptionType d : src.description)
                    {
                        Description desc = target.addDescription(d.lang);
                        desc.setDescription(d.value);
                    }
                }
            }
        }
        if (customWindowState != null)
        {
            for (CustomWindowStateType src : customWindowState)
            {
                CustomWindowState target = app.addCustomWindowState(src.windowState);
                if (src.description != null)
                {
                    for (DescriptionType d : src.description)
                    {
                        Description desc = target.addDescription(d.lang);
                        desc.setDescription(d.value);
                    }
                }
            }
        }
        if (userAttribute != null)
        {
            for (UserAttributeType src : userAttribute)
            {
                UserAttribute target = app.addUserAttribute(src.name);
                if (src.description != null)
                {
                    for (DescriptionType d : src.description)
                    {
                        Description desc = target.addDescription(d.lang);
                        desc.setDescription(d.value);
                    }
                }
            }
        }
        if (securityConstraint != null)
        {
            for (SecurityConstraintType src : securityConstraint)
            {
                SecurityConstraint target = app.addSecurityConstraint(src.userDataConstraint.transportGuarantee);
                if (src.displayName != null)
                {
                    for (DisplayNameType d : src.displayName)
                    {
                        DisplayName dname = target.addDisplayName(d.lang);
                        dname.setDisplayName(d.value);
                    }
                }
                if (src.portletCollection != null && src.portletCollection.portletName != null)
                {
                    for (String pname : src.portletCollection.portletName)
                    {
                        target.addPortletName(pname);
                    }
                }
            }
        }
        return app;
View Full Code Here

            return true;
        }
       
        String modeName = mode.toString();

        PortletDefinition dd = getPortletWindow().getPortletDefinition();

        for (Supports sup : dd.getSupports())
        {
            for (String m : sup.getPortletModes())
            {
                if (m.equalsIgnoreCase(modeName))
                {
                    // check if a portlet managed mode which is always allowed.
                    CustomPortletMode cpm = dd.getApplication().getCustomPortletMode(modeName);
                    if (cpm != null && !cpm.isPortalManaged())
                    {
                        return true;
                    }
                    Enumeration<PortletMode> supportedModes = getPortalContext().getSupportedPortletModes();
View Full Code Here

TOP

Related Classes of org.apache.pluto.container.om.portlet.PortletDefinition

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.