Package com.dotmarketing.common.db

Examples of com.dotmarketing.common.db.DotConnect.loadObjectResults()


        dc.addParam( userId );
        dc.addParam( "%" + likeName + "%" );
        dc.setMaxRows( limit );
        dc.setStartRow( offset );

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

        for ( Map<String, Object> row : res ) {
            Bundle bundle = PublisherUtil.getBundleByMap( row );
            bundles.add( bundle );
        }
View Full Code Here


        DotConnect dc = new DotConnect();
        dc.setSQL( SELECT_BUNDLE_BY_NAME );
        dc.addParam( bundleName );

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

        if ( res != null && !res.isEmpty() ) {
            return PublisherUtil.getBundleByMap( res.get( 0 ) );
        }
View Full Code Here

  @Override
  public Environment getEnvironmentByName(String name) throws DotDataException {
    DotConnect dc = new DotConnect();
    dc.setSQL(SELECT_ENVIRONMENT_BY_NAME);
    dc.addParam(name);
    List<Map<String, Object>> res = dc.loadObjectResults();
    Environment e = null;

    if(res!=null && !res.isEmpty()) {
      Map<String, Object> row = res.get(0);
      e = PublisherUtil.getEnvironmentByMap(row);
View Full Code Here

    DotConnect dc = new DotConnect();
    dc.setSQL(SELECT_BUNDLE_BY_ID);
    dc.addParam(id);

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

    if(res.size()>0)
      return PublisherUtil.getBundleByMap(res.get(0));
    else
      return null;
View Full Code Here

  public Set<Environment> getEnvironmentsByRole(String roleId) throws DotDataException, NoSuchUserException, DotSecurityException {
    Set<Environment> environments = new HashSet<Environment>();
    DotConnect dc = new DotConnect();
    dc.setSQL(SELECT_ENVIRONMENTS_BY_ROLE_ID);
    dc.addParam(roleId);
    List<Map<String, Object>> res = dc.loadObjectResults();
    for(Map<String, Object> row : res){
      Environment environment = PublisherUtil.getEnvironmentByMap(row);
      environments.add(environment);
    }
    return environments;
View Full Code Here

      throws DotDataException {
    List<Environment> environments = new ArrayList<Environment>();
    DotConnect dc = new DotConnect();
    dc.setSQL(SELECT_ENVIRONMENTS_BY_BUNDLE_ID);
    dc.addParam(bundleId);
    List<Map<String, Object>> res = dc.loadObjectResults();

    for(Map<String, Object> row : res){
      Environment environment = PublisherUtil.getEnvironmentByMap(row);
      environments.add(environment);
    }
View Full Code Here

                    + "join folder f on iden.id = f.identifier join " + tempTableName + " ft on iden.parent_path = ft.parent_path "
                    + "join contentlet c on iden.host_inode = c.identifier and iden.asset_name = ft.asset_name and ft.host_identifier = iden.host_inode "
                    + "join contentlet_version_info cvi on c.inode = cvi.working_inode "
                    + "where asset_type = 'folder' and f.inode <> ft.inode order by c.title, iden.asset_name");

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

            if(!results.isEmpty()) {
                // if we have conflicts, lets create a table out of them

                String fullFolder = " c.title || iden.parent_path || iden.asset_name ";
View Full Code Here

                dc.executeStatement(INSERT_INTO_RESULTS_TABLE);

            }

            dc.setSQL("select * from folders_ir");
            results = dc.loadObjectResults();

            return !results.isEmpty();
        } catch(Exception e) {
            throw new Exception("Error running the Folders Integrity Check", e);
        }
View Full Code Here

            // compare the data from the CSV to the local db data and see if we have conflicts
            dc.setSQL("select s.velocity_var_name as velocity_name, "
                    + "s.inode as local_inode, st.inode as remote_inode from structure s "
                    + "join " + tempTableName + " st on s.velocity_var_name = st.velocity_var_name and s.inode <> st.inode");

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

            if(!results.isEmpty()) {
                // if we have conflicts, lets create a table out of them
                String INSERT_INTO_RESULTS_TABLE = "insert into " +resultsTableName+ " select s.velocity_var_name as velocity_name, "
                        + "s.inode as local_inode, st.inode as remote_inode, '" + endpointId + "' from structure s "
View Full Code Here

            // compare the data from the CSV to the local db data and see if we have conflicts
            dc.setSQL("select s.name, s.id as local_inode, wt.inode as remote_inode from workflow_scheme s "
                    + "join " + tempTableName + " wt on s.name = wt.name and s.id <> wt.inode");

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


            if(!results.isEmpty()) {
                // if we have conflicts, lets create a table out of them
                final String INSERT_INTO_RESULTS_TABLE = "insert into "+resultsTableName+" select s.name, s.id as local_inode, wt.inode as remote_inode , '" + endpointId + "' from workflow_scheme s "
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.