Package org.infoglue.cms.entities.management

Examples of org.infoglue.cms.entities.management.SubscriptionVO


        String key = "subscription_" + interceptionPointIds[i] + "_" + extraParameters;
        List subscriptionVOList = subscriptionsController.getSubscriptionVOList(interceptionPointId, null, null, entityName, entityId, this.getInfoGluePrincipal().getName(), null);
        Iterator<SubscriptionVO> subscriptionVOListIterator = subscriptionVOList.iterator();
        while(subscriptionVOListIterator.hasNext())
        {
          SubscriptionVO subscriptionVO = subscriptionVOListIterator.next();
          subscriptionsController.delete(subscriptionVO);
        }
      }
     
      if(subscribedInterceptionPointId != null)
      {
        for(int i=0; i<subscribedInterceptionPointId.length; i++)
        {
          Integer interceptionPointId = subscribedInterceptionPointId[i];
          SubscriptionVO subscriptionVO = new SubscriptionVO();
          subscriptionVO.setInterceptionPointId(interceptionPointId);
            subscriptionVO.setName(name);
            subscriptionVO.setIsGlobal(false);
          subscriptionVO.setEntityName(entityName);
          subscriptionVO.setEntityId(entityId);
          subscriptionVO.setUserName(this.getInfoGluePrincipal().getName());
         
          subscriptionsController.create(subscriptionVO);
        }
      }
      else
