Generate column for each ancestor.
@param currentResource Current resource
@param rootResource Root resource
@return Columns
2240
private static List<Column> getAncestorColumns(Resource currentResource, Resource rootResource) {
    List<Column> columns = new ArrayList<>();
    List<Resource> ancestors = getAncestors(currentResource, rootResource);
    for (int i = 0; i < ancestors.size(); i++) {
      Resource r = ancestors.get(i);

      String activeId;
      if (i < ancestors.size() - 1) {
        activeId = ancestors.get(i + 1).getPath();
      }
      else {
        activeId = currentResource.getPath();
      }

      Column column = new Column()
          .columnId(r.getPath())
          .lazy(true)
          .activeId(activeId);
      columns.add(column);
    }
    return columns;
  }
1098122
public HashResource restoreRelativeRoot(HashResource previousValue) {
		HashResource value = relativeRoot;
		relativeRoot = previousValue;
		return value;
	}
659409
@Override
    public List<DColumn> getColumns(String storeName, String rowKey, String startColumn, String endColumn, int count) {
        DBConn dbConn = getDBConnection();
        try {
            List<ColumnOrSuperColumn> columns = dbConn.getSlice(
                    CassandraDefs.columnParent(storeName),
                    CassandraDefs.slicePredicateStartEndCol(Utils.toBytes(startColumn), Utils.toBytes(endColumn), count),
                    Utils.toByteBuffer(rowKey));
            List<DColumn> result = new ArrayList<>(columns.size());
            for(ColumnOrSuperColumn column: columns) {
                result.add(new DColumn(column.getColumn().getName(), column.getColumn().getValue()));
            }
            return result;
        } finally {
            returnDBConnection(dbConn);
        }
    }
438591
public Collection<JavaClassSource> allResources()
   {
      Set<JavaClassSource> result = new HashSet<>();
      for (DTOPair pair : dtos.values())
      {
         if (pair.rootDTO != null)
         {
            result.add(pair.rootDTO);
         }
         if (pair.nestedDTO != null)
         {
            result.add(pair.nestedDTO);
         }
      }
      return result;
   }
1161894
private void addPathColumn() {

        Column<CmsHistoryResourceBean, ?> col = new TextColumn<CmsHistoryResourceBean>() {

            @Override
            public String getValue(CmsHistoryResourceBean historyRes) {

                String path = historyRes.getRootPath();
                String siteRoot = CmsCoreProvider.get().getSiteRoot();
                if (path.startsWith(siteRoot)) {
                    path = path.substring(siteRoot.length());
                    if (!path.startsWith("/")) {
                        path = "/" + path;
                    }
                }
                return path;
            }
        };
        addColumn(col, CmsHistoryMessages.columnPath());
        setColumnWidth(col, 100, Unit.PCT);
    }
1263260
public Predicate generateJPAPredicate(CriteriaBuilder criteriaBuilder, Root<?> root) {
		
		// On retourne le predicat
		return criteriaBuilder.isNotNull(this.<Boolean>buildPropertyPath(root, property));
	}
1272449
public List<ColumnResult<SqlResultSetMapping<T>>> getAllColumnResult()
   {
      List<ColumnResult<SqlResultSetMapping<T>>> list = new ArrayList<ColumnResult<SqlResultSetMapping<T>>>();
      List<Node> nodeList = childNode.get("column-result");
      for(Node node: nodeList)
      {
         ColumnResult<SqlResultSetMapping<T>>  type = new ColumnResultImpl<SqlResultSetMapping<T>>(this, "column-result", childNode, node);
         list.add(type);
      }
      return list;
   }
