From 06ec8c88556b02782c7b91a233de91eaf4a1439d Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Tue, 09 Jun 2009 12:28:05 +0000
Subject: [PATCH] Fix for issue 3550 (Consider making the control panel able to manage remote servers)
---
opends/src/guitools/org/opends/guitools/controlpanel/util/SchemaLoader.java | 47 ++++++++++++++++++++++++++++++-----------------
1 files changed, 30 insertions(+), 17 deletions(-)
diff --git a/opends/src/guitools/org/opends/guitools/controlpanel/util/SchemaLoader.java b/opends/src/guitools/org/opends/guitools/controlpanel/util/SchemaLoader.java
index f176f60..675ed6d 100644
--- a/opends/src/guitools/org/opends/guitools/controlpanel/util/SchemaLoader.java
+++ b/opends/src/guitools/org/opends/guitools/controlpanel/util/SchemaLoader.java
@@ -128,23 +128,7 @@
public void readSchema() throws DirectoryException,
ConfigException, InitializationException
{
- schema = new Schema();
- for (MatchingRule mr : matchingRulesToKeep)
- {
- schema.registerMatchingRule(mr, true);
- }
- for (AttributeSyntax syntax : syntaxesToKeep)
- {
- schema.registerSyntax(syntax, true);
- }
- for (AttributeType attr : attributesToKeep)
- {
- schema.registerAttributeType(attr, true);
- }
- for (ObjectClass oc : objectclassesToKeep)
- {
- schema.registerObjectClass(oc, true);
- }
+ schema = getBaseSchema();
String[] fileNames = null;
try
@@ -263,6 +247,35 @@
}
/**
+ * Returns a basic version of the schema. The schema is created and contains
+ * enough definitions for the schema to be loaded.
+ * @return a basic version of the schema.
+ * @throws DirectoryException if there is an error registering the minimal
+ * objectclasses.
+ */
+ protected Schema getBaseSchema() throws DirectoryException
+ {
+ Schema schema = new Schema();
+ for (MatchingRule mr : matchingRulesToKeep)
+ {
+ schema.registerMatchingRule(mr, true);
+ }
+ for (AttributeSyntax syntax : syntaxesToKeep)
+ {
+ schema.registerSyntax(syntax, true);
+ }
+ for (AttributeType attr : attributesToKeep)
+ {
+ schema.registerAttributeType(attr, true);
+ }
+ for (ObjectClass oc : objectclassesToKeep)
+ {
+ schema.registerObjectClass(oc, true);
+ }
+ return schema;
+ }
+
+ /**
* Returns the schema that was read.
* @return the schema that was read.
*/
--
Gitblit v1.10.0