1 17 package org.alfresco.repo.exporter; 18 19 import java.io.InputStream ; 20 import java.util.Collection ; 21 22 import org.alfresco.service.cmr.repository.ContentData; 23 import org.alfresco.service.cmr.repository.NodeRef; 24 import org.alfresco.service.cmr.security.AccessPermission; 25 import org.alfresco.service.cmr.view.ExportPackageHandler; 26 import org.alfresco.service.cmr.view.Exporter; 27 import org.alfresco.service.cmr.view.ExporterContext; 28 import org.alfresco.service.namespace.QName; 29 import org.alfresco.util.ParameterCheck; 30 31 32 39 class URLExporter 40 implements Exporter 41 { 42 private Exporter exporter; 43 private ExportPackageHandler streamHandler; 44 45 46 51 public URLExporter(Exporter exporter, ExportPackageHandler streamHandler) 52 { 53 ParameterCheck.mandatory("Exporter", exporter); 54 ParameterCheck.mandatory("Stream Handler", streamHandler); 55 56 this.exporter = exporter; 57 this.streamHandler = streamHandler; 58 } 59 60 61 64 public void start(ExporterContext context) 65 { 66 exporter.start(context); 67 } 68 69 72 public void startNamespace(String prefix, String uri) 73 { 74 exporter.startNamespace(prefix, uri); 75 } 76 77 80 public void endNamespace(String prefix) 81 { 82 exporter.endNamespace(prefix); 83 } 84 85 88 public void startNode(NodeRef nodeRef) 89 { 90 exporter.startNode(nodeRef); 91 } 92 93 96 public void endNode(NodeRef nodeRef) 97 { 98 exporter.endNode(nodeRef); 99 } 100 101 104 public void startAspects(NodeRef nodeRef) 105 { 106 exporter.startAspects(nodeRef); 107 } 108 109 112 public void endAspects(NodeRef nodeRef) 113 { 114 exporter.endAspects(nodeRef); 115 } 116 117 120 public void startAspect(NodeRef nodeRef, QName aspect) 121 { 122 exporter.startAspect(nodeRef, aspect); 123 } 124 125 128 public void endAspect(NodeRef nodeRef, QName aspect) 129 { 130 exporter.endAspect(nodeRef, aspect); 131 } 132 133 136 public void startACL(NodeRef nodeRef) 137 { 138 exporter.startACL(nodeRef); 139 } 140 141 144 public void permission(NodeRef nodeRef, AccessPermission permission) 145 { 146 exporter.permission(nodeRef, permission); 147 } 148 149 152 public void endACL(NodeRef nodeRef) 153 { 154 exporter.endACL(nodeRef); 155 } 156 157 160 public void startProperties(NodeRef nodeRef) 161 { 162 exporter.startProperties(nodeRef); 163 } 164 165 168 public void endProperties(NodeRef nodeRef) 169 { 170 exporter.endProperties(nodeRef); 171 } 172 173 176 public void startProperty(NodeRef nodeRef, QName property) 177 { 178 exporter.startProperty(nodeRef, property); 179 } 180 181 184 public void endProperty(NodeRef nodeRef, QName property) 185 { 186 exporter.endProperty(nodeRef, property); 187 } 188 189 192 public void value(NodeRef nodeRef, QName property, Object value) 193 { 194 exporter.value(nodeRef, property, value); 195 } 196 197 200 public void value(NodeRef nodeRef, QName property, Collection values) 201 { 202 exporter.value(nodeRef, property, values); 203 } 204 205 208 public void content(NodeRef nodeRef, QName property, InputStream content, ContentData contentData) 209 { 210 ContentData exportedContentData = streamHandler.exportContent(content, contentData); 212 value(nodeRef, property, exportedContentData.toString()); 213 } 214 215 218 public void startAssoc(NodeRef nodeRef, QName assoc) 219 { 220 exporter.startAssoc(nodeRef, assoc); 221 } 222 223 226 public void endAssoc(NodeRef nodeRef, QName assoc) 227 { 228 exporter.endAssoc(nodeRef, assoc); 229 } 230 231 234 public void startAssocs(NodeRef nodeRef) 235 { 236 exporter.startAssocs(nodeRef); 237 } 238 239 242 public void endAssocs(NodeRef nodeRef) 243 { 244 exporter.endAssocs(nodeRef); 245 } 246 247 250 public void startReference(NodeRef nodeRef, QName childName) 251 { 252 exporter.startReference(nodeRef, childName); 253 } 254 255 259 public void endReference(NodeRef nodeRef) 260 { 261 exporter.endReference(nodeRef); 262 } 263 264 267 public void warning(String warning) 268 { 269 exporter.warning(warning); 270 } 271 272 275 public void end() 276 { 277 exporter.end(); 278 } 279 280 } 281 | Popular Tags |