Examples of PushedAsset


Examples of com.dotcms.publisher.assets.bean.PushedAsset

    dc.addParam(environmentId);

    List<Map<String, Object>> res = dc.loadObjectResults();

    for(Map<String, Object> row : res){
      PushedAsset asset = PublisherUtil.getPushedAssetByMap(row);
      assets.add(asset);
    }

    return assets;
View Full Code Here

Examples of com.dotcms.publisher.assets.bean.PushedAsset

    dc.addParam(assetId);

    List<Map<String, Object>> res = dc.loadObjectResults();

    for(Map<String, Object> row : res){
      PushedAsset asset = PublisherUtil.getPushedAssetByMap(row);
      assets.add(asset);
    }

    return assets;
  }
View Full Code Here

Examples of com.dotcms.publisher.assets.bean.PushedAsset

    dc.addParam(environmentId);

    List<Map<String, Object>> res = dc.loadObjectResults();

    for(Map<String, Object> row : res){
      PushedAsset asset = PublisherUtil.getPushedAssetByMap(row);
      assets.add(asset);
    }

    return assets;
  }
View Full Code Here

Examples of com.dotcms.publisher.assets.bean.PushedAsset

    cache = CacheLocator.getCacheAdministrator();
  }


  public synchronized PushedAsset getPushedAsset(String assetId, String environmentId) {
    PushedAsset asset = null;
    try {
      asset = (PushedAsset) cache.get(assetId + "|" + environmentId, cacheGroup);
    }
    catch(DotCacheException e) {
      Logger.debug(this, "PublishingEndPoint cache entry not found for: " + assetId + "|" + environmentId);
View Full Code Here

Examples of com.dotcms.publisher.assets.bean.PushedAsset

            isForcePush = bundle.isForcePush();
        }

        if ( !isForcePush && !isDownload && isPublish ) {
            for (Environment env : envs) {
        PushedAsset asset = cache.getPushedAsset(assetId, env.getId());

        modified = (asset==null || (assetModDate!=null && asset.getPushDate().before(assetModDate)));
       
        try {
            if(!modified && assetType.equals("content")) {
                // check for versionInfo TS on content
                for(Language lang : APILocator.getLanguageAPI().getLanguages()) {
                            ContentletVersionInfo info=APILocator.getVersionableAPI().getContentletVersionInfo(assetId, lang.getId());
                            if(info!=null && InodeUtils.isSet(info.getIdentifier())) {
                                modified = modified || assetModDate.before(info.getVersionTs());
                            }
                }
            }
            if(!modified && (assetType.equals("template") || assetType.equals("links") || assetType.equals("container") || assetType.equals("htmlpage"))) {
                // check for versionInfo TS
                        VersionInfo info=APILocator.getVersionableAPI().getVersionInfo(assetId);
                        if(info!=null && InodeUtils.isSet(info.getIdentifier())) {
                            modified = assetModDate.before(info.getVersionTs());
                        }
            }
        } catch (Exception e) {
                    Logger.warn(getClass(), "Error checking versionInfo for assetType:"+assetType+" assetId:"+assetId+
                            " process continues without checking versionInfo.ts",e);
                }
       
        if(modified) {
          try {
            //We need to check if the assetID is already in the bundle.
            //1.Get all the pushed assests records with same Asset ID.
            List<PushedAsset> pushedAssests = APILocator.getPushedAssetsAPI().getPushedAssets(assetId);
            boolean isAlreadyInPushedBunble = false;
           
            //Check through the records to see if match env and bundle ID.
            for(PushedAsset pushedAsset : pushedAssests){
              if(pushedAsset.getBundleId().equals(bundleId)
                  && pushedAsset.getEnvironmentId().equals(env.getId())){
                isAlreadyInPushedBunble = true;
              }
            }
           
            //If it is not already in the bundle, we can push the record.
            if(!isAlreadyInPushedBunble){
              asset = new PushedAsset(bundleId, assetId, assetType, new Date(), env.getId());
              APILocator.getPushedAssetsAPI().savePushedAsset(asset);
            }
           
            cache.add(asset);
           
View Full Code Here

Examples of com.dotcms.publisher.assets.bean.PushedAsset

    b.setForcePush(row.get("force_push") == null ? false :DbConnectionFactory.isDBTrue(row.get("force_push").toString()));
    return b;
  }

  public static PushedAsset getPushedAssetByMap(Map<String, Object> row){
    PushedAsset b = new PushedAsset();
    b.setBundleId(row.get("bundle_id").toString());
    b.setAssetId(row.get("asset_id").toString());
    b.setAssetType(row.get("asset_type").toString());
    b.setPushDate((Date)row.get("push_date"));
    b.setEnvironmentId(row.get("environment_id").toString());
    return b;
  }
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.