コード例 #1
0
  /*
   * (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;
  }
コード例 #2
0
 /*
  * (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;
 }