883354
public Node createNode( Tree<Row> current ){
        Row row = current.getContent();
        Element output = row.getOutputElement();
        Element main = row.getMainElement();
        List<Element> input = row.getInputElement();
        Integer id = main.getId();
        Type type = main.getType();
        switch( type ) {
            case START:
                return null;
            case END:
                return null;
            case VALUE:
                String vAttribute = output.getString( 0 );
                Object value = main.getObject( 0 );
                return new SetAttributeActivity( id, vAttribute, value );
            case CALL:
                String cBean = main.getString( 0 );
                String cMethod = main.getString( 1 );
                InputMapping<?>[] cArgumentsMapping = ElementUtil.createArrayMapping( main.getObjectArray( 2 ) );
                OutputMapping cOutputMapping = ElementUtil.createOutputMapping( output );
                return new BeanCallActivity( id, cBean, cMethod, cArgumentsMapping, cOutputMapping );
            case CALL_ASYNC:
                String caBean = main.getString( 0 );
                String caMethod = main.getString( 1 );
                InputMapping<?>[] caArgumentsMapping = ElementUtil.createArrayMapping( main.getObjectArray( 2 ) );
                OutputMapping caOutputMapping = ElementUtil.createOutputMapping( output );
                return new BeanAsyncCallActivity( id, caBean, caMethod, caArgumentsMapping, caOutputMapping );
            case HUMAN_TASK:
                String role = main.getString( 0 );
                String user = main.getString( 1 );
                MapMapping htArgumentsMapping = ElementUtil.createMapMapping( input );
                OutputMapping htOutputMapping = ElementUtil.createOutputMapping( output );
                return new HumanTaskActivity( id, role, user, htArgumentsMapping, htOutputMapping );
            case WAIT_SIGNAL:
                String signal = main.getString( 0 );
                OutputMapping wsOutputMapping = ElementUtil.createOutputMapping( output );
                return new CatchSignal( id, signal, wsOutputMapping );
            case WAIT_TIMER:
                String due = main.getString( 0 );
                if( ElUtil.hasBrackets( due ) ){
                    return new CatchTimer( new ExpressionLanguageMapping<Long>( due ), id );
                }
                else{
                    long delayMillis = Long.valueOf( due );
                    return new CatchTimer( id, delayMillis );
                }
            case WAIT_UNTIL_DATE:
                String dueDate = main.getString( 0 );
                return new CatchTimer( id, new ExpressionLanguageMapping<Date>( dueDate ) );
            case CREATE_INSTANCE:
                String graphName = main.getString( 0 );
                InputMapping<String> nameMapping = ElUtil.hasBrackets( graphName ) ?
                        new ExpressionLanguageMapping<String>( graphName ) : ConstantMapping.of( graphName );

                Integer graphVersion = main.getInteger( 1 );
                InputMapping<Integer> versionMapping = ConstantMapping.of( graphVersion );

                String label1 = main.getString( 2 );
                InputMapping<String> label1Mapping = ElUtil.hasBrackets( label1 ) ?
                        new ExpressionLanguageMapping<String>( label1 ) : ConstantMapping.of( label1 );

                String label2 = main.getString( 3 );
                InputMapping<String> label2Mapping = ElUtil.hasBrackets( label2 ) ?
                        new ExpressionLanguageMapping<String>( label2 ) : ConstantMapping.of( label2 );

                MapMapping ciArgumentsMapping = ElementUtil.createMapMapping( input );

                return new CreateNewInstanceActivity( id, nameMapping, versionMapping, label1Mapping, label2Mapping, ciArgumentsMapping );
            case WHILE_DO_BEGIN:
                return new XorFork( id );
            case WHILE_DO_END:
                id = -findPartnerNodeId( current, type );
                return new XorJoin( id );
            case DO_WHILE_BEGIN:
                id = -findPartnerNodeId( current, type );
                return new XorJoin( id );
            case DO_WHILE_END:
                return new XorFork( id );
            case IF:
                return new XorFork( id );
            case ELSE_IF:
                return null;
            case ELSE:
                return null;
            case END_IF:
                id = -findPartnerNodeId( current, type );
                return new XorJoin( id );
            case SPLIT:
                boolean hasConditionalBranches = hasConditionalBranches( current );
                return hasConditionalBranches ? new OrFork( id ) : new AndFork( id );
            case BRANCH:
                return null;
            case JOIN_FIRST:
                id = -findPartnerNodeId( current, type );
                return new CancellingDiscriminator( id );
            case JOIN_ALL:
                id = -findPartnerNodeId( current, type );
                return new AndJoin( id );
            case ESCALATE:
                return new ThrowEscalation( id );
            case VALIDATE_INPUT_VARIABLE:
                String vivAttribute = main.getString( 0 );
                Class<?> vivType = (Class<?>)main.getObject( 1 );
                if( main.countArguments() == 2 ){
                    return new ValidateAttributeActivity( id, vivAttribute, vivType );
                }
                boolean vivIsRequired = (boolean)main.getObject( 2 );
                if( main.countArguments() == 3 ){
                    return new ValidateAttributeActivity( id, vivAttribute, vivType, vivIsRequired );
                }
                Object vivDefaultValue = main.getObject( 3 );
                return new ValidateAttributeActivity( id, vivAttribute, vivType, vivIsRequired, vivDefaultValue );
            default :
                throw new IllegalStateException( "Cannot create node for unknown main element type in row: " + row );
        }
    }
548665
private <C> Iterator<Column<C>> columnScan(final ByteBuffer rowKey,
                                               final DeltaPlacement placement,
                                               final ColumnFamily<ByteBuffer, C> columnFamily,
                                               final C start,
                                               final C end,
                                               final boolean reversed,
                                               final ColumnInc<C> columnInc,
                                               final long limit,
                                               final long page,
                                               final ReadConsistency consistency) {
        return Iterators.concat(new AbstractIterator<Iterator<Column<C>>>() {
            private C _from = start;
            private long _remaining = limit;
            private long _page = page;

            @Override
            protected Iterator<Column<C>> computeNext() {
                if (_remaining <= 0) {
                    return endOfData();
                }

                // For page N+1, treat "_from" as exclusive.  Since Cassandra doesn't support exclusive column ranges
                // bump the from value up to the next possible time UUID (assumes from != null when page != 0).
                if (_page > 0) {
                    if (_from.equals(end)) {
                        return endOfData();
                    }
                    _from = reversed ? columnInc.previous(_from) : columnInc.next(_from);
                    if (_from == null) {
                        return endOfData();
                    }
                }

                // Execute the query
                int batchSize = (int) Math.min(_remaining, MAX_COLUMN_SCAN_BATCH);
                ColumnList<C> columns = execute(placement.getKeyspace()
                                .prepareQuery(columnFamily, SorConsistencies.toAstyanax(consistency))
                                .getKey(rowKey)
                                .withColumnRange(_from, end, reversed, batchSize),
                        "scan columns in placement %s, column family %s, row %s, from %s to %s",
                        placement.getName(), columnFamily.getName(), rowKey, start, end);

                // Update state for the next iteration.
                if (columns.size() >= batchSize) {
                    // Save the last column key so we can use it as the start (exclusive) if we must query to get more data.
                    _from = columns.getColumnByIndex(columns.size() - 1).getName();
                    _remaining = _remaining - columns.size();
                    _page++;
                } else {
                    // If we got fewer columns than we asked for, another query won't find more columns.
                    _remaining = 0;
                }

                // Track metrics.  For rows w/more than 50 columns, count subsequent reads w/_largeRowReadMeter.
                (_page == 0 ? _randomReadMeter : _largeRowReadMeter).mark();

                return columns.iterator();
            }
        });
    }
373739
private static Set<URL> getResourcesFromRoot(final String rootPath) {

        final Set<URL> rets = new LinkedHashSet<URL>();

        String path = rootPath;

        if (path.startsWith("/")) {
            path = path.substring(1);
        }

        try {
            final Enumeration<URL> resources = Thread.currentThread().getContextClassLoader().getResources(path);
            URL url = null;

            while (resources.hasMoreElements()) {
                url = (URL) resources.nextElement();

                rets.add(url);
            }
        } catch (final IOException e) {
            LOGGER.log(Level.ERROR, "get the ROOT Rescources error", e);
        }
        return rets;
    }
217429
public static List<Locale> getPossibleLocales(CmsObject cms, CmsResource currentResource) {

        CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(currentResource.getRootPath());
        List<Locale> secondaryLocales = Lists.newArrayList();
        Locale mainLocale = null;
        if (site != null) {
            List<Locale> siteLocales = site.getSecondaryTranslationLocales();
            mainLocale = site.getMainTranslationLocale(null);
            if ((siteLocales == null) || siteLocales.isEmpty()) {
                siteLocales = OpenCms.getLocaleManager().getAvailableLocales();
                if (mainLocale == null) {
                    mainLocale = siteLocales.get(0);
                }
            }
            secondaryLocales.addAll(siteLocales);
        }

        try {
            CmsProperty secondaryLocaleProp = cms.readPropertyObject(
                currentResource,
                CmsPropertyDefinition.PROPERTY_SECONDARY_LOCALES,
                true);
            String propValue = secondaryLocaleProp.getValue();
            if (!CmsStringUtil.isEmptyOrWhitespaceOnly(propValue)) {
                List<Locale> restrictionLocales = Lists.newArrayList();
                String[] tokens = propValue.trim().split(" *, *"); //$NON-NLS-1$
                for (String token : tokens) {
                    OpenCms.getLocaleManager();
                    Locale localeForToken = CmsLocaleManager.getLocale(token);
                    restrictionLocales.add(localeForToken);
                }
                if (!restrictionLocales.isEmpty()) {
                    secondaryLocales.retainAll(restrictionLocales);
                }
            }
        } catch (CmsException e) {
            LOG.error(e.getLocalizedMessage(), e);
        }
        List<Locale> result = new ArrayList<Locale>();
        result.add(mainLocale);
        for (Locale secondaryLocale : secondaryLocales) {
            if (!result.contains(secondaryLocale)) {
                result.add(secondaryLocale);
            }
        }
        return result;
    }
596075
def get_ancestors(self):
        ""

        if self._ancestors:
            return self._ancestors

        if not self.parent:
            return []

        obj = self.resource_map.get(self.parent.uid)

        while obj and obj.member_name:
            self._ancestors.append(obj)
            obj = obj.parent

        self._ancestors.reverse()
        return self._ancestors
946270
def ng_repeater_column(repeater, binding, opt = {})
    opt[:root_selector] ||= ng_root_selector
    row = ng.row(opt)
    ng_repeater_columns(repeater, binding, opt)[row]
  end
820250
public static void generate(Elements elementUtils, Filer filer, SQLiteDatabaseSchema schema) throws Exception {
		BindCursorBuilder visitor = new BindCursorBuilder(elementUtils, filer, schema);

		for (SQLiteEntity item : schema.getEntities()) {
			visitor.visit(schema, item);
		}

	}
1126187
def columnCount(self, parent):
        
        if parent.isValid():
            return parent.internalPointer().column_count()
        else:
            return self._root.column_count()
609316
@SafeVarargs
  public final TableBuilder columns(String... columns) {
    if (columns == null || columns.length == 0) {
      throw new InvalidOperationException("Columns array is null or empty.");
    }
    if (tableColumns != null) {
      throw new InvalidOperationException("The table columns are already defined.");
    }
    tableColumns = columns.clone();
    return this;
  }
5838
def _get_columns(self):
        
        return [self] + [c for c in self.children
                         if isinstance(c, TreeViewColumn)]