* 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() );