Package org.apache.directory.ldapstudio.schemas.model

Examples of org.apache.directory.ldapstudio.schemas.model.Schema


    public void testAddSchemasToPool() throws Exception
    {

        for ( int i = 0; i < 100; i++ )
        {
            Schema sc = new Schema( "schema_" + i ); //$NON-NLS-1$
            schemas[i] = sc;
            pool.addSchema( sc );
        }

        assertEquals( pool.count(), 100 );
View Full Code Here


    }


    public void testAddExistingSchemasToPool() throws Exception
    {
        Schema sc1 = new Schema( "ressources/schemas/apache.schema", Schema.SchemaType.coreSchema ); //$NON-NLS-1$
        Schema sc2 = new Schema( "ressources/schemas/core.schema", Schema.SchemaType.coreSchema ); //$NON-NLS-1$
        Schema sc3 = new Schema( "ressources/schemas/cosine.schema", Schema.SchemaType.coreSchema ); //$NON-NLS-1$
        Schema sc4 = new Schema( "ressources/schemas/misc.schema", Schema.SchemaType.coreSchema ); //$NON-NLS-1$

        pool.addSchemas( new Schema[]
            { sc1, sc2, sc3, sc4 } );

        assertTrue( pool.containsSchema( sc1 ) );
        assertTrue( pool.containsSchema( sc2 ) );
        assertTrue( pool.containsSchema( sc3 ) );
        assertTrue( pool.containsSchema( sc4 ) );

        Hashtable<String, ObjectClass> objectClasses = pool.getObjectClassesAsHashTableByName();
        Hashtable<String, AttributeType> attributeTypes = pool.getAttributeTypesAsHashTableByName();

        AttributeType[] sc1AT = sc1.getAttributeTypesAsArray();
        for ( AttributeType type : sc1AT )
        {
            assertTrue( attributeTypes.containsValue( type ) );
        }

        AttributeType[] sc2AT = sc2.getAttributeTypesAsArray();
        for ( AttributeType type : sc2AT )
        {
            assertTrue( attributeTypes.containsValue( type ) );
        }

        AttributeType[] sc3AT = sc3.getAttributeTypesAsArray();
        for ( AttributeType type : sc3AT )
        {
            assertTrue( attributeTypes.containsValue( type ) );
        }

        AttributeType[] sc4AT = sc4.getAttributeTypesAsArray();
        for ( AttributeType type : sc4AT )
        {
            assertTrue( attributeTypes.containsValue( type ) );
        }
View Full Code Here

    {
        // Getting the SchemaPool
        SchemaPool pool = SchemaPool.getInstance();

        // Getting the right schema
        Schema schema = pool.getSchema( schemaName );

        // Creating the new attribute type and adding it to the schema
        AttributeTypeLiteral attributeTypeLiteral = new AttributeTypeLiteral( this.page.getOidField() );
        attributeTypeLiteral.setNames( new String[] { this.page.getNameField() } );
        AttributeType attributeType = new AttributeType( attributeTypeLiteral, schema );
        schema.addAttributeType( attributeType );
       
        // Opening the associated editor
        AttributeTypeFormEditorInput input = new AttributeTypeFormEditorInput( attributeType );
        String editorId = AttributeTypeFormEditor.ID;
        try
View Full Code Here

            {
                Object selection = ( ( TreeSelection ) view.getViewer().getSelection() ).getFirstElement();

                if ( selection instanceof SchemaWrapper )
                {
                    Schema schema = ( ( SchemaWrapper ) selection ).getMySchema();
                    if ( schema.type == SchemaType.coreSchema )
                    {
                        manager.add( saveAs );
                        manager.add( new Separator() );
                        manager.add( exportSchemaForADS);
View Full Code Here

TOP

Related Classes of org.apache.directory.ldapstudio.schemas.model.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.