1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 package org.ogf.graap.wsag.api.types;
36
37 import org.ogf.graap.wsag.api.AgreementTemplate;
38 import org.ogf.schemas.graap.wsAgreement.AgreementContextType;
39 import org.ogf.schemas.graap.wsAgreement.AgreementRoleType;
40 import org.ogf.schemas.graap.wsAgreement.AgreementTemplateType;
41 import org.ogf.schemas.graap.wsAgreement.ConstraintSectionType;
42 import org.ogf.schemas.graap.wsAgreement.TemplateDocument;
43 import org.ogf.schemas.graap.wsAgreement.TermTreeType;
44
45
46
47
48
49
50 public class TemplateType extends WSAGXmlType implements AgreementTemplate
51 {
52 AgreementTemplateType template = AgreementTemplateType.Factory.newInstance();
53
54
55
56
57 public TemplateType()
58 {
59 initialize();
60 }
61
62
63
64
65
66
67
68 public TemplateType( AgreementTemplateType template )
69 {
70
71
72
73 TemplateDocument templateDoc = TemplateDocument.Factory.newInstance();
74 templateDoc.addNewTemplate().set( template.copy() );
75 this.template = templateDoc.getTemplate();
76 }
77
78
79
80
81 public boolean validate()
82 {
83 return validate( template );
84 }
85
86 private void initialize()
87 {
88 AgreementContextType context = template.addNewContext();
89 context.setServiceProvider( AgreementRoleType.AGREEMENT_RESPONDER );
90
91 template.addNewTerms();
92 template.addNewCreationConstraints();
93 }
94
95
96
97
98 public String getAgreementId()
99 {
100 return template.getAgreementId();
101 }
102
103
104
105
106 public AgreementContextType getContext()
107 {
108 return template.getContext();
109 }
110
111
112
113
114 public ConstraintSectionType getCreationConstraints()
115 {
116 return template.getCreationConstraints();
117 }
118
119
120
121
122 public String getName()
123 {
124 return template.getName();
125 }
126
127
128
129
130 public String getTemplateId()
131 {
132 return template.getTemplateId();
133 }
134
135
136
137
138 public TermTreeType getTerms()
139 {
140 return template.getTerms();
141 }
142
143
144
145
146 public void setAgreementId( String arg0 )
147 {
148 template.setAgreementId( arg0 );
149 }
150
151
152
153
154 public void setContext( AgreementContextType arg0 )
155 {
156 template.setContext( arg0 );
157 }
158
159
160
161
162 public void setCreationConstraints( ConstraintSectionType arg0 )
163 {
164 template.setCreationConstraints( arg0 );
165 }
166
167
168
169
170 public void setName( String arg0 )
171 {
172 template.setName( arg0 );
173 }
174
175
176
177
178 public void setTemplateId( String arg0 )
179 {
180 template.setTemplateId( arg0 );
181 }
182
183
184
185
186 public void setTerms( TermTreeType arg0 )
187 {
188 template.setTerms( arg0 );
189 }
190
191
192
193
194 public AgreementTemplateType getXMLObject()
195 {
196 return template;
197 }
198
199 }