diff --git a/config/alfresco/audit/alfresco-audit-3.2.xsd b/config/alfresco/audit/alfresco-audit-3.2.xsd
index 7056a05720..5b8d205366 100644
--- a/config/alfresco/audit/alfresco-audit-3.2.xsd
+++ b/config/alfresco/audit/alfresco-audit-3.2.xsd
@@ -87,6 +87,7 @@
+
diff --git a/config/alfresco/audit/alfresco-audit-repository.xml b/config/alfresco/audit/alfresco-audit-repository.xml
index 4a27c9431d..f57a494320 100644
--- a/config/alfresco/audit/alfresco-audit-repository.xml
+++ b/config/alfresco/audit/alfresco-audit-repository.xml
@@ -15,6 +15,7 @@
+
@@ -23,11 +24,9 @@
-
diff --git a/source/java/org/alfresco/repo/audit/AuditComponentImpl.java b/source/java/org/alfresco/repo/audit/AuditComponentImpl.java
index 2034d2193c..e63daabd0d 100644
--- a/source/java/org/alfresco/repo/audit/AuditComponentImpl.java
+++ b/source/java/org/alfresco/repo/audit/AuditComponentImpl.java
@@ -651,9 +651,16 @@ public class AuditComponentImpl implements AuditComponent
for (DataExtractorDefinition extractorDef : extractors)
{
DataExtractor extractor = extractorDef.getDataExtractor();
+ String triggerPath = extractorDef.getDataTrigger();
String sourcePath = extractorDef.getDataSource();
String targetPath = extractorDef.getDataTarget();
+ // Check if it is triggered
+ if (!values.containsKey(triggerPath))
+ {
+ continue; // It is not triggered
+ }
+
// We observe the key, not the actual value
if (!values.containsKey(sourcePath))
{
diff --git a/source/java/org/alfresco/repo/audit/model/AuditApplication.java b/source/java/org/alfresco/repo/audit/model/AuditApplication.java
index d51a539f1f..9e42dc924a 100644
--- a/source/java/org/alfresco/repo/audit/model/AuditApplication.java
+++ b/source/java/org/alfresco/repo/audit/model/AuditApplication.java
@@ -290,22 +290,33 @@ public class AuditApplication
*/
public static class DataExtractorDefinition
{
+ private final String dataTrigger;
private final String dataSource;
private final String dataTarget;
private final DataExtractor dataExtractor;
/**
+ * @param dataTrigger the data path that must exist for this extractor to be triggered
* @param dataSource the path to get data from
* @param dataTarget the path to write data to
* @param dataExtractor the implementation to use
*/
- public DataExtractorDefinition(String dataSource, String dataTarget, DataExtractor dataExtractor)
+ public DataExtractorDefinition(String dataTrigger, String dataSource, String dataTarget, DataExtractor dataExtractor)
{
+ this.dataTrigger = dataTrigger;
this.dataSource = dataSource;
this.dataTarget = dataTarget;
this.dataExtractor = dataExtractor;
}
+ /**
+ * The data path that must exist for the extractor to be triggered.
+ */
+ public String getDataTrigger()
+ {
+ return dataTrigger;
+ }
+
public String getDataSource()
{
return dataSource;
@@ -442,8 +453,14 @@ public class AuditApplication
{
sourcePath = currentPath;
}
+ // The extractor may be triggered by data from elsewhere
+ String dataTrigger = element.getDataTrigger();
+ if (dataTrigger == null)
+ {
+ dataTrigger = currentPath;
+ }
// Store the extractor definition
- DataExtractorDefinition extractorDef = new DataExtractorDefinition(sourcePath, extractorPath, extractor);
+ DataExtractorDefinition extractorDef = new DataExtractorDefinition(dataTrigger, sourcePath, extractorPath, extractor);
dataExtractors.add(extractorDef);
}
diff --git a/source/java/org/alfresco/repo/audit/model/_3/Application.java b/source/java/org/alfresco/repo/audit/model/_3/Application.java
index e9be632e75..4dc765b24c 100644
--- a/source/java/org/alfresco/repo/audit/model/_3/Application.java
+++ b/source/java/org/alfresco/repo/audit/model/_3/Application.java
@@ -1,21 +1,4 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
+
package org.alfresco.repo.audit.model._3;
import java.util.ArrayList;
diff --git a/source/java/org/alfresco/repo/audit/model/_3/Audit.java b/source/java/org/alfresco/repo/audit/model/_3/Audit.java
index deb1eeaf23..2b97166c07 100644
--- a/source/java/org/alfresco/repo/audit/model/_3/Audit.java
+++ b/source/java/org/alfresco/repo/audit/model/_3/Audit.java
@@ -1,21 +1,4 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
+
package org.alfresco.repo.audit.model._3;
import java.util.ArrayList;
diff --git a/source/java/org/alfresco/repo/audit/model/_3/AuditPath.java b/source/java/org/alfresco/repo/audit/model/_3/AuditPath.java
index 3dddfe1bf9..6de3e1314e 100644
--- a/source/java/org/alfresco/repo/audit/model/_3/AuditPath.java
+++ b/source/java/org/alfresco/repo/audit/model/_3/AuditPath.java
@@ -1,21 +1,4 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
+
package org.alfresco.repo.audit.model._3;
import java.util.ArrayList;
diff --git a/source/java/org/alfresco/repo/audit/model/_3/DataExtractor.java b/source/java/org/alfresco/repo/audit/model/_3/DataExtractor.java
index 63c91248f0..ff8fde64e2 100644
--- a/source/java/org/alfresco/repo/audit/model/_3/DataExtractor.java
+++ b/source/java/org/alfresco/repo/audit/model/_3/DataExtractor.java
@@ -1,21 +1,4 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
+
package org.alfresco.repo.audit.model._3;
import javax.xml.bind.annotation.XmlAccessType;
diff --git a/source/java/org/alfresco/repo/audit/model/_3/DataExtractors.java b/source/java/org/alfresco/repo/audit/model/_3/DataExtractors.java
index ef0eb04d0c..580f855b2e 100644
--- a/source/java/org/alfresco/repo/audit/model/_3/DataExtractors.java
+++ b/source/java/org/alfresco/repo/audit/model/_3/DataExtractors.java
@@ -1,21 +1,4 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
+
package org.alfresco.repo.audit.model._3;
import java.util.ArrayList;
diff --git a/source/java/org/alfresco/repo/audit/model/_3/DataGenerator.java b/source/java/org/alfresco/repo/audit/model/_3/DataGenerator.java
index 424d4df859..3814f868a1 100644
--- a/source/java/org/alfresco/repo/audit/model/_3/DataGenerator.java
+++ b/source/java/org/alfresco/repo/audit/model/_3/DataGenerator.java
@@ -1,21 +1,4 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
+
package org.alfresco.repo.audit.model._3;
import javax.xml.bind.annotation.XmlAccessType;
diff --git a/source/java/org/alfresco/repo/audit/model/_3/DataGenerators.java b/source/java/org/alfresco/repo/audit/model/_3/DataGenerators.java
index 78f0d8ef8f..5ba54660d2 100644
--- a/source/java/org/alfresco/repo/audit/model/_3/DataGenerators.java
+++ b/source/java/org/alfresco/repo/audit/model/_3/DataGenerators.java
@@ -1,21 +1,4 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
+
package org.alfresco.repo.audit.model._3;
import java.util.ArrayList;
diff --git a/source/java/org/alfresco/repo/audit/model/_3/GenerateValue.java b/source/java/org/alfresco/repo/audit/model/_3/GenerateValue.java
index 1bf61079f8..8fcd9206d5 100644
--- a/source/java/org/alfresco/repo/audit/model/_3/GenerateValue.java
+++ b/source/java/org/alfresco/repo/audit/model/_3/GenerateValue.java
@@ -1,21 +1,4 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
+
package org.alfresco.repo.audit.model._3;
import javax.xml.bind.annotation.XmlAccessType;
diff --git a/source/java/org/alfresco/repo/audit/model/_3/KeyedAuditDefinition.java b/source/java/org/alfresco/repo/audit/model/_3/KeyedAuditDefinition.java
index f56bde15b0..5f4c050102 100644
--- a/source/java/org/alfresco/repo/audit/model/_3/KeyedAuditDefinition.java
+++ b/source/java/org/alfresco/repo/audit/model/_3/KeyedAuditDefinition.java
@@ -1,21 +1,4 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
+
package org.alfresco.repo.audit.model._3;
import javax.xml.bind.annotation.XmlAccessType;
diff --git a/source/java/org/alfresco/repo/audit/model/_3/ObjectFactory.java b/source/java/org/alfresco/repo/audit/model/_3/ObjectFactory.java
index 15a6cfd153..c52885d2c4 100644
--- a/source/java/org/alfresco/repo/audit/model/_3/ObjectFactory.java
+++ b/source/java/org/alfresco/repo/audit/model/_3/ObjectFactory.java
@@ -1,21 +1,4 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
+
package org.alfresco.repo.audit.model._3;
import javax.xml.bind.JAXBElement;
diff --git a/source/java/org/alfresco/repo/audit/model/_3/PathMap.java b/source/java/org/alfresco/repo/audit/model/_3/PathMap.java
index 79a0cc3ed3..483dcb5928 100644
--- a/source/java/org/alfresco/repo/audit/model/_3/PathMap.java
+++ b/source/java/org/alfresco/repo/audit/model/_3/PathMap.java
@@ -1,21 +1,4 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
+
package org.alfresco.repo.audit.model._3;
import javax.xml.bind.annotation.XmlAccessType;
diff --git a/source/java/org/alfresco/repo/audit/model/_3/PathMappings.java b/source/java/org/alfresco/repo/audit/model/_3/PathMappings.java
index 7f8e84b4a9..155b22eee0 100644
--- a/source/java/org/alfresco/repo/audit/model/_3/PathMappings.java
+++ b/source/java/org/alfresco/repo/audit/model/_3/PathMappings.java
@@ -1,21 +1,4 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
+
package org.alfresco.repo.audit.model._3;
import java.util.ArrayList;
diff --git a/source/java/org/alfresco/repo/audit/model/_3/RecordValue.java b/source/java/org/alfresco/repo/audit/model/_3/RecordValue.java
index 309c60faae..4e5eaa52ae 100644
--- a/source/java/org/alfresco/repo/audit/model/_3/RecordValue.java
+++ b/source/java/org/alfresco/repo/audit/model/_3/RecordValue.java
@@ -1,21 +1,4 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
+
package org.alfresco.repo.audit.model._3;
import javax.xml.bind.annotation.XmlAccessType;
@@ -35,6 +18,7 @@ import javax.xml.bind.annotation.XmlType;
* <extension base="{http://www.alfresco.org/repo/audit/model/3.2}KeyedAuditDefinition">
* <attribute name="dataExtractor" use="required" type="{http://www.alfresco.org/repo/audit/model/3.2}NameAttribute" />
* <attribute name="dataSource" type="{http://www.alfresco.org/repo/audit/model/3.2}PathAttribute" />
+ * <attribute name="dataTrigger" type="{http://www.alfresco.org/repo/audit/model/3.2}PathAttribute" />
* </extension>
* </complexContent>
* </complexType>
@@ -52,6 +36,8 @@ public class RecordValue
protected String dataExtractor;
@XmlAttribute
protected String dataSource;
+ @XmlAttribute
+ protected String dataTrigger;
/**
* Gets the value of the dataExtractor property.
@@ -101,4 +87,28 @@ public class RecordValue
this.dataSource = value;
}
+ /**
+ * Gets the value of the dataTrigger property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDataTrigger() {
+ return dataTrigger;
+ }
+
+ /**
+ * Sets the value of the dataTrigger property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDataTrigger(String value) {
+ this.dataTrigger = value;
+ }
+
}