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 package info.magnolia.audit;
35
36 import info.magnolia.jcr.decoration.ContentDecorator;
37 import info.magnolia.jcr.decoration.ContentDecoratorWorkspaceWrapper;
38
39 import javax.jcr.AccessDeniedException;
40 import javax.jcr.ItemExistsException;
41 import javax.jcr.NoSuchWorkspaceException;
42 import javax.jcr.PathNotFoundException;
43 import javax.jcr.RepositoryException;
44 import javax.jcr.Workspace;
45 import javax.jcr.lock.LockException;
46 import javax.jcr.nodetype.ConstraintViolationException;
47 import javax.jcr.version.VersionException;
48
49
50
51
52 public class MgnlAuditLoggingContentDecoratorWorspaceWrapper extends ContentDecoratorWorkspaceWrapper {
53
54 public MgnlAuditLoggingContentDecoratorWorspaceWrapper(Workspace workspace, ContentDecorator contentDecorator) {
55 super(workspace, contentDecorator);
56 }
57
58 @Override
59 public void move(String srcAbsPath, String destAbsPath) throws ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, RepositoryException {
60 super.move(srcAbsPath, destAbsPath);
61 AuditLoggingUtil.log(AuditLoggingUtil.ACTION_MOVE, getName(), srcAbsPath, destAbsPath);
62 }
63
64 @Override
65 public void copy(String srcAbsPath, String destAbsPath) throws ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, RepositoryException {
66 super.copy(srcAbsPath, destAbsPath);
67 AuditLoggingUtil.log(AuditLoggingUtil.ACTION_COPY, getName(), srcAbsPath, destAbsPath);
68 }
69
70 @Override
71 public void copy(String srcWorkspace, String srcAbsPath, String destAbsPath) throws NoSuchWorkspaceException, ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, RepositoryException {
72 super.copy(srcWorkspace, srcAbsPath, destAbsPath);
73 AuditLoggingUtil.log(AuditLoggingUtil.ACTION_COPY, getName(), srcWorkspace, srcAbsPath, destAbsPath);
74 }
75
76 }