use of org.olat.portfolio.PortfolioModule in project OpenOLAT by OpenOLAT.
the class EPArtefactWizzardStepCallback method execute.
/**
* @see org.olat.core.gui.control.generic.wizard.StepRunnerCallback#execute(org.olat.core.gui.UserRequest,
* org.olat.core.gui.control.WindowControl,
* org.olat.core.gui.control.generic.wizard.StepsRunContext)
*/
@Override
public Step execute(UserRequest ureq2, WindowControl wControl, StepsRunContext runContext) {
boolean hasChanges = false;
if (runContext.containsKey("artefact")) {
hasChanges = true;
AbstractArtefact locArtefact = (AbstractArtefact) runContext.get("artefact");
ePFMgr = (EPFrontendManager) CoreSpringFactory.getBean("epFrontendManager");
PortfolioModule portfolioModule = (PortfolioModule) CoreSpringFactory.getBean("portfolioModule");
// set the defined signature level, if its not from inside olat
if (locArtefact.getSignature() < 0 && ((runContext.containsKey("copyright.accepted") && (Boolean) runContext.get("copyright.accepted")) || !portfolioModule.isCopyrightStepEnabled())) {
locArtefact.setSignature(-1 * locArtefact.getSignature());
}
ePFMgr.updateArtefact(locArtefact);
if (runContext.containsKey("tempArtFolder")) {
// a new text or file-artefact was created, copy everything to destination
VFSContainer tmpFolder = (VFSContainer) runContext.get("tempArtFolder");
copyFromTempToArtefactContainer(locArtefact, tmpFolder);
} else if (tempUpload != null) {
// an artefact was collected in bc, only copy the selected file
copyFromBCToArtefactContainer(locArtefact, tempUpload);
}
// add to a structure if any was selected
if (runContext.containsKey("selectedStructure")) {
PortfolioStructure parentStructure = (PortfolioStructure) runContext.get("selectedStructure");
if (parentStructure != null) {
ePFMgr.addArtefactToStructure(ureq2.getIdentity(), locArtefact, parentStructure);
}
}
@SuppressWarnings("unchecked") List<String> allTags = (List<String>) runContext.get("artefactTagsList");
ePFMgr.setArtefactTags(ureq2.getIdentity(), locArtefact, allTags);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapPortfolioOres(locArtefact));
ThreadLocalUserActivityLogger.log(EPLoggingAction.EPORTFOLIO_ARTEFACT_ADDED, getClass());
}
return hasChanges ? StepsMainRunController.DONE_MODIFIED : StepsMainRunController.DONE_UNCHANGED;
}
use of org.olat.portfolio.PortfolioModule in project OpenOLAT by OpenOLAT.
the class UserInfoMainController method buildTreeModel.
/**
* Generates the archiver menu
*
* @return The generated menu tree model
* @param firstLastName
*/
private GenericTreeModel buildTreeModel(String name) {
GenericTreeNode root, gtn;
GenericTreeModel gtm = new GenericTreeModel();
root = new GenericTreeNode();
root.setTitle(name);
root.setAltText(name);
root.setAccessible(false);
gtm.setRootNode(root);
gtn = new GenericTreeNode();
gtn.setTitle(translate("menu.homepage"));
gtn.setUserObject(CMD_HOMEPAGE);
gtn.setAltText(translate("menu.homepage.alt"));
root.addChild(gtn);
// following user info elements are only shown for undeleted and real
// users (not invited
// eportfolio users)
boolean isInvitee = invitationDao.isInvitee(chosenIdentity);
boolean isDeleted = chosenIdentity.getStatus().equals(Identity.STATUS_DELETED);
if (!isDeleted && !isInvitee) {
if (calendarModule.isEnablePersonalCalendar()) {
gtn = new GenericTreeNode();
gtn.setTitle(translate("menu.calendar"));
gtn.setUserObject(CMD_CALENDAR);
gtn.setAltText(translate("menu.calendar.alt"));
gtn.setCssClass("o_visiting_card_calendar");
root.addChild(gtn);
}
gtn = new GenericTreeNode();
gtn.setTitle(translate("menu.folder"));
gtn.setUserObject(CMD_FOLDER);
gtn.setAltText(translate("menu.folder.alt"));
gtn.setCssClass("o_visiting_card_folder");
root.addChild(gtn);
}
if (!isDeleted) {
gtn = new GenericTreeNode();
gtn.setTitle(translate("menu.contact"));
gtn.setUserObject(CMD_CONTACT);
gtn.setAltText(translate("menu.contact.alt"));
gtn.setCssClass("o_visiting_card_contact");
root.addChild(gtn);
}
if (!isDeleted && !isInvitee) {
PortfolioModule portfolioModule = (PortfolioModule) CoreSpringFactory.getBean("portfolioModule");
if (portfolioModule.isEnabled()) {
gtn = new GenericTreeNode();
gtn.setTitle(translate("menu.portfolio"));
gtn.setUserObject(CMD_PORTFOLIO);
gtn.setAltText(translate("menu.portfolio.alt"));
gtn.setCssClass("o_visiting_card_portfolio");
root.addChild(gtn);
}
}
return gtm;
}
use of org.olat.portfolio.PortfolioModule in project OpenOLAT by OpenOLAT.
the class EPCollectRestrictionResultController method getMessageArgs.
public static String[] getMessageArgs(CollectRestriction restriction, Translator translator) {
String[] args = new String[3];
args[0] = translator.translate("restriction." + restriction.getRestriction());
PortfolioModule portfolioModule = (PortfolioModule) CoreSpringFactory.getBean("portfolioModule");
EPArtefactHandler<?> handler = portfolioModule.getArtefactHandler(restriction.getArtefactType());
if (handler != null) {
String handlerClass = PortfolioFilterController.HANDLER_PREFIX + handler.getClass().getSimpleName() + PortfolioFilterController.HANDLER_TITLE_SUFFIX;
args[1] = handler.getHandlerTranslator(translator).translate(handlerClass);
} else {
args[1] = translator.translate("restriction.handler.unknown");
}
args[2] = Integer.toString(restriction.getAmount());
return args;
}
use of org.olat.portfolio.PortfolioModule in project OpenOLAT by OpenOLAT.
the class CollaborationToolsFactory method initAvailableTools.
/**
* Helper method to initialize the list of enabled tools based system wide
* configuration.
*/
public synchronized void initAvailableTools() {
ArrayList<String> toolArr = new ArrayList<String>();
toolArr.add(CollaborationTools.TOOL_NEWS);
toolArr.add(CollaborationTools.TOOL_CONTACT);
CalendarModule calendarModule = CoreSpringFactory.getImpl(CalendarModule.class);
if (calendarModule.isEnabled() && calendarModule.isEnableGroupCalendar()) {
toolArr.add(CollaborationTools.TOOL_CALENDAR);
}
toolArr.add(CollaborationTools.TOOL_FOLDER);
toolArr.add(CollaborationTools.TOOL_FORUM);
if (CoreSpringFactory.getImpl(InstantMessagingModule.class).isEnabled()) {
toolArr.add(CollaborationTools.TOOL_CHAT);
}
BaseSecurityModule securityModule = CoreSpringFactory.getImpl(BaseSecurityModule.class);
if (securityModule.isWikiEnabled()) {
toolArr.add(CollaborationTools.TOOL_WIKI);
}
PortfolioModule portfolioModule = CoreSpringFactory.getImpl(PortfolioModule.class);
PortfolioV2Module portfolioV2Module = CoreSpringFactory.getImpl(PortfolioV2Module.class);
if (portfolioModule.isEnabled() || portfolioV2Module.isEnabled()) {
toolArr.add(CollaborationTools.TOOL_PORTFOLIO);
}
OpenMeetingsModule openMeetingsModule = CoreSpringFactory.getImpl(OpenMeetingsModule.class);
if (openMeetingsModule.isEnabled()) {
toolArr.add(CollaborationTools.TOOL_OPENMEETINGS);
}
TOOLS = ArrayHelper.toArray(toolArr);
}
use of org.olat.portfolio.PortfolioModule in project openolat by klemens.
the class UserInfoMainController method buildTreeModel.
/**
* Generates the archiver menu
*
* @return The generated menu tree model
* @param firstLastName
*/
private GenericTreeModel buildTreeModel(String name) {
GenericTreeNode root, gtn;
GenericTreeModel gtm = new GenericTreeModel();
root = new GenericTreeNode();
root.setTitle(name);
root.setAltText(name);
root.setAccessible(false);
gtm.setRootNode(root);
gtn = new GenericTreeNode();
gtn.setTitle(translate("menu.homepage"));
gtn.setUserObject(CMD_HOMEPAGE);
gtn.setAltText(translate("menu.homepage.alt"));
root.addChild(gtn);
// following user info elements are only shown for undeleted and real
// users (not invited
// eportfolio users)
boolean isInvitee = invitationDao.isInvitee(chosenIdentity);
boolean isDeleted = chosenIdentity.getStatus().equals(Identity.STATUS_DELETED);
if (!isDeleted && !isInvitee) {
if (calendarModule.isEnablePersonalCalendar()) {
gtn = new GenericTreeNode();
gtn.setTitle(translate("menu.calendar"));
gtn.setUserObject(CMD_CALENDAR);
gtn.setAltText(translate("menu.calendar.alt"));
gtn.setCssClass("o_visiting_card_calendar");
root.addChild(gtn);
}
gtn = new GenericTreeNode();
gtn.setTitle(translate("menu.folder"));
gtn.setUserObject(CMD_FOLDER);
gtn.setAltText(translate("menu.folder.alt"));
gtn.setCssClass("o_visiting_card_folder");
root.addChild(gtn);
}
if (!isDeleted) {
gtn = new GenericTreeNode();
gtn.setTitle(translate("menu.contact"));
gtn.setUserObject(CMD_CONTACT);
gtn.setAltText(translate("menu.contact.alt"));
gtn.setCssClass("o_visiting_card_contact");
root.addChild(gtn);
}
if (!isDeleted && !isInvitee) {
PortfolioModule portfolioModule = (PortfolioModule) CoreSpringFactory.getBean("portfolioModule");
if (portfolioModule.isEnabled()) {
gtn = new GenericTreeNode();
gtn.setTitle(translate("menu.portfolio"));
gtn.setUserObject(CMD_PORTFOLIO);
gtn.setAltText(translate("menu.portfolio.alt"));
gtn.setCssClass("o_visiting_card_portfolio");
root.addChild(gtn);
}
}
return gtm;
}
Aggregations