Examples of SchemaHandler


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

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

        // Looping on Attribute Types
        for ( AttributeTypeImpl at : schema.getAttributeTypes() )
        {
            // Superior
            String supName = at.getSuperiorName();
            if ( supName != null )
            {
                AttributeTypeImpl sup = schemaHandler.getAttributeType( supName );
                if ( sup != null )
                {
                    if ( !schema.getName().toLowerCase().equals( sup.getSchema().toLowerCase() ) )
                    {
                        schemaNames.add( sup.getSchema() );
                    }
                }
            }
        }

        // Looping on Object Classes
        for ( ObjectClassImpl oc : schema.getObjectClasses() )
        {
            // Superiors
            String[] supNames = oc.getSuperClassesNames();
            if ( supNames != null )
            {
                for ( String supName : oc.getSuperClassesNames() )
                {
                    ObjectClassImpl sup = schemaHandler.getObjectClass( supName );
                    if ( sup != null )
                    {
                        if ( !schema.getName().toLowerCase().equals( sup.getSchema().toLowerCase() ) )
                        {
                            schemaNames.add( sup.getSchema() );
                        }
                    }
                }
            }

            // Mays
            String[] mayNames = oc.getMayNamesList();
            if ( mayNames != null )
            {
                for ( String mayName : mayNames )
                {
                    AttributeTypeImpl may = schemaHandler.getAttributeType( mayName );
                    if ( may != null )
                    {
                        if ( !schema.getName().toLowerCase().equals( may.getSchema().toLowerCase() ) )
                        {
                            schemaNames.add( may.getSchema() );
                        }
                    }
                }

            }

            // Musts
            String[] mustNames = oc.getMustNamesList();
            if ( mustNames != null )
            {
                for ( String mustName : oc.getMustNamesList() )
                {
                    AttributeTypeImpl must = schemaHandler.getAttributeType( mustName );
                    if ( must != null )
                    {
                        if ( !schema.getName().toLowerCase().equals( must.getSchema().toLowerCase() ) )
                        {
                            schemaNames.add( must.getSchema() );
View Full Code Here

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

        {
            SchemaViewRoot root = ( SchemaViewRoot ) parentElement;

            if ( root.getChildren().isEmpty() )
            {
                SchemaHandler schemaHandler = Activator.getDefault().getSchemaHandler();
                if ( schemaHandler != null )
                {
                    List<Schema> schemas = schemaHandler.getSchemas();
                    for ( Schema schema : schemas )
                    {
                        SchemaWrapper schemaWrapper = new SchemaWrapper( schema, root );
                        root.addChild( schemaWrapper );
View Full Code Here

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

    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

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

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

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

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

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

        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

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

    /* (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

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

        if ( searchString != null )
        {
            Pattern pattern = Pattern.compile( ".*" + searchString + ".*", Pattern.CASE_INSENSITIVE );

            SchemaHandler schemaHandler = Activator.getDefault().getSchemaHandler();
            if ( schemaHandler != null )
            {
                List<SearchScopeEnum> searchScope = new ArrayList<SearchScopeEnum>( Arrays.asList( scope ) );

                // Looping on attribute types
                List<AttributeTypeImpl> attributeTypes = schemaHandler.getAttributeTypes();
                for ( AttributeTypeImpl at : attributeTypes )
                {
                    // Aliases
                    if ( searchScope.contains( SearchScopeEnum.ALIASES ) )
                    {
                        if ( checkArray( pattern, at.getNames() ) )
                        {
                            searchResults.add( at );
                            continue;
                        }
                    }

                    // OID
                    if ( searchScope.contains( SearchScopeEnum.OID ) )
                    {
                        if ( checkString( pattern, at.getOid() ) )
                        {
                            searchResults.add( at );
                            continue;
                        }
                    }

                    // Description
                    if ( searchScope.contains( SearchScopeEnum.DESCRIPTION ) )
                    {
                        if ( checkString( pattern, at.getDescription() ) )
                        {
                            searchResults.add( at );
                            continue;
                        }
                    }

                    // Superior
                    if ( searchScope.contains( SearchScopeEnum.SUPERIOR ) )
                    {
                        if ( checkString( pattern, at.getSuperiorName() ) )
                        {
                            searchResults.add( at );
                            continue;
                        }
                    }

                    // Syntax
                    if ( searchScope.contains( SearchScopeEnum.SYNTAX ) )
                    {
                        if ( checkString( pattern, at.getSyntaxOid() ) )
                        {
                            searchResults.add( at );
                            continue;
                        }
                    }

                    // Matching Rules
                    if ( searchScope.contains( SearchScopeEnum.MATCHING_RULES ) )
                    {
                        // Equality
                        if ( checkString( pattern, at.getEqualityName() ) )
                        {
                            searchResults.add( at );
                            continue;
                        }

                        // Ordering
                        if ( checkString( pattern, at.getOrderingName() ) )
                        {
                            searchResults.add( at );
                            continue;
                        }

                        // Substring
                        if ( checkString( pattern, at.getSubstrName() ) )
                        {
                            searchResults.add( at );
                            continue;
                        }
                    }
                }

                // Looping on object classes
                List<ObjectClassImpl> objectClasses = schemaHandler.getObjectClasses();
                for ( ObjectClassImpl oc : objectClasses )
                {
                    // Aliases
                    if ( searchScope.contains( SearchScopeEnum.ALIASES ) )
                    {
View Full Code Here

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

     * @return
     *      the original schema object from the schema handler.
     */
    private SchemaObject getSchemaObject( SchemaObject so )
    {
        SchemaHandler schemaHandler = Activator.getDefault().getSchemaHandler();
        SchemaObject schemaObject = null;

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

        return schemaObject;
    }
View Full Code Here

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

    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
TOP
Copyright © 2018 www.massapi.com. 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.