/**
   * Get list of application types this form item is used on.
   *
   * @see cz.metacentrum.perun.wui.model.beans.Application.ApplicationType
   * @return List of application types.
   */
  public final ArrayList<Application.ApplicationType> getApplicationTypes() {

    // TODO - check if it works
    List<String> list =
        JsUtils.listFromJsArrayString(
            JsUtils.getNativePropertyArrayString(this, "applicationTypes"));
    ArrayList<Application.ApplicationType> result = new ArrayList<Application.ApplicationType>();
    for (String s : list) {
      result.add(Application.ApplicationType.valueOf(s));
    }
    return result;
  }
Beispiel #2
0
 /**
  * Get shortName of VO
  *
  * @return shortName of VO
  */
 public final String getShortName() {
   return JsUtils.getNativePropertyString(this, "shortName");
 }
 /**
  * Return TRUE if item is required, FALSE otherwise.
  *
  * <p>User CAN'T submit form item with empty value if is required with exception of non-editable
  * or invisible items.
  *
  * @return TRUE = item is required / FALSE = item is optional
  */
 public final boolean isRequired() {
   return JsUtils.getNativePropertyBoolean(this, "required");
 }
 /**
  * Get form item's ID.
  *
  * @return ID of object
  */
 public final int getId() {
   return JsUtils.getNativePropertyInt(this, "id");
 }
  /**
   * Get object's type, equals to Class.getSimpleName(). Value is stored to object on server side
   * and only for PerunBeans object.
   *
   * <p>If value not present in object, "JavaScriptObject" is returned instead.
   *
   * @return type of object
   */
  public final String getObjectType() {

    if (JsUtils.getNativePropertyString(this, "beanName") == null) return "JavaScriptObject";
    return JsUtils.getNativePropertyString(this, "beanName");
  }
 /**
  * Return TRUE if item was edited (configuration change). FALSE otherwise.
  *
  * <p>IMPORTANT: This property is used only in GUI. Do not send it to the Perun server as part of
  * object.
  *
  * @return TRUE = edited / FALSE = not edited
  */
 public final boolean isEdited() {
   return JsUtils.getNativePropertyBoolean(this, "edited");
 }
 /**
  * Return TRUE if item was marked for deletion. FALSE otherwise.
  *
  * @return TRUE = marked for delete / FALSE = not marked for delete.
  */
 public final boolean isForDelete() {
   return JsUtils.getNativePropertyBoolean(this, "forDelete");
 }
 /**
  * Get ordering number used when sorting form items on form.
  *
  * @return Ordering number.
  */
 public final int getOrdnum() {
   return JsUtils.getNativePropertyInt(this, "ordnum");
 }
 /**
  * Get regular expression used to validate user input for this form item.
  *
  * <p>IMPORTANT: Validation is performed in Javascript, so regex must conform it.
  *
  * @return Regular expression used to validate input.
  */
 public final String getRegex() {
   return JsUtils.getNativePropertyString(this, "regex");
 }
 /**
  * Get name of IdP federation attribute this form item is linked to.
  *
  * <p>Value from attribute (if provided by IDP) is pushed to form item on item retrieval.
  *
  * @return Name of IdP federation attribute.
  */
 public final String getFederationAttribute() {
   return JsUtils.getNativePropertyString(this, "federationAttribute");
 }
 /**
  * Get URN of Attribute definition this form item is linked to.
  *
  * <p>Vale from form item is stored to attribute on application approval. Value from attribute is
  * pushed to form item on item retrieval.
  *
  * @see AttributeDefinition#getURN()
  * @return URN of linked attribute definition
  */
 public final String getPerunAttribute() {
   return JsUtils.getNativePropertyString(this, "perunDestinationAttribute");
 }
 /**
  * Get type of form item. Type defines used widget when drawing the item and editable and visible
  * state.
  *
  * @see ApplicationFormItemType
  * @return Type of form item.
  */
 public final ApplicationFormItemType getType() {
   return ApplicationFormItemType.valueOf(JsUtils.getNativePropertyString(this, "type"));
 }