Examples of ProcessBean


Examples of org.infoglue.cms.applications.databeans.ProcessBean

      logger.debug("Number of processes before filtering: " + processes.size());
    }
    if (this.processStatus != -1)
    {
      Iterator<ProcessBean> processIterator = processes.iterator();
      ProcessBean process;
      while (processIterator.hasNext())
      {
        process = processIterator.next();
        if (process.getStatus() != this.processStatus)
        {
          logger.debug("Removing (filtering) process with Id: " + process.getProcessId());
          processIterator.remove();
        }
      }
    }
    if (logger.isDebugEnabled())
View Full Code Here

Examples of org.infoglue.cms.applications.databeans.ProcessBean

     private boolean anonymousNoAccessWarning = false;

  protected String doExecute() throws Exception
  {
    ProcessBean processBean = ProcessBean.createProcessBean(ViewListContentVersionAction.class.getName(), "" + getInfoGluePrincipal().getName());
    processBean.setStatus(ProcessBean.RUNNING);

    try
    {
      if(this.contentId != null)
      {
        Timer t = new Timer();
          ContentVO contentVO = ContentController.getContentController().getContentVOWithId(this.contentId);
          this.repositoryId = contentVO.getRepositoryId();
         
        AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
     
        Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentId);
        if(protectedContentId != null && !AccessRightController.getController().getIsPrincipalAuthorized(this.getInfoGluePrincipal(), "Content.SubmitToPublish", protectedContentId.toString()))
          ceb.add(new AccessConstraintException("Content.contentId", "1005"));
       
        ceb.throwIfNotEmpty();
 
        RequestAnalyser.getRequestAnalyser().registerComponentStatistics("ViewListContentVersion part 1", t.getElapsedTime());
       
        //Set<SiteNodeVersionVO> siteNodeVersionVOList = new HashSet<SiteNodeVersionVO>();
        //Set<ContentVersionVO> contentVersionVOList = new HashSet<ContentVersionVO>();
 
        ContentVersionController.getContentVersionController().getContentAndAffectedItemsRecursive(this.contentId, ContentVersionVO.WORKING_STATE, this.siteNodeVersionVOList, this.contentVersionVOList, true, true, processBean);
        RequestAnalyser.getRequestAnalyser().registerComponentStatistics("ViewListContentVersion getContentAndAffectedItemsRecursive", t.getElapsedTime());
       
        processBean.updateProcess("Found " + this.siteNodeVersionVOList.size() + " pages and " + this.contentVersionVOList.size() + " contents");
       
        /*
        Set<ContentVersionVO> contentVersionVOListSet = new HashSet<ContentVersionVO>();
        for(Integer contentVersionId : contentVersionVOSet)
        {
          contentVersionVOListSet.add(ContentVersionController.getContentVersionController().getContentVersionVOWithId(contentVersionId));
        }
        */
       
        RequestAnalyser.getRequestAnalyser().registerComponentStatistics("ViewListContentVersion versions", t.getElapsedTime());
 
        Database db = CastorDatabaseService.getDatabase();
 
            beginTransaction(db);
 
            try
            {
              boolean skipDisplayName = false;
          for(ContentVersionVO contentVersionVO : contentVersionVOList)
          {
            if(contentVersionVO.getStateId() == 0
            {
              Integer localProtectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentVersionVO.getContentId());
              if(localProtectedContentId != null)
              {
                boolean hasAnonymousUserAccess = AccessRightController.getController().getIsPrincipalAuthorized(db, UserControllerProxy.getController().getUser(CmsPropertyHandler.getAnonymousUser()), "Content.Read", localProtectedContentId.toString(), false);
                if(!hasAnonymousUserAccess)
                {
                  anonymousNoAccessWarning = true;
                  contentVersionVO.setHasAnonymousUserAccess(false);
                }
              }

              if(!skipDisplayName)
              {
                InfoGluePrincipal principal = (InfoGluePrincipal)getInfoGluePrincipal(contentVersionVO.getVersionModifier(), db);
                if(principal != null)
                {
                  if(principal.getName().equalsIgnoreCase(principal.getDisplayName()))
                    skipDisplayName = true;
                 
                  contentVersionVO.setVersionModifierDisplayName(principal.getDisplayName());
                }
              }
              contentVersionVO.setPath(getContentPath(contentVersionVO.getContentId(), db));
              contentVersionVO.setLanguageName(LanguageController.getController().getLanguageVOWithId(contentVersionVO.getLanguageId()).getName());
            }
            else
              logger.info("Not adding contentVersion..");
          }
         
          for(SiteNodeVersionVO snVO : siteNodeVersionVOList)
          {
            if(snVO.getStateId() == 0)
            {
              Integer protectedSiteNodeVersionId = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getProtectedSiteNodeVersionId(snVO.getId(), db);
              if(protectedSiteNodeVersionId != null)
              {
                boolean hasAnonymousUserAccess = AccessRightController.getController().getIsPrincipalAuthorized(db, UserControllerProxy.getController().getUser(CmsPropertyHandler.getAnonymousUser()), "SiteNodeVersion.Read", protectedSiteNodeVersionId.toString(), false);
                if(!hasAnonymousUserAccess)
                {
                  anonymousNoAccessWarning = true;
                  snVO.setHasAnonymousUserAccess(false);
                }
              }
             
              if(!skipDisplayName)
              {
                InfoGluePrincipal principal = (InfoGluePrincipal)getInfoGluePrincipal(snVO.getVersionModifier(), db);
                if(principal != null)
                {
                  if(principal.getName().equalsIgnoreCase(principal.getDisplayName()))
                    skipDisplayName = true;
                 
                  snVO.setVersionModifierDisplayName(principal.getDisplayName());
                }
              }
              snVO.setPath(getSiteNodePath(snVO.getSiteNodeId(), db));
            }
            else
              logger.info("Not adding siteNodeVersion..");
          }
         
          commitTransaction(db);
            }
            catch(Exception e)
            {
                logger.error("An error occurred so we should not complete the transaction:" + e);
                logger.warn("An error occurred so we should not complete the transaction:" + e, e);
                rollbackTransaction(db);
                throw new SystemException(e.getMessage());
            }
 
        processBean.updateProcess("Added metadata");

          Collections.sort(contentVersionVOList, Collections.reverseOrder(new ReflectionComparator("modifiedDateTime")));
             
        Set siteNodeVersionVOListSet = new HashSet();
        siteNodeVersionVOListSet.addAll(siteNodeVersionVOList);
        siteNodeVersionVOList.clear();
        siteNodeVersionVOList.addAll(siteNodeVersionVOListSet);
 
          Collections.sort(siteNodeVersionVOList, Collections.reverseOrder(new ReflectionComparator("modifiedDateTime")));
         
          RequestAnalyser.getRequestAnalyser().registerComponentStatistics("ViewListContentVersion end", t.getElapsedTime());
      }
    }
    finally
    {
      processBean.setStatus(ProcessBean.FINISHED);
      processBean.removeProcess();
    }
   
      return "success";
  }
