Project

General

Profile

« Previous | Next » 

Revision 53202

1. FetchClaimHandler.java: add method fetchNumberOfClaimsByDateAndOpenaireId.
2. CommunityUtils.java: request datasource API to get community information (including managers).
3. FetchContextHandler.java: Method fetchFirstContextByCommunityId to parse name of community to be used in the above API.
4. EmailSender.java: Completely changed:
No token in project | send emails to project AND community managers | send emails according to notification table - if no preferences (no entry in table), use default settings.
5. springContext-claimsDemo.properties: Add property 'communityAPI'.
6. springContext-claimsDemo.xml: Add beans 'fetchContextHandler', 'CommunityUtils', properties for EmailSender.

View differences:

modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/migration/handler/FetchContextHandler.java
1
package eu.dnetlib.data.claims.migration.handler;
2

  
3
import eu.dnetlib.data.claims.migration.entity.Context;
4
import eu.dnetlib.data.claimsDemo.QueryGenerator;
5
import eu.dnetlib.data.claimsDemo.SQLStoreException;
6
import eu.dnetlib.data.claimsDemo.SqlDAO;
7
import org.apache.log4j.Logger;
8

  
9
import java.sql.ResultSet;
10
import java.util.ArrayList;
11

  
12
public class FetchContextHandler {
13

  
14
    private Logger log = Logger.getLogger(this.getClass());
15

  
16
    SqlDAO sqlDAO = null;
17
    QueryGenerator queryGenerator = null;
18

  
19
    public FetchContextHandler(){
20

  
21
    }
22

  
23
    public Context fetchFirstContextByCommunityId(String communityId) throws Exception, SQLStoreException {
24
        ArrayList<Object> params = new ArrayList<>();
25
        String query = queryGenerator.generateSelectFirstContextByCommunityIdQuery(communityId, params);
26
        ResultSet rs = sqlDAO.executePreparedQuery(query, params);
27

  
28
        Context context = fetchContextByResultSet(rs);
29
        if(context == null) {
30
            log.info("No context with community id : "+ communityId+"\n");
31
        }
32

  
33
        return context;
34
    }
35

  
36

  
37
    public Context fetchContextByResultSet(ResultSet rs) throws Exception {
38
        Context context = null;
39
        while(rs.next()) {
40
            context = new Context();
41
            context.setOpenaireId(rs.getString(1));
42
            context.setTitle(rs.getString(2));
43
        }
44
        return context;
45
    }
46

  
47
    public SqlDAO getSqlDAO() {
48
        return sqlDAO;
49
    }
50

  
51
    public void setSqlDAO(SqlDAO sqlDAO) {
52
        this.sqlDAO = sqlDAO;
53
    }
54

  
55
    public QueryGenerator getQueryGenerator() {
56
        return queryGenerator;
57
    }
58

  
59
    public void setQueryGenerator(QueryGenerator queryGenerator) {
60
        this.queryGenerator = queryGenerator;
61
    }
62
}
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/migration/handler/FetchClaimHandler.java
125 125
        ResultSet rs = sqlDAO.executePreparedQuery(query, params);
126 126
        return fetchClaimsByResultSet(rs, addCurationInfo);
127 127
    }
128
    /**
129
     *
130
     * @param dateFrom
131
     * @param dataTo
132
     * @param openaireId for project
133
     * @param limit returns at most 'limit' claims  (use -1 or null for no limit)
134
     * @param offset returns claims after 'offset' position (null for no offset)
135
     * @return
136
     * @throws Exception
137
     */
138
    public int fetchNumberOfClaimsByDateAndOpenaireId(String dateFrom, String dataTo, String openaireId, Integer limit, Integer offset, String keyword, String orderField, boolean descending, List<String> types, boolean addCurationInfo) throws Exception, SQLStoreException {
139
        ArrayList<Object> params = new ArrayList<>();
140
        String query = queryGenerator.generateFetchNumberOfClaimsByDateAndOpenaireId(dateFrom, dataTo, openaireId, limit, offset,keyword, orderField, descending,types, params);
141
        ResultSet rs = sqlDAO.executePreparedQuery(query, params);
142
        return countClaimsByResultSet(rs);
143
    }
