Project

General

Profile

« Previous | Next » 

Revision 46067

View differences:

modules/uoa-goldoa-portal/branches/hibernate/target/generated-sources/gwt/eu/dnetlib/client/DataServiceAsync.java
2 2

  
3 3
import com.google.gwt.core.client.GWT;
4 4
import com.google.gwt.user.client.rpc.AsyncCallback;
5
import eu.dnetlib.goldoa.domain.Publisher;
6 5

  
7 6
public interface DataServiceAsync
8 7
{
......
427 426
    void getCommentTemplates( eu.dnetlib.goldoa.domain.Request.RequestStatus requestStatus, AsyncCallback<java.util.List<eu.dnetlib.goldoa.domain.CommentTemplate>> callback );
428 427

  
429 428

  
429
    /**
430
     * GWT-RPC service  asynchronous (client-side) interface
431
     * @see eu.dnetlib.client.DataService
432
     */
433
    void getOrganization( java.lang.String organizationId, AsyncCallback<eu.dnetlib.goldoa.domain.Organization> callback );
430 434

  
431 435

  
432 436
    /**
437
     * GWT-RPC service  asynchronous (client-side) interface
438
     * @see eu.dnetlib.client.DataService
439
     */
440
    void getProject( java.lang.String projectId, AsyncCallback<eu.dnetlib.goldoa.domain.Project> callback );
441

  
442

  
443
    /**
433 444
     * Utility class to get the RPC Async interface from client-side code
434 445
     */
435 446
    public static final class Util 
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/server/BudgetServlet.java
60 60
                    String value = item.getString();
61 61

  
62 62
                    if (fieldName.equals("institution")) {
63
                        budget.setOrganization(value);
63
                        //TODO fix!
64
                        //budget.setOrganization(value);
64 65
                    } else if (fieldName.equals("amountRequested")) {
65 66
                        budget.setAmountRequested(Float.parseFloat(value));
66 67
                    } else if (fieldName.equals("userId")) {
67
                        budget.setUser(value);
68
                        //budget.setUser(value);
68 69
                    } else if (fieldName.equals("startDate")) {
69 70
                        budget.setStartdate(new SimpleDateFormat("yyyy/MM/dd").parse(value));
70 71
                    } else if (fieldName.equals("endDate")) {
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/server/DataServiceImpl.java
239 239
        return publisherManager.getPublisher(publisherId);
240 240
    }
241 241

  
242

  
242 243
    @Override
243 244
    public Publication resolveDOI(String doi) throws ManagerException {
244 245
        return publicationManager.resolveDOI(doi);
......
626 627
            statsData.setPublishersFullInfo(fullInfo);
627 628
        }
628 629
    }
630

  
631
    @Override
632
    public  Organization getOrganization(String organizationId) throws OrganizationManagerException {
633
        return organizationManager.getById(organizationId);
634
    }
635

  
636
    @Override
637
    public Project getProject(String projectId){
638
        return projectManager.getById(projectId);
639
    }
629 640
}
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/NewBudgetRequestWidget.java
153 153
                        bankAccount.setBankName(nameOfBank.getValue().trim());
154 154
                        bankAccount.setIban(accountNumber.getValue().trim());
155 155

  
156
                        Budget budget = new Budget();
156
                        final Budget budget = new Budget();
157 157
                        budget.setUser(GoldOAPortal.currentUser);
158 158
                        budget.setBankAccount(bankAccount);
159 159
                        budget.setAmountRequested(Float.parseFloat(budgetRequestedTextBox.getValue().trim()));
......
161 161
                        if(Utils.currentUserHasRoleApproved("publisher") && GoldOAPortal.currentUser.getPublisher()!=null) {
162 162
                            budget.setPublisher(GoldOAPortal.currentUser.getPublisher());
163 163
                        } else {
164
                            budget.setOrganization(institutions.getSelectedValue());
164
                            dataService.getOrganization(institutions.getSelectedValue(), new AsyncCallback<Organization>() {
165
                                @Override
166
                                public void onFailure(Throwable throwable) {
167

  
168
                                }
169

  
170
                                @Override
171
                                public void onSuccess(Organization organization) {
172
                                    budget.setOrganization(organization);
173
                                }
174
                            });
165 175
                        }
166 176

  
167 177
                        budget.setStartdate(startDateDateBox.getValue());
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/monitor/BudgetInfoElement.java
22 22
import eu.dnetlib.client.widgets.ConfirmActionModal;
23 23
import eu.dnetlib.goldoa.domain.Budget;
24 24
import eu.dnetlib.goldoa.domain.Comment;
25
import eu.dnetlib.goldoa.domain.CommentTemplate;
25 26

  
27
import java.sql.Timestamp;
26 28
import java.util.Date;
27 29

  
28 30
/**
......
141 143
                                errorLabel.setText("System error initial approving this budget request");
142 144
                                errorLabel.setVisible(true);
143 145
                                if(actionListener!=null) {
144
                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Date(), comment, templateId);
146
                                    //TODO fix comment template
147
                                    CommentTemplate ct = new CommentTemplate();
148
                                    /*ct.setId(templateId);
149
                                    ct.setComment(comment);*/
150
                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Timestamp(new Date().getTime()), comment, ct);
