use of org.olat.portfolio.model.structel.EPDefaultMap in project OpenOLAT by OpenOLAT.
the class EPFrontendManagerTest method closedArtefacts.
@Test
public void closedArtefacts() {
// create two artefacts
AbstractArtefact artefact1 = epFrontendManager.createAndPersistArtefact(ident1, "text");
assertNotNull(artefact1);
AbstractArtefact artefact2 = epFrontendManager.createAndPersistArtefact(ident1, "bc");
assertNotNull(artefact2);
dbInstance.commitAndCloseSession();
// create a map with a page and the page has two artefacts
PortfolioStructureMap originalMap = epFrontendManager.createAndPersistPortfolioDefaultMap(ident1, "Title", "Description");
PortfolioStructure newPage = epFrontendManager.createAndPersistPortfolioPage(originalMap, "Page title", "Page description");
boolean successfullLink1 = epFrontendManager.addArtefactToStructure(ident1, artefact1, newPage);
assertTrue(successfullLink1);
boolean successfullLink2 = epFrontendManager.addArtefactToStructure(ident1, artefact2, newPage);
assertTrue(successfullLink2);
dbInstance.commitAndCloseSession();
// check if the artefact is in a closed map
assertFalse(epFrontendManager.isArtefactClosed(artefact1));
assertFalse(epFrontendManager.isArtefactClosed(artefact2));
// closed the map artificially
((EPDefaultMap) originalMap).setStatus(StructureStatusEnum.CLOSED);
dbInstance.updateObject(originalMap);
dbInstance.commitAndCloseSession();
// check if the artefact is in a closed map
assertTrue(epFrontendManager.isArtefactClosed(artefact1));
assertTrue(epFrontendManager.isArtefactClosed(artefact2));
}
use of org.olat.portfolio.model.structel.EPDefaultMap in project OpenOLAT by OpenOLAT.
the class EPStructureManager method createPortfolioDefaultMap.
protected PortfolioStructureMap createPortfolioDefaultMap(Identity identity, String title, String description) {
EPDefaultMap el = new EPDefaultMap();
fillStructureElement(el, title, description);
// create security group
EPStructureElementToGroupRelation ownerGroup = createBaseGroup(el, identity);
Set<EPStructureElementToGroupRelation> relations = new HashSet<>();
relations.add(ownerGroup);
el.setGroups(relations);
return el;
}
use of org.olat.portfolio.model.structel.EPDefaultMap in project openolat by klemens.
the class EPStructureManager method createPortfolioDefaultMap.
protected PortfolioStructureMap createPortfolioDefaultMap(String title, String description) {
EPDefaultMap el = new EPDefaultMap();
fillStructureElement(el, title, description);
return el;
}
use of org.olat.portfolio.model.structel.EPDefaultMap in project OpenOLAT by OpenOLAT.
the class EPStructureManager method createPortfolioDefaultMap.
protected PortfolioStructureMap createPortfolioDefaultMap(String title, String description) {
EPDefaultMap el = new EPDefaultMap();
fillStructureElement(el, title, description);
return el;
}
use of org.olat.portfolio.model.structel.EPDefaultMap in project OpenOLAT by OpenOLAT.
the class EPChangelogController method updateChangelogDisplay.
/**
* update the changelog-list according to selected date. this method is
* invoked on initForm and again when user changes date in dateChooser
*/
private void updateChangelogDisplay() {
// init the helper;
String path = getWindowControl().getBusinessControl().getAsString();
EPNotificationsHelper helper = new EPNotificationsHelper(path, getLocale());
// get the date from the dateChooser component
Date compareDate = dateChooser.getDate();
EPMapShort mapShort = ePFMgr.loadMapShortByResourceId(map.getOlatResource().getResourceableId());
List<SubscriptionListItem> allItems = new ArrayList<SubscriptionListItem>(0);
// get subscriptionListItems according to map type
if (map instanceof EPDefaultMap || map instanceof EPStructuredMapTemplate) {
allItems = helper.getAllSubscrItemsDefault(compareDate, mapShort);
} else if (map instanceof EPStructuredMap) {
allItems = helper.getAllSubscrItemsStructured(compareDate, mapShort);
}
List<SubscriptionItemBundle> bundles = getItemBundlesForSubscriptionItems(allItems);
flc.contextPut("subscriptionItems", bundles);
}
Aggregations