128 144

  
129 145
    /**
130 146
     *
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/emailSender/EmailSender.java
1 1
package eu.dnetlib.data.emailSender;
2 2

  
3 3
import eu.dnetlib.data.claims.migration.entity.Claim;
4
import eu.dnetlib.data.claims.migration.entity.Context;
5
import eu.dnetlib.data.claims.migration.entity.Notification;
4 6
import eu.dnetlib.data.claims.migration.entity.Project;
5
import eu.dnetlib.data.claims.migration.handler.FetchClaimHandler;
6
import eu.dnetlib.data.claims.migration.handler.ProjectHandler;
7
import eu.dnetlib.data.claims.migration.handler.*;
7 8
import eu.dnetlib.data.claimsDemo.ClaimUtils;
9
import eu.dnetlib.data.claimsDemo.CommunityUtils;
8 10
import eu.dnetlib.data.claimsDemo.SQLStoreException;
9 11
import org.apache.log4j.Logger;
10 12
import org.springframework.beans.factory.annotation.Autowired;
......
22 24

  
23 25
    @Autowired
24 26
    private FetchClaimHandler fetchClaimHandler = null;
27
    @Autowired
28
    private FetchProjectHandler fetchProjectHandler = null;
29
    @Autowired
30
    private FetchNotificationHandler fetchNotificationHandler = null;
31
    @Autowired
32
    private NotificationHandler notificationHandler = null;
33
    @Autowired
34
    private FetchContextHandler fetchContextHandler = null;
25 35

  
26 36
    @Autowired
27
    private ProjectHandler projectHandler = null;
37
    private String defaultFrequencyInHours;
28 38

  
29 39
    private static String openaireClaimsPage;
30 40
    private static String username;
......
34 44
    private static String from;
35 45
    private static String specialRecipients;
36 46

  
37
    private static String dateFrom;
38
    private static String dateTo;
39

  
40 47
    @Override
41 48
    public void run() {
42 49
        logger.info("EmailSender thread is running. " + host);
43 50
        logger.info("Special Recipients  " + specialRecipients);
44 51

  
52
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
53
        Date date = new Date();
54
        String dateTo = (format.format(date));
45 55

  
46
        Project project = null;
56
        defaultEmails_For_ProjectClaims(dateTo, format);    // daily for managers not in notification table
57
        defaultEmails_For_CommunityClaims(dateTo, format);  // daily for managers not in notification table
58

  
59
        notificationEmails_For_ProjectClaims(dateTo, format);
60
        notificationEmails_For_CommunityClaims(dateTo, format);
61
    }
62

  
63
    public void defaultEmails_For_ProjectClaims(String dateTo, SimpleDateFormat format) {
64
        Map<String, List<String>> managersOfProject = new HashMap<String, List<String>>();
65
        Project project;
47 66
        List<Claim> claims = null;
48 67
        List<String> types = new ArrayList<String>();
49 68

  
50
        Map<String, List<String>> managersOfProject = new HashMap<String, List<String>>();
51

  
52 69
        types.add(ClaimUtils.PROJECT);
53 70

  
54
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
55
        Date date = null;
56

  
57 71
        Calendar calendar = Calendar.getInstance();
58
        calendar.add(Calendar.HOUR_OF_DAY, -23);
72
        calendar.add(Calendar.HOUR_OF_DAY, -(Integer.parseInt(defaultFrequencyInHours)-1));
59 73
        calendar.add(Calendar.MINUTE, -59);
60 74
        calendar.add(Calendar.SECOND, -59);
61
        date = calendar.getTime();
62
        dateFrom=(format.format(date));
75
        Date date = calendar.getTime();
76
        String dateFrom=(format.format(date));
63 77

  
64
        date = new Date();
65
        dateTo = (format.format(date));
78
        logger.debug("Sending emails for project claims between " + dateFrom + " and "+dateTo);
66 79

  
67
        logger.debug("Sending emails for claims between " + dateFrom + " and "+dateTo);
68

  
69 80
        try {
70 81
            // Get all claims between dateFrom and dateTo which satisfy source_type == "project" or target_type == "project"
71 82
            claims = fetchClaimHandler.fetchClaimsByDate(dateFrom, dateTo, null, null, "", "source", true, types, false);
......
90 101
                    managersOfProject.put(project.getOpenaireId(), tmpManagers);
91 102
                }
92 103

  
104
                /*
93 105
                // Send emails to actual project managers instead of special recipients
94
                //List<String> managers = projectFetcher.getFetchProjectHandler().fetchContactEmailsByProjectId(project.getOpenaireId());
95
                //logger.debug("Managers of project " + project.getOpenaireId() + ": "+managers);
96
                //managersOfProject.put(project.getOpenaireId(), managers);
106
                List<String> managers = null;
107
                try {
108
                    managers = fetchProjectHandler.fetchContactEmailsByProjectId(project.getOpenaireId());
109
                    if(managers != null) {
110
                        Iterator itr = managers.iterator();
111
                        while (itr.hasNext()) {
112
                            String manager = (String) itr.next();
113
                            Notification notification = fetchNotificationHandler.fetchNotification(project.getOpenaireId(), manager);
114
                            //if (notification != null && (!notification.isNotify() || notification.getFrequency() != 24)) {
115
                            if (notification != null) {
116
                                itr.remove();
117
                            }
118
                        }
119
                    }
120
                } catch (Exception e) {
121
                    e.printStackTrace();
122
                } catch (SQLStoreException e) {
123
                    e.printStackTrace();
124
                }
97 125

  
98
                String token = UUID.randomUUID().toString();
99
                logger.debug("UUID Token for project " + project.getOpenaireId() + ": " + token);
126
                logger.debug("Managers of project " + project.getOpenaireId() + ": "+managers);
127
                managersOfProject.put(project.getOpenaireId(), managers);
128
                */
