예제 #1
0
  /**
   * 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;
  }
예제 #2
0
파일: Vo.java 프로젝트: zlamalp/perun-wui
 /**
  * Get shortName of VO
  *
  * @return shortName of VO
  */
 public final String getShortName() {
   return JsUtils.getNativePropertyString(this, "shortName");
 }
예제 #3
0
 /**
  * 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");
 }
예제 #4
0
 /**
  * Get form item's ID.
  *
  * @return ID of object
  */
 public final int getId() {
   return JsUtils.getNativePropertyInt(this, "id");
 }
예제 #5
0
  /**
   * 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");
  }
예제 #6
0
 /**
  * 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");
 }
예제 #7
0
 /**
  * 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");
 }
예제 #8
0
 /**
  * Get ordering number used when sorting form items on form.
  *
  * @return Ordering number.
  */
 public final int getOrdnum() {
   return JsUtils.getNativePropertyInt(this, "ordnum");
 }
예제 #9
0
 /**
  * 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");
 }
예제 #10
0
 /**
  * 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");
 }
예제 #11
0
 /**
  * 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");
 }
예제 #12
0
 /**
  * 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"));
 }