r3395 - in trunk: pollen-persistence/src/main/java/org/chorem/pollen pollen-persistence/src/main/java/org/chorem/pollen/business/persistence pollen-persistence/src/main/java/org/chorem/pollen/entities/migration pollen-services/src/main/java/org/chorem/pollen/bean pollen-services/src/main/java/org/chorem/pollen/services pollen-services/src/main/java/org/chorem/pollen/services/exceptions pollen-services/src/main/java/org/chorem/pollen/services/impl pollen-ui-struts2/src/main/java/org/chorem/p
Author: tchemit Date: 2012-05-28 17:34:46 +0200 (Mon, 28 May 2012) New Revision: 3395 Url: http://chorem.org/repositories/revision/pollen/3395 Log: add myself to copyright + reformat code Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenApplicationConfigProvider.java trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenIOUtil.java trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/CommentDAOImpl.java trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PersonListDAOImpl.java trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PersonToListDAOImpl.java trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollAccountDAOImpl.java trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollDAOImpl.java trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollImpl.java trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/UserAccountDAOImpl.java trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/VoteDAOImpl.java trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/VotingListImpl.java trunk/pollen-persistence/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_4.java trunk/pollen-services/src/main/java/org/chorem/pollen/bean/ChoiceHelper.java trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollDateChoice.java trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollImageChoice.java trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollResult.java trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollResultList.java trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollUri.java trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollUrl.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/FavoriteListImport.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/PollenNotifierWorker.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/PollenServiceFunctions.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/PollenServicePredicates.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListImportException.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/InvalidEmailException.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollAccountNotFound.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollChoiceNotFoundException.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollCommentNotFound.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollVoteNotFoundException.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UnauthorizedPollAccessException.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/VoteNotFoundException.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/EmailService.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteListImportCSV.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteListImportLDAP.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteService.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollFeedService.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollResultsService.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PreventRuleService.java trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/VoteService.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenUIUtils.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PageSkin.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/Confirm.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollUriIdAction.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AddComment.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ClosePoll.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/EditVote.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultLink.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/VoteForPoll.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/LostPassword.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteLists.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/converters/BooleanIntegerConverter.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/converters/PollUriConverter.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/ResultAccessRequired.java Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenApplicationConfigProvider.java =================================================================== --- trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenApplicationConfigProvider.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenApplicationConfigProvider.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenIOUtil.java =================================================================== --- trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenIOUtil.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenIOUtil.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/CommentDAOImpl.java =================================================================== --- trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/CommentDAOImpl.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/CommentDAOImpl.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PersonListDAOImpl.java =================================================================== --- trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PersonListDAOImpl.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PersonListDAOImpl.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PersonToListDAOImpl.java =================================================================== --- trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PersonToListDAOImpl.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PersonToListDAOImpl.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollAccountDAOImpl.java =================================================================== --- trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollAccountDAOImpl.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollAccountDAOImpl.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollDAOImpl.java =================================================================== --- trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollDAOImpl.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollDAOImpl.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollImpl.java =================================================================== --- trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollImpl.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/PollImpl.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/UserAccountDAOImpl.java =================================================================== --- trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/UserAccountDAOImpl.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/UserAccountDAOImpl.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/VoteDAOImpl.java =================================================================== --- trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/VoteDAOImpl.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/VoteDAOImpl.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/VotingListImpl.java =================================================================== --- trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/VotingListImpl.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/business/persistence/VotingListImpl.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_4.java =================================================================== --- trunk/pollen-persistence/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_4.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_4.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/bean/ChoiceHelper.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/bean/ChoiceHelper.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/bean/ChoiceHelper.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -37,10 +37,11 @@ * Created: 30/03/12 * * @author fdesbois <desbois@codelutin.com> + * @since 1.3 */ public final class ChoiceHelper { - - private ChoiceHelper() { + + private ChoiceHelper() { } public static Object toValue(Choice choice, ChoiceType choiceType) { @@ -48,14 +49,14 @@ switch (choiceType) { case DATE: if (choice instanceof PollDateChoice) { - result = ((PollDateChoice)choice).getDate(); + result = ((PollDateChoice) choice).getDate(); } else { result = new Date(Long.parseLong(choice.getName())); } break; case IMAGE: if (choice instanceof PollImageChoice) { - result = ((PollImageChoice)choice).getLocation(); + result = ((PollImageChoice) choice).getLocation(); } else { result = choice.getName(); } @@ -97,5 +98,5 @@ } return result; } - + } Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollDateChoice.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollDateChoice.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollDateChoice.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollImageChoice.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollImageChoice.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollImageChoice.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -36,7 +36,7 @@ public class PollImageChoice extends ChoiceImpl { private static final long serialVersionUID = 1L; - + public static final String PROPERTY_LOCATION = "location"; protected String location; @@ -55,7 +55,7 @@ setTopiaId(choice.getTopiaId()); setValidate(choice.isValidate()); } - + public void toChoice(Choice choice) { choice.setName(getName()); choice.setDescription(getDescription()); Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollResult.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollResult.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollResult.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollResultList.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollResultList.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollResultList.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -31,7 +31,7 @@ * TODO * * @author tchemit <chemit@codelutin.com> - * @since TODO + * @since 1.3 */ public class PollResultList { Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollUri.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollUri.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollUri.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -54,9 +54,9 @@ public static PollUri newPollUri(String pollId, String accountId) { Preconditions.checkNotNull(pollId); - + PollUri result = new PollUri(); - + result.pollId = pollId; result.accountId = accountId; return result; @@ -66,7 +66,8 @@ protected String accountId; - private PollUri() { } + private PollUri() { + } public String getPollId() { return pollId; Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollUrl.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollUrl.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/bean/PollUrl.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -52,8 +52,8 @@ /** * Create a new PollUrl which is a copy of the given {@code pollUrl} with * an other {@code accountId} for {@link PollUri}. - * - * @param pollUrl PollUrl to copy + * + * @param pollUrl PollUrl to copy * @param accountId New accountId to use for copy * @return the new PollUrl */ @@ -65,7 +65,8 @@ return result; } - private PollUrl() { } + private PollUrl() { + } public String getBaseUrl() { return baseUrl; @@ -74,7 +75,7 @@ public PollUri getPollUri() { return pollUri; } - + public String getUrl() { return getBaseUrl() + getPollUri().getUri(); } Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/FavoriteListImport.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/FavoriteListImport.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/FavoriteListImport.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -33,13 +33,13 @@ /** * Used to import a favorite List or a List of {@link PollAccount} from a given * source url (file, external service, ...) - * + * <p/> * Created: 16/04/12 * * @author fdesbois <desbois@codelutin.com> - * @since 1.3 * @see FavoriteListImportLDAP * @see FavoriteListImportCSV + * @since 1.3 */ public interface FavoriteListImport { @@ -48,7 +48,7 @@ * successful list of {@link PollAccount} instanciated during import. No * database save is done here, only the extraction from an input url to * a list of entities to manage. - * + * * @param url Url of the file or service that contains data to import * @return the List of PollAccount imported * @throws FavoriteListImportException for any import error Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/PollenNotifierWorker.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/PollenNotifierWorker.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/PollenNotifierWorker.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/PollenServiceFunctions.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/PollenServiceFunctions.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/PollenServiceFunctions.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -113,7 +113,7 @@ public static Function<PersonToList, PersonToList> newPersonToListCreator() { return new PersonToListCreator(); } - + public static class TopiaIdExtractor implements Function<TopiaEntity, String> { @Override Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/PollenServicePredicates.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/PollenServicePredicates.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/PollenServicePredicates.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -33,14 +33,12 @@ * @author fdesbois <desbois@codelutin.com> */ public final class PollenServicePredicates { - + private PollenServicePredicates() { // never instanciate a class with static methods } - /** - * Check if the PollAccount is empty, i.e. has empty votingId or email. - */ + /** Check if the PollAccount is empty, i.e. has empty votingId or email. */ public static final Predicate<PollAccount> POLL_ACCOUNT_NOT_EMPTY = new Predicate<PollAccount>() { @Override Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListImportException.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListImportException.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/FavoriteListImportException.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -21,22 +21,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * #L% */ -/* *##% Pollen - * Copyright (C) 2010 CodeLutin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. ##%*/ - package org.chorem.pollen.services.exceptions; import org.chorem.pollen.services.FavoriteListImport; @@ -49,8 +33,8 @@ /** * Exception during {@link FavoriteListImport#execute(String)} error. There is - * always a cause from librairies used for import. - * + * always a cause from librairies used for import. + * * @author fdesbois <desbois@codelutin.com> */ public class FavoriteListImportException extends Exception { @@ -73,23 +57,19 @@ this(importName, cause.getMessage(), cause); } - /** - * @return the name of import (CSV, LDAP, ...) - */ + /** @return the name of import (CSV, LDAP, ...) */ public String getImportName() { return importName; } - /** - * @return the error message source from import execution. - */ + /** @return the error message source from import execution. */ public String getCauseMessage() { return causeMessage; } /** * Get the message depends on {@code locale}. - * + * * @param locale Locale to translate the message * @return the localized message or default one if locale is null */ Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/InvalidEmailException.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/InvalidEmailException.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/InvalidEmailException.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollAccountNotFound.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollAccountNotFound.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollAccountNotFound.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollChoiceNotFoundException.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollChoiceNotFoundException.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollChoiceNotFoundException.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollCommentNotFound.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollCommentNotFound.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollCommentNotFound.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollVoteNotFoundException.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollVoteNotFoundException.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/PollVoteNotFoundException.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UnauthorizedPollAccessException.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UnauthorizedPollAccessException.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/UnauthorizedPollAccessException.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/VoteNotFoundException.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/VoteNotFoundException.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/exceptions/VoteNotFoundException.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/EmailService.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/EmailService.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/EmailService.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -110,7 +110,7 @@ if (StringUtils.isNotEmpty(poll.getCreator().getEmail())) { int nbVotes = poll.sizeVote(); - + String subject = l_(locale, "pollen.email.voteEmail.subject", pollTitle); String content = l_(locale, "pollen.email.voteEmail.content", @@ -137,7 +137,7 @@ // Mail au créateur if (StringUtils.isNotEmpty(poll.getCreator().getEmail())) { - + String subject, content; if (PollType.FREE == poll.getPollType()) { subject = l_(locale, "pollen.email.createPoll.subject", @@ -178,7 +178,7 @@ } } } - + public void onRestrictedPersonAdded(Poll poll, PollAccount account, PollUrl voteURL) { URL url = serviceContext.getApplicationURL(); @@ -233,9 +233,9 @@ } private PollenEmail createVotingEmail(Locale locale, - String pollTitle, - PollAccount account, - PollUrl voteURL) { + String pollTitle, + PollAccount account, + PollUrl voteURL) { String subject = l_(locale, "pollen.email.votingEmail.subject", pollTitle); Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteListImportCSV.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteListImportCSV.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteListImportCSV.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -55,14 +55,14 @@ * Implementation of {@link FavoriteListImport} as a service for CSV import. * Nuiton-CSV is used to manage the {@link Import} using a specific {@link * ImportModel} for pollen. Empty rows (no votingId or no email) are ignored. - * + * <p/> * Created: 16/04/12 * * @author fdesbois <desbois@codelutin.com> * @since 1.3 */ public class FavoriteListImportCSV extends PollenServiceSupport implements FavoriteListImport { - + private static final Log log = LogFactory.getLog(FavoriteListImportCSV.class); private static final ValueParser<String> EMAIL_PARSER = new ValueParser<String>() { @@ -75,7 +75,7 @@ return value; } }; - + protected class FavoriteListImportModel implements ImportModel<PollAccount> { @Override @@ -95,10 +95,10 @@ @Override public Iterable<ImportableColumn<PollAccount, Object>> getColumnsForImport() { ModelBuilder modelBuilder = new ModelBuilder(); - modelBuilder.newMandatoryColumn(PollAccount.PROPERTY_VOTING_ID, + modelBuilder.newMandatoryColumn(PollAccount.PROPERTY_VOTING_ID, PollAccount.PROPERTY_VOTING_ID); - modelBuilder.newMandatoryColumn(PollAccount.PROPERTY_EMAIL, - PollAccount.PROPERTY_EMAIL, + modelBuilder.newMandatoryColumn(PollAccount.PROPERTY_EMAIL, + PollAccount.PROPERTY_EMAIL, EMAIL_PARSER); return modelBuilder.getColumnsForImport(); } @@ -138,7 +138,7 @@ } return results; } - + // @Override // public List<PollAccount> execute(String url) throws FavoriteListImportException { // Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteListImportLDAP.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteListImportLDAP.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteListImportLDAP.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -45,9 +45,9 @@ /** * LDAP Import of {@link PollAccount}. The behavior is the same than the one * from pollen 1.2.x - * + * <p/> * TODO-fdesbois-2012-04-17 : tests and documentation - * + * <p/> * Created: 16/04/12 * * @author fdesbois <desbois@codelutin.com> @@ -56,12 +56,12 @@ public class FavoriteListImportLDAP extends PollenServiceSupport implements FavoriteListImport { private static final Log log = LogFactory.getLog(FavoriteListImportLDAP.class); - + @Override public List<PollAccount> execute(String url) throws FavoriteListImportException { - + long start = System.nanoTime(); - + List<PollAccount> results = Lists.newArrayList(); try { Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteService.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteService.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/FavoriteService.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -136,7 +136,7 @@ UserAccountDAO userDAO = getDAO(UserAccount.class); PersonListDAO dao = getDAO(PersonList.class); - + PersonList result; try { Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollFeedService.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollFeedService.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollFeedService.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollResultsService.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollResultsService.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PollResultsService.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PreventRuleService.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PreventRuleService.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/PreventRuleService.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2009 - 2012 CodeLutin + * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -40,9 +40,9 @@ * @since 1.3 */ public class PreventRuleService extends PollenServiceSupport { - + public static final String SCOPE_VOTE = "vote"; - + public static final String SCOPE_REMINDER = "rappel"; /** Logger. */ Modified: trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/VoteService.java =================================================================== --- trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/VoteService.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-services/src/main/java/org/chorem/pollen/services/impl/VoteService.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -60,30 +60,30 @@ /** Logger. */ private static final Log log = LogFactory.getLog(VoteService.class); - + public Vote getNewVote(Poll poll, PollAccount account) { - + Preconditions.checkNotNull(poll); - + VoteDAO voteDAO = getDAO(Vote.class); VoteToChoiceDAO voteToChoiceDAO = getDAO(VoteToChoice.class); - + Vote result = newInstance(voteDAO); result.setPollAccount(account); result.setWeight(1.); - + // Prepare the List of VoteToChoice with Poll's choices for (Choice choice : poll.getChoice()) { VoteToChoice element = newInstance(voteToChoiceDAO); element.setChoice(choice); result.addChoiceVoteToChoice(element); } - - return result; + + return result; } - + public Vote getVoteEditable(Poll poll, PollAccount accountEditable) { - + Preconditions.checkNotNull(poll); Preconditions.checkNotNull(accountEditable); @@ -94,7 +94,7 @@ } catch (TopiaException e) { throw new PollenTechnicalException(e); } - + Vote result; if (voteLoaded != null) { @@ -126,8 +126,8 @@ voteToChoices.add(i, voteToChoice); } result.setChoiceVoteToChoice(voteToChoices); - - } else { + + } else { result = getNewVote(poll, accountEditable); } @@ -142,7 +142,7 @@ /** * Retrieve the URL to update a vote based on {@link PollUri}. - * + * * @param pollUri Uri with pollId and accountId * @return the URL that allow the voting person to update his vote */ @@ -153,7 +153,7 @@ String.format("%s/poll/votefor/%s", baseUrl, pollUri.getUri()); return result; } - + public Vote createVote(Vote vote) throws PollAccountNotFound { VoteDAO voteDAO = getDAO(Vote.class); @@ -170,7 +170,7 @@ // Load existing account (restricted poll) if (pollAccountId != null) { pollAccountLoaded = getEntityById(PollAccount.class, pollAccountId); - + // Create new account } else { PollAccountDAO pollAccountDAO = getDAO(PollAccount.class); @@ -244,7 +244,7 @@ if (voteToChoiceEntity != null) { voteToChoiceEntity.setVoteValue(value); - + } else { createVoteToChoice(result, input); } @@ -262,24 +262,24 @@ return result; } - + protected VoteToChoice createVoteToChoice(Vote vote, VoteToChoice source) { - + VoteToChoiceDAO voteToChoiceDao = getDAO(VoteToChoice.class); VoteToChoice result = create(voteToChoiceDao); - + String choiceId = source.getChoice().getTopiaId(); Choice choiceLoaded = getEntityById(Choice.class, choiceId); result.setChoice(choiceLoaded); - - result.setVote(vote); + + result.setVote(vote); result.setVoteValue(source.getVoteValue()); - + vote.addChoiceVoteToChoice(result); - + return result; } - + protected void deleteVoteToChoice(Vote vote, VoteToChoice entity) { VoteToChoiceDAO voteToChoiceDao = getDAO(VoteToChoice.class); @@ -293,7 +293,7 @@ * deleted for a {@link PollType#FREE} poll where vote will be removed. This * remove implied an new execution of poll vote counting if continuous results * is activated. - * + * * @param voteId TopiaId of the vote * @throws VoteNotFoundException if vote doesn't exist */ @@ -306,7 +306,7 @@ } VoteDAO dao = getDAO(Vote.class); - VoteToChoiceDAO voteToChoiceDao = getDAO(VoteToChoice.class); + VoteToChoiceDAO voteToChoiceDao = getDAO(VoteToChoice.class); // Delete all VoteToChoice List<VoteToChoice> voteToChoices = ImmutableList.copyOf(entityToDelete.getChoiceVoteToChoice()); @@ -357,23 +357,23 @@ } /** - * Vote is allowed if {@code poll} is running and {@code pollAccount} is - * defined in the {@code poll} restricted list if it's not a {@link PollType#FREE} + * Vote is allowed if {@code poll} is running and {@code pollAccount} is + * defined in the {@code poll} restricted list if it's not a {@link PollType#FREE} * poll. The account must be defined previously using * {@link PollService#getPollAccountEditable(String, UserAccount, Poll)} to * have a proper link between userAccount and pollAccount even if not already * created in dabase. The poll creator can't vote. The token is just use * for moderate purpose. - * - * @param poll Poll + * + * @param poll Poll * @param accountEditable Account to check * @return true if vote is allowed, false otherwise */ public boolean isVoteAllowed(Poll poll, PollAccount accountEditable) { - + Preconditions.checkNotNull(poll); Preconditions.checkNotNull(accountEditable); - + Date now = serviceContext.getCurrentTime(); boolean result; @@ -395,11 +395,11 @@ } return result; } - + public boolean isUpdateAllowed(Poll poll, String voteId, String accountId, UserAccount userConnected) { - + Date now = serviceContext.getCurrentTime(); - + boolean result = false; Vote vote = poll.getVoteByTopiaId(voteId); Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenUIUtils.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenUIUtils.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenUIUtils.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -40,9 +40,7 @@ */ public class PollenUIUtils { - /** - * Keep the servlet context - */ + /** Keep the servlet context */ private static ServletContext servletContext; public static ServletContext getServletContext() { Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PageSkin.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PageSkin.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/PageSkin.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -30,17 +30,17 @@ * @since 1.3 */ public enum PageSkin { - + INDEX("Index", "yellow"), - + VOTE("Vote", "green"), - + RESULT("VoteCounting", "cupertino"), - + EDITION("Creation", "cupertino"); - + private String cssSuffix; - + private String theme; private PageSkin(String cssSuffix, String theme) { Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/Confirm.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/Confirm.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/admin/Confirm.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -57,6 +57,7 @@ public void setUserId(String userId) { this.userId = userId; } + public void setPollId(String pollId) { this.pollId = pollId; } Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -233,7 +233,7 @@ public boolean isVoteStarted() { return isEdit() && poll.sizeVote() > 0; } - + // public boolean isPersonEditable(PersonToList personToList) { // boolean result; // // If vote is started, the person is editable if he hasn't vote yet Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollUriIdAction.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollUriIdAction.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollUriIdAction.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -26,8 +26,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.pollen.bean.PollUri; +import org.chorem.pollen.ui.actions.PollenActionSupport; import org.chorem.pollen.ui.converters.PollUriConverter; -import org.chorem.pollen.ui.actions.PollenActionSupport; import java.util.Map; Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractVoteAction.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -68,11 +68,11 @@ private static final Log log = LogFactory.getLog(AbstractVoteAction.class); private transient PollResultsService pollResultsService; - + private transient PollService pollService; private transient VoteService voteService; - + private transient PollCommentService pollCommentService; private Poll poll; @@ -86,11 +86,11 @@ private boolean alreadyVoted; private boolean voteAllowed; - + private List<Vote> votes; - + private Vote vote; - + private String commentAuthor; // private String voteSizeMessage; @@ -98,7 +98,7 @@ private List<PollResult> results; private List<Comment> comments; - + private Map<String, String[]> parameters; @Override @@ -112,7 +112,7 @@ } return pollResultsService; } - + protected PollService getPollService() { if (pollService == null) { pollService = newService(PollService.class); @@ -257,7 +257,7 @@ public String getCommentAuthor() { if (commentAuthor == null) { - + UserAccount user = getPollenUserAccount(); if (user == null) { @@ -300,13 +300,13 @@ PollFeedService pollFeedService = newService(PollFeedService.class); feedFileExisting = pollFeedService.isFeedExists(poll); - + PollAccount pollCreator = poll.getCreator(); if (getPollenUserAccount() == null) { // User is creator if loaded pollAccount is the creator creatorUser = pollCreator.equals(pollAccount); - + } else { // User is creator if the userAccount is the same @@ -382,7 +382,7 @@ public boolean isDeleteCommentAllowed(Comment comment) { return getPollCommentService().isCanDeleteComment(comment, getPollAccount(), getPollenUserAccount()); } - + public boolean isDeleteVoteAllowed(Vote vote) { return isUserAdmin(); } @@ -405,7 +405,7 @@ // Ensure uri for poll and pollAccount loading preparePollUri(parameters); - + String pollId = getPollId(); if (StringUtils.isNotEmpty(pollId)) { poll = getPollService().getPollByPollId(pollId); Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AddComment.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AddComment.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AddComment.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -37,7 +37,7 @@ public class AddComment extends AbstractVoteAction implements Preparable { private static final long serialVersionUID = 1L; - + private String commentText; public void setCommentText(String commentText) { Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ClosePoll.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ClosePoll.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ClosePoll.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -51,9 +51,9 @@ PollService service = newService(PollService.class); service.closePoll(getPollId(), getPollenUserAccount(), getAccountId()); - + addFlashMessage(_("pollen.information.poll.closed")); - + return SUCCESS; } } Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/EditVote.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/EditVote.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/EditVote.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -33,9 +33,9 @@ public class EditVote extends AbstractPollUriIdAction { private static final long serialVersionUID = 1L; - + private String accountId; - + private String pollId; public void setAccountId(String accountId) { Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultLink.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultLink.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ResultLink.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -38,9 +38,9 @@ private static final long serialVersionUID = 1L; protected PollService pollService; - + protected Poll poll; - + protected String pollResultUrl; protected PollService getPollService() { @@ -65,7 +65,7 @@ @Override public String execute() throws Exception { - + String pollUid = getPollId(); poll = getPollService().getPollByPollId(pollUid); Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -51,8 +51,8 @@ import org.chorem.pollen.common.ChoiceType; import org.chorem.pollen.common.PollType; import org.chorem.pollen.services.impl.PreventRuleService; +import org.chorem.pollen.ui.actions.FileUploadAware; import org.chorem.pollen.ui.converters.DateConverter; -import org.chorem.pollen.ui.actions.FileUploadAware; import org.nuiton.util.StringUtil; import java.io.File; Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/VoteForPoll.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/VoteForPoll.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/VoteForPoll.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -43,7 +43,7 @@ * @since 1.3 */ public class VoteForPoll extends AbstractVoteAction implements Preparable { - + private static final Log log = LogFactory.getLog(VoteForPoll.class); private static final long serialVersionUID = 1L; @@ -81,11 +81,11 @@ } } - + int nbVotes = 0; int totalValues = 0; for (VoteToChoice voteToChoice : vote.getChoiceVoteToChoice()) { - + Integer value = voteToChoice.getVoteValue(); // XXX-fdesbois-2012-04-11 : for a VoteCountingType#NUMBER the difference between 0 and null value could be important if (value != null && value != 0) { @@ -113,10 +113,10 @@ // REMARQUES : // - pas le droit de modif si le pollAccount est rattaché a un userAccount et qu'on est pas loggé ?!? // - Ce serait plus simple que l'Admin ne puisse jamais voter, il ne peut que modérer les votes - + if (getVote().getTopiaId() != null) { getVoteService().updateVote(getVote()); - + } else { Vote voteCreated = getVoteService().createVote(getVote()); getPollService().addVoteToPoll(getPoll(), voteCreated); @@ -143,8 +143,8 @@ addFlashMessage( _("pollen.information.vote.createdWithUpdateUrl", updateUrl)); - } else{ - + } else { + addFlashMessage(_("pollen.information.vote.created")); } return SUCCESS; Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/Login.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -39,7 +39,7 @@ public class Login extends PollenActionSupport { private static final long serialVersionUID = 1L; - + private static final String HOME = "home"; protected String login; @@ -76,7 +76,7 @@ public String execute() throws Exception { UserService service = newService(UserService.class); - + if (StringUtils.isBlank(login) || StringUtils.isBlank(password)) { addFlashError(_("pollen.error.user.bad.login.or.password")); Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/LostPassword.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/LostPassword.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/LostPassword.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -38,7 +38,7 @@ public class LostPassword extends PollenActionSupport { private static final long serialVersionUID = 1L; - + private String email; public String getEmail() { Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteLists.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteLists.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/user/ManageFavoriteLists.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -62,9 +62,9 @@ protected String ldapImport; protected String action; - + private FavoriteService favoriteService; - + public FavoriteService getFavoriteService() { if (favoriteService == null) { favoriteService = newService(FavoriteService.class); @@ -119,14 +119,14 @@ Preconditions.checkNotNull(favoriteList.getName()); try { - PersonList personList = + PersonList personList = getFavoriteService().createFavoriteList(getPollenUserAccount(), - favoriteList.getName()); - + favoriteList.getName()); + if (csvImportFileName != null) { FavoriteListImport importService = newService(FavoriteListImportCSV.class); - + addImport(importService, csvImport.getAbsolutePath(), personList); } @@ -162,7 +162,7 @@ Preconditions.checkNotNull(favoriteList); - PersonList deletedFavoritedList = + PersonList deletedFavoritedList = getFavoriteService().deleteFavoriteList(getPollenUserAccount(), favoriteList); getTransaction().commitTransaction(); Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/converters/BooleanIntegerConverter.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/converters/BooleanIntegerConverter.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/converters/BooleanIntegerConverter.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -33,29 +33,29 @@ * @author fdesbois <desbois@codelutin.com> */ public class BooleanIntegerConverter extends StrutsTypeConverter { - + @Override - public Integer convertFromString(Map context, String[] values, Class toClass) { + public Integer convertFromString(Map context, String[] values, Class toClass) { Integer result; if (values.length == 1) { result = parseValue(values[0]); - + } else { result = null; } return result; } - + protected Integer parseValue(String value) { Integer result; if ("true".equals(value)) { result = 1; - + } else if ("false".equals(value)) { result = 0; - + } else { - result = Integer.parseInt(value); + result = Integer.parseInt(value); } return result; } Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/converters/PollUriConverter.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/converters/PollUriConverter.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/converters/PollUriConverter.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -44,14 +44,14 @@ } return instance; } - + @Override public PollUri convertFromString(Map context, String[] values, Class toClass) { PollUri result; if (values.length == 1) { String value = values[0]; result = PollUri.newPollUri(value); - + } else { result = null; } @@ -62,14 +62,14 @@ public String convertToString(Map context, Object o) { String result; if (o != null) { - result = ((PollUri)o).getUri(); + result = ((PollUri) o).getUri(); } else { result = ""; } return result; } - + public static PollUri convertFromString(String[] values) { Preconditions.checkNotNull(values); PollUri result = getInstance().convertFromString(null, values, PollUri.class); Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/ResultAccessRequired.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/ResultAccessRequired.java 2012-05-28 15:27:04 UTC (rev 3394) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/ResultAccessRequired.java 2012-05-28 15:34:46 UTC (rev 3395) @@ -63,14 +63,12 @@ // user is connected ans admin, so isAccessAllowed = true; - } - else if (pollCreatorFilter.isAccessAllowed(request, response, mappedValue)) { + } else if (pollCreatorFilter.isAccessAllowed(request, response, mappedValue)) { // account is creator isAccessAllowed = true; - } - else if (pollAccountFilter.isAccessAllowed(request, response, mappedValue)) { + } else if (pollAccountFilter.isAccessAllowed(request, response, mappedValue)) { PollUri pollUri = getPollUri(request); @@ -99,8 +97,7 @@ isAccessAllowed = false; } - } - else { + } else { isAccessAllowed = false; }
participants (1)
-
tchemit@users.chorem.org