/* * (non-Javadoc) * * @see * cc.kune.core.server.content.CreationService#createContent(java.lang.String, * java.lang.String, cc.kune.domain.User, cc.kune.domain.Container, * java.lang.String) */ @Override public Content createContent( final String title, final String body, final User user, final Container container, final String typeId, final WaveRef waveRef, final boolean publishExistingWave) { final ServerTool tool = tools.get(container.getToolName()); tool.checkTypesBeforeContentCreation(container.getTypeId(), typeId); final URL gagdetUrl = tool instanceof ServerToolWithWaveGadget ? ((ServerToolWithWaveGadget) tool).getGadgetUrl() : KuneWaveService.WITHOUT_GADGET; final String[] otherParticipants = tool instanceof ServerToolWithWave ? ((ServerToolWithWave) tool).getNewContentAdditionalParts(container) : NO_MORE_PARTICIPANTS; final Content content = contentManager.createContent( title, body, publishExistingWave, waveRef, user, container, typeId, gagdetUrl, NO_PROPERTIES, otherParticipants); tool.onCreateContent(content, container); return content; }
/* * (non-Javadoc) * * @see * cc.kune.core.server.content.CreationService#copyContent(cc.kune.domain. * User, cc.kune.domain.Container, cc.kune.domain.Content) */ @Override public Content copyContent( final User user, final Container container, final Content contentToCopy) { final ServerTool tool = tools.get(container.getToolName()); final Content content = contentManager.copyContent(user, container, contentToCopy); tool.onCreateContent(content, container); return content; }
/* * (non-Javadoc) * * @see * cc.kune.core.server.content.CreationService#createFolder(cc.kune.domain * .Group, java.lang.Long, java.lang.String, cc.kune.domain.I18nLanguage, * java.lang.String) */ @Override public Container createFolder( final Group group, final Long parentFolderId, final String name, final I18nLanguage language, final String typeId) { final Container parent = containerManager.find(parentFolderId); final String toolName = parent.getToolName(); tools.get(toolName).checkTypesBeforeContainerCreation(parent.getTypeId(), typeId); final Container child = containerManager.createFolder(group, parent, name, language, typeId); tools.get(toolName).onCreateContainer(child, parent); return child; }