|
From: <pka...@us...> - 2009-07-22 15:00:53
|
Revision: 353
http://cse-ip.svn.sourceforge.net/cse-ip/?rev=353&view=rev
Author: pkasprzak
Date: 2009-07-22 15:00:44 +0000 (Wed, 22 Jul 2009)
Log Message:
-----------
* Improved logging
Modified Paths:
--------------
trunk/sandbox/lsf-adapter-demo/CSECore-ejb/src/java/de/campussource/cse/core/RelationManagerImpl.java
Added Paths:
-----------
trunk/sandbox/lsf-adapter-demo/CSECore-ejb/src/java/de/campussource/cse/core/cdm/Utils.java
Property Changed:
----------------
trunk/sandbox/lsf-adapter-demo/CSECore-ejb/
Property changes on: trunk/sandbox/lsf-adapter-demo/CSECore-ejb
___________________________________________________________________
Modified: svn:ignore
- build
+ build
dist
Modified: trunk/sandbox/lsf-adapter-demo/CSECore-ejb/src/java/de/campussource/cse/core/RelationManagerImpl.java
===================================================================
--- trunk/sandbox/lsf-adapter-demo/CSECore-ejb/src/java/de/campussource/cse/core/RelationManagerImpl.java 2009-07-22 14:53:29 UTC (rev 352)
+++ trunk/sandbox/lsf-adapter-demo/CSECore-ejb/src/java/de/campussource/cse/core/RelationManagerImpl.java 2009-07-22 15:00:44 UTC (rev 353)
@@ -3,9 +3,11 @@
import de.campussource.cse.core.cdm.AccountType;
import de.campussource.cse.core.cdm.CategoryType;
import de.campussource.cse.core.cdm.CourseType;
+import de.campussource.cse.core.cdm.Utils;
import de.campussource.cse.core.pdm.EntityType;
import de.campussource.cse.core.pdm.Relation;
import de.campussource.cse.core.pdm.RelationType;
+import java.util.logging.Logger;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.persistence.PersistenceContext;
@@ -26,6 +28,8 @@
@EJB
private EntityManager entityManager;
+ private Logger logger = Logger.getLogger("de.campussource.cse.core.RelationManager");
+
// ----------------------------------------------------------------------------------------------------------------
protected void createRelation(int childId, int parentId, RelationType type) {
@@ -39,7 +43,7 @@
// ----------------------------------------------------------------------------------------------------------------
public void createRelationsFromAccount(int cseId, AccountType account, String system) {
- /* No relations to handle for now */
+ logger.info("Creating relations from account for account:" + Utils.dumpEntity(account, true));
}
// ----------------------------------------------------------------------------------------------------------------
Added: trunk/sandbox/lsf-adapter-demo/CSECore-ejb/src/java/de/campussource/cse/core/cdm/Utils.java
===================================================================
--- trunk/sandbox/lsf-adapter-demo/CSECore-ejb/src/java/de/campussource/cse/core/cdm/Utils.java (rev 0)
+++ trunk/sandbox/lsf-adapter-demo/CSECore-ejb/src/java/de/campussource/cse/core/cdm/Utils.java 2009-07-22 15:00:44 UTC (rev 353)
@@ -0,0 +1,36 @@
+package de.campussource.cse.core.cdm;
+
+/**
+ *
+ * @author pete
+ */
+public class Utils {
+
+ /* Dump entity data / attributes for logging */
+ public static String dumpEntity(EntityType entity, boolean withAttributes) {
+ StringBuffer output = new StringBuffer();
+
+ /* Determine entity type */
+ output.append("EntityType: ");
+ if (entity instanceof AccountType) {
+ output.append("Account");
+ }
+ if (entity instanceof CourseType) {
+ output.append("Course");
+ }
+ if (entity instanceof CategoryType) {
+ output.append("category");
+ }
+
+ output.append("CSE-Id: " + entity.getBusId());
+
+ if (withAttributes) {
+ for (AttributeType attribute : entity.getAttribute()) {
+ output.append(attribute.getName() + ": " + attribute.getValue());
+ }
+ }
+
+ return output.toString();
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|