145 151
                                    actionListener.actionHappened(false, Budget.Status.INITIALLY_APPROVED, newComment);
146 152
                                }
147 153
                            }
......
162 168
                                actionButtons.add(uploadContract);
163 169

  
164 170
                                if(actionListener!=null) {
165
                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Date(), comment, templateId);
171
                                    //TODO fix comment template
172
                                    CommentTemplate ct = new CommentTemplate();
173
                                    /*ct.setId(templateId);
174
                                    ct.setComment(comment);*/
175
                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Timestamp(new Date().getTime()), comment, ct);
166 176
                                    actionListener.actionHappened(true, Budget.Status.INITIALLY_APPROVED, newComment);
167 177
                                }
168 178
                            }
......
215 225
                                        errorLabel.setText("System error rejecting this budget request");
216 226
                                        errorLabel.setVisible(true);
217 227
                                        if(actionListener!=null) {
218
                                            Comment newComment = new Comment(GoldOAPortal.currentUser, new Date(), comment, templateId);
228
                                            //TODO fix comment template
229
                                            CommentTemplate ct = new CommentTemplate();
230
                                            /*ct.setId(templateId);
231
                                            ct.setComment(comment);*/
232
                                            Comment newComment = new Comment(GoldOAPortal.currentUser, new Timestamp(new Date().getTime()), comment, ct);
219 233
                                            actionListener.actionHappened(false, Budget.Status.REJECTED, newComment);
220 234
                                        }
221 235
                                    }
......
230 244
                                        successLabel.setVisible(true);
231 245
                                        budgetInfoPanel.remove(actionButtons);
232 246
                                        if(actionListener!=null) {
233
                                            Comment newComment = new Comment(GoldOAPortal.currentUser, new Date(), comment, templateId);
247
                                            //TODO fix comment template
248
                                            CommentTemplate ct = new CommentTemplate();
249
                                            /*ct.setId(templateId);
250
                                            ct.setComment(comment);*/
251
                                            Comment newComment = new Comment(GoldOAPortal.currentUser, new Timestamp(new Date().getTime()), comment, ct);
234 252
                                            actionListener.actionHappened(true, Budget.Status.REJECTED, newComment);
235 253
                                        }
236 254
                                    }
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/monitor/MonitorBudgetsWidget.java
119 119
        budgetsForApprovalPanel.addStyleName("loading");
120 120
        budgetsForApprovalPanel.add(loadingWheel);
121 121

  
122
        dataService.getBudgets(new AsyncCallback<List<BudgetInfo>>() {
122
        dataService.getBudgets(new AsyncCallback<List<Budget>>() {
123 123

  
124 124
            @Override
125 125
            public void onFailure(Throwable throwable) {
......
132 132
            }
133 133

  
134 134
            @Override
135
            public void onSuccess(List<BudgetInfo> budgetInfoList) {
135
            public void onSuccess(List<Budget> budgetInfoList) {
136 136

  
137 137
                budgetsForApprovalPanel.clear();
138 138
                budgetsForApprovalPanel.removeStyleName("loading");
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/monitor/RequestInfoElement.java
22 22
import eu.dnetlib.client.widgets.FormFieldSet;
23 23
import eu.dnetlib.goldoa.domain.*;
24 24

  
25
import java.sql.Timestamp;
26
import java.util.ArrayList;
25 27
import java.util.Date;
26 28
import java.util.List;
27 29

  
......
198 200
                                    CommentTemplate ct = new CommentTemplate();
199 201
                                    /*ct.setId(templateId);
200 202
                                    ct.setComment(comment);*/
201
                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Date(), comment, ct);
203
                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Timestamp(new Date().getTime()), comment, ct);
202 204
                                    actionListener.actionHappened(false, Request.RequestStatus.APPROVED, newComment);
203 205
                                }
204 206
                            }
......
213 215
                                successLabel.setVisible(true);
214 216
                                requestInfoPanel.remove(actionButtons);
215 217
                                if(actionListener!=null) {
216
                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Date(), comment, templateId);
218
                                    //TODO fix comment template
219
                                    CommentTemplate ct = new CommentTemplate();
220
                                    /*ct.setId(templateId);
221
                                    ct.setComment(comment);*/
222
                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Timestamp(new Date().getTime()), comment, ct);
217 223
                                    actionListener.actionHappened(true, Request.RequestStatus.APPROVED, newComment);
218 224
                                }
219 225
                            }
......
255 261
                                errorLabel.setText("Error while conditionally approving request.");
256 262
                                errorLabel.setVisible(true);
257 263
                                if (actionListener != null) {
258
                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Date(), comment, templateId);
264
                                    //TODO fix comment template
265
                                    CommentTemplate ct = new CommentTemplate();
266
                                    /*ct.setId(templateId);
267
                                    ct.setComment(comment);*/
268
                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Timestamp(new Date().getTime()), comment, ct);
259 269
                                    actionListener.actionHappened(false, Request.RequestStatus.CONDITIONALLY_APPROVED, newComment);
260 270
                                }
261 271
                            }
......
270 280
                                successLabel.setVisible(true);
271 281
                                requestInfoPanel.remove(actionButtons);
