Package com.google.livingstories.client

Examples of com.google.livingstories.client.NarrativeContentItem


        title.setType("text/html");
        title.setValue(event.getEventUpdate());
        content.setType("text/html");
        content.setValue(StringUtil.stripForExternalSites(event.getEventSummary()));
      } else if (update.getContentItemType() == ContentItemType.NARRATIVE) {
        NarrativeContentItem narrative = (NarrativeContentItem) update;
        title.setType("text/html");
        title.setValue(narrative.getHeadline() + " - "
            + narrative.getNarrativeType().toString());
        content.setType("text/html");
        String narrativeSummary = StringUtil.stripForExternalSites(
            narrative.getNarrativeSummary());
        if (GlobalUtil.isContentEmpty(narrativeSummary)) {
          content.setValue(SnippetUtil.createSnippet(
              JavaNodeAdapter.fromHtml(narrative.getContent()), MAXIMUM_SNIPPET_LENGTH));
        } else {
          content.setValue(narrativeSummary);
        }
      }
      SyndEntry entry = new SyndEntryImpl();
View Full Code Here


              contentEditor.setContent("");
              imageUrlTextBox.setText(selectedContentItem.getContent());
            }
            break;
          case NARRATIVE:
            NarrativeContentItem narrativeContentItem = (NarrativeContentItem) selectedContentItem;
            headlineTextBox.setText(narrativeContentItem.getHeadline());
            narrativeTypeSelector.selectConstant(narrativeContentItem.getNarrativeType());
            narrativeDateBox.setValue(narrativeContentItem.getNarrativeDate());
            narrativeSummaryTextArea.setContent(narrativeContentItem.getNarrativeSummary());
            break;
          case BACKGROUND:
            BackgroundContentItem backgroundContentItem =
                (BackgroundContentItem) selectedContentItem;
            if (backgroundContentItem.isConcept()) {
View Full Code Here

          // with a type of 'Event'. In this case, the standalone value should be set to true
          // because this is the first time the item is being saved as a narrative, and hasn't
          // been linked from anything yet. The second case is when an existing narrative
          // is being resaved. In this case, we want to preserve the old value of the
          // 'isStandalone' field.
          contentItem = new NarrativeContentItem(contentItemId, creationDate, currentContributorIds,
              content, importance, livingStoryId, headlineTextBox.getText().trim(),
              narrativeTypeSelector.getSelectedConstant(),
              selectedContentItem.getContentItemType() == ContentItemType.NARRATIVE ?
                  ((NarrativeContentItem)selectedContentItem).isStandalone() : true,
              narrativeDateBox.getValue(), narrativeSummaryTextArea.getContent());
View Full Code Here

        EventContentItem event = (EventContentItem) contentItem;
        if (!GlobalUtil.isContentEmpty(event.getEventSummary())) {
          return new SummarySnippetWidget(event);
        }
      } else if (contentItem.getContentItemType() == ContentItemType.NARRATIVE) {
        NarrativeContentItem narrative = (NarrativeContentItem) contentItem;
        if (!GlobalUtil.isContentEmpty(narrative.getNarrativeSummary())
            || !GlobalUtil.isContentEmpty(narrative.getContent())) {
          return new SummarySnippetWidget(narrative);
        }
      }
    }
    return null;
View Full Code Here

    panel.add(header);
   
    for (BaseContentItem update : updates) {
      Anchor headline = null;
      if (update.getContentItemType() == ContentItemType.NARRATIVE) {
        NarrativeContentItem narrative = (NarrativeContentItem)update;
        headline = new Anchor(narrative.getHeadline() + "<span class=\"greyFont\">&nbsp;-&nbsp;"
            + narrative.getNarrativeType().toString(),
            true, getStoryUrl(story) + getUpdateUrl(narrative));
      } else {
        EventContentItem event = (EventContentItem)update;
        headline = new Anchor(event.getEventUpdate(), true,
            getStoryUrl(story) + getUpdateUrl(event));
View Full Code Here

        setAssetType(assetContentItem.getAssetType());
        setCaption(assetContentItem.getCaption());
        setPreviewUrl(assetContentItem.getPreviewUrl());
        break;
      case NARRATIVE:
        NarrativeContentItem narrativeContentItem = (NarrativeContentItem) clientContentItem;
        setHeadline(narrativeContentItem.getHeadline());
        setNarrativeType(narrativeContentItem.getNarrativeType());
        setIsStandalone(narrativeContentItem.isStandalone());
        setNarrativeDate(narrativeContentItem.getNarrativeDate());
        setNarrativeSummary(narrativeContentItem.getNarrativeSummary());
        break;
      case BACKGROUND:
        BackgroundContentItem backgroundContentItem = (BackgroundContentItem) clientContentItem;
        setName(backgroundContentItem.getConceptName());
        break;
View Full Code Here

      case ASSET:
        return new AssetContentItem(getId(), getTimestamp(), getContributorIds(),
            getContent(), getImportance(), getLivingStoryId(),
            getAssetType(), getCaption(), getPreviewUrl());
      case NARRATIVE:
        return new NarrativeContentItem(getId(), getTimestamp(), getContributorIds(),
            getContent(), getImportance(), getLivingStoryId(),
            getHeadline(), getNarrativeType(), isStandalone(), getNarrativeDate(),
            getNarrativeSummary());
      case REACTION:
        return new ReactionContentItem(getId(), getTimestamp(), getContributorIds(),
View Full Code Here

      Label relatedLabel = new Label(LspMessageHolder.consts.related());
      relatedLabel.setStylePrimaryName("contentItemHeader");
      panel.add(relatedLabel);
     
      for (final BaseContentItem linkedNarrative : linkedNarratives) {
        NarrativeContentItem narrative = (NarrativeContentItem)linkedNarrative;
       
        FlowPanel row = new FlowPanel();
        InlineLabel narrativeHeadline = new InlineLabel(narrative.getHeadline());
        narrativeHeadline.addStyleName(Resources.INSTANCE.css().clickable());
        InlineHTML narrativeType = new InlineHTML("&nbsp;-&nbsp;"
            + narrative.getNarrativeType().toString());
        narrativeType.addStyleName("greyFont");
        row.add(narrativeHeadline);
        row.add(narrativeType);
       
        FocusPanel clickableRow = new FocusPanel();
View Full Code Here

TOP

Related Classes of com.google.livingstories.client.NarrativeContentItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.