Package com.google.livingstories.client

Examples of com.google.livingstories.client.AssetContentItem


        // and then save the player content item via another RPC. If there is no photo URL provided,
        // the player can be saved via 1 RPC call directly.
        if (GlobalUtil.isContentEmpty(photoUrl)) {
          savePlayer(null);
        } else {
          AssetContentItem photo = new AssetContentItem(null, new Date(), new HashSet<Long>(),
              photoUrl, Importance.MEDIUM, null, AssetType.IMAGE, name, previewPhotoUrl);
          photo.setLocation(new Location(null, null, ""));
          photo.setPublishState(PublishState.PUBLISHED);
          contentService.createOrChangeContentItem(photo, new AsyncCallback<BaseContentItem>() {
            @Override
            public void onFailure(Throwable caught) {
              problemLabel.setVisible(true);
              callbackWork.onFailure(caught);
View Full Code Here


        case DATA:
          contentItem = new DataContentItem(contentItemId, creationDate, currentContributorIds,
              content, importance, livingStoryId);
          break;
        case ASSET:
          contentItem = new AssetContentItem(contentItemId, creationDate, currentContributorIds,
              content, importance, livingStoryId, assetType, captionTextArea.getText(),
              previewUrlTextBox.getText());
          break;
        case NARRATIVE:
          // There are 2 types possible for a content item that is now being saved as a narrative.
View Full Code Here

          setParentPlayerContentEntityId(
              storyPlayerContentItem.getParentPlayerContentItem().getId());
        }
        break;
      case ASSET:
        AssetContentItem assetContentItem = (AssetContentItem) clientContentItem;
        setAssetType(assetContentItem.getAssetType());
        setCaption(assetContentItem.getCaption());
        setPreviewUrl(assetContentItem.getPreviewUrl());
        break;
      case NARRATIVE:
        NarrativeContentItem narrativeContentItem = (NarrativeContentItem) clientContentItem;
        setHeadline(narrativeContentItem.getHeadline());
        setNarrativeType(narrativeContentItem.getNarrativeType());
View Full Code Here

              getEventUpdate(), getEventSummary(), getContent());
        }
      case PLAYER:
        Long livingStoryId = getLivingStoryId();
        if (livingStoryId == null) {
          AssetContentItem photoContentItem = null;
          if (getPhotoContentEntityId() != null) {
            try {
              photoContentItem = (AssetContentItem) new ContentRpcImpl().getContentItem(
                  getPhotoContentEntityId(), false);
            } catch (JDOException ex) {
              // leave photoContentItem as null;
            }
          }
          return new PlayerContentItem(getId(), getTimestamp(), getContributorIds(), getContent(),
              getImportance(), getName(), getAliases(), getPlayerType(), photoContentItem);
        } else {
          return new StoryPlayerContentItem(getId(), getTimestamp(), getContributorIds(),
              getContent(), getImportance(), livingStoryId,
              (PlayerContentItem) new ContentRpcImpl().getContentItem(
                  getParentPlayerContentEntityId(), false));
        }
      case QUOTE:
        return new QuoteContentItem(getId(), getTimestamp(), getContributorIds(),
            getContent(), getImportance(), getLivingStoryId());
      case BACKGROUND:
        return new BackgroundContentItem(getId(), getTimestamp(), getContributorIds(),
            getContent(), getImportance(), getLivingStoryId(), getName());
      case DATA:
        return new DataContentItem(getId(), getTimestamp(), getContributorIds(),
            getContent(), getImportance(), getLivingStoryId());
      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(),
View Full Code Here

      popupImageLoadedHandler = null;
    }
  }

  private void displayImage(int index) {
    final AssetContentItem currentImage = allImages.get(index);
    imagePanel.setWidget(new ImagePopupView(currentImage));
    // Reposition the popup/filmstrip to take image size changes, window size changes,
    // and scrolling into account.
    showPopup();
    showFilmstrip();
View Full Code Here

        break;
      case PLAYER:
        content.setWidget(new BasePlayerPreview((PlayerContentItem) contentItem).hideHeader());
        break;
      case ASSET:
        AssetContentItem asset = (AssetContentItem) contentItem;
        switch (asset.getAssetType()) {
          case LINK:
            content.setWidget(new LinkAssetPreview(asset).hideHeader());
            break;
          case DOCUMENT:
            content.setWidget(new DocumentAssetPreview(asset).hideHeader());
            break;
          case AUDIO:
            content.setWidget(new AudioAssetView(asset).hideHeader());
            break;
          case INTERACTIVE:
            content.setWidget(new GraphicAssetPreview(asset).hideHeader());
            break;
          case VIDEO:
            content.setWidget(new VideoAssetPreview(asset).hideHeader());
            break;
          case IMAGE:
            content.setWidget(new ImageAssetPreview(asset).hideHeader());
            break;
          default:
            throw new IllegalArgumentException("Asset type " + asset.getAssetType()
                + " does not have a stream view defined.");
        }
        break;
      default:
        throw new IllegalArgumentException("Content item type " + contentItem.getContentItemType()
View Full Code Here

          slideshowImages.add(image);
        }
      }
     
      if (!slideshowImages.isEmpty()) {
        AssetContentItem previewImage = slideshowImages.get(0);
        previewImage.setRelatedAssets(slideshowImages);
        Widget previewPanel =
            LinkedViewFactory.createView(previewImage, contentItem.getContributorIds());
        rightPanel.add(previewPanel);
      }