272 282
                                if (actionListener != null) {
273
                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Date(), comment, templateId);
283
                                    //TODO fix comment template
284
                                    CommentTemplate ct = new CommentTemplate();
285
                                    /*ct.setId(templateId);
286
                                    ct.setComment(comment);*/
287
                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Timestamp(new Date().getTime()), comment, ct);
274 288
                                    actionListener.actionHappened(true, Request.RequestStatus.CONDITIONALLY_APPROVED, newComment);
275 289
                                }
276 290
                            }
......
317 331
                                                errorLabel.setText(goldOAConstants.monitorErrorRejectingRequest());
318 332
                                                errorLabel.setVisible(true);
319 333
                                                if (actionListener != null) {
320
                                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Date(), comment, templateId);
334
                                                    //TODO fix comment template
335
                                                    CommentTemplate ct = new CommentTemplate();
336
                                                    /*ct.setId(templateId);
337
                                                    ct.setComment(comment);*/
338
                                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Timestamp(new Date().getTime()), comment, ct);
321 339
                                                    actionListener.actionHappened(false, Request.RequestStatus.REJECTED, newComment);
322 340
                                                }
323 341
                                            }
......
332 350
                                                successLabel.setVisible(true);
333 351
                                                requestInfoPanel.remove(actionButtons);
334 352
                                                if (actionListener != null) {
335
                                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Date(), comment, templateId);
353
                                                    //TODO fix comment template
354
                                                    CommentTemplate ct = new CommentTemplate();
355
                                                    /*ct.setId(templateId);
356
                                                    ct.setComment(comment);*/
357
                                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Timestamp(new Date().getTime()), comment, ct);
336 358
                                                    actionListener.actionHappened(true, Request.RequestStatus.REJECTED, newComment);
337 359
                                                }
338 360
                                            }
......
367 389
                                                errorLabel.setText(goldOAConstants.monitorErrorRejectingRequest());
368 390
                                                errorLabel.setVisible(true);
369 391
                                                if (actionListener != null) {
370
                                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Date(), comment, templateId);
392
                                                    //TODO fix comment template
393
                                                    CommentTemplate ct = new CommentTemplate();
394
                                                    /*ct.setId(templateId);
395
                                                    ct.setComment(comment);*/
396
                                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Timestamp(new Date().getTime()), comment, ct);
371 397
                                                    actionListener.actionHappened(false, Request.RequestStatus.REJECTED, newComment);
372 398
                                                }
373 399
                                            }
......
382 408
                                                successLabel.setVisible(true);
383 409
                                                requestInfoPanel.remove(actionButtons);
384 410
                                                if (actionListener != null) {
385
                                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Date(), comment, templateId);
411
                                                    //TODO fix comment template
412
                                                    CommentTemplate ct = new CommentTemplate();
413
                                                    /*ct.setId(templateId);
414
                                                    ct.setComment(comment);*/
415
                                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Timestamp(new Date().getTime()), comment, ct);
386 416
                                                    actionListener.actionHappened(true, Request.RequestStatus.REJECTED, newComment);
387 417
                                                }
388 418
                                            }
......
426 456
                                errorLabel.setText("Error while marking the request as liberary fund - paid.");
427 457
                                errorLabel.setVisible(true);
428 458
                                if (actionListener != null) {
429
                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Date(), comment, templateId);
459
                                    //TODO fix comment template
460
                                    CommentTemplate ct = new CommentTemplate();
461
                                    /*ct.setId(templateId);
462
                                    ct.setComment(comment);*/
463
                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Timestamp(new Date().getTime()), comment, ct);
430 464
                                    actionListener.actionHappened(false, Request.RequestStatus.LIBRARY_FUND_PAID, newComment);
431 465
                                }
432 466
                            }
......
441 475
                                successLabel.setVisible(true);
442 476
                                requestInfoPanel.remove(actionButtons);
443 477
                                if (actionListener != null) {
444
                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Date(), comment, templateId);
478
                                    //TODO fix comment template
479
                                    CommentTemplate ct = new CommentTemplate();
480
                                    /*ct.setId(templateId);
481
                                    ct.setComment(comment);*/
482
                                    Comment newComment = new Comment(GoldOAPortal.currentUser, new Timestamp(new Date().getTime()), comment, ct);
445 483
                                    actionListener.actionHappened(true, Request.RequestStatus.LIBRARY_FUND_PAID, newComment);
446 484
                                }
447 485
                            }
......
483 521
                                        errorLabel.setText("Error while marking the request as publisher fund - paid.");
484 522
                                        errorLabel.setVisible(true);
485 523
                                        if (actionListener != null) {
486
                                            Comment newComment = new Comment(GoldOAPortal.currentUser, new Date(), comment, templateId);
524
                                            //TODO fix comment template
525
                                            CommentTemplate ct = new CommentTemplate();
526
                                            /*ct.setId(templateId);
527
                                            ct.setComment(comment);*/
528
                                            Comment newComment = new Comment(GoldOAPortal.currentUser, new Timestamp(new Date().getTime()), comment, ct);
487 529
                                            actionListener.actionHappened(false, Request.RequestStatus.PUBLISHER_FUND_PAID, newComment);
488 530
                                        }
489 531
                                    }
......
498 540
                                        successLabel.setVisible(true);
499 541
                                        requestInfoPanel.remove(actionButtons);
500 542
                                        if (actionListener != null) {
501
                                            Comment newComment = new Comment(GoldOAPortal.currentUser, new Date(), comment, templateId);
543
                                            //TODO fix comment template
544
                                            CommentTemplate ct = new CommentTemplate();
545
                                            /*ct.setId(templateId);
546
                                            ct.setComment(comment);*/
547
                                            Comment newComment = new Comment(GoldOAPortal.currentUser, new Timestamp(new Date().getTime()), comment, ct);
502 548
                                            actionListener.actionHappened(true, Request.RequestStatus.PUBLISHER_FUND_PAID, newComment);
503 549
                                        }
504 550
                                    }
......
565 611

  
566 612
        requestInfoPanel.add(secondDivider);
567 613
        if(request.getRequestComments()!=null && !request.getRequestComments().isEmpty()) {
568
            CommentsInfo commentsInfo = new CommentsInfo(request.getRequestComments());
614
            List<Comment> comments = new ArrayList<>();
615
            for(RequestComment rc : request.getRequestComments())
616
                comments.add(rc.getComment());
617
            CommentsInfo commentsInfo = new CommentsInfo(comments);
569 618
            commentsInfo.addStyleName("requestComments");
570 619
            requestInfoPanel.add(commentsInfo.asWidget());
571 620
        }
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/accountingmonitor/AccountingRequestInfoElement.java
19 19
import eu.dnetlib.client.fundingrequest.stepinfo.*;
20 20
import eu.dnetlib.client.widgets.ConfirmActionModal;
21 21
import eu.dnetlib.client.widgets.FormFieldSet;
22
import eu.dnetlib.goldoa.domain.Comment;
22 23
import eu.dnetlib.goldoa.domain.Currency;
23 24
import eu.dnetlib.goldoa.domain.Request;
25
import eu.dnetlib.goldoa.domain.RequestComment;
24 26

  
27
import java.util.ArrayList;
28
import java.util.List;
29

  
25 30
/**
26 31
 * Created by stefania on 4/30/15.
27 32
 */
......
396 401
            requestInfoPanel.add(secondDivider);
397 402

  
398 403
            if(request.getRequestComments()!=null && !request.getRequestComments().isEmpty()) {
399
                CommentsInfo commentsInfo = new CommentsInfo(request.getRequestComments());
404
                List<Comment> comments = new ArrayList<>();
405
                for(RequestComment rc : request.getRequestComments())
406
                    comments.add(rc.getComment());
407

  
408
                CommentsInfo commentsInfo = new CommentsInfo(comments);
400 409
                commentsInfo.addStyleName("requestComments");
401 410
                requestInfoPanel.add(commentsInfo.asWidget());
402 411
            }
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/fundingrequest/newrequest/researcherstep/ResearcherInfoForm.java
126 126
        List<Affiliation> affiliations = multipleAffiliationsWidget.getAffiliations();
127 127
        user.setAffiliations(affiliations);
128 128

  
129
        List<UserRole> personRoles = new ArrayList<>();
130
        PersonRole personRole = new PersonRole();
131
        personRole.setPerson(user);
132
        personRole.setRole(new Role("researcher"));
133
        personRole.setApproved(true);
134
        personRoles.add(personRole);
135
        user.setRoles(personRoles);
129
        UserRole ur = new UserRole();
130
        UserRolePK urpk = new UserRolePK();
131
        urpk.setUser(user);
132
        urpk.setRole(new Role("researcher"));
133
        ur.setPk(urpk);
134
        ur.setApproved(true);
135
        user.getRoles().add(ur);
136 136

  
137 137
        return user;
138 138
    }
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/fundingrequest/newrequest/researcherstep/ResearcherStepWidget.java
14 14
import com.google.gwt.event.logical.shared.ValueChangeHandler;
15 15
import com.google.gwt.user.client.rpc.AsyncCallback;
16 16
import com.google.gwt.user.client.ui.*;
17
import eu.dnetlib.client.GoldOAConstants;
18
import eu.dnetlib.client.GoldOAPortal;
19
import eu.dnetlib.client.Utils;
17
import eu.dnetlib.client.*;
20 18
import eu.dnetlib.client.user.MyPersonalInfoWidget;
21 19
import eu.dnetlib.client.fundingrequest.newrequest.EligibilityDisplayWidget;
22 20
import eu.dnetlib.client.fundingrequest.newrequest.EligibilityService;
......
26 24
import eu.dnetlib.goldoa.domain.*;
27 25
import eu.dnetlib.shared.FundingWizardState;
28 26

  
27
import javax.xml.crypto.Data;
28

  
29 29
/**
30 30
 * Created by stefania on 2/25/15.
31 31
 */
......
57 57

  
58 58
    private EligibilityServiceAsync eligibilityService = GWT.create(EligibilityService.class);
59 59
    private GoldOAConstants goldOAConstants = GWT.create(GoldOAConstants.class);
60
    private DataServiceAsync dataService = GWT.create(DataService.class);
60 61

  
61 62
    private FundingWizardStepCompleteListener fundingWizardStepCompleteListener;
62 63

  
......
159 160
    @Override
160 161
    public void updateState(FundingWizardState fundingWizardState) {
161 162

  
162
        Request request = fundingWizardState.getRequest();
163
        final Request request = fundingWizardState.getRequest();
163 164
        if(researcher !=null) {
164 165
            request.setResearcher(researcher);
165 166
            fundingWizardState.setResearcher(researcher);
......
176 177
        } else {
177 178

  
178 179
            if (!GoldOAPortal.currentUser.getAffiliations().isEmpty()) {
179
                request.setOrganization(institutions.getSelectedValue());
180
                dataService.getOrganization(institutions.getSelectedValue(), new AsyncCallback<Organization>() {
181
                    @Override
182
                    public void onFailure(Throwable throwable) {
183

  
184
                    }
185

  
186
                    @Override
187
                    public void onSuccess(Organization organization) {
188
                        request.setOrganization(organization);
189
                    }
190
                });
191

  
192

  
180 193
            } else {
181 194
                request.setOrganization(researcher.getAffiliations().get(0).getOrganization());
182 195
            }
......
210 223
            }
211 224
        } else if(Utils.currentUserHasRoleApproved("researcher")) {
212 225

  
213
            Request request = new Request();
214
            request.setOrganization(institutions.getSelectedValue());
226
            final Request request = new Request();
227

  
228
            dataService.getOrganization(institutions.getSelectedValue(), new AsyncCallback<Organization>() {
229
                @Override
230
                public void onFailure(Throwable throwable) {
231

  
232
                }
233

  
234
                @Override
235
                public void onSuccess(Organization organization) {
236
                    request.setOrganization(organization);
237
                }
238
            });
239

  
240

  
215 241
            eligibilityService.validate(request, new AsyncCallback<Eligibility>() {
216 242

  
217 243
                @Override
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/fundingrequest/newrequest/publicationstep/JournalInfoStep.java
219 219
                journal.setUrl(url.getValue().trim());
220 220
                journal.setLanguages(languages.getValue().trim());
221 221
                journal.setIssn(issnAndEissn.getValue().trim());
222
                journal.setCountry(country.getValue().trim());
222
                journal.setCountry(new Country(country.getValue().trim()));
223 223
                journal.setSubjects(subjects.getValue().trim());
224 224
                journal.setLicence(licence.getValue().trim());
225 225

  
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/fundingrequest/newrequest/accountingstep/AccountingStepWidget.java
20 20
import eu.dnetlib.client.fundingrequest.stepinfo.AlreadyUploadedInvoiceInfo;
21 21
import eu.dnetlib.client.widgets.FormFieldSet;
22 22
import eu.dnetlib.client.widgets.TextBox;
23
import eu.dnetlib.goldoa.domain.BankAccount;
24
import eu.dnetlib.goldoa.domain.Invoice;
25
import eu.dnetlib.goldoa.domain.Publisher;
26
import eu.dnetlib.goldoa.domain.Request;
23
import eu.dnetlib.goldoa.domain.*;
27 24
import eu.dnetlib.shared.FundingWizardState;
28 25

  
29 26
import java.util.Date;
......
285 282
    @Override
286 283
    public void updateState(FundingWizardState fundingWizardState) {
287 284

  
288
        Request request = fundingWizardState.getRequest();
285
        final Request request = fundingWizardState.getRequest();
289 286
        chargesForm.updateRequest(request);
290 287

  
291 288
        if(isInvoiceUploaded) {
......
316 313
        }
317 314

  
318 315
        if(!publisherEmail.getValue().trim().equals("")) {
319
            request.setPublisher(dataService.getUserByEmail(publisherEmail.getValue().trim()));
316
            request.setPublisherEmail(publisherEmail.getValue().trim());
320 317
        }
318

  
321 319
    }
322 320

  
323 321
    @Override
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/fundingrequest/existingrequests/ExistingRequestElement.java
17 17
import eu.dnetlib.client.DataServiceAsync;
18 18
import eu.dnetlib.client.fundingrequest.newrequest.EligibilityDisplayWidget;
19 19
import eu.dnetlib.client.fundingrequest.stepinfo.*;
20
import eu.dnetlib.goldoa.domain.Comment;
20 21
import eu.dnetlib.goldoa.domain.Currency;
21 22
import eu.dnetlib.goldoa.domain.Request;
23
import eu.dnetlib.goldoa.domain.RequestComment;
22 24

  
25
import java.util.ArrayList;
26
import java.util.List;
27

  
23 28
/**
24 29
 * Created by stefania on 3/26/15.
25 30
 */
......
183 188
            requestInfoPanel.add(secondDivider);
184 189

  
185 190
            if(request.getRequestComments()!=null && !request.getRequestComments().isEmpty()) {
186
                CommentsInfo commentsInfo = new CommentsInfo(request.getRequestComments());
191
                List<Comment> comments = new ArrayList<>();
192
                for(RequestComment rc : request.getRequestComments())
193
                    comments.add(rc.getComment());
194
                CommentsInfo commentsInfo = new CommentsInfo(comments);
187 195
                commentsInfo.addStyleName("requestComments");
188 196
                requestInfoPanel.add(commentsInfo.asWidget());
189 197
            }
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/fundingrequest/stepinfo/PublicationFullInfo.java
4 4
import com.google.gwt.user.client.ui.HTML;
5 5
import com.google.gwt.user.client.ui.IsWidget;
6 6
import com.google.gwt.user.client.ui.Widget;
7
import eu.dnetlib.goldoa.domain.Affiliation;
8
import eu.dnetlib.goldoa.domain.Publication;
9
import eu.dnetlib.goldoa.domain.Identifier;
10
import eu.dnetlib.goldoa.domain.PublicationType;
7
import eu.dnetlib.goldoa.domain.*;
11 8

  
12 9
/**
13 10
 * Created by stefania on 3/27/15.
......
38 35

  
39 36
        if(!publication.getAuthors().isEmpty()) {
40 37

  
41
            for(Affiliation author : publication.getAuthors()) {
42
                publicationInfoContents += "<dd>" + author.getPerson().getName();
43
                if(author.getPerson().getInitials()!=null && !author.getPerson().getInitials().trim().equals(""))
44
                    publicationInfoContents += " " + author.getPerson().getInitials().trim();
45
                publicationInfoContents += " " + author.getPerson().getLastname() + "</dd>";
38
            for(Author author : publication.getAuthors()) {
39
                publicationInfoContents += "<dd>" + author.getFirstname();
40
                if(author.getInitials()!=null && !author.getInitials().trim().equals(""))
41
                    publicationInfoContents += " " + author.getInitials().trim();
42
                publicationInfoContents += " " + author.getLastname() + "</dd>";
46 43
            }
47 44
        }
48 45

  
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/fundingrequest/stepinfo/CommentsInfo.java
19 19

  
20 20
    private DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy/MM/dd");
21 21

  
22
    public CommentsInfo(List<RequestComment> comments) {
22
    public CommentsInfo(List<Comment> comments) {
23 23

  
24 24
        commentsInfoContents = "<div>";
25 25

  
26 26
        commentsInfoContents += "<dl><dt class=\"chronologySubTitle\">COMMENTS</dt></dl>";
27 27

  
28 28
        commentsInfoContents += "<ul>";
29
        for(RequestComment comment : comments) {
29
        for(Comment comment : comments) {
30 30
            commentsInfoContents += "<li>" + comment.getComment();
31 31
            if(comment.getUser()!=null) {
32 32
                commentsInfoContents += " ("  + comment.getUser().getFirstname() + " ";
33 33
                if (comment.getUser().getInitials() != null && !comment.getUser().getInitials().trim().equals(""))
34 34
                    commentsInfoContents += comment.getUser().getInitials() + ". ";
35
                commentsInfoContents += comment.getUser().getLastname() + " - " + dtf.format(comment.getRequest().getDate()) + ")";
35
                commentsInfoContents += comment.getUser().getLastname() + " - " + dtf.format(comment.getDate()) + ")";
36 36
            }
37 37
            commentsInfoContents += "</li>";
38 38
        }
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/fundingrequest/stepinfo/PublicationInlineInfo.java
64 64
                if(i!=0)
65 65
                    publicationInfoContents += ", ";
66 66
                publicationInfoContents += publication.getAuthors().get(i).getFirstname();
67
                if(publication.getAuthors().get(i).getInitial()!=null && !publication.getAuthors().get(i).getInitial().trim().equals(""))
68
                    publicationInfoContents += " " + publication.getAuthors().get(i).getInitial().trim() + ".";
67
                if(publication.getAuthors().get(i).getInitials()!=null && !publication.getAuthors().get(i).getInitials().trim().equals(""))
68
                    publicationInfoContents += " " + publication.getAuthors().get(i).getInitials().trim() + ".";
69 69
                publicationInfoContents += " " + publication.getAuthors().get(i).getLastname();
70 70
            }
71 71
            publicationInfoContents += "</dd>";
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/fundingrequest/stepinfo/PublicationChronologyInfo.java
6 6
import com.google.gwt.user.client.ui.HTML;
7 7
import com.google.gwt.user.client.ui.IsWidget;
8 8
import com.google.gwt.user.client.ui.Widget;
9
import eu.dnetlib.goldoa.domain.Affiliation;
10
import eu.dnetlib.goldoa.domain.Publication;
11
import eu.dnetlib.goldoa.domain.Identifier;
12
import eu.dnetlib.goldoa.domain.PublicationType;
9
import eu.dnetlib.goldoa.domain.*;
13 10

  
14 11
/**
15 12
 * Created by stefania on 4/27/15.
......
69 66

  
70 67
                if(!publication.getAuthors().isEmpty()) {
71 68

  
72
                    for(Affiliation author : publication.getAuthors()) {
73
                        tooltipText += author.getPerson().getName();
74
                        if(author.getPerson().getInitials()!=null && !author.getPerson().getInitials().trim().equals(""))
75
                            tooltipText += " " + author.getPerson().getInitials().trim();
76
                        tooltipText += " " + author.getPerson().getLastname() + ", ";
69
                    for(Author author : publication.getAuthors()) {
70
                        tooltipText += author.getFirstname();
71
                        if(author.getInitials()!=null && !author.getInitials().trim().equals(""))
72
                            tooltipText += " " + author.getInitials().trim();
73
                        tooltipText += " " + author.getLastname() + ", ";
77 74
                    }
78 75

  
79 76
                    tooltipText = tooltipText.substring(0, tooltipText.length()-2);
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/widgets/MultipleAuthorsWidget.java
73 73
        return multipleAuthorsPanel;
74 74
    }
75 75

  
76
    public List<Affiliation> getAuthors() {
76
    public List<Author> getAuthors() {
77 77

  
78
        List<Affiliation> authorsList = new ArrayList<>();
78
        List<Author> authorsList = new ArrayList<>();
79 79

  
80 80
        for(AuthorInfoWidget authorInfoWidget : authorInfoWidgetList) {
81

  
82 81
            if(authorInfoWidget.getAuthor()!=null)
83 82
                authorsList.add(authorInfoWidget.getAuthor());
84

  
85 83
        }
86

  
87 84
        return authorsList;
88 85
    }
89 86

  
......
156 153
    }
157 154

  
158 155
    private void loadDefaultAffiliation(Organization organization, AuthorInfoWidget authorInfoWidget) {
159
        Affiliation affiliation = new Affiliation();
156
        //TODO assana task
157
       /* Affiliation affiliation = new Affiliation();
160 158
        affiliation.setOrganization(organization);
161
        authorInfoWidget.loadAuthor(affiliation);
159
        authorInfoWidget.loadAuthor(affiliation);*/
162 160
    }
163 161
}
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/widgets/AuthorInfoWidget.java
7 7
import com.google.gwt.user.client.ui.IsWidget;
8 8
import com.google.gwt.user.client.ui.Widget;
9 9
import eu.dnetlib.goldoa.domain.Affiliation;
10
import eu.dnetlib.goldoa.domain.Author;
11
import eu.dnetlib.goldoa.domain.User;
10 12

  
11 13
import java.util.ArrayList;
12 14
import java.util.List;
......
83 85
        this.deleteAuthorListener = deleteAuthorListener;
84 86
    }
85 87

  
86
    public Affiliation getAuthor() {
88
    public Author getAuthor() {
87 89

  
88 90
        if(isComplete()) {
91
            Author author = new Author();
92
            author.setFirstname(firstNameTextBox.getValue().trim());
93
            author.setInitials(initialsTextBox.getValue().trim());
94
            author.setLastname(lastNameTextBox.getValue().trim());
95
            author.setEmail(emailTextBox.getValue().trim());
89 96

  
90
            Affiliation affiliation = new Affiliation();
91

  
92
            Person person = new Person();
93
            person.setName(firstNameTextBox.getValue().trim());
94
            person.setInitials(initialsTextBox.getValue().trim());
95
            person.setLastname(lastNameTextBox.getValue().trim());
96
            person.setEmail(emailTextBox.getValue().trim());
97
            affiliation.setPerson(person);
98

  
99 97
            if(affiliationInfoWidget.getAffiliation()!=null) {
100
                affiliation.setOrganization(affiliationInfoWidget.getAffiliation().getOrganization());
98
                author.setOrganization(affiliationInfoWidget.getAffiliation().getOrganization());
101 99
                if (affiliationInfoWidget.getAffiliation().getDepartment() != null && !affiliationInfoWidget.getAffiliation().getDepartment().equals(""))
102
                    affiliation.setDepartment(affiliationInfoWidget.getAffiliation().getDepartment());
100
                    author.setDepartment(affiliationInfoWidget.getAffiliation().getDepartment());
103 101
            }
104 102

  
105
            return affiliation;
103
            return author;
106 104
        }
107 105

  
108 106
        return null;
......
116 114
        return false;
117 115
    }
118 116

  
119
    public void loadAuthor(Affiliation author) {
117
    public void loadAuthor(Author author) {
120 118

  
121
        if(author.getPerson()!=null) {
122
            if(author.getPerson().getName()!=null)
123
                firstNameTextBox.setValue(author.getPerson().getName());
124
            if(author.getPerson().getLastname()!=null)
125
                lastNameTextBox.setValue(author.getPerson().getLastname());
126
            if(author.getPerson().getInitials()!=null)
127
                initialsTextBox.setValue(author.getPerson().getInitials());
128
            if(author.getPerson().getEmail()!=null)
129
                emailTextBox.setValue(author.getPerson().getEmail());
119
        if(author!=null) {
120
            if(author.getFirstname()!=null)
121
                firstNameTextBox.setValue(author.getFirstname());
122
            if(author.getLastname()!=null)
123
                lastNameTextBox.setValue(author.getLastname());
124
            if(author.getInitials()!=null)
125
                initialsTextBox.setValue(author.getInitials());
126
            if(author.getEmail()!=null)
127
                emailTextBox.setValue(author.getEmail());
130 128
        }
131 129

  
132 130
        if(author.getOrganization()!=null) {
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/DataService.java
1 1
package eu.dnetlib.client;
2 2

  
3
import com.google.gwt.user.client.rpc.AsyncCallback;
3 4
import com.google.gwt.user.client.rpc.RemoteService;
4 5
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
5 6
import eu.dnetlib.goldoa.domain.*;
......
143 144
                                            String[] organizations, String[] countries, String[] scientificAreas);
144 145

  
145 146
    public List<CommentTemplate> getCommentTemplates(Request.RequestStatus requestStatus);
147

  
148
    public  Organization getOrganization(String organizationId) throws OrganizationManagerException;
149

  
150
    public Project getProject(String projectId);
146 151
}
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/HomeWidget.java
16 16
import eu.dnetlib.client.fundingrequest.newrequest.EligibilityServiceAsync;
17 17
import eu.dnetlib.client.widgets.AutoCompleteWidget;
18 18
import eu.dnetlib.goldoa.domain.Eligibility;
19
import eu.dnetlib.goldoa.domain.Project;
19 20
import eu.dnetlib.goldoa.domain.Request;
20 21
import eu.dnetlib.goldoa.domain.Vocabulary;
21 22

  
......
73 74
    private GoldOAConstants goldOAConstants = GWT.create(GoldOAConstants.class);
74 75

  
75 76
    private EligibilityServiceAsync eligibilityService = GWT.create(EligibilityService.class);
77
    private DataServiceAsync dataService = GWT.create(DataService.class);
76 78

  
77 79
    public HomeWidget() {
78 80

  
......
117 119
                eligibilityPanel.addStyleName("loading-small");
118 120
                eligibilityPanel.add(loadingWheel);
119 121

  
120
                Request request = new Request();
121
                request.setProject(vocabulary.getId());
122
                final Request request = new Request();
122 123

  
124
                dataService.getProject(vocabulary.getId(), new AsyncCallback<Project>() {
125
                    @Override
126
                    public void onFailure(Throwable throwable) {
127

  
128
                    }
129

  
130
                    @Override
131
                    public void onSuccess(Project project) {
132
                        request.setProject(project);
133
                    }
134
                });
135

  
123 136
                eligibilityService.validate(request, new AsyncCallback<Eligibility>() {
124 137

  
125 138
                    @Override
modules/uoa-goldoa-portal/branches/hibernate/src/main/java/eu/dnetlib/client/user/UserRegistrationForm.java
479 479

  
480 480
    private User getPerson() {
481 481

  
482
        User person;
482
        final User person;
483 483
        if(isEdit)
484 484
            person = registeredPerson;
485 485
        else
......
522 522

  
523 523
        List<UserRole> personRoles = new ArrayList<>();
524 524

  
525
        for(String role : selectedRoles) {
525
        for(final String roleId : selectedRoles) {
526 526

  
527 527
            UserRole personRole = new UserRole();
528 528
            UserRolePK urPk = new UserRolePK();
529 529

  
530 530
            urPk.setUser(person);
531
            //TODO get role from db
532
            urPk.setRole(new Role(role));
531
            urPk.setRole(new Role(roleId));
533 532
            personRole.setPk(urPk);
534 533

  
535 534
            if(GoldOAPortal.currentUser==null) {
536
                if (role.equals("researcher"))
535
                if (roleId.equals("researcher"))
537 536
                    personRole.setApproved(true);
538 537
                else
539 538
                    personRole.setApproved(false);
540 539
            } else {
541
                if(Utils.currentUserHasRole(role)) {
542
                    personRole.setApproved(Utils.isRoleApprovedForCurrentUser(role));
540
                if(Utils.currentUserHasRole(roleId)) {
541
                    personRole.setApproved(Utils.isRoleApprovedForCurrentUser(roleId));
543 542
                } else {
544
                    if (role.equals("researcher"))
543
                    if (roleId.equals("researcher"))
545 544
                        personRole.setApproved(true);
546 545
                    else
547 546
                        personRole.setApproved(false);
548 547
                }
549 548
            }
550 549

  
551
            personRoles.add(personRole);
550
            person.getRoles().add(personRole);
551

  
552 552
        }
553 553

  
554
        for(String role : notShownRoles) {
554
        for(String roleId : notShownRoles) {
555 555

  
556 556
            UserRole personRole = new UserRole();
557 557
            UserRolePK urPk = new UserRolePK();
558 558

  
559 559
            urPk.setUser(person);
560
            urPk.setRole(new Role(role));
560
            urPk.setRole(new Role(roleId));
561 561
            personRole.setPk(urPk);
562 562

  
563 563
            if(GoldOAPortal.currentUser==null) {
564
                if (role.equals("researcher"))
564
                if (roleId.equals("researcher"))
565 565
                    personRole.setApproved(true);
566 566
                else
567 567
                    personRole.setApproved(false);
568 568
            } else {
569
                if(Utils.currentUserHasRole(role)) {
570
                    personRole.setApproved(Utils.isRoleApprovedForCurrentUser(role));
569
                if(Utils.currentUserHasRole(roleId)) {
570
                    personRole.setApproved(Utils.isRoleApprovedForCurrentUser(roleId));
571 571
                } else {
572
                    if (role.equals("researcher"))
572
                    if (roleId.equals("researcher"))
573 573
                        personRole.setApproved(true);
574 574
                    else
575 575
                        personRole.setApproved(false);
576 576
                }
577 577
            }
578

  
579 578
            personRoles.add(personRole);
580 579
        }
581 580
        person.setRole(personRoles);

Also available in: Unified diff