Package org.olat.properties

Examples of org.olat.properties.PropertyManager


   * @param wControl
   * @param identity
   */
  public UserPropertiesController(UserRequest ureq, WindowControl wControl, Identity identity) {
    super(ureq, wControl);
    PropertyManager pm = PropertyManager.getInstance();
    List l = pm.listProperties(identity, null, null, null, null);
    TableGuiConfiguration tableConfig = new TableGuiConfiguration();
    tableConfig.setTableEmptyMessage(getTranslator().translate("error.no.props.found"));
    tableCtr = new TableController(tableConfig, ureq, getWindowControl(), getTranslator(), this);
    tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.prop.category", 0, null, ureq.getLocale()));
    tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.prop.grp", 1, null, ureq.getLocale()));
View Full Code Here


   * @param name
   */
  public AdvancedPropertySearchForm(UserRequest ureq, WindowControl wControl) {
    super(ureq, wControl);
   
    PropertyManager pm = PropertyManager.getInstance();
    List resourceTypeNames = pm.getAllResourceTypeNames();
    int size = resourceTypeNames.size();
    theKeys = new String[size+1];
    theValues = new String[size+1];
    theKeys[0] = "0";
    theValues[0] = null;
View Full Code Here

   *
   * @param courseExportPath
   * @param re
   */
  private void markAsDeployed(String courseExportPath, RepositoryEntry re) {
    PropertyManager pm = PropertyManager.getInstance();
    Property prop = pm.createPropertyInstance(null, null, null, "_o3_", "deployedCourses", null, re.getKey(), courseExportPath, null);
    pm.saveProperty(prop);
    deplyedCoursePaths.put(courseExportPath, re);
  }
View Full Code Here

   *
   * @return
   */
  private Map getDeployedCourses() {
    if (deplyedCoursePaths != null) return deplyedCoursePaths;
    PropertyManager pm = PropertyManager.getInstance();
    List props = pm.findProperties(null, null, null, "_o3_", "deployedCourses");
    deplyedCoursePaths = new HashMap(props.size());
    for (Iterator iter = props.iterator(); iter.hasNext();) {
      Property prop = (Property) iter.next();
      Long repoKey = prop.getLongValue();
      RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(repoKey);
View Full Code Here

  private static String createIcalAuthToken(Identity identity) {
    // generate the random alpha numeric token
    String token = RandomStringUtils.randomAlphabetic(6);
   
     // save token as a property of resourceable
    PropertyManager pm = PropertyManager.getInstance();
    Property tokenProperty = pm.createPropertyInstance(identity, null,
        null, PROP_CAT_ICALTOKEN, PROP_NAME_ICALTOKEN, null, null, token, null );
    pm.saveProperty(tokenProperty);
   
    //return the generated token
    return token;
  }
View Full Code Here

    return token;
  }
 
  private static String getIcalAuthToken(Identity identity, boolean create) {
    // find the property for the identity
    PropertyManager pm = PropertyManager.getInstance();
    Property tokenProperty = pm.findProperty(identity, null, null,
        PROP_CAT_ICALTOKEN, PROP_NAME_ICALTOKEN);
   
    String token;
    if (tokenProperty == null && create) {
      token = createIcalAuthToken(identity);
View Full Code Here

          items = new ArrayList<SubscriptionItem>();
          subsToUpdate = new ArrayList<Subscriber>();
          latestSub = sub;
          veto = false;
         
          PropertyManager pm = PropertyManager.getInstance();
          Property p = pm.findProperty(ident, null, null, null, LATEST_EMAIL_USER_PROP);
          if(p != null) {
            Date latestEmail = new Date(p.getLongValue());
            String userInterval = getUserIntervalOrDefault(ident);
            Date compareDate = getCompareDateFromInterval(userInterval);
            if(latestEmail.after(compareDate)) {
View Full Code Here

    return authToken;
  }
 
  private static String regenerateIcalAuthToken(Identity identity) {
    // find the property for the identity
    PropertyManager pm = PropertyManager.getInstance();
    Property tokenProperty = pm.findProperty(identity, null, null,
        PROP_CAT_ICALTOKEN, PROP_NAME_ICALTOKEN);
   
    //genearate the new token
    String authToken = RandomStringUtils.randomAlphanumeric(6);
   
    //set new auth token as the string value of the property
    tokenProperty.setStringValue(authToken);
   
    // update the property
    pm.updateProperty(tokenProperty);
   
    //return the new token
    return authToken;
  }
View Full Code Here

      }
    } else if (items.size() > 0) {
      Identity curIdent = latestSub.getIdentity();
      boolean sentOk = sendMailToUserAndUpdateSubscriber(curIdent, items, translator, subsToUpdate);
      if (sentOk) {
        PropertyManager pm = PropertyManager.getInstance();
        Property p = pm.findProperty(curIdent, null, null, null, LATEST_EMAIL_USER_PROP);
        if(p == null) {
          p = pm.createUserPropertyInstance(curIdent, null, LATEST_EMAIL_USER_PROP, null, null, null, null);
          p.setLongValue(new Date().getTime());
          pm.saveProperty(p);
        } else {
          p.setLongValue(new Date().getTime());
          pm.updateProperty(p);
        }

        mailLog.append(curIdent.getName()).append(' ')
          .append(items.size()).append(' ')
          .append((System.currentTimeMillis() - start)).append("ms, ");
View Full Code Here

          PROP_CAT_ICALTOKEN, PROP_NAME_ICALTOKEN);
      if (tokenProperty != null) {
        npm.deleteProperty(tokenProperty);
      }
    } else {
      PropertyManager pm = PropertyManager.getInstance();
      Property tokenProperty = pm.findProperty(identity, null, null,
          PROP_CAT_ICALTOKEN, PROP_NAME_ICALTOKEN);
      if (tokenProperty != null) {
        pm.deleteProperty(tokenProperty);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.olat.properties.PropertyManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.