Package org.apache.directory.studio.ldapbrowser.core.model.schema

Examples of org.apache.directory.studio.ldapbrowser.core.model.schema.Schema


        // check all the attributes
        for ( String attributeDescription : attributeDescriptions )
        {
            // get attribute type schema information
            Schema schema = oldEntry.getBrowserConnection().getSchema();
            AttributeTypeDescription atd = schema.getAttributeTypeDescription( attributeDescription );
            boolean hasEMR = SchemaUtils.getEqualityMatchingRuleNameOrNumericOidTransitive( atd, schema ) != null;
            boolean isReplaceForced = ( hasEMR && modifyMode == ModifyMode.REPLACE )
                || ( !hasEMR && modifyModeNoEMR == ModifyMode.REPLACE );
            boolean isAddDelForced = ( hasEMR && modifyMode == ModifyMode.ADD_DELETE )
                || ( !hasEMR && modifyModeNoEMR == ModifyMode.ADD_DELETE );
View Full Code Here


    }


    private Object getRawValue( IBrowserConnection connection, Object value )
    {
        Schema schema = null;
        if ( connection != null )
        {
            schema = connection.getSchema();
        }
        if ( schema == null || value == null || !( value instanceof String ) )
View Full Code Here

    }


    private Object getRawValue( IBrowserConnection connection, Object value )
    {
        Schema schema = null;
        if ( connection != null )
        {
            schema = connection.getSchema();
        }
        if ( schema == null || value == null || !( value instanceof String ) )
View Full Code Here

                Messages.getString( "MatchingRuleUseDescriptionDetailsPage.MatchingRules" ), SWT.NONE ); //$NON-NLS-1$
            nameLink = toolkit.createHyperlink( mainClient, "", SWT.WRAP ); //$NON-NLS-1$
            nameLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
            nameLink.addHyperlinkListener( this );

            Schema schema = getSchema();
            MatchingRule mrd = schema.hasMatchingRuleDescription( mrud.getOid() ) ? schema
                .getMatchingRuleDescription( mrud.getOid() ) : null;
            nameLink
                .setText( getNonNullString( mrd != null ? SchemaUtils.toString( mrd ) : SchemaUtils.toString( mrud ) ) );
            nameLink.setHref( mrd );
            nameLink.setUnderlined( mrd != null );
View Full Code Here

            {
                appliesSection
                    .setText( NLS
                        .bind(
                            Messages.getString( "MatchingRuleUseDescriptionDetailsPage.AppliesCount" ), new Object[] { names.size() } ) ); //$NON-NLS-1$
                Schema schema = getSchema();
                for ( String name : names )
                {
                    if ( schema.hasAttributeTypeDescription( name ) )
                    {
                        AttributeType appliesAtd = schema.getAttributeTypeDescription( name );
                        Hyperlink appliesLink = toolkit.createHyperlink( appliesClient, SchemaUtils
                            .toString( appliesAtd ), SWT.WRAP );
                        appliesLink.setHref( appliesAtd );
                        appliesLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
                        appliesLink.setUnderlined( true );
View Full Code Here

     * @param iselection the selection
     */
    private void add( ISelection iselection )
    {
        IStructuredSelection selection = ( IStructuredSelection ) iselection;
        Schema schema = wizard.getSelectedConnection().getSchema();
        Iterator<?> it = selection.iterator();
        while ( it.hasNext() )
        {
            ObjectClass ocd = ( ObjectClass ) it.next();
            if ( availableObjectClasses.contains( ocd ) && !selectedObjectClasses.contains( ocd ) )
View Full Code Here

     * @param iselection the iselection
     */
    private void remove( ISelection iselection )
    {
        IStructuredSelection selection = ( IStructuredSelection ) iselection;
        Schema schema = wizard.getSelectedConnection().getSchema();
        Iterator<?> it = selection.iterator();
        while ( it.hasNext() )
        {
            ObjectClass ocd = ( ObjectClass ) it.next();
            if ( !availableObjectClasses.contains( ocd ) && selectedObjectClasses.contains( ocd ) )
View Full Code Here

    }


    private Object getRawValue( IBrowserConnection connection, Object value )
    {
        Schema schema = null;
        if ( connection != null )
        {
            schema = connection.getSchema();
        }
        if ( schema == null || value == null || !( value instanceof String ) )
View Full Code Here

    }


    private Object getRawValue( IBrowserConnection connection, Object value )
    {
        Schema schema = null;
        if ( connection != null )
        {
            schema = connection.getSchema();
        }
        if ( schema == null || value == null || !( value instanceof String ) )
View Full Code Here

        {
            monitor.reportError( BrowserCoreMessages.model__missing_schema_location );
            return;
        }

        Schema schema = browserConnection.getSchema();

        boolean mustReload = forceReload || ( schema == Schema.DEFAULT_SCHEMA )
            || mustReload( schemaLocation, browserConnection, monitor );

        if ( mustReload )
        {
            browserConnection.setSchema( Schema.DEFAULT_SCHEMA );

            try
            {
                SearchParameter sp = new SearchParameter();
                sp.setSearchBase( schemaLocation );
                sp.setFilter( Schema.SCHEMA_FILTER );
                sp.setScope( SearchScope.OBJECT );
                sp.setReturningAttributes( new String[]
                    { SchemaConstants.OBJECT_CLASSES_AT, SchemaConstants.ATTRIBUTE_TYPES_AT,
                        SchemaConstants.LDAP_SYNTAXES_AT, SchemaConstants.MATCHING_RULES_AT,
                        SchemaConstants.MATCHING_RULE_USE_AT, SchemaConstants.CREATE_TIMESTAMP_AT,
                        SchemaConstants.MODIFY_TIMESTAMP_AT } );

                LdifEnumeration le = ExportLdifRunnable.search( browserConnection, sp, monitor );
                if ( le.hasNext() )
                {
                    LdifContentRecord schemaRecord = ( LdifContentRecord ) le.next();
                    schema = new Schema();
                    schema.loadFromRecord( schemaRecord );
                    browserConnection.setSchema( schema );
                }
                else
                {
                    monitor.reportError( BrowserCoreMessages.model__no_schema_information );
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.ldapbrowser.core.model.schema.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.