Example #1
0
  /**
   * Returns a XML for displaying attribute in property sheet.
   *
   * @param serviceSchema Service schemas.
   * @param model Model for getting localized string and user locale.
   * @throws SMSException if attribute schema cannot obtained.
   * @throws SSOException if single sign on token is invalid.
   */
  public PropertyXMLBuilder(ServiceSchema serviceSchema, AMModel model)
      throws SMSException, SSOException {
    this.model = model;
    this.serviceName = serviceSchema.getServiceName();
    getServiceResourceBundle(serviceSchema);

    if (serviceBundle != null) {
      mapTypeToAttributeSchema = new HashMap();
      mapTypeToAttributeSchema.put(
          serviceSchema.getServiceType(), serviceSchema.getAttributeSchemas());
    }
  }
Example #2
0
  private Set getAttributeSchemas(SchemaType type) throws SMSException {
    Set results = null;
    ServiceSchema schema = svcSchemaManager.getSchema(type);

    if (schema != null) {
      Set attributes = schema.getAttributeSchemas();

      if ((attributes != null) && !attributes.isEmpty()) {
        results = new HashSet(attributes.size() * 2);
        for (Iterator iter = attributes.iterator(); iter.hasNext(); ) {
          AttributeSchema as = (AttributeSchema) iter.next();
          String i18nKey = as.getI18NKey();

          if ((i18nKey != null) && (i18nKey.trim().length() > 0)) {
            results.add(as);
          }
        }
      }
    }

    return results;
  }