1 17 package org.alfresco.repo.exporter; 18 19 import java.io.InputStream ; 20 import java.util.ArrayList ; 21 import java.util.Collection ; 22 import java.util.List ; 23 24 import org.alfresco.service.cmr.repository.ContentData; 25 import org.alfresco.service.cmr.repository.NodeRef; 26 import org.alfresco.service.cmr.security.AccessPermission; 27 import org.alfresco.service.cmr.view.Exporter; 28 import org.alfresco.service.cmr.view.ExporterContext; 29 import org.alfresco.service.namespace.QName; 30 31 32 37 class ChainedExporter 38 implements Exporter 39 { 40 private Exporter[] exporters; 41 42 43 48 ChainedExporter(Exporter[] exporters) 49 { 50 List <Exporter> exporterList = new ArrayList <Exporter>(); 51 for (Exporter exporter : exporters) 52 { 53 if (exporter != null) 54 { 55 exporterList.add(exporter); 56 } 57 } 58 this.exporters = exporterList.toArray(new Exporter[exporterList.size()]); 59 } 60 61 64 public void start(ExporterContext context) 65 { 66 for (Exporter exporter : exporters) 67 { 68 exporter.start(context); 69 } 70 } 71 72 75 public void startNamespace(String prefix, String uri) 76 { 77 for (Exporter exporter : exporters) 78 { 79 exporter.startNamespace(prefix, uri); 80 } 81 } 82 83 86 public void endNamespace(String prefix) 87 { 88 for (Exporter exporter : exporters) 89 { 90 exporter.endNamespace(prefix); 91 } 92 } 93 94 97 public void startNode(NodeRef nodeRef) 98 { 99 for (Exporter exporter : exporters) 100 { 101 exporter.startNode(nodeRef); 102 } 103 } 104 105 108 public void endNode(NodeRef nodeRef) 109 { 110 for (Exporter exporter : exporters) 111 { 112 exporter.endNode(nodeRef); 113 } 114 } 115 116 119 public void startAspects(NodeRef nodeRef) 120 { 121 for (Exporter exporter : exporters) 122 { 123 exporter.startAspects(nodeRef); 124 } 125 } 126 127 130 public void endAspects(NodeRef nodeRef) 131 { 132 for (Exporter exporter : exporters) 133 { 134 exporter.endAspects(nodeRef); 135 } 136 } 137 138 141 public void startAspect(NodeRef nodeRef, QName aspect) 142 { 143 for (Exporter exporter : exporters) 144 { 145 exporter.startAspect(nodeRef, aspect); 146 } 147 } 148 149 152 public void endAspect(NodeRef nodeRef, QName aspect) 153 { 154 for (Exporter exporter : exporters) 155 { 156 exporter.endAspect(nodeRef, aspect); 157 } 158 } 159 160 163 public void startACL(NodeRef nodeRef) 164 { 165 for (Exporter exporter : exporters) 166 { 167 exporter.startACL(nodeRef); 168 } 169 } 170 171 174 public void permission(NodeRef nodeRef, AccessPermission permission) 175 { 176 for (Exporter exporter : exporters) 177 { 178 exporter.permission(nodeRef, permission); 179 } 180 } 181 182 185 public void endACL(NodeRef nodeRef) 186 { 187 for (Exporter exporter : exporters) 188 { 189 exporter.endACL(nodeRef); 190 } 191 } 192 193 196 public void startProperties(NodeRef nodeRef) 197 { 198 for (Exporter exporter : exporters) 199 { 200 exporter.startProperties(nodeRef); 201 } 202 } 203 204 207 public void endProperties(NodeRef nodeRef) 208 { 209 for (Exporter exporter : exporters) 210 { 211 exporter.endProperties(nodeRef); 212 } 213 } 214 215 218 public void startProperty(NodeRef nodeRef, QName property) 219 { 220 for (Exporter exporter : exporters) 221 { 222 exporter.startProperty(nodeRef, property); 223 } 224 } 225 226 229 public void endProperty(NodeRef nodeRef, QName property) 230 { 231 for (Exporter exporter : exporters) 232 { 233 exporter.endProperty(nodeRef, property); 234 } 235 } 236 237 240 public void value(NodeRef nodeRef, QName property, Object value) 241 { 242 for (Exporter exporter : exporters) 243 { 244 exporter.value(nodeRef, property, value); 245 } 246 } 247 248 251 public void value(NodeRef nodeRef, QName property, Collection values) 252 { 253 for (Exporter exporter : exporters) 254 { 255 exporter.value(nodeRef, property, values); 256 } 257 } 258 259 262 public void content(NodeRef nodeRef, QName property, InputStream content, ContentData contentData) 263 { 264 for (Exporter exporter : exporters) 265 { 266 exporter.content(nodeRef, property, content, contentData); 267 } 268 } 269 270 273 public void startAssoc(NodeRef nodeRef, QName assoc) 274 { 275 for (Exporter exporter : exporters) 276 { 277 exporter.startAssoc(nodeRef, assoc); 278 } 279 } 280 281 284 public void endAssoc(NodeRef nodeRef, QName assoc) 285 { 286 for (Exporter exporter : exporters) 287 { 288 exporter.endAssoc(nodeRef, assoc); 289 } 290 } 291 292 295 public void startAssocs(NodeRef nodeRef) 296 { 297 for (Exporter exporter : exporters) 298 { 299 exporter.startAssocs(nodeRef); 300 } 301 } 302 303 306 public void endAssocs(NodeRef nodeRef) 307 { 308 for (Exporter exporter : exporters) 309 { 310 exporter.endAssocs(nodeRef); 311 } 312 } 313 314 317 public void startReference(NodeRef nodeRef, QName childName) 318 { 319 for (Exporter exporter : exporters) 320 { 321 exporter.startReference(nodeRef, childName); 322 } 323 } 324 325 328 public void endReference(NodeRef nodeRef) 329 { 330 for (Exporter exporter : exporters) 331 { 332 exporter.endReference(nodeRef); 333 } 334 } 335 336 339 public void warning(String warning) 340 { 341 for (Exporter exporter : exporters) 342 { 343 exporter.warning(warning); 344 } 345 } 346 347 350 public void end() 351 { 352 for (Exporter exporter : exporters) 353 { 354 exporter.end(); 355 } 356 } 357 358 } | Popular Tags |