Package org.infoglue.cms.entities.management

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


       
        logger.info("registryEntires:" + registryEntires.size());
        Iterator registryEntiresIterator = registryEntires.iterator();
        while(registryEntiresIterator.hasNext())
        {
            RegistryVO registryVO = (RegistryVO)registryEntiresIterator.next();
            logger.info("registryVO.getReferenceType():" + registryVO.getReferenceType() + ":" + registryVO.getReferencingEntityName() + ":" + registryVO.getReferencingEntityId() + ":" + registryVO.getReferencingEntityCompletingName() + ":" + registryVO.getReferencingEntityCompletingId());
           
            if(!registryVO.getReferenceType().equals(RegistryVO.INLINE_ASSET) && registryVO.getReferencingEntityName().indexOf("SiteNode") == -1)
            {
              logger.info("NOT INLINE ASSET:" + registryVO.getId());
            }
          else if(registryVO.getReferenceType().equals(RegistryVO.PAGE_COMPONENT_BINDING))
            {
            logger.info("Page component binding:" + registryVO.getId() + " - " + registryVO.getReferencingEntityName() + ":" + registryVO.getReferencingEntityId() + ":" + registryVO.getReferencingEntityCompletingName() + ":" + registryVO.getReferencingEntityCompletingId());

              boolean add = true;
             
              String key = "" + registryVO.getReferencingEntityCompletingName() + "_" + registryVO.getReferencingEntityCompletingId();
              ReferenceBean existingReferenceBean = (ReferenceBean)entries.get(key);
              if(existingReferenceBean == null)
              {
                  existingReferenceBean = new ReferenceBean();
                  logger.info("Adding referenceBean to entries with key:" + key);
                entries.put(key, existingReferenceBean);
                referenceBeanList.add(existingReferenceBean);
            }
 
              ReferenceVersionBean referenceVersionBean = new ReferenceVersionBean();

              try
                {
                  SiteNodeVersionVO siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(new Integer(registryVO.getReferencingEntityId()), db);
                  SiteNodeVO siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeVersion.getSiteNodeId(), db);
                  logger.info("siteNodeVersion:" + siteNodeVersion.getSiteNodeVersionId());
                  logger.info("siteNode:" + siteNodeVO.getId());
            existingReferenceBean.setName(siteNodeVO.getName());
            existingReferenceBean.setReferencingCompletingObject(siteNodeVO);
            existingReferenceBean.setPath(SiteNodeController.getController().getSiteNodePath(siteNodeVO.getSiteNodeId(), false, true, db));
            try
            {
              String userName = siteNodeVersion.getVersionModifier();
              if(userName == null || userName.equals(""))
                userName = siteNodeVO.getCreatorName();
             
              InfoGluePrincipal user = UserControllerProxy.getController().getUser(userName);
              if(user != null)
                existingReferenceBean.setContactPersonEmail(user.getEmail());
              else
                existingReferenceBean.setContactPersonEmail(userName);
            }
            catch (Exception e)
            {
              logger.warn("Problem getting version modifier email: " + e.getMessage());
          }

            referenceVersionBean.setReferencingObject(siteNodeVersion);
            referenceVersionBean.getRegistryVOList().add(registryVO);

            LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(siteNodeVO.getRepositoryId(), db);
            ContentVersionVO cvVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(siteNodeVO.getMetaInfoContentId(), masterLanguageVO.getId(), db);
            logger.info("cvVO:" + cvVO.getId());
           
            String assetExtraInfo = RegistryController.getController().getInlineAssetInformation(cvVO.getVersionValue(), new Integer(registryVO.getEntityId()), masterLanguageVO.getLanguageId(), assetKey, false, db);
            logger.info("assetExtraInfo:" + assetExtraInfo);
           
            if(assetExtraInfo != null && !assetExtraInfo.equals(""))
              referenceVersionBean.setReferencingExtraInfo(assetExtraInfo);
            else if(discardMiss)
            {
              add = false;
            }                 
                }
                catch(Exception e)
                {
                    add = false;
                    logger.info("siteNode:" + registryVO.getReferencingEntityId() + " did not exist - skipping..");
                }
             
              if(add)
              {
                  boolean exists = false;
                  ReferenceVersionBean existingReferenceVersionBean = null;
                Iterator versionsIterator = existingReferenceBean.getVersions().iterator();
                while(versionsIterator.hasNext())
                {
                    existingReferenceVersionBean = (ReferenceVersionBean)versionsIterator.next();
                    if(existingReferenceVersionBean == null || existingReferenceVersionBean.getReferencingObject() == null || referenceVersionBean.getReferencingObject() == null || referenceVersionBean == null || existingReferenceVersionBean.getReferencingObject().equals(referenceVersionBean.getReferencingObject()))
                    {
                        exists = true;
                        break;
                    }
                }
 
                if(!exists)
                    existingReferenceBean.getVersions().add(referenceVersionBean);
                else
                    existingReferenceVersionBean.getRegistryVOList().add(registryVO);
                logger.info("existingReferenceBean.getVersions():" + existingReferenceBean.getVersions());
              }
          }
            else
            {
              logger.info("Inline ASSET binding: " + assetKey);
             
              boolean add = true;
             
              String key = "" + registryVO.getReferencingEntityCompletingName() + "_" + registryVO.getReferencingEntityCompletingId();
              ReferenceBean existingReferenceBean = (ReferenceBean)entries.get(key);
              if(existingReferenceBean == null)
              {
                  existingReferenceBean = new ReferenceBean();
                logger.info("Adding referenceBean to entries with key:" + key);
                entries.put(key, existingReferenceBean);
                referenceBeanList.add(existingReferenceBean);
            }
 
              ReferenceVersionBean referenceVersionBean = new ReferenceVersionBean();
              if(registryVO.getReferencingEntityName().indexOf("Content") > -1)
              {
                  try
                  {
                      ContentVersionVO cv = ContentVersionController.getContentVersionController().getContentVersionVOWithId(new Integer(registryVO.getReferencingEntityId()), db);
                      ContentVersionVO latestContentVersion = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(new Integer(registryVO.getReferencingEntityCompletingId()), cv.getLanguageId(), db);
                      Boolean hasVersion = checkedLanguageVersions.get("" + latestContentVersion.getContentId() + "_" + latestContentVersion.getLanguageId());
                      if(hasVersion != null && onlyLatestVersionPerLanguage)
                      {
                        continue;
                        //referenceBeanList.remove(existingReferenceBean);
                      }
                      else if(excludeInternalContentReferences && latestContentVersion.getContentId().equals(contentId))
              {
                        logger.info("Skipping internal reference " + contentId + " had on itself.");
                referenceBeanList.remove(existingReferenceBean);
              }
              else
              {
                logger.info("contentVersion:" + latestContentVersion.getId() + " : " + assetKey);
                boolean includesAsset = RegistryController.getController().hasInlineAsset(latestContentVersion.getVersionValue(), new Integer(registryVO.getEntityId()), assetKey, db);
                logger.info("includesAsset:" + includesAsset);
                if(includesAsset)
                        {
                  ContentVO contentVO = ContentController.getContentController().getContentVOWithId(latestContentVersion.getContentId(), db);
                          existingReferenceBean.setName(contentVO.getName());
                  existingReferenceBean.setReferencingCompletingObject(contentVO);
                  existingReferenceBean.setPath(ContentController.getContentController().getContentPath(contentVO.getContentId(), false, true, db));
                  try
                  {
                    String userName = latestContentVersion.getVersionModifier();
                    if(userName == null || userName.equals(""))
                      userName = contentVO.getCreatorName();
   
                    InfoGluePrincipal user = UserControllerProxy.getController().getUser(userName);
                    if(user != null)
                      existingReferenceBean.setContactPersonEmail(user.getEmail());
                    else
                      existingReferenceBean.setContactPersonEmail(userName);
                  }
                  catch (Exception e)
                  {
                    logger.warn("Problem getting version modifier email: " + e.getMessage());
                }
                  referenceVersionBean.setReferencingObject(latestContentVersion);
                  referenceVersionBean.getRegistryVOList().add(registryVO);
             
                  checkedLanguageVersions.put("" + latestContentVersion.getContentId() + "_" + latestContentVersion.getLanguageId(), new Boolean(true));
                        }
                        else
                {
                          //if(existingReferenceBean.getVersions().size() == 0)
                            referenceBeanList.remove(existingReferenceBean);
                          //logger.info("NOOOOOOOO: This version had no asset reference...");
                }
              }
                  }
                  catch(Exception e)
                  {
                      add = false;
                      logger.info("content:" + registryVO.getReferencingEntityId() + " did not exist - skipping..");
                  }
              }
              else
              {
                try
                  {
                    SiteNodeVersionVO siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(new Integer(registryVO.getReferencingEntityId()), db);
                    SiteNodeVO siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeVersion.getSiteNodeId(), db);
              logger.info("siteNodeVersion:" + siteNodeVersion.getSiteNodeVersionId());
              logger.info("siteNode:" + siteNodeVO.getId());
              existingReferenceBean.setName(siteNodeVO.getName());
              existingReferenceBean.setReferencingCompletingObject(siteNodeVO);
              existingReferenceBean.setPath(SiteNodeController.getController().getSiteNodePath(siteNodeVO.getSiteNodeId(), false, true, db));
              try
              {
                String userName = siteNodeVersion.getVersionModifier();
                if(userName == null || userName.equals(""))
                  userName = siteNodeVO.getCreatorName();
               
                InfoGluePrincipal user = UserControllerProxy.getController().getUser(userName);
                if(user != null)
                  existingReferenceBean.setContactPersonEmail(user.getEmail());
                else
                  existingReferenceBean.setContactPersonEmail(userName);
              }
              catch (Exception e)
              {
                logger.warn("Problem getting version modifier email: " + e.getMessage());
            }
              referenceVersionBean.setReferencingObject(siteNodeVersion);
              referenceVersionBean.getRegistryVOList().add(registryVO);

              LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(siteNodeVO.getRepositoryId(), db);
              ContentVersionVO cvVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(siteNodeVO.getMetaInfoContentId(), masterLanguageVO.getId(), db);
              String assetExtraInfo = RegistryController.getController().getInlineAssetInformation(cvVO.getVersionValue(), new Integer(registryVO.getEntityId()), masterLanguageVO.getLanguageId(), assetKey, false, db);
              if(assetExtraInfo != null && !assetExtraInfo.equals(""))
                referenceVersionBean.setReferencingExtraInfo(assetExtraInfo);
              else
                add = false;
                  }
                  catch(Exception e)
                  {
                      add = false;
                      logger.info("siteNode:" + registryVO.getReferencingEntityId() + " did not exist - skipping..");
                  }
              }
             
              if(add)
              {
View Full Code Here


    @SuppressWarnings("unchecked")
    List<RegistryVO> registryEntires = getMatchingRegistryVOList(SiteNode.class.getName(), siteNodeId.toString(), maxRows, db);
        Iterator<RegistryVO> registryEntiresIterator = registryEntires.iterator();
        while(registryEntiresIterator.hasNext())
        {
            RegistryVO registryVO = registryEntiresIterator.next();
            logger.info("registryVO:" + registryVO.getReferencingEntityId() + ":" +  registryVO.getReferencingEntityCompletingId());
            ReferenceBean referenceBean = getReferenceBeanFromRegistryVO(registryVO, entries, checkedLanguageVersions, onlyLatestVersion, onlyOneVersionPerLanguage, db);
            if (referenceBean != null)
            {
              referenceBeanList.add(referenceBean);
            }
View Full Code Here

    int i = 0;
    while (results.hasMore() && (maxRows == -1 || i < maxRows))
        {
            Registry registry = (Registry)results.next();
            RegistryVO registryVO = registry.getValueObject();
            matchingRegistryVOList.add(registryVO);

            i++;
        }
View Full Code Here

 
      int i = 0;
      while (results.hasMore() && (maxRows == -1 || i < maxRows))
          {
              Registry registry = (Registry)results.next();
              RegistryVO registryVO = registry.getValueObject();
             
              if(registryVO.getReferencingEntityCompletingName().indexOf("SiteNode") > -1)
              {
                try
                {
                  Set<Integer> existingSiteNodeIds = contentSiteNodeIdListMap.get("" + registryVO.getEntityId());
                  if(existingSiteNodeIds == null)
                  {
                    existingSiteNodeIds = new HashSet<Integer>();
                    contentSiteNodeIdListMap.put("" + registryVO.getEntityId(), existingSiteNodeIds);
                  }
                  siteNodeIds.add(new Integer(registryVO.getReferencingEntityCompletingId()));
                  //SiteNodeVO siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(new Integer(registryVO.getReferencingEntityCompletingId()), db);
                  existingSiteNodeIds.add(new Integer(registryVO.getReferencingEntityCompletingId()));
                }
                catch (Exception e)
                {
                  logger.error("Error getting related sitenode:" + e.getMessage());
          }
View Full Code Here

      List registryVOList = getMatchingRegistryVOListForReferencingEntity(referencingEntityName, referencingEntityId, db);
       
      Iterator i = registryVOList.iterator();
      while(i.hasNext())
      {
          RegistryVO registryVO = (RegistryVO)i.next();
          if(registryVO.getEntityName().indexOf("Content") > -1)
              {
                  try
                  {
                      Content content = ContentController.getContentController().getContentWithId(new Integer(registryVO.getEntityId()), db);
              logger.info("contentVersion:" + content.getContentId());
              result.add(content.getValueObject());
                  }
                  catch(Exception e)
                  {
                      logger.info("content:" + registryVO.getEntityId() + " did not exist - skipping..");
                  }
              }
              else if(registryVO.getEntityName().indexOf("SiteNode") > -1)
              {
                  try
                  {
                    SiteNode siteNode = SiteNodeController.getController().getSiteNodeWithId(new Integer(registryVO.getEntityId()), db);
              logger.info("siteNode:" + siteNode.getId());
              result.add(siteNode.getValueObject());
            }
                  catch(Exception e)
                  {
                      logger.info("siteNode:" + registryVO.getEntityId() + " did not exist - skipping..");
                  }
              }
      }
     
      commitTransaction(db);
View Full Code Here

    List registryVOList = getMatchingRegistryVOListForReferencingEntity(referencingEntityName, referencingEntityId, db);
     
    Iterator i = registryVOList.iterator();
    while(i.hasNext())
    {
        RegistryVO registryVO = (RegistryVO)i.next();
        if(registryVO.getEntityName().indexOf("Content") > -1)
            {
                try
                {
                    ContentVO contentVO = ContentController.getContentController().getContentVOWithId(new Integer(registryVO.getEntityId()), db);
            logger.info("contentVO:" + contentVO.getId());
            result.add(contentVO);
                }
                catch(Exception e)
                {
                    logger.info("content:" + registryVO.getEntityId() + " did not exist - skipping..");
                }
            }
            else if(registryVO.getEntityName().indexOf("SiteNode") > -1)
            {
                try
                {
                  SiteNodeVO siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(new Integer(registryVO.getEntityId()), db);
            logger.info("siteNodeVO:" + siteNodeVO.getId());
            result.add(siteNodeVO);
          }
                catch(Exception e)
                {
                    logger.info("siteNode:" + registryVO.getEntityId() + " did not exist - skipping..");
                }
            }
    }
   
    return result;
View Full Code Here

      QueryResults results = oql.execute(Database.READONLY);
     
      while (results.hasMore())
          {
              Registry registry = (Registry)results.next();
              RegistryVO registryVO = registry.getValueObject();
            //logger.info("found match:" + registryVO.getEntityName() + ":" + registryVO.getEntityId());
             
              matchingRegistryVOList.add(registryVO);
          }      
     
View Full Code Here

    QueryResults results = oql.execute(Database.READONLY);
   
    while (results.hasMore())
        {
            Registry registry = (Registry)results.next();
            RegistryVO registryVO = registry.getValueObject();
          //System.out.println("found match:" + registryVO.getEntityName() + ":" + registryVO.getEntityId());
           
            matchingRegistryVOList.add(registryVO);
           
            if(limit > -1 && matchingRegistryVOList.size() > limit)
View Full Code Here

   * This method return a RegistryVO
   */
 
  public RegistryVO getRegistryVOWithId(Integer registryId) throws SystemException, Exception
  {
    RegistryVO registryVO = (RegistryVO)getVOWithId(RegistryImpl.class, registryId);

    return registryVO;
  }
View Full Code Here

    return registryVO;
  }

  public RegistryVO getRegistryVOWithId(Integer registryId, Database db) throws SystemException, Exception
  {
    RegistryVO registryVO = (RegistryVO)getVOWithId(RegistryImpl.class, registryId, db);

    return registryVO;
  }
View Full Code Here

TOP

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

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.