Package org.apache.directory.studio.schemaeditor.model

Examples of org.apache.directory.studio.schemaeditor.model.Schema


                        SchemaFileType schemaFileType = XMLSchemaFileImporter.getSchemaFileType( new FileInputStream(
                            schemaFile ), schemaFile.getAbsolutePath() );
                        switch ( schemaFileType )
                        {
                            case SINGLE:
                                Schema importedSchema = XMLSchemaFileImporter.getSchema( new FileInputStream(
                                    schemaFile ), schemaFile.getAbsolutePath() );
                                importedSchema
                                    .setProject( Activator.getDefault().getProjectsHandler().getOpenProject() );
                                schemaHandler.addSchema( importedSchema );
                                break;
                            case MULTIPLE:
                                Schema[] schemas = XMLSchemaFileImporter.getSchemas( new FileInputStream( schemaFile ),
View Full Code Here


    public String getSchemaValue()
    {
        StructuredSelection selection = ( StructuredSelection ) schemaComboViewer.getSelection();
        if ( !selection.isEmpty() )
        {
            Schema schema = ( Schema ) selection.getFirstElement();

            return schema.getName();
        }
        else
        {
            return null;
        }
View Full Code Here

                for ( Iterator<?> iterator = selection.iterator(); iterator.hasNext(); )
                {
                    Object selectedItem = iterator.next();
                    if ( selectedItem instanceof SchemaWrapper )
                    {
                        Schema schema = ( ( SchemaWrapper ) selectedItem ).getSchema();
                        schemasMap.put( schema.getName().toLowerCase(), schema );
                    }
                    else if ( selectedItem instanceof AttributeTypeWrapper )
                    {
                        AttributeTypeImpl at = ( ( AttributeTypeWrapper ) selectedItem ).getAttributeType();
                        schemaObjectsList.add( at );
View Full Code Here

     * @see org.eclipse.jface.action.Action#run()
     */
    public void run()
    {
        // Getting the selection
        Schema selectedSchema = null;

        int presentation = Activator.getDefault().getPreferenceStore().getInt(
            PluginConstants.PREFS_SCHEMA_VIEW_SCHEMA_PRESENTATION );
        if ( presentation == PluginConstants.PREFS_SCHEMA_VIEW_SCHEMA_PRESENTATION_FLAT )
        {
View Full Code Here

    public String getSchemaValue()
    {
        StructuredSelection selection = ( StructuredSelection ) schemaComboViewer.getSelection();
        if ( !selection.isEmpty() )
        {
            Schema schema = ( Schema ) selection.getFirstElement();

            return schema.getName();
        }
        else
        {
            return null;
        }
View Full Code Here

     * @see org.eclipse.jface.action.Action#run()
     */
    public void run()
    {
        // Getting the selection
        Schema selectedSchema = null;

        int presentation = Activator.getDefault().getPreferenceStore().getInt(
            PluginConstants.PREFS_SCHEMA_VIEW_SCHEMA_PRESENTATION );
        if ( presentation == PluginConstants.PREFS_SCHEMA_VIEW_SCHEMA_PRESENTATION_FLAT )
        {
View Full Code Here

        throws NamingException
    {
        monitor.subTask( name ); //$NON-NLS-1$

        // Creating the schema
        Schema schema = new SchemaImpl( name );

        // Looking for the nodes of the schema
        SearchControls constraintSearch = new SearchControls();
        constraintSearch.setSearchScope( SearchControls.SUBTREE_SCOPE );

        NamingEnumeration<SearchResult> answer = wrapper.search( "cn=" + name + ", ou=schema", "(objectclass=*)",
            constraintSearch, DEREF_ALIAS_METHOD, HANDLE_REFERALS_METHOD, null, monitor, null );
        if ( answer != null )
        {
            try
            {
                while ( answer.hasMore() )
                {
                    SearchResult searchResult = ( SearchResult ) answer.next();
                    switch ( getNodeType( searchResult ) )
                    {
                        case ATTRIBUTE_TYPE:
                            AttributeTypeImpl at = createAttributeType( searchResult );
                            at.setSchema( name );
                            at.setSchemaObject( schema );
                            schema.addAttributeType( at );
                            break;
                        case OBJECT_CLASS:
                            ObjectClassImpl oc = createObjectClass( searchResult );
                            oc.setSchema( name );
                            oc.setSchemaObject( schema );
                            schema.addObjectClass( oc );
                            break;
                        case MATCHING_RULE:
                            MatchingRuleImpl mr = createMatchingRule( searchResult );
                            mr.setSchema( name );
                            mr.setSchemaObject( schema );
                            schema.addMatchingRule( mr );
                            break;
                        case SYNTAX:
                            SyntaxImpl syntax = createSyntax( searchResult );
                            syntax.setSchema( name );
                            syntax.setSchemaObject( schema );
                            schema.addSyntax( syntax );
                            break;
                        default:
                            break;
                    }
                }
View Full Code Here

     * @return
     *      the corresponding schema, or null if no schema has been found
     */
    public static Schema loadCoreSchema( ServerTypeEnum serverType, String schemaName )
    {
        Schema schema = null;

        try
        {
            URL url = Activator.getDefault().getBundle().getResource(
                "resources/schemas/" + getFolderName( serverType ) + "/" + schemaName + ".xml" );
View Full Code Here

     *      the corresponding schema
     */
    public static Schema readSchema( Element element, String path ) throws XMLSchemaFileImportException
    {
        // Creating the schema with an empty name
        Schema schema = new SchemaImpl( null );

        // Name
        schema.setName( getSchemaName( element, path ) );

        // Attribute Types
        readAttributeTypes( element, schema );

        // Object Classes
View Full Code Here

                for ( File schemaFile : selectedSchemasFiles )
                {
                    monitor.subTask( schemaFile.getName() );
                    try
                    {
                        Schema schema = OpenLdapSchemaFileImporter.getSchema( new FileInputStream( schemaFile ),
                            schemaFile.getAbsolutePath() );
                        schema.setProject( Activator.getDefault().getProjectsHandler().getOpenProject() );
                        schemaHandler.addSchema( schema );
                    }
                    catch ( OpenLdapSchemaFileImportException e )
                    {
                        reportError( e, schemaFile, monitor );
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.schemaeditor.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.