Package com.google.livingstories.client

Examples of com.google.livingstories.client.ContentItemType


  /**
   * Tests whether a content item should be included in the displayed list, based on the filter
   * setting.
   */
  protected boolean testContentItem(BaseContentItem contentItem) {
    ContentItemType type = filter.getSelectedConstant();
    return type == null || contentItem.getContentItemType().equals(type) || isSelected(contentItem);
  }
View Full Code Here


   
    public void doClickWork(Widget showPromptRelativeTo) {
      selectedContentItem = contentItemListBox.getSelectedContentItem();
      long contentItemId = selectedContentItem.getId();
      Date creationDate = republish ? selectedContentItem.getTimestamp() : new Date();
      ContentItemType contentItemType = contentItemTypeSelector.getSelectedConstant();
      AssetType assetType =
        contentItemType == ContentItemType.ASSET ? assetTypeSelector.getSelectedConstant() : null;
      String content =
          contentEditor.isVisible() ? contentEditor.getContent() : imageUrlTextBox.getText();
View Full Code Here

   * @return false if this is a content item that should be ignored completely. Handy to the caller,
   * which can then avoid adding contentItem to other, theme-specific types bundles.
   */
  private boolean addContentItemToTypesBundle(BaseContentItem contentItem,
      ContentItemTypesBundle bundle) {
    ContentItemType contentItemType = contentItem.getContentItemType();
   
    // We don't want to show background and reaction items in the filters, so skip those entirely
    if (contentItemType == ContentItemType.BACKGROUND
        || contentItemType == ContentItemType.REACTION) {
      return false;
View Full Code Here

   * Also looks for matches of the names of concepts and creates a link if one doesn't exist.
   */
  public static Set<Long> createLinks(BaseContentEntity contentEntity,
      List<PlayerContentItem> playerContentItems, List<BackgroundContentItem> concepts) {
    Set<Long> suggestedAdditionIds = Sets.newHashSet();
    ContentItemType contentItemType = contentEntity.getContentItemType();
    Long contentEntityId = contentEntity.getId();
    if (contentItemType != ContentItemType.ASSET && contentItemType != ContentItemType.PLAYER) {
      MatchResult matchResult = match(contentEntityId, contentEntity.getContent(),
          playerContentItems, concepts);
      // If matches were found, set the current content string with the new one that contains
View Full Code Here

      // Note: this doesn't handle the case of unlinking a previously linked narrative content item.
      // That would require checking the linked content items of every single other event
      // content item to make sure it's not linked to from anywhere else, which would be an
      // expensive operation.
      Set<Long> linkedContentEntityIds = contentEntity.getLinkedContentEntityIds();
      ContentItemType contentItemType = contentEntity.getContentItemType();
      if ((contentItemType == ContentItemType.EVENT || contentItemType == ContentItemType.NARRATIVE)
          && !linkedContentEntityIds.isEmpty()) {
        List<Object> oids = new ArrayList<Object>(linkedContentEntityIds.size());
        for (Long id : linkedContentEntityIds) {
          oids.add(pm.newObjectIdInstance(BaseContentEntity.class, id));
View Full Code Here

 
  public static BaseContentEntity fromJSON(JSONObject json) {
    DateFormat dateFormatter = SimpleDateFormat.getInstance();
   
    try {
      ContentItemType contentItemType = ContentItemType.valueOf(json.getString("contentItemType"));
      Long livingStoryId = json.has("livingStoryId") ? json.getLong("livingStoryId") : null;
      BaseContentEntity entity = new BaseContentEntity(
          dateFormatter.parse(json.getString("timestamp")), contentItemType,
          json.getString("content"), Importance.valueOf(json.getString("importance")),
          livingStoryId);
View Full Code Here

    }
    List<AssetContentItem> linkedImages = new ArrayList<AssetContentItem>();
   
    for (BaseContentItem linkedContentItem : narrative.getLinkedContentItems()) {
      if (linkedContentItem != null) {
        ContentItemType linkedContentItemType = linkedContentItem.getContentItemType();
        if (linkedContentItemType == ContentItemType.ASSET
            && ((AssetContentItem) linkedContentItem).getAssetType() == AssetType.IMAGE) {
          // Collect all of the images in a list so that they can be shown in a slideshow
          linkedImages.add((AssetContentItem) linkedContentItem);
        } else if (LINKED_TYPES_SHOWN_FOR_NARRATIVES.contains(linkedContentItemType)) {
View Full Code Here

  private void createContentItemTypeFilter() {
    contentItemType = EnumDropdown.newInstance(ContentItemType.class, "All");
    contentItemType.addChangeHandler(new ChangeHandler() {
      @Override
      public void onChange(ChangeEvent event) {
        ContentItemType selectedType = contentItemType.getSelectedConstant();
        if (CONTENT_TYPES_WITH_SUBTYPES.contains(selectedType)) {
          filterGrid.getRowFormatter().setVisible(contentItemSubtypeRow, true);
          playerType.setVisible(selectedType == ContentItemType.PLAYER);
          assetType.setVisible(selectedType == ContentItemType.ASSET);
          narrativeType.setVisible(selectedType == ContentItemType.NARRATIVE);
View Full Code Here

   */
  private void createContentItemTypeSelectionHandler() {
    ChangeHandler typeSelectionHandler = new ChangeHandler() {
      @Override
      public void onChange(ChangeEvent event) {
        ContentItemType type = contentItemTypeSelector.getSelectedConstant();
        showSpecialAttributesPanel(type);
        setAssetControlVisibility();
      }
    };
    contentItemTypeSelector.addChangeHandler(typeSelectionHandler);
View Full Code Here

TOP

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

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.