1 package net.sourceforge.blogentis.storage.impl;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 import java.util.Iterator;
26
27 import net.sourceforge.blogentis.om.Blog;
28 import net.sourceforge.blogentis.plugins.AbstractBlogExtensionPoint;
29 import net.sourceforge.blogentis.plugins.IPlugin;
30 import net.sourceforge.blogentis.storage.IStorageExtension;
31 import net.sourceforge.blogentis.storage.IStorageExtensionPoint;
32
33 import org.apache.slide.content.NodeRevisionContent;
34 import org.apache.slide.content.NodeRevisionDescriptor;
35 import org.apache.slide.content.NodeRevisionDescriptors;
36 import org.apache.slide.content.NodeRevisionNumber;
37
38 /***
39 * @author abas
40 *
41 */
42 public class StorageExtensionPointImpl
43 extends AbstractBlogExtensionPoint
44 implements IStorageExtensionPoint {
45
46 public StorageExtensionPointImpl(IPlugin plugin, Blog blog) {
47 super(plugin, blog);
48 }
49
50 public String getName() {
51 return "Storage Operations Extension Point";
52 }
53
54 public Class getExtensionClass() {
55 return IStorageExtension.class;
56 }
57
58 public void preStoreContent(String originalPath,
59 NodeRevisionDescriptors revisionDescriptors,
60 NodeRevisionDescriptor revisionDescriptor,
61 NodeRevisionContent revisionContent) {
62 for(Iterator i = extensions.iterator(); i.hasNext();) {
63 IStorageExtension ise = (IStorageExtension)i.next();
64 ise.preStoreContent(originalPath, revisionDescriptors,
65 revisionDescriptor, revisionContent);
66 }
67 }
68
69 public void postStoreContent(String originalPath,
70 NodeRevisionDescriptors revisionDescriptors,
71 NodeRevisionDescriptor revisionDescriptor,
72 NodeRevisionContent revisionContent) {
73 for(Iterator i = extensions.iterator(); i.hasNext();) {
74 IStorageExtension ise = (IStorageExtension)i.next();
75 ise.postStoreContent(originalPath, revisionDescriptors,
76 revisionDescriptor, revisionContent);
77 }
78 }
79
80 public void preRetrieveContent(String originalPath,
81 NodeRevisionDescriptors revisionDescriptors,
82 NodeRevisionNumber revisionNumber,
83 NodeRevisionDescriptor revisionDescriptor) {
84 for(Iterator i = extensions.iterator(); i.hasNext();) {
85 IStorageExtension ise = (IStorageExtension)i.next();
86 ise.preRetrieveContent(originalPath, revisionDescriptors,
87 revisionNumber, revisionDescriptor);
88 }
89 }
90
91 public void postRetrieveContent(
92 String originalPath,
93 NodeRevisionDescriptors revisionDescriptors,
94 NodeRevisionDescriptor revisionDescriptor,
95 NodeRevisionContent revisionContent) {
96 for(Iterator i = extensions.iterator(); i.hasNext();) {
97 IStorageExtension ise = (IStorageExtension)i.next();
98 ise.postRetrieveContent(originalPath, revisionDescriptors,
99 revisionDescriptor, revisionContent);
100 }
101 }
102
103 public void preRemoveContent(String originalPath,
104 NodeRevisionDescriptors revisionDescriptors,
105 NodeRevisionDescriptor revisionDescriptor) {
106 for(Iterator i = extensions.iterator(); i.hasNext();) {
107 IStorageExtension ise = (IStorageExtension)i.next();
108 ise.preRemoveContent(originalPath, revisionDescriptors,
109 revisionDescriptor);
110 }
111 }
112 }