Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Commit 3b04bc3

Browse files
authored
Merge pull request #284 from tom-vandepoele/AnnotationBasedActionExecuter-with-LoggingAwareExecuter
Added LoggingAwareExecuter interface to AnnotationBasedActionExecuter
2 parents 0f8011d + df0696f commit 3b04bc3

File tree

7 files changed

+68
-2
lines changed

7 files changed

+68
-2
lines changed

alfresco-dynamic-extensions-repo/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ subprojects {
4646
blueprint(project(":blueprint-integration:blueprint-integration-spring-5"))
4747
}
4848

49+
if(project.name.endsWith("-50")) {
50+
ampLib(project(":polyfill:polyfill-alfresco-50")) { transitive = false }
51+
}
52+
4953
blueprint("org.eclipse.gemini.blueprint:gemini-blueprint-core:${project.ext.geminiVersion}")
5054
blueprint("org.eclipse.gemini.blueprint:gemini-blueprint-io:${project.ext.geminiVersion}")
5155

annotations-runtime/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ dependencies {
3232
compileOnly("org.activiti:activiti-engine:5.7") { transitive = false }
3333
compileOnly("org.activiti:activiti-spring:5.7") { transitive = false }
3434

35+
compileOnly project(':polyfill:polyfill-alfresco-50')
36+
3537
compileOnly 'com.google.code.findbugs:jsr305:2.0.1'
3638
compile 'com.google.collections:google-collections:1.0'
3739

annotations-runtime/src/main/java/com/github/dynamicextensionsalfresco/actions/AnnotationBasedActionExecuter.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package com.github.dynamicextensionsalfresco.actions;
22

33
import org.alfresco.repo.action.executer.ActionExecuter;
4+
import org.alfresco.repo.action.executer.LoggingAwareExecuter;
45
import org.alfresco.service.cmr.action.Action;
56
import org.alfresco.service.cmr.action.ActionDefinition;
67
import org.alfresco.service.cmr.repository.NodeRef;
8+
import org.apache.commons.logging.Log;
79

8-
class AnnotationBasedActionExecuter implements ActionExecuter {
10+
class AnnotationBasedActionExecuter implements ActionExecuter, LoggingAwareExecuter {
911

1012
private final ActionMethodMapping mapping;
1113

@@ -53,4 +55,9 @@ public boolean getTrackStatus() {
5355
return false;
5456
}
5557

58+
@Override
59+
public boolean onLogException(Log logger, Throwable t, String message) {
60+
return false;
61+
}
62+
5663
}

build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ allprojects {
7070
subprojects {
7171
if (project.name == 'integration-tests'
7272
|| project.parent.name == 'integration-tests'
73-
|| project.name == 'blueprint-integration') {
73+
|| project.name == 'blueprint-integration'
74+
|| project.name == 'polyfill'
75+
|| project.parent.name == 'polyfill') {
7476
return
7577
}
7678

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
plugins {
2+
id 'java-library'
3+
}
4+
5+
dependencies {
6+
compileOnly 'commons-logging:commons-logging:1.2'
7+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* #%L
3+
* Alfresco Repository
4+
* %%
5+
* Copyright (C) 2005 - 2016 Alfresco Software Limited
6+
* %%
7+
* This file is part of the Alfresco software.
8+
* If the software was purchased under a paid Alfresco license, the terms of
9+
* the paid license agreement will prevail. Otherwise, the software is
10+
* provided under the following open source license terms:
11+
*
12+
* Alfresco is free software: you can redistribute it and/or modify
13+
* it under the terms of the GNU Lesser General Public License as published by
14+
* the Free Software Foundation, either version 3 of the License, or
15+
* (at your option) any later version.
16+
*
17+
* Alfresco is distributed in the hope that it will be useful,
18+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
* GNU Lesser General Public License for more details.
21+
*
22+
* You should have received a copy of the GNU Lesser General Public License
23+
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
24+
* #L%
25+
*/
26+
package org.alfresco.repo.action.executer;
27+
28+
import org.apache.commons.logging.Log;
29+
30+
public interface LoggingAwareExecuter {
31+
32+
/**
33+
* Optional logging of errors callback for the action executer for the cases when the error might be ignored or
34+
* shown in a different manner for the action
35+
*
36+
* @param logger the logger
37+
* @param t the exception thrown
38+
* @param message the proposed message that will be logged
39+
* @return true if it was handled, false for default handling
40+
*/
41+
boolean onLogException(Log logger, Throwable t, String message);
42+
}

settings.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ include 'control-panel'
1919

2020
include 'gradle-plugin'
2121

22+
include 'polyfill:polyfill-alfresco-50'
23+
2224

2325
def alfrescoDependentModules =
2426
[

0 commit comments

Comments
 (0)