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

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


     * @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

    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

    private void init( ProjectType type, String name, ProjectState state )
    {
        this.type = type;
        this.name = name;
        this.state = state;
        schemaHandler = new SchemaHandler();
    }
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 )
                    {
                        schema.setProject( project );
                        schemaHandler.addSchema( schema );
                    }
                }
            }
        }
View Full Code Here

            // Getting the selected 'core' schemas
            String[] selectedSchemas = schemasSelectionPage.getSelectedSchemas();
            ServerTypeEnum serverType = schemasSelectionPage.getServerType();
            if ( ( selectedSchemas != null ) && ( serverType != null ) )
            {
                SchemaHandler schemaHandler = project.getSchemaHandler();
                for ( String selectedSchema : selectedSchemas )
                {
                    Schema schema = PluginUtils.loadCoreSchema( serverType, selectedSchema );
                    if ( schema != null )
                    {
                        schema.setProject( project );
                        schemaHandler.addSchema( schema );
                    }
                }
            }
        }
View Full Code Here

        originalAttributeType = ( MutableAttributeType ) ( ( AttributeTypeEditorInput ) getEditorInput() )
            .getAttributeType();
        modifiedAttributeType = PluginUtils.getClone( originalAttributeType );

        SchemaHandler schemaHandler = Activator.getDefault().getSchemaHandler();
        originalSchema = schemaHandler.getSchema( originalAttributeType.getSchemaName() );
        schemaHandler.addListener( schemaHandlerListener );

        addPageChangedListener( pageChangedListener );
    }
View Full Code Here

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

        super.dispose();
    }
View Full Code Here

    {
        if ( inputElement instanceof AttributeType )
        {
            List<ObjectClass> results = new ArrayList<ObjectClass>();
            AttributeType inputAT = ( AttributeType ) inputElement;
            SchemaHandler schemaHandler = Activator.getDefault().getSchemaHandler();

            List<String> names = new ArrayList<String>();

            List<String> atNames = inputAT.getNames();
            if ( atNames != null )
            {
                for ( String name : atNames )
                {
                    names.add( Strings.toLowerCase( name ) );
                }
            }

            List<ObjectClass> objectClasses = schemaHandler.getObjectClasses();
            for ( ObjectClass oc : objectClasses )
            {
                List<String> musts = oc.getMustAttributeTypeOids();
                if ( musts != null )
                {
View Full Code Here

    {
        if ( inputElement instanceof AttributeType )
        {
            List<ObjectClass> results = new ArrayList<ObjectClass>();
            AttributeType inputAT = ( AttributeType ) inputElement;
            SchemaHandler schemaHandler = Activator.getDefault().getSchemaHandler();

            List<String> names = new ArrayList<String>();

            List<String> atNames = inputAT.getNames();
            if ( atNames != null )
            {
                for ( String name : atNames )
                {
                    names.add( Strings.toLowerCase( name ) );
                }
            }

            List<ObjectClass> objectClasses = schemaHandler.getObjectClasses();
            for ( ObjectClass oc : objectClasses )
            {
                List<String> mays = oc.getMayAttributeTypeOids();
                if ( mays != null )
                {
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.