View Full Code Here


    return "inputGlobalSubscriptions";
    }
   
    public String doGlobalSubscriptions() throws Exception
    {
      SubscriptionVO subscriptionVO = new SubscriptionVO();
      subscriptionVO.setIsGlobal(true);
      subscriptionVO.setInterceptionPointId(interceptionPointId);
      subscriptionVO.setName(name);
      subscriptionVO.setUserName(this.getInfoGluePrincipal().getName());
     
      List<SubscriptionFilterVO> subscriptionFilterVOList = new ArrayList<SubscriptionFilterVO>();
     
      int i=0;
      String filterType = this.getRequest().getParameter("filterType_" + i);
View Full Code Here

      return "successGlobalSubscriptions";
    }

    public String doUpdateGlobalSubscription() throws Exception
    {
      SubscriptionVO subscriptionVO = subscriptionsController.getSubscriptionVOWithId(subscriptionId);

      subscriptionVO.setIsGlobal(true);
      subscriptionVO.setInterceptionPointId(interceptionPointId);
      subscriptionVO.setName(name);
     
      List<SubscriptionFilterVO> subscriptionFilterVOList = new ArrayList<SubscriptionFilterVO>();
     
      int i=0;
      String filterType = this.getRequest().getParameter("filterType_" + i);
View Full Code Here

      return "successGlobalSubscriptions";
    }
       
    public String doGetSubscriptionForm() throws Exception
    {
      SubscriptionVO subscriptionVO = subscriptionsController.getSubscriptionVOWithId(subscriptionId);
     
      StringBuffer sb = new StringBuffer();
     
      sb.append("<form action=\"Subscriptions!updateGlobalSubscription.action\" name=\"inputForm\" method=\"post\">");
      sb.append("<input type=\"hidden\" name=\"subscriptionId\" value=\"" + subscriptionVO.getId() + "\" style=\"border: 0px;\"/>");
      sb.append("<fieldset style=\"width: 90%; border: 0px solid red; margin: 0px; padding-left: 10px;\">");
     
      sb.append("  <h3>" + getLocalizedString(getLocale(), "tool.common.subscriptionBasics.label") + "</h3>");
      sb.append("  <p style=\"clear: both;\">");
     
      sb.append("  <label for=\"name\">" + getLocalizedString(getLocale(), "tool.common.subscriptionName.label") + "</label>");
      sb.append("  <input type=\"text\" name=\"name\" value=\"" + subscriptionVO.getName() + "\"/>");
      sb.append("  </p>");
   
    sb.append("  <p style=\"clear: both;\">");
      sb.append("  <label for=\"interceptionPointId\">" + getLocalizedString(getLocale(), "tool.common.subscriptionType.label") + "</label>");
      sb.append("  <select name=\"interceptionPointId\">");
      sb.append("    <option value=\"33\" " + (subscriptionVO.getInterceptionPointId().intValue() == 33 ? "selected='selected'" : "") + ">Content.Published</option>");
      sb.append("    <option value=\"22\" " + (subscriptionVO.getInterceptionPointId().intValue() == 22 ? "selected='selected'" : "") + ">Content.Delete</option>");
      sb.append("  </select>");
      sb.append("  </p>");
     
      sb.append("  <div style=\"clear: both;\"></div>");
   
      sb.append("  <h4 style=\"border-bottom: 1px solid #bbb;\">" + getLocalizedString(getLocale(), "tool.common.subscriptionsFilters.label") + "</h4>");

      this.contentTypeDefintionVOList = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOList();
    this.categoryVOList = CategoryController.getController().getAllActiveCategories();
   
      int i = 0;
      int size = subscriptionVO.getSubscriptionFilterVOList().size();
      Iterator<SubscriptionFilterVO> subscriptionFilterVOListIterator = subscriptionVO.getSubscriptionFilterVOList().iterator();
      while(subscriptionFilterVOListIterator.hasNext())
      {
        SubscriptionFilterVO subscriptionFilterVO = subscriptionFilterVOListIterator.next();
       
        sb.append("  <div id=\"filterRow_" + i + "\" class=\"formRow\" style=\"min-height: 50px; border: 0px solid red; border-bottom: 1px solid #bbb;\">");
View Full Code Here

        return subscription.getValueObject();
    }

    public SubscriptionVO create(SubscriptionVO subscriptionVO,List<SubscriptionFilterVO> subscriptionFilterVOList) throws ConstraintException, SystemException
    {
      SubscriptionVO newSubscriptionVO = null;
     
      Database db = CastorDatabaseService.getDatabase();
   
    try
    {
View Full Code Here

          SiteNodeVO siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(new Integer(transactionQueueVO.getTransactionObjectId()), db);
          if(siteNodeVO != null)
          {
            SiteNodeVersionVO version = SiteNodeVersionController.getController().getLatestSiteNodeVersionVO(db, siteNodeVO.getId());

            SubscriptionVO creatorSubscriptionVO = new SubscriptionVO();
            creatorSubscriptionVO.setEntityId(transactionQueueVO.getTransactionObjectId());
            creatorSubscriptionVO.setEntityName(transactionQueueVO.getTransactionObjectName());
            creatorSubscriptionVO.setInterceptionPointId(transactionQueueVO.getInterceptionPointVO().getId());
            creatorSubscriptionVO.setName("Standard subscription");
            creatorSubscriptionVO.setUserName(siteNodeVO.getCreatorName());
            subscriptionVOList.add(creatorSubscriptionVO);

            if(version != null)
            {
              if(!version.getVersionModifier().equals(siteNodeVO.getCreatorName()))
              {
                SubscriptionVO modifyerSubscriptionVO = new SubscriptionVO();
                modifyerSubscriptionVO.setEntityId(transactionQueueVO.getTransactionObjectId());
                modifyerSubscriptionVO.setEntityName(transactionQueueVO.getTransactionObjectName());
                modifyerSubscriptionVO.setInterceptionPointId(transactionQueueVO.getInterceptionPointVO().getId());
                modifyerSubscriptionVO.setName("Standard subscription");
                modifyerSubscriptionVO.setUserName(version.getVersionModifier());
                subscriptionVOList.add(modifyerSubscriptionVO);
              }
            }
          }
        }
        else if(transactionQueueVO.getInterceptionPointVO().getName().equalsIgnoreCase("Content.ExpireDateComingUp"))
        {
          logger.info("It's a expiredate coming up event... let's find add a fake subscription on the last modifier.");
          ContentVO contentVO = ContentController.getContentController().getContentVOWithId(new Integer(transactionQueueVO.getTransactionObjectId()), db);
         
          if(contentVO != null)
          {
            SubscriptionVO creatorSubscriptionVO = new SubscriptionVO();
            creatorSubscriptionVO.setEntityId(transactionQueueVO.getTransactionObjectId());
            creatorSubscriptionVO.setEntityName(transactionQueueVO.getTransactionObjectName());
            creatorSubscriptionVO.setInterceptionPointId(transactionQueueVO.getInterceptionPointVO().getId());
            creatorSubscriptionVO.setName("Standard subscription");
            creatorSubscriptionVO.setUserName(contentVO.getCreatorName());
            subscriptionVOList.add(creatorSubscriptionVO);
 
            List languages = LanguageController.getController().getLanguageVOList(contentVO.getRepositoryId(), db);
            Iterator languagesIterator = languages.iterator();
            while(languagesIterator.hasNext())
            {
              LanguageVO languageVO = (LanguageVO)languagesIterator.next();
              ContentVersionVO version = ContentVersionController.getContentVersionController().getLatestContentVersionVO(contentVO.getId(), languageVO.getId(), db);
             
              if(version != null)
              {             
                if(!version.getVersionModifier().equals(contentVO.getCreatorName()))
                {
                  SubscriptionVO modifyerSubscriptionVO = new SubscriptionVO();
                  modifyerSubscriptionVO.setEntityId(transactionQueueVO.getTransactionObjectId());
                  modifyerSubscriptionVO.setEntityName(transactionQueueVO.getTransactionObjectName());
                  modifyerSubscriptionVO.setInterceptionPointId(transactionQueueVO.getInterceptionPointVO().getId());
                  modifyerSubscriptionVO.setName("Standard subscription");
                  modifyerSubscriptionVO.setUserName(version.getVersionModifier());
                  subscriptionVOList.add(modifyerSubscriptionVO);
                }
              }
            }
          }
        }
       
        Iterator<SubscriptionVO> subscriptionVOListIterator = subscriptionVOList.iterator();
        while(subscriptionVOListIterator.hasNext())
        {
          SubscriptionVO subscriptionVO = subscriptionVOListIterator.next();
          boolean subscriptionHandled = handleSubscription(subscriptionVO, transactionQueueVO, db);
          if(subscriptionHandled)
            completeTransactions.add(transactionQueueVO);
        }
         
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.management.SubscriptionVO

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.