Package org.apache.directory.studio.ldapbrowser.core.model.schema

Examples of org.apache.directory.studio.ldapbrowser.core.model.schema.Schema


         */
        public Object[] getElements( Object inputElement )
        {
            if ( inputElement instanceof Schema )
            {
                Schema schema = ( Schema ) inputElement;
                if ( schema != null )
                {
                    return schema.getObjectClassDescriptions();
                }
            }
            return new Object[0];
        }
View Full Code Here


        this.attributeOid2AtdMap = new TreeMap();
        BrowserConnectionManager cm = BrowserCorePlugin.getDefault().getConnectionManager();
        IBrowserConnection[] connections = cm.getBrowserConnections();
        for ( int i = 0; i < connections.length; i++ )
        {
            Schema schema = connections[i].getSchema();
            if ( schema != null )
            {
                createAttributeMaps( schema );
            }
        }
        createAttributeMaps( Schema.DEFAULT_SCHEMA );
        this.attributeTypesAndOids = new String[this.attributeTypes2AtdMap.size() + this.attributeOid2AtdMap.size()];
        System.arraycopy( this.attributeTypes2AtdMap.keySet().toArray(), 0, this.attributeTypesAndOids, 0,
            this.attributeTypes2AtdMap.size() );
        System.arraycopy( this.attributeOid2AtdMap.keySet().toArray(), 0, this.attributeTypesAndOids,
            this.attributeTypes2AtdMap.size(), this.attributeOid2AtdMap.size() );

        // init available syntaxes
        this.syntaxOid2LsdMap = new TreeMap();
        this.syntaxDesc2LsdMap = new TreeMap();
        for ( int i = 0; i < connections.length; i++ )
        {
            Schema schema = connections[i].getSchema();
            if ( schema != null )
            {
                createSyntaxMaps( schema );
            }
        }
View Full Code Here

    private void connectionUpdated( IBrowserConnection connection )
    {

        if ( !this.dnText.isDisposed() )
        {
            Schema schema = null;
            if ( connection != null )
            {
                schema = connection.getSchema();
            }

            if ( schema != null && schema.getDn() != null )
            {
                dnText.setText( schema.getDn().toString() );
            }
            else
            {
                dnText.setText( "-" );
            }

            if ( schema != null && schema.getCreateTimestamp() != null )
            {
                ctText.setText( schema.getCreateTimestamp() );
            }
            else
            {
                ctText.setText( "-" );
            }

            if ( schema != null && schema.getModifyTimestamp() != null )
            {
                mtText.setText( schema.getModifyTimestamp() );
            }
            else
            {
                mtText.setText( "-" );
            }
View Full Code Here

                        IAttribute.OPERATIONAL_ATTRIBUTE_MODIFY_TIMESTAMP, } );
                LdifEnumeration le = connectionProvider.search( sp, monitor );
                if ( le.hasNext( monitor ) )
                {
                    LdifContentRecord schemaRecord = ( LdifContentRecord ) le.next( monitor );
                    schema = new Schema();
                    schema.loadFromRecord( schemaRecord );
                    // TODO: Schema update event
//                    EventRegistry.fireConnectionUpdated( new ConnectionUpdateEvent( this,
//                        ConnectionUpdateEvent.EventDetail.SCHEMA_LOADED ), this );
                }
View Full Code Here

        Collection<ObjectClass> ocds = new ArrayList<ObjectClass>();
        IAttribute ocAttribute = getAttribute( SchemaConstants.OBJECT_CLASS_AT );
        if ( ocAttribute != null )
        {
            String[] ocNames = ocAttribute.getStringValues();
            Schema schema = getBrowserConnection().getSchema();
            for ( String ocName : ocNames )
            {
                ObjectClass ocd = schema.getObjectClassDescription( ocName );
                ocds.add( ocd );
            }
        }
        return ocds;
    }
View Full Code Here

            try
            {
                String schemaFilename = getSchemaCacheFileName( connection.getId() );
                FileReader reader = new FileReader( schemaFilename );
                Schema schema = new Schema();
                schema.loadFromLdif( reader );
                browserConnection.setSchema( schema );
            }
            catch ( Exception e )
            {
            }
View Full Code Here

        this.attributeOid2AtdMap = new TreeMap();
        BrowserConnectionManager cm = BrowserCorePlugin.getDefault().getConnectionManager();
        IBrowserConnection[] connections = cm.getBrowserConnections();
        for ( int i = 0; i < connections.length; i++ )
        {
            Schema schema = connections[i].getSchema();
            if ( schema != null )
            {
                createAttributeMaps( schema );
            }
        }
        createAttributeMaps( Schema.DEFAULT_SCHEMA );
        this.attributeNamesAndOids = new String[this.attributeNames2AtdMap.size() + this.attributeOid2AtdMap.size()];
        System.arraycopy( this.attributeNames2AtdMap.keySet().toArray(), 0, this.attributeNamesAndOids, 0,
            this.attributeNames2AtdMap.size() );
        System.arraycopy( this.attributeOid2AtdMap.keySet().toArray(), 0, this.attributeNamesAndOids,
            this.attributeNames2AtdMap.size(), this.attributeOid2AtdMap.size() );

        // init available syntaxes
        this.syntaxOid2LsdMap = new TreeMap();
        this.syntaxDesc2LsdMap = new TreeMap();
        for ( int i = 0; i < connections.length; i++ )
        {
            Schema schema = connections[i].getSchema();
            if ( schema != null )
            {
                createSyntaxMaps( schema );
            }
        }
View Full Code Here

        String displayValue = value.getStringValue();

        if ( !showRawValues() && !"".equals( displayValue ) )
        {
            Schema schema = value.getAttribute().getEntry().getBrowserConnection().getSchema();
            ObjectClassDescription ocd = schema.getObjectClassDescription( displayValue );
            if ( ocd.isStructural() )
            {
                displayValue = displayValue + " (structural)";
            }
            else if ( ocd.isAbstract() )
View Full Code Here

    }


    private Object getRawValue( IBrowserConnection connection, Object value )
    {
        Schema schema = null;
        if ( connection != null )
        {
            schema = connection.getSchema();
        }
        if ( schema == null || value == null || !( value instanceof String ) )
View Full Code Here

    }


    private Object getRawValue( IBrowserConnection connection, Object value )
    {
        Schema schema = null;
        if ( connection != null )
        {
            schema = connection.getSchema();
        }
        if ( schema == null || value == null || !( value instanceof String ) )
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.ldapbrowser.core.model.schema.Schema

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.