129

  
130
                if (managersOfProject.get(project.getOpenaireId()) != null &&
131
                        !managersOfProject.get(project.getOpenaireId()).isEmpty()) {
132
                    //send(project.getOpenaireId(), project.getName(), "project", managersOfProject.get(project.getOpenaireId()));
133
                }
134
            }
135
        }
136
    }
137

  
138
    public void defaultEmails_For_CommunityClaims(String dateTo, SimpleDateFormat format) {
139
        Map<String, List<String>> managersOfCommunity = new HashMap<String, List<String>>();
140
        Context context;
141
        List<Claim> claims = null;
142
        List<String> types = new ArrayList<String>();
143

  
144
        types.add(ClaimUtils.CONTEXT);
145

  
146
        Calendar calendar = Calendar.getInstance();
147
        calendar.add(Calendar.HOUR_OF_DAY, -(Integer.parseInt(defaultFrequencyInHours)-1));
148
        calendar.add(Calendar.MINUTE, -59);
149
        calendar.add(Calendar.SECOND, -59);
150
        Date date = calendar.getTime();
151
        String dateFrom=(format.format(date));
152

  
153
        logger.debug("Sending emails for community claims between " + dateFrom + " and "+dateTo);
154

  
155
        try {
156
            // Get all claims between dateFrom and dateTo which satisfy source_type == "context" or target_type == "context"
157
            claims = fetchClaimHandler.fetchClaimsByDate(dateFrom, dateTo, null, null, "", "source", true, types, false);
158
        } catch (SQLStoreException|Exception e) {
159
            logger.error("Could not fetch claims by date from "+dateFrom+" to "+dateTo, e);
160
        }
161

  
162
        for (Claim claim: claims) {
163
            if (claim.getSourceType().equals("context")) {
164
                context = (Context)claim.getSource();
165
            } else {
166
                context = (Context)claim.getTarget();
167
            }
168

  
169
            String openaireId = context.getOpenaireId().split("::")[0];
170
            if (!managersOfCommunity.containsKey(openaireId)) {
171

  
172
                /*
173
                // specialRecipients are used currently for testing purposes
174
                List<String> tmpManagers = null;
175
                if (specialRecipients != null && !specialRecipients.isEmpty()) {
176
                    tmpManagers = Arrays.asList(specialRecipients.split("\\s*,\\s*"));
177
                    logger.debug("Special recipients: " + specialRecipients);
178
                    managersOfCommunity.put(openaireId, tmpManagers);
179
                }
180
                */
181

  
182

  
183
                // Send emails to actual project managers instead of special recipients
184
                List<String> managers = null;
100 185
                try {
101
                    projectHandler.updateTokenByProjectId(project.getOpenaireId(), token);
186
                    CommunityUtils communityInfo = CommunityUtils.getCommunityInfo(openaireId);
187
                    managers = communityInfo.getManagers();
188
                    if(managers != null) {
189
                        Iterator itr = managers.iterator();
190
                        while (itr.hasNext()) {
191
                            String manager = (String) itr.next();
192
                            Notification notification = fetchNotificationHandler.fetchNotification(openaireId, manager);
193
                            if (notification != null) {
194
                                itr.remove();
195
                            } else {
196
                                logger.debug("Sending email to community manager: "+ manager);
197
                            }
198
                        }
199
                    }
200
                    else {
201
                        logger.debug("Community Managers: null");
202
                    }
203
                } catch (Exception e) {
204
                    e.printStackTrace();
205
                } catch (SQLStoreException e) {
206
                    e.printStackTrace();
207
                }
102 208

  
103
                    if (managersOfProject.get(project.getOpenaireId()) != null &&
104
                            !managersOfProject.get(project.getOpenaireId()).isEmpty()) {
105
                        send(project, token, managersOfProject.get(project.getOpenaireId()));
209
                logger.debug("Managers of community " + openaireId + ": "+managers);
210
                managersOfCommunity.put(openaireId, managers);
211

  
212

  
213
                if (managersOfCommunity.get(openaireId) != null &&
214
                        !managersOfCommunity.get(openaireId).isEmpty()) {
215
                    //send(openaireId, context.getTitle().split(">")[0], "community", managersOfCommunity.get(openaireId));
216
                }
217
            }
218
        }
219
    }
220

  
221
    public void notificationEmails_For_ProjectClaims(String dateTo, SimpleDateFormat format) {
222
        Project project = null;
223
        List<String> types = new ArrayList<String>();
224

  
225
        types.add(ClaimUtils.PROJECT);
226

  
227
        logger.debug("Sending email for project claims from notification table");
228

  
229
        try {
230
            List<Notification> trueNotifications = fetchNotificationHandler.fetchTrueNotifications();
231
            logger.debug(trueNotifications);
232
            if(trueNotifications != null) {
233
                for(Notification notification : trueNotifications) {
234
                    List<String> managers = fetchProjectHandler.fetchContactEmailsByProjectId(notification.getOpenaireId());
235
                    if(managers != null && managers.contains(notification.getUserMail())) {
236

  
237
                        Date _dateTo = format.parse(dateTo);
238

  
239
                        String last_interaction_date = (format.format(notification.getDate()));
240

  
241
                        long diff = _dateTo.getTime() - notification.getDate().getTime();
242
                        diff = diff / 1000;
243

  
244
                        if (diff >= (notification.getFrequency() * 3600)) {
245
                            if (fetchClaimHandler.fetchNumberOfClaimsByDateAndOpenaireId(last_interaction_date, dateTo, notification.getOpenaireId(), null, null, "", null, true, types, false) > 0) {
246
                                List<String> managersByNotification = new ArrayList<>();
247
                                managersByNotification.add(notification.getUserMail());
248

  
249
                                project = fetchProjectHandler.fetchProjectById(notification.getOpenaireId());
250

  
251
                                logger.debug("Sending email for project claims between " + last_interaction_date + " and " + dateTo + " to " + notification.getUserMail());
252

  
253
                                //send(project.getOpenaireId(), project.getName(), "project", managersByNotification);
254
                            }
255
                            Calendar cal = Calendar.getInstance();
256
                            cal.setTime(_dateTo);
257
                            cal.add(Calendar.SECOND, 1);
258
                            _dateTo = cal.getTime();
259
                            notificationHandler.updateNotificationLastInteractionDate(notification.getOpenaireId(), notification.getUserMail(), _dateTo);
260
                            //update last interaction date (db)
261
                        }
262
                    } else {
263
                        logger.debug("managers do not contain "+notification.getUserMail());
106 264
                    }
107
                } catch (SQLStoreException|Exception e) {
108
                    logger.error("Could update token for project with id "+ project.getOpenaireId(), e);
109 265
                }
266
            } else {
267
                logger.debug("true notifications: null");
110 268
            }
269
        } catch (Exception e) {
270
            e.printStackTrace();
271
        } catch (SQLStoreException e) {
272
            e.printStackTrace();
111 273
        }
112 274
    }
113 275

  
114
    public void send(Project project, String token, List<String> managers) {
115
        final String openaireClaimsPageUrl = openaireClaimsPage + token;
276
    public void notificationEmails_For_CommunityClaims(String dateTo, SimpleDateFormat format) {
277
        Context context = null;
278
        List<String> types = new ArrayList<String>();
116 279

  
280
        types.add(ClaimUtils.CONTEXT);
281

  
282
        logger.debug("Sending email for community claims from notification table");
283

  
284
        try {
285
            List<Notification> trueNotifications = fetchNotificationHandler.fetchTrueNotifications();
286

  
287
            if(trueNotifications != null) {
288
                for(Notification notification : trueNotifications) {
289
                    CommunityUtils communityInfo = CommunityUtils.getCommunityInfo(notification.getOpenaireId());
290
                    List<String> managers = null;
291
                    if(communityInfo != null) {
292
                        managers = communityInfo.getManagers();
293
                    }
294

  
295
                    if(managers != null && managers.contains(notification.getUserMail())) {
296
                        Date _dateTo = format.parse(dateTo);
297

  
298
                        String last_interaction_date = (format.format(notification.getDate()));
299
                        long diff = _dateTo.getTime() - notification.getDate().getTime();
300
                        diff = diff / 1000;
301
                        //if dateTo - last_interaction_date >= notification.getFrequency//last_interaction_date.compareTo(dateFrom) == -1 &&
302

  
303
                        if (diff >= (notification.getFrequency() * 3600)) {
304
                            if (fetchClaimHandler.fetchNumberOfClaimsByDateAndOpenaireId(last_interaction_date, dateTo, notification.getOpenaireId(), null, null, "", "source", true, types, false) > 0) {
305
                                List<String> managersByNotification = new ArrayList<>();
306
                                managersByNotification.add(notification.getUserMail());
307

  
308
                                // We need that to get name of community
309
                                context = fetchContextHandler.fetchFirstContextByCommunityId(notification.getOpenaireId());
310

  
311
                                logger.debug("Sending email for community claims between " + last_interaction_date + " and " + dateTo + " to " + notification.getUserMail());
312

  
313
                                //send(context.getOpenaireId().split("::")[0], context.getTitle().split(">")[0], "community", managersByNotification);
314
                            }
315
                            Calendar cal = Calendar.getInstance();
316
                            cal.setTime(_dateTo);
317
                            cal.add(Calendar.SECOND, 1);
318
                            _dateTo = cal.getTime();
319
                            notificationHandler.updateNotificationLastInteractionDate(notification.getOpenaireId(), notification.getUserMail(), _dateTo);
320
                            //update last interaction date (db)
321
                        }
322
                    }
323
                }
324
            }
325
        } catch (Exception e) {
326
            e.printStackTrace();
327
        } catch (SQLStoreException e) {
328
            e.printStackTrace();
329
        }
330
    }
331

  
332
    public void send(String openaire_id, String openaire_name, String type, /*String token,*/ List<String> managers) {
333
        final String openaireClaimsPageUrl = openaireClaimsPage + openaire_id;//token;
334

  
117 335
        // Get system properties
118 336
        Properties properties = System.getProperties();
119 337
        properties.setProperty("mail.smtp.host", host);
......
137 355

  
138 356
            // Set To: header field of the header.
139 357
            for(String to : managers) {
358
                logger.debug(to);
140 359
                message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
141 360
            }
142 361

  
......
146 365
            // For simple text setText() can be used instead of setContent()
147 366

  
148 367
            // Send the actual HTML message, as big as you like
149
            message.setContent("There are new Claims for the project: '" + project.getName() +"' for which you seem to be a contact person." +
368
            message.setContent("There are new Claims for the "+type+": '" + openaire_name +"' for which you seem to be a contact person." +
150 369
                                        "<br>Click <a href=\""+openaireClaimsPageUrl+"\">here</a> to curate these Claims.", "text/html");
151 370

  
152 371
            // Send message
......
165 384
        this.fetchClaimHandler = fetchClaimHandler;
166 385
    }
167 386

  
168
    public void setProjectHandler(ProjectHandler projectHandler) {
169
        this.projectHandler = projectHandler;
387
    public void setFetchProjectHandler(FetchProjectHandler fetchProjectHandler) {
388
        this.fetchProjectHandler = fetchProjectHandler;
170 389
    }
171 390

  
391
    public void setFetchNotificationHandler(FetchNotificationHandler fetchNotificationHandler) {
392
        this.fetchNotificationHandler = fetchNotificationHandler;
393
    }
394

  
395
    public void setFetchContextHandler(FetchContextHandler fetchContextHandler) {
396
        this.fetchContextHandler = fetchContextHandler;
397
    }
398

  
172 399
    public static void setOpenaireClaimsPage(String openaireClaimsPage) {
173 400
        EmailSender.openaireClaimsPage = openaireClaimsPage;
174 401
    }
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claimsDemo/CommunityUtils.java
1
package eu.dnetlib.data.claimsDemo;
2

  
3
import com.google.gson.Gson;
4
import org.apache.log4j.Logger;
5

  
6
import java.io.BufferedReader;
7
import java.io.InputStreamReader;
8
import java.io.StringReader;
9
import java.net.HttpURLConnection;
10
import java.net.URL;
11
import java.util.ArrayList;
12
import java.util.List;
13

  
14
public class CommunityUtils {
15
    private static String communityAPI;
16
    String name;
17
    List<String> managers = new ArrayList<String>();
18
    private final static Logger log = Logger.getLogger(CommunityUtils.class);
19

  
20
    public String getCommunityAPI() { return communityAPI; }
21
    public void setCommunityAPI(String communityAPI) { CommunityUtils.communityAPI = communityAPI; }
22

  
23
    public String getName() {
24
        return name;
25
    }
26
    public void setName(String name) {
27
        this.name = name;
28
    }
29

  
30
    public List<String> getManagers() {
31
        return managers;
32
    }
33
    public void setManagers(List<String> managers) {
34
        this.managers = managers;
35
    }
36

  
37
    public static CommunityUtils getCommunityInfo(String community) {
38
        String url = communityAPI + community;
39
        URL obj = null;
40
        String responseStr = null;
41
        log.debug("Community info url is " + url);
42

  
43
        try {
44
            obj = new URL(url);
45
            HttpURLConnection con = (HttpURLConnection) obj.openConnection();
46
            log.debug("User info response code is: " + con.getResponseCode());
47
            if (con.getResponseCode() != 200) {
48
                return null;
49
            }
50
            BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
51
            StringBuffer response = new StringBuffer();
52
            String inputLine;
53
            while ((inputLine = in.readLine()) != null) {
54
                response.append(inputLine).append("\n");
55
            }
56
            in.close();
57
            responseStr = response.toString();
58
        } catch (Exception e) {
59
            log.error("An error occured while trying to fetch user info ", e);
60
            return null;
61
        }
62
        return json2CommunityInfo(responseStr);
63
    }
64
    private static CommunityUtils json2CommunityInfo(String json){
65

  
66
        log.debug("Try to create CommunityInfo class from json: "+json);
67
        if (json == null){
68
            return null;
69
        }
70

  
71
        BufferedReader br = new BufferedReader(new StringReader(json));
72
        //convert the json string back to object
73
        Gson gson = new Gson();
74
        CommunityUtils communityInfo = null;
75
        try {
76
            communityInfo = gson.fromJson(br, CommunityUtils.class);
77
        }catch(Exception e){
78
            log.debug("Error in parsing json response. Given json is : "+json, e);
79
            return null;
80
        }
81

  
82
        log.debug("Original response.........: "+communityInfo.toString());
83

  
84

  
85

  
86
        return communityInfo;
87
    }
88
}
modules/uoa-claims/trunk/src/main/resources/eu/dnetlib/data/claims/migration/springContext-claimsDemo.xml
74 74
        <property name="sqlDAO" ref="sqlDao"/>
75 75
    </bean>
76 76

  
77
    <bean id="fetchContextHandler" class="eu.dnetlib.data.claims.migration.handler.FetchContextHandler">
78
        <property name="sqlDAO" ref="sqlDao"/>
79
        <property name="queryGenerator" ref="queryGenerator"/>
80

  
81
    </bean>
82

  
77 83
    <bean id="contextRelationHandler" class="eu.dnetlib.data.claims.migration.handler.ContextRelationHandler">
78 84
        <property name="sqlDAO" ref="sqlDao"/>
79 85
        <property name="queryGenerator" ref="queryGenerator"/>
......
109 115

  
110 116
    <bean id="emailSender" class="eu.dnetlib.data.emailSender.EmailSender">
111 117
        <property name="fetchClaimHandler" ref="fetchClaimHandler"/>
112
        <property name="projectHandler" ref="projectHandler"/>
118
        <property name="fetchProjectHandler" ref="fetchProjectHandler"/>
119
        <property name="fetchNotificationHandler" ref="fetchNotificationHandler"/>
120
        <property name="fetchContextHandler" ref="fetchContextHandler"/>
113 121
        <property name="openaireClaimsPage" value="${services.claims.mail.angularUrl}"/>
114 122
        <property name="username" value="${services.claims.mail.from}"/>
115 123
        <property name="password" value="${services.claims.mail.password}"/>
......
118 126
        <property name="from" value="${services.claims.mail.from}"/>
119 127
        <property name="specialRecipients" value="${services.claims.mail.specialRecipients}"/>
120 128
    </bean>
129

  
130
    <bean id="CommunityUtils" class="eu.dnetlib.data.claimsDemo.CommunityUtils">
131
        <property name="communityAPI" value="${services.claimsDemo.communityAPI}"/>
132
    </bean>
121 133
    
122 134
    <bean id="sqlStore" class="eu.dnetlib.data.claimsDemo.SqlStore" init-method="init" destroy-method="destroy">
123 135
        <property name="dbUser" value="${services.claimsDemo.db.username}"/>
modules/uoa-claims/trunk/src/main/resources/eu/dnetlib/data/claims/migration/springContext-claimsDemo.properties
5 5
services.claimsDemo.db.password = snowflakes
6 6
services.claimsDemo.useProductionIndex = false
7 7

  
8
services.claimsDemo.communityAPI = https://dev-openaire.d4science.org/openaire/community/
9

  
8 10
#email properties
9 11
## EMAIL SETTINGS
10 12
services.claims.mail.host = smtp.gmail.com
......
20 22
#old version
21 23
#services.claims.directClaimAPIUrl = http://beta.services.openaire.eu:8280/is/mvc/api/publications
22 24
services.claims.directClaimAPIUrl = http://beta.services.openaire.eu:8980/provision/mvc/api/results
25

  

Also available in: Unified diff