/** * Creates a glossary resource and creates the necessary folders on disk. The glossary will be * placed in the resources _unizipped dir to make import / export easier * * @return */ @Override public GlossaryResource createGlossary() { final GlossaryResource resource = new GlossaryResource(); final VFSContainer rootContainer = FileResourceManager.getInstance().getFileResourceRootImpl(resource); if (rootContainer == null) { return null; } if (rootContainer.createChildContainer(INTERNAL_FOLDER_NAME) == null) { return null; } final OLATResourceManager rm = OLATResourceManager.getInstance(); final OLATResource ores = rm.createOLATResourceInstance(resource); rm.saveOLATResource(ores); return resource; }
public void archiveForum(final OLATResourceable ores, final String archivFilePath) { PropertyParameterObject propertyParameterObject = new PropertyParameterObject.Builder() .resourceable(ores) .category(PropertyManagerEBL.PROP_CAT_BG_COLLABTOOLS) .name(PropertyManagerEBL.KEY_FORUM) .build(); final PropertyImpl forumKeyProperty = propertyManagerEBL.findProperty(propertyParameterObject); if (forumKeyProperty != null) { final VFSContainer archiveContainer = new LocalFolderImpl(new File(archivFilePath)); final String archiveForumName = "del_forum_" + forumKeyProperty.getLongValue(); final VFSContainer archiveForumContainer = archiveContainer.createChildContainer(archiveForumName); final ForumFormatter ff = new ForumRTFFormatter(archiveForumContainer, false); ForumArchiveManager.getInstance().applyFormatter(ff, forumKeyProperty.getLongValue(), null); } }