Package org.apache.directory.server.core.tools.schema

Examples of org.apache.directory.server.core.tools.schema.OpenLdapSchemaParser


        in = fileURL.openStream();

        if ( in == null )
            throw new FileNotFoundException( Messages.getString( "SchemaParser.No_path_or_url_specified" ) ); //$NON-NLS-1$

        OpenLdapSchemaParser parser = new OpenLdapSchemaParser();
        try
        {
            parser.parse( in );
        }
        catch ( ParseException e )
        {
            logger.error( "An error occured when parsing the file - " + e.getMessage() ); //$NON-NLS-1$
            MessageBox messageBox = new MessageBox( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
View Full Code Here


        catch ( IOException e )
        {
            throw new OpenLdapSchemaFileImportException( "The file '" + path + "' can not be read correctly." );
        }

        OpenLdapSchemaParser parser = null;
        try
        {
            parser = new OpenLdapSchemaParser();
        }
        catch ( IOException e )
        {
            throw new OpenLdapSchemaFileImportException( "The file '" + path + "' can not be read correctly." );
        }

        try
        {
            parser.parse( in );
        }
        catch ( IOException e )
        {
            throw new OpenLdapSchemaFileImportException( "The file '" + path + "' can not be read correctly." );
        }
        catch ( ParseException e )
        {
            throw new OpenLdapSchemaFileImportException( "The file '" + path + "' can not be read correctly." );
        }

        String schemaName = getNameFromPath( path );

        Schema schema = new SchemaImpl( schemaName );

        List<?> ats = parser.getAttributeTypes();
        for ( int i = 0; i < ats.size(); i++ )
        {
            AttributeTypeImpl at = convertAttributeType( ( AttributeTypeLiteral ) ats.get( i ) );
            at.setSchema( schemaName );
            schema.addAttributeType( at );
        }

        List<?> ocs = parser.getObjectClassTypes();
        for ( int i = 0; i < ocs.size(); i++ )
        {
            ObjectClassImpl oc = convertObjectClass( ( ObjectClassLiteral ) ocs.get( i ) );
            oc.setSchema( schemaName );
            schema.addObjectClass( oc );
View Full Code Here

        in = fileURL.openStream();

        if ( in == null )
            throw new FileNotFoundException( Messages.getString( "SchemaParser.0" ) ); //$NON-NLS-1$

        OpenLdapSchemaParser parser = new OpenLdapSchemaParser();
        try
        {
            parser.parse( in );
        }
        catch ( ParseException e )
        {
            logger.error( "An error occured when parsing the file - " + e.getMessage() ); //$NON-NLS-1$
            MessageBox messageBox = new MessageBox( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.tools.schema.OpenLdapSchemaParser

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.