Api xmlDocWriter: write each xml command to single file for 1)rootAdmin 2)domainAdmin 3)regularUser

This commit is contained in:
alena 2011-01-10 14:53:07 -08:00
parent 73e9d5f2e2
commit 5dde719988
1 changed files with 10 additions and 9 deletions

View File

@ -145,7 +145,6 @@ public class ApiXmlDocWriter {
//Write commands in the order they are represented in commands.properties.in file
Iterator<?> it = all_api_commands.keySet().iterator();
while (it.hasNext()) {
ObjectOutputStream singleCommandOs = null;
String key = (String)it.next();
//Write admin commands
@ -153,26 +152,29 @@ public class ApiXmlDocWriter {
writeCommand(rootAdmin, key);
//Write single commands to separate xml files
singleCommandOs = xs.createObjectOutputStream(new FileWriter(rootAdminDirName + "/" + key + ".xml"), "command");
ObjectOutputStream singleRootAdminCommandOs = xs.createObjectOutputStream(new FileWriter(rootAdminDirName + "/" + key + ".xml"), "command");
writeCommand(singleRootAdminCommandOs, key);
singleRootAdminCommandOs.close();
if (domain_admin_api_commands.containsKey(key)){
writeCommand(domainAdmin, key);
singleCommandOs = xs.createObjectOutputStream(new FileWriter(domainAdminDirName + "/" + key + ".xml"), "command");
ObjectOutputStream singleDomainAdminCommandOs = xs.createObjectOutputStream(new FileWriter(domainAdminDirName + "/" + key + ".xml"), "command");
writeCommand(singleDomainAdminCommandOs, key);
singleDomainAdminCommandOs.close();
}
if (regular_user_api_commands.containsKey(key)){
singleCommandOs = xs.createObjectOutputStream(new FileWriter(regularUserDirName + "/" + key + ".xml"), "command");
writeCommand(regularUser, key);
}
writeCommand(singleCommandOs, key);
singleCommandOs.close();
ObjectOutputStream singleRegularUserCommandOs = xs.createObjectOutputStream(new FileWriter(regularUserDirName + "/" + key + ".xml"), "command");
writeCommand(singleRegularUserCommandOs, key);
singleRegularUserCommandOs.close();
}
}
//Write sorted commands
it = all_api_commands_sorted.keySet().iterator();
while (it.hasNext()) {
String key = (String)it.next();
writeCommand(rootAdminSorted, key);
@ -215,7 +217,6 @@ public class ApiXmlDocWriter {
Command apiCommand = new Command();
apiCommand.setName(command);
Implementation impl = (Implementation)clas.getAnnotation(Implementation.class);
if (impl == null)
impl = (Implementation)clas.getSuperclass().getAnnotation(Implementation.class);