Examples of findProperty()


Examples of org.olat.properties.PropertyManager.findProperty()

  public void setCustomQuotaKB(Quota quota) {
    if (defaultQuotas == null) {
      throw new OLATRuntimeException(QuotaManagerImpl.class, "Quota manager has not been initialized properly! Must call init() first.", null);
    }
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.findProperty(null, null, quotaResource, QUOTA_CATEGORY, quota.getPath());
    if (p == null) { // create new entry
      p = pm.createPropertyInstance(null, null, quotaResource, QUOTA_CATEGORY, quota.getPath(), null, null, assembleQuota(quota), null);
      pm.saveProperty(p);
    } else {
      p.setStringValue(assembleQuota(quota));
View Full Code Here

Examples of org.olat.properties.PropertyManager.findProperty()

    // do not allow to delete default quotas!
    if (quota.getPath().startsWith(QuotaConstants.IDENTIFIER_DEFAULT)) {
      return false;
    }
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.findProperty(null, null, quotaResource, QUOTA_CATEGORY, quota.getPath());
    if (p != null) pm.deleteProperty(p);
    return true;
  }

  /**
 
View Full Code Here

Examples of org.olat.properties.PropertyManager.findProperty()

  }
 
  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

Examples of org.olat.properties.PropertyManager.findProperty()

          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

Examples of org.olat.properties.PropertyManager.findProperty()

  }
 
  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);
   
View Full Code Here

Examples of org.olat.properties.PropertyManager.findProperty()

    } 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 {
View Full Code Here

Examples of org.olat.properties.PropertyManager.findProperty()

      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

Examples of org.olat.properties.PropertyManager.findProperty()

  }
 
  private static void destroyIcalAuthToken(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);
   
    // return the string value of the property
    pm.deleteProperty(tokenProperty);
  }
View Full Code Here

Examples of org.olat.properties.PropertyManager.findProperty()

      OLATResourceable resourceable = getResourceable(calendarType, calendarID);
      NarrowedPropertyManager npm = NarrowedPropertyManager.getInstance(resourceable);
      tokenProperty = npm.findProperty(identity, null, PROP_CAT_ICALTOKEN, PROP_NAME_ICALTOKEN);
    } else {
      PropertyManager pm = PropertyManager.getInstance();
      tokenProperty = pm.findProperty(identity, null, null, PROP_CAT_ICALTOKEN, PROP_NAME_ICALTOKEN);
    }
    return tokenProperty != null;
   }
}
View Full Code Here

Examples of org.olat.properties.PropertyManager.findProperty()

  }

  @Override
  public long getLastUpdated() {
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.findProperty(null, null, null, STATISTICS_PROPERTIES_CATEGORY, LAST_UPDATED_PROPERTY_NAME);
    if (p==null) {
      return -1;
    } else {
      return p.getLongValue();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.