Package org.olat.properties

Examples of org.olat.properties.Property


    setProperty(DELETE_EMAIL_DURATION_PROPERTY_NAME, deleteEmailDuration);
  }

  private void setProperty(String propertyName, int value) {
    List properties = PropertyManager.getInstance().findProperties(null, null, null, PROPERTY_CATEGORY, propertyName);
    Property property = null;
    if (properties.size() == 0) {
      property = PropertyManager.getInstance().createPropertyInstance(null, null, null, PROPERTY_CATEGORY, propertyName, null,  new Long(value), null, null);
    } else {
      property = (Property)properties.get(0);
      property.setLongValue( new Long(value) );
    }
    PropertyManager.getInstance().saveProperty(property);
  }
View Full Code Here


   * @param ident The current Subject
   */
  public void loadStatusFormData(StatusForm statusForm, CourseNode node, UserCourseEnvironment userCourseEnv) {
    Identity identity = userCourseEnv.getIdentityEnvironment().getIdentity();
    CoursePropertyManager cpm = userCourseEnv.getCourseEnvironment().getCoursePropertyManager();
    Property statusProperty;

    statusProperty = cpm.findCourseNodeProperty(node, identity, null, PROPERTY_KEY_STATUS);
    if (statusProperty == null) {
      // found no status property => init DEFAULT value
      statusForm.setSelectedStatus(StatusForm.STATUS_VALUE_INITIAL);
    } else {
      String value = statusProperty.getStringValue();
      statusForm.setSelectedStatus(value);
    }

  }
View Full Code Here

  public void saveStatusFormData(StatusForm statusForm, CourseNode node, UserCourseEnvironment userCourseEnv) {
    Identity identity = userCourseEnv.getIdentityEnvironment().getIdentity();
    String selectedKey = statusForm.getSelectedStatus();
   
    CoursePropertyManager cpm = userCourseEnv.getCourseEnvironment().getCoursePropertyManager();
    Property statusProperty;

    statusProperty = cpm.findCourseNodeProperty(node, identity, null, PROPERTY_KEY_STATUS);
    if (statusProperty == null) {
      statusProperty = cpm.createCourseNodePropertyInstance(node, identity, null, PROPERTY_KEY_STATUS, null, null,selectedKey, null);
      cpm.saveProperty(statusProperty);
    } else {
      statusProperty.setStringValue(selectedKey);
      cpm.updateProperty(statusProperty);
    }   
  }
View Full Code Here

  @Override
  public void event(UserRequest ureq, Controller source, Event event) {
    if (source == propertiesCtr) {
      if (event.getCommand().equals("PropFound")){
        PropFoundEvent foundEvent = (PropFoundEvent) event;
        Property myfoundProperty = foundEvent.getProperty();       
        this.showInfo(NLS_FOUND_PROPERTY,myfoundProperty.getKey().toString());               
      }
    } else if (source == pwdCtr) {
      if (event == Event.DONE_EVENT) {
        // rebuild authentication tab, could be wrong now
        if (authenticationsCtr != null) authenticationsCtr.rebuildAuthenticationsTableDataModel();
View Full Code Here

   
    CoordinatorManager.getCoordinator().getSyncer().doInSync(ores, new SyncerExecutor(){

      public void execute() {
        PropertyManager pm = PropertyManager.getInstance();
        Property p = pm.findProperty(null, null, null, "_o3_", INFO_MSG);
        if (p == null) {
          p =  pm.createPropertyInstance(null,  null,  null,  "_o3_", INFO_MSG, null, null, null, "");
          pm.saveProperty(p);
        }
        p.setTextValue(message);
        //set Message in RAM
        InfoMessageManager.infoMessage = message;
        pm.updateProperty(p);
      }
     
View Full Code Here

   
    return CoordinatorManager.getCoordinator().getSyncer().doInSync(ores, new SyncerCallback<Property>() {
   
      public Property execute() {
      PropertyManager pm = PropertyManager.getInstance();
      Property p = pm.findProperty(null, null, null, "_o3_", key);
      if (p == null) {
        p =  pm.createPropertyInstance(null,  null,  null,  "_o3_", key, null, null, null, "");
        pm.saveProperty(p);
      }
      return p;
View Full Code Here

   * set info message on node level only, no need to sync
   * @param message
   */
  public void setInfoMessageNodeOnly(String message) {
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.findProperty(null, null, null, "_o3_", INFO_MSG_NODE_ONLY+nodeId);
    if (p == null) {
      p =  pm.createPropertyInstance(null,  null,  null,  "_o3_", INFO_MSG_NODE_ONLY+nodeId, null, null, null, "");
      pm.saveProperty(p);
    }
    p.setTextValue(message);
    //set Message in RAM
    InfoMessageManager.infoMessageNodeOnly = message;
    pm.updateProperty(p);
  }
View Full Code Here

  public Property createAndPersistDisplayMembers(boolean showOwners, boolean showPartips, boolean showWaitingList) {
    long showXXX = 0;
    if (showOwners) showXXX += showOwnersVal;
    if (showPartips) showXXX += showPartipsVal;
    if (showWaitingList) showXXX += showWaitingListVal;
    Property prop = npm.createPropertyInstance(null, this.businessGroup, PropertyConstants.OLATRESOURCE_CONFIGURATION, PROP_NAME, null,
        new Long(showXXX), null, null);
    npm.saveProperty(prop);
    this.myProperty = prop;
    return prop;
  }
View Full Code Here

  /**
   * @return The group property. Either red from database or newly created.
   */
  private Property findProperty() {
    Property prop = npm.findProperty(null, businessGroup, PropertyConstants.OLATRESOURCE_CONFIGURATION, PROP_NAME);
    // prop != null, otherwise the init of this businessGroup was incomplete
    // or the caller uses the function in the wrong way
    //
    // BugFix 986, http://bugzilla.olat.org/show_bug.cgi?id=986
    // above statement is still true, but as old groups are existing, which
View Full Code Here

  }

  private Quota initDefaultQuota(String quotaIdentifier) {
    Quota q = null;
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.findProperty(null, null, quotaResource, QUOTA_CATEGORY, quotaIdentifier);
    if (p != null) q = parseQuota(p);
    if (q != null) return q;
    // initialize default quota
    q = createQuota(quotaIdentifier, new Long(FolderConfig.getDefaultQuotaKB()), new Long(FolderConfig.getLimitULKB()));
    setCustomQuotaKB(q);
View Full Code Here

TOP

Related Classes of org.olat.properties.Property

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.