Package org.apache.jetspeed.om.portlet

Examples of org.apache.jetspeed.om.portlet.UserAttribute


   
    @Override
    protected UserAttribute load()
    {
        PortletApplication app = locator.getPortletRegistry().getPortletApplication(paNodeBean.getApplicationName());
        UserAttribute userAttribute = app.getUserAttribute(name);
        return userAttribute;
    }
View Full Code Here


                description = securityRoleRef.getDescription(locale);
            }
        }
        else
        {
            UserAttribute attr = app.getUserAttribute(name);
            description = attr.getDescription(locale);
        }
       
        return new DescriptionBean(description);
    }
View Full Code Here

            @Override
            public IDataProvider<DescriptionBean> getDataProvider()
            {
                JetspeedServiceLocator locator = ((AbstractAdminWebApplication) getApplication()).getServiceLocator();
                PortletApplication app = locator.getPortletRegistry().getPortletApplication(paNodeBean.getApplicationName());
                final UserAttribute attribute = app.getUserAttribute(userAttr.getName());

                List<DescriptionBean> list = new ArrayList<DescriptionBean>();

                for (Description description : attribute.getDescriptions())
                {
                    list.add(new DescriptionBean(description));
                }

                return new ListDataProvider<DescriptionBean>(list);
            }

            @Override
            protected Button saveButton(String componentId)
            {
                return new Button(componentId)
                {

                    @Override
                    public void onSubmit()
                    {
                        FeedbackPanel feed = (FeedbackPanel) getPage().get("feedback");
                       
                        try
                        {
                            PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                            PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
                           
                            if (newLocale != null && newDescription != null)
                            {
                                UserAttribute attr = app.getUserAttribute(userAttr.getName());
                                Locale locale = new Locale(newLocale);
                                Description targetDescription = null;
                               
                                for (Description description : attr.getDescriptions())
                                {
                                    if (description.getLocale().equals(locale))
                                    {
                                        targetDescription = description;
                                        break;
                                    }
                                }

                                if (targetDescription == null)
                                {
                                    targetDescription = attr.addDescription(newLocale);
                                }
                               
                                targetDescription.setDescription(newDescription);
                               
                                newLocale = null;
                                newDescription = null;
                            }

                            registry.updatePortletApplication(app);
                            StringResourceModel resModel = new StringResourceModel("pam.details.action.status.application.saveOK", this, null, new Object [] { paNodeBean.getApplicationName() } );
                            feed.info(resModel.getString());
                        }
                        catch (RegistryException e)
                        {
                            logger.error("Failed to update portlet application.", e);
                            StringResourceModel resModel = new StringResourceModel("pam.details.action.status.application.saveFailure", this, null, new Object [] { paNodeBean.getApplicationName(), e.getMessage() } );
                            feed.info(resModel.getString());
                        }
                    }
                };
            }

            @Override
            public void delete(IModel<DescriptionBean>[] fields)
            {
                FeedbackPanel feed = (FeedbackPanel) getPage().get("feedback");
               
                try
                {
                    PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                    PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
                    UserAttribute attr = app.getUserAttribute(name);
                   
                    if (attr != null)
                    {
                        for (Iterator<Description> it = attr.getDescriptions().iterator(); it.hasNext(); )
                        {
                            Description description = it.next();
                           
                            for (IModel<DescriptionBean> descriptionBeanModel : fields)
                            {
View Full Code Here

                    JetspeedServiceLocator locator = ((AbstractAdminWebApplication) getApplication()).getServiceLocator();
                    PortletApplication app = locator.getPortletRegistry().getPortletApplication(paNodeBean.getApplicationName());

                    if (newName != null && newDescription != null && newLocale != null)
                    {
                        UserAttribute attribute = app.addUserAttribute(newName);
                        attribute.addDescription(newLocale).setDescription(newDescription);
                       
                        newName = null;
                        newDescription = null;
                        newLocale = null;
                    }
View Full Code Here

                description = securityRoleRef.getDescription(locale);
            }
        }
        else
        {
            UserAttribute attr = app.getUserAttribute(name);
            description = attr.getDescription(locale);
        }
       
        return new DescriptionBean(description);
    }
View Full Code Here

        app.setContextPath("/pa-001");

        UserAttributeRef uaRef = app.addUserAttributeRef("user-name-family");
        uaRef.setNameLink("user.name.family");
       
        UserAttribute ua = app.addUserAttribute("user.name.family");
        ua.addDescription(lang).setDescription("User Last Name");
       
        app.addJetspeedServiceReference("PortletEntityAccessComponent");
        app.addJetspeedServiceReference("PortletRegistryComponent");

        PortletDefinition portlet = app.addPortlet("Portlet-1");
View Full Code Here

        app.setContextPath("/app1");

        UserAttributeRef uaRef = app.addUserAttributeRef("user-name-family");
        uaRef.setNameLink("user.name.family");

        UserAttribute ua = app.addUserAttribute("user.name.family");
        ua.addDescription(lang).setDescription("User Last Name");

        app.addJetspeedServiceReference("PortletEntityAccessComponent");
        app.addJetspeedServiceReference("PortletRegistryComponent");

        addDublinCore(app.getMetadata());
View Full Code Here

        if ((null != userAttributeRefs) && (userAttributeRefs.size() > 0))
        {
            Iterator attrIter = userAttributes.iterator();
            while (attrIter.hasNext())
            {
                UserAttribute currentAttribute = (UserAttribute) attrIter.next();
                boolean linkedAttribute = false;
                if (null != currentAttribute)
                {
                    Iterator attrRefsIter = userAttributeRefs.iterator();
                    while (attrRefsIter.hasNext())
                    {
                        UserAttributeRef currentAttributeRef = (UserAttributeRef) attrRefsIter.next();
                        if (null != currentAttributeRef)
                        {
                            if ((currentAttribute.getName()).equals(currentAttributeRef.getNameLink()))
                            {
                                if (log.isDebugEnabled())
                                    log.debug("Linking user attribute ref: [[name, " + currentAttribute.getName()
                                            + "], [linked name, " + currentAttributeRef.getName() + "]]");
                                linkedUserAttributes.add(currentAttributeRef);
                                linkedAttribute = true;
                            }
                        }
                    }
                }
                if (!linkedAttribute)
                {
                    linkedUserAttributes.add(new UserAttributeRefImpl(currentAttribute));
                }
            }
        }
        else
        {
            Iterator attrIter = userAttributes.iterator();
            while (attrIter.hasNext())
            {
                UserAttribute currentAttribute = (UserAttribute) attrIter.next();
                linkedUserAttributes.add(new UserAttributeRefImpl(currentAttribute));
            }
        }
        return linkedUserAttributes;
    }
View Full Code Here

        app.addDisplayName(Locale.FRENCH.toString()).setDisplayName("Display Name: Le fromage est dans mon pantalon!");

        UserAttributeRef uaRef = app.addUserAttributeRef("user-name-family");
        uaRef.setNameLink("user.name.family");

        UserAttribute ua = app.addUserAttribute("user.name.family");
        ua.addDescription(lang).setDescription("User Last Name");

//        app.addJetspeedServiceReference("PortletEntityAccessComponent");
        app.addJetspeedServiceReference("PortletRegistryComponent");

        addDublinCore(app.getMetadata());
View Full Code Here

        app.addDisplayName(Locale.FRENCH.toString()).setDisplayName("Display Name: Le fromage est dans mon pantalon!");
       
        UserAttributeRef uaRef = app.addUserAttributeRef("user-name-family");
        uaRef.setNameLink("user.name.family");

        UserAttribute ua = app.addUserAttribute("user.name.family");
        ua.addDescription(lang).setDescription("User Last Name");

        app.addJetspeedServiceReference("PortletEntityAccessComponent");
        app.addJetspeedServiceReference("PortletRegistryComponent");
       
        addDublinCore(app.getMetadata());
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.portlet.UserAttribute

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.