View Full Code Here

        slideshowImages.add(image);
      }
    }
   
    if (!slideshowImages.isEmpty()) {
      AssetContentItem previewImage = slideshowImages.get(0);
      previewImage.setRelatedAssets(slideshowImages);
      Widget previewPanel =
          LinkedViewFactory.createView(previewImage, contentItem.getContributorIds());
      if (previewImage.getImportance() == Importance.HIGH) {
        importantImages.add(previewPanel);
      } else {
        images.add(previewPanel);
        assignNavLinkString(images, AssetType.IMAGE.getNavLinkString());
      }
View Full Code Here

        break;
      case PLAYER:
        widget = new BasePlayerPreview((PlayerContentItem) contentItem);
        break;
      case ASSET:
        AssetContentItem asset = (AssetContentItem) contentItem;
        switch (asset.getAssetType()) {
          case LINK:
            widget = new LinkAssetPreview(asset);
            break;
          case DOCUMENT:
            widget = new DocumentAssetPreview(asset);
            break;
          case AUDIO:
            widget = new AudioAssetView(asset);
            break;
          case INTERACTIVE:
            widget = new GraphicAssetPreview(asset);
            break;
          case VIDEO:
            widget = new VideoAssetPreview(asset);
            break;
          case IMAGE:
            // getRelatedAssets() will return a list that includes the current asset.
            // So we only make a slideshow if there's more than 1 asset in the list.
            if (asset.getRelatedAssets() != null && asset.getRelatedAssets().size() > 1) {
              widget = new SlideshowPreview(asset);
            } else {
              widget = new ImageAssetPreview(asset);
            }
            break;
          default:
            throw new IllegalArgumentException("Asset type " + asset.getAssetType()
                + " does not have a linked view defined.");
        }
        break;
      default:
        throw new IllegalArgumentException("Content item type " + contentItem.getContentItemType()
View Full Code Here

    linkedAssetsByType = new HashMap<AssetType, List<AssetContentItem>>();
    for (AssetType type : AssetType.values()) {
      linkedAssetsByType.put(type, new ArrayList<AssetContentItem>());
    }
    for (BaseContentItem linkedAsset : linkedAssets) {
      AssetContentItem asset = (AssetContentItem) linkedAsset;
      linkedAssetsByType.get(asset.getAssetType()).add(asset);
    }
   
    bind();
  }
View Full Code Here

TOP

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

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.