use of org.olat.properties.Property in project openolat by klemens.
the class ViteroBookingsAdminController method openResource.
protected void openResource(UserRequest ureq, ViteroBooking booking) {
Property prop = booking.getProperty();
if (prop != null) {
String url;
if (prop.getGrp() != null) {
url = "[BusinessGroup:" + prop.getGrp().getKey() + "]";
} else {
OLATResourceable ores = OresHelper.createOLATResourceableInstance(prop.getResourceTypeName(), prop.getResourceTypeId());
RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(ores, false);
if (re != null) {
url = "[RepositoryEntry:" + re.getKey() + "]";
} else {
showWarning("resource.dont.exist");
return;
}
}
BusinessControl bc = BusinessControlFactory.getInstance().createFromString(url);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, getWindowControl());
NewControllerFactory.getInstance().launch(ureq, bwControl);
}
}
use of org.olat.properties.Property in project openolat by klemens.
the class EPSettingsManager method setSavedFilterSettings.
public void setSavedFilterSettings(Identity ident, List<EPFilterSettings> filterList) {
Property p = propertyManager.findProperty(ident, null, null, EPORTFOLIO_CATEGORY, EPORTFOLIO_FILTER_SETTINGS);
if (p == null) {
p = propertyManager.createUserPropertyInstance(ident, EPORTFOLIO_CATEGORY, EPORTFOLIO_FILTER_SETTINGS, null, null, null, null);
}
// don't persist filters without a name
for (Iterator<EPFilterSettings> iterator = filterList.iterator(); iterator.hasNext(); ) {
EPFilterSettings epFilterSettings = iterator.next();
if (!StringHelper.containsNonWhitespace(epFilterSettings.getFilterName())) {
iterator.remove();
}
}
XStream xStream = XStreamHelper.createXStreamInstance();
xStream.aliasType("EPFilterSettings", EPFilterSettings.class);
String filterListXML = xStream.toXML(filterList);
p.setTextValue(filterListXML);
propertyManager.saveProperty(p);
}
use of org.olat.properties.Property in project openolat by klemens.
the class EPSettingsManager method getSavedFilterSettings.
@SuppressWarnings("unchecked")
public List<EPFilterSettings> getSavedFilterSettings(Identity ident) {
Property p = propertyManager.findProperty(ident, null, null, EPORTFOLIO_CATEGORY, EPORTFOLIO_FILTER_SETTINGS);
List<EPFilterSettings> result = new ArrayList<EPFilterSettings>();
if (p == null) {
result.add(new EPFilterSettings());
} else {
XStream xStream = XStreamHelper.createXStreamInstance();
xStream.aliasType("EPFilterSettings", EPFilterSettings.class);
try {
result = (List<EPFilterSettings>) xStream.fromXML(p.getTextValue());
} catch (Exception e) {
// it's not a live critical part
logWarn("Cannot read filter settings", e);
}
}
return result;
}
use of org.olat.properties.Property in project openolat by klemens.
the class EPSettingsManager method setArtefactAttributeConfig.
public void setArtefactAttributeConfig(Identity ident, Map<String, Boolean> artAttribConfig) {
Property p = propertyManager.findProperty(ident, null, null, EPORTFOLIO_CATEGORY, EPORTFOLIO_ARTEFACTS_ATTRIBUTES);
if (p == null) {
p = propertyManager.createUserPropertyInstance(ident, EPORTFOLIO_CATEGORY, EPORTFOLIO_ARTEFACTS_ATTRIBUTES, null, null, null, null);
}
XStream xStream = XStreamHelper.createXStreamInstance();
String artAttribXML = xStream.toXML(artAttribConfig);
p.setTextValue(artAttribXML);
propertyManager.saveProperty(p);
}
use of org.olat.properties.Property in project openolat by klemens.
the class EPFrontendManager method deleteGroupDataFor.
@Override
public boolean deleteGroupDataFor(BusinessGroup group) {
final NarrowedPropertyManager npm = NarrowedPropertyManager.getInstance(group);
final Property mapKeyProperty = npm.findProperty(null, null, CollaborationTools.PROP_CAT_BG_COLLABTOOLS, CollaborationTools.KEY_PORTFOLIO);
if (mapKeyProperty != null) {
final Long mapKey = mapKeyProperty.getLongValue();
final String version = mapKeyProperty.getStringValue();
if (!"2".equals(version)) {
final PortfolioStructure map = loadPortfolioStructureByKey(mapKey);
if (map != null) {
deletePortfolioStructure(map);
}
}
return true;
}
return false;
}
Aggregations