Package org.apache.directory.studio.schemaeditor.controller

Examples of org.apache.directory.studio.schemaeditor.controller.SchemaHandler


    /**
     * {@inheritDoc}
     */
    public void dispose()
    {
        SchemaHandler schemaHandler = Activator.getDefault().getSchemaHandler();
        schemaHandler.removeListener( schemaHandlerListener );

        super.dispose();
    }
View Full Code Here


     *      schema depends on
     */
    private String[] getSchemaDependencies( Schema schema )
    {
        Set<String> schemaNames = new HashSet<String>();
        SchemaHandler schemaHandler = Activator.getDefault().getSchemaHandler();

        // Looping on Attribute Types
        for ( AttributeType at : schema.getAttributeTypes() )
        {
            // Superior
            String supName = at.getSuperiorOid();
            if ( supName != null )
            {
                AttributeType sup = schemaHandler.getAttributeType( supName );
                if ( sup != null )
                {
                    if ( !Strings.toLowerCase( schema.getSchemaName() ).equals(
                        Strings.toLowerCase( sup.getSchemaName() ) ) )
                    {
                        schemaNames.add( sup.getSchemaName() );
                    }
                }
            }
        }

        // Looping on Object Classes
        for ( ObjectClass oc : schema.getObjectClasses() )
        {
            // Superiors
            List<String> supNames = oc.getSuperiorOids();
            if ( supNames != null )
            {
                for ( String supName : oc.getSuperiorOids() )
                {
                    ObjectClass sup = schemaHandler.getObjectClass( supName );
                    if ( sup != null )
                    {
                        if ( !Strings.toLowerCase( schema.getSchemaName() ).equals(
                            Strings.toLowerCase( sup.getSchemaName() ) ) )
                        {
                            schemaNames.add( sup.getSchemaName() );
                        }
                    }
                }
            }

            // Mays
            List<String> mayNames = oc.getMayAttributeTypeOids();
            if ( mayNames != null )
            {
                for ( String mayName : mayNames )
                {
                    AttributeType may = schemaHandler.getAttributeType( mayName );
                    if ( may != null )
                    {
                        if ( !Strings.toLowerCase( schema.getSchemaName() ).equals(
                            Strings.toLowerCase( may.getSchemaName() ) ) )
                        {
                            schemaNames.add( may.getSchemaName() );
                        }
                    }
                }

            }

            // Musts
            List<String> mustNames = oc.getMustAttributeTypeOids();
            if ( mustNames != null )
            {
                for ( String mustName : oc.getMustAttributeTypeOids() )
                {
                    AttributeType must = schemaHandler.getAttributeType( mustName );
                    if ( must != null )
                    {
                        if ( !Strings.toLowerCase( schema.getSchemaName() ).equals(
                            Strings.toLowerCase( must.getSchemaName() ) ) )
                        {
View Full Code Here

            {
                LdapSchemaException ldapSchemaException = ( LdapSchemaException ) error;
                SchemaObject source = ldapSchemaException.getSourceObject();
                if ( source != null )
                {
                    SchemaHandler schemaHandler = Activator.getDefault().getSchemaHandler();

                    if ( source instanceof AttributeType )
                    {
                        source = schemaHandler.getAttributeType( source.getOid() );
                    }
                    else if ( source instanceof LdapSyntax )
                    {
                        source = schemaHandler.getSyntax( source.getOid() );
                    }
                    else if ( source instanceof MatchingRule )
                    {
                        source = schemaHandler.getMatchingRule( source.getOid() );
                    }
                    else if ( source instanceof ObjectClass )
                    {
                        source = schemaHandler.getObjectClass( source.getOid() );
                    }

                    errorsMap.put( source, ldapSchemaException );
                }
            }
View Full Code Here

    {
        // Clearing previous warnings
        warningsList.clear();

        // Getting the schema handler to check for schema objects without names (aliases)
        SchemaHandler schemaHandler = Activator.getDefault().getSchemaHandler();

        if ( schemaHandler != null )
        {
            // Checking attribute types
            for ( AttributeType attributeType : schemaHandler.getAttributeTypes() )
            {
                checkSchemaObjectNames( attributeType );
            }

            // Checking object classes
            for ( ObjectClass objectClass : schemaHandler.getObjectClasses() )
            {
                checkSchemaObjectNames( objectClass );
            }
        }
    }
View Full Code Here

    public DependenciesComputer( List<Schema> schemas ) throws DependencyComputerException
    {
        this.schemasList = schemas;

        // Creating the SchemaHandler
        schemaHandler = new SchemaHandler();

        // Creating the dependencies MultiMaps
        schemasDependencies = new MultiValueMap();
        attributeTypesDependencies = new MultiValueMap();
        objectClassesDependencies = new MultiValueMap();
View Full Code Here

        Project project = Activator.getDefault().getProjectsHandler().getOpenProject();
        if ( project != null )
        {
            if ( ( selectedSchemas != null ) && ( serverType != null ) )
            {
                SchemaHandler schemaHandler = project.getSchemaHandler();
                for ( String selectedSchema : selectedSchemas )
                {
                    Schema schema = PluginUtils.loadCoreSchema( serverType, selectedSchema );
                    if ( schema != null )
                    {
                        schemaHandler.addSchema( schema );
                    }
                }
            }
        }
View Full Code Here

        setPartName( input.getName() );

        originalObjectClass = ( ( ObjectClassEditorInput ) getEditorInput() ).getObjectClass();
        modifiedObjectClass = PluginUtils.getClone( originalObjectClass );

        SchemaHandler schemaHandler = Activator.getDefault().getSchemaHandler();
        originalSchema = schemaHandler.getSchema( originalObjectClass.getSchema() );
        schemaHandler.addListener( originalObjectClass, objectClassListener );
        schemaHandler.addListener( schemaHandlerListener );

        addPageChangedListener( pageChangedListener );
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.eclipse.ui.forms.editor.FormEditor#dispose()
     */
    public void dispose()
    {
        SchemaHandler schemaHandler = Activator.getDefault().getSchemaHandler();
        schemaHandler.removeListener( originalObjectClass, objectClassListener );
        schemaHandler.removeListener( schemaHandlerListener );

        super.dispose();
    }
View Full Code Here

    public Project( ProjectType type, String name )
    {
        this.type = type;
        this.name = name;
        this.state = ProjectState.CLOSED;
        schemaHandler = new SchemaHandler();
        schemaChecker = new SchemaChecker();
    }
View Full Code Here

     */
    public Project()
    {
        type = ProjectType.OFFLINE;
        this.state = ProjectState.CLOSED;
        schemaHandler = new SchemaHandler();
        schemaChecker = new SchemaChecker();
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.schemaeditor.controller.SchemaHandler

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.