You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2008/01/27 23:28:07 UTC
svn commit: r615668 - in /lenya/trunk/src/java/org/apache/lenya/cms:
observation/RepositoryEvent.java observation/RepositoryEventFactory.java
workflow/WorkflowEventDescriptor.java
Author: andreas
Date: Sun Jan 27 14:28:07 2008
New Revision: 615668
URL: http://svn.apache.org/viewvc?rev=615668&view=rev
Log:
Implementing toString() functions of repository events to offer more useful repository logging
Modified:
lenya/trunk/src/java/org/apache/lenya/cms/observation/RepositoryEvent.java
lenya/trunk/src/java/org/apache/lenya/cms/observation/RepositoryEventFactory.java
lenya/trunk/src/java/org/apache/lenya/cms/workflow/WorkflowEventDescriptor.java
Modified: lenya/trunk/src/java/org/apache/lenya/cms/observation/RepositoryEvent.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/observation/RepositoryEvent.java?rev=615668&r1=615667&r2=615668&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/observation/RepositoryEvent.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/observation/RepositoryEvent.java Sun Jan 27 14:28:07 2008
@@ -55,5 +55,25 @@
public Object getDescriptor() {
return this.descriptor;
}
+
+ public String toString() {
+ return "user:" + getSession().getIdentity().getUser() + " " + getNodeUri() + " " + getDescriptor();
+ }
+
+ private String nodeUri;
+
+ /**
+ * @param nodeUri The source URI of the affected node.
+ */
+ public void setNodeUri(String nodeUri) {
+ this.nodeUri = nodeUri;
+ }
+
+ /**
+ * @return The source URI of the affected node.
+ */
+ public String getNodeUri() {
+ return this.nodeUri;
+ }
}
Modified: lenya/trunk/src/java/org/apache/lenya/cms/observation/RepositoryEventFactory.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/observation/RepositoryEventFactory.java?rev=615668&r1=615667&r2=615668&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/observation/RepositoryEventFactory.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/observation/RepositoryEventFactory.java Sun Jan 27 14:28:07 2008
@@ -56,9 +56,11 @@
public static final RepositoryEvent createEvent(ServiceManager manager, Document doc,
Logger logger, Object descriptor) {
try {
- return new DocumentEvent(doc.getRepositoryNode().getSession(), doc.getPublication()
+ RepositoryEvent event = new DocumentEvent(doc.getRepositoryNode().getSession(), doc.getPublication()
.getId(), doc.getArea(), doc.getUUID(), doc.getLanguage(), doc
.getResourceType(), descriptor);
+ event.setNodeUri(doc.getRepositoryNode().getSourceURI());
+ return event;
} catch (DocumentException e) {
throw new RuntimeException(e);
}
@@ -84,6 +86,7 @@
event = createEvent(manager, doc, logger, descriptor);
} else {
event = new RepositoryEvent(node.getSession(), descriptor);
+ event.setNodeUri(node.getSourceURI());
}
return event;
}
Modified: lenya/trunk/src/java/org/apache/lenya/cms/workflow/WorkflowEventDescriptor.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/workflow/WorkflowEventDescriptor.java?rev=615668&r1=615667&r2=615668&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/workflow/WorkflowEventDescriptor.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/workflow/WorkflowEventDescriptor.java Sun Jan 27 14:28:07 2008
@@ -34,12 +34,16 @@
Assert.notNull("version", version);
this.version = version;
}
-
+
/**
* @return The version.
*/
public Version getVersion() {
return this.version;
}
-
+
+ public String toString() {
+ return "workflow:" + this.version.getEvent() + "->" + this.version.getState();
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org