Package ch.entwine.weblounge.common.content.movie

Examples of ch.entwine.weblounge.common.content.movie.MovieResource


      deleteResource(resourceResult.getResourceURI());
      logger.info("Deleted harvestet resource " + recordIdentifier);
    } else {
      if (searchResult.getHitCount() == 1) {
        MovieResourceSearchResultItemImpl movieResultItem = (MovieResourceSearchResultItemImpl) searchResult.getItems()[0];
        MovieResource movieResource = movieResultItem.getMovieResource();

        if (!date.after(movieResource.getPublishFrom()))
          return;
        logger.warn("Update harvested element {}", recordIdentifier);

        Resource<MovieContent> resource = parseResource(record);
        resource.getURI().setIdentifier(movieResource.getIdentifier());
        resource.setPublished(harvesterUser, date, null);
        removeContents(resource);

        MovieContent content = parseResourceContent(record);
        content.setSource(recordIdentifier);
View Full Code Here


    } catch (ContentRepositoryException e) {
      logger.error("Error trying to look up video resource {} from {}", videoId, repository);
      return SKIP_BODY;
    }

    MovieResource video = null;
    MovieContent videoContent = null;

    // Store the result in the jsp page context
    try {
      video = (MovieResource) repository.get(uri);
      video.switchTo(language);
      videoContent = video.getContent(language);
      if (videoContent == null)
        videoContent = video.getOriginalContent();
    } catch (ContentRepositoryException e) {
      logger.warn("Error trying to load video resource " + uri + ": " + e.getMessage(), e);
      return SKIP_BODY;
    }

    // TODO: Check the permissions

    // Store the resource and the resource content in the request
    stashAndSetAttribute(VideoResourceTagExtraInfo.VIDEO, video);
    stashAndSetAttribute(VideoResourceTagExtraInfo.VIDEO_CONTENT, videoContent);

    // Add cache tags to the response
    response.addTag(CacheTag.Resource, video.getURI().getIdentifier());
    response.addTag(CacheTag.Url, video.getURI().getPath());

    return EVAL_BODY_INCLUDE;
  }
View Full Code Here

  public Resource<MovieContent> newResource(Site site, InputStream is,
      User user, Language language) {

    // TODO: Extract av metadata

    MovieResource avResource = new MovieResourceImpl(new MovieResourceURIImpl(site));
    avResource.setCreated(user, new Date());

    return avResource;
  }
View Full Code Here

    for (ResourceMetadata<?> metadataItem : metadata) {
      if (XML.equals(metadataItem.getName())) {
        String resourceXml = (String) metadataItem.getValues().get(0);
        try {
          ResourceReader<MovieContent, MovieResource> reader = getReader();
          MovieResource audioVisual = reader.read(IOUtils.toInputStream(resourceXml, "UTF-8"), site);
          return audioVisual;
        } catch (SAXException e) {
          logger.warn("Error parsing audio visual resource from metadata", e);
          return null;
        } catch (IOException e) {
View Full Code Here

TOP

Related Classes of ch.entwine.weblounge.common.content.movie.MovieResource

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.