Examples of PortletPublishingDefinition


Examples of org.jasig.portal.portletpublishing.xml.PortletPublishingDefinition

        Map<IPortletType, PortletPublishingDefinition> portletDefinitions = new HashMap<>();

        IPortletType someType = new PortletTypeImpl("someType", "someUri");
        IPortletType someOtherType = new PortletTypeImpl("someOtherType", "someOtherUri");

        PortletPublishingDefinition someDefinition = new PortletPublishingDefinition();
        PortletPublishingDefinition someOtherDefinition = new PortletPublishingDefinition();

        portletDefinitions.put(someType, someDefinition);
        portletDefinitions.put(someOtherType, someOtherDefinition);

        PortletDefinitionForm form = new PortletDefinitionForm();
View Full Code Here

Examples of org.jasig.portal.portletpublishing.xml.PortletPublishingDefinition

        final List<IPortletType> channelTypes = this.portletTypeRegistry.getPortletTypes();
       
        final Map<IPortletType, PortletPublishingDefinition> cpds = new LinkedHashMap<IPortletType, PortletPublishingDefinition>(channelTypes.size());
       
        for (final IPortletType channelType : channelTypes) {
            final PortletPublishingDefinition cpd = this.getChannelPublishingDefinition(channelType.getId());
            cpds.put(channelType, cpd);
        }
       
        return cpds;
    }
View Full Code Here

Examples of org.jasig.portal.portletpublishing.xml.PortletPublishingDefinition

        else {
            cpdUri = CUSTOM_CPD_PATH;
        }
       
        // read and parse the CPD
        final PortletPublishingDefinition def;
        final Resource cpdResource = this.resourceLoader.getResource("classpath:" + cpdUri);
        if (!cpdResource.exists()) {
            throw new MissingResourceException("Failed to find CPD '" + cpdUri + "' for channel type " + channelTypeId, this.getClass().getName(), cpdUri);
        }
       
        final InputStream cpdStream;
        try {
            cpdStream = cpdResource.getInputStream();
        }
        catch (IOException e) {
            throw new MissingResourceException("Failed to load CPD '" + cpdUri + "' for channel type " + channelTypeId, this.getClass().getName(), cpdUri);
        }
       
        try {
            def = (PortletPublishingDefinition) this.unmarshaller.unmarshal(cpdStream);
            final List<Step> sharedParameters = this.getSharedParameters();
            def.getSteps().addAll(sharedParameters);
            // add the CPD to the cache and return it
            this.cpdCache.put(channelTypeId, def);
           
            return def;
        } catch (JAXBException e) {
View Full Code Here

Examples of org.jasig.portal.portletpublishing.xml.PortletPublishingDefinition

            throw new MissingResourceException("Failed to load CPD '" + SHARED_PARAMETERS_PATH + "'", this.getClass().getName(), SHARED_PARAMETERS_PATH);
        }
       
        // parse the shared CPD and add its steps to the end of the type-specific
        try {
            PortletPublishingDefinition config = (PortletPublishingDefinition) unmarshaller.unmarshal(paramStream);
            this.sharedParameters = config.getSteps();
        } catch (JAXBException e) {
            logger.warn("Failed to parse: " + paramResource, e);
        }
        finally {
            IOUtils.closeQuietly(paramStream);
View Full Code Here

Examples of org.jasig.portal.portletpublishing.xml.PortletPublishingDefinition

        }

        if (form.isNew() || portletDefinitionRegistry.getPortletDefinition(form.getId()).getType().getId() != form.getTypeId()) {
            // User must have access to the selected CPD if s/he selected it in this interaction
            final int selectedTypeId = form.getTypeId();
            final PortletPublishingDefinition cpd = portletPublishingDefinitionDao.getChannelPublishingDefinition(selectedTypeId);
            final Map<IPortletType, PortletPublishingDefinition> allowableCpds = this.getAllowableChannelPublishingDefinitions(publisher);
            if (!allowableCpds.containsValue(cpd)) {
                logger.warn("User '" + publisher.getUserName() +
                        "' attempted to administer the following portlet without the selected " +
                        IPermission.PORTLET_MANAGER_SELECT_PORTLET_TYPE + " permission:  " + form);
View Full Code Here

Examples of org.jasig.portal.portletpublishing.xml.PortletPublishingDefinition

   * @param form
   * @return
   */
  public Set<String> getArbitraryPortletPreferenceNames(PortletDefinitionForm form) {
    // set default values for all portlet parameters
    PortletPublishingDefinition cpd = this.portletPublishingDefinitionDao.getChannelPublishingDefinition(form.getTypeId());
    Set<String> currentPrefs = new HashSet<String>();
    currentPrefs.addAll(form.getPortletPreferences().keySet());
    for (Step step : cpd.getSteps()) {
      if (step.getPreferences() != null) {
        for (Preference pref : step.getPreferences()) {
          currentPrefs.remove(pref.getName());
        }
      }
View Full Code Here

Examples of org.jasig.portal.portletpublishing.xml.PortletPublishingDefinition

                }
            }
        }

        //Add all of the parameter and preference names that have default values in the CPD into the valid name sets
        final PortletPublishingDefinition cpd = this.portletPublishingDefinitionDao.getChannelPublishingDefinition(form.getTypeId());
        for (final Step step : cpd.getSteps()) {
            final List<Parameter> parameters = step.getParameters();
            if (parameters != null) {
                for (final Parameter parameter : parameters) {
                    final JAXBElement<? extends ParameterInputType> parameterInput = parameter.getParameterInput();
                    if (parameterInput != null) {
View Full Code Here

Examples of org.jasig.portal.portletpublishing.xml.PortletPublishingDefinition

    if (portletDefinitions.size() != 1) {
      return null;
    }
    IPortletType portletType = portletDefinitions.keySet().iterator().next();
    form.setTypeId(portletType.getId());
    PortletPublishingDefinition cpd = portletPublishingDefinitionDao.getChannelPublishingDefinition(portletType.getId());
    form.setChannelPublishingDefinition(cpd);
   
    return cpd;
  }
View Full Code Here

Examples of org.jasig.portal.portletpublishing.xml.PortletPublishingDefinition

    return cpd;
  }
 
  public boolean offerPortletSelection(PortletDefinitionForm form) {
    final IPortletType portletType = this.portletTypeRegistry.getPortletType(form.getTypeId());
    final PortletPublishingDefinition portletPublishingDefinition = this.portletPublishingDefinitionDao.getChannelPublishingDefinition(portletType.getId());
    final PortletDescriptor portletDescriptor = portletPublishingDefinition.getPortletDescriptor();
    if (portletDescriptor == null) {
        return true;
    }
   
    final Boolean isFramework = portletDescriptor.isIsFramework();
View Full Code Here

Examples of org.jasig.portal.portletpublishing.xml.PortletPublishingDefinition

                context.addMessage(new MessageBuilder().error().source("typeId")
                    .code("please.choose.portlet.type").build());
                break;
            default:
                // User specified a typeId;  validate that it exists
                final PortletPublishingDefinition cpd = channelPublishingDefinitionDao.getChannelPublishingDefinition(selectedTypeId);
                if (cpd == null) {
                    context.addMessage(new MessageBuilder().error().source("typeId")
                            .code("please.choose.portlet.type").build());
                }
                break;
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.