mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 02:22:52 +01:00
Fixed code style errors in cloud-apidoc project
This commit is contained in:
parent
9df10718e4
commit
eb9147f709
@ -14,8 +14,11 @@
|
|||||||
// KIND, either express or implied. See the License for the
|
// KIND, either express or implied. See the License for the
|
||||||
// specific language governing permissions and limitations
|
// specific language governing permissions and limitations
|
||||||
// under the License.
|
// under the License.
|
||||||
import javax.xml.transform.*;
|
import java.io.FileOutputStream;
|
||||||
import java.io.*;
|
|
||||||
|
import javax.xml.transform.Transformer;
|
||||||
|
import javax.xml.transform.TransformerFactory;
|
||||||
|
|
||||||
public class XmlToHtmlConverter extends XmlToHtmlConverterData {
|
public class XmlToHtmlConverter extends XmlToHtmlConverterData {
|
||||||
// To turn off generation of API docs for certain roles, comment out
|
// To turn off generation of API docs for certain roles, comment out
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
@ -26,117 +29,83 @@ public class XmlToHtmlConverter extends XmlToHtmlConverterData {
|
|||||||
x.generateToc();
|
x.generateToc();
|
||||||
x.generateIndividualCommandPages();
|
x.generateIndividualCommandPages();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void generateToc() {
|
public void generateToc() {
|
||||||
try {
|
try {
|
||||||
TransformerFactory tFactory = TransformerFactory.newInstance();
|
TransformerFactory tFactory = TransformerFactory.newInstance();
|
||||||
// Generate the TOC for the API reference for User role
|
// Generate the TOC for the API reference for User role
|
||||||
Transformer transformer =
|
Transformer transformer = tFactory.newTransformer(new javax.xml.transform.stream.StreamSource("generatetocforuser.xsl"));
|
||||||
tFactory.newTransformer
|
|
||||||
(new javax.xml.transform.stream.StreamSource
|
|
||||||
("generatetocforuser.xsl"));
|
|
||||||
// Modify this path to match your own setup.
|
// Modify this path to match your own setup.
|
||||||
transformer.transform
|
transformer.transform(new javax.xml.transform.stream.StreamSource("regular_user/regularUserSummary.xml"), new javax.xml.transform.stream.StreamResult(
|
||||||
(new javax.xml.transform.stream.StreamSource
|
new FileOutputStream("html/TOC_User.html")));
|
||||||
("regular_user/regularUserSummary.xml"),
|
|
||||||
new javax.xml.transform.stream.StreamResult
|
|
||||||
( new FileOutputStream("html/TOC_User.html")));
|
|
||||||
// Generate the TOC for root administrator role
|
// Generate the TOC for root administrator role
|
||||||
Transformer transformer1 =
|
Transformer transformer1 = tFactory.newTransformer(new javax.xml.transform.stream.StreamSource("generatetocforadmin.xsl"));
|
||||||
tFactory.newTransformer
|
|
||||||
(new javax.xml.transform.stream.StreamSource
|
|
||||||
("generatetocforadmin.xsl"));
|
|
||||||
// Modify this path to match your own setup.
|
// Modify this path to match your own setup.
|
||||||
transformer1.transform
|
transformer1.transform(new javax.xml.transform.stream.StreamSource("root_admin/rootAdminSummary.xml"),
|
||||||
(new javax.xml.transform.stream.StreamSource
|
|
||||||
("root_admin/rootAdminSummary.xml"),
|
|
||||||
// Modify this path to your own desired output location.
|
// Modify this path to your own desired output location.
|
||||||
new javax.xml.transform.stream.StreamResult
|
new javax.xml.transform.stream.StreamResult(new FileOutputStream("html/TOC_Root_Admin.html")));
|
||||||
( new FileOutputStream("html/TOC_Root_Admin.html")));
|
|
||||||
// Generate the TOC for domain admin role
|
// Generate the TOC for domain admin role
|
||||||
Transformer transformer2 =
|
Transformer transformer2 = tFactory.newTransformer(new javax.xml.transform.stream.StreamSource("generatetocfordomainadmin.xsl"));
|
||||||
tFactory.newTransformer
|
|
||||||
(new javax.xml.transform.stream.StreamSource
|
|
||||||
("generatetocfordomainadmin.xsl"));
|
|
||||||
|
|
||||||
// The XML to be transformed must be at the location below.
|
// The XML to be transformed must be at the location below.
|
||||||
// Modify this path to match your own setup.
|
// Modify this path to match your own setup.
|
||||||
transformer2.transform
|
transformer2.transform(new javax.xml.transform.stream.StreamSource("domain_admin/domainAdminSummary.xml"),
|
||||||
(new javax.xml.transform.stream.StreamSource
|
|
||||||
("domain_admin/domainAdminSummary.xml"),
|
|
||||||
// Modify this path to your own desired output location.
|
// Modify this path to your own desired output location.
|
||||||
new javax.xml.transform.stream.StreamResult
|
new javax.xml.transform.stream.StreamResult(new FileOutputStream("html/TOC_Domain_Admin.html")));
|
||||||
( new FileOutputStream("html/TOC_Domain_Admin.html")));
|
|
||||||
|
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e) {
|
e.printStackTrace();
|
||||||
e.printStackTrace( );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create man pages
|
// Create man pages
|
||||||
public void generateIndividualCommandPages() {
|
public void generateIndividualCommandPages() {
|
||||||
for(String commandName : rootAdminCommandNames) {
|
for (String commandName : rootAdminCommandNames) {
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
TransformerFactory tFactory = TransformerFactory.newInstance();
|
|
||||||
Transformer transformer =
|
|
||||||
tFactory.newTransformer
|
|
||||||
(new javax.xml.transform.stream.StreamSource
|
|
||||||
("generateadmincommands.xsl"));
|
|
||||||
|
|
||||||
transformer.transform
|
|
||||||
// Modify this path to the location of the input files on your system.
|
|
||||||
(new javax.xml.transform.stream.StreamSource
|
|
||||||
("root_admin/"+commandName+".xml"),
|
|
||||||
// Modify this path with the desired output location.
|
|
||||||
new javax.xml.transform.stream.StreamResult
|
|
||||||
( new FileOutputStream("html/root_admin/"+commandName+".html")));
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace( );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(String commandName : domainAdminCommandNames) {
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
TransformerFactory tFactory = TransformerFactory.newInstance();
|
TransformerFactory tFactory = TransformerFactory.newInstance();
|
||||||
Transformer transformer =
|
Transformer transformer = tFactory.newTransformer(new javax.xml.transform.stream.StreamSource("generateadmincommands.xsl"));
|
||||||
tFactory.newTransformer
|
|
||||||
(new javax.xml.transform.stream.StreamSource
|
|
||||||
("generatedomainadmincommands.xsl"));
|
|
||||||
|
|
||||||
transformer.transform
|
transformer.transform
|
||||||
// Modify this path with the location of the input files on your system.
|
// Modify this path to the location of the input files on your system.
|
||||||
(new javax.xml.transform.stream.StreamSource
|
(new javax.xml.transform.stream.StreamSource("root_admin/" + commandName + ".xml"),
|
||||||
("domain_admin/"+commandName+".xml"),
|
// Modify this path with the desired output location.
|
||||||
// Modify this path to the desired output location.
|
new javax.xml.transform.stream.StreamResult(new FileOutputStream("html/root_admin/" + commandName + ".html")));
|
||||||
new javax.xml.transform.stream.StreamResult
|
|
||||||
( new FileOutputStream("html/domain_admin/"+commandName+".html")));
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace( );
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(String commandName : userCommandNames) {
|
for (String commandName : domainAdminCommandNames) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
TransformerFactory tFactory = TransformerFactory.newInstance();
|
||||||
|
Transformer transformer = tFactory.newTransformer(new javax.xml.transform.stream.StreamSource("generatedomainadmincommands.xsl"));
|
||||||
|
|
||||||
|
transformer.transform
|
||||||
|
// Modify this path with the location of the input files on your system.
|
||||||
|
(new javax.xml.transform.stream.StreamSource("domain_admin/" + commandName + ".xml"),
|
||||||
|
// Modify this path to the desired output location.
|
||||||
|
new javax.xml.transform.stream.StreamResult(new FileOutputStream("html/domain_admin/" + commandName + ".html")));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (String commandName : userCommandNames) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
TransformerFactory tFactory = TransformerFactory.newInstance();
|
TransformerFactory tFactory = TransformerFactory.newInstance();
|
||||||
|
|
||||||
Transformer transformer =
|
Transformer transformer = tFactory.newTransformer(new javax.xml.transform.stream.StreamSource("generateusercommands.xsl"));
|
||||||
tFactory.newTransformer
|
|
||||||
(new javax.xml.transform.stream.StreamSource
|
|
||||||
("generateusercommands.xsl"));
|
|
||||||
|
|
||||||
transformer.transform
|
transformer.transform(new javax.xml.transform.stream.StreamSource("regular_user/" + commandName + ".xml"), new javax.xml.transform.stream.StreamResult(
|
||||||
(new javax.xml.transform.stream.StreamSource
|
new FileOutputStream("html/user/" + commandName + ".html")));
|
||||||
("regular_user/"+commandName+".xml"),
|
|
||||||
new javax.xml.transform.stream.StreamResult
|
|
||||||
( new FileOutputStream("html/user/"+commandName+".html")));
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace( );
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user