use of org.olat.properties.PropertyManager in project openolat by klemens.
the class CourseNodePasswordManagerImpl method deleteAllPasswordsFor.
/**
* @see de.bps.course.nodes.CourseNodePasswordManager#deleteAllPasswordsFor(java.lang.Long)
*/
public void deleteAllPasswordsFor(OLATResourceable ores) {
PropertyManager pm = PropertyManager.getInstance();
List<Property> properties = pm.listProperties(null, null, AdditionalConditionAnswerContainer.RESOURCE_NAME, null, null, AdditionalConditionAnswerContainer.RESOURCE_NAME, ores.getResourceableId(), null);
for (Property p : properties) {
Long nodeId = p.getResourceTypeId();
Long courseId = p.getLongValue();
removeAnswers(nodeId, courseId);
pm.deleteProperty(p);
}
}
use of org.olat.properties.PropertyManager in project openolat by klemens.
the class DBPersistentLockManager method releasePersistentLock.
/**
* @see org.olat.core.util.locks.PersistentLockManager#releasePersistentLock(org.olat.core.util.locks.LockEntry)
*/
@Override
public void releasePersistentLock(LockResult le) {
// synchronisation is solved in the LockManager
String derivedLockString = ((LockResultImpl) le).getLockEntry().getKey();
PropertyManager pm = PropertyManager.getInstance();
Property p = pm.findProperty(null, null, null, CATEGORY_PERSISTENTLOCK, derivedLockString);
if (p == null)
throw new AssertException("could not release lock: no lock in db, " + derivedLockString);
Identity ident = le.getOwner();
Long ownerKey = p.getLongValue();
if (!ownerKey.equals(ident.getKey()))
throw new AssertException("user " + ident.getName() + " cannot release lock belonging to user with key " + ownerKey + " on resourcestring " + derivedLockString);
pm.deleteProperty(p);
}
use of org.olat.properties.PropertyManager in project openolat by klemens.
the class StatisticUpdateManagerImpl method getAndUpdateLastUpdated.
@Override
public long getAndUpdateLastUpdated(long lastUpdated) {
PropertyManager pm = PropertyManager.getInstance();
Property p = pm.findProperty(null, null, null, STATISTICS_PROPERTIES_CATEGORY, LAST_UPDATED_PROPERTY_NAME);
if (p == null) {
Property newp = pm.createPropertyInstance(null, null, null, STATISTICS_PROPERTIES_CATEGORY, LAST_UPDATED_PROPERTY_NAME, null, lastUpdated, null, null);
pm.saveProperty(newp);
return -1;
} else {
final long result = p.getLongValue();
p.setLongValue(lastUpdated);
pm.saveProperty(p);
return result;
}
}
use of org.olat.properties.PropertyManager in project openolat by klemens.
the class StatisticUpdateManagerImpl method getLastUpdated.
@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();
}
}
use of org.olat.properties.PropertyManager in project openolat by klemens.
the class MessageListController method doExportForumItem.
private void doExportForumItem(UserRequest ureq, MessageView messageToMove) {
if (foCallback.mayEditMessageAsModerator()) {
StepRunnerCallback finish = new FinishCallback();
Translator trans = Util.createPackageTranslator(Step_1_SelectCourse.class, getLocale());
Step start = new Step_1_SelectCourse(ureq);
Message message = forumManager.getMessageById(messageToMove.getKey());
String wizardTitle = trans.translate("title.wizard.movethread", new String[] { message.getTitle() });
exportCtrl = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, wizardTitle, "o_sel_bulk_assessment_wizard");
StepsRunContext runContext = exportCtrl.getRunContext();
// can be threadtop message
runContext.put(SendMailStepForm.MESSAGE_TO_MOVE, message);
// starting thread
runContext.put(SendMailStepForm.START_THREADTOP, message.getThreadtop() == null ? message : message.getThreadtop());
// get start course
PropertyManager propertyManager = PropertyManager.getInstance();
Long forumResourceableId = forum.getResourceableId();
Property forumproperty = propertyManager.getPropertyByLongValue(forumResourceableId, FOCourseNode.FORUM_KEY);
if (forumproperty != null) {
Long resourcetypeId = forumproperty.getResourceTypeId();
String resourcetypeName = forumproperty.getResourceTypeName();
OLATResourceable olatResourceable = olatManager.findResourceable(resourcetypeId, resourcetypeName);
RepositoryEntry startCourse = repositoryManager.lookupRepositoryEntry(olatResourceable, false);
if (startCourse != null) {
runContext.put(SendMailStepForm.START_COURSE, startCourse);
}
}
listenTo(exportCtrl);
getWindowControl().pushAsModalDialog(exportCtrl.getInitialComponent());
} else {
showWarning("may.not.move.message");
}
}
Aggregations