Examples of DisplayName


Examples of com.github.sardine.model.Displayname

  {
    HttpPropFind entity = new HttpPropFind(url);
    entity.setDepth("1");
    Propfind body = new Propfind();
    Prop prop = new Prop();
    prop.setDisplayname(new Displayname());
    prop.setResourcetype(new Resourcetype());
    prop.setPrincipalURL(new PrincipalURL());
    body.setProp(prop);
    entity.setEntity(new StringEntity(SardineUtil.toXml(body), UTF_8));
    Multistatus multistatus = this.execute(entity, new MultiStatusResponseHandler());
View Full Code Here

Examples of com.github.sardine.model.Displayname

      return null;
    }
    for (Propstat propstat : list)
    {
      if (propstat.getProp() != null) {
        Displayname dn = propstat.getProp().getDisplayname();
        if ((dn != null) && (dn.getContent().size() == 1))
        {
          return dn.getContent().get(0);
        }
      }
    }
    return null;
  }
View Full Code Here

Examples of com.googlecode.sardine.model.Displayname

  {
    HttpPropFind entity = new HttpPropFind(url);
    entity.setDepth("1");
    Propfind body = new Propfind();
    Prop prop = new Prop();
    prop.setDisplayname(new Displayname());
    prop.setResourcetype(new Resourcetype());
    prop.setPrincipalURL(new PrincipalURL());
    body.setProp(prop);
    entity.setEntity(new StringEntity(SardineUtil.toXml(body), UTF_8));
    Multistatus multistatus = this.execute(entity, new MultiStatusResponseHandler());
View Full Code Here

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

                    PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
                    PortletDefinition def = app.getPortlet(paNodeBean.getName());
                   
                    for (Iterator<DisplayName> it = def.getDisplayNames().iterator(); it.hasNext(); )
                    {
                        DisplayName displayName = it.next();
                       
                        for (IModel<DisplayNameBean> displayNameBeanModel : fields)
                        {
                            if (displayNameBeanModel.getObject().getLocale().equals(displayName.getLocale()))
                            {
                                it.remove();
                                break;
                            }
                        }
                    }
                   
                    registry.savePortletDefinition(def);
                    StringResourceModel resModel = new StringResourceModel("pam.details.action.status.portlet.saveOK", this, null, new Object [] { paNodeBean.getName() } );
                    feed.info(resModel.getString());
                }
                catch (FailedToStorePortletDefinitionException e)
                {
                    logger.error("Failed to save portlet definition.", e);
                    StringResourceModel resModel = new StringResourceModel("pam.details.action.status.portlet.saveFailure", this, null, new Object [] { paNodeBean.getName(), e.getMessage() } );
                    feed.info(resModel.getString());
                }
            }

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

                    @Override
                    public void onSubmit()
                    {
                        PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                        PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
                        PortletDefinition def = app.getPortlet(paNodeBean.getName());
                       
                        if (newLocale != null && newDisplayName != null)
                        {
                            Locale locale = new Locale(newLocale);
                            DisplayName targetDisplayName = null;
                           
                            for (DisplayName displayName : def.getDisplayNames())
                            {
                                if (displayName.getLocale().equals(locale))
                                {
                                    targetDisplayName = displayName;
                                    break;
                                }
                            }
                           
                            if (targetDisplayName == null)
                            {
                                targetDisplayName = def.addDisplayName(newLocale);
                            }
                           
                            targetDisplayName.setDisplayName(newDisplayName);
                           
                            newLocale = null;
                            newDisplayName = null;
                        }
View Full Code Here

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

       
    public PortletDefinitionBean(PortletDefinition portlet, String appName, Locale locale)
    {
        super(appName, portlet.getPortletName());
        this.uniqueName = portlet.getUniqueName();
        DisplayName dn = portlet.getDisplayName(locale);
        if (dn == null)
            this.displayName = this.name;
        else
            this.displayName = dn.getDisplayName();
    }
View Full Code Here

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

    @Override
    protected DisplayNameBean load()
    {
        PortletApplication app = locator.getPortletRegistry().getPortletApplication(paNodeBean.getApplicationName());
        PortletDefinition def = app.getPortlet(paNodeBean.getName());
        DisplayName displayName = def.getDisplayName(locale);
        return new DisplayNameBean(displayName);
    }
View Full Code Here

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

        return desc != null ? desc.getDescription() : null;
    }
   
    public String getDisplayNameText(Locale locale)
    {
        DisplayName dn = getDisplayName(locale);
        return dn != null ? dn.getDisplayName() : null;
    }
View Full Code Here

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

        // create new portlet in source portlet application
        PortletDefinition copy = source.getApplication().addPortlet(newPortletName);
       
        // First set display name
       
        DisplayName displayName = copy.addDisplayName(JetspeedLocale.getDefaultLocale().getLanguage());
        displayName.setDisplayName(newPortletName);
       
        // And, then, copy all attributes
       
        copy.setPortletClass(source.getPortletClass());
        copy.setResourceBundle(source.getResourceBundle());
View Full Code Here

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

                    PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
                    PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                   
                    for (Iterator<DisplayName> it = def.getDisplayNames().iterator(); it.hasNext(); )
                    {
                        DisplayName displayName = it.next();
                       
                        for (IModel<DisplayNameBean> displayNameBeanModel : fields)
                        {
                            if (displayNameBeanModel.getObject().getLocale().equals(displayName.getLocale()))
                            {
                                it.remove();
                                break;
                            }
                        }
                    }
                   
                    registry.savePortletDefinition(def);
                    StringResourceModel resModel = new StringResourceModel("pam.details.action.status.portlet.saveOK", this, null, new Object [] { paNodeBean.getName() } );
                    feed.info(resModel.getString());
                }
                catch (FailedToStorePortletDefinitionException e)
                {
                    logger.error("Failed to save portlet definition.", e);
                    StringResourceModel resModel = new StringResourceModel("pam.details.action.status.portlet.saveFailure", this, null, new Object [] { paNodeBean.getName(), e.getMessage() } );
                    feed.info(resModel.getString());
                }
            }

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

                    @Override
                    public void onSubmit()
                    {
                        PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                        PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
                        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                       
                        if (newLocale != null && newDisplayName != null)
                        {
                            Locale locale = new Locale(newLocale);
                            DisplayName targetDisplayName = null;
                           
                            for (DisplayName displayName : def.getDisplayNames())
                            {
                                if (displayName.getLocale().equals(locale))
                                {
                                    targetDisplayName = displayName;
                                    break;
                                }
                            }
                           
                            if (targetDisplayName == null)
                            {
                                targetDisplayName = def.addDisplayName(newLocale);
                            }
                           
                            targetDisplayName.setDisplayName(newDisplayName);
                           
                            newLocale = null;
                            newDisplayName = null;
                        }
View Full Code Here

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

       
    public PortletDefinitionBean(PortletDefinition portlet, String appName, Locale locale)
    {
        super(appName, portlet.getPortletName());
        this.uniqueName = portlet.getUniqueName();
        DisplayName dn = portlet.getDisplayName(locale);
       
        if (dn == null)
        {
            this.displayName = this.name;
        }
        else
        {
            this.displayName = dn.getDisplayName();
        }
       
        this.cloned = portlet.isClone();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.