View Full Code Here

Examples of org.infoglue.cms.applications.databeans.ProcessBean

  public String doDeleteProcessBean() throws Exception
  {
    if(this.processId != null)
    {
      ProcessBean pb = ProcessBean.getProcessBean(ImportRepositoryAction.class.getName(), processId);
      if(pb != null)
        pb.removeProcess();
    }
   
    return "successRedirectToProcesses";
  }
View Full Code Here

Examples of org.infoglue.cms.applications.databeans.ProcessBean

   */
 
  protected String importV3(File file) throws Exception
  {
    String exportId = "Import_" + visualFormatter.formatDate(new Date(), "yyyy-MM-dd_HHmm");
    ProcessBean processBean = ProcessBean.createProcessBean(ImportRepositoryAction.class.getName(), exportId);
   
    OptimizedImportController.importRepositories(file, this.onlyLatestVersions, this.standardReplacement, this.replacements, processBean);
   
    return "successRedirectToProcesses";
  }
View Full Code Here

Examples of org.infoglue.cms.applications.databeans.ProcessBean

      if(exportFormat.equalsIgnoreCase("3") || this.exportFormat.equals("3") || requestExportFormat.equals("3"))
      {
        String[] repositories = getRequest().getParameterValues("repositoryId");
       
        String exportId = "Copy_Import_" + visualFormatter.formatDate(new Date(), "yyyy-MM-dd_HHmm");
        ProcessBean processBean = ProcessBean.createProcessBean(ImportRepositoryAction.class.getName(), exportId);
       
        OptimizedExportController.copy(repositories, -1, false, null, processBean, onlyLatestVersions, standardReplacement, replacements);

        return "successRedirectToProcesses";
      }
View Full Code Here

Examples of org.infoglue.cms.applications.databeans.ProcessBean

    File file = new File(CmsPropertyHandler.getSQLUpgradePath() + File.separator + "www.infoglue.org.zip");
    if(file == null || !file.exists())
      throw new SystemException("The file upload must have gone bad as no example site was found.");
   
    String exportId = "Import_" + visualFormatter.formatDate(new Date(), "yyyy-MM-dd_HHmm");
    ProcessBean processBean = ProcessBean.createProcessBean(ImportRepositoryAction.class.getName(), exportId);
    try
    {
      OptimizedImportController.importRepositories(file, "false", null, null, processBean);
     
      int count = 0;
      while(processBean.getStatus() != ProcessBean.FINISHED && count < 30)
      {
        Thread.sleep(1000);
        count++;
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.