public static Map<String, String> getExtensionPropertiesMap() {
   PropertySet ps = getPS();
   Map<String, String> dBMap = new HashMap<String, String>();
   List<String> keys = (List<String>) ps.getKeys();
   for (String key : keys) {
     if (key.endsWith("_ext")) {
       dBMap.put(key, ps.getString(key));
     }
   }
   return dBMap;
 }
 public static Map<String, String> getInputPropertiesMap() {
   PropertySet ps = getPS();
   Map<String, String> dBMap = new HashMap<String, String>();
   List<String> keys = (List<String>) ps.getKeys();
   for (String key : keys) {
     if (!key.endsWith("_ext")) {
       dBMap.put(key, ps.getString(key));
     }
   }
   dBMap.remove("reIndexInputValues"); // Patch redendance
   return dBMap;
 }
Esempio n. 3
0
  public Map getProperties(InfoGluePrincipal userPrincipal, long workflowId) {
    if (logger.isDebugEnabled()) {
      logger.info("userPrincipal:" + userPrincipal);
      logger.info("workflowId:" + workflowId);
    }

    Map parameters = new HashMap();

    Session session = null;
    net.sf.hibernate.Transaction tx = null;

    try {
      session = hibernateSessionFactory.openSession();
      tx = session.beginTransaction();

      PropertySet propertySet = getPropertySet(userPrincipal, workflowId, session);
      for (Iterator keys = propertySet.getKeys().iterator(); keys.hasNext(); ) {
        String key = (String) keys.next();
        parameters.put(key, propertySet.getString(key));
      }

      session.flush();

      tx.commit();
    } catch (Exception e) {
      logger.error("An error occurred when we tries to run getHistorySteps():" + e.getMessage(), e);
      try {
        tx.rollback();
      } catch (HibernateException he) {
        logger.error(
            "An error occurred when we tries to rollback transaction:" + he.getMessage(), he);
      }
      restoreSessionFactory(e);
    } finally {
      try {
        session.close();
      } catch (HibernateException e) {
        logger.error("An error occurred when we tries to close session:" + e.getMessage(), e);
      }
    }

    return parameters;
  }
Esempio n. 4
0
  /** This method retrieves a user's meta properties */
  protected void retrieveUserMetaProperties() {
    userProperties = new HashMap<String, String>();

    User user = getUser();
    if (user != null) {
      PropertySet userPropertySet = userPropertyManager.getPropertySet(user);

      @SuppressWarnings("unchecked")
      Collection<String> keys = userPropertySet.getKeys(PropertySet.STRING);
      if (keys != null) {
        for (String key : keys) {
          if (key.startsWith(UserUtil.META_PROPERTY_PREFIX)) {
            userProperties.put(
                key.substring(UserUtil.META_PROPERTY_PREFIX.length()),
                userPropertySet.getString(key));
          }
        }
      }
    }
  }
  public Map<String, String> convertUserPrefs(final PropertySet propertySet) {
    @SuppressWarnings("unchecked")
    final Collection<String> keys = propertySet.getKeys();
    final Map<String, String> ret = new LinkedHashMap<String, String>();
    for (String key : keys) {
      final int type = propertySet.getType(key);
      String value;
      if (type == PropertySet.STRING) {
        value = propertySet.getString(key);
      } else {
        // if the value wasn't a string (very unlikely with portletconfigs) then call the toString()
        // method
        // on the object returned.
        final Object o = propertySet.getAsActualType(key);
        value = o == null ? null : o.toString();
      }

      if (value != null && value.contains(PORTLET_MULTI_VALUE_SEPARATOR)) {
        value = convertMultiSelectValue(value);
      }
      ret.put(key, value);
    }
    return ret;
  }
 public Collection getKeys(String s) throws PropertyException {
   return ps.getKeys(s);
 }
 public Collection getKeys(int i) throws PropertyException {
   return ps.getKeys(i);
 }