Skip to content

Commit

Permalink
[#148,#261,#282] FIX control-panel schema errors in remote mode (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
vharseko authored Jul 16, 2024
1 parent 30095de commit af105fd
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,8 @@ else if (schema1 == null)

return areAttributeTypesEqual(schema1, schema2)
&& areObjectClassesEqual(schema1, schema2)
&& Objects.equals(schema1.getMatchingRules(), schema2.getMatchingRules())
&& Objects.equals(schema1.getSyntaxes(), schema2.getSyntaxes());
&& (schema1.getMatchingRules().size()==schema2.getMatchingRules().size() && schema1.getMatchingRules().containsAll(schema2.getMatchingRules()))
&& (schema1.getSyntaxes().size()==schema2.getSyntaxes().size() && schema1.getSyntaxes().containsAll(schema2.getSyntaxes()));
}

private static boolean areAttributeTypesEqual(Schema schema1, Schema schema2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ private AttributeType getNewAttribute()
.noUserModification(nonModifiable.isSelected())
.singleValue(singleValued.isSelected())
.extraProperties(getExtraProperties())
.addToSchema()
.addToSchemaOverwrite()
.toSchema()
.getAttributeType(getOID());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ private ObjectClass getNewObjectClass()
.type(getObjectClassType())
.obsolete(obsolete.isSelected())
.extraProperties(getExtraProperties())
.addToSchema()
.addToSchemaOverwrite()
.toSchema()
.getObjectClass(getOID());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ private void readSchemaIfNeeded(final ConnectionWrapper connWrapper, final List<
}
catch (OpenDsException oe)
{
errors.add(oe);
//errors.add(oe);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,17 @@ public Schema readSchema(ConnectionWrapper connWrapper) throws LdapException, Di

// Add missing matching rules and attribute syntaxes to base schema to allow read of remote server schema
// (see OPENDJ-1122 for more details)
//SchemaHandler.addServerSyntaxesAndMatchingRules(schemaBuilder);
SchemaHandler.addServerSyntaxesAndMatchingRules(schemaBuilder);

// Add remote schema entry
final SearchRequest request = newSearchRequest(
DN.valueOf(DN_DEFAULT_SCHEMA_ROOT), BASE_OBJECT, Filter.alwaysTrue(),
ATTR_LDAP_SYNTAXES, ATTR_ATTRIBUTE_TYPES, ATTR_OBJECTCLASSES);
final SearchResultEntry entry = connWrapper.getConnection().searchSingleEntry(request);
removeNonOpenDjOrOpenDsSyntaxes(entry);
new SchemaBuilder(getBaseSchema()).addSchema(entry, true);
//removeNonOpenDjOrOpenDsSyntaxes(entry);
schemaBuilder.addSchema(entry, true);

return buildSchema(schemaBuilder);
return schemaBuilder.toSchema();

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1981,7 +1981,7 @@ public final class ServerConstants
/**
* The value that will be used for the vendorName attribute in the root DSE.
*/
public static final String SERVER_VENDOR_NAME = "ForgeRock AS.";
public static final String SERVER_VENDOR_NAME = "Open Identity Platform Community";



Expand Down

0 comments on commit af105fd

Please sign in to comment.