Package org.apache.sling.jcr.contentloader.internal.readers

Examples of org.apache.sling.jcr.contentloader.internal.readers.XmlReader$PropertyDescription


    * @since 2.6
    */
   public static PropertyDescription convertToPropertyDescription(RegistrationPropertyDescription propertyDescription)
   {
      ParameterValidation.throwIllegalArgExceptionIfNull(propertyDescription, "RegistrationPropertyDescription");
      PropertyDescription propDesc = WSRPTypeFactory.createPropertyDescription(propertyDescription.getName().toString(),
         propertyDescription.getType());

      // todo: deal with languages properly!!
      LocalizedString hint = propertyDescription.getHint();
      if (hint != null)
      {
         propDesc.setHint(convertToWSRPLocalizedString(hint));
      }
      LocalizedString label = propertyDescription.getLabel();
      if (label != null)
      {
         propDesc.setLabel(convertToWSRPLocalizedString(label));
      }
      return propDesc;
   }
View Full Code Here


               {
                  //todo: check what we should use key
                  //todo: right now we only support String properties
                  List<String> desiredLocales = getPortletPropertyDescription.getDesiredLocales();
                  desiredLocales = WSRPUtils.replaceByEmptyListIfNeeded(desiredLocales);
                  PropertyDescription desc = WSRPTypeFactory.createPropertyDescription(prefInfo.getKey(), WSRPConstants.XSD_STRING);
                  desc.setLabel(Utils.convertToWSRPLocalizedString(prefInfo.getDisplayName(), desiredLocales));
                  desc.setHint(Utils.convertToWSRPLocalizedString(prefInfo.getDescription(), desiredLocales));
                  descs.add(desc);
               }
            }
         }
View Full Code Here

   {
      public PropertyDescription apply(V1PropertyDescription from)
      {
         if (from != null)
         {
            PropertyDescription result = WSRPTypeFactory.createPropertyDescription(from.getName(), from.getType());
            result.setHint(toV2LocalizedString(from.getHint()));
            result.setLabel(toV2LocalizedString(from.getLabel()));
            List<Extension> extensions = WSRPUtils.transform(from.getExtensions(), EXTENSION);
            if (extensions != null)
            {
               result.getExtensions().addAll(extensions);
            }

            return result;
         }
         else
View Full Code Here

   }

   public static PropertyDescription convertToPropertyDescription(RegistrationPropertyDescription propertyDescription)
   {
      ParameterValidation.throwIllegalArgExceptionIfNull(propertyDescription, "RegistrationPropertyDescription");
      PropertyDescription propDesc = WSRPTypeFactory.createPropertyDescription(propertyDescription.getName().toString(),
         propertyDescription.getType());

      // todo: deal with languages properly!!
      LocalizedString hint = propertyDescription.getHint();
      if (hint != null)
      {
         propDesc.setHint(convertToWSRPLocalizedString(hint));
      }
      LocalizedString label = propertyDescription.getLabel();
      if (label != null)
      {
         propDesc.setLabel(convertToWSRPLocalizedString(label));
      }
      return propDesc;
   }
View Full Code Here

   {
      // QName.valueOf(name) validates name
      QName qName = QName.valueOf(name);

      ParameterValidation.throwIllegalArgExceptionIfNull(type, "PropertyDescription type");
      PropertyDescription description = new PropertyDescription();
      description.setName(qName);
      description.setType(type);
      return description;
   }
View Full Code Here

               {
                  //todo: check what we should use key
                  //todo: right now we only support String properties
                  List<String> desiredLocales = getPortletPropertyDescription.getDesiredLocales();
                  desiredLocales = WSRPUtils.replaceByEmptyListIfNeeded(desiredLocales);
                  PropertyDescription desc = WSRPTypeFactory.createPropertyDescription(prefInfo.getKey(), WSRPConstants.XSD_STRING);
                  desc.setLabel(Utils.convertToWSRPLocalizedString(prefInfo.getDisplayName(), desiredLocales));
                  desc.setHint(Utils.convertToWSRPLocalizedString(prefInfo.getDescription(), desiredLocales));
                  descs.add(desc);
               }
            }
         }
View Full Code Here

   }

   public static PropertyDescription convertToPropertyDescription(RegistrationPropertyDescription propertyDescription)
   {
      ParameterValidation.throwIllegalArgExceptionIfNull(propertyDescription, "RegistrationPropertyDescription");
      PropertyDescription propDesc = WSRPTypeFactory.createPropertyDescription(propertyDescription.getName().toString(),
         propertyDescription.getType());

      // todo: deal with languages properly!!
      LocalizedString hint = propertyDescription.getHint();
      if (hint != null)
      {
         propDesc.setHint(convertToWSRPLocalizedString(hint));
      }
      LocalizedString label = propertyDescription.getLabel();
      if (label != null)
      {
         propDesc.setLabel(convertToWSRPLocalizedString(label));
      }
      return propDesc;
   }
View Full Code Here

   {
      // QName.valueOf(name) validates name
      QName qName = QName.valueOf(name);

      ParameterValidation.throwIllegalArgExceptionIfNull(type, "PropertyDescription type");
      PropertyDescription description = new PropertyDescription();
      description.setName(qName);
      description.setType(type);
      return description;
   }
View Full Code Here

   {
      // QName.valueOf(name) validates name
      QName qName = QName.valueOf(name);

      ParameterValidation.throwIllegalArgExceptionIfNull(type, "PropertyDescription type");
      PropertyDescription description = new PropertyDescription();
      description.setName(qName);
      description.setType(type);
      return description;
   }
View Full Code Here

   }

   public static PropertyDescription convertToPropertyDescription(RegistrationPropertyDescription propertyDescription)
   {
      ParameterValidation.throwIllegalArgExceptionIfNull(propertyDescription, "RegistrationPropertyDescription");
      PropertyDescription propDesc = WSRPTypeFactory.createPropertyDescription(propertyDescription.getName().toString(),
         propertyDescription.getType());

      // todo: deal with languages properly!!
      LocalizedString hint = propertyDescription.getHint();
      if (hint != null)
      {
         propDesc.setHint(convertToWSRPLocalizedString(hint));
      }
      LocalizedString label = propertyDescription.getLabel();
      if (label != null)
      {
         propDesc.setLabel(convertToWSRPLocalizedString(label));
      }
      return propDesc;
   }
View Full Code Here

TOP

Related Classes of org.apache.sling.jcr.contentloader.internal.readers.XmlReader$PropertyDescription

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.