Example #1
0
  /**
   * Returns the type of the property: object- or datatype, and whether it has restricted values,
   * and any cardinality constraints it might have. The first element in the array returns the range
   * type, the second a maximum cardinality constraint (0 if there is none)
   *
   * @param user User ID
   * @param anchor Unique ID of Anchor
   * @param property Property name
   * @param type Session type
   * @param key browsing session id (null if session type is EDIT)
   * @return Integer[] with property type.
   */
  public Integer[] getType(String user, String anchor, String property, int type, String key) {
    if (!userMap.containsKey(user)) return null;

    LiberSession session = userMap.get(user);
    Integer[] result = new Integer[2];
    synchronized (session) {
      session.setLastUpdated();
      result[0] = session.getReader().getRangeType(property);
      result[1] = new Integer(session.getMax(anchor, property, type, key));
    }

    return result;
  }