Package com.google.livingstories.server.dataservices.entities

Examples of com.google.livingstories.server.dataservices.entities.LivingStoryEntity$Summary


          ExternalServiceKeyChain externalKeys = new ExternalServiceKeyChain(getServletContext());
          cachedPublisherName = externalKeys.getPublisherName();
          cachedFromAddress = externalKeys.getFromAddress();
        }
      
        LivingStoryEntity livingStory = pm.getObjectById(LivingStoryEntity.class,
            eventContentItem.getLivingStoryId());
        String baseLspUrl = getBaseServerUrl() + "/lsps/" + livingStory.getUrl();
       
        String eventSummary = eventContentItem.getEventSummary();
        String eventDetails = eventContentItem.getContent();
        if (GlobalUtil.isContentEmpty(eventSummary)
            && !GlobalUtil.isContentEmpty(eventDetails)) {
          eventSummary = SnippetUtil.createSnippet(JavaNodeAdapter.fromHtml(eventDetails),
              EMAIL_ALERT_SNIPPET_LENGTH);
        }

        ImmutableMap<String, String> placeholderMap = new ImmutableMap.Builder<String, String>()
            .put("storyTitle", livingStory.getTitle())
            .put("updateTitle", eventContentItem.getEventUpdate())
            .put("publisherName", cachedPublisherName)
            .put("snippet", StringUtil.stripForExternalSites(eventSummary))
            .put("linkUrl", baseLspUrl + "#OVERVIEW:false,false,false,false,n,n,n:"
                + eventContentItem.getId())
View Full Code Here


   
    PersistenceManager pm = PMF.get().getPersistenceManager();
    Transaction tx = null;
   
    try {
      LivingStoryEntity entity = null;
      if (id == null) {
        entity = new LivingStoryEntity(urlName, title, publishState, summary);
      } else {
        entity = pm.getObjectById(LivingStoryEntity.class, id);
        entity.setUrl(urlName);
        entity.setTitle(title);
        entity.setPublishState(publishState);
        String previousLatestRevision = entity.getSummary();
        if (!previousLatestRevision.equals(summary)) {
          entity.addSummaryRevision(summary);
        }
      }
      tx = pm.currentTransaction();
      tx.begin();
      pm.makePersistent(entity);
      tx.commit();
      return entity.toClientObject(false);
    } finally {
      if (tx != null && tx.isActive()) {
        tx.rollback();
      }
      pm.close();
View Full Code Here

    DataImplFactory.getThemeService().deleteThemesForLivingStory(id);
   
    PersistenceManager pm = PMF.get().getPersistenceManager();
    try {
      // Finally delete the story entity itself
      LivingStoryEntity livingStory = pm.getObjectById(LivingStoryEntity.class, id);
      pm.deletePersistent(livingStory);
    } finally {
      pm.close();
    }
  }
View Full Code Here

      // Map all the ids in the BaseContentEntity objects to the new ones
      while (iter.hasNext()) {
        BaseContentEntity contentEntity = iter.next();
        // Living Story ids
        if (contentEntity.getLivingStoryId() != null) {
          LivingStoryEntity livingStory =
              livingStoryMap.get(contentEntity.getLivingStoryId().toString());
          if (livingStory != null) {
            contentEntity.setLivingStoryId(livingStory.getId());
          }
        }
       
        // Theme ids
        Set<Long> themeIds = Sets.newHashSet();
View Full Code Here

TOP

Related Classes of com.google.livingstories.server.dataservices.entities.LivingStoryEntity$Summary

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.