Package com.esri.sde.sdk.client

Examples of com.esri.sde.sdk.client.SeLayer


     *             if an exception is caught accessing the sde feature class metadata.
     */
    public static FeatureTypeInfo fetchSchema(final String typeName, final String namespace,
            final ISession session) throws IOException {
        final SeTable table = session.getTable(typeName);
        SeLayer layer = null;

        final SeColumnDefinition[] seColumns = session.describe(typeName);
        for (SeColumnDefinition col : seColumns) {
            if (col.getType() == SeColumnDefinition.TYPE_SHAPE) {
                layer = session.getLayer(typeName);
View Full Code Here


            mainTable = queryInfo.getConstruct().getTables()[0];
        } catch (SeException e) {
            throw new ArcSdeException(e);
        }

        SeLayer layer = null;
        try {
            layer = session.getLayer(mainTable);
        } catch (NoSuchElementException e) {
            LOGGER.info(mainTable + " is not an SeLayer, so no CRS info will be parsed");
        }
View Full Code Here

                final String[] typeNameParts = featureType.getTypeName().split("\\.");
                final String unqualifiedTypeName = typeNameParts[typeNameParts.length - 1];

                // Create a new SeTable/SeLayer with the specified attributes....
                SeTable table = null;
                SeLayer layer = null;

                // flag to know if the table was created by us when catching an
                // exception.
                boolean tableCreated = false;

                // table/layer creation hints information
                int rowIdType = SeRegistration.SE_REGISTRATION_ROW_ID_COLUMN_TYPE_NONE;
                String rowIdColumn = null;
                String configKeyword = "DEFAULTS";
                if (hints.containsKey("configuration.keyword")) {
                    configKeyword = String.valueOf(hints.get("configuration.keyword"));
                }
                if (hints.get("rowid.column.type") instanceof String) {
                    String rowIdStr = (String) hints.get("rowid.column.type");
                    if (rowIdStr.equalsIgnoreCase("NONE")) {
                        rowIdType = SeRegistration.SE_REGISTRATION_ROW_ID_COLUMN_TYPE_NONE;
                    } else if (rowIdStr.equalsIgnoreCase("USER")) {
                        rowIdType = SeRegistration.SE_REGISTRATION_ROW_ID_COLUMN_TYPE_USER;
                    } else if (rowIdStr.equalsIgnoreCase("SDE")) {
                        rowIdType = SeRegistration.SE_REGISTRATION_ROW_ID_COLUMN_TYPE_SDE;
                    } else {
                        throw new DataSourceException(
                                "createSchema hint 'rowid.column.type' must be one of 'NONE', 'USER' or 'SDE'");
                    }
                }
                if (hints.get("rowid.column.name") instanceof String) {
                    rowIdColumn = (String) hints.get("rowid.column.name");
                }

                // placeholder to a catched exception to know in the finally block
                // if we should cleanup the crap we left in the database
                Exception error = null;

                try {
                    // create a table with provided username
                    String qualifiedName = null;

                    if (unqualifiedTypeName.indexOf('.') == -1) {
                        // Use the already parsed name (unqualifiedTypeName)
                        qualifiedName = connection.getUser() + "." + unqualifiedTypeName; // featureType.getTypeName();
                        LOGGER.finer("new full qualified type name: " + qualifiedName);
                    } else {
                        qualifiedName = unqualifiedTypeName;
                        LOGGER.finer("full qualified type name provided by user: " + qualifiedName);
                    }

                    layer = new SeLayer(connection);
                    layer.setTableName(qualifiedName);
                    layer.setCreationKeyword(configKeyword);

                    final String HACK_COL_NAME = "gt_workaround_col_";

                    table = createSeTable(connection, qualifiedName, HACK_COL_NAME, configKeyword);
                    tableCreated = true;
View Full Code Here

     *             if thrown by any sde stream method
     * @throws IOException
     */
    private void updateRow(final SimpleFeature modifiedFeature) throws IOException {

        final SeLayer layer = getLayer();
        final SeCoordinateReference seCoordRef = layer == null ? null : layer.getCoordRef();

        final SeUpdate updateStream = (SeUpdate) createStream(SeUpdate.class);
        // updateStream.setWriteMode(true);

        final LinkedHashMap<Integer, String> mutableColumns = getUpdatableColumnNames();
View Full Code Here

     * @throws IOException
     */
    private Number insertSeRow(final SimpleFeature newFeature) throws IOException {

        // final SeTable table = getTable();
        final SeLayer layer = getLayer();
        final SeCoordinateReference seCoordRef = layer == null ? null : layer.getCoordRef();

        // this returns only the mutable attributes
        final LinkedHashMap<Integer, String> insertColumns = getInsertableColumnNames();

        final Command<Number> insertCmd = new Command<Number>() {
View Full Code Here

    private Number getNextAvailableUserManagedId() throws IOException, SeException {

        // TODO: refactor, this is expensive to do for each row to insert
        // TODO: refactor to some sort of strategy object like done for
        // FIDReader
        final SeLayer layer = getLayer();
        final SeTable table = getTable();
        // ArcSDE JavaDoc only says: "Returns a range of row id values"
        // http://edndoc.esri.com/arcsde/9.1/java_api/docs/com/esri/sde/sdk/client/setable.html#getIds
        // (int)
        /*
 
View Full Code Here

            } else {
                shapeAttributeName = session.issue(new Command<String>() {
                    @Override
                    public String execute(ISession session, SeConnection connection)
                            throws SeException, IOException {
                        SeLayer layer = session.getLayer(typeName);
                        return layer.getShapeAttributeName(SeLayer.SE_SHAPE_ATTRIBUTE_FID);
                    }
                });
            }

            // use LinkedHashMap to respect column order
View Full Code Here

    }

    private SeLayer getLayer() throws IOException {
        if (this.cachedLayer == null && featureType.getGeometryDescriptor() != null) {
            final String typeName = this.featureType.getTypeName();
            final SeLayer layer = session.getLayer(typeName);
            this.cachedLayer = layer;
        }
        return this.cachedLayer;
    }
View Full Code Here

        LOGGER.fine("Creating new ArcSDEQuery");

        final String typeName = fullSchema.getTypeName();
        final SeTable sdeTable = session.getTable(typeName);
        final SeLayer sdeLayer;
        if (fullSchema.getGeometryDescriptor() == null) {
            sdeLayer = null;
        } else {
            sdeLayer = session.getLayer(typeName);
        }
View Full Code Here

        // then construct the query info dynamically when needed?
        if (layerName.indexOf(" AS") > 0) {
            layerName = layerName.substring(0, layerName.indexOf(" AS"));
        }
        final SeTable sdeTable = session.getTable(layerName);
        final SeLayer sdeLayer;
        if (fullSchema.getGeometryDescriptor() == null) {
            sdeLayer = null;
        } else {
            sdeLayer = session.getLayer(layerName);
        }
View Full Code Here

TOP

Related Classes of com.esri.sde.sdk.client.SeLayer

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.