KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > utils > xml > XMLSerializationOptions


1 package org.jahia.utils.xml;
2
3 /**
4  * <p>Title: Options to modify XML serialization behavior </p>
5  * <p>Description: This class regroups options that allow to change the
6  * behavior of the XML export system. Examples include how binary data is
7  * handled, if ACLs should be exported along, if sub pages should be processed,
8  * etc... </p>
9  * <p>Copyright: Copyright (c) 2002</p>
10  * <p>Company: </p>
11  * @author unascribed
12  * @version 1.0
13  */

14
15 public class XMLSerializationOptions {
16
17     private boolean includingSubPages = true;
18     private boolean includingRights = false;
19     private boolean embeddingBinary = false;
20     private boolean includingAllLanguages = true;
21     private boolean includingAllStates = false;
22     private boolean includingAllVersions = false;
23
24     public XMLSerializationOptions() {
25     }
26
27     /**
28      * Specifies whether we should recursively go into all the sub pages to
29      * export data. Default is true.
30      * @param includingSubPages
31      */

32     public void setIncludingSubPages(boolean includingSubPages) {
33         this.includingSubPages = includingSubPages;
34     }
35
36     public boolean isIncludingSubPages() {
37         return includingSubPages;
38     }
39
40     /**
41      * Specifies whether we should include ACL rights in the XML export stream.
42      * Default is false.
43      * @param includingRights
44      */

45     public void setIncludingRights(boolean includingRights) {
46         this.includingRights = includingRights;
47     }
48
49     public boolean isIncludingRights() {
50         return includingRights;
51     }
52
53     /**
54      * This option specifies whether the XML file generated should include
55      * binary data (application WARs, file field data) directly into the XML
56      * file itself or if it should include URL links to the actual data.
57      * Default is false.
58      * @param embeddingBinary a boolean that specifies whether we should
59      * embed the binary data into the XML stream.
60      */

61     public void setEmbeddingBinary(boolean embeddingBinary) {
62         this.embeddingBinary = embeddingBinary;
63     }
64
65     public boolean isEmbeddingBinary() {
66         return embeddingBinary;
67     }
68
69     /**
70      * Specifies whether we should include all languages when exporting XML
71      * data
72      * @param includingAllLanguages
73      */

74     public void setIncludingAllLanguages(boolean includingAllLanguages) {
75         this.includingAllLanguages = includingAllLanguages;
76     }
77     public boolean isIncludingAllLanguages() {
78         return includingAllLanguages;
79     }
80
81     /**
82      * Specifies whether we should include all the workflow states (only
83      * active and staging) when outputting the values. Default is false and
84      * will only export the active state.
85      * @param includingAllStates
86      */

87     public void setIncludingAllStates(boolean includingAllStates) {
88         this.includingAllStates = includingAllStates;
89     }
90     public boolean isIncludingAllStates() {
91         return includingAllStates;
92     }
93
94     /**
95      * Specifies whether we should include all the versioned values in the
96      * XML export stream. Default is false.
97      * @param includingAllVersions
98      */

99     public void setIncludingAllVersions(boolean includingAllVersions) {
100         this.includingAllVersions = includingAllVersions;
101     }
102     public boolean isIncludingAllVersions() {
103         return includingAllVersions;
104     }
105 }
Popular Tags