Pollen-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
March 2010
- 5 participants
- 71 discussions
Author: fdesbois
Date: 2010-03-31 10:29:03 +0200 (Wed, 31 Mar 2010)
New Revision: 2963
Log:
- Use eugene 2.0.1 snapshot to have parameter documentation
- Change BusinessTransformer to ServiceTransformer from ToPIA
- Use 1.2 of i18n
Added:
trunk/v2
Modified:
trunk/pollen-business/pom.xml
trunk/pom.xml
Modified: trunk/pollen-business/pom.xml
===================================================================
--- trunk/pollen-business/pom.xml 2010-03-30 18:19:27 UTC (rev 2962)
+++ trunk/pollen-business/pom.xml 2010-03-31 08:29:03 UTC (rev 2963)
@@ -113,7 +113,7 @@
<defaultPackage>org.chorem.pollen</defaultPackage>
<templates>
org.nuiton.topia.generator.TopiaMetaTransformer,
- org.nuiton.topia.generator.BusinessTransformer,
+ org.nuiton.topia.generator.ServiceTransformer,
org.nuiton.topia.generator.BeanTransformer
</templates>
</configuration>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-03-30 18:19:27 UTC (rev 2962)
+++ trunk/pom.xml 2010-03-31 08:29:03 UTC (rev 2963)
@@ -18,7 +18,7 @@
<version>2.0-SNAPSHOT</version>
<modules>
-<!-- <module>pollen-ui</module>-->
+ <module>pollen-ui</module>
<module>pollen-business</module>
<module>pollen-votecounting</module>
</modules>
@@ -310,8 +310,8 @@
<!-- customized versions -->
<!--javadoc.version>2.4</javadoc.version-->
<topia.version>2.3.1-SNAPSHOT</topia.version>
- <eugene.version>2.0</eugene.version>
- <i18n.version>1.1.1-SNAPSHOT</i18n.version>
+ <eugene.version>2.0.1-SNAPSHOT</eugene.version>
+ <i18n.version>1.2</i18n.version>
<tapestry.version>5.1.0.5</tapestry.version>
<nuiton-utils.version>1.2.1-SNAPSHOT</nuiton-utils.version>
<processor.version>1.0.2</processor.version>
Added: trunk/v2
===================================================================
--- trunk/v2 (rev 0)
+++ trunk/v2 2010-03-31 08:29:03 UTC (rev 2963)
@@ -0,0 +1,88 @@
+1ère partie
+-----------
+
+Recoder les fonctionnalités métiers liés à la base sans retoucher au style/traduction de l'ui, etc...
+
+- [business] Gestion utilisateurs : création/modification/suppression/connexion/listes de favoris
+ Pages [UserRegister, UserProfile, UserPolls, UserLists, AdminUsers, Border]
+>> 3j
+
+- [business] Gestion sondage : création/modification/suppression/commentaires/listes
+ Pages [PollForm, AdminPolls, VoteForPoll]
+>> 5j
+
+- [business] Gestion vote : création/modification/suppression
+ Pages [VoteForPoll]
+>> 2j
+
+- [business] Gestion résultats : dépouillement/sauvegarde continu ou non
+ Pages [VoteForPoll, Results]
+>> 2j
+
+- [votecounting] Vérifier le bon fonctionnement + exécuter tests de montée en charge (fusion avec business ?)
+>> 2j
+
+Note : 3 pages seront refaites intégralement : PollForm (déjà commencé 1.3), VoteForPoll (déjà commencé 1.3), Results
+Total : 14j
+
+2ème partie
+-----------
+
+Vérifier et améliorer les fonctionnalités supplémentaires (import, emails)
+
+- [emails] Uniformiser et centraliser les notifications et gestion d'envoi des mails
+>> 0.5j
+
+- [import] Centraliser la gestion CSV dans un service ou une méthode approprié + Tests
+>> 0.5j
+
+- [import] Vérifier import/export XML
+>> 1.5j
+
+- [import] Vérifier import LDAP
+>> 0.5j
+
+- [migration] Essai de migration XML de la 1.2.x à la 2.0
+>> 2j
+
+Total : 5j
+
+3ème partie
+-----------
+
+Revoir l'intégralité des templates, le CSS et les clés i18n pour homogénéiser le code des vues.
+
+- [tapestry/style] Uniformiser les templates et le CSS
+>> 5j
+
+- [i18n] Uniformisation des clés i18n (centraliser dans les fichiers appropriés)
+- [i18n/tapestry] Intégrer les clés pour Tapestry aux bundles i18n
+>> 2j
+
+- [i18n] Compléter les traductions manquantes
+>> 1j
+
+- [documentation] Mettre à jour documentation métier de l'appli
+>> 1j
+
+Total : 9j
+
+Note sur les releases
+---------------------
+
+Toutes ses modifications font parti de la v2 cependant des beta seront surement releasé pendant le dev
+
+Total : 28j
+
+Dates estimés (fdesbois seul en parallèle avec dev de WAO)
+----------------------------------------------------------
+
+Release beta-1 : 30 avril
+Release beta-2 : 17 mai
+Release beta-3 voir final : 18 juin
+
+
+
+
+
+
1
0
r2962 - in trunk/pollen-ui/src/main: java/org/chorem/pollen/ui/pages/user resources/i18n
by fdesbois@users.chorem.org 30 Mar '10
by fdesbois@users.chorem.org 30 Mar '10
30 Mar '10
Author: fdesbois
Date: 2010-03-30 20:19:27 +0200 (Tue, 30 Mar 2010)
New Revision: 2962
Log:
Ano #134 : Use display name in email.
Modified:
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserRegister.java
trunk/pollen-ui/src/main/resources/i18n/pollen-ui-en_GB.properties
trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserRegister.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserRegister.java 2010-03-30 18:14:00 UTC (rev 2961)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserRegister.java 2010-03-30 18:19:27 UTC (rev 2962)
@@ -172,8 +172,8 @@
getNewUser().getLogin()));
mail.setContent(
messages.format("pollen.mail.userRegister.content",
- getNewUser().getFirstName(), getNewUser().getLastName(),
- getNewUser().getLogin(), password1, siteURL));
+ getNewUser().getDisplayName(), getNewUser().getLogin(),
+ password1, siteURL));
serviceEmail.sendEmail(mail);
Modified: trunk/pollen-ui/src/main/resources/i18n/pollen-ui-en_GB.properties
===================================================================
--- trunk/pollen-ui/src/main/resources/i18n/pollen-ui-en_GB.properties 2010-03-30 18:14:00 UTC (rev 2961)
+++ trunk/pollen-ui/src/main/resources/i18n/pollen-ui-en_GB.properties 2010-03-30 18:19:27 UTC (rev 2962)
@@ -1,6 +1,6 @@
# User registration emails
pollen.mail.userRegister.subject=[Pollen] Confirmation of account creation %s
-pollen.mail.userRegister.content=Welcome %s %s. You had just created an account on the web application Pollen.\n\nLogin: %s\nPassword: %s\n\nYou can now manage your polls by logging on the website : \n%s
+pollen.mail.userRegister.content=Welcome %1$s. You had just created an account on the web application Pollen.\n\nLogin: %2$s\nPassword: %3$s\n\nYou can now manage your polls by logging on the website : \n%4$s
# Poll creation emails
creatorEmail_subject=[Pollen] Poll creation (%s)
Modified: trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties
===================================================================
--- trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties 2010-03-30 18:14:00 UTC (rev 2961)
+++ trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties 2010-03-30 18:19:27 UTC (rev 2962)
@@ -1,6 +1,6 @@
# User registration emails
pollen.mail.userRegister.subject=[Pollen] Confirmation de cr\u00E9ation du compte %s
-pollen.mail.userRegister.content=Bienvenue %s %s. Vous venez de cr\u00E9er un compte sur l'application de sondage en ligne Pollen.\n\nIdentifiant : %s\nMot de passe : %s\n\nVous pouvez d\u00E8s maintenant g\u00E9rer vos sondages en vous identifiant sur le site : \n%s
+pollen.mail.userRegister.content=Bienvenue %1$s. Vous venez de cr\u00E9er un compte sur l'application de sondage en ligne Pollen.\n\nIdentifiant : %2$s\nMot de passe : %3$s\n\nVous pouvez d\u00E8s maintenant g\u00E9rer vos sondages en vous identifiant sur le site : \n%4$s
# Poll creation emails
creatorEmail_subject=[Pollen] Cr\u00E9ation d'un sondage (%s)
1
0
r2961 - in trunk: pollen-business/src/main/java/org/chorem/pollen/service pollen-business/src/main/resources/i18n pollen-business/src/main/xmi pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user
by fdesbois@users.chorem.org 30 Mar '10
by fdesbois@users.chorem.org 30 Mar '10
30 Mar '10
Author: fdesbois
Date: 2010-03-30 20:14:00 +0200 (Tue, 30 Mar 2010)
New Revision: 2961
Log:
Improve PollenEmail instanciation (add getNewEmail method in ServiceEmail)
Modified:
trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceEmailImpl.java
trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties
trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties
trunk/pollen-business/src/main/xmi/pollen.zargo
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserRegister.java
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceEmailImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceEmailImpl.java 2010-03-30 17:57:40 UTC (rev 2960)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceEmailImpl.java 2010-03-30 18:14:00 UTC (rev 2961)
@@ -7,6 +7,8 @@
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.SimpleEmail;
import org.chorem.pollen.bean.PollenEmail;
+import org.chorem.pollen.bean.PollenEmailImpl;
+import org.chorem.pollen.entity.UserAccount;
/**
* ServiceMailImpl
@@ -49,4 +51,11 @@
}
}
+ @Override
+ protected PollenEmail executeGetNewEmail(UserAccount toUser) {
+ PollenEmail email = new PollenEmailImpl();
+ email.setTo(toUser.getEmail());
+ return email;
+ }
+
}
Modified: trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties
===================================================================
--- trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties 2010-03-30 17:57:40 UTC (rev 2960)
+++ trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties 2010-03-30 18:14:00 UTC (rev 2961)
@@ -4,6 +4,7 @@
pollen.error.context.rollback=
pollen.error.context.start=
pollen.error.context.stop=
+pollen.error.serviceEmail.getNewEmail=
pollen.error.serviceEmail.sendEmail=
pollen.error.serviceList.createAccountForPersonList=
pollen.error.serviceList.deleteAccountFromPersonList=
Modified: trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties
===================================================================
--- trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties 2010-03-30 17:57:40 UTC (rev 2960)
+++ trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties 2010-03-30 18:14:00 UTC (rev 2961)
@@ -4,6 +4,7 @@
pollen.error.context.rollback=Erreur lors de l'annulation de la transaction
pollen.error.context.start=Erreur lors du d\u00E9marrage de l'application
pollen.error.context.stop=Erreur lors de l'arr\u00EAt de l'application
+pollen.error.serviceEmail.getNewEmail=
pollen.error.serviceEmail.sendEmail=
pollen.error.serviceList.createAccountForPersonList=
pollen.error.serviceList.deleteAccountFromPersonList=
Modified: trunk/pollen-business/src/main/xmi/pollen.zargo
===================================================================
--- trunk/pollen-business/src/main/xmi/pollen.zargo 2010-03-30 17:57:40 UTC (rev 2960)
+++ trunk/pollen-business/src/main/xmi/pollen.zargo 2010-03-30 18:14:00 UTC (rev 2961)
@@ -1,148 +1,148 @@
-PK�~<pollen.argo�TKn�0���@�AQt!kcwѢA��]�4� E�9�z�^��H��g�Mh1�=�<�3,��D6�T(�u�1�lDm8�j�:�b��^ȁr��" R8Ev�}��P��'�Ȫ,N�gP��1V�2O�.��
-�ơS!� <����A���[�"���T/{��U��)(�%�FAg�1�B��K0f�J��z>��&佢� >�F4J�aG���x�G9����2�|�G�(�R��D4J�q\l�ǑW$�&�R8ۛ4��d��~Cp꣖Z\���6��V���P/ﱁ=6(�v�AmZi+�j��؝��<[{��+�3y��Z=xn�Vϧ0!���vI�)�N&h�v���Q4��2�t �c���*�~���z �:������ͯ���S����ۙ�|������z��0��s۴���?삂��>�e�g��sǾ�n�8{�x8r-'R3;q�\Ȏ���pF�X�ܫP�Z � �o�ƭ�z͋i��P�m�����N�O��f~c��;y�oXע���L��/�η/��B]��̎��@u�PK(�:K/.PK�~<pollen_Modèle.pgml�]�n�8����7X,�@�)Q�6�4mw��-f���b�X�����r�,����/vIږD�H�lZ���˒m�����>����~>y���$]�9C��$^L�(Y�ޜ}����?��������oן�����aFo���}z��䌽����^�߈��t�<d�����"\��5�����p��/VY�%����z�����:����O��p�z����]�����9?G>��w3���B�������ܷ,�U>�Z��w~,������i��;�Ͼ���_ϖ��a�·df������O�?��r�8�� ��+���fw_�Ur3��܆�U��*��q�==�_�����!^��kW���?�Y�Ln�Y,����2�}s�/J�o���n���R^x=M�����$��7����K7g������[������1�����s�x����<.�"'�7�M��˧7g�ݫ�I����������.��{wJZY��v���&��k���@D��6|�[�����TY��g�͑\%z
+PKx�~<pollen.argo�TKn�0��� �AQt!kcwѢA��]�4� E�9�z�^�C��(;�"��b�{�7$gX0��d�Qv��cZ�%IQ��
+�3�:�0fM+U��E1�!?�>�|p(ﳇO٪ȧس5�Ja?�%�'�����
+
+�`�萫���k,k����-Ye����t+�{�k�]�P�K����"� �9����i-+�|�l�{EͫԸG����TXn��X]��,�
+2>0n!�/�Y�+ك2�<�����/����H�F�b8�MZ�T�\d�!�����-���i˕�+��[�a�5*��e0J��!��b��<�Ό3���M�������Ճ��`Y���cy?W�$Q%���D�Ԁh��>�I<4"LUm�L��
+�������7�v�/Oi��bOC�|�8�uJ�~@iM��}%���]Pd�����,�v�̱/���_1������JN��4r�T�&sϝ<s`3힅j���+cd3z46n��k^L��o+}��w�}�[��hx6�T{p�Q���|��F:4~u>= �HurMV�21�@y�PK�,�N0/PKx�~<pollen_Modèle.pgml�]�n�8����7X,�@�)Q�6�4mw��-f���b�X�����r�,����/vIږD�H�lZ���˒m�����>����~>y���$]�9C��$^L�(Y�ޜ}����?��������oן�����aFo���}z��䌽����^�߈��t�<d�����"\��5�����p��/VY�%����z�����:����O��p�z����]�����9?G>��w3���B�������ܷ,�U>�Z��w~,������i��;�Ͼ���_ϖ��a�·df������O�?��r�8�� ��+���fw_�Ur3��܆�U��*��q�==�_�����!^��kW���?�Y�Ln�Y,����2�}s�/J�o���n���R^x=M�����$��7����K7g������[������1�����s�x����<.�"'�7�M��˧7g�ݫ�I����������.��{wJZY��v���&��k���@D��6|�[�����TY��g�͑\%z
�!�Wct��D$��[�bT���2+@�Pb�8�,�z����V��]L��u y���@]�u���a�c2a�~�6]�_A��<�g�,�'�7g\��o�y��d��J��@-��,�M��f�\��)vo_�q����гI���}E����}�N��ݸ}!� L��ja��;L˒j�!�A��!�k�����W�i�^d���+qm ����v��?���~�V̹�݊9��J�Yʹc�9�I�Q���.��X�sL��Q����>��Mu�s��=c�6��5i��������c��*$r0�{��bw�u��A��D������U�8�[��f���sN�j�{z{NxNw���t�m7�xOy�J�s��8BU6=�!|;�8?�@G�)��rR~�1����Fe�bVV!@��z��e+8�Έ3Ù���4RڷG���}����&
H�*K@Z1�W�v
u����j�j�%`Y#��0�O�4���k�k`kw��A��f�;��R��?�P�
-P{[�y���u�HO��zՂ���@ �F��<Ye0Ң-^9{�r�[�u�8$��p엖 ��M��,��ķ^N�MX���q��齊!)Jd9%f*6떗(�*/�"/=H��D2#*=��#B@��*�=O��VY�!"��,".ˀ��1B�:B��� H��/���D�W�R#@�L����\��q��Y���$�0�_��S�Q]����De2H��U۶�qO���)���p�� ���C��.�~��̋�=S�����|L��֊dd�]�2�����Y�>fq�.Y=�ç_(�/�z[k���tt�=o
-v:52���;z��Q��)H�Z5zƔ4��h��ѣ�G��ባFGe�����yC���~w�k���.�<�1��9��j�5]jF�$��&*_�hoѾM����4"�2�.��P��ជmі��2ڀsl�n�n,E@�T�:�8�N�9UA��g��R��B*g�@��)��s[�wH��r�.|W�sx���u���,D�r{��P,�W�;,��p���B�ĕx��,�E]䥣�ﰱ��@F�w%��<|���.�:���B?�wX ������P���`,�ڼy`��;I�x�5]-H��c����6���#�N��&�v���ܨX���b�)��g�����2H�p��Z���P��S���MU9Aq.��Y����*]��:++;��j�cw���Hp�|"������!��?n���1}]ߥ���-AjI�[Ж�GRlIA�W+#{'aC�HN�Y�mv�'jc�\��e#�^=�@�
-{��v�ur+�i�_�Z�4�~=!�P�3z�9!�`R'g�F̃źx�P\�4�?��a����l���DJa'cL�Ӏ�=��ٳ6Y�r��O6A��ID�w��~��|+��� �&��M��f�6N��lU�5���{rT��~�^���gL��CK��rT1r�tT��48��d?�Ԡ�� ���P���'�Lʏ��c#s�ds�l�$�)@c���\�tI���]�R"��أ!���&�%�����?+�~
-�@}L�,#��z�T�F�9��"jt�?�����G�>��"��P��p���Z��c�'�t���H���4y|������g6g�(���ӯ�`�����xL����7Yb^�=��7)]�����}��mKׅT��9����ƫ�<k�y���z�T�K8�Ӕ��ה������t���QO�S������Mς�͑�9�师�f��
-N��M��k�v��<i�\omz���P�S�(c(o���ucMj�L�uWSV(Y�הy��y��2��O�︦�۾=E��yp3�Q��
-n~p�ҫ�2[�)�
-���X�%���K��Ք��j�dj�)ۏ�=�)���2�,�DF�X�5e�RS�![Z���
-a--k�)��Ԕ�BM�$H
-O\� zM�uz��$���l�ee\��ي��qa�����ul��Lo"=������� T��Q���ہ�-ڳ�l��qm"@��FNu�ɹq�6y���F�u�
-,5�j�1j��n�-��q���r��[zP�� fq,�R�l%7Ny�Y�x><r���Lףk+ r
-�X���b�{�����~�l��e�]ѝ� uUc�J� �1��P]����x���z9�?�ˌ�PٛDט��*5/��G���F�W��U~#��n#n�zŞ9�H��l�a�3$S�3�\Z�G��?���H�3�P�����>���O�Źϩ��ү�xi����w+Ĵ����+noW1L�F݀:�Y�����,y��,ɞ�<�)I�ۈ��w�������Et�X��(����qݥ{A�Y��Y�`㸓���L��L�`-�_���~�@v�G=������]\ї��<gEӺW�6�/7��2�������C�F�+����&s"�f��]���u����m����n8�vESr_)�W�M"�6sՈ�/)������48��Mb,�)�NM\sR�<�I��fI7Yb�~�4���E�r��:cD��]�$BDSE��Z|=��q?����L3Ӥ2�uݭ`��hv.غ
-�%�)
-6ׅ
-����L2�h&<1�Ѣr�<�H�E;�I��2���z�m'���8��?�P<�f���o��E1�m�h�r�����0�Ô9A�$}(��#��i���u�(!L f��{Nlq�ԬO�Tͥh�HմY�l�۩�;�#4��p��T��+�|�QrE��ʆT�F�9��4K�@�u@CF?�
-?|��E�)�o�W���ӧ�qgw)���1��;5��(�o$��.�Z����G|�L�ԧ���
-��h�;�����"Nb:�W�>���\���FN�������I}8���q��w8Y{a��s�:�#���x8�����$;���0����3��H�#�%��n�3�n�����a:x�V�C��T��0
-�[r��=���@^dd]¯C5��K������ޠԸ���GS㼡�q-1߬�YZR��X�3��i5����w5�����X�3��a=����z�S�ǡ�lm{��v�_��=<��
-� 켜`;`ɭݍ�o�����p.�*���[�@hU8��yB� �z�o,�Ufc �er�<��W\�@l��c+*#�#��WR\�@�����j�7&�r�k�\}!�U#�ԉj12�4�M���W�l�+�my[���̂�\�u�|�+9��l#HM�e�������e�
-T��Q��T%�!�<_�r��1N�����~}e�����&y��I��q�����+��8돽�7$����$���ݩ�2�]�x�Ҫ�>��;�O�z�ѥ�ي�����[���;ۀ�*��A1!��s�f�V�P�V1j�T��[�*��A�Ձ���4�q�`�+l��g(�K6@���+�
-ށ�����S�L��L_HK6��.1��|F��U#��Բ�9�%'-Z�{v��6�$��p�*G�ӢטG?�'�e_�u�Z-�����a����3[��d�� �Vr�VV>F-`dr��H`8�%�}淐�|��.�JW)M~�D�w����DeT��,�U~#�aZ�YQ�$�r-S�">�n/�5t:�-v)��鎄�i���?�n���Un�� չ#�oX�CVߕ9�-� ���[q=�ܖ�\A��R�P�{�qu�J��G�kWs���r77�?��-��[��SV��j~�Z^Q�}��� p��Q�7���9���F���ڀ>�s-ࠖb�A�C���|E,�ªj2����z�jC��q�b(}�~�"/T3�4:�������l�E���c'ݩ�������m����ꎝt
-wI��j���|�sd����[ձ{�o�@k���}�"�G3�L<�5��.�c�*���J#"�X�
-��S�C���m��qENV������f#۱����
-d�^u@��~���{���p� ^�)������ ��t-�w��K�^�`X��1��c-�}*���_���I�*b������� [��%���7_-F��~�K��6@���Z\�yd+�poD[W5r�&��
-I цm��u�JN �D���?U��{j��8���!ԑk�3������CD7e/(�x!�X�W�i�^d�ٵ���6<���=�vr(��S��lN���{��`��Ӑ{��{�=MrO�{�0���S��a��˽G*�5������4&����⠗�-��
-*K,�j����W���U��s�\���� ���m���S���Sh��S����_�zDz[�
-I;��V�8>��� �-��{�,,I�~9��,t���*�ɢ�b,�2T4>��[H�ye�1dR�~{��-tqZ�M�.��o!Q���H���b�Ft���C^�-$��P�#��-��н��ƫ�<����B.�l�l��)��p�֙�L�,�(<z��Y�f24�eJl�Qa7O�Tn)���N*b�I��lm7��n�MvR)�
-�N*p�=g;����l��IU�ِ���(>*�4}T���扛(��Q9�v=�Xmˍ�q�9G�y�Y�#Y��k0�N=����g~��%W�q����M�-:��e�vKŢ�D�W�g�����,~���� ��k�2���-AoND��V�Z�Y�h�3���x����n��0$��w@��m��������ă�ضG4=p�b��ܶT���t#Rt0�Ѹ���S�*�z���8�I�e�*��Կ�Ս�[
-����p�����i��F���y�o�����_�u��U@?#�|�X-չ�÷[�s$��4�c�
-Apㄱ�����9k/m�e<x��>dU��)s� �9}Л�j�ʜ?xe�$�ƕ9�ʜ>�F�qe��2gD܋�|�쒼��j��]���T�����ŭw��S����w�PK�-��qB:PK�~<pollen_Services.pgml�\io�8��_�5E��:��.�4YH4M�bQ,�v��%C�s,��/)ɺH1�-�A�v"�2�rf8O>zs7��Fn��{`(�$�ہ���q������Io&{G���t����i1#'\|��z�A�э���9"���������%9��ך��|a����6^�h�t��Ώ=+��'��7����4@�4�lE�@S�Yөy80eY>��?�d��'�?�5G��
-o\E�� i?���r��:ug����?9�ʙ�Q8�l�T�}i#ؗ,,|�͍�+�����9�~����v,�(��}�Ձ��9���!� 1���ڶ��9$M�,y�@@>��5���k�����q������H����xhҒ|�Y�O�k�>Z�Q�uP�L�Bdc˟y�@�0#�n܃�j㾸q�:�z�#�Z��;���{�T�V]�V���
-�>I�Aڑ��s8�Ob.�D�KV��G�m��-��Gv=4���2��)�uă��
-��yP4����q}�9���nf�'��r'@�Z��2� �m� �I'$�~x��i��OA�a/��.�<���),o�
-<�i��)�B�YF؝�����cD�����+��/w5�����::���E��r�àG���A~tOz�F��N� [˜p������i�\�9��;I�ρ�e���������|a�xN���L] ԍg�Kd�m[�D��l�Kt۟rgB��r/
-w{�Q�8ĜI�X0��iābc ���AN�c���
-�A��29������\w1[�oP���b #��<b-��
-r��|�9�����-��������[�=bC8�s�ݎ�� o)ލqWE��,:����"�Ux���� �xN�t���\8���W8��x
-|dݬ�!�]��{{��<����B�u��!P:�s��������z����~��{ht���'�2����,$
-�����v��qc�0�#�80y�������|�oF�g\(ݸ�� ?E�4���ry��/p�����?���Ƅ�!a7Ӯ��GQ��$�܍0]
-�,�U�h>�� �|���!=���4!E�
-C�
-�V�|Y�>[!F�+C�-*49�������P��$o���o�Ȕ0���"����!t���oTr��B|�;莴�>�#�)l6�/�p3
-�iz)4[Q�v���B���_!�kơ0�W�.�k�}A��K�zA�p�;d�ɰx�%?QP.ysk�����⦨�
-�
-5B���֚�����}I���b�j���n��T�Jr7�d��r��*?0X���5�D��
-��w+�MK��ӍE
-O%x��@�n�`�C�ś^��h/���*ٹ��
-0��*�ޡ�5�(i�ʳv>@��n��躀H�����d������6w(O�z���P8��C!�mV�����&{+�Pf�F��b6Ww�P��c�])&����ہ��On��Y��_XQt��̱����Ϯ�㪌�|����EJ
-Ud���EK���8i@؉Xb��hbx���(x}����7,��i�TTEu1;2��[��Mb>�[�H��n�1��-��p�Q/��{����e������+7�4$naSFB��q�� d�9�n��MXx�f�1���K8���s���)}�#���N�����Z�B�r a=0��J��U!N����{�ha���8����.�<�G�Y?X���lE����渵S��wI�&�f �/�OX�U(_A�V���[o��y�j��T�y
-��-r�����lw�_����W��8�Z}�b;��:l?�-d
-����x�
-ęٯ��B�BFJ�퐲��M+%ZȔh�y
-u�Wa_�FK5�����(�3{�H��dn�¯&��Vic��B�z(��>�Wy�*-d��U���¶ȫ�_X��/�J[b��FM�VU@�S�eZȔiYkPXk��� �"�"�D�Iv�;����{��#?n�-;>�;�R��Bп�ܑ��l�M��PKFƱ��SPK�~<pollen_Context.pgml�[�o�8�}��NZ2l��&Ӯ��JۭR�I�4�1��N�N���kB��!�M{Q�TH�������Oܣ7�f�tE�����=�̝p�Ͻa��廾ٓތ��q�������yp���ӏR��&t҃� I�؏h�Z{;��Tb�ķ�؞
-jS��'��¡������ǁ�$'�:��u��7�>��}$㾁�����!B�U�v]�oʲ|(�?�z~���{�ᜒ_��l�G^.���;ߓWu�����<!vm�|���;�_J���#�N���?�е���N�. �MD���z(�#��ɪ"4O��������ї����5v�kB�9�4Y���0��p� �6*�N��w=�i�0�p����.K����v~�K���Q�W6%�٫��,&��^@JTr2~
-{Z��M��ڟ���J����^�ȋj�j�ժSr���'Iz�u�;������<����z�|/5� �y�[����(�R��#=���xTP_#�F�(�!P�q=n�M��cz�D�� T�Q�!�,�v�N�]:!I���W\��aT8��ԧv�;�^*aE�8&\!k;�3DK$�X$�w}�^��c�4suy�<���ᯔ��p�bͭ�$��I��Yu�0���L<��!-�Y����G�a�y�
-+�r����F�>���8�EvLg��T�,m�l
-�i�����6�]ڬ�ho�6�T�P�Ph��T{Qz�-��t
-S�RH�� I�%��էNz=����+B�: U2
-����g7(�����1?(� �$'�H0���-��Ks�О�v���Xj́��I���(
-���5^@�U�O�"'dCic!��a�{6���Ag��V�1����y�su�Yk�Y���<��8{���l�Mo�����2��0.h�Ͻ�L�L3��+K���N�11À��T�T�A��=�rPT3�Q�]K��J�ɏ��T�[��8�� �5R�ٗ��[m�cY�`����C<��ɹ�$�a<9��/���S@Ք�s,7�k���6kU|����"V6c����R2efq���Bs\9���*sU�q�*G�)ע+�U��G2�����j�l�/���8��qժ��Y��G�v�㈳�U�ꏛ|fB�*�����?�*�xU@
-&�d��YfV�q�W�6땧B���)��{,�qfy]��nR��'u�r��Ss�+,��h����Һ�V�q�9
-X��4��}3NL`�-U�s�M�|A����g���|)���|O�0��w
-�'Y'@�p;@hL�-�k� -_*��Y�e�ⶺ�cw�/���Fd�!���8�
-x�1��8l+ײj�����{]O�ms���nm��bx��t�WSk�5�� N�O:zX�˹�{��&Gɹ�Re-��
-��h���^!c�框^�٭Y�i���������z�ZƸr�1�`Q��)���X�2����=
-��Ԏ�T�E����NX��D�ݞ��,p�*�B�8J�����]X���%�\j�(eAm̧��O���.to�Q�pF�R��U�@��T(�S���������'9�l�*�Ğ�֥P*.EMD�}|�
-��tf�A�3�l֙H�M��L�ڝ�G���r&Ι�K��M��OgByj�D��
-΄����:
-�L���o�IJ`�7Fu�d�8>�XS![:�ys��T�4�n�o��9�r��VNUβvN��u8a\Tβ�q��*�������M*��oXf0��lY6�;��g4
-�m� �Yi�Y�E6���R��0f8�=&����-،l
-��.�������,؍����;�3�wg��v�n��G9E9Y���;�F;Ԃ�Ėh�?D�-s1�k|,�[ÆL����R�,=�PK�'�qoPAPK�~<pollen.todoeO�j�0<�_��.YnkW6�M��{��Xk#P�ERL?�5%Ѕeg��aV�/�,`�ƙ�H�3��Tz���ٝ�HɾI����Н?�ģBҞ���J�H��*%a%�u�|��
+P{[�y���u�HO��zՂ���@ �F��<Ye0Ң-^9{�r�[�u�8$��p엖 ��M��,��ķ^N�MX���q��齊!)Jd9%f*6떗(�*/�"/=H��D2#*=��#B@��*�=O��VY�!"��,".ˀ��1B�:B��� H��/���D�W�R#@�L����\��q��Y���$�0�_��S�Q]����De2H��U۶�qO���)���p�� ���C��.�~��̋�=S�����|L��֊dd�]�2�����y�f�,��%��y����ş@okmt�����
+B�N�FF3~G5:*16IS�FϘ����x�0z�}��4<q���X��<`�|�Я�nw�`�2��}�G8F�;��!\���K�h4��2�D���-ڷ�r����F@�T�ۅ���� ��-�r�TFp����-�m����Xg��)b=�*�:���l9^*[^H�lH�:Eë:��1~�����!���w:���0�Zw��B�/�����{��B�9�,L\��(�2/Q�E^:z��Id4|W"x��wX ��r���+�#|���.��5����͛������[�Ղd��;�ٮ��a�q;.�<�d�k2nw�p�ʍ����,�(F���}ƸZ�N �D�
+'��uK�+Q;�\�T�����K��/(�҅�ӱұ�SH�F:vGoߎW�'?�N=`+��V���zӇ��]�L����m $Ŗ�x�2�'�zB6䍄�����f7|�66�%(^6�����۰�n'X'�p�����N���
+�9���n&ur�߽h�<����a��O��s���)A�����L��v2�D9
+(�3���=k��,��d3d�D |��j��a�Q:�� � �l��� ���
+�&��~O�*9�O��k3����~xh�~U�*F���*�G��짲��;��C�
+V2�d�I����yl��aΒl��-��$?h�WC��ˑ.�Q}��]J�Q{4�x�ijd���u�G`%�OA��i�e��`]�/"����5�:^Dm���ۣ�H߇�6B��v"�`�;�\��`������Ui{��&������l��l}EW�y����>�Vy�����&K̋���&��?����o�w�m麐
+>�:��a}C?��x��g�0�73]��cr �|�2��2��כ�n�=�w���76Q���Y��92:����Q���a���Xz���6�'-��M�V���{�e�Q�n�)�BM��:��j�
+%��2a�6��X6� �ה�s۷�(�1n�1
+qB��n!^zUSf5e^��<WK�Dq�y R���2�XM��@�5e���5e�RS�Ř�+����Vj�<dK�P��!��e�5e�2[�)�Iቫ$C�)�N�Y�D]Y�m����7�![��<.�S��U���T���B�'ޞsZ�=��2�
+5*ru|;иE{V�m69n�Mh��ȩn797N�& ���ȳn����Um7F���M��65�VR�TnPuK�[;�L"��V
+����)9χ�A�t���ztm%ANA�\��S�}��]�ܯ��-��L�+�s}�n�j�V�4�0��K���6]/���t��*{����[��E���_�H�
+���o��m�-R��3�鞒mV ,x��c�|��Kk �H?�G����c&�?�~��g�_���8�9U\�u/͑V9�Nb��VY?S~���*f�IШP4�^���z�%T�%�ӑ�4% x���n����z����4%�s��1N��t/H�!�_7�lw�Sܟ���i��%��В�/Ȏ�ՙ��߲�+����1��hZ��٦���f�_�r��pya��(y_�dN$��l��kwݴ�>?��?��
+���hJ@�+e�*�I��f���%epbQ�_��'=�I�E6E֩�k�O�G5��,��"@LЏ�&Qb���`\��Sg�hr�k"�D�h
+�U����3?.�G��8�\�iFc�T����lu��[W��3E��Pa ؞3�I�̈́'1ZTN���h�2��X&�\o�͂�$��ǔ���ܴ۬��m6�(&��-Zn3��&Qb�2'���e��`s5M4�N%�)���{cω-���ɜ�����6���p;up�}�ƒ���A�a�o5J����CRِ���5�:�f�c�h�h��GZCᇏt��?%�m���v�x�3 ���.��^5f@!�p�fw���?��Q�����o�)������A�M}0?�sU�IL�>���R����w���ɼ��1w �RU9����'�a/��5bn#_sd��|�G��t��;�d�}[���a�9 ~d���>���{����8�� �A/��p(�~�j�F�{Kn^�s��pȋ���B�u��Y{�q�=Z���7U��hj�745�%���8KK�b���q��7��yCS��!��F��S����q��7��y}����S�r*�8@��m�w�N�+������$���l,���q��2�_Υ^%��Br�M�
+�z>5�B(<�]�������c,��L�'��J���
+rlEe�~���J��H��ڞ�Z���$W�xM��/$�Jb��:Q-F�����W����p岍 o+ۼ�Y�˶���|%�U�m��w�l�q�?�,W�
+5*���<����+��Un�:�I���ү�LWp��$X�8ɜ�2��^3~}e�B`��W������DQ�x�;U�Wƻ+���[Z��|�~��)Po=��7[Ѱ1]{�V�ug�Z%�4(&#�ܐ@��l�Ъ��*F��j�xK�Z%�5�ܠ:�q�&;.�z�
+�Rؠ��e�ci����4}��A�;P���p�� ��I�i�&���%&��hc��j��Zv�#����EBK~�n��F>��$�NT��sZ���G������NZK��~vr0̴���tfK0�̖=A�Jn���Ǩ�Ln9 ����R��X���Z�*���ϖ���x:�U��������o�?Lk�#k �݁dU��e*S������Ng��.�|�:ݑ�7��Q�����{c�ʭ0�:w$�
+�r��2���4a�b}u+�Ǟ�R�+h�\�*u/3��U)s��r�j�:]U���綣��]}��"~ʪ�W�ϵ@�+��6����>α�#��&��6�p�Ո4�s^�Gu��R�4�s������E�VXUMf�s�^�V�a��=n�A�o�O_�j�F�z���|��b��Vq�D�;5�u�u���m��[ݱs��A�.)�[-��o�0w�l״�{�:v���h�����Z��hƟ��û���{,]��^iDT�B��z�}H��-t:��Ɋ�?|⾜�ld;�����������P0w��XNċ=%߳�Q�d���%��~�`I���Ky:s��Oe�~4��@�:<i@E�7vؼy`�d�3�D1R������|I����6<_��6�lE�h�F��$�<�! $��a���"9��AU� d��Q5��j��xOm�70�:r
+|F�bA�4\|~���c��e�/���j:M��6��:ن�q�G�N�����{��3�� ��{�X��qr���rO��I�)s��Pu|��:1|��H�ݗp�fՔQ���Ƥ6T"[�r���]Ae�Zm�Y�����ݢJ~����7�>���-��z
+��{
+-��]�"�_�XvKW!iǂ��J�gz~9A�E�B~/��%i�/g!���S�Z�=Y�Q�eQ���]y�1o��=�Lj��oo!Q���#N���Iإ{z�-$���qi��R�Ոn�r�뼅D�Jrė�������x��g��Bb�_ȅ�풭p3e7.�:����/���GO�=��L��/t�L�-9*�f�)���-e���IE�:�6�
+��f�z�
+~��N*e�!�In���`��q�
+U:�*7��Q�G�����<qE�7*GۮG�m��5�2�h3��5x$���b
+�۩�����O�����!.Xqֶ �E�>أ��n�X�h��J��}@��ז�Ú��7a��x
+P7r�%�͉�6�*_k1�
+z�q/7��햐&���(���m�Pz?v�xPC�vሦN_ly��ۖJ<��nD�.�;�t�#u�_e[�B/�'<��LX�8��wڣ�y����~�����o\�;�Y݈4�4�������oZ����nV�
+�g�B��/���:�r�vu�D�q̸!n�0v��£ء:g��͵��O�ۇ��q<e��2�z�]m^���̙�߸2�R�Ӈ\�h4����W�L⏈{���]�7��V����v�
+Wu�������:zjv?����PK���qB:PKx�~<pollen_Services.pgml�\io�8��_�5E��:��)�4YH4M�bQ,�v��%C�s,��/)ɺH1�-F�v"�2�rf8O>~}��[Fn�O`,$�ہ���������H�O^�������Ϥ圜p�����i@7�v�x��";t�8�Z��V8V� �r\kZ�q�-��G8\�x���_}�8��(z���HWG#�m42и��:�cb�f��Ȕe�H.�����)���.Qx��(�8!���0X-�]��\^��''Wy�c�,�աD_�%�K�|s#��Cә�E�UD�E~X�o.��ʯ�%
+-z�h} �<�i�>�M�f�0h�����m��r�H�iK�!��Oav���y��m;��p:��qq~3���'*���_{����:�w/C���(�:,m&m!����=T�b��q?@u��Pܸs|3x�-7ȝ��退�n�t��W�N��j�$�0�H�v�9
+�'1����?�%�V�p�6hf�P�#�����2��)�u�
+��yP4����q}�9���nf�'��r'@�Z��2� �m� �I'$�~x��Y��OA�a/��.�<מ�),o�<�i��)�B�YE؝�����SD���~E_�z&}9'
+�u|H/'�@W���A�Ƀ��0��ҍ*�ٝ���9�� {w�u=�<��(s0�!,��$
+<>�WB��"�f^�S�����{�J3u%P7�ė�Lۮ|�"�%��̗�v?%�΄���^���8s�9�X�`�ӈ���[����<Ɏ9^�U�d��<�OOЋ3r��0l��A����%LK��7ȭ���4��s�?�;:u�!I�9��"{p@�����$o)ލqWE��,:�����*<�o�yxM<'i��O�_-�m�ׅ�+��@<>�n7��®�콇=��A���M!�:k�(=�9�7I���=�n�D���=4z�c�{����H~j�ol;X��1@� g��x��D$� � �����Dt@�J?.b:H�O?�dlĤ\�w��8t�y��S\yc����ʹ��Q��8ɽp#LWC�q!Z�)-�#��aLm�$MH��PeG����5)_V�O��N���PcG�
+M1ݝ���W
+V�PC�/���&���TuS�B�����F%ga+��}ݓ��C�;��F��nF�0M/�fk
+�~\SHc���+�y�8�����x
+b�/(Zy�`�,�.�b�l�3��Y���7�ƘيPI.n�
+ߠ�P#T*|�j�9���Q��9�Ty()�6+�(w;�S�(���3�e+���`����5z7Кޭl7- �η)<��
+0���u��� ��
+0�7���^N/z�U�sC�`$oU�5�G}g�7PҼ�g�|�
+f�n��躀H�����d�����w(ϥz���P8��C!��~V����_M�Vb��F��
+��l����
+0�7�X)�RL���ہ�v@n��Y�8\ZQt��̱����Ϯ�㪌�|����"%�*�`��Ѣ%`�r
+��4 �E,1
+I
+y[41��Gi������7,��i�TTEu1;2��[��&1�e$SK7u�u���~8Ĩ�B��G�6вFa��`r�җc��-!P清��2��[�A�&,<A3����%����9u0rJ���v5��S|���V�P�\BXLx��y���D��l�rƄ���-̒1g^`[�e_��2�GK��T�m���|���vj� �. =.�M���x�ڬ�@�ꈮ�ZH��rx+��������Rm�5|*��ufk�`���ڎ&Fٌ�\�%�i�U0%��V��؎�@� �{^��L��/[���B�
+-�(�np$�rw⭔h!S�e`�<4�����a��j���[��Qg��H��la�¯&��Vic��B�zu_��sUi!S��z�E^E�ΫlU���Z���B����').H՞",�B�L�Z��XW��/Q~��N<� ��f�ȏ�-;B�*��4��'��vU+��Ii<,��-�_�J���/���PK"&�'GUPKx�~<pollen_Context.pgml�[o�8����NS'-�ɴk���v��n�4M'Ba#�]������ؐ�M{Q�L��1��y^?���7���r�IƳA�Ԏ�g^<g�����]��(o�ώ�8�t|���TI�������G��zc:�@���� ����� �C%��n@�i/�.
+�RJ��ܛ���?Gn��,���5�n����"U�Z�5�t�=D��帾ovmUU���/��<S��̝�A�8�Q��v�
+��( �<�ϼuY�������z�[�|������
+���K'_�4Ex�Q�_�P��&�_B|=P_� &.�o������y'���fu�.�]���oB�=��U��|�PцF��{q�A�z��fp�W�.J�ʣ��~�S���QB�+����w�(#أ�,�p��^AƯA�_�xS=��t2��˒ � �G���ZXMQ-�R��zL��*��;��5�g�.E��Y����^iv4�D�P-#��a^��\ =���xTR_#�F�,�)P� 7,��)�" &*|��⃰$A�� ��
+B]'Ea/?�\:��Q��!u��t2 +�Gq4
+Y�i��!Z!��<��zc������};�RI�PߣW����d=0?��_ܫ���Z=��f�eHKq��,ø��yEx������%g��O�puO��)�?S6��T6]�iS����6�]ڜJoo�6�R�P�Pj���QT�v��8CB�ԥ��g��{Ŵ�^�:G��
+ӸNOF�\���ݴV_��5�zOk�� �Z�L�렩O�->`�F�;���`�И/;R��I�-j��«8WENʆ��BH��2�l06`D���8�8kb�[�=���d}���0b:k�l��A�L� [mӛ�$��/�L�3��J�Y�� �� �bF��ʒ11q����q���J*�V*,I���=ʢS�#��`����[�Ȑ���&�
+��������Jĝ6�5U��}�,S3v�����n�^�d|��?
+��)!]Xn��T��m��|����2W6c���R�Ufq���Bs\?.��*sq��T��VkY�ʕ�2����#��hc�8�5r�+<o�;�w�pxQ�+���{ ������-�L�2$Q�������y)�h��2�ϦI��Y�6�m�+τ!'W:m[���r$��u�p֓:�~Rw/�=5��c��F�_nV�֍���H0̅l�$__�~��ŌG0����}&�������-_�?�|��K��-��{<����3P7��8��:��s����S�� ����Y\e��_ֱ��'�k�=2��uS`h
+�%�=I_~<��kQ��sh��=�г�A��zm��bx��l�WSk�5�� N�O�{��V�2����b�]�zX*k��Ƒ-������7��
+�n%�F�FU�oT���ѡ�����
+E���mä�`����=� ��Ҏ��ōzb�:�L�r�ņ���X�{v �V:gP�O�LG�8ZZ�H&�.0TE��ٷ2VH�gc.E-yZ��w!{�]
+]p)���'�,
+���vjQ�
+��R<�)g�K1��������������
+�6OB߬'�dM��\��-�G��Dz$t���ɚ.y�)���ӑП�#asǂ��
+|���%���.B.�[�5U��[Cuܞ�� �#.B�f"��#���qBP��x{�d~[���
+��V�p��s
+g���ɲZ�p�S���T8c'��qK��/Y�pF��i�8������
+S�8���d0�m0sT�0��mQ�IL�lSI��J��V��$��[�3�}O�O�~+̺��&���`�^d�d����7xg ��������Պ�)���|���O��H�|�X�?����U#L��i4|�PK�M\@k<APKx�~<pollen.todoeO�j�0<�_��.YnkW6�M��{��Xk#P�ERL?�5%Ѕeg��aV�/�,`�ƙ�H�3��Tz���ٝ�HɾI����Н?�ģBҞ���J�H��*%a%�u�|��
���,���\�l�v�
-l�:�L�A;��Nx�{�i7�����D�7��=�l5�^8�0�@h�@���h^PZ���ˢ����CYV�j*8�5���ӓ��LB�l�)�?�~�$?PKP����KPK�~<pollen_profile.profile�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��qq��e��q��ÙPK7Rp:BPK�~<
-pollen.xmi�}뗣8����+8�s:�v'<m�]�3?j�|�η9dS����=���xH�!l���+l�+ݟ�K���/ߟ��3B���Ho���F���;���_|���������_~����Kߟ�In��}��·_�
-��������x���p�~|#E.�3O<��J��@�dI1ߪ�[Ŕ���_$UV�7��"I�y�G������>>A/��:��� Bc�����t�;|���J����h�������}�j�-�H���'�|��4�Y
-�BGB�����[D�<���;E���������ѷ�O�A����w�#���OR����'?^4�� "��K)���W�����?��L��K������E�/�D����t;��Ss7�����;Ÿ�Sd�n��,[������������\��r�� O�Ӆo�����Fr��h�[�����_>�~���7��_���
-V�Ό=M��-�{��6��n�?���A/þ��Bxe��o�[�e�[筢*�eCȄVW���tw��%�e�1q@BՉ��}��U7�~r^�����ܘ��u�e��f��>GI��<)��Osv�d���p������g����]vN $��r��l9s�~��e��B��)�����t
-cD��>M�r������U�[%��]����4p�aHXو�ݝ&[sGV�X�M�t� ��z�|���+;���k#����G�����YҘ-�K;r�!�S'&�U��E 9��|���tgZ��V^ASyn�Q<ِ��Q���Iz�C�CL�DǠ��E�u����n*������#��ls~>���O?�x��m�������مi��x;^o�~�G��@��Q�>E��f38ڈg`�Ix7y:�#���E�']�.�̰K�i�#>j��-N��)��D����
-)I��o����{ae�H��y��h�\Mf� ���,j7�;Æ6RM���� cf�� Ř/Ɍ*{�`���w���P%���=`�0@��%�0�0����`@��A�9E�/�y6�)��$�OQfj`
-o]�)���.���B����������Ul{�+�� o�FևE��ohf@��?[��(��,^��iZ:��I\ƬJ���%�ߗ�a�
-��?2�ھg�zv�m��[�`��{�@���c�|Ϯ���K2�B�U�1�N �.�NKQ��?]�Ɍ����r���O��W��7-��i�Mi;Y.�TӚ\r��ŰR� �g���(���Y�yO"���1y͵�{�����cG[�8%������;uN8�L�qp�Pk�܌�U���ŏg��浑�Y7;�/�҃>"�0��.���YP}c�F>����7��{'a�����dP��S~\�1�����EyЮ�N3��=/�5 )������gw����K�ы���q`���tS�:��Ux�+���[f�y��e�s_����O9���G`��<�)wQE0�63q�Q���4䑮� 0V�r!`D��/����{WSށ����"P��,RЧ=���1�JHa$��J
-�w[6�{a��ы��RE�Y�G>cE�U�NX�A̭ʗ�9�_�;������>�@Yi����.�
-�tb�S䁳�s5L�gc����#�����Ԉ�E
-� ���EV��iP��H��#F�����~�����`��o�6V�N�1�OC�}�L�����aY�D��iiv�1䈏,��.�w╮L*=P�_c�����jZ�z�yro��%Cg��ު4�Fz� �8E�T���A\�E
-OU�oPԑD��h��LJj� X��ޏ'�
-�b*��`Uq6w�M�j�t���A�O��iT���]0.��2��>s��A8�O�0�3�gμ�q�qLLmL�6����C��89��N����9���9}��&�2��@̞J���X��n8q����@i-�0z���gTZ�[7�"m�������
-�1w���@e�<��z��^B����4��m���8�c�u���2z,�G�j�:�$P��s��o�H���
-����4�R-@̟^UJ��'����a�9}B�s\���|5TVm��3,��uBs�D��#�����5�jxU��
-x�q���X�G�.A���$��TZ���.�$6���í�Lb��&��/g''I��Fb�e��іIl���ʖ:��`����SU,!�?���+7<��&���C�)�js�C�,�e��R�ji�ҏ|F��M@��d;���)n��ӹ)D���U�1�ޮ���>�A2)�B�.�A�b-�R�����@Z��W�щ;A�xp���ꅺ�j&��Ѯ�ա[sU-;�Y< z�
-g�2�u3�~ИH�hd.hS?�V
-k��ʐ�M4�L�3��J��}�.P@ne�B���/�-翲ru8��1�+��.�Z,����e#�ehY��؞b�R0x�ѣ/�z��ٿ��HM�A���9�*��)�bʶ!�'^cO,�i�q��n>����oR(�M�ƶQ�-�D+"�ȍXr
-n��Xh1��5 )80����[�[u�a������q��y��[Mup"�<�p�OgD�oS4��'��\/��T��p��a�မ�}�e&R��]pEU�Yӑ*�,ƨp���Y��g�EVE���
-�ʺ��s�p��ҋ�4����q�*�?����],`�j�m���m�s�Wxi�Pz�*+/�{?��t�Ux�9���R�+,�ּ
-ߢ2s������,�x]�#����x;PAsEAA�3F���7ǎc�1�P�KN1W&�����G�����}�0)�r\
-20mD���yS�+���G@�h! �'h����T+�j9&��������ԫ)��O0D��a `dm�P�H���W9�Ԑ4�b�Μ�>���E�ؾ��)�pp5&s��Px�დ�L\�Ņ-��c���A~(�k�����d�N�ҫp��K�K^+����#�u���lk��lW���sA~��hBL�������W̞��g�2�o�n-՚AmJ\�4���.q�r�� ���@8М@���,��r1T�Vc
-��S�s���|���-���Ԙ��@��a��S(�s���^�(��P��t�.���.-��=���k������KK�^��Im�hiyrj[�!����io2Dߪ,7Z�B���9��n��VL�!˄�VxX3���)=�/��|p����!��e��>0��q��o��|NJSY$�arJ�j���{H����UDۆa(t��d�&:=�k;=@���QlƝ�M���Mr����;%�ᗎ#��SR+uB��;>�W^)��?���pZ�w#bؿNKO!r ��i&�9O� ���������`̱�5`�tb!��j{<�=X�
-ᴤs����J�I(��w!� ��hu�z��I^Ʀ�PL91�,W�4�?2g0��Q���&����ت0�T!�/���A
-aLk�L��R2���)m�C:H8N�e� ���eKW�N�k�45��A�b��i�Y�F��nL*�����5��)��)�rSU�m\�K��S]��V>��3���0��r����}�/f&R�1�]p��ݐZ3{�ɩ�0��A<s��ե��ණ��r��Bͬ4�Z����ln:�����ӭ���M�DSYt�G?�]`a�0U��'��.�:І�C�v�}u��daGI��`ds������=�n������D��7�?�gw��/�Ȃ#�������7�C��,��pw���{�Y�����g[{�4��ӭa�~���:�A�8�(r��p��7��B�9!��AֻA��r*I�A�.8/b�V�UU�J
-�HW��sIbE�ue���5�d��Ѝ�ƌ�]y�hޗ����[ձLr
-C�MFs"G�J��8!�)�t�1�*IadcU��
-CyF��1�:1�M�n��Y�}��$f���#�.�⁸<�9�.JL7��Dy^.�s.���U�:52:������X#�|u�p
-���f'�����ls�J�����7��W����Ċ�i]�R�h�W9_��5'��+�e��*����nW[u����6����0&�%�
-��vk���a�-��uh^�>�A�Dc��
-m��&�V���b�i��6@��2�t��]�\;S4���]$��pp���y�p���U�Ghi#B�δ��#�,�L/-Nu��e�(y���)�:1r'"�-�C�����[�G�c�e:� �qc�1l[5xϺ5�e�
-��ϧ[/+O���f_���
-�g�`����o���%��7K<�|��F�K[��ka���DG��P�֝���c�VZDtk6�V�<��u�5
-�ɛ �D�R�$�\�^̃ɵ�K~I%5��;�PҎQx��F�a�6��'�6�."��|���GaW��OհO0D�'����f:�N���3n��5���Фb�0�c)$:��?
-���%l�P/�b Z����:��IA 1<�`G��μ\�@ed3�?ۤg+�Mr���#@���fwE���)<c��7u�F-�����,+2L/
-G�Ax����7_�1��8Kw��=�ٜ����{���I�������[S3�u\�Hb� ��K�q�;�3t�h��̢)x��֩zg/4�@�6�6U� ��*�g����9c��[���g�u���n���n�E�4hˆ���r�&����8��HW��V�/�;��bӄ��[��4k�4��f[��ɯM��0�lѽ`@y��m�L�z�O�z��:����K�����y�&���ipY?gj>T:|SŐv��B��]����#���)L2f�+6�Y���w{C1���R���"��L�]i�r��,��'��ɥE4����!H&&��䍩�2���`�Tr�77�����������ir��{�M�e����m���.�{ �hדM|D|��f.��m3P'���5��X��'��q����m���5�!>�x��5U��i�P�1��@r��}�϶��]�sl�PXn{�'��8����Bͫ��݅���?m��0��R�$]��(�w��:��<�S塎�PGw�>�AЩ�t �|���o]���Kg/�3iB��!�-�"jWΛl+���B����+��w~���u��q�h���@z������]�/�$.��y��ٵ��/�:,�w���[4�B^�{���=�t
-s��2o�#
-����j��)�$/�ǥ�)F����m��Z�)7[�
-���P����"+��im��,�
-�0� )�����6q�'/_xJ� hz�ŅH�>E��1��O�+�P]��/=Oni�1�1�'���5�>xI7yYz>���n}���N�U��ݝ�
-y��<��\�>�ݹ�l��\�;7��Rg�؝�G�0?��թ�j�����ЕR��2a+>=����4��R�,q���3X�G��Kbu���,5��Sjx\�_`a�VZRJ`a��&��ԏ��+�BE����g���5��K�3$������� �e��0��
-��
-�g��S"��dd������7��,\>�qv�@�>��Z�hX2���!�!d'�~��a�>����h�������< �.�������'�P�2��(��me��sܘXYw!�E?����e�@Ò�����h�#��E�6�(��Q�M�R�봃v�n� �م��*<g< XT�F᭯q�����Ÿfq�3����12�Bg�E���|""�+jB�Fw���}:z�����Oh$LsR��+�4r��W���b�?p]ի?)<��W��9xd����:dg�K��\&S�����u��K�da�#o���&�8��:1M4;3��l�f � �����2'����}Bj݈�s�t�XS�l�4�jBO�V���Z�ܱg�8(�M�4��I���oJLm>�PxT(��W��yM��������ӵW��bZj�*�1\�NE1A��EƘ��a~�8Mң؉�4�q�QQ.��}�b�s]S�dԩ��ُ��.<�\�)�_�|�GO�86��0��K����!�
-ϧ/G�!���Ԇa������{e˳Q��{@,��By�̨k>ŕ ��W�b��.�s>፟��7"��Q���c3Ȅ��2���X�fG`�5c�VYOo#�"i��d�k鵔[]�>~�
- ����}��~sC�6�G�_�J�M�bI���:aY��
-�Ӥ�ja��r��jK��l��/�[y�"���?q����ca�)
-��#�ByC��y��~�&�(r�{
-��
-_Fχ�x�u�)���Ǘr�B��Cr+�3z���H4��f@T��H�@��3ud��[CC�v����H���uM�-u��Ph�:�I^�iHG��D��)��v���eK_��uԅ�QZ�M�2�M��E��UF���
-d
-_��빙�Z0��Z[u;�!�2yj²�5bی���^&�4IKLn<�F��K8U#�)L���|7�,���C�´�m��U$�+�.�zR?�Ws�X����� �����N�6���"�!�� z4�d���U�w=z��V}A
-�8P2��ɩ=����5�k"8T���>�LJ���w�P��K����2���]2T�+��w���T�(i��?{��7���Jz?�M�G?�O\MV�ץ�&|���y`!J���?C׃a��n�~�5�{V���>��K=�;C�ag�EK�ys�����A<ں�c���D�@Eo<)z���M�74�R�%p8����ٖ�&w���������.�{�՝�p �G��Pr� �^��1�z�����;�\�E�)���-�0��g�3����'w��q&^�,1�/Ԍ��P V��qWlb4g����fd�Skb$ �jc�!���з�-�P���H-^�7�i���ꕜ��'d�I�n����B�tZ�i���6�ǭM۲�Yٚ9�M ��}��ji��M��3�P�ߞ���K�����%J��N��c�?�6��H�V� D?K�I��_�������5��q�L�&�b���~�G����c|�}��i��^�}H��?p���J/���R��%�G:r���C3ػ�J�2Od�O�J;��]�NJ%'y] 8O��a�O~r����EX�����y"�캱W�f�܈}h�N-=�?mkv�]K(Got�F�,�5�����B�"N�Ф�Ф�gFs�LW��]��m���]]�?����a�u�D��Wt�%�*�8Q��@�|3{N/@`D?����������_!R�����J��*��߯ߵ��m��w�ǟ������HG�e*a�r�?��8Ƴ�-cBm9��Ii�4��F�$죐�㇖��w|�k����4aU$��l1�BaU�jU�v1kӪ��{ر%q�-��`4���z�Vd'�#a^\�y�sC���Ҙ'���XD��N���x�~T�Z�hͣ��W�������M����#L�ە}azd�і�Q�(c#q����C�Q�b)a�}<G��Q�N��|�t(�)$� �i��ܺep-��K,��n� �'QF����(��!�-/��Ċ@��?(��^���l�6��O�^��!�K�)[�c!<�Q��a�2������Q�X��
-Q5�C�9����4/DK�SNŷ<��G��o~�1lm��ƒ|�w2S��݇'y��R���e��/?#1_��c}ԉ:g��jeZ��!V+{�VZ��;O^��!���
-�>��xkS�ew��b��57���ʪ�D2��4�����\������Ɋ���ߐ1�7���#/���t�\�X��{'9-��Y���ڏq�Cr#�'�I�������C���b�vr�w��O��ǥ{("&�����`������ş���&^aX� ����Q5��B�o��Ǣ��W{_z�l���� 譨�����*w�#[!n��뵡F̰^KX����!��IxAsƯ�1g,�*���t�p�o��F�79F���,���.�Xo��B��H�Ҏ�gؙ���K�͒���>�� 7�W)�<�����~��|�[,J:e�0 ��+�y�?�q�Ct��oHFw��H��!�wB��QC{qTq�5��ȳ�Ftm��5r��ta�i�؏��i��_��Y�����H�!�a{ĪJb��
-�h�4:���8`�P���X�y�0��b3H�-.ַv��ڔ��F<03֥V�����&�M>��}&�'DݩЄgb�OO�
-h�}�t
-ymd�97
-��#�Gr���a���pZ����
-�I�~�\b����z����*qo��m�L�-8��r㛦�]��k����������9��V�˘����|�|�s�6�m�G��{ii��d0�W4�:Y�Y.�"��:Fn<fes�G?촹���u�z����>�F���
-��(8ڈ��\.��r�ZV�٩��XX��[Z��+���?'�K���N6���G��T���
-��)�Y�B%z�}N�;�ʒV���B�'�E�J��Һ$�#���7�� eQ |�O?
-;M΅�����C>�|!�4�\r.���Z��ߘ�W�@:Z� m��Sqt÷�/��Pҏ��ے��YF�/y=!�TU9���fk�#�w��9�p�1�F��&�&DI�q�F��IÏ��q
-~sFmʒ��G���N��(���ݝ��U�%eE^��&��������>���%﮲�J���4����E��G
-8�tkXq��LQ�0���N�v{��vlN@�G��2p��[����5y��k�ꡖk�1
-7jv�廤�ϴT�Bt��lٚ;���V���LDZId��u�����z�{�RV���~���;��+�r��5[�S�TH�o�mJ,;?;�t>S�����t��9#�uv� s�{�]�K�J'�N�w�����2�l3��L�Y6�;���`�%y/�J���h�0kŖS�u���S1�^�Lx�;��y��/x���a5��|�b砦b9ҽc�lӋ�Nٕ��ޱ\��`�r��oŃ��%�N8�o�)��*�[+\9Yh(��6ҽc=�}�J/{G�{��mط����GO�t���"�AO�e5�qa�m�j�m�Л7d�m.�N���T������y�{W%�1���[�#���.��2��h\�O��Rx0�V�H
-���RF��[�2�ی�}<�LW�X}�+���4*�NLc����C��u�<d���͗S��\��:Y����y��z��}&�#����<t.�z�۔W�������w�yp���z�)��3��z��F,WS.4��X�.S.�o:V�˜�x�j>�x�j΅���z�����g�{�8es�F�Ʌ�#MvY-���X�w�C��jA�y�SU>�Dž�eQ���)��p�,F���z�"��@N�����:�ju,���/��_r��.Gz�c��"T���=�\(.��"i��o��>��R�Gi���Xhn5/����4�̀S�*N�A�U���*hi�Ħ�-�ׅ/��N��5����hi�D��%��B�N*�Vu�uy���(_�)!�Y��Z8I��%��DZ8I��$���nZƉu���4�Ӛ�h]�xhi�$'��l���6-
-��i��"'��r�e�Y��6a�s�08�&��l���[�,�N'.j���rh���oGOxw�4Tp�@Cxw�h� �Pg�((7��^c��ۉ�BO'Z}'��R�i���#EM����g4Tp�OCxwyd4Tp�GFCxw�<4T|��5>�9�i���H�j��\�:2�dE���sY�?�n�Br�Z2��֏YHn3`�����$+m"���Jd!������&?�1�j�Z��p�B�����O2[�˱<|ZF��8��O�h������=o,4���`y��eYhn�������xf�������H����Q��)�Ʋ�W�t��l`0�\�9!}g��c̀�i�n�S}��Yk�Ф$`�V���@3�5un�*�tkl5C�H���N�L\ޅ��nē�n��in��"�؛wpLD��h��g��8SZ=��D����5'������6&`=p~ �C��Amݍ��r��F�C���-OhV�t���7y�n'P:
-�Q��%h��p:��ӛ��jc&���5��x�Tn�P4�*�Y�A^H�zJ����wy#=��k�{<����BO~#����ݭk���=���C������/7t�� ���-�0
-�忴#��~u�y��ؾ����
-����y`���C<M(J8��3�QlB�Ӵtu�ȌyV��NWvcŶ����@�jd�����&�����ƷV6c#Y��#��H��d]SeK���DhS�����Hn|_�E�P�������'�^��/�����PKM 3G{)@uPK�~<(�:K/.pollen.argoPK�~<�-��qB:hpollen_Modèle.pgmlPK�~<FƱ��Spollen_Services.pgmlPK�~<�'�qoPAk pollen_Context.pgmlPK�~<P����K(pollen.todoPK�~<7Rp:B8)pollen_profile.profilePK�~<M 3G{)@u
-�)pollen.xmiPK�iS
\ No newline at end of file
+l�:�L�A;��Nx�{�i7�����D�7��=�l5�^8�0�@h�@���h^PZ���ˢ����CYV�j*8�5���ӓ��LB�l�)�?�~�$?PKP����KPKx�~<pollen_profile.profile�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��qq��e��q��ÙPK7Rp:BPKx�~<
+pollen.xmi�}뗣8����+8�s:�v'��6��9��6ϩ���G�|�#@v0�/����3��J8p���<�-wwu�-�r���}��_����Ny�a����6R�(�w�����_�w�7ʿ���/���{���7�
+�ߠ�v~�����o�p;
+��#<�O0��Џo��C��i��}9@�w*cU�շ��ְ��������y�E��=B��𝢼���� �1�x���}�1;�&�C����m�H�����CCN/����_�sW�n��q�;u��F�O���>{tt�Z��Ed��;ռ�tE��M���}��������?�a?+��䟚> y��'&4=A����;%��?�����ٙ��_�����w�;��0��1���-ѥo?��s���M�����N3��4U���S�O�%�O-������TU}�f?����0]�V���o/�������}�O�� ��SĹ/~�`�����hnGq����d��b���i�l����0�2���/�W�,�ֆ�ۖ�q�j�6��4�Jxa}��ߜ��_�]f�9#��H�>R���\v���>7�u�n<�K�9�n7�o�X����()�'���i���LZ�N0|��2�l^?�O��Ω�#�D����FWmw���ƴ-��@Hx9M5�ә�a�h�c§�>Y�#�t/����s�$��KWvm�.v �+�A�����U5;ekl��c�Dy�X��������s�=��!F�o�{�9�,����{ϐ̩r�*B����F>
+ȋ����l�D����:s�1Q<4�T��AY�t�^����
+�!�Q>��г1y��MT03+Y��rU0%�m�Χ#;���������{x>��}�0���<����/v�61�0.ާȑ�l����Gލ����#r��I���&3�R~ZD�����ei� |��/%pN�����!% ���r���/����,/UM��{�ɤ����.Ȣ&q��3� �)A�nZ@3�I ��ق�(�Q��>'�m��C���0rBo��[�[���R�@����
+/�1p� �|���T�]�$)}�6��`Sx�����q���H�!�?{��_(v��83Cn�X�u�D`}�w'���fd���`���X��E�Y�mhX��`NˤI�����2x��:��G�Z'�CB�I����9`��{��(��s�}����2S�!bI�UH��c:��)!�e�i !"�����给���t��DPN�W��)��
+����I�v_����t d���%'1k[Ku�H�abXp��OK�b�؞��u$�M�Ո�k����ͅ��;��� QM�h&��s]تsB�af:�[�ÇJK�fį�0���u,~"7��L���y|��� ���U!�̨ւ�k��6�A���08� ��81�����w�$����㢌�Z`~�68/ʇN�v��B�y�ۯHH�>���l��<���._2�~�tI��m���:��>�����^ꧧn�y����Wu�}�6_<�L�f�y�.���E%�8����Z/�dz�G��#�XWȅ���3���~�_!PLD
+���?D���Y�`O{�'
+c�JHa$����w[6�{�8�����Re�Y�G>cE7t�c��2�����9�_������.�@yi�����.� �b�S��s�O�gm����#�����m���v���<�Ҡ䥑�K? �.uQ����#�x-8��љ�^%l�\3�$c�����V��!�"Z�D��)5;m�r�G��x���J�F��گ�w���Po9)C=�>y7����S�AoIM�����^��Oa���i�2�b�+�H`ᩮ���>���
+���0@/=����" LL��.���.�i5@/u��Hz>��)z>�.}���%�m�w�g�<����2sF�̙�5>v]�S=��f��%SM��v�`+}Fl���O^���v��@�j fO�ҿG���7�8�����Z$�*虥������L�cej�&##��d�]p� P�:�x#1�����P6e�|��Ā1���$���\�uf�fcV=��#���3(Cǹ��7�%��v
+L�Zp�c��m@̟^�J��'����~�>}R�s\��_5�Vm��3<��uB}�d�������5�jxU��5xp���x�G�� �eu ��*�u�nu�� �p�,�X1���!����9&ZuP#��2S�`�$�Dc���>I�`h���SU,!�?���K/���.���C�)�js�C�,�eP�R�:�T��>#��t��&��f�� �aӆ�������RM�OS���0�ޮ���.�Ar)�B�.�A�`-�T������DVΚ�W�1�;A��xpX�����5�-�`�]C�ðg�N;�Y!�#z�
+g�r�uݟ~P�H�h%d.hR?�V
+o��ҐHL4 �L�2��K��}�.�P@ne�BA��/�-��r�?��6�K��.�Z,��Z.�� �Uh�X�؞f�R0x��c �v�vٿ��ȱD��Cs"
+ULa]�ŔmC"cO�ƞx��J�N7�|�����d$PF�rm�hZ��VD*�����4h���b��pk@4Rpa��˷�&���{/K À��@#06c�ʼnH�1�;u��ß
+l���c�t�j܄[�r�ņn�vY���HY�7w�U��MG*�����mW���k��yi�5sH40J�.BߕX���.K/��(�/�.�",�(�9-�W��-���bW�o[�F�l[�����Ks�уTZy���-���p���k� ���r\a��U�楙N���]w��� ��_��۞��(�r\
+��0:�U��v;����J9�\�Hp���GÛGnw�[�M��/�]p5���MȲ��eL����'� �����0�N�qB�f�kA�\��X�N��Y�#��N�v �$J0�]p5`�s ML@/��ԝ����Ұ�����B�Wc"p1���#��>8 ���=\���;�A���>�Qtq�*_����o;p��^��_B�_��Z��t4�l �ذ��|f������+�F�bl�u���E�r\e�ĝ15� �x�dc���'��@N�M��9��7,����&���� �8����2(Cij5�PJ??�ia�@�̧�]p��_�J�)<Z���O{eu�Ab@3ݫ4��
+|�.Ѧ�_ԥ�P�����t��4jmM����5K��d���'����((���&C���r�!(�K�#(��F�|��$�L����Ê�L�����z�!<�Z�!n��i"2�ɯ��_�9���HH����P�j ���CxH,���UDǁQ$u��d�&:=+;=K@�L��&��-�64,r����[��/-G���R�z�ĕxʯ�*2�)�ߞ<���pR�w#�bؽN����4��L$̈́av*}�NFb:PO$0���0�:��~�m5 �
+���F�pB)<�����mI!�\o�k2Xݤ�mr���i&SNLK�� ���.p�!6�����Ʃ.���=h")�� ce���T(#��j�A�aj,���m�t��Ƴ������� Ԁ�z��p�,]#�� 7&�]]E�����M�M����&�¥�ԉ�Br+�U��~��k9Y���.�s)��.���nH�����Ԍ107�I<s��奚�;�mW��l���yi���s\e���rmsl%�O7�ƙ��Mi�p���va����T�O�,:��`h�@v�<��;���[��%����5v�>#'�}蔸)3�W����E�݀���-F��"HC�����$�]ҳ�v���~���g)�R+϶�J9��kM6���妚�&�㜦�ݷ�a"P]SC��sBV5��w�@+�T���]�~̇�<.��:�䑮�+��.ĊT�ʀ���������g����x_���fmt�(L��6��H+-q���Ț5h:
+c�*IadmU��
+Cy��q�:1�M�n��i�}��$f�� ��6�⁸<�9�,JLւ�=/�9�� ���u���`QPK��1�:Q��������V�^P�>}Ԥ5�!���b�U�bl0�$�EWŮ%��U�V�(c� ��c����SB�Ա���c�6Ա����|^u��E`�dQ����6�b%�.̶E?��k౧:H������ڄߊ6VQ�9-���C���n}���δ����.��Y8�sH��B��Ԫ��#���EkZ���r�uf���
+_�2y���Q���T���܆]�i�
+�Lj�V��:�v�Vp�x�Xz��FMѳn�zY�(���V�ғ��)���-x�:����:X����[p1u!8���Dz��^/�����K�Z8���w��Q��TԺ3�T=r����UAdw�z��o��s�^��Y����ЬIT,�I��U�e�<XB��ԇ�TR������v����4J���Q�>��qv&��k�e=�����~��}��<x��7�qtb�5�q�ǯap�K�&K�9�@ щ�~�Q0��Ф���B���hm�z{H`�k?V&��t��#Q�(�y�F���f�(~2���V�c�䶭�G��ر���vsS(x$���D�Z��3W5YV��^����7����<Jb:!q��(7{�>�Db��#����
+���? l����#lM�/���qi"��'�N/������Е�N2�\��e�Z�Ᵹ��<*��~���MU�V�?���|�㿀�n<�;ӭ���
+[�-}�-
+�A�4�������0��� TE�Jd�}��a��&��J�奉X{�.����rl=�ZgZ#���{G�o;e����gЩ�WA_oNMD��o���p�����~��|(u
+>���!ʹ�'�� �{�!�g)G>�!W�d�!VlJ�����b���y��p�l��8RO�|YP;OLm��E4���!H&&��䍫�����`_�r�7/������ۑ���i�v;菎��#�k�88���m�w
+�h֓M|Dw|��f.��m3� ���5��\������8���m�����!>�x�4ƺj�����L�M�N �>ۀ�v�ϱ�Ca�����r�`r�;
+5�:"�b�4}�ä��jH�8�Q����t��~��:���a��}Z�-�S�iA��"ݝߺf)'���_ʩ3YB��!�
+�"jV��lK���B����;���~�o�u����x���@z������]�/� .��y���s��/�:<�w�����4�B^P�=~>�=�t�s��2o�#��%��j��)ܤ.�ǥ�)F����o��Z�)7[1�
+����(Q����"+��eo��4�
+�4Չ�����6r�_$��2AP��5���}�fMm��Wx��C_:�\j�9� �'�����{I7uA=�,@I�.R�_'N�*b���䆼rw�iw�:%%�w��M��+w�:XMuf�ݹzd�C��N5W��t`W���jǥ [��AN_�Pu�~���$6V�`1$.��Ͳ�#�p�XHTfO��I-~��݉�����L�ԏ��+�BM-���g���5�P�ՙ%V��`r*� ����h�wPj�]j��3��)�XHف���>Sb�5`����A��'Ѱ�R�$RFv09�<���8/��/6�Ƿ��
+��6�1vrAO½)y"�#����~��V�e��,;xK�.5D�ϸ;��l�+ѐ2�}����|r��ܡ�T���4�I�Js��0�n�uuv��w���O5�Vx��{�o\䨾*a1��G��,�w;�����;��1�ģ����c){GFw���}:���o��Oj$\sR��+�4r��W���bD?p]ի?%:�[T�9x`����:dg�H��\&����U��K�dit#o���&�0��1M4;3ҙ��lTf � ����w2'���}B*݈�w�tXS(m�4��jBG�F��z-j��3H��&E����$RM�6%�2�]� "� M�K{�&a|��a��W��ک��0-�g���d�b��Zɂ2c��X3?M�&�P�dz��X�(���.q��sUS��SÍ�s�]xj��Wt�
+�d3���q�ˏa�.I�c'�(�"��d�@��S��[��3.��
+�Fe����[J�E0����&fk\e��������7~*V]˔�kFDM�QO�� �;�t�zz�b!������zz[c �IS%��\K���jJ3��17$x�*��~�͋�۰�u+Q6Y�%U;K�e�"\b(�"\�"���k��N�]")C�$"��o���_D�$݉��G(n+OQH,0�k��e̳5xB��2G���L�Љe��|�Lt\U����}|)�*Ց.<$�r>��=�Y�d,#5���V��hءq�,Tskh�W�V�q���s�A�1�U[�$'o4Z�.q��UF�o+�'wJ"�-t��m �K����p6�����+C��18�Hr�q��Խe
+�E×p��^f�L;$��F�LH�MS�X�VY�Bl�W���R����&�kv8��Q�ޚ�T
+�w#�����<T*L����ZE�R%�
+�'us~�6'�u�ί�����\`m�k��--�A��`�GsL5F�Z���CT��R����&��|:<B�`ԬYW!�;ꡪ��M����^�G-�檜\鏪�"gWlcnxf*=�q���T�=�tYs�E���?��D"0�P8�C ��z_%�(�#T�؈+_��K8��h�=����%�u݈OZ@O������4ª��2s���ws����$���^�P�B�s���0i�$����]^���s�:�U�p;r�>�p�KX�u^�^��3������v2�������!�|E����7o� ~Ox�r�}�-h��w]�9�9���o�{^�C�
+�5l\ģ��=v;�Z��kO�щ����D���.����m����]��.��>���O��S殫���=)���Ȭ���u�����%�{���ȋb4�0�'�i���.|����ɸ����,1�/���-������� b� �����(@�ɩ�AD0�>�vj��_����J˶l���-�*=��ڴ
+��Ċʹ�a2�ԅʩS�M����~���9R����N�����z 8�������mB���
+ح���u��*�
+_�vqΔQ�k��wQ���GpP�+O�?$7ܥ�q�����Eه���S�����/�^�$k[q�#�k��14�����i������ Y�`�ױ����_W��g�S���0��r1ֵ��~��I5�j�ըٕԛU����tj������P�
+��p�hY$�aMaׅ�E�R�I��Iό^�.�
+!i��t'�[���Y]:����.�`�u�DU�WtI%�*�8Y���@�\*%[J#D`�?$�w�����Mb��)���ef�M<Uw��W���kW�m����4m�?''F:2/S ��c���-�!��i*+��OZ�@���s���4
+��>J�1�o�_����&�Ϭ�XZGF�v�~��*:�*�����*��(�vlI�l�����x�Q+r��#i^\�y�q���j��V,��[%bgv�T?����~4��|誛\�xAݚ����ְ�izܮ�K�#ˍ�L��^v[�H���niMG5� H�����!����v�$��CA�L!�N;��k!ĂL�q; �<�2(eD�DiV
+!nyY5$Qbd�A��t��P���TB>%{�Q9�&s,���5
+�{����4�Q�D��
+Q6^@�;���{?��A�SN�q}��G��oA�ގ�o�����b�K��d���S��O�"��
+�t�e��/?#1_��cuԉ9g��je��C�V�>���7�+�`C�.��}����Z���e���kn�偕%�� ��ԑ����\������qE|
+w�oH����I���C�@9�b����{<-��Y���9�I�C�b�'���f����?^�7$����!܇0��z.���x��=.�v�A1�N�F�{�oP���o���a�'$l?K�G��krxHݾ�}�BH^�}iӷF:B�'�7�����܅�}|9��c_��מw �:-a��F#D0Y\�N���3~��9cYY���g�����/��!.m_�c��,t��z)�V��#e�K'��ak�G�/�7K�Zr�p��\�_U�l�t�����b�=��o1�4!�<aK�y�?�q�Ct�oHFwT�(�������=�����"�3��gˍ����k�������0r��[c3��� Im$Z��C��յĞ�A�И* ht�B�a����3&���Pa���f�[R�on�!,��`K�x`f�K�T
+7]Ws,��|�=2�,2O��S� �� ����0������V}n��)G�2��q�>�Zͽ�4�5��������b���y��v����Ke�^��㴞��*�t㛥�e�����r��f7y��g#��&7��㺠(��Jp�Ij2�[�jb�e>��9i��7��
+���6��q�L�xE�����b��8��C|��c�6�{�V��8�XQ�7O�ء�� �¸x��|�Ã����e�E���Ҳ���qE���E��niէ�Z
+N�Vnq�(�ey�G��}*)+�Dx;�v�^���焻e�/-i���,t}�_t�P�ԋ�S������R�'��E%��>)�,�~� ���c;?1�|
+�R�Y��\�KO�Jѿ1�/o�t��:R�g��Zl�����)��%�sb��L_��R��8�.��fk�#�_t�g9�p�1�D��"�%DI�q�F��I�O��r
+~}F�i�M�#|���Fǘ������v�U�%eE^}w�"��������>���%ﶲ�J���4����E���1p��ƴ�lé���i�>�v��̒�X���+����e6��
+���6�5u��k��k�1
+7j�w�廤tϴT�Bt�l՞�������[���VW�&/
+���v&��t��]���wX��T�n<;� �j@�D�zҤ��Sa��CLfS�8�=��İ�D��-�]}�\^b�f��4���E��z�;�֪*�&{��n�Om�G��Z`�!y/�J7o
+�X��*�VP�����Sѳ^�Mx�?��y��/D���a9��xhc�`�b1нc�hҋ�Oٕ"�ޱX,�`�b��o)����%�O��o�(�V��[iB9YX(7���x�{�j*�fC�^!��{Y|��5ط�n���N�d��k#��N�e5� a���j���Л�d�m.�V���T�����TE�{��x��'�-Ձz]���O����B�O���D0ܖ�@
+��&�����[��[�}"�L��P}�K���4*�NL�\��C��u�"d,���WP�B��Y��0D-�j��}��#��ķ<!�F��TT���0��w1Dp�.�j����3��źF,�!4��P�.!�o2T��L�x�r6�x�r&��Άz����gU{�e�k�F�%��ZMvY΅��P�w.B��rN�y�Su1�'��e^��+(��p�����|"��@N����:�ju,���/��_��.z�c�"T���;�B(.��"i��o%�z>��S�Gk����xhn4/����4�ɀW�*A�A�U�ڰ*XiĦ`-�׆/��A��5����XiD�c%[�B�kA*�Vu�uku���(唐�k�+
+��Z���F�+
+��Y0��Jr7+
+�ĺFM N�iM��m�xXi$'��l���6+
+��Y�n#'��r�e�Y'�6as�0�&&�l����,�O� .f�rX��o�Nx{�,T��Bx{�X� o_g�(7��^s��ۊ��N� Z{'��R�Y��#�L����g,T��Bx{yd,T�G�Bx{�<,T�|��5>?v]����f3c��5Umr��y~ϻ-�Mj�<��Y?�!�ɀ��{Vp��5�h<��9+���v��?_����$�Mjm<���%�=K�><�l�/����i���x�?<-�Q��������ܤ׃��}� 䡹�s<ϯ�3���d��{�~� yҳnF �fES�e=���WY�`6���dL��ii�=�y��L��KJ/��q�&#}��͜�e�p�V�'s36
+�tPOS�d�E@��]�hnG<ƩQ��F�.r ��y7�������T�]�$cJ�'"�Z´��c?1�ҡ���z�䢹o�"����1@����b��o���)͚ڒ�Q���&���ZK!;��j=n'��@�0���47���a�v�i6{�?5S�0�=�Zg�_;E����|��]�(�^���O�{�ѓ�(^�yo�9 �����_>A����
+��76�qs;�C���/��{��_�g^q�N���{�!�"�~��>�����O�9��3L��B�˲
+
+�ȌYV��>>�vc�qf�܄�@����3>�o�4�7�k�Z[�dum�dkh$#�F������$?$z`<A�!�ߒ�����NPt��@������~����������/�PK[�n�)�PKx�~<�,�N0/pollen.argoPKx�~<���qB:ipollen_Modèle.pgmlPKx�~<"&�'GUpollen_Services.pgmlPKx�~<�M\@k<A� pollen_Context.pgmlPKx�~<P����K0(pollen.todoPKx�~<7Rp:BM)pollen_profile.profilePKx�~<[�n�)�
+�)pollen.xmiPK��S
\ No newline at end of file
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserRegister.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserRegister.java 2010-03-30 17:57:40 UTC (rev 2960)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserRegister.java 2010-03-30 18:14:00 UTC (rev 2961)
@@ -19,11 +19,9 @@
import java.util.Locale;
import org.apache.tapestry5.BindingConstants;
-import org.apache.tapestry5.Field;
import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.IncludeStylesheet;
import org.apache.tapestry5.annotations.InjectComponent;
-import org.apache.tapestry5.annotations.Log;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SessionState;
@@ -34,7 +32,7 @@
import org.apache.tapestry5.ioc.annotations.Inject;
import org.chorem.pollen.PollenBusinessException;
import org.chorem.pollen.PollenContext;
-import org.chorem.pollen.bean.PollenEmailImpl;
+import org.chorem.pollen.bean.PollenEmail;
import org.chorem.pollen.entity.UserAccount;
import org.chorem.pollen.service.ServiceEmail;
import org.chorem.pollen.service.ServiceUser;
@@ -167,8 +165,8 @@
serviceUser.createUpdateUser(getNewUser());
// Send an email to the new user
- PollenEmailImpl mail = new PollenEmailImpl();
- mail.setTo(getNewUser().getEmail());
+ PollenEmail mail = serviceEmail.getNewEmail(getNewUser());
+
mail.setSubject(
messages.format("pollen.mail.userRegister.subject",
getNewUser().getLogin()));
1
0
Author: fdesbois
Date: 2010-03-30 19:57:40 +0200 (Tue, 30 Mar 2010)
New Revision: 2960
Log:
- Implement createUpdate and connect method for user (UserRegister / Border)
- Add BusinessUtils with method to manage errors from business (PollenBusinessException)
- Improve errors and exceptions (FeedBack / BusinessTransformer improved in ToPIA)
- Add common.css
- Add ServiceEmail + PollenEmail bean
Added:
trunk/pollen-business/src/main/java/org/chorem/pollen/bean/
trunk/pollen-business/src/main/java/org/chorem/pollen/bean/PollenEmailImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/entity/UserAccountImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceEmailImpl.java
trunk/pollen-business/src/test/java/org/chorem/pollen/service/
trunk/pollen-business/src/test/java/org/chorem/pollen/service/ServiceUserImplTest.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserProfile.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserRegister.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/BusinessUtils.java
trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/UserRegister_en.properties
trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/UserRegister_fr.properties
trunk/pollen-ui/src/main/webapp/css/common.css
trunk/pollen-ui/src/main/webapp/user/UserRegister.tml
Removed:
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/Account.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/Register.java
trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/Register_en.properties
trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/Register_fr.properties
trunk/pollen-ui/src/main/webapp/user/Register.tml
Modified:
trunk/pollen-business/pom.xml
trunk/pollen-business/src/main/java/org/chorem/pollen/PollenBusinessException.java
trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/PollenProperty.java
trunk/pollen-business/src/main/java/org/chorem/pollen/mail/MailUtil.java
trunk/pollen-business/src/main/java/org/chorem/pollen/mail/PreventRuleManager.java
trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java
trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties
trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties
trunk/pollen-business/src/main/resources/pollen.properties
trunk/pollen-business/src/main/xmi/pollen.zargo
trunk/pollen-business/src/test/java/org/chorem/pollen/business/TestManager.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Border.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FeedBack.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/AddressBar.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/EvenOdd.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/ErrorPage.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/Index.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/admin/UsersAdmin.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java
trunk/pollen-ui/src/main/resources/i18n/pollen-ui-en_GB.properties
trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties
trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/Border.tml
trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/Border_fr.properties
trunk/pollen-ui/src/main/webapp/Index.tml
trunk/pollen-ui/src/main/webapp/css/main.css
trunk/pollen-ui/src/main/webapp/css/register.css
trunk/pollen-ui/src/main/webapp/poll/PollForm.tml
trunk/pom.xml
Modified: trunk/pollen-business/pom.xml
===================================================================
--- trunk/pollen-business/pom.xml 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-business/pom.xml 2010-03-30 17:57:40 UTC (rev 2960)
@@ -113,7 +113,8 @@
<defaultPackage>org.chorem.pollen</defaultPackage>
<templates>
org.nuiton.topia.generator.TopiaMetaTransformer,
- org.nuiton.topia.generator.BusinessTransformer
+ org.nuiton.topia.generator.BusinessTransformer,
+ org.nuiton.topia.generator.BeanTransformer
</templates>
</configuration>
<goals>
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/PollenBusinessException.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/PollenBusinessException.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/PollenBusinessException.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -23,16 +23,22 @@
public PollenBusinessException(PollenExceptionType type) {
super(type.getMessage());
+ this.type = type;
}
public PollenBusinessException(PollenExceptionType type, Object... args) {
super(type.getMessage());
this.args = args;
+ this.type = type;
}
public enum PollenExceptionType {
//LOAD_CONFIGURATION(n_("pollen.exception.load_configuration")),
- POLL_NOT_EXIST(n_("pollen.exception.poll_not_exist"));
+ POLL_NOT_EXIST(n_("pollen.exception.poll_not_exist")),
+ USER_LOGIN_EXIST(n_("pollen.exception.user_login_exist")),
+ USER_EMAIL_EXIST(n_("pollen.exception.user_email_exist")),
+ USER_NOT_EXIST(n_("pollen.exception.user_not_exist")),
+ USER_WRONG_PASSWORD(n_("pollen.exception.user_wrong_password"));
private String message;
@@ -48,4 +54,8 @@
public Object[] getArgs() {
return args;
}
+
+ public PollenExceptionType getType() {
+ return type;
+ }
}
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -9,6 +9,8 @@
//import org.chorem.pollen.PollenDAOHelper;
//import org.chorem.pollen.business.services.SendMail;
//import org.chorem.pollen.business.services.ServiceUserImpl;
+import org.chorem.pollen.service.ServiceEmail;
+import org.chorem.pollen.service.ServiceEmailImpl;
import org.nuiton.i18n.I18n;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaContextFactory;
@@ -95,8 +97,8 @@
configuration = conf;
configuration.setOption("topia.persistence.classes",
PollenDAOHelper.getImplementationClassesAsString());
- configuration.setOption("topia.service.migration.version",
- PollenDAOHelper.getModelVersion());
+// configuration.setOption("topia.service.migration.version",
+// PollenDAOHelper.getModelVersion());
}
/**
@@ -170,6 +172,7 @@
*
* @param property PollenProperty
* @return value of this property
+ * @throws PollenBusinessException
*/
@Override
public String getProperty(PollenProperty property) {
@@ -192,6 +195,7 @@
*
* @param key of the property
* @return value of this property
+ * @throws PollenBusinessException
*/
public String getProperty(String key) {
return getConfiguration().getOption(key);
@@ -201,6 +205,7 @@
* Get all properties from the configuration
*
* @return the Properties of the application
+ * @throws PollenBusinessException
*/
public Properties getProperties() {
return getConfiguration().getOptions();
@@ -223,6 +228,8 @@
* Get the Topia rootContext.
*
* @return the main TopiaContext needed to begin new transaction
+ * @throws PollenException
+ * @throws PollenBusinessException
*/
public TopiaContext getTopiaRootContext() {
try {
@@ -272,6 +279,7 @@
* @param eee the exception to manage
* @param message the message to add to the new PollenException
* @param args for message
+ * @throws PollenException
*/
@Override
public void doCatch(TopiaContext transaction, Exception eee, String message,
@@ -292,7 +300,12 @@
}
// PollenBusinessException must be managed (catch and throw) when needed
// if (! (eee instanceof PollenBusinessException)) {
- throw new PollenException(eee, message, args);
+// throw new PollenException(eee, message, args);
+// } else {
+// if (log.isDebugEnabled()) {
+// log.debug("Business error : " + _(message, args));
+// }
+// throw eee;
// }
}
@@ -346,4 +359,19 @@
this.currentDate = currentDate;
}
+// @Override
+// public ServiceEmail getServiceEmail() {
+// if (serviceEmail == null) {
+// ServiceEmailImpl instance = new ServiceEmailImpl();
+// instance.setContext(this);
+// serviceEmail = instance;
+// }
+// return serviceEmail;
+// }
+
+ @Override
+ public String encodePassword(String password) {
+ return MD5.encode(password);
+ }
+
}
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/PollenProperty.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/PollenProperty.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/PollenProperty.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -15,7 +15,12 @@
public enum PollenProperty {
/** version of the application **/
APP_VERSION("version"),
- /** url of the server **/
+ /**
+ * url of the server
+ * @deprecated don't need to use it from properties file. Will be analysing
+ * from url in ui module.
+ */
+ @Deprecated
SERVER_URL("siteUrl"),
/** login for default admin **/
ADMIN_LOGIN("adminLogin"),
@@ -38,7 +43,9 @@
/** path for uploaded images directory **/
IMG_DIR("upImgDir"),
/** nb votes to display per page **/
- NB_VOTES_PER_PAGE("pollen.ui.nbVotesPerPage");
+ NB_VOTES_PER_PAGE("pollen.ui.nbVotesPerPage"),
+ /** Charset of Pollen **/
+ CHARSET("pollen.charset");
String key;
Added: trunk/pollen-business/src/main/java/org/chorem/pollen/bean/PollenEmailImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/bean/PollenEmailImpl.java (rev 0)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/bean/PollenEmailImpl.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -0,0 +1,75 @@
+
+package org.chorem.pollen.bean;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.mail.EmailException;
+import org.apache.commons.mail.SimpleEmail;
+import org.chorem.pollen.PollenProperty;
+
+/**
+ * PollenMail
+ *
+ * Created: 30 mars 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class PollenEmailImpl extends PollenEmail {
+
+ /**
+ * Get the value of host
+ *
+ * @return the value of host
+ */
+ @Override
+ public String getHost() {
+ if (host == null) {
+ host = PollenProperty.EMAIL_HOST.getValue();
+ }
+ return host;
+ }
+
+ @Override
+ public String getFrom() {
+ if (from == null) {
+ from = PollenProperty.EMAIL_FROM.getValue();
+ }
+ return from;
+ }
+
+ @Override
+ public Integer getPort() {
+ if (port == null) {
+ port = Integer.parseInt(PollenProperty.EMAIL_PORT.getValue());
+ }
+ return port;
+ }
+
+ @Override
+ public SimpleEmail createSimpleEmail() throws EmailException {
+ SimpleEmail result = new SimpleEmail();
+ result.setHostName(getHost());
+ result.setSmtpPort(getPort());
+ result.setFrom(getFrom());
+ result.addTo(getTo());
+ result.setSubject(getSubject());
+ result.setMsg(getContent());
+ result.setCharset(PollenProperty.CHARSET.getValue());
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ String result = new ToStringBuilder(this)
+ .append("host", this.host)
+ .append("port", this.port)
+ .append("from", this.from)
+ .append("to", this.to)
+ .append("subject", this.subject).
+ toString();
+ return result;
+ }
+}
Property changes on: trunk/pollen-business/src/main/java/org/chorem/pollen/bean/PollenEmailImpl.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Added: trunk/pollen-business/src/main/java/org/chorem/pollen/entity/UserAccountImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/entity/UserAccountImpl.java (rev 0)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/entity/UserAccountImpl.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -0,0 +1,41 @@
+
+package org.chorem.pollen.entity;
+
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * UserAccountImpl
+ *
+ * Created: 30 mars 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class UserAccountImpl extends UserAccountAbstract {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void addFavoriteList(PollAccount list) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public String getDisplayName() {
+ String name = "";
+ if (StringUtils.isNotEmpty(getFirstName())) {
+ name += getFirstName();
+ }
+ if (StringUtils.isNotEmpty(getLastName())) {
+ name += getLastName();
+ }
+ if (StringUtils.isEmpty(name)) {
+ name = getLogin();
+ }
+ return name;
+ }
+
+}
Property changes on: trunk/pollen-business/src/main/java/org/chorem/pollen/entity/UserAccountImpl.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/mail/MailUtil.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/mail/MailUtil.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/mail/MailUtil.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -41,7 +41,9 @@
* @param to Adresse email du destinataire
* @param subject Sujet
* @param msg Message
+ * @deprecated use {@link org.chorem.pollen.service.ServiceEmail#sendEmail(org.chorem.pollen.bean.PollenEmail)}
*/
+ @Deprecated
public static void sendMail(String host, int port, String from, String to,
String subject, String msg) {
SimpleEmail email = new SimpleEmail();
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/mail/PreventRuleManager.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/mail/PreventRuleManager.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/mail/PreventRuleManager.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -16,6 +16,7 @@
package org.chorem.pollen.mail;
+import org.chorem.pollen.bean.PollenEmailImpl;
import java.lang.reflect.Method;
import java.util.Map;
@@ -190,6 +191,16 @@
log.warn("emailAction data parameter is not instance of Map");
}
}
-
}
+
+ public static void emailAction(PollenEmailImpl mail) {
+ MailUtil.sendMail(
+ mail.getHost(),
+ mail.getPort(),
+ mail.getFrom(),
+ mail.getTo(),
+ mail.getSubject(),
+ mail.getContent()
+ );
+ }
}
Added: trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceEmailImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceEmailImpl.java (rev 0)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceEmailImpl.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -0,0 +1,52 @@
+
+package org.chorem.pollen.service;
+
+import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.mail.EmailException;
+import org.apache.commons.mail.SimpleEmail;
+import org.chorem.pollen.bean.PollenEmail;
+
+/**
+ * ServiceMailImpl
+ *
+ * Created: 30 mars 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class ServiceEmailImpl extends ServiceEmailAbstract {
+
+ private static final Log log = LogFactory.getLog(ServiceEmailImpl.class);
+
+ @Override
+ protected void executeSendEmail(List<Object> errorArgs,
+ PollenEmail pollenEmail) throws EmailException {
+
+ errorArgs.add(pollenEmail.getHost());
+ errorArgs.add(pollenEmail.getPort());
+ errorArgs.add(pollenEmail.getTo());
+ errorArgs.add(pollenEmail.getFrom());
+
+ // Create the SimpleEmail to send
+ SimpleEmail email = pollenEmail.createSimpleEmail();
+ email.send();
+
+ if (log.isInfoEnabled()) {
+ log.info("Mail sent to : " + pollenEmail.getTo());
+
+ if (log.isDebugEnabled()) {
+ log.debug("Email infos : " +
+ "\ndate: " + email.getSentDate() +
+ "\nhostname: " + email.getHostName() +
+ "\nport: " + email.getSmtpPort() +
+ "\nfrom: " + email.getFromAddress().toString());
+ }
+ }
+ }
+
+}
Property changes on: trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceEmailImpl.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -2,10 +2,15 @@
package org.chorem.pollen.service;
import java.util.List;
+import java.util.Locale;
+import org.apache.commons.lang.StringUtils;
import org.chorem.pollen.PollenBusinessException;
-import org.chorem.pollen.PollenContextImplementor;
+import org.chorem.pollen.PollenBusinessException.PollenExceptionType;
+import org.chorem.pollen.PollenDAOHelper;
import org.chorem.pollen.entity.PollAccount;
import org.chorem.pollen.entity.UserAccount;
+import org.chorem.pollen.entity.UserAccountDAO;
+import org.chorem.pollen.entity.UserAccountImpl;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
@@ -26,13 +31,63 @@
protected UserAccount executeConnect(TopiaContext transaction,
List<Object> errorArgs, String login, String password)
throws PollenBusinessException, TopiaException {
- throw new UnsupportedOperationException("Not supported yet.");
+ errorArgs.add(login);
+ errorArgs.add(password);
+
+ UserAccountDAO dao = PollenDAOHelper.getUserAccountDAO(transaction);
+
+ UserAccount user = dao.findByLogin(login);
+
+ if (user == null) {
+ throw new PollenBusinessException(
+ PollenExceptionType.USER_NOT_EXIST, login);
+ } else if (!user.getPassword().equals(password)) {
+ throw new PollenBusinessException(
+ PollenExceptionType.USER_WRONG_PASSWORD, login);
+ }
+ return user;
}
@Override
+ protected UserAccount executeGetNewUser(Locale locale) {
+ UserAccount user = new UserAccountImpl();
+ user.setAdmin(false);
+ user.setLanguage(locale.getLanguage());
+ return user;
+ }
+
+ @Override
protected void executeCreateUpdateUser(TopiaContext transaction,
- List<Object> errorArgs, UserAccount user) throws TopiaException {
- throw new UnsupportedOperationException("Not supported yet.");
+ List<Object> errorArgs, UserAccount user)
+ throws TopiaException, PollenBusinessException {
+
+ errorArgs.add(user.getLogin());
+ errorArgs.add(user.getEmail());
+ errorArgs.add(user.getAdmin());
+
+ UserAccountDAO dao = PollenDAOHelper.getUserAccountDAO(transaction);
+
+ // New User
+ if (StringUtils.isEmpty(user.getTopiaId())) {
+ // Check login exist
+ UserAccount userFound = dao.findByLogin(user.getLogin());
+ if (userFound != null) {
+ throw new PollenBusinessException(
+ PollenExceptionType.USER_LOGIN_EXIST);
+ }
+ // Check email exist
+ userFound = dao.findByEmail(user.getEmail());
+ if (userFound != null) {
+ throw new PollenBusinessException(
+ PollenExceptionType.USER_EMAIL_EXIST);
+ }
+ dao.create(user);
+ // Update existing user
+ } else {
+ dao.update(user);
+ }
+
+ transaction.commitTransaction();
}
@Override
Modified: trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties
===================================================================
--- trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties 2010-03-30 17:57:40 UTC (rev 2960)
@@ -4,8 +4,10 @@
pollen.error.context.rollback=
pollen.error.context.start=
pollen.error.context.stop=
+pollen.error.serviceEmail.sendEmail=
pollen.error.serviceList.createAccountForPersonList=
pollen.error.serviceList.deleteAccountFromPersonList=
+pollen.error.serviceMail.sendEmail=
pollen.error.servicePoll.addComment=
pollen.error.servicePoll.createChoice=
pollen.error.servicePoll.createPoll=
@@ -38,6 +40,7 @@
pollen.error.serviceUser.getFavoriteLists=
pollen.error.serviceUser.getNewList=
pollen.error.serviceUser.getNewPerson=
+pollen.error.serviceUser.getNewUser=
pollen.error.serviceUser.getPerson=
pollen.error.serviceUser.getUsers=
pollen.error.serviceVote.getVote=
@@ -45,3 +48,7 @@
pollen.error.serviceVote.hasAlreadyVoted=Unable test vote existing for account with votingId \= %1$s and poll with uid \= %2$s
pollen.exception.load_configuration=
pollen.exception.poll_not_exist=No such poll exists. Please make sure that you are using the correct link and copy it completely into your browser's address field.
+pollen.exception.user_email_exist=
+pollen.exception.user_login_exist=
+pollen.exception.user_not_exist=
+pollen.exception.user_wrong_password=
Modified: trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties
===================================================================
--- trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties 2010-03-30 17:57:40 UTC (rev 2960)
@@ -4,8 +4,10 @@
pollen.error.context.rollback=Erreur lors de l'annulation de la transaction
pollen.error.context.start=Erreur lors du d\u00E9marrage de l'application
pollen.error.context.stop=Erreur lors de l'arr\u00EAt de l'application
+pollen.error.serviceEmail.sendEmail=
pollen.error.serviceList.createAccountForPersonList=
pollen.error.serviceList.deleteAccountFromPersonList=
+pollen.error.serviceMail.sendEmail=Erreur lors de l'envoi de l'email sur le serveur %1$s\:%2$d pour %3$s de la part de %4$s
pollen.error.servicePoll.addComment=Impossible d'ajouter un nouveau commentaire cr\u00E9\u00E9 par %1$s pour le sondage %2$s (%3$s)
pollen.error.servicePoll.createChoice=
pollen.error.servicePoll.createPoll=Impossible d'enregistrer le sondage %1$s cr\u00E9\u00E9 par %2$s
@@ -28,15 +30,16 @@
pollen.error.servicePoll.savePoll=
pollen.error.servicePoll.updatePoll=Impossible de mettre \u00E0 jour le sondage %1$s (%2$s)
pollen.error.serviceResults.importPoll=
-pollen.error.serviceUser.connect=
+pollen.error.serviceUser.connect=Impossible d'\u00E9tablir la connexion pour l'identifiant %1$s et le mot de passe encod\u00E9 %2$s
pollen.error.serviceUser.createDefaultAdmin=Impossible de cr\u00E9er l'administrateur par d\u00E9faut \: %1$s (%2$s)
pollen.error.serviceUser.createUpdateList=
-pollen.error.serviceUser.createUpdateUser=
+pollen.error.serviceUser.createUpdateUser=Impossible de cr\u00E9er l'utilisateur '%1$s' <%2$s> (admin \= %$3b)
pollen.error.serviceUser.deleteList=
pollen.error.serviceUser.deleteUser=
pollen.error.serviceUser.getFavoriteLists=
pollen.error.serviceUser.getNewList=
pollen.error.serviceUser.getNewPerson=
+pollen.error.serviceUser.getNewUser=Impossible d'instancier un nouvel utilisateur.
pollen.error.serviceUser.getPerson=
pollen.error.serviceUser.getUsers=
pollen.error.serviceVote.getVote=
@@ -44,3 +47,7 @@
pollen.error.serviceVote.hasAlreadyVoted=
pollen.exception.load_configuration=La configuration n'a pas \u00E9t\u00E9 charg\u00E9e correctement \! Veuillez v\u00E9rifier le d\u00E9marrage de l'application.
pollen.exception.poll_not_exist=Il n'y a pas de sondage \u00E0 cette adresse. Veuillez verifier que vous utilisez le lien correcte et copiez-le compl\u00E8tement dans le champ d'adresse de votre navigateur.
+pollen.exception.user_email_exist=Un utilisateur est d\u00E9j\u00E0 enregistr\u00E9 avec cet email.
+pollen.exception.user_login_exist=Un utilisateur est d\u00E9j\u00E0 enregistr\u00E9 avec cet identifiant.
+pollen.exception.user_not_exist=L'identifiant '%1$s' ne correspond \u00E0 aucun utilisateur connu.
+pollen.exception.user_wrong_password=Le mot de passe renseign\u00E9 est incorrect pour l'utilisateur '%1$s'.
Modified: trunk/pollen-business/src/main/resources/pollen.properties
===================================================================
--- trunk/pollen-business/src/main/resources/pollen.properties 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-business/src/main/resources/pollen.properties 2010-03-30 17:57:40 UTC (rev 2960)
@@ -15,10 +15,10 @@
#hibernate.default_schema=public
## Configuration de topia-migration
-topia.service.migration=org.nuiton.topia.migration.TopiaMigrationServiceImpl
-topia.service.migration.callbackhandlers=org.chorem.pollen.business.migration.PollenMigrationCallbackHandler
-topia.service.migration.mappingsdir=oldmappings
-topia.service.migration.modelnames=pollen
+#topia.service.migration=org.nuiton.topia.migration.TopiaMigrationServiceImpl
+#topia.service.migration.callbackhandlers=org.chorem.pollen.business.migration.PollenMigrationCallbackHandler
+#topia.service.migration.mappingsdir=oldmappings
+#topia.service.migration.modelnames=pollen
## Initialisation de la base de donn\u00E9es
#choiceType=DATE,IMAGE,TEXT
@@ -47,12 +47,13 @@
## Repertoire de stockage des mails a envoyer
pollen.emails.directory=${HOME}/.pollen/emails
+pollen.charset=UTF-8
## Nombre de votes a afficher par page
pollen.ui.nbVotesPerPage=25
## Adresse du site (utilis\u00C3\u00A9e pour les emails de rappel)
-siteUrl=
+##siteUrl=
## Version de l'application
version=${project.version}
\ No newline at end of file
Modified: trunk/pollen-business/src/main/xmi/pollen.zargo
===================================================================
--- trunk/pollen-business/src/main/xmi/pollen.zargo 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-business/src/main/xmi/pollen.zargo 2010-03-30 17:57:40 UTC (rev 2960)
@@ -1,134 +1,148 @@
-PK�hz<pollen.argo�TKn�0���@�AQt!kcwѢA��]�4� E�9�z�^��H��g�Mh1�=�<�3,��D6�T(�u�1�lDm8�j�:�b��^ȁr��" R8Ev�}��P��'�Ȫ,N�gP��1V�2O�.��
-�ơS!� <����A���[�"���T/{��U��)(�%�FAg�1�B��K0f�J��z>��&佢� >�F4J�aG���x�G9����2�|�G�(�R��D4J�q\l�ǑW$�&�R8ۛ4��d��~Cp꣖Z\���6��V���P/ﱁ=6(�v�AmZi+�j��؝��<[{��+�3y��Z=xn�Vϧ0!���vI�)�N&h�v���Q4��2�t �c���*�~���z �:������ͯ���S����ۙ�|������z��0��s۴���?삂��>�e�g��sǾ�n�8{�x8r-'R3;q�\Ȏ���pF�X�ܫP�Z � �o�ƭ�z͋i��P�m�����N�O��f~c��;y�oXע���L��/�η/��B]��̎��@u�PK(�:K/.PK�hz<pollen_Modèle.pgml�]���8�����8,�@�G$E}dҽ�t���#�I��v��m5l�����=�Ŏ�mI$Ke�j�$��,�毊���U����a1y
-W�(^^���l.��,Z�/�>}|�M�v����x�����?��<��
-�����w?N����Y2;cW�o���t=&�ū�E���v�3���*x�X'AM�{��6�d�
-/6�ŧ�Y����5�:w��s�;G��Y�����8�+��;���ݝ��ܳ,�U<�X��7��X��ُ�����Ͼ�b�_�W��q���hn��=���OI�Q�rb��� "���<��o�:�]��w�b~�N�U'_�ߢ���]�����������$YE��$Og��~�]����;���h�`�^O�E��<�|%a�v�ϰx������E0�'�*}���*z
-�p��[����*�&�r���D�}�t�����v��s4K��$�1�a4�O�)��OI#+�~\�xB�d��n,�]�h*�Vo~�ta�w���
-��(|�9��B�;$�r��v���W`�eJ�r5PAVH
-����A��rو3�`�I�/�8$��H���q`=j��8&���w��%��:/�y~6J�E4�<Km[~�6^̔������rP����:��i��07�M���WY$��?�l�|�˜�b^�?koX�ٸ{!�}`L��rc��;Lےr�!�A��!�+��/��i�Y&���+hm�s�p���U���}g�����;e�,�ܩ��3s#=3��>�y���5�8
-��@=�͘b3nSP�����0U�xuԘ�L�Uv���)LbU�8r�=�h��{:�0�`�A�K�r�aS�:#�ꔳ=w�,�?�9g�R�՛s�s��Igd�qy4�t�=�I���i�J6]H!�fׇp�»$��g�W�_��YęT�L-����#�g��>�v
-�HUh��@s�Ç Z�#Mk�&�J�Έ4G�s:v�,ް�Q-�N
-ԐK��F�9���!Z2�o�x�Z����Q�ˠ~���-c�m�O-�^
-Ԯ��k�X�x��!ެ��_���hō��"Z'0��Z\xe�iʱo_V9�x�ı_���Em"Ld�|�m��`B��<��0Qn�;&BR�Ȳ�İ����h��Dm:y�I*d4LTx�w;L��0�UX���)C7�DYTơ�b�D)�a"$��DcB2�(7&}}Z�+�02&�f�dg�p��\[.k��$3�0�3s�83w���/LT�$�2�5!��=�k��V��T%n��UL0�����lA�b��)����^>�Ѭ� �X>�Ѻ��QO��������:��Q5�fx�C�Ѻ����������>5Z'k��r~ȁS������J���
-��d�]� �,w��C��ן�ftA;m_�kdy#���h�N~Ҏ�" r'S(Rn(�1@�AS�����6ਁ�wD�I��;ki6D����Q�M0o��r�NF�t��
-q%V�kQOBR<�@��xR���$�Өm�����q�Nz��S�$,��p�t�c�ԑt��,�C]ԥ�G���h��@F�I�w<���`.�ދ��B7bIX�%���I���7�q�}��PBI�!ɝ�冤�$�d�
-!a�!�Զ���m�qkˏ���l�\��
-7�0�ݨ�o!$A�8J����-�NT��u|����&~\M��oq�`����j�Hg��E@�E8W1��d�"��N���r����]��a��f����}M���R���.E�<\��� �Z��օ�I���v6|dk���e-�n5����oq_�O��
-�2;@AxՂ��Ȇ,��&�:���_�b�Wc�ʏ�h�1_0�����ڣ�e��d��[tS0��������L���B�=x�|u"0>Cܢ���$�d�8�����:�}�sTa�d�ߟ�Q%'�)^x@�AG�P��6U=��+sTqq4tT���8��l?UԠ����)�.́�T?fZ|$�P��(Yh��`%�O��H�R�fT�j��U�r;�o�y�ܮ�u`%�OA�9S�G� ���"���P�P��Y���Aԃ��hFR��/[#��-C;���`W;���`�z�a�E�gڞ~���V Ð;�S���ͮ��s3ث}<Qu�O�U��^���^R:�f��AC��굥�@|�;��qs�>��p�Y$�0�^f:�h�˭z������^��t|@���S�#o��DիMׂV�c���b\D������)�c�6E;�F��P�^m�DUjؿ7��GykET�k7�aaS��}@��)�I��{�\�y�<�E�x/"䵼���LQ@p�C� ����ܼtjO��������X�%���K(�-�)#����
-T���0�w|OQ���E3&*�
-��SF�=e."�0��ck��qOY�xŞ2"�)�I�.7$}�Sv?�4��me�춲Լy6ݙ���U�����u���L6o"=�����H�6� R��Q���_���U�lrܖM�h7��P����� ȻM7��ӭg�qeӍK��to�L�#Jj��
-*�t�*?��J��J!"Jn�~qz�N�閛�zt�� ���U�.��r9�`��ǫ��)��e�]ў�+u��^��(�1��X.�[�c<L��x����U�~��MbcL�o�m�c�~�g�W��U|#��~"�zş9LHLl�a�3$S�3�^Z���߳����r�P����>����L�S�S��ş��ʜh�#�I|#�U�gʯ��[��0 ��u�Yt�7�$zd�,J��x�)I�Du�o�;�(���n9�^.�D�`�%۸��ҝA��Sos�q�iGq&կ������;K�~i�l�z���ٯ��\\����"SE��+S��o��ZV���\�/t+H^����7�)�Ka��!�E7�s��ωu��,t�j�O��lJA�+4�Tl�
-�͌����N~���������Mj,�)�NE\�pQw<�I��f��*)A7b�T�i�� �zx�N�1���]ѤBDS0y���|�=��a>�lĞتM3�d6�q��a��h�n��
-�P%�)6�rI!����Lڷh&�2�ˢ��ܙH�E;�I��29p��4��AN39�)���ӬX���iֳ(&<,N3��&Ub��&�L҃���\O�GͪT aJ0{@��Xsb�s�d��h�h.C�{F���n�
-nX�qKJ
-���A���9�hl��J���!U����`�DOa��*��E?�jP���e�1zh�[����C̀x���zU�A��㝚��?��7����Vl����=�S�-?�n�̞M=X~ �:���N}���*��*���y?�*#bNOR���r�,���O��A���Ŝ Osd5���'��t��ӟd�CS���~�9�~D�_���t=��v��q\8�E��˵2r�o�ơT������W��"<�Qȋ������H㬃h\v�քw{E���r��ƹ}�q
-1WO�,-��q�{L��o�ƹ}�q�[a`��8l7���<�8��y��u����]��e�6�ޱQ3��w�Omu|�H�/'��<���v��2���ΥN%�zBr��E�r�z�5�B�=�m7�������c,��(�'�zJ�����blEU�n��zJ���K��Z��r}c�k�xE��'$�Jf$/o[nF��溭�W����pMmE�ζ���[�mm%�yJ��l�(R��@�Vl��v��,WA
-�4J���<����)��Um�:Ǝ��qx�_O����N�$�a1�Q�=9�ǯ�4~WD`�������W4����]�=����輥������3���r��.���h�.��UU��zL��=
-ʒRnȠ?gm6�o��h�FCZ%�RC��}
-�6�o��Ï+���O�ؠ���x�� Ѝ�iz��o_�k���P;Г�ҒM���KL�'���lMi� �Z��#��d�ABKv�~�UF>��$�/T��rZ�
-��G����
-�NZ���~v��ϴ�Ӊ�tf�ߟ̖A�Jn���Ǩ�Ln9�����Z�����˵�U
-��-Q���8�U��������od?Lk�#�'��H�*��2�⽡u����L��e���ӝӄ���Fw���*7¼�t�D��r��:�C�R�0��b%uuK�'V��c����*T/3N����!T�ٞ3��K��/Nl�)�诘�C�r_�?�|-�(�>r9}�c��h��0d6�p��i:��&��t��l�����9�}>�)f1M+,�MF��
-M�w��0���i#�·�ӍjH���}��A>�f�]�;K[1�v�e�?Em��h�;�[7�0�e���|}��sD�,w�:����h�����,��l�>O�w��5�X��w�4"
-�������j��MoN�9����Q������_N|t�G*_�� "�``�_q�nν������7�o��"�k���8��t���R�A�ka٧�A7���@�8\i��w�>�}�����=�D3�����H���'��1�_+5m.ݙ6����9h�is��$�i�Ǚ��6ɥ���.9A�8ʺ������&��kBm�+��O����|ܔ�`*�N7r���z:�7ˤdov��`D7<K�E{�l��S��jNѡjު�����R�GQs�'�Sg���g�B����q�S������xs+uH��K�������u{{)
-�ͼy��
-�=�J�}���Л|��^v�NO*��v睄��:M�~�$�_o[����6S��B���qJ�_N��_�뤟�`���'���ж�
-��+�2��l�P^�-G!5�(����jZp�w�QHG�m��Ⱛ���t�QHG�m��8���X���(L!�rR�Q(�Ovv���_��f�T�
-�YWaj܈Cw��Ԓ�x��ڒ�*�Bٸ1x�۳.�i�\�6�$�Gɒ���&e��⊹�?E�����
-��d����~���)e�!�?N��,^��c�
-���J'�wOQ�=���,���,�v�5]�h�EM�&�hc�"7��.�)�Oq¦�q��\���mW�m���S�^���&-:_O�b�!�ȭ�q�+=p�*u�6��Я.�V9NW��wm��^�|L�֖��Q��l��-&�k��r`m An��I�;m��tՓηڦ.XĄ8p(�;.6���M�G<knD��ƫWT��U����q���Ā�s����nύ�
-�g�Q8��n��q�7��܈֗4�����M�7��:ߠ�oT�-�s��ķҹ�
-��9:����\|��B����=�-�9� 6װ��?2w�X��td��%���~]m��y�'s&�7N�^�9}�5��ɜ�{2gD��xT̒��6��*�]�Wњ3���U�f(�`\����.+iW?q��u���aq���PK�GCY�8PK�hz<pollen_Services.pgml�\�o�8���NSOJR�#]�i��Ӥ�6���4�(8�78i{�?�l |ٸ�I��B�d�1��y^��k?����җ60�QLd0Pd N�����_.��,����y�q��ۧi���]}�� ɴ0p�+���N�V8�-���y�4��^d/1�1r��q�v�:��5\x?��8~����o�}������7U����8�̑=�[�}KQ�s���F1�)� �%��W0� ��ɔԏ�(\��K��S����椗w���v���'я>R{����W6^|E1���dn�1|��0��+��ۉ�2\�Ȧύ�
-I���:�E�0��+}@�8�5�{N�,��j��2S�>���I���a4�o#�?`�iZ�5��m��4M.�W��f��J1�������a��AN��DV���}�p�\����m�"o�'2{[U3�ɪ�QJ��n�$�e��}gP���Rw��= ��vY���n�A3K��j���L�&U��3ڛ��5�k����Ecq��{���}�X����F�U#t�
-k�w2Bic�$ї�_��y2
-��W�"l�ș��VT߄��TҾc�E�D����9r�t�� �3���/|��~�v&}�
-������"ЇJ�à�i��A>>K&��PG?R}��� �<an�nF��3e�<��N��ǧ��+�2QD{Z���f�reGxI�����B�j��$�(Lݡb�&�%��.��?%��.�V�����p�;��b�%~�+�8K�dS�9�ی���NB��r�����<#7�A����zl�y�� �������Alx�8�Ѓ�xK���ߤs�>�q��D`��%0���+�����w�p��ୀ�x'�$���߄�}x]<'i�<>~�rw��q<^������<vS�����v�p�������U�{,��!I�N��/zZn
-�H����jj��Ky��Nf��!��$�� ���ܚ L���3�QG������b��Fѡθкq��AV���0J�FB��;�@�#x��@��*oL��06^�>E9N���(�t7�n��P����0��ڴŖ4!E�
-�Cvdh�7Q')��A@��A��ʪΎ��ڭ���$�����at�&_���R��#S��Z59'�f�L��%���+�>�v��.�#5(�=��b+����Q(L�+K�-���TN!]��:��_S�5^�5�g��l0>m�'����
-�e�|��'?QP=��1�@�E������oP�h*�~�\dl�Q�C�'
-��������P�v�L�n�"w#H�ܨ��l���Os�Oһ���ݪ~�'����"��%x��D�n���C�ś1U�+:�Uz�7�H���F���4o��y�������!z��"�د�-�'�aO��\��R�F�V(�
-7��?+4����M�Va��F��
-(�l����
-0�7�X)�VN�9mw� �<y��[�q|F�̱���@̮����.�T�7>����)�`���CK���8������%�!=Cޕ]L/�Ѻ#��b�x�C�9-�����!FgG�y'�G82R/e$WK�
-�u��]�NP/��{�|=A��C�� JwΑА��] PNX�.��3,\ڛ0B)��L<&<q~����n�H�/x$b����cb��֨�Z��z��`�h�N9D<x(*��{8�9ԩ����Gӓ�PK5��I��CPK�hz<pollen_Context.pgml�Zmo�H��_��S�J�a�1�خzNZEj���T�N� Â���hY祺��v�g%!�df_`�yfg�y �`�ɨ��^8�%$__�SLYz3>�v�ir���L
-}Xp�����$����]f�.�FB�F�߱�O�0I|\b�̞w"ns��q�t���Βt�?~�v������{�b�
-���bh�����B����y�@1UU����/H��x$O��;.�A<�]���;��?���9<�y�����G��t5�HB��5���3��4�#�"|�\L�}�?|;ROh��-��'���A���a��EU�)�5�4��Ȝ�ڷp�}�P��G��(�;4�l$���
-�o8?u%I&O��&����0d���8�;.ܮd;�^��A�I���z��}�斸|6���k����tc-*�դ�Z)�((�$Ilj"e��d���V�r�z@�^lY��kn�]�\��:��M3N�!�����<ʠ/�_���r.`d����
-��ۤn��� �����QT¨*��%�G)�n��$����.G2�p@�LJ�g$����4p+B�wD��j���eĉG{!,8s=<~��!k&}�>�c�ݚI�Ln��O�Uf���=�t��ɣ��u���s���l�b��
-�HRa��R�f�=��>��jB����3����mo�M��~�u۩��E{+�=�۶����ĩ��E�ip�3�.9��]$@;e��i+��s�sz�9-�P#�,�"Y�5��+�1�l�����Z=�&ɩF�'�e��;w�=���Sj��]�+�9t�;i �
-� Y����7��y��E�ۆB���AC�E�[۹�jg����X{�v���f�[�ܫ��fh/vv�1�`�����a���:2�G������~+5Ōf�0K��̎�CbJi���F(�V(����=|UJ��E1㾮K�0[0��P`��:C��%cpb>�Z#6���\זi��IKM�߶UŨ(hh��\�f��/۳�5E
-��I�}��v'�{E��l��{�����[�����ˢ��e�^���E�=o̢Jc�g��
-W=`?:��ҙ�Y�֬Y=�~����5�#�YTh� $C��@�Uo�|X��(kkӢݶic�C�J�N���U}ZT�Ӗ����i�c�=�Fm�
-�ھnm���W�*�ڊ7h5�O��o��+[��W.�u+V�f��{X�<�X��B�����+_2K= ��[@��F�AAq��:��%sP��-�5(��C��q�ց�O��:�*?��YGdb��S@h���y'���_������=�}/@�8�6oO�nϷ ����mԴ��w�i劣G$ 5��*���Cp(HM���*KYE+�]��>�@� ��V襜ݚ%G��<�����iz���?��PKd>�7�0'PK�hz<pollen.todo�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��q�(��;�D�*���+G���*(�8z)%)J
-@% ���,.2���E���9e�)�E�%��� Y,B3PK4�[-m�PK�hz<pollen_profile.profile�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��qq��e��q��ÙPK7Rp:BPK�hz<
-pollen.xmi�]m��6���_��me���LR�$:Y�i��sU���c�~�IHËD�Hjl����ȡ���@|%hw�
-��Fw㗿~�m�'���J�|'A��l���/>=��;�o������a��z��ۺ��O���������m���v0�яwR�?C���v+ߑ~���%e�Z�^+i�|�TY���|'I�u�Gl近��m�:���[�_����3�aZ~<x�`hB����|59�
-��_^ez��9n�F�ӡ���'ɇONm =�O�ly2����J��u�_��d����G�YB���E�~��$eߚ� zy�a�M;���p+%���h�ߧ'�/�+C��Wo�'=�0��!z��#Q���xfcm0�N�>(�:�����kE��������`*��k9����w���t�G���[��IN�q-g�X�x�Ok�
- ��煙/~�`�����`f��T��dG��B̴a6h�L=7{x��0d����L�4Ե�ZQ��ش�dՅ<�;>]��T�S"�6AL�:�y��s�C�o�L��&�v\'�'���#���w�2���%���㜽�2i�(�Q���B���ɼ��`��SEE����Z�M{���Z7
-�ZCH�"k���L�04����n������ �Ѭ��*ɮ�]�dž�-��F|P��lNmY1#Q6F�m[:I����]��/�?z���F��1�?�[�bdIe��/��y�dN��YVX�Kȱ��c����,��a�:ZEx��e���Ⱥ�����O��"B�� <�y����w�CH^�����fD��&d����t�g�?�|�u���}��E�k�M;�X���@����-zL�
-ϟsΑ�l��lW1�6t��\�xR�dѤ�]�O�H�UC6�9����Rg��H>[�R����~�����>���fP等s��m2s�Y��ҨI� �-��"%HUu(�� )A�>���7�`z������H�mX����-`���s�a`!` ���`@��alc�4_D�d:QT��IJ��L�"��S�sԺ�S� �OwX c�!���U,k�)�� ��������ohf@��?Y�m+��,^��a���A\��H���Ŗ�C�0��y���T_�s���C�
-����սG������G��x����$�*$�z���tJ�vYzZ|��*t���v�e! �.�c�{�eWޙ�P�4G`����J�I�| ��ָ�Q̚�B]<b�9�N��C1�mϚO[��g'�j����ͅ��;��1QMMi&���6l�9!�05�-��}��s3�WhB�Z?�����F�F��<>KK�����#�T���W��������a����+'fA�Y���dp��'��(b�����E��*�NS��=/����s���{��;�oC�9���FA��:���ps|����^���B?}e^�xY��/+���S�$i������F0e:��F&�Wj�?��<R��cA\!F�N�:Z��{�@1�(r�o�!��f��>�E�8k������PR�����ݖ�Y�wpCn�Tz���XQ5�B���L��f����Oo�ۍ�`�h�Q��4�@�L����B/�x�)��Yٹ�&��2}DD���c�g�P���Ep���"+O�4(Yi$�%�=F�</<����#�x-8���)�^%l�\3%ceC��YN�I��� /z���int�1�S���.ӳ���=P���u�}�Po1.B=`��d�s�[���O�A�C��a��(�"��B�+���*��ړS�>>��a�Z�\�����*����4�L��V�B�� �烎���Ө�����/�o2��>r�̃p���/"g8��yY�#�6L0�0գ�t��m2�䃓�n�m�ψ����ɫ�w�nrqPF���S���k�x�
-α���sȭ�?zt��Bkq��A�N���2�}���@a2f:�:��#���)�%�u9��p�0�k�ҭh9�����T#ѬMO�E�5C����) GǙ��W�1D;��x-ؓ�m�& �O/
-�?��@��e7�_�>!��W��W_
-�U[o<q����\�P�>qsB�CO���Dbe���^�{�<|��o,�#�G� �eu �a*�u�nu��Inr�(�XҲ��!���ɉ�Z��Xg��{M�I�<U�-��އO�>��Bn�hN�}M� �1�ZT��SC։�eT�~���vUhf�����L�H��t�2]c
-����"�rV��F� ������ �Ej
-��V,82��;�V�fNU5/��|�G����c��;��2�h�
-<Hu�S?�Nk��Bw;�L4�Lm���J��g:( _��@����c�X�ڝ^P�ƅP2�Æ�2-D�M�|���Ġ�v0|�@��6�Na&r$� ݡoND��Wgu`�W ��'^ϞX����N7}�;�/�GI�8m�t��FQ�������N�kp����"o�G���pH����;{,��ت���� ��4m=Rm�$O!\k� ��[��}��@� 7����T ���8n�မ�me&R�t������H�5�"T����|m��+���[��@���tm�,\m��+���[��aC!�I�]�;�5�ޙ��,\m��T:�ĕ���}����ª/��n9$���]}�N�����p�E��W�FX��?����z$�!o;
-#�N�#�t�$8�aT���S�8�l}
-e9'��0��xw�g/�7��<n3���H_��p5���M��F�˘:�]9 �'&����0���QD����m@�&_1W���b�
-#kۄFd:\
-dHc]PNja<����$�t(j᱁幡��B�
-Wc"01���J����($C�up���`{(���������|Mj���I�gG+�7�B�_rٮ��n)�YC��fN�&9g���t��+�Fbbl�u��E�2�2zb�Mte.�0^��9��1q9��l x�B8Ǘ%;�F�_;�
-�t��
-��PZ�)�O��n�Ϧ P�Sg:ܶ��Rc
-ck@`W��A��@G���K���E)v��K4)�ݘsV�����ܘ�(��5��Ɯ<�Y�&no�Q��댐@^���7�Μ47j�B�0�A�_"�VL�!˄�VxXҲ���M�xXm>���B����Ǘ>0�����Rŗ9�
-e�XҲ��ɵ�$V��!��Y�"Z�#�'s7q�l_���Y�\�@�m�2 �Sl��f�������a�>4|�x��H1%�R�!$.��.���P�b�9���m7%���{7!���87�1�M3�Oy�L(f�Էh�$��Dc��c��'�V�آ�����U�9E���ݖ�M!���MxMz����M���7�D�bIa���|N�`0��8bc���s�c��8Q�0>s���@cg�Xf"4���m�N�>�D�~j,=���&�tU���R�H��� T�
-�z��,�,Y#so�/&���z�k2�1��1�rCU�uT�K��cM��|��9�!��0�גY���69ƙW{�Rk&�59m���s���Ts��v�VζY���FQ�9��*k�L��m�##�?]kk*[�J4�E�!|��ۅ�vSu�:}��@�C�ԁ:��Yx�s�c�&�v�?hF6���x����*pS�/]���E�ހ~��
-F��"�H}�����D�mһ�f������g!��
-V�m��r��u3��Mնuҍs�"���*����*��u� �RN%i���Q�=pC6leqYթ� �ԣ=� �%]��֕��[.�ŷ�'�3Nv�=����X��i�o����ɨNdO���:(2DV9��@�Y�\��eeU���3�饖�4tb̛�T��I��1H��I>l{�M��=qys�^��8G���\��\&(o�W������3����Љ�խF�#��̶w�����
-Z�"��,�^�*F�[�vU�JQ�z\�tٍ2V���r��#��fJ�ܖ:��]ulф:v;8[���6�Ø�,*p�8�P,�Bֆ�6�&֡z
-<�P��Qb,�1�5ᷢ��{N�4���אa�Ǡ[��#ε3e$���NB;��qɟW#��"��!�-�Ghј�v�Rβδ���DWa��L��WN%�NIՈ'w��fW��k\�=�x+���O�L#8AL7ú�Q���[�Zԭ
-�x��0�;e4=Pւ7L�C,l|�����m���9��U�<���h���m�����O{�Pܦ���S�5g��rd_o˭"n�6�V�<��5z,���M�̱�NT*Ei�W}0��n/��'U�x0fo/q!�*F���%��بN��8�D� &��qI�:�\����D
-�4y�Е���L��ij�d��o���a/�T,�&1��@�+��`�ϡ�æ���R,��A��C�_��2)$��'��(�s+/�( N5k�O5ɗ�&!�|�j6W����/����C'���s��Ug1�nn@� �'W �}����ˣ0�����܉r�����;p��'�Dkp�ҏ|��!��5e?��_�%!$� =�d�6�k;EW�V8�,�v���zj��w2�� +��[`�Ъң�Vy�i��?����9ѭ�%�5S5
-u�-
-�A�ԉ�W�%��O��ʡS�t�n���a!�_�PxK��&bř�X[
-c��5��ʴZ�,�gȿ1��eSi��7x�J{�51���-��zF_�T\86λř����{��B�T'��K� �����^����#C�逤�!�iJ������b����uC��L�]{��r��<S;�L��sKgBg{C�L�;�ӕ�H��}Uȉߜ �a��������p7�{�-t���2|���Y>��a���5"+��d_�q��K�x�Ԉ�Ce~
-�/bne>��[�o���[�*�',���5h,���jL��,�fQ+�6��pVݩŃ��=�<��]��b*
-4��p6�ɇ*_���F������Fӹ t��
-��Y�D{�J�,��"��KynmH�c������+��)(IAs�F!i=f�en���U3Ù���a�rO����mo4��D��̉���$Bf��cQ�/3���Y�#�k��B^�&�}�G��;�d����kL�a�� \'�`Z_=e��9198�b����_�f��5�2�"�ڟqVC�Z��Ҋ���Vדh6L]����c�V�&E��F8$�x 4���
-�tH.�fMe�Rg��;PY9���'7�Z��܈?z��K@�Y�<���堀Y��/�mͬzwg�ճbw�hw�uJ
-���#&W��U�:י)v��-�O�mu�0��=�/*t�D;.R�2�}U}Օ�5Vr�%శ����X8'��JO���^c!Q�=�CG���'n����larr��,�,T�º�xH��5rn-b��%-[������=FBy^�e�-Za�Z!1/6=%sZ��-̽(R`�5`�0)=����E� 4lC�(8��9-[�bBzr�gY�k������
-�6r|vr�}��g�`�e�H@�@�#{�=P�2��(/�meq_e�1���@�!��{���b�l^?<� �tr��ܢ��7����{���:m`�ݸ+Ϗuv����
-�O���֧�v�PqT�bT��8�)X�m����"q�܌G>�e�#!{1#��_J�>\�q7l�'4�9)
-��Gj�K�+�}6 ��o���Չ���ͫD� �3��yf��g�IN�\&c����je��sq`a�#o���&Z?��1L4=3��l�F ��÷�
-��2'��~������k��豦Px���PZ����N�EM����E�$O�Q�L"ԄvCbJ�م����@qw�5~/A`p�2�xw���0PLKi�_Õ�TT)XP�a�+Ƨ�l��N��q����r \l��.e�[/�8�1�ۅY�e�q0��!������8V�i��K���JŊ���^F�<?��0[o�t����^Y�l�F����x�P^83�Oqa�a�F�U�r�K�Ox�Y��J�^3"*r�zzl���Y�C�����,�f,������j)��Zz5�V�\��O^����_~s�6lG�_��)��Œ���u��~&1~�I�����R��6������0�"����=q�9��汰4�B`a��P^�/e�����;1 ��fJ��/#��2�pY���~y�\U�#mxHn%?��=�^�d$Nj���F�a�ƙڳ��[CC�t����P�e�*/#��z}�G?
-1x��i/풱Y�M�;�s��HQ���'�)ZMT�H��W'cyᅧ�*i(��Z��wC�����qef��~t6.�^Ȁ�� �DžA��j�=y�99�-�DBb���$����q1;ֹ������X.RM�<�9DLs~IN6�����ݎ�'����ڟ������./�.�-w;gۺS�
-m�!��
-M�>B ����Vz����S�U�a�������䫁4�m �G��@rv��Y����}��|���;`�osq�M&�>b�9-=�QǗ;g�1��41�����>�����>��/��q��ĝ���!������)5ŋ��PX���K�� b��p`o\�aP��)�9�A��РC�c���7���P��D`
-�f/���F|E�JNwi ٢WR��}���.���=��I�M[��YxNT�v\|]��j�ac�*�G<���>U;��C����n%J��v��C��Pl��$g-���%l�n�������!���aƔ��9�f��K���;Hp�p���~��%zz�)����<�����tzxt)Zے�!�X�~��l�����Lc�>��Y�`����(�S���J��9n�1?���3�������-��P��em�F�n�櫮5;57�������P���p�hi$�auaׅ�E�R�I7�I�ό�^�.����]��m���^]�۟o-����ȉ*�/�8J�U*q���-�<9�-�#���o�[���L�:��W�bi�<����v窻�����Qˑ�]��W��O�F�SDpd�#�2�0a9���r�cpa͘PZ�a�zz�[f�F�8콐�
-�����{�e5ivf]����QX��ªhժ�-]�U��{ر%q�-�dc4��丱Vd��#a^\�y�r����3O��[�}Do�����B�(jߵ�Q��m��/Jo4��[���q��/L�47�2=
-+n`(�ڷ?rk��}�q�D
-�z�b|�m'AB�{L
-:F
-�c��SZ��ٹ�{-��n� ��(�RFD&J�jq�K�!�""��.�T ɍ֮S ���ϰ��`�1��y�E��WW�Q�x�O���H�E�9T!�)�[���*M��!v�� �٪5����ǣ-������<o��"��Wu�2�z��_!R�p:0�0����]��L��}�����H��Ш0e%��$^��-�]'���+
-�I��T�������� �J���qb`RQ�ˣc=FN=� ��2��U�,�?^2���C�߇{X���|��o����[\e谅�9x��|�90����ş�Uy~��/0,����'����&�^T`���G�T腗�`5��cVo\��r�/#� �w�����_/mNXVT赺�k$~�B��� =wx�-�e^Ӳ����1�Ύy����V�<�{�r�#m�a-ٞu8V���tN�pw؆���b�=������>p7yF_����Bz�ح�����t���'��=o�%���:_dU����d�m{v�>.UV�����l�
-N�<s�Ԗ�A���d0��XU�@�)�F��.��A� ����
-_0��y�f�\l:i�E��f�&��Rs�Ԉ��}]j�j�nۊe@�y�أ�d�u������1_6@�l�S�K�v�s�,�$����C�N-��\����v�?���v����9�O;��q^`/�wM9������#`�nF�9QT����˘�Ԕ�
-pW' #�G�VR�=HAv1T�At�\��n�&/�K���p}�n�Z6��}�%n`D��Ȗͩ-+ft5�12l�"�-/�u.6V��MnMJY�r���e���K���h:�0R#�!T�
-��ոN�e�B�g�O'*бA��3��X3&D�G
-�]u�\�^bz��Ј�Sy��j�9�V���&K{�b>k�h�0JŖS�5���Sѱ^�Lx�;��y����������o~���AMż�{�|^���
-�+���c>_p��yOW߂�eK��p.V�b�S�-UطT�r��P�q��QO����M�*�\�9�e�ٷRx`ߪ�z� g=㾲���
-z*�.����m�W�mŅ"[m=pY5⭧��lw�Ͽ����9���x����S��B�b�)�]~ʈ����}
-��B��PxP^JO�~U�}������B���t�6�FCEׁi�s�y��.��h��Z��r�?��Y#�~�oGF��8e����GF�[~��m�+�qazh}��h<�MZ�۔O��\l�zOO,c.4�q_�.c.�o�W�˔���Ŵ���)�;�k������(�Zq�>.<����k�4�e1�Bxg}�a��y�M'��|���ˬ<J�S�q�r��4Rmq��q�=9Ğ������1��[?~���;�i��b��Q����K�s��,ʋ�qʾ%��8-��~�R'�1�1��\k\=\ij�jL��89��ՄUAK'6mI�&|y�4p↧��Մ>GK'�-��\qR!���[��[�=eE�r��xg]#9.�4pjAKv��4pfAIv#�ݴ4��j5%i�5�5q�CK'1��d�Mm�����6-�MĤ��@���=�8�&�~n:�Ę�m��~���٩��@M��\,
-���� o.��
-�bho�b
-d��*w��r����*���,�Tp����D�\2
-�x�� �4�zFCW�4�7GFCWqd4�7�CCE�Y�/��#�6L0����t:�ֶL Y��:�\��w�۲�\�������c��<�`yLJ$+u"��;�Jd!������&>�2�j�Z����p�Bsǒ��O2k�˱��ZF��8���O˨������=o,4���`y�eYh�3����zw<�대`y��$�;��rQӢ)�Ʋ�Wٸ���c0w\�9&=�
-�6'@�4���6�I��<��Ф$��|S�@�64�_+�x��G�f���֛,�踼�͈'�85��\뭋LpcoF�6�&�y2�(�m�dL�5㍉�>2�!L�N?��
-%�V&`�q| �]�gAmٌ��r�sF�]�g�W�2Ь�
-�� (�䙻�@i�Ȏ��,��D��9N� �����4�z1ܜ�U�Y�x�Ttn��(h�x�TZK�oA\H�z�s���ION���O�{0ћ�$'�����v,:��Z�m�/</|����N��L���>���V�<���^��8���!���N�������
-�4�(��Yf(�5�`G�
-��pDލV�i����v�s���sk#Y^�}#m_��<�m[��
-���⳧}�Yn����E��W���0��
-�|����PK�X��U&g3PK�hz<(�:K/.pollen.argoPK�hz<�GCY�8hpollen_Modèle.pgmlPK�hz<5��I��Cpollen_Services.pgmlPK�hz<d>�7�0'pollen_Context.pgmlPK�hz<4�[-m��$pollen.todoPK�hz<7Rp:B�%pollen_profile.profilePK�hz<�X��U&g3
-&pollen.xmiPK��L
\ No newline at end of file
+PK�~<pollen.argo�TKn�0���@�AQt!kcwѢA��]�4� E�9�z�^��H��g�Mh1�=�<�3,��D6�T(�u�1�lDm8�j�:�b��^ȁr��" R8Ev�}��P��'�Ȫ,N�gP��1V�2O�.��
+�ơS!� <����A���[�"���T/{��U��)(�%�FAg�1�B��K0f�J��z>��&佢� >�F4J�aG���x�G9����2�|�G�(�R��D4J�q\l�ǑW$�&�R8ۛ4��d��~Cp꣖Z\���6��V���P/ﱁ=6(�v�AmZi+�j��؝��<[{��+�3y��Z=xn�Vϧ0!���vI�)�N&h�v���Q4��2�t �c���*�~���z �:������ͯ���S����ۙ�|������z��0��s۴���?삂��>�e�g��sǾ�n�8{�x8r-'R3;q�\Ȏ���pF�X�ܫP�Z � �o�ƭ�z͋i��P�m�����N�O��f~c��;y�oXע���L��/�η/��B]��̎��@u�PK(�:K/.PK�~<pollen_Modèle.pgml�]�n�8����7X,�@�)Q�6�4mw��-f���b�X�����r�,����/vIږD�H�lZ���˒m�����>����~>y���$]�9C��$^L�(Y�ޜ}����?��������oן�����aFo���}z��䌽����^�߈��t�<d�����"\��5�����p��/VY�%����z�����:����O��p�z����]�����9?G>��w3���B�������ܷ,�U>�Z��w~,������i��;�Ͼ���_ϖ��a�·df������O�?��r�8�� ��+���fw_�Ur3��܆�U��*��q�==�_�����!^��kW���?�Y�Ln�Y,����2�}s�/J�o���n���R^x=M�����$��7����K7g������[������1�����s�x����<.�"'�7�M��˧7g�ݫ�I����������.��{wJZY��v���&��k���@D��6|�[�����TY��g�͑\%z
+�!�Wct��D$��[�bT���2+@�Pb�8�,�z����V��]L��u y���@]�u���a�c2a�~�6]�_A��<�g�,�'�7g\��o�y��d��J��@-��,�M��f�\��)vo_�q����гI���}E����}�N��ݸ}!� L��ja��;L˒j�!�A��!�k�����W�i�^d���+qm ����v��?���~�V̹�݊9��J�Yʹc�9�I�Q���.��X�sL��Q����>��Mu�s��=c�6��5i��������c��*$r0�{��bw�u��A��D������U�8�[��f���sN�j�{z{NxNw���t�m7�xOy�J�s��8BU6=�!|;�8?�@G�)��rR~�1����Fe�bVV!@��z��e+8�Έ3Ù���4RڷG���}����&
+H�*K@Z1�W�v
+u����j�j�%`Y#��0�O�4���k�k`kw��A��f�;��R��?�P�
+P{[�y���u�HO��zՂ���@ �F��<Ye0Ң-^9{�r�[�u�8$��p엖 ��M��,��ķ^N�MX���q��齊!)Jd9%f*6떗(�*/�"/=H��D2#*=��#B@��*�=O��VY�!"��,".ˀ��1B�:B��� H��/���D�W�R#@�L����\��q��Y���$�0�_��S�Q]����De2H��U۶�qO���)���p�� ���C��.�~��̋�=S�����|L��֊dd�]�2�����Y�>fq�.Y=�ç_(�/�z[k���tt�=o
+v:52���;z��Q��)H�Z5zƔ4��h��ѣ�G��ባFGe�����yC���~w�k���.�<�1��9��j�5]jF�$��&*_�hoѾM����4"�2�.��P��ជmі��2ڀsl�n�n,E@�T�:�8�N�9UA��g��R��B*g�@��)��s[�wH��r�.|W�sx���u���,D�r{��P,�W�;,��p���B�ĕx��,�E]䥣�ﰱ��@F�w%��<|���.�:���B?�wX ������P���`,�ڼy`��;I�x�5]-H��c����6���#�N��&�v���ܨX���b�)��g�����2H�p��Z���P��S���MU9Aq.��Y����*]��:++;��j�cw���Hp�|"������!��?n���1}]ߥ���-AjI�[Ж�GRlIA�W+#{'aC�HN�Y�mv�'jc�\��e#�^=�@�
+{��v�ur+�i�_�Z�4�~=!�P�3z�9!�`R'g�F̃źx�P\�4�?��a����l���DJa'cL�Ӏ�=��ٳ6Y�r��O6A��ID�w��~��|+��� �&��M��f�6N��lU�5���{rT��~�^���gL��CK��rT1r�tT��48��d?�Ԡ�� ���P���'�Lʏ��c#s�ds�l�$�)@c���\�tI���]�R"��أ!���&�%�����?+�~
+�@}L�,#��z�T�F�9��"jt�?�����G�>��"��P��p���Z��c�'�t���H���4y|������g6g�(���ӯ�`�����xL����7Yb^�=��7)]�����}��mKׅT��9����ƫ�<k�y���z�T�K8�Ӕ��ה������t���QO�S������Mς�͑�9�师�f��
+N��M��k�v��<i�\omz���P�S�(c(o���ucMj�L�uWSV(Y�הy��y��2��O�︦�۾=E��yp3�Q��
+n~p�ҫ�2[�)�
+���X�%���K��Ք��j�dj�)ۏ�=�)���2�,�DF�X�5e�RS�![Z���
+a--k�)��Ԕ�BM�$H
+O\� zM�uz��$���l�ee\��ي��qa�����ul��Lo"=������� T��Q���ہ�-ڳ�l��qm"@��FNu�ɹq�6y���F�u�
+,5�j�1j��n�-��q���r��[zP�� fq,�R�l%7Ny�Y�x><r���Lףk+ r
+�X���b�{�����~�l��e�]ѝ� uUc�J� �1��P]����x���z9�?�ˌ�PٛDט��*5/��G���F�W��U~#��n#n�zŞ9�H��l�a�3$S�3�\Z�G��?���H�3�P�����>���O�Źϩ��ү�xi����w+Ĵ����+noW1L�F݀:�Y�����,y��,ɞ�<�)I�ۈ��w�������Et�X��(����qݥ{A�Y��Y�`㸓���L��L�`-�_���~�@v�G=������]\ї��<gEӺW�6�/7��2�������C�F�+����&s"�f��]���u����m����n8�vESr_)�W�M"�6sՈ�/)������48��Mb,�)�NM\sR�<�I��fI7Yb�~�4���E�r��:cD��]�$BDSE��Z|=��q?����L3Ӥ2�uݭ`��hv.غ
+�%�)
+6ׅ
+����L2�h&<1�Ѣr�<�H�E;�I��2���z�m'���8��?�P<�f���o��E1�m�h�r�����0�Ô9A�$}(��#��i���u�(!L f��{Nlq�ԬO�Tͥh�HմY�l�۩�;�#4��p��T��+�|�QrE��ʆT�F�9��4K�@�u@CF?�
+?|��E�)�o�W���ӧ�qgw)���1��;5��(�o$��.�Z����G|�L�ԧ���
+��h�;�����"Nb:�W�>���\���FN�������I}8���q��w8Y{a��s�:�#���x8�����$;���0����3��H�#�%��n�3�n�����a:x�V�C��T��0
+�[r��=���@^dd]¯C5��K������ޠԸ���GS㼡�q-1߬�YZR��X�3��i5����w5�����X�3��a=����z�S�ǡ�lm{��v�_��=<��
+� 켜`;`ɭݍ�o�����p.�*���[�@hU8��yB� �z�o,�Ufc �er�<��W\�@l��c+*#�#��WR\�@�����j�7&�r�k�\}!�U#�ԉj12�4�M���W�l�+�my[���̂�\�u�|�+9��l#HM�e�������e�
+T��Q��T%�!�<_�r��1N�����~}e�����&y��I��q�����+��8돽�7$����$���ݩ�2�]�x�Ҫ�>��;�O�z�ѥ�ي�����[���;ۀ�*��A1!��s�f�V�P�V1j�T��[�*��A�Ձ���4�q�`�+l��g(�K6@���+�
+ށ�����S�L��L_HK6��.1��|F��U#��Բ�9�%'-Z�{v��6�$��p�*G�ӢטG?�'�e_�u�Z-�����a����3[��d�� �Vr�VV>F-`dr��H`8�%�}淐�|��.�JW)M~�D�w����DeT��,�U~#�aZ�YQ�$�r-S�">�n/�5t:�-v)��鎄�i���?�n���Un�� չ#�oX�CVߕ9�-� ���[q=�ܖ�\A��R�P�{�qu�J��G�kWs���r77�?��-��[��SV��j~�Z^Q�}��� p��Q�7���9���F���ڀ>�s-ࠖb�A�C���|E,�ªj2����z�jC��q�b(}�~�"/T3�4:�������l�E���c'ݩ�������m����ꎝt
+wI��j���|�sd����[ձ{�o�@k���}�"�G3�L<�5��.�c�*���J#"�X�
+��S�C���m��qENV������f#۱����
+d�^u@��~���{���p� ^�)������ ��t-�w��K�^�`X��1��c-�}*���_���I�*b������� [��%���7_-F��~�K��6@���Z\�yd+�poD[W5r�&��
+I цm��u�JN �D���?U��{j��8���!ԑk�3������CD7e/(�x!�X�W�i�^d�ٵ���6<���=�vr(��S��lN���{��`��Ӑ{��{�=MrO�{�0���S��a��˽G*�5������4&����⠗�-��
+*K,�j����W���U��s�\���� ���m���S���Sh��S����_�zDz[�
+I;��V�8>��� �-��{�,,I�~9��,t���*�ɢ�b,�2T4>��[H�ye�1dR�~{��-tqZ�M�.��o!Q���H���b�Ft���C^�-$��P�#��-��н��ƫ�<����B.�l�l��)��p�֙�L�,�(<z��Y�f24�eJl�Qa7O�Tn)���N*b�I��lm7��n�MvR)�
+�N*p�=g;����l��IU�ِ���(>*�4}T���扛(��Q9�v=�Xmˍ�q�9G�y�Y�#Y��k0�N=����g~��%W�q����M�-:��e�vKŢ�D�W�g�����,~���� ��k�2���-AoND��V�Z�Y�h�3���x����n��0$��w@��m��������ă�ضG4=p�b��ܶT���t#Rt0�Ѹ���S�*�z���8�I�e�*��Կ�Ս�[
+����p�����i��F���y�o�����_�u��U@?#�|�X-չ�÷[�s$��4�c�
+Apㄱ�����9k/m�e<x��>dU��)s� �9}Л�j�ʜ?xe�$�ƕ9�ʜ>�F�qe��2gD܋�|�쒼��j��]���T�����ŭw��S����w�PK�-��qB:PK�~<pollen_Services.pgml�\io�8��_�5E��:��.�4YH4M�bQ,�v��%C�s,��/)ɺH1�-�A�v"�2�rf8O>zs7��Fn��{`(�$�ہ���q������Io&{G���t����i1#'\|��z�A�э���9"���������%9��ך��|a����6^�h�t��Ώ=+��'��7����4@�4�lE�@S�Yөy80eY>��?�d��'�?�5G��
+o\E�� i?���r��:ug����?9�ʙ�Q8�l�T�}i#ؗ,,|�͍�+�����9�~����v,�(��}�Ձ��9���!� 1���ڶ��9$M�,y�@@>��5���k�����q������H����xhҒ|�Y�O�k�>Z�Q�uP�L�Bdc˟y�@�0#�n܃�j㾸q�:�z�#�Z��;���{�T�V]�V���
+�>I�Aڑ��s8�Ob.�D�KV��G�m��-��Gv=4���2��)�uă��
+��yP4����q}�9���nf�'��r'@�Z��2� �m� �I'$�~x��i��OA�a/��.�<���),o�
+<�i��)�B�YF؝�����cD�����+��/w5�����::���E��r�àG���A~tOz�F��N� [˜p������i�\�9��;I�ρ�e���������|a�xN���L] ԍg�Kd�m[�D��l�Kt۟rgB��r/
+w{�Q�8ĜI�X0��iābc ���AN�c���
+�A��29������\w1[�oP���b #��<b-��
+r��|�9�����-��������[�=bC8�s�ݎ�� o)ލqWE��,:����"�Ux���� �xN�t���\8���W8��x
+|dݬ�!�]��{{��<����B�u��!P:�s��������z����~��{ht���'�2����,$
+�����v��qc�0�#�80y�������|�oF�g\(ݸ�� ?E�4���ry��/p�����?���Ƅ�!a7Ӯ��GQ��$�܍0]
+�,�U�h>�� �|���!=���4!E�
+C�
+�V�|Y�>[!F�+C�-*49�������P��$o���o�Ȕ0���"����!t���oTr��B|�;莴�>�#�)l6�/�p3
+�iz)4[Q�v���B���_!�kơ0�W�.�k�}A��K�zA�p�;d�ɰx�%?QP.ysk�����⦨�
+�
+5B���֚�����}I���b�j���n��T�Jr7�d��r��*?0X���5�D��
+��w+�MK��ӍE
+O%x��@�n�`�C�ś^��h/���*ٹ��
+0��*�ޡ�5�(i�ʳv>@��n��躀H�����d������6w(O�z���P8��C!�mV�����&{+�Pf�F��b6Ww�P��c�])&����ہ��On��Y��_XQt��̱����Ϯ�㪌�|����EJ
+Ud���EK���8i@؉Xb��hbx���(x}����7,��i�TTEu1;2��[��Mb>�[�H��n�1��-��p�Q/��{����e������+7�4$naSFB��q�� d�9�n��MXx�f�1���K8���s���)}�#���N�����Z�B�r a=0��J��U!N����{�ha���8����.�<�G�Y?X���lE����渵S��wI�&�f �/�OX�U(_A�V���[o��y�j��T�y
+��-r�����lw�_����W��8�Z}�b;��:l?�-d
+����x�
+ęٯ��B�BFJ�퐲��M+%ZȔh�y
+u�Wa_�FK5�����(�3{�H��dn�¯&��Vic��B�z(��>�Wy�*-d��U���¶ȫ�_X��/�J[b��FM�VU@�S�eZȔiYkPXk��� �"�"�D�Iv�;����{��#?n�-;>�;�R��Bп�ܑ��l�M��PKFƱ��SPK�~<pollen_Context.pgml�[�o�8�}��NZ2l��&Ӯ��JۭR�I�4�1��N�N���kB��!�M{Q�TH�������Oܣ7�f�tE�����=�̝p�Ͻa��廾ٓތ��q�������yp���ӏR��&t҃� I�؏h�Z{;��Tb�ķ�؞
+jS��'��¡������ǁ�$'�:��u��7�>��}$㾁�����!B�U�v]�oʲ|(�?�z~���{�ᜒ_��l�G^.���;ߓWu�����<!vm�|���;�_J���#�N���?�е���N�. �MD���z(�#��ɪ"4O��������ї����5v�kB�9�4Y���0��p� �6*�N��w=�i�0�p����.K����v~�K���Q�W6%�٫��,&��^@JTr2~
+{Z��M��ڟ���J����^�ȋj�j�ժSr���'Iz�u�;������<����z�|/5� �y�[����(�R��#=���xTP_#�F�(�!P�q=n�M��cz�D�� T�Q�!�,�v�N�]:!I���W\��aT8��ԧv�;�^*aE�8&\!k;�3DK$�X$�w}�^��c�4suy�<���ᯔ��p�bͭ�$��I��Yu�0���L<��!-�Y����G�a�y�
++�r����F�>���8�EvLg��T�,m�l
+�i�����6�]ڬ�ho�6�T�P�Ph��T{Qz�-��t
+S�RH�� I�%��էNz=����+B�: U2
+����g7(�����1?(� �$'�H0���-��Ks�О�v���Xj́��I���(
+���5^@�U�O�"'dCic!��a�{6���Ag��V�1����y�su�Yk�Y���<��8{���l�Mo�����2��0.h�Ͻ�L�L3��+K���N�11À��T�T�A��=�rPT3�Q�]K��J�ɏ��T�[��8�� �5R�ٗ��[m�cY�`����C<��ɹ�$�a<9��/���S@Ք�s,7�k���6kU|����"V6c����R2efq���Bs\9���*sU�q�*G�)ע+�U��G2�����j�l�/���8��qժ��Y��G�v�㈳�U�ꏛ|fB�*�����?�*�xU@
+&�d��YfV�q�W�6땧B���)��{,�qfy]��nR��'u�r��Ss�+,��h����Һ�V�q�9
+X��4��}3NL`�-U�s�M�|A����g���|)���|O�0��w
+�'Y'@�p;@hL�-�k� -_*��Y�e�ⶺ�cw�/���Fd�!���8�
+x�1��8l+ײj�����{]O�ms���nm��bx��t�WSk�5�� N�O:zX�˹�{��&Gɹ�Re-��
+��h���^!c�框^�٭Y�i���������z�ZƸr�1�`Q��)���X�2����=
+��Ԏ�T�E����NX��D�ݞ��,p�*�B�8J�����]X���%�\j�(eAm̧��O���.to�Q�pF�R��U�@��T(�S���������'9�l�*�Ğ�֥P*.EMD�}|�
+��tf�A�3�l֙H�M��L�ڝ�G���r&Ι�K��M��OgByj�D��
+΄����:
+�L���o�IJ`�7Fu�d�8>�XS![:�ys��T�4�n�o��9�r��VNUβvN��u8a\Tβ�q��*�������M*��oXf0��lY6�;��g4
+�m� �Yi�Y�E6���R��0f8�=&����-،l
+��.�������,؍����;�3�wg��v�n��G9E9Y���;�F;Ԃ�Ėh�?D�-s1�k|,�[ÆL����R�,=�PK�'�qoPAPK�~<pollen.todoeO�j�0<�_��.YnkW6�M��{��Xk#P�ERL?�5%Ѕeg��aV�/�,`�ƙ�H�3��Tz���ٝ�HɾI����Н?�ģBҞ���J�H��*%a%�u�|��
+���,���\�l�v�
+l�:�L�A;��Nx�{�i7�����D�7��=�l5�^8�0�@h�@���h^PZ���ˢ����CYV�j*8�5���ӓ��LB�l�)�?�~�$?PKP����KPK�~<pollen_profile.profile�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��qq��e��q��ÙPK7Rp:BPK�~<
+pollen.xmi�}뗣8����+8�s:�v'<m�]�3?j�|�η9dS����=���xH�!l���+l�+ݟ�K���/ߟ��3B���Ho���F���;���_|���������_~����Kߟ�In��}��·_�
+��������x���p�~|#E.�3O<��J��@�dI1ߪ�[Ŕ���_$UV�7��"I�y�G������>>A/��:��� Bc�����t�;|���J����h�������}�j�-�H���'�|��4�Y
+�BGB�����[D�<���;E���������ѷ�O�A����w�#���OR����'?^4�� "��K)���W�����?��L��K������E�/�D����t;��Ss7�����;Ÿ�Sd�n��,[������������\��r�� O�Ӆo�����Fr��h�[�����_>�~���7��_���
+V�Ό=M��-�{��6��n�?���A/þ��Bxe��o�[�e�[筢*�eCȄVW���tw��%�e�1q@BՉ��}��U7�~r^�����ܘ��u�e��f��>GI��<)��Osv�d���p������g����]vN $��r��l9s�~��e��B��)�����t
+cD��>M�r������U�[%��]����4p�aHXو�ݝ&[sGV�X�M�t� ��z�|���+;���k#����G�����YҘ-�K;r�!�S'&�U��E 9��|���tgZ��V^ASyn�Q<ِ��Q���Iz�C�CL�DǠ��E�u����n*������#��ls~>���O?�x��m�������مi��x;^o�~�G��@��Q�>E��f38ڈg`�Ix7y:�#���E�']�.�̰K�i�#>j��-N��)��D����
+)I��o����{ae�H��y��h�\Mf� ���,j7�;Æ6RM���� cf�� Ř/Ɍ*{�`���w���P%���=`�0@��%�0�0����`@��A�9E�/�y6�)��$�OQfj`
+o]�)���.���B����������Ul{�+�� o�FևE��ohf@��?[��(��,^��iZ:��I\ƬJ���%�ߗ�a�
+��?2�ھg�zv�m��[�`��{�@���c�|Ϯ���K2�B�U�1�N �.�NKQ��?]�Ɍ����r���O��W��7-��i�Mi;Y.�TӚ\r��ŰR� �g���(���Y�yO"���1y͵�{�����cG[�8%������;uN8�L�qp�Pk�܌�U���ŏg��浑�Y7;�/�҃>"�0��.���YP}c�F>����7��{'a�����dP��S~\�1�����EyЮ�N3��=/�5 )������gw����K�ы���q`���tS�:��Ux�+���[f�y��e�s_����O9���G`��<�)wQE0�63q�Q���4䑮� 0V�r!`D��/����{WSށ����"P��,RЧ=���1�JHa$��J
+�w[6�{a��ы��RE�Y�G>cE�U�NX�A̭ʗ�9�_�;������>�@Yi����.�
+�tb�S䁳�s5L�gc����#�����Ԉ�E
+� ���EV��iP��H��#F�����~�����`��o�6V�N�1�OC�}�L�����aY�D��iiv�1䈏,��.�w╮L*=P�_c�����jZ�z�yro��%Cg��ު4�Fz� �8E�T���A\�E
+OU�oPԑD��h��LJj� X��ޏ'�
+�b*��`Uq6w�M�j�t���A�O��iT���]0.��2��>s��A8�O�0�3�gμ�q�qLLmL�6����C��89��N����9���9}��&�2��@̞J���X��n8q����@i-�0z���gTZ�[7�"m�������
+�1w���@e�<��z��^B����4��m���8�c�u���2z,�G�j�:�$P��s��o�H���
+����4�R-@̟^UJ��'����a�9}B�s\���|5TVm��3,��uBs�D��#�����5�jxU��
+x�q���X�G�.A���$��TZ���.�$6���í�Lb��&��/g''I��Fb�e��іIl���ʖ:��`����SU,!�?���+7<��&���C�)�js�C�,�e��R�ji�ҏ|F��M@��d;���)n��ӹ)D���U�1�ޮ���>�A2)�B�.�A�b-�R�����@Z��W�щ;A�xp���ꅺ�j&��Ѯ�ա[sU-;�Y< z�
+g�2�u3�~ИH�hd.hS?�V
+k��ʐ�M4�L�3��J��}�.P@ne�B���/�-翲ru8��1�+��.�Z,����e#�ehY��؞b�R0x�ѣ/�z��ٿ��HM�A���9�*��)�bʶ!�'^cO,�i�q��n>����oR(�M�ƶQ�-�D+"�ȍXr
+n��Xh1��5 )80����[�[u�a������q��y��[Mup"�<�p�OgD�oS4��'��\/��T��p��a�မ�}�e&R��]pEU�Yӑ*�,ƨp���Y��g�EVE���
+�ʺ��s�p��ҋ�4����q�*�?����],`�j�m���m�s�Wxi�Pz�*+/�{?��t�Ux�9���R�+,�ּ
+ߢ2s������,�x]�#����x;PAsEAA�3F���7ǎc�1�P�KN1W&�����G�����}�0)�r\
+20mD���yS�+���G@�h! �'h����T+�j9&��������ԫ)��O0D��a `dm�P�H���W9�Ԑ4�b�Μ�>���E�ؾ��)�pp5&s��Px�დ�L\�Ņ-��c���A~(�k�����d�N�ҫp��K�K^+����#�u���lk��lW���sA~��hBL�������W̞��g�2�o�n-՚AmJ\�4���.q�r�� ���@8М@���,��r1T�Vc
+��S�s���|���-���Ԙ��@��a��S(�s���^�(��P��t�.���.-��=���k������KK�^��Im�hiyrj[�!����io2Dߪ,7Z�B���9��n��VL�!˄�VxX3���)=�/��|p����!��e��>0��q��o��|NJSY$�arJ�j���{H����UDۆa(t��d�&:=�k;=@���QlƝ�M���Mr����;%�ᗎ#��SR+uB��;>�W^)��?���pZ�w#bؿNKO!r ��i&�9O� ���������`̱�5`�tb!��j{<�=X�
+ᴤs����J�I(��w!� ��hu�z��I^Ʀ�PL91�,W�4�?2g0��Q���&����ت0�T!�/���A
+aLk�L��R2���)m�C:H8N�e� ���eKW�N�k�45��A�b��i�Y�F��nL*�����5��)��)�rSU�m\�K��S]��V>��3���0��r����}�/f&R�1�]p��ݐZ3{�ɩ�0��A<s��ե��ණ��r��Bͬ4�Z����ln:�����ӭ���M�DSYt�G?�]`a�0U��'��.�:І�C�v�}u��daGI��`ds������=�n������D��7�?�gw��/�Ȃ#�������7�C��,��pw���{�Y�����g[{�4��ӭa�~���:�A�8�(r��p��7��B�9!��AֻA��r*I�A�.8/b�V�UU�J
+�HW��sIbE�ue���5�d��Ѝ�ƌ�]y�hޗ����[ձLr
+C�MFs"G�J��8!�)�t�1�*IadcU��
+CyF��1�:1�M�n��Y�}��$f���#�.�⁸<�9�.JL7��Dy^.�s.���U�:52:������X#�|u�p
+���f'�����ls�J�����7��W����Ċ�i]�R�h�W9_��5'��+�e��*����nW[u����6����0&�%�
+��vk���a�-��uh^�>�A�Dc��
+m��&�V���b�i��6@��2�t��]�\;S4���]$��pp���y�p���U�Ghi#B�δ��#�,�L/-Nu��e�(y���)�:1r'"�-�C�����[�G�c�e:� �qc�1l[5xϺ5�e�
+��ϧ[/+O���f_���
+�g�`����o���%��7K<�|��F�K[��ka���DG��P�֝���c�VZDtk6�V�<��u�5
+�ɛ �D�R�$�\�^̃ɵ�K~I%5��;�PҎQx��F�a�6��'�6�."��|���GaW��OհO0D�'����f:�N���3n��5���Фb�0�c)$:��?
+���%l�P/�b Z����:��IA 1<�`G��μ\�@ed3�?ۤg+�Mr���#@���fwE���)<c��7u�F-�����,+2L/
+G�Ax����7_�1��8Kw��=�ٜ����{���I�������[S3�u\�Hb� ��K�q�;�3t�h��̢)x��֩zg/4�@�6�6U� ��*�g����9c��[���g�u���n���n�E�4hˆ���r�&����8��HW��V�/�;��bӄ��[��4k�4��f[��ɯM��0�lѽ`@y��m�L�z�O�z��:����K�����y�&���ipY?gj>T:|SŐv��B��]����#���)L2f�+6�Y���w{C1���R���"��L�]i�r��,��'��ɥE4����!H&&��䍩�2���`�Tr�77�����������ir��{�M�e����m���.�{ �hדM|D|��f.��m3P'���5��X��'��q����m���5�!>�x��5U��i�P�1��@r��}�϶��]�sl�PXn{�'��8����Bͫ��݅���?m��0��R�$]��(�w��:��<�S塎�PGw�>�AЩ�t �|���o]���Kg/�3iB��!�-�"jWΛl+���B����+��w~���u��q�h���@z������]�/�$.��y��ٵ��/�:,�w���[4�B^�{���=�t
+s��2o�#
+����j��)�$/�ǥ�)F����m��Z�)7[�
+���P����"+��im��,�
+�0� )�����6q�'/_xJ� hz�ŅH�>E��1��O�+�P]��/=Oni�1�1�'���5�>xI7yYz>���n}���N�U��ݝ�
+y��<��\�>�ݹ�l��\�;7��Rg�؝�G�0?��թ�j�����ЕR��2a+>=����4��R�,q���3X�G��Kbu���,5��Sjx\�_`a�VZRJ`a��&��ԏ��+�BE����g���5��K�3$������� �e��0��
+��
+�g��S"��dd������7��,\>�qv�@�>��Z�hX2���!�!d'�~��a�>����h�������< �.�������'�P�2��(��me��sܘXYw!�E?����e�@Ò�����h�#��E�6�(��Q�M�R�봃v�n� �م��*<g< XT�F᭯q�����Ÿfq�3����12�Bg�E���|""�+jB�Fw���}:z�����Oh$LsR��+�4r��W���b�?p]ի?)<��W��9xd����:dg�K��\&S�����u��K�da�#o���&�8��:1M4;3��l�f � �����2'����}Bj݈�s�t�XS�l�4�jBO�V���Z�ܱg�8(�M�4��I���oJLm>�PxT(��W��yM��������ӵW��bZj�*�1\�NE1A��EƘ��a~�8Mң؉�4�q�QQ.��}�b�s]S�dԩ��ُ��.<�\�)�_�|�GO�86��0��K����!�
+ϧ/G�!���Ԇa������{e˳Q��{@,��By�̨k>ŕ ��W�b��.�s>፟��7"��Q���c3Ȅ��2���X�fG`�5c�VYOo#�"i��d�k鵔[]�>~�
+ ����}��~sC�6�G�_�J�M�bI���:aY��
+�Ӥ�ja��r��jK��l��/�[y�"���?q����ca�)
+��#�ByC��y��~�&�(r�{
+��
+_Fχ�x�u�)���Ǘr�B��Cr+�3z���H4��f@T��H�@��3ud��[CC�v����H���uM�-u��Ph�:�I^�iHG��D��)��v���eK_��uԅ�QZ�M�2�M��E��UF���
+d
+_��빙�Z0��Z[u;�!�2yj²�5bی���^&�4IKLn<�F��K8U#�)L���|7�,���C�´�m��U$�+�.�zR?�Ws�X����� �����N�6���"�!�� z4�d���U�w=z��V}A
+�8P2��ɩ=����5�k"8T���>�LJ���w�P��K����2���]2T�+��w���T�(i��?{��7���Jz?�M�G?�O\MV�ץ�&|���y`!J���?C׃a��n�~�5�{V���>��K=�;C�ag�EK�ys�����A<ں�c���D�@Eo<)z���M�74�R�%p8����ٖ�&w���������.�{�՝�p �G��Pr� �^��1�z�����;�\�E�)���-�0��g�3����'w��q&^�,1�/Ԍ��P V��qWlb4g����fd�Skb$ �jc�!���з�-�P���H-^�7�i���ꕜ��'d�I�n����B�tZ�i���6�ǭM۲�Yٚ9�M ��}��ji��M��3�P�ߞ���K�����%J��N��c�?�6��H�V� D?K�I��_�������5��q�L�&�b���~�G����c|�}��i��^�}H��?p���J/���R��%�G:r���C3ػ�J�2Od�O�J;��]�NJ%'y] 8O��a�O~r����EX�����y"�캱W�f�܈}h�N-=�?mkv�]K(Got�F�,�5�����B�"N�Ф�Ф�gFs�LW��]��m���]]�?����a�u�D��Wt�%�*�8Q��@�|3{N/@`D?����������_!R�����J��*��߯ߵ��m��w�ǟ������HG�e*a�r�?��8Ƴ�-cBm9��Ii�4��F�$죐�㇖��w|�k����4aU$��l1�BaU�jU�v1kӪ��{ر%q�-��`4���z�Vd'�#a^\�y�sC���Ҙ'���XD��N���x�~T�Z�hͣ��W�������M����#L�ە}azd�і�Q�(c#q����C�Q�b)a�}<G��Q�N��|�t(�)$� �i��ܺep-��K,��n� �'QF����(��!�-/��Ċ@��?(��^���l�6��O�^��!�K�)[�c!<�Q��a�2������Q�X��
+Q5�C�9����4/DK�SNŷ<��G��o~�1lm��ƒ|�w2S��݇'y��R���e��/?#1_��c}ԉ:g��jeZ��!V+{�VZ��;O^��!���
+�>��xkS�ew��b��57���ʪ�D2��4�����\������Ɋ���ߐ1�7���#/���t�\�X��{'9-��Y���ڏq�Cr#�'�I�������C���b�vr�w��O��ǥ{("&�����`������ş���&^aX� ����Q5��B�o��Ǣ��W{_z�l���� 譨�����*w�#[!n��뵡F̰^KX����!��IxAsƯ�1g,�*���t�p�o��F�79F���,���.�Xo��B��H�Ҏ�gؙ���K�͒���>�� 7�W)�<�����~��|�[,J:e�0 ��+�y�?�q�Ct��oHFw��H��!�wB��QC{qTq�5��ȳ�Ftm��5r��ta�i�؏��i��_��Y�����H�!�a{ĪJb��
+�h�4:���8`�P���X�y�0��b3H�-.ַv��ڔ��F<03֥V�����&�M>��}&�'DݩЄgb�OO�
+h�}�t
+ymd�97
+��#�Gr���a���pZ����
+�I�~�\b����z����*qo��m�L�-8��r㛦�]��k����������9��V�˘����|�|�s�6�m�G��{ii��d0�W4�:Y�Y.�"��:Fn<fes�G?촹���u�z����>�F���
+��(8ڈ��\.��r�ZV�٩��XX��[Z��+���?'�K���N6���G��T���
+��)�Y�B%z�}N�;�ʒV���B�'�E�J��Һ$�#���7�� eQ |�O?
+;M΅�����C>�|!�4�\r.���Z��ߘ�W�@:Z� m��Sqt÷�/��Pҏ��ے��YF�/y=!�TU9���fk�#�w��9�p�1�F��&�&DI�q�F��IÏ��q
+~sFmʒ��G���N��(���ݝ��U�%eE^��&��������>���%﮲�J���4����E��G
+8�tkXq��LQ�0���N�v{��vlN@�G��2p��[����5y��k�ꡖk�1
+7jv�廤�ϴT�Bt��lٚ;���V���LDZId��u�����z�{�RV���~���;��+�r��5[�S�TH�o�mJ,;?;�t>S�����t��9#�uv� s�{�]�K�J'�N�w�����2�l3��L�Y6�;���`�%y/�J���h�0kŖS�u���S1�^�Lx�;��y��/x���a5��|�b砦b9ҽc�lӋ�Nٕ��ޱ\��`�r��oŃ��%�N8�o�)��*�[+\9Yh(��6ҽc=�}�J/{G�{��mط����GO�t���"�AO�e5�qa�m�j�m�Л7d�m.�N���T������y�{W%�1���[�#���.��2��h\�O��Rx0�V�H
+���RF��[�2�ی�}<�LW�X}�+���4*�NLc����C��u�<d���͗S��\��:Y����y��z��}&�#����<t.�z�۔W�������w�yp���z�)��3��z��F,WS.4��X�.S.�o:V�˜�x�j>�x�j΅���z�����g�{�8es�F�Ʌ�#MvY-���X�w�C��jA�y�SU>�Dž�eQ���)��p�,F���z�"��@N�����:�ju,���/��_r��.Gz�c��"T���=�\(.��"i��o��>��R�Gi���Xhn5/����4�̀S�*N�A�U���*hi�Ħ�-�ׅ/��N��5����hi�D��%��B�N*�Vu�uy���(_�)!�Y��Z8I��%��DZ8I��$���nZƉu���4�Ӛ�h]�xhi�$'��l���6-
+��i��"'��r�e�Y��6a�s�08�&��l���[�,�N'.j���rh���oGOxw�4Tp�@Cxw�h� �Pg�((7��^c��ۉ�BO'Z}'��R�i���#EM����g4Tp�OCxwyd4Tp�GFCxw�<4T|��5>�9�i���H�j��\�:2�dE���sY�?�n�Br�Z2��֏YHn3`�����$+m"���Jd!������&?�1�j�Z��p�B�����O2[�˱<|ZF��8��O�h������=o,4���`y��eYhn�������xf�������H����Q��)�Ʋ�W�t��l`0�\�9!}g��c̀�i�n�S}��Yk�Ф$`�V���@3�5un�*�tkl5C�H���N�L\ޅ��nē�n��in��"�؛wpLD��h��g��8SZ=��D����5'������6&`=p~ �C��Amݍ��r��F�C���-OhV�t���7y�n'P:
+�Q��%h��p:��ӛ��jc&���5��x�Tn�P4�*�Y�A^H�zJ����wy#=��k�{<����BO~#����ݭk���=���C������/7t�� ���-�0
+�忴#��~u�y��ؾ����
+����y`���C<M(J8��3�QlB�Ӵtu�ȌyV��NWvcŶ����@�jd�����&�����ƷV6c#Y��#��H��d]SeK���DhS�����Hn|_�E�P�������'�^��/�����PKM 3G{)@uPK�~<(�:K/.pollen.argoPK�~<�-��qB:hpollen_Modèle.pgmlPK�~<FƱ��Spollen_Services.pgmlPK�~<�'�qoPAk pollen_Context.pgmlPK�~<P����K(pollen.todoPK�~<7Rp:B8)pollen_profile.profilePK�~<M 3G{)@u
+�)pollen.xmiPK�iS
\ No newline at end of file
Modified: trunk/pollen-business/src/test/java/org/chorem/pollen/business/TestManager.java
===================================================================
--- trunk/pollen-business/src/test/java/org/chorem/pollen/business/TestManager.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/TestManager.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -10,6 +10,8 @@
import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.pollen.service.ServiceUser;
+import org.chorem.pollen.service.ServiceUserImpl;
import org.junit.Ignore;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
@@ -72,4 +74,10 @@
return getContext().beginTransaction();
}
+ public static ServiceUser newServiceUser() {
+ ServiceUserImpl instance = new ServiceUserImpl();
+ instance.setContext(getContext());
+ return instance;
+ }
+
}
Added: trunk/pollen-business/src/test/java/org/chorem/pollen/service/ServiceUserImplTest.java
===================================================================
--- trunk/pollen-business/src/test/java/org/chorem/pollen/service/ServiceUserImplTest.java (rev 0)
+++ trunk/pollen-business/src/test/java/org/chorem/pollen/service/ServiceUserImplTest.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -0,0 +1,184 @@
+
+package org.chorem.pollen.service;
+
+import java.io.IOException;
+import java.util.Locale;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.pollen.PollenBusinessException;
+import org.chorem.pollen.PollenBusinessException.PollenExceptionType;
+import org.chorem.pollen.business.TestManager;
+import org.chorem.pollen.entity.UserAccount;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ * @author fdesbois
+ */
+public class ServiceUserImplTest {
+
+ private static final Log log = LogFactory.getLog(ServiceUserImplTest.class);
+
+ public ServiceUserImplTest() {
+ }
+
+ @BeforeClass
+ public static void setUpClass() throws Exception {
+ }
+
+ @AfterClass
+ public static void tearDownClass() throws Exception {
+ }
+
+ @Before
+ public void setUp() {
+ }
+
+ @After
+ public void tearDown() throws IOException {
+ TestManager.stop();
+ }
+
+ /**
+ * Test of executeConnect method, of class ServiceUserImpl.
+ */
+ //@Test
+ public void testExecuteConnect() throws Exception {
+ TestManager.start("testExecuteConnect");
+ }
+
+ /**
+ * Test of executeGetNewUser method, of class ServiceUserImpl.
+ */
+ @Test
+ public void testExecuteGetNewUser() throws Exception {
+ TestManager.start("testGetNewUser");
+ ServiceUser serviceUser = TestManager.newServiceUser();
+
+ UserAccount user = serviceUser.getNewUser(Locale.FRENCH);
+ Assert.assertNotNull(user);
+ Assert.assertEquals(false, user.getAdmin());
+ Assert.assertEquals("fr", user.getLanguage());
+ Assert.assertEquals(Locale.FRENCH, new Locale(user.getLanguage()));
+ }
+
+ /**
+ * Test of executeCreateUpdateUser method, of class ServiceUserImpl.
+ */
+ @Test
+ public void testExecuteCreateUpdateUser() throws Exception {
+ TestManager.start("testCreateUpdateUser");
+ ServiceUser serviceUser = TestManager.newServiceUser();
+
+ UserAccount user = serviceUser.getNewUser(Locale.FRENCH);
+ user.setLogin("hsimpson");
+ user.setEmail("hsimpson(a)springfield.us");
+ String encodedPassword =
+ TestManager.getContext().encodePassword("wouhou");
+ user.setPassword(encodedPassword);
+
+ serviceUser.createUpdateUser(user);
+ Assert.assertNotNull(user.getTopiaId());
+ Assert.assertNotSame("wouhou", user.getPassword());
+
+ // User 2 with same login
+ UserAccount user2 = serviceUser.getNewUser(Locale.FRENCH);
+ user2.setLogin("hsimpson");
+ // Not the same email
+ user2.setEmail("hsimpson(a)springfield.com");
+ user2.setPassword("troubidou");
+
+ try {
+ serviceUser.createUpdateUser(user2);
+ } catch (PollenBusinessException eee) {
+ log.error("Error : " + eee.getMessage(), eee);
+ Assert.assertEquals(PollenExceptionType.USER_LOGIN_EXIST,
+ eee.getType());
+ }
+
+ // User 3 with same email as user
+ UserAccount user3 = serviceUser.getNewUser(Locale.FRENCH);
+ user3.setLogin("homer");
+ user3.setEmail("hsimpson(a)springfield.us");
+ user3.setPassword("troubidou");
+
+ try {
+ serviceUser.createUpdateUser(user3);
+ } catch (PollenBusinessException eee) {
+ log.error("Error : " + eee.getMessage(), eee);
+ Assert.assertEquals(PollenExceptionType.USER_EMAIL_EXIST,
+ eee.getType());
+ }
+
+ }
+
+ /**
+ * Test of executeDeleteUser method, of class ServiceUserImpl.
+ */
+ //@Test
+ public void testExecuteDeleteUser() throws Exception {
+ System.out.println("executeDeleteUser");
+ }
+
+ /**
+ * Test of executeGetUsers method, of class ServiceUserImpl.
+ */
+ //@Test
+ public void testExecuteGetUsers() throws Exception {
+ System.out.println("executeGetUsers");
+ }
+
+ /**
+ * Test of executeGetNewList method, of class ServiceUserImpl.
+ */
+ //@Test
+ public void testExecuteGetNewList() throws Exception {
+ System.out.println("executeGetNewList");
+ }
+
+ /**
+ * Test of executeCreateUpdateList method, of class ServiceUserImpl.
+ */
+ //@Test
+ public void testExecuteCreateUpdateList() throws Exception {
+ System.out.println("executeCreateUpdateList");
+ }
+
+ /**
+ * Test of executeDeleteList method, of class ServiceUserImpl.
+ */
+ //@Test
+ public void testExecuteDeleteList() throws Exception {
+ System.out.println("executeDeleteList");
+ }
+
+ /**
+ * Test of executeGetFavoriteLists method, of class ServiceUserImpl.
+ */
+ //@Test
+ public void testExecuteGetFavoriteLists() throws Exception {
+ System.out.println("executeGetFavoriteLists");
+ }
+
+ /**
+ * Test of executeGetNewPerson method, of class ServiceUserImpl.
+ */
+ //@Test
+ public void testExecuteGetNewPerson() throws Exception {
+ System.out.println("executeGetNewPerson");
+ }
+
+ /**
+ * Test of executeGetPerson method, of class ServiceUserImpl.
+ */
+ //@Test
+ public void testExecuteGetPerson() throws Exception {
+ System.out.println("executeGetPerson");
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/pollen-business/src/test/java/org/chorem/pollen/service/ServiceUserImplTest.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Border.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Border.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Border.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -13,7 +13,6 @@
*
* 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.ui.components;
import java.io.File;
@@ -25,8 +24,8 @@
import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.annotations.Component;
-import org.apache.tapestry5.annotations.IncludeStylesheet;
import org.apache.tapestry5.annotations.InjectComponent;
+import org.apache.tapestry5.annotations.Log;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SessionState;
@@ -39,37 +38,45 @@
import org.chorem.pollen.entity.UserAccount;
import org.chorem.pollen.ui.base.ContextLink;
import org.chorem.pollen.ui.data.AddressBarItem;
-import org.chorem.pollen.MD5;
import org.chorem.pollen.PollenBusinessException;
import org.chorem.pollen.service.ServiceUser;
+import org.chorem.pollen.ui.data.AddressBar;
+import org.chorem.pollen.ui.pages.Index;
+import org.chorem.pollen.ui.utils.BusinessUtils;
+import org.slf4j.Logger;
/**
* Classe du Layout Component Border.
*
* @author kmorin
* @author rannou
+ * @author fdesbois
* @version $Id$
*/
-@IncludeStylesheet("context:css/main.css")
public class Border {
- /** Affichage des messages pour l'utilisateur */
- @Component(id = "borderFeedback")
- private FeedBack feedback;
+ @Inject
+ private Logger logger;
- @InjectComponent
- private FeedBack errorJs;
/**
- * Objet de session (SSO) représentant l'adresse du site.
+ * Chaine définissant le style de la page
*/
- @SuppressWarnings("unused")
- @SessionState
- private String siteURL;
+ @Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
+ @Property
+ private String pageLogo;
+ @Parameter(defaultPrefix = BindingConstants.LITERAL, value = "body")
+ @Property
+ private String pageBodyId;
+
+ /** Title of the page **/
+ @Parameter(defaultPrefix = BindingConstants.LITERAL)
+ @Property
+ private String pageTitle;
+
/**
* Adresse du fil de syndication
*/
- @SuppressWarnings("unused")
@Parameter(required = false, defaultPrefix = BindingConstants.LITERAL)
@Property
private String feedFilename;
@@ -77,42 +84,36 @@
/**
* Hierarchie de l'adresse
*/
- @SuppressWarnings("unused")
- @Parameter(required = false)
+ @Parameter(required = true)
@Property
- private AddressBarItem[] address;
+ private AddressBar addressBar;
/**
- * Chaine définissant le style de la page
+ * Lien pour l'itération
*/
- @Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
@Property
- private String pageLogo;
+ private AddressBarItem item;
- @Parameter(defaultPrefix = BindingConstants.LITERAL, value = "body")
- @Property
- private String pageBodyId;
+ /** Affichage des messages pour l'utilisateur */
+ @Component(id = "borderFeedback")
+ private FeedBack feedback;
- /** Title of the page **/
- @Parameter(defaultPrefix = BindingConstants.LITERAL)
- @Property
- private String pageTitle;
+ @InjectComponent
+ private FeedBack errorJs;
/**
+ * Objet de session (SSO) représentant l'adresse du site.
+ */
+ @SessionState
+ private String siteURL;
+
+ /**
* Chaine definissant le logo de la page
*/
- @SuppressWarnings("unused")
@Property
private String logo;
/**
- * Lien pour l'itération
- */
- @SuppressWarnings("unused")
- @Property
- private AddressBarItem lien;
-
- /**
* Champ login du formulaire d'identification
*/
@Property
@@ -138,11 +139,6 @@
@Property
private boolean userExists;
- /** Format des dates */
- @SuppressWarnings("unused")
- @Property
- private DateFormat dateFormat;
-
/** Locale courante */
@Inject
private Locale currentLocale;
@@ -153,59 +149,115 @@
@Inject
private PersistentLocale localeService;
+ @Inject
+ private PollenContext pollen;
+
+ /** Injection des services */
+ @Inject
+ private ServiceUser serviceUser;
+
/**
* Accès à la requête
*/
@Inject
private Request request;
- @Inject
- private PollenContext pollen;
-
/**
* Accès aux messages
*/
@Inject
private Messages messages;
- /** Injection des services */
- @Inject
- private ServiceUser serviceUser;
-
@InjectComponent
private ContextLink feedContext;
+ private boolean fatal;
+
+ /**
+ * Initialisation de l'affichage
+ */
+ void setupRender() {
+
+ // URL du site
+ siteURL = "http://" + request.getHeader("host") +
+ request.getContextPath() + "/";
+
+ errorJs.addError(messages.get("errorJs"));
+
+ // Logo
+ if (Locale.FRENCH.equals(currentLocale)) {
+ logo = "pollen" + pageLogo + "_fr.png";
+ } else {
+ logo = "pollen" + pageLogo + "_en.png";
+ }
+ }
+
+ boolean afterRender() {
+ // Check if fatal errors has been added to the border
+ // Reload the page if feedBack hasn't been reloaded yet to display
+ // errors
+ if (fatal && feedback.hasErrors() && !feedback.hasBeeanReloaded()) {
+ if (logger.isInfoEnabled()) {
+ logger.info("[ FATAL ] Reload the page to display errors");
+ }
+ feedback.reload();
+ return false;
+ }
+ // Clear errors after page render
+ feedback.clearErrors();
+ fatal = false;
+ return true;
+ }
+
+ public void addInfo(String message) {
+ feedback.addInfo(message);
+ }
+
+ public void addError(String message) {
+ feedback.addError(message);
+ }
+
+ public void addFatal(String message) {
+ feedback.addError(message);
+ fatal = true;
+ }
+
+ public boolean canDisplayBody() {
+ return !fatal;
+ }
+
+ public DateFormat getDateFormat() {
+ return DateFormat.getDateTimeInstance(DateFormat.SHORT,
+ DateFormat.SHORT, currentLocale);
+ }
+
public ContextLink getFeedContext() {
return feedContext;
}
- public FeedBack getFeedBack() {
- return feedback;
- }
-
/**
- * Methode appelée lorsque l'utilisateur s'identifie. L'utilisateur est
- * retrouvé grâce au service d'authentification.
+ * User connection. Call business to check user existence.
*
- * @return la zone à mettre à jour
+ * @return the page with errors or not
*/
- Object onSuccessFromLoginCompForm() {
- // Récupération de l'utilisateur identifié
- UserAccount current;
- try {
- current = serviceUser.connect(login, MD5.encode(password));
- if (current != null) {
+ @Log
+ Object onSuccessFromConnection() {
+ // No need to connect if user exists
+ if (!userExists) {
+ try {
+ String encodedPassword = pollen.encodePassword(password);
+ UserAccount current =
+ serviceUser.connect(login, encodedPassword);
user = current;
feedback.addInfo(messages.get("loginOk"));
- } else {
- feedback.addError(messages.get("loginFailed"));
+ } catch (PollenBusinessException eee) {
+ feedback.addError(
+ BusinessUtils.getErrorMessage(eee, messages, logger));
}
- } catch (PollenBusinessException ex) {
- // TODO
- feedback.addError(messages.get("loginFailed"));
}
return this;
}
+
/**
* Methode appelée lorsque l'utilisateur se déconnecte. L'objet user est
* désinstancié (=null).
@@ -214,7 +266,7 @@
*/
Object onActionFromLogout() {
user = null;
- return "Index";
+ return Index.class;
}
/**
@@ -243,8 +295,8 @@
* Version de l'application.
* @return current application version
*/
- public String getVersion() {
- return pollen.getProperty(PollenProperty.APP_VERSION);
+ public String getVersion() {
+ return PollenProperty.APP_VERSION.getValue();
}
public int getCurrentYear() {
@@ -252,49 +304,20 @@
return current.get(Calendar.YEAR);
}
- public String getContactEmail() {
- return pollen.getProperty(PollenProperty.CONTACT_EMAIL);
+ public String getContactEmail() {
+ return PollenProperty.CONTACT_EMAIL.getValue();
}
/**
- * Retourne si l'utilisateur a renseigné un nom ou un prénom.
- */
- public boolean isUserNamed() {
- return (user.getFirstName() != null) || (user.getLastName() != null);
- }
-
- /**
* Vérifie que le fichier de flux de syndication existe.
*
* @return vrai si le fichier existe
- * @
*/
- public boolean isFeedFileExisting() {
+ public boolean isFeedFileExisting() {
if (feedFilename == null) {
return false;
}
File feedFile = feedContext.getFile(feedFilename);
return feedFile.exists() ? true : false;
}
-
- /**
- * Initialisation de l'affichage
- */
- void setupRender() {
- dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT,
- DateFormat.SHORT, currentLocale);
-
- // URL du site
- siteURL = "http://" + request.getHeader("host")
- + request.getContextPath() + "/";
-
- errorJs.addError(messages.get("errorJs"));
-
- // Logo
- if (Locale.FRENCH.equals(currentLocale)) {
- logo = "pollen" + pageLogo + "_fr.png";
- } else {
- logo = "pollen" + pageLogo + "_en.png";
- }
- }
}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FeedBack.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FeedBack.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FeedBack.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -1,26 +1,32 @@
-/* *##% Pollen
- * Copyright (C) 2009 CodeLutin
+/* *##%
+ * Pollen :: Pollen Web Interface
+ * Copyright (C) 2009 - 2010 Code Lutin
*
* 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.
+ * 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.
+ * GNU General Lesser 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/>. ##%*/
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * ##%*/
package org.chorem.pollen.ui.components;
import java.util.ArrayList;
import java.util.List;
+import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.MarkupWriter;
+import org.apache.tapestry5.annotations.Log;
+import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.ioc.annotations.Inject;
/**
@@ -46,15 +52,22 @@
*/
public class FeedBack {
+ @Parameter(defaultPrefix = BindingConstants.LITERAL, value= "true")
+ private boolean autoClear;
+
/** Messages d'erreur */
private List<String> errorMessages;
/** Messages d'info */
private List<String> infoMessages;
+ private boolean errors;
+
@Inject
- private ComponentResources _resources;
+ private ComponentResources resources;
+ private boolean reload;
+
public FeedBack() {
errorMessages = new ArrayList<String>();
infoMessages = new ArrayList<String>();
@@ -64,6 +77,7 @@
// Rendu des messages d'erreur et vidage de la collection
if (!errorMessages.isEmpty()) {
+ errors = true;
writer.element("div", "class", "fb-error");
for (String message : errorMessages) {
writer.write(message);
@@ -72,7 +86,9 @@
}
writer.end();
}
- errorMessages.clear();
+ if (autoClear) {
+ errorMessages.clear();
+ }
// Rendu des messages d'info et vidage de la collection
if (!infoMessages.isEmpty()) {
@@ -86,7 +102,7 @@
}
infoMessages.clear();
- _resources.renderInformalParameters(writer);
+ resources.renderInformalParameters(writer);
}
void afterRender(MarkupWriter writer) {
@@ -115,7 +131,21 @@
}
}
- public boolean getHasErrors() {
- return !errorMessages.isEmpty();
+ public boolean hasErrors() {
+ return errors;
}
-}
\ No newline at end of file
+
+ @Log
+ public void reload() {
+ reload = true;
+ }
+
+ public boolean hasBeeanReloaded() {
+ return reload;
+ }
+
+ public void clearErrors() {
+ errorMessages.clear();
+ reload = false;
+ }
+}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/AddressBar.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/AddressBar.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/AddressBar.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -19,10 +19,29 @@
public List<AddressBarItem> items;
- public AddressBar() {
- appendHome();
+ private AddressBar() {
}
+ /**
+ * Create an empty bar with no items.
+ *
+ * @return a new AddressBar
+ */
+ public static AddressBar newEmptyBar() {
+ return new AddressBar();
+ }
+
+ /**
+ * Create a bar with the home item.
+ *
+ * @return a new AddresBar with home item
+ */
+ public static AddressBar newBar() {
+ AddressBar result = new AddressBar();
+ result.appendHome();
+ return result;
+ }
+
protected List<AddressBarItem> getListItems() {
if (items == null) {
items = new ArrayList<AddressBarItem>();
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/EvenOdd.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/EvenOdd.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/EvenOdd.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -49,6 +49,7 @@
/**
* Modifie la valeur de even.
+ * @param value
*/
public void setEven(boolean value) {
even = value;
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/ErrorPage.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/ErrorPage.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/ErrorPage.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -23,11 +23,11 @@
private Border border;
public void addError(String message) {
- border.getFeedBack().addError(message);
+ border.addError(message);
}
public AddressBarItem[] getAddress() {
- return new AddressBar().getItems();
+ return AddressBar.newBar().getItems();
}
}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/Index.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/Index.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/Index.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -17,6 +17,7 @@
package org.chorem.pollen.ui.pages;
import org.apache.tapestry5.annotations.Property;
+import org.chorem.pollen.ui.data.AddressBar;
import org.chorem.pollen.ui.data.AddressBarItem;
/**
@@ -24,11 +25,12 @@
*
* @author kmorin
* @author rannou
+ * @author fdesbois <fdesbois(a)codelutin.com>
* @version $Id$
*/
public class Index {
- @SuppressWarnings("unused")
- @Property
- private AddressBarItem[] address = new AddressBarItem[] { new AddressBarItem("Pollen", null) };
+ public AddressBar getAddressBar() {
+ return AddressBar.newEmptyBar().appendCurrent("Pollen");
+ }
}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/admin/UsersAdmin.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/admin/UsersAdmin.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/admin/UsersAdmin.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -127,7 +127,7 @@
*/
public Object onSuccessFromUsersForm() {
for (UserAccount usr : accounts) {
- serviceUser.createUpdateUser(usr);
+// serviceUser.createUpdateUser(usr);
// FIXME : test and refactor to manage errors
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -159,9 +159,10 @@
* AddressBar for border component.
*
* @return the address bar.
+ * @throws PollenBusinessException
*/
public AddressBar getAddressBar() throws PollenBusinessException {
- return new AddressBar().appendCurrent(getPageTitle());
+ return AddressBar.newBar().appendCurrent(getPageTitle());
}
public void setPollCopyFromPoll(Poll poll) {
@@ -346,11 +347,12 @@
* Condition to enable or not the notification option.
*
* @return true if the mail is not defined
+ * @throws PollenBusinessException
*/
-// public boolean isNotificationDisabled() {
-// // no email defined
-// return StringUtils.isEmpty(getPoll().getCreatorEmail());
-// }
+ public boolean isNotificationDisabled() throws PollenBusinessException {
+ // no email defined
+ return StringUtils.isEmpty(getPoll().getCreator().getEmail());
+ }
//~~~~~~~~ OPTION REMINDER ~~~~~~~~~~~~~~~~//
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -186,7 +186,7 @@
//countPoll();
for (Result result : results) {
String name = result.getChoice().getName();
- String value = String.valueOf(result.getValue());
+ String value = String.valueOf(result.getResultValue());
if (poll.getChoiceType() == ChoiceType.DATE) { // mise en forme de la date
Date date = new Date(Long.parseLong(name));
@@ -209,8 +209,8 @@
Collections.sort(ranking, new Comparator<Result>() {
@Override
public int compare(Result o1, Result o2) {
- double result1 = o1.getValue();
- double result2 = o2.getValue();
+ double result1 = o1.getResultValue();
+ double result2 = o2.getResultValue();
int comp = 0; // résultat de la comparaison
if (result1 > result2) {
@@ -236,13 +236,13 @@
double winValue = 0.;
if (ranking.size() > 0) {
- winValue = ranking.get(0).getValue();
+ winValue = ranking.get(0).getResultValue();
} else {
return winners;
}
for (Result r : ranking) {
- if (winValue == r.getValue()) {
+ if (winValue == r.getResultValue()) {
winners.add(r);
}
}
@@ -337,7 +337,7 @@
// FIXME : carefull with Locale !!
- return NumberFormat.getNumberInstance().format(result.getValue());
+ return NumberFormat.getNumberInstance().format(result.getResultValue());
}
/** Retourne la date correspondant au résultat courant */
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -1036,7 +1036,7 @@
* @return the address bar of the page.
*/
public AddressBar getAddress() {
- return new AddressBar().appendCurrent(title);
+ return AddressBar.newBar().appendCurrent(title);
}
/**
Deleted: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/Account.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/Account.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/Account.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -1,189 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.ui.pages.user;
-
-import org.apache.tapestry5.BindingConstants;
-import org.apache.tapestry5.annotations.Component;
-import org.apache.tapestry5.annotations.IncludeStylesheet;
-import org.apache.tapestry5.annotations.Parameter;
-import org.apache.tapestry5.annotations.Persist;
-import org.apache.tapestry5.annotations.Property;
-import org.apache.tapestry5.annotations.SessionState;
-import org.apache.tapestry5.corelib.components.Form;
-import org.apache.tapestry5.corelib.components.PasswordField;
-import org.apache.tapestry5.corelib.components.TextField;
-import org.apache.tapestry5.corelib.components.Zone;
-import org.apache.tapestry5.ioc.Messages;
-import org.apache.tapestry5.ioc.annotations.Inject;
-import org.chorem.pollen.MD5;
-import org.chorem.pollen.entity.UserAccount;
-import org.chorem.pollen.service.ServiceUser;
-import org.chorem.pollen.ui.data.AddressBarItem;
-
-/**
- * Classe de la page d'un utilisateur.
- *
- * @author kmorin
- * @author rannou
- * @version $Id$
- */
-@IncludeStylesheet("context:css/account.css")
-public class Account {
-
- /**
- * Objet de session représentant l'utilisateur identifié.
- */
- @SessionState
- @Property
- private UserAccount user;
- @Property
- private boolean userExists;
-
- /**
- * Utilisateur dont les données sont affichées et modifiées dans le
- * formulaire
- */
- @Property
- @Persist
- private UserAccount newUser;
-
- /** Ancien mot de passe */
- @Persist
- private String oldEmail;
-
- @Component
- private Zone myAccountZone;
-
- @Component
- private Form myAccountForm;
-
- @Component(id = "password")
- private PasswordField passwordField;
-
- @Component(id = "newPassword1")
- private PasswordField newPasswordField;
-
- @Component(id = "email")
- private TextField emailField;
-
- /**
- * Champ password du formulaire d'enregsitrement d'un utilisateur
- */
- @Property
- private String password;
-
- /**
- * Champ password1 du formulaire d'enregsitrement d'un utilisateur
- */
- @Property
- private String newPassword1;
- /**
- * Champ password2 du formulaire d'enregsitrement d'un utilisateur
- */
- @Property
- private String newPassword2;
-
- @Inject
- private Messages messages;
-
- @Parameter(defaultPrefix = BindingConstants.MESSAGE, value = "title")
- @Property
- private String title;
-
- @SuppressWarnings("unused")
- @Property
- private AddressBarItem[] address;
-
- /**
- * Vrai lorsque l'utilisateur modifie son compte.
- */
- @SuppressWarnings("unused")
- @Property
- private boolean modify = false;
-
- /** Injection des services */
- @Inject
- private ServiceUser serviceUser;
-// @Inject
-// private ServiceAuth serviceAuth;
-
- /**
- * Méthode appelée quand l'utilisateur modifie ses données
- *
- * @return la zone de compte mise à jour
- */
- Object onSuccessFromMyAccountForm() {
- modify = true;
-//
-// // L'utilisateur a renseigné le mauvais mot de passe
-// if (!serviceAuth.isLoginRight(newUser.getLogin(), MD5.encode(password))) {
-// myAccountForm.recordError(passwordField, messages
-// .get("badPassword"));
-// }
-//
-// // L'utilisateur ne s'est pas trompé en répétant son mot de passe
-// if (newPassword1 != null && !newPassword1.equals("")) {
-// if (!newPassword1.equals(newPassword2)) {
-// myAccountForm.recordError(newPasswordField, messages
-// .get("passwords-dont-match"));
-// }
-// }
-//
-// // L'email existe déjà
-// if (!oldEmail.equals(newUser.getEmail())) {
-// if (serviceUser.isUserEmailExisting(newUser.getEmail())) {
-// myAccountForm.recordError(emailField, messages
-// .get("emailAlreadyExists"));
-// }
-// }
-//
-// // Modification de l'utilisateur
-// if (!myAccountForm.getHasErrors()) {
-// if (serviceUser.updateUser(newUser)) {
-// if (newPassword1 != null && !newPassword1.equals("")) {
-// serviceUser.updatePasswordUser(newUser, MD5
-// .encode(newPassword1));
-// }
-// modify = false;
-// }
-// }
-
- return myAccountZone.getBody();
- }
-
- /**
- * Méthode appelée quand l'utilisateur veut modifier son compte
- *
- * @return le formulaire de modification du compte
- */
- Object onActionFromModifyButton() {
- modify = true;
- return myAccountZone.getBody();
- }
-
- /**
- * Initialisation de l'affichage
- */
- void setupRender() {
- address = new AddressBarItem[] { new AddressBarItem("Pollen", "Index"),
- new AddressBarItem(title, null) };
- if (userExists) {
- newUser = user;
- oldEmail = user.getEmail();
- }
- }
-}
Deleted: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/Register.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/Register.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/Register.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -1,180 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.ui.pages.user;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tapestry5.BindingConstants;
-import org.apache.tapestry5.annotations.Component;
-import org.apache.tapestry5.annotations.IncludeStylesheet;
-import org.apache.tapestry5.annotations.Parameter;
-import org.apache.tapestry5.annotations.Property;
-import org.apache.tapestry5.annotations.SessionState;
-import org.apache.tapestry5.corelib.components.Form;
-import org.apache.tapestry5.corelib.components.PasswordField;
-import org.apache.tapestry5.corelib.components.TextField;
-import org.apache.tapestry5.ioc.Messages;
-import org.apache.tapestry5.ioc.annotations.Inject;
-import org.chorem.pollen.MD5;
-import org.chorem.pollen.PollenContext;
-import org.chorem.pollen.PollenProperty;
-import org.chorem.pollen.entity.UserAccount;
-import org.chorem.pollen.mail.PreventRuleManager;
-import org.chorem.pollen.service.ServiceUser;
-import org.chorem.pollen.ui.data.AddressBarItem;
-
-/**
- * Classe de la page d'enregistrement d'un utilisateur.
- *
- * @author kmorin
- * @author rannou
- * @version $Id$
- */
-@IncludeStylesheet("context:css/register.css")
-public class Register {
-
- /**
- * Objet de session représentant l'url du site.
- */
- @SessionState
- private String siteURL;
-
- /**
- * Objet de session représentant l'utilisateur identifié.
- */
- @SuppressWarnings("unused")
- @SessionState
- private UserAccount user;
- @SuppressWarnings("unused")
- @Property
- private boolean userExists;
-
- /**
- * Utilisateur créé via le formulaire
- */
- @Property
- private UserAccount newUser;
-
- @Component
- private Form registerForm;
-
- @Component(id = "login")
- private TextField loginField;
-
- @Component(id = "email")
- private TextField emailField;
-
- @Component(id = "password1")
- private PasswordField passwordField;
-
- /**
- * Champ password1 du formulaire d'enregsitrement d'un utilisateur
- */
- @Property
- private String password1;
- /**
- * Champ password2 du formulaire d'enregsitrement d'un utilisateur
- */
- @Property
- private String password2;
-
- @Inject
- private Messages messages;
-
- @Parameter(defaultPrefix = BindingConstants.MESSAGE, value = "title")
- @Property
- private String title;
-
- @SuppressWarnings("unused")
- @Property
- private AddressBarItem[] address;
-
- /** Injection des services */
- @Inject
- private ServiceUser serviceUser;
-// @Inject
-// private ServiceAuth serviceAuth;
-
- /**
- * Méthode appelée quand l'utilisateur s'enregistre
- *
- * @return la page d'accueil
- */
- Object onSuccessFromRegisterForm() {
-
- // L'utilisateur s'est pas trompé en répétant son mot de passe
- if (!password1.equals(password2)) {
- password1 = null;
- registerForm.recordError(passwordField, messages
- .get("passwords-dont-match"));
- }
-
- // Le login existe déjà
-// if (serviceUser.isUserLoginExisting(newUser.getLogin())) {
-// registerForm.recordError(loginField, messages
-// .get("loginAlreadyExists"));
-// }
-//
-// // L'email existe déjà
-// if (serviceUser.isUserEmailExisting(newUser.getEmail())) {
-// registerForm.recordError(emailField, messages
-// .get("emailAlreadyExists"));
-// }
-//
-// // Création de l'utilisateur, envoi d'un email de notification et connexion
-// if (!registerForm.getHasErrors()) {
-// if (serviceUser.createUser(newUser, MD5.encode(password1)) != null) {
-// sendMailNotification();
-// user = serviceAuth.getUser(newUser.getLogin(), MD5
-// .encode(password1));
-// return "Index";
-// }
-// }
-
- return this;
- }
-
- @Inject
- private PollenContext pollen;
-
- /** Envoi du mail de notification */
- private void sendMailNotification() {
- Map<String, String> data = new HashMap<String, String>();
- data.put("host", pollen.getProperty(PollenProperty.EMAIL_HOST));
- data.put("port", pollen.getProperty(PollenProperty.EMAIL_PORT));
- data.put("from", pollen.getProperty(PollenProperty.EMAIL_FROM));
- data.put("to", newUser.getEmail());
- data.put("title", messages.format("registerEmail_subject", newUser
- .getLogin()));
- data.put("msg", messages.format("registerEmail_msg", newUser
- .getFirstName(), newUser.getLastName(), newUser.getLogin(),
- password1, siteURL));
-
- // FIXME call directly MailUtil.sendMail()
- // skip fill map, get from map...
- PreventRuleManager.emailAction(data);
- }
-
- /**
- * Initialisation de l'affichage
- */
- void setupRender() {
- address = new AddressBarItem[] { new AddressBarItem("Pollen", "Index"),
- new AddressBarItem(title, null) };
- }
-}
Copied: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserProfile.java (from rev 2958, trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/Account.java)
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserProfile.java (rev 0)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserProfile.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -0,0 +1,189 @@
+/* *##% Pollen
+ * Copyright (C) 2009 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.ui.pages.user;
+
+import org.apache.tapestry5.BindingConstants;
+import org.apache.tapestry5.annotations.Component;
+import org.apache.tapestry5.annotations.IncludeStylesheet;
+import org.apache.tapestry5.annotations.Parameter;
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.annotations.SessionState;
+import org.apache.tapestry5.corelib.components.Form;
+import org.apache.tapestry5.corelib.components.PasswordField;
+import org.apache.tapestry5.corelib.components.TextField;
+import org.apache.tapestry5.corelib.components.Zone;
+import org.apache.tapestry5.ioc.Messages;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.chorem.pollen.MD5;
+import org.chorem.pollen.entity.UserAccount;
+import org.chorem.pollen.service.ServiceUser;
+import org.chorem.pollen.ui.data.AddressBarItem;
+
+/**
+ * Classe de la page d'un utilisateur.
+ *
+ * @author kmorin
+ * @author rannou
+ * @version $Id$
+ */
+@IncludeStylesheet("context:css/account.css")
+public class UserProfile {
+
+ /**
+ * Objet de session représentant l'utilisateur identifié.
+ */
+ @SessionState
+ @Property
+ private UserAccount user;
+ @Property
+ private boolean userExists;
+
+ /**
+ * Utilisateur dont les données sont affichées et modifiées dans le
+ * formulaire
+ */
+ @Property
+ @Persist
+ private UserAccount newUser;
+
+ /** Ancien mot de passe */
+ @Persist
+ private String oldEmail;
+
+ @Component
+ private Zone myAccountZone;
+
+ @Component
+ private Form myAccountForm;
+
+ @Component(id = "password")
+ private PasswordField passwordField;
+
+ @Component(id = "newPassword1")
+ private PasswordField newPasswordField;
+
+ @Component(id = "email")
+ private TextField emailField;
+
+ /**
+ * Champ password du formulaire d'enregsitrement d'un utilisateur
+ */
+ @Property
+ private String password;
+
+ /**
+ * Champ password1 du formulaire d'enregsitrement d'un utilisateur
+ */
+ @Property
+ private String newPassword1;
+ /**
+ * Champ password2 du formulaire d'enregsitrement d'un utilisateur
+ */
+ @Property
+ private String newPassword2;
+
+ @Inject
+ private Messages messages;
+
+ @Parameter(defaultPrefix = BindingConstants.MESSAGE, value = "title")
+ @Property
+ private String title;
+
+ @SuppressWarnings("unused")
+ @Property
+ private AddressBarItem[] address;
+
+ /**
+ * Vrai lorsque l'utilisateur modifie son compte.
+ */
+ @SuppressWarnings("unused")
+ @Property
+ private boolean modify = false;
+
+ /** Injection des services */
+ @Inject
+ private ServiceUser serviceUser;
+// @Inject
+// private ServiceAuth serviceAuth;
+
+ /**
+ * Méthode appelée quand l'utilisateur modifie ses données
+ *
+ * @return la zone de compte mise à jour
+ */
+ Object onSuccessFromMyAccountForm() {
+ modify = true;
+//
+// // L'utilisateur a renseigné le mauvais mot de passe
+// if (!serviceAuth.isLoginRight(newUser.getLogin(), MD5.encode(password))) {
+// myAccountForm.recordError(passwordField, messages
+// .get("badPassword"));
+// }
+//
+// // L'utilisateur ne s'est pas trompé en répétant son mot de passe
+// if (newPassword1 != null && !newPassword1.equals("")) {
+// if (!newPassword1.equals(newPassword2)) {
+// myAccountForm.recordError(newPasswordField, messages
+// .get("passwords-dont-match"));
+// }
+// }
+//
+// // L'email existe déjà
+// if (!oldEmail.equals(newUser.getEmail())) {
+// if (serviceUser.isUserEmailExisting(newUser.getEmail())) {
+// myAccountForm.recordError(emailField, messages
+// .get("emailAlreadyExists"));
+// }
+// }
+//
+// // Modification de l'utilisateur
+// if (!myAccountForm.getHasErrors()) {
+// if (serviceUser.updateUser(newUser)) {
+// if (newPassword1 != null && !newPassword1.equals("")) {
+// serviceUser.updatePasswordUser(newUser, MD5
+// .encode(newPassword1));
+// }
+// modify = false;
+// }
+// }
+
+ return myAccountZone.getBody();
+ }
+
+ /**
+ * Méthode appelée quand l'utilisateur veut modifier son compte
+ *
+ * @return le formulaire de modification du compte
+ */
+ Object onActionFromModifyButton() {
+ modify = true;
+ return myAccountZone.getBody();
+ }
+
+ /**
+ * Initialisation de l'affichage
+ */
+ void setupRender() {
+ address = new AddressBarItem[] { new AddressBarItem("Pollen", "Index"),
+ new AddressBarItem(title, null) };
+ if (userExists) {
+ newUser = user;
+ oldEmail = user.getEmail();
+ }
+ }
+}
Property changes on: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserProfile.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Rev Revision"
Added: svn:mergeinfo
+
Copied: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserRegister.java (from rev 2958, trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/Register.java)
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserRegister.java (rev 0)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserRegister.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -0,0 +1,204 @@
+/* *##% Pollen
+ * Copyright (C) 2009 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.ui.pages.user;
+
+
+import java.util.Locale;
+import org.apache.tapestry5.BindingConstants;
+import org.apache.tapestry5.Field;
+import org.apache.tapestry5.annotations.Component;
+import org.apache.tapestry5.annotations.IncludeStylesheet;
+import org.apache.tapestry5.annotations.InjectComponent;
+import org.apache.tapestry5.annotations.Log;
+import org.apache.tapestry5.annotations.Parameter;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.annotations.SessionState;
+import org.apache.tapestry5.corelib.components.Form;
+import org.apache.tapestry5.corelib.components.PasswordField;
+import org.apache.tapestry5.corelib.components.TextField;
+import org.apache.tapestry5.ioc.Messages;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.chorem.pollen.PollenBusinessException;
+import org.chorem.pollen.PollenContext;
+import org.chorem.pollen.bean.PollenEmailImpl;
+import org.chorem.pollen.entity.UserAccount;
+import org.chorem.pollen.service.ServiceEmail;
+import org.chorem.pollen.service.ServiceUser;
+import org.chorem.pollen.ui.data.AddressBar;
+import org.chorem.pollen.ui.pages.Index;
+import org.chorem.pollen.ui.utils.BusinessUtils;
+import org.slf4j.Logger;
+
+/**
+ * Classe de la page d'enregistrement d'un utilisateur.
+ *
+ * @author kmorin
+ * @author rannou
+ * @author fdesbois
+ * @version $Id$
+ */
+@IncludeStylesheet("context:css/register.css")
+public class UserRegister {
+
+ @Inject
+ private Logger logger;
+
+ /**
+ * Objet de session représentant l'utilisateur identifié.
+ */
+ @SessionState
+ private UserAccount user;
+
+ @Property
+ private boolean userExists;
+
+ /** Injection des services */
+ @Inject
+ private ServiceUser serviceUser;
+
+ /** Injection des services */
+ @Inject
+ private ServiceEmail serviceEmail;
+
+ @Inject
+ private PollenContext pollen;
+
+ @Inject
+ private Messages messages;
+
+ @Parameter(defaultPrefix = BindingConstants.MESSAGE, value = "title")
+ @Property
+ private String title;
+
+ /**
+ * Objet de session représentant l'url du site.
+ */
+ @SessionState
+ private String siteURL;
+
+ /** Locale courante */
+ @Inject
+ private Locale currentLocale;
+
+ /**
+ * Utilisateur créé via le formulaire
+ */
+ private UserAccount newUser;
+
+ @InjectComponent
+ private Form register;
+
+ @Component(id = "login")
+ private TextField loginField;
+
+ @Component(id = "email")
+ private TextField emailField;
+
+ @Component(id = "password1")
+ private PasswordField passwordField;
+
+ /**
+ * Champ password1 du formulaire d'enregsitrement d'un utilisateur
+ */
+ @Property
+ private String password1;
+ /**
+ * Champ password2 du formulaire d'enregsitrement d'un utilisateur
+ */
+ @Property
+ private String password2;
+
+ /**
+ * Initialisation de l'affichage
+ */
+ void setupRender() {
+ }
+
+ public AddressBar getAddressBar() {
+ return AddressBar.newBar().appendCurrent(title);
+ }
+
+ public UserAccount getNewUser() {
+ if (newUser == null) {
+ newUser = serviceUser.getNewUser(currentLocale);
+ }
+ return newUser;
+ }
+
+ /**
+ * ON_VALIDATE_FORM :: Check if two passwords are equals.
+ */
+ void onValidateFormFromRegister() {
+ // L'utilisateur s'est pas trompé en répétant son mot de passe
+ if (!password1.equals(password2)) {
+ password1 = null;
+ register.recordError(passwordField,
+ messages.get("passwords-dont-match"));
+ }
+ }
+
+ /**
+ * ON_SUCCESS :: Executed if no errors are recorded from ON_VALIDATE_FORM.
+ * Encode password and create the user. If no problem appears during
+ * creation, an email will be sent to the user.
+ *
+ * @return the form if errors are recorded, or Index page otherwise
+ */
+ Object onSuccessFromRegister() {
+ try {
+ // Encode the password before saving user
+ getNewUser().setPassword(pollen.encodePassword(password1));
+
+ // Saving new user
+ serviceUser.createUpdateUser(getNewUser());
+
+ // Send an email to the new user
+ PollenEmailImpl mail = new PollenEmailImpl();
+ mail.setTo(getNewUser().getEmail());
+ mail.setSubject(
+ messages.format("pollen.mail.userRegister.subject",
+ getNewUser().getLogin()));
+ mail.setContent(
+ messages.format("pollen.mail.userRegister.content",
+ getNewUser().getFirstName(), getNewUser().getLastName(),
+ getNewUser().getLogin(), password1, siteURL));
+
+ serviceEmail.sendEmail(mail);
+
+ return Index.class;
+ } catch (PollenBusinessException eee) {
+ String message =
+ BusinessUtils.getErrorMessage(eee, messages, logger);
+ switch (eee.getType()) {
+ case USER_EMAIL_EXIST:
+ register.recordError(emailField, message); break;
+ case USER_LOGIN_EXIST:
+ register.recordError(loginField, message);
+ }
+ }
+ return register;
+ }
+
+ /**
+ * ON_FAILURE :: Executed if errors are recorded from ON_VALIDATE_FORM.
+ *
+ * @return the form
+ */
+ Object onFailureFromRegister() {
+ return register;
+ }
+}
Property changes on: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserRegister.java
___________________________________________________________________
Added: svn:keywords
+ Date Author Revision Rev Id
Added: svn:mergeinfo
+
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -25,10 +25,16 @@
import org.apache.tapestry5.ioc.services.Coercion;
import org.apache.tapestry5.ioc.services.CoercionTuple;
import org.apache.tapestry5.ioc.services.SymbolProvider;
+import org.apache.tapestry5.services.ApplicationStateContribution;
+import org.apache.tapestry5.services.ApplicationStateCreator;
import org.apache.tapestry5.upload.services.UploadSymbols;
import org.chorem.pollen.PollenContext;
import org.chorem.pollen.PollenContextImpl;
import org.chorem.pollen.PollenContextImplementor;
+import org.chorem.pollen.entity.UserAccount;
+import org.chorem.pollen.entity.UserAccountImpl;
+import org.chorem.pollen.service.ServiceEmail;
+import org.chorem.pollen.service.ServiceEmailImpl;
import org.chorem.pollen.service.ServicePoll;
import org.chorem.pollen.service.ServicePollImpl;
import org.chorem.pollen.service.ServiceUser;
@@ -72,6 +78,13 @@
return service;
}
+ public static ServiceEmail buildServiceEmail(
+ @InjectService("PollenContext") PollenContextImplementor context) {
+ ServiceEmailImpl service = new ServiceEmailImpl();
+ service.setContext(context);
+ return service;
+ }
+
public static ServiceImage buildServiceImage(
@InjectService("PollenContext") PollenContextImplementor context) {
return new ServiceImageImpl(context);
@@ -165,4 +178,23 @@
configPropertiesFileSymbolProvider, "after:SystemProperties",
"before:ApplicationDefaults");
}
+
+
+ /**
+ * Used to instanciate SessionState WaoUser when session expires.
+ *
+ * @param configuration to add the ApplicationStateCreator.
+ */
+ public void contributeApplicationStateManager(MappedConfiguration<Class<?>, ApplicationStateContribution> configuration) {
+ ApplicationStateCreator<UserAccount> creator =
+ new ApplicationStateCreator<UserAccount>() {
+ @Override
+ public UserAccount create() {
+ return new UserAccountImpl();
+ }
+ };
+
+ configuration.add(UserAccount.class,
+ new ApplicationStateContribution("session", creator));
+ }
}
Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/BusinessUtils.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/BusinessUtils.java (rev 0)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/BusinessUtils.java 2010-03-30 17:57:40 UTC (rev 2960)
@@ -0,0 +1,37 @@
+
+package org.chorem.pollen.ui.utils;
+
+import java.util.Arrays;
+import org.apache.tapestry5.ioc.Messages;
+import org.chorem.pollen.PollenBusinessException;
+import org.slf4j.Logger;
+
+/**
+ * BusinessUtils
+ *
+ * Created: 30 mars 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class BusinessUtils {
+
+ public static String getErrorMessage(
+ PollenBusinessException eee, Messages messages, Logger logger) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("ERROR from business : " + eee.getMessage() +
+ " _ args = " + Arrays.toString(eee.getArgs()));
+ }
+ String message = null;
+ if (eee.getArgs() != null) {
+ message = messages.format(eee.getMessage(), eee.getArgs());
+ } else {
+ message = messages.get(eee.getMessage());
+ }
+ return message;
+ }
+
+}
Property changes on: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/BusinessUtils.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Modified: trunk/pollen-ui/src/main/resources/i18n/pollen-ui-en_GB.properties
===================================================================
--- trunk/pollen-ui/src/main/resources/i18n/pollen-ui-en_GB.properties 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/resources/i18n/pollen-ui-en_GB.properties 2010-03-30 17:57:40 UTC (rev 2960)
@@ -1,6 +1,6 @@
# User registration emails
-registerEmail_subject=[Pollen] Confirmation of account creation %s
-registerEmail_msg=Welcome %s %s. You had just created an account on the web application Pollen.\n\nLogin: %s\nPassword: %s\n\nYou can now manage your polls by logging on the website : \n%s
+pollen.mail.userRegister.subject=[Pollen] Confirmation of account creation %s
+pollen.mail.userRegister.content=Welcome %s %s. You had just created an account on the web application Pollen.\n\nLogin: %s\nPassword: %s\n\nYou can now manage your polls by logging on the website : \n%s
# Poll creation emails
creatorEmail_subject=[Pollen] Poll creation (%s)
Modified: trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties
===================================================================
--- trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties 2010-03-30 17:57:40 UTC (rev 2960)
@@ -1,6 +1,6 @@
# User registration emails
-registerEmail_subject=[Pollen] Confirmation de cr\u00E9ation du compte %s
-registerEmail_msg=Bienvenue %s %s. Vous venez de cr\u00E9er un compte sur l'application de sondage en ligne Pollen.\n\nIdentifiant : %s\nMot de passe : %s\n\nVous pouvez d\u00E8s maintenant g\u00E9rer vos sondages en vous identifiant sur le site : \n%s
+pollen.mail.userRegister.subject=[Pollen] Confirmation de cr\u00E9ation du compte %s
+pollen.mail.userRegister.content=Bienvenue %s %s. Vous venez de cr\u00E9er un compte sur l'application de sondage en ligne Pollen.\n\nIdentifiant : %s\nMot de passe : %s\n\nVous pouvez d\u00E8s maintenant g\u00E9rer vos sondages en vous identifiant sur le site : \n%s
# Poll creation emails
creatorEmail_subject=[Pollen] Cr\u00E9ation d'un sondage (%s)
Modified: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/Border.tml
===================================================================
--- trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/Border.tml 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/Border.tml 2010-03-30 17:57:40 UTC (rev 2960)
@@ -4,6 +4,8 @@
<head>
<title>Pollen<t:if t:test="pageTitle"> :: ${pageTitle}</t:if></title>
<link rel="icon" type="image/png" href="${asset:context:favicon.png}" />
+ <link rel="stylesheet" type="text/css" href="${asset:context:}/css/common.css" />
+ <link rel="stylesheet" type="text/css" href="${asset:context:}/css/main.css" />
<t:FeedContextLink t:id="feedContext" />
<t:if test="${feedFileExisting}">
<link t:type="headlink" rel="alternate" type="application/atom+xml" href="${feedFilename}" t:context="feedContext" />
@@ -14,7 +16,7 @@
<body id="${pageLogo}Body">
<!-- Langue -->
- <div id="localization" class="${pageLogo}Localization">
+ <div id="po-header-localization" class="${pageLogo}Localization">
<a href="mailto:${contactEmail}" title="${message:header-contact-title}">
<img src="${asset:context:img/contact.png}" alt="Contact" />
</a> |
@@ -28,7 +30,7 @@
</div>
<!-- Entête de la page -->
- <p id="top_logo">
+ <p id="po-header-logo">
<a t:type="pagelink" t:page="index" href="index">
<img src="${asset:context:img}/${logo}" alt="Pollen" />
</a>
@@ -36,21 +38,16 @@
<t:zone t:id="top" class="${pageLogo}" show="show" update="show">
<!-- Login -->
- <div id="login_box" class="${pageLogo}">
+ <div id="po-header-connection" class="${pageLogo}">
<t:if test="userExists">
<span class="menu_elt" onmouseover="$('compte_menu').show()" onmouseout="$('compte_menu').hide()">
- <t:if test="userNamed">
- ${user.firstName} ${user.lastName}
- <p:else>
- ${user.login}
- </p:else>
- </t:if>
+ ${user.displayName}
<div class="dropdown_menu" id="compte_menu" style="display: none;">
<div class="top_right${pageLogo}"></div>
<div class="top_left${pageLogo}"></div>
<ul class="top_middle${pageLogo}">
<li>
- <t:pagelink page="user/Account">${message:account}</t:pagelink>
+ <t:pagelink page="user/profile">${message:account}</t:pagelink>
</li>
<li>
<t:actionlink t:id="logout" t:zone="top">${message:logout}</t:actionlink>
@@ -63,7 +60,7 @@
<div class="dropdown_menu" id="login_menu" style="display: none;">
<div class="top_right${pageLogo}"></div>
<div class="top_left${pageLogo}"></div>
- <form t:type="form" t:id="loginForm" action="post">
+ <form t:type="form" t:id="connection" action="post">
<ul class="top_middle${pageLogo}">
<li>
<div t:type="errors" />
@@ -83,7 +80,7 @@
</form>
</div>
${message:or}
- <t:pagelink t:page="user/Register">${message:register}</t:pagelink>
+ <t:pagelink t:page="user/register">${message:register}</t:pagelink>
</p:else>
</t:if>
</div>
@@ -100,7 +97,7 @@
<div class="top_left${pageLogo}"></div>
<ul class ="top_middle${pageLogo}">
<li>
- <t:pagelink t:page="poll/PollCreation">${message:pollCreation}</t:pagelink>
+ <t:pagelink t:page="poll/form">${message:pollCreation}</t:pagelink>
</li>
<t:if test="userExists">
<li>
@@ -117,7 +114,7 @@
</div>
</li>
<t:if test="userExists">
- <t:if test="user.administrator">
+ <t:if test="user.admin">
<li class="menu_elt" onmouseout="$('menu2').hide()" onmouseover="$('menu2').show()">
<a>${message:menu2}</a>
<div class="dropdown_menu" id="menu2" style="display:none">
@@ -142,14 +139,14 @@
<div id="corps">
<!-- Barre d'adresse -->
- <div id="addressBar" class="${pageLogo}Address">
- <t:loop t:source="address" t:value="lien">
+ <div id="po-header-addressBar" class="${pageLogo}Address">
+ <t:loop t:source="addressBar.items" t:value="item">
>
<strong>
- <t:if test="lien.address">
- <a t:type="pagelink" t:page="${lien.address}" href="index">${lien.name}</a>
+ <t:if test="item.address">
+ <a t:type="pagelink" t:page="prop:item.address" href="index">${item.name}</a>
<p:else>
- ${lien.name}
+ ${item.name}
</p:else>
</t:if>
</strong>
@@ -161,25 +158,22 @@
<noscript>
<t:feedback t:id="errorJs" />
</noscript>
- <t:feedback t:id="borderFeedback" />
- <t:unless t:test="feedBack.hasErrors">
+ <t:feedback t:id="borderFeedback" t:autoClear="false"/>
+ <t:if t:test="canDisplayBody()">
<t:body />
- </t:unless>
+ </t:if>
</div>
</div>
<!-- Pied de page -->
- <div id="footer" class="${pageLogo}" xml:space="preserve">
+ <div id="po-footer" class="${pageLogo}" xml:space="preserve">
<a href="${message:footer-documentation-url}">Pollen</a>
<a href="http://www.chorem.org/projects/list_files/pollen">${version}</a> -
<a href="http://www.gnu.org/licenses/gpl.html">${message:footer-license}</a> -
- <!--<a href="${message:codeLutinUrl}">${message:copyright}</a>-->
<span title="Copyright">©2009-${currentYear}</span>
<a href="http://www.codelutin.com">Code Lutin</a> -
- <!--<a href="mailto:${message:contactEmail}">${message:contact}</a> -->
<a href="http://www.chorem.org/projects/pollen/issues">${message:footer-bugReport}</a> -
<a href="http://list.chorem.org/cgi-bin/mailman/listinfo/pollen-users">${message:footer-userSupport}</a>
</div>
- <!--<a href="${message:gplUrl}"><img src="${asset:context:img/gplv3.png}" alt="GPLv3" /></a>-->
</body>
</html>
Modified: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/Border_fr.properties
===================================================================
--- trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/Border_fr.properties 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/Border_fr.properties 2010-03-30 17:57:40 UTC (rev 2960)
@@ -26,7 +26,7 @@
password-required-message=Vous devez entrer votre mot de passe.
loginSubmit=M'identifier
loginOk=Vous \u00EAtes connect\u00E9.
-loginFailed=Mauvais identifiant ou mot de passe.
+#loginFailed=Mauvais identifiant ou mot de passe.
#foot
#contact=Contact
Deleted: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/Register_en.properties
===================================================================
--- trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/Register_en.properties 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/Register_en.properties 2010-03-30 17:57:40 UTC (rev 2960)
@@ -1,20 +0,0 @@
-title=Register
-login-label=Login *
-password1-label=Password *
-password2-label=Reenter your password *
-firstName-label=First name
-lastName-label=Last name
-email-label=Em@il *
-submit-label=Register
-connectionInfoLegend=Connection information
-userInfoLegend=User information
-email-regexp=^([a-zA-Z0-9_.+-])+(a)(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$
-email-regexp-message=Invalid email.
-login-required-message=You must provide a username.
-password1-required-message=You must provide a password.
-password1-minlength-message=Your password must be at least 6 characters long.
-password2-required-message=You must repeat your password for confirmation.
-password2-minlength-message=Your password must be at least 6 characters long.
-passwords-dont-match=Two versions of password do not match.
-loginAlreadyExists=A user already registered with this login.
-emailAlreadyExists=A user already registered with this email.
\ No newline at end of file
Deleted: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/Register_fr.properties
===================================================================
--- trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/Register_fr.properties 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/Register_fr.properties 2010-03-30 17:57:40 UTC (rev 2960)
@@ -1,20 +0,0 @@
-title=S'enregistrer
-login-label=Identifiant *
-password1-label=Mot de passe *
-password2-label=R\u00E9p\u00E9tez votre mot de passe *
-firstName-label=Pr\u00E9nom
-lastName-label=Nom
-email-label=Em@il *
-submit-label=S'enregistrer
-connectionInfoLegend=Informations de connexion
-userInfoLegend=Informations de l'utilisateur
-email-regexp=^([a-zA-Z0-9_.+-])+(a)(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$
-email-regexp-message=Email invalide.
-login-required-message=Vous devez fournir un identifiant.
-password1-required-message=Vous devez fournir un mot de passe.
-password1-minlength-message=Votre mot de passe doit comporter au moins 6 caract\u00E8res.
-password2-required-message=Vous devez r\u00E9p\u00E9ter votre mot de passe pour confirmation.
-password2-minlength-message=Votre mot de passe doit comporter au moins 6 caract\u00E8res.
-passwords-dont-match=Les deux mots de passe ne correspondent pas.
-loginAlreadyExists=Un utilisateur est d\u00E9j\u00E0 enregistr\u00E9 avec cet identifiant.
-emailAlreadyExists=Un utilisateur est d\u00E9j\u00E0 enregistr\u00E9 avec cet email.
\ No newline at end of file
Copied: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/UserRegister_en.properties (from rev 2956, trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/Register_en.properties)
===================================================================
--- trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/UserRegister_en.properties (rev 0)
+++ trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/UserRegister_en.properties 2010-03-30 17:57:40 UTC (rev 2960)
@@ -0,0 +1,20 @@
+title=Register
+login-label=Login *
+password1-label=Password *
+password2-label=Reenter your password *
+firstName-label=First name
+lastName-label=Last name
+email-label=Em@il *
+submit-label=Register
+connectionInfoLegend=Connection information
+userInfoLegend=User information
+email-regexp=^([a-zA-Z0-9_.+-])+(a)(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$
+email-regexp-message=Invalid email.
+login-required-message=You must provide a username.
+password1-required-message=You must provide a password.
+password1-minlength-message=Your password must be at least 6 characters long.
+password2-required-message=You must repeat your password for confirmation.
+password2-minlength-message=Your password must be at least 6 characters long.
+passwords-dont-match=Two versions of password do not match.
+loginAlreadyExists=A user already registered with this login.
+emailAlreadyExists=A user already registered with this email.
\ No newline at end of file
Property changes on: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/UserRegister_en.properties
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/UserRegister_fr.properties (from rev 2956, trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/Register_fr.properties)
===================================================================
--- trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/UserRegister_fr.properties (rev 0)
+++ trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/UserRegister_fr.properties 2010-03-30 17:57:40 UTC (rev 2960)
@@ -0,0 +1,18 @@
+title=S'enregistrer
+login-label=Identifiant *
+password1-label=Mot de passe *
+password2-label=R\u00E9p\u00E9tez votre mot de passe *
+firstName-label=Pr\u00E9nom
+lastName-label=Nom
+email-label=Em@il *
+submit-label=S'enregistrer
+connectionInfoLegend=Informations de connexion
+userInfoLegend=Informations de l'utilisateur
+email-regexp=^([a-zA-Z0-9_.+-])+(a)(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$
+email-regexp-message=Email invalide.
+login-required-message=Vous devez fournir un identifiant.
+password1-required-message=Vous devez fournir un mot de passe.
+password1-minlength-message=Votre mot de passe doit comporter au moins 6 caract\u00E8res.
+password2-required-message=Vous devez r\u00E9p\u00E9ter votre mot de passe pour confirmation.
+password2-minlength-message=Votre mot de passe doit comporter au moins 6 caract\u00E8res.
+passwords-dont-match=Les deux mots de passe ne correspondent pas.
\ No newline at end of file
Property changes on: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/user/UserRegister_fr.properties
___________________________________________________________________
Added: svn:mergeinfo
+
Modified: trunk/pollen-ui/src/main/webapp/Index.tml
===================================================================
--- trunk/pollen-ui/src/main/webapp/Index.tml 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/webapp/Index.tml 2010-03-30 17:57:40 UTC (rev 2960)
@@ -1,20 +1,20 @@
-
-<t:border t:address="address" t:pageLogo="literal:Index"
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<t:border t:addressBar="addressBar" t:pageLogo="literal:Index"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter">
<div class="center" style="margin-bottom:20px;">
- <img src="${asset:context:img/pollen.png}" />
+ <img src="${asset:context:img/pollen.png}" alt="Pollen logo"/>
</div>
<div class="center">
- <t:pagelink t:page="poll/Creation">
- <img src="${asset:context:img/smallCreation.png}" />
+ <t:pagelink t:page="poll/form">
+ <img src="${asset:context:img/smallCreation.png}" alt="poll creation" />
</t:pagelink>
<t:pagelink t:page="user/PollsParticipated">
- <img src="${asset:context:img/smallVote.png}" />
+ <img src="${asset:context:img/smallVote.png}" alt="vote" />
</t:pagelink>
<t:pagelink t:page="user/PollsParticipated">
- <img src="${asset:context:img/smallVoteCounting.png}" />
+ <img src="${asset:context:img/smallVoteCounting.png}" alt="voteCounting" />
</t:pagelink>
</div>
Added: trunk/pollen-ui/src/main/webapp/css/common.css
===================================================================
--- trunk/pollen-ui/src/main/webapp/css/common.css (rev 0)
+++ trunk/pollen-ui/src/main/webapp/css/common.css 2010-03-30 17:57:40 UTC (rev 2960)
@@ -0,0 +1,63 @@
+/*
+ Document : common
+ Created on : 30 mars 2010, 10:40:20
+ Author : fdesbois
+ Description:
+ Common StyleSheet for Pollen application
+*/
+
+.fleft {
+ float: left;
+}
+
+.fright {
+ float: right;
+}
+
+.clearfix {
+ display:block;
+}
+
+.clearfix:after {
+ content:".";
+ display:block;
+ height:0;
+ clear:both;
+ visibility:hidden;
+}
+
+.hidden {
+ display: none;
+}
+
+.display {
+ display: block;
+}
+
+.fb-error {
+ width: 400px;
+ margin: auto;
+ text-align: center;
+ color: #000;
+ font-weight: bold;
+ padding: 3px;
+ border: solid;
+ border-color: #f00;
+ border-width: 2px;
+}
+
+.fb-info {
+ width: 400px;
+ margin: auto;
+ text-align: center;
+ color: #000;
+ padding: 3px;
+ border: solid;
+ border-color: #000;
+ border-width: 2px;
+}
+
+.center {
+ text-align: center;
+}
+
Modified: trunk/pollen-ui/src/main/webapp/css/main.css
===================================================================
--- trunk/pollen-ui/src/main/webapp/css/main.css 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/webapp/css/main.css 2010-03-30 17:57:40 UTC (rev 2960)
@@ -10,38 +10,6 @@
margin: auto;
}
-.fleft {
- float: left;
-}
-
-.fright {
- float: right;
-}
-
-.clearfix {
- display:block;
-}
-
-.clearfix:after {
- content:".";
- display:block;
- height:0;
- clear:both;
- visibility:hidden;
-}
-
-.clr {
- clear: both;
-}
-
-.hidden {
- display: none;
-}
-
-.display {
- display: block;
-}
-
#CreationBody {
background-image: url("../img/bigCreation.png");
}
@@ -68,6 +36,7 @@
padding: 0px;
}
+/*Haut de page*/
.CreationLocalization, .VoteLocalization,
.VoteCountingLocalization {
margin-top: 82px;
@@ -77,22 +46,51 @@
margin-top: 10px;
}
-#localization {
- text-align: right;
- margin-bottom: 1px;
+#po-header-localization {
+ text-align: right;
+ margin-bottom: 1px;
}
-#localization a {
- text-decoration: none;
+#po-header-localization a {
+ text-decoration: none;
}
-/*Haut de page*/
-#top_logo {
+#po-header-logo {
float: left;
margin-top: -102px;
margin-right: 10px;
}
+#po-header-connection {
+ float: right;
+ vertical-align: top;
+ position: relative;
+ margin-right: 10px;
+ text-align: right;
+}
+
+#po-header-connection form {
+ margin: 0px;
+ padding: 0px;
+ width: 200px;
+}
+
+#po-header-connection a,
+#po-header-connection span {
+ padding: 1px;
+ padding-left: 5px;
+ padding-right: 5px;
+ text-decoration: none;
+ cursor: pointer;
+}
+
+#po-header-connection a:hover,
+#po-header-connection span:hover {
+ -moz-border-radius: 10px;
+ background-color: #000;
+ color: #fff;
+}
+
.Index {
background-color: #ff0;
color: #000;
@@ -150,6 +148,7 @@
position: relative;
}
+/** DROPDOWN MENU **/
.dropdown_menu {
padding-top: 9px;
position: absolute;
@@ -315,34 +314,6 @@
right: -25px;
}
-#login_box {
- float: right;
- vertical-align: top;
- position: relative;
- margin-right: 10px;
- text-align: right;
-}
-
-#login_box form {
- margin: 0px;
- padding: 0px;
- width: 200px;
-}
-
-#login_box a, #login_box span {
- padding: 1px;
- padding-left: 5px;
- padding-right: 5px;
- text-decoration: none;
- cursor: pointer;
-}
-
-#login_box a:hover, #login_box span:hover {
- -moz-border-radius: 10px;
- background-color: #000;
- color: #fff;
-}
-
HTML>BODY DIV.t-error LI {
margin-left: 0px;
}
@@ -385,7 +356,7 @@
color: #727a7e;
}
-#addressBar {
+#po-header-addressBar {
padding: 5px;
margin-left: 350px;
}
@@ -410,42 +381,15 @@
padding: 15px;
}
-.fb-error {
- width: 400px;
- margin: auto;
- text-align: center;
- color: #000;
- font-weight: bold;
- padding: 3px;
- border: solid;
- border-color: #f00;
- border-width: 2px;
-}
-
-.fb-info {
- width: 400px;
- margin: auto;
- text-align: center;
- color: #000;
- padding: 3px;
- border: solid;
- border-color: #000;
- border-width: 2px;
-}
-
-.center {
- text-align: center;
-}
-
-/* Le pied de page (qui se trouve tout en bas, en général pour les copyrights) */
-#footer {
+/* Pied de page */
+#po-footer {
padding: 5px;
font-size: small;
text-align: center;
margin-top: 20px;
}
-#footer a,
-#footer span {
+#po-footer a,
+#po-footer span {
color:#727a7e;
}
\ No newline at end of file
Modified: trunk/pollen-ui/src/main/webapp/css/register.css
===================================================================
--- trunk/pollen-ui/src/main/webapp/css/register.css 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/webapp/css/register.css 2010-03-30 17:57:40 UTC (rev 2960)
@@ -1,4 +1,4 @@
-#registerForm fieldset {
+#po-user-register form fieldset {
border: 1px solid #aab;
padding: 15px;
padding-bottom: 10px;
@@ -9,28 +9,28 @@
text-align: left;
}
-#registerForm fieldset div {
+#po-user-register form fieldset div {
margin-bottom: 10px;
}
-#registerForm label {
+#po-user-register form label {
display: block;
width: 180px;
float: left;
}
-#registerError {
+#po-user-register-form-error {
width: 600px;
margin: auto;
margin-top: 10px;
}
-#registerError .t-error div,
-#registerError .t-error ul {
+#po-user-register-form-error .t-error div,
+#po-user-register-form-error .t-error ul {
padding: 3px;
}
-#registerError .t-error LI
+#po-user-register-form-error .t-error LI
{
list-style:disc;
margin-left: 20px;
Modified: trunk/pollen-ui/src/main/webapp/poll/PollForm.tml
===================================================================
--- trunk/pollen-ui/src/main/webapp/poll/PollForm.tml 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/webapp/poll/PollForm.tml 2010-03-30 17:57:40 UTC (rev 2960)
@@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<t:border t:address="addressBar.items" t:pageLogo="literal:Creation" t:pageBodyId="p-pollForm" t:pageTitle="prop:pageTitle"
+<t:border t:addressBar="addressBar" t:pageLogo="literal:Creation" t:pageBodyId="p-pollForm" t:pageTitle="prop:pageTitle"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter">
<t:feedback t:id="feedback"/>
<h1 class="titlePoll">
@@ -23,9 +23,9 @@
</p>
<p>
<span><label t:type="label" for="creatorName"/>:</span>
- <input type="text" t:type="textfield" t:id="creatorName" value="poll.creatorName" t:validate="required,minlength=2"/>
+ <input type="text" t:type="textfield" t:id="creatorName" value="poll.creator.name" t:validate="required,minlength=2"/>
<label t:type="label" for="email"/>:
- <input type="text" t:type="textfield" class="email" t:id="email" value="poll.creatorEmail" t:validate="regexp"/>
+ <input type="text" t:type="textfield" class="email" t:id="email" value="poll.creator.email" t:validate="regexp"/>
</p>
<p>
<span><label t:type="label" for="description"/>: </span>
@@ -40,8 +40,8 @@
<label t:type="label" for="endDate"/>:
<input t:type="ck/dateTimeField" t:id="endDate" value="poll.endDate" t:validate="regexp"
t:datePattern="message:date-pattern" t:timePicker="true" t:timePickerAdjacent="true"/>
- <label t:type="label" for="voteCounting"/>:
- <select t:type="select" t:id="voteCounting" t:value="poll.voteCounting" t:validate="required">
+ <label t:type="label" for="voteCountingType"/>:
+ <select t:type="select" t:id="voteCountingType" t:value="poll.voteCountingType" t:validate="required">
<option></option>
</select>
<span t:type="ck/Tooltip" title="${message:help}" t:value="${message:voteCounting-help}" t:effect="appear">
Deleted: trunk/pollen-ui/src/main/webapp/user/Register.tml
===================================================================
--- trunk/pollen-ui/src/main/webapp/user/Register.tml 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pollen-ui/src/main/webapp/user/Register.tml 2010-03-30 17:57:40 UTC (rev 2960)
@@ -1,48 +0,0 @@
-
-<t:border t:address="address" t:pageLogo="literal:Creation"
- xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter">
- <t:unless test="userExists">
- <h1 class="titleCreation">${message:title}</h1>
- <t:form t:id="registerForm">
- <div id="registerError">
- <t:errors />
- </div>
-
- <FieldSet>
- <legend>${message:connectionInfoLegend}</legend>
- <div>
- <t:label for="login"/>
- <t:TextField t:id="login" t:value="newUser.login" t:validate="required"/>
- </div>
- <div>
- <t:label for="password1"/>
- <t:PasswordField t:id="password1" t:value="password1" t:validate="required, minlength=6"/>
- </div>
- <div>
- <t:label for="password2"/>
- <t:PasswordField t:id="password2" t:value="password2" t:validate="required, minlength=6"/>
- </div>
- </FieldSet>
-
- <FieldSet>
- <legend>${message:userInfoLegend}</legend>
- <div>
- <t:label for="email"/>
- <t:TextField t:id="email" t:value="newUser.email" t:validate="required,regexp"/>
- </div>
- <div>
- <t:label for="firstName"/>
- <t:TextField t:id="firstName" t:value="newUser.firstName"/>
- </div>
- <div>
- <t:label for="lastName"/>
- <t:TextField t:id="lastName" t:value="newUser.lastName"/>
- </div>
- </FieldSet>
-
- <div class="buttons">
- <input type="submit" value="${message:submit-label}"/>
- </div>
- </t:form>
- </t:unless>
-</t:border>
\ No newline at end of file
Copied: trunk/pollen-ui/src/main/webapp/user/UserRegister.tml (from rev 2956, trunk/pollen-ui/src/main/webapp/user/Register.tml)
===================================================================
--- trunk/pollen-ui/src/main/webapp/user/UserRegister.tml (rev 0)
+++ trunk/pollen-ui/src/main/webapp/user/UserRegister.tml 2010-03-30 17:57:40 UTC (rev 2960)
@@ -0,0 +1,51 @@
+
+<t:border t:addressBar="addressBar" t:pageLogo="literal:Creation" t:pageTitle="prop:title"
+ t:pageBodyId="po-user-register"
+ xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter">
+ <t:unless t:test="userExists">
+ <h1 class="titleCreation">${message:title}</h1>
+ <t:zone t:id="zone" t:update="show">
+ <form action="post" t:type="form" t:id="register" t:zone="zone">
+ <div id="po-user-register-form-error">
+ <t:errors />
+ </div>
+
+ <fieldset>
+ <legend>${message:connectionInfoLegend}</legend>
+ <div>
+ <t:label for="login"/>
+ <t:TextField t:id="login" t:value="newUser.login" t:validate="required"/>
+ </div>
+ <div>
+ <t:label for="password1"/>
+ <t:PasswordField t:id="password1" t:value="password1" t:validate="required, minlength=6"/>
+ </div>
+ <div>
+ <t:label for="password2"/>
+ <t:PasswordField t:id="password2" t:value="password2" t:validate="required, minlength=6"/>
+ </div>
+ </fieldset>
+
+ <fieldset>
+ <legend>${message:userInfoLegend}</legend>
+ <div>
+ <t:label for="email"/>
+ <t:TextField t:id="email" t:value="newUser.email" t:validate="required,regexp"/>
+ </div>
+ <div>
+ <t:label for="firstName"/>
+ <t:TextField t:id="firstName" t:value="newUser.firstName"/>
+ </div>
+ <div>
+ <t:label for="lastName"/>
+ <t:TextField t:id="lastName" t:value="newUser.lastName"/>
+ </div>
+ </fieldset>
+
+ <div class="buttons">
+ <input type="submit" value="${message:submit-label}"/>
+ </div>
+ </form>
+ </t:zone>
+ </t:unless>
+</t:border>
\ No newline at end of file
Property changes on: trunk/pollen-ui/src/main/webapp/user/UserRegister.tml
___________________________________________________________________
Added: svn:mergeinfo
+
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-03-27 20:07:23 UTC (rev 2959)
+++ trunk/pom.xml 2010-03-30 17:57:40 UTC (rev 2960)
@@ -313,7 +313,7 @@
<eugene.version>2.0</eugene.version>
<i18n.version>1.1.1-SNAPSHOT</i18n.version>
<tapestry.version>5.1.0.5</tapestry.version>
- <nuiton-utils.version>1.2</nuiton-utils.version>
+ <nuiton-utils.version>1.2.1-SNAPSHOT</nuiton-utils.version>
<processor.version>1.0.2</processor.version>
<!-- <chorem-commons.version>1.0.0-alpha-2-SNAPSHOT</chorem-commons.version>-->
1
0
Author: tchemit
Date: 2010-03-27 21:07:23 +0100 (Sat, 27 Mar 2010)
New Revision: 2959
Log:
Utilisation de mavenpom4redmine 2.0.7
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-03-26 14:06:00 UTC (rev 2958)
+++ trunk/pom.xml 2010-03-27 20:07:23 UTC (rev 2959)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>2.0.6</version>
+ <version>2.0.7</version>
</parent>
<groupId>org.chorem</groupId>
1
0
Author: fdesbois
Date: 2010-03-26 15:06:00 +0100 (Fri, 26 Mar 2010)
New Revision: 2958
Log:
Refactor ui module to use new model v2 (only for build)
Added:
trunk/pollen-business/src/main/java/org/chorem/pollen/MD5.java
trunk/pollen-business/src/main/java/org/chorem/pollen/entity/ChoiceImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/mail/
trunk/pollen-business/src/main/java/org/chorem/pollen/mail/BackgroundWorker.java
trunk/pollen-business/src/main/java/org/chorem/pollen/mail/BackgroundWorkerImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/mail/MailUtil.java
trunk/pollen-business/src/main/java/org/chorem/pollen/mail/PreventRuleManager.java
trunk/pollen-business/src/main/java/org/chorem/pollen/mail/SendMail.java
Removed:
trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenContext.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenException.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Image.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ImageContextLink.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/uio/DateChoiceUIO.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/uio/ImageChoiceUIO.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ImageDisplay.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollCreation.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollModification.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/BackgroundWorker.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/BackgroundWorkerImpl.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenManager.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/ImageUtil.java
trunk/pollen-ui/src/test/java/org/chorem/pollen/ui/PropertiesLoaderTest.java
Modified:
trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/PollenProperty.java
trunk/pollen-business/src/main/java/org/chorem/pollen/entity/PollImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java
trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties
trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties
trunk/pollen-business/src/main/xmi/pollen.zargo
trunk/pollen-ui/pom.xml
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/ContextLink.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/Polls.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Border.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FeedContextLink.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FileLink.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/LoginComponent.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ChoiceField.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/PollHelper.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/admin/PollsAdmin.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/admin/UsersAdmin.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CloseValidation.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ConfirmPoll.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CreationValidation.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ModificationValidation.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/Account.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/Register.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserLists.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsCreated.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsParticipated.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PropertiesFileSymbolProvider.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/ServiceImageImpl.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/CSVAccountUtil.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/LDAPAccountUtil.java
trunk/pollen-ui/src/test/java/org/chorem/pollen/ui/utils/CSVAccountUtilTest.java
trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/ChoiceType.java
trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/PollType.java
trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/VoteCountingType.java
Added: trunk/pollen-business/src/main/java/org/chorem/pollen/MD5.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/MD5.java (rev 0)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/MD5.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -0,0 +1,59 @@
+/* *##% Pollen
+ * Copyright (C) 2009 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;
+
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+/**
+ * Classe utilitaire permettant d'encoder des chaîne en MD5.
+ *
+ * @version $Id$
+ */
+public class MD5 {
+
+ /**
+ * Encode la chaine passé en paramètre avec l’algorithme MD5
+ *
+ * @param key : la chaine à encoder
+ * @return la valeur (string) hexadécimale sur 32 bits
+ */
+ public static String encode(String key) {
+
+ byte[] uniqueKey = key.getBytes();
+ byte[] hash = null;
+
+ try {
+ // on récupère un objet qui permettra de crypter la chaine
+ hash = MessageDigest.getInstance("MD5").digest(uniqueKey);
+ } catch (NoSuchAlgorithmException e) {
+ throw new Error("no MD5 support in this VM");
+ }
+
+ StringBuffer hashString = new StringBuffer();
+ for (int i = 0; i < hash.length; ++i) {
+ String hex = Integer.toHexString(hash[i]);
+ if (hex.length() == 1) {
+ hashString.append("0");
+ hashString.append(hex.charAt(hex.length() - 1));
+ } else {
+ hashString.append(hex.substring(hex.length() - 2));
+ }
+ }
+ return hashString.toString();
+ }
+}
Property changes on: trunk/pollen-business/src/main/java/org/chorem/pollen/MD5.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -6,7 +6,6 @@
import java.util.UUID;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.PollenException;
//import org.chorem.pollen.PollenDAOHelper;
//import org.chorem.pollen.business.services.SendMail;
//import org.chorem.pollen.business.services.ServiceUserImpl;
@@ -121,6 +120,10 @@
}
I18n.setInitializer(new DefaultI18nInitializer("pollen-business"));
I18n.init();
+
+ // Set context in PollenProperty enum to use easily method
+ // getValue() on PollenProperty
+ PollenProperty.setContext(this);
// ServiceUserImpl serviceUser = new ServiceUserImpl(this);
// serviceUser.createDefaultAdmin(
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/PollenProperty.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/PollenProperty.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/PollenProperty.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -42,6 +42,8 @@
String key;
+ static PollenContext context;
+
PollenProperty(String key) {
this.key = key;
}
@@ -50,11 +52,15 @@
return key;
}
-// public String getValue() {
-// return PollenContexImpl.getProperty(this);
-// }
+ static void setContext(PollenContext cx) {
+ context = cx;
+ }
-// public boolean hasValue() {
-// return !getValue().equals("");
-// }
+ public String getValue() {
+ return context.getProperty(this);
+ }
+
+ public boolean hasValue() {
+ return !getValue().equals("");
+ }
}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenContext.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenContext.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenContext.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -1,90 +0,0 @@
-
-package org.chorem.pollen.business;
-
-import org.chorem.pollen.PollenProperty;
-import java.util.Date;
-//import org.chorem.pollen.business.services.SendMail;
-import org.nuiton.util.ApplicationConfig;
-
-/**
- * PollenContext
- *
- * Created: 20 mars 2010
- *
- * @author fdesbois
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
-public interface PollenContext {
-
- /**
- * Load the application configuration :
- * <pre>
- * - Add entities implementation classes for Topia-persistence
- * - Add model version for Topia-migration-service
- * </pre>
- *
- * @param conf ApplicationConfig
- */
- void loadConfiguration(ApplicationConfig conf);
-
- /**
- * Start of the application. The application configuration will be loaded
- * automatically if needed using {@link #loadDefaultConfiguration }. Also
- * you can manually load the configuration using
- * {@link #loadConfiguration(ApplicationConfig)}
- * This start does :
- * <pre>
- * - Initialize i18n for error messages
- * - Create default admin if needed (this will load the topiaRootContext).
- * </pre>
- *
- */
- void start();
-
- /**
- * Stop the application. Close the Topia rootContext.
- */
- void stop();
-
- /**
- * Get the SendMail thread to manage emails.
- *
- * @return the SendMail running thread
- */
-// SendMail getSendMail();
-
- /**
- * Get a property from the configuration.
- *
- * @param property PollenProperty
- * @return value of this property
- */
- String getProperty(PollenProperty property);
-
- /**
- * Test if the property is defined in this context
- *
- * @param property PollenProperty
- * @return value of this property
- */
- boolean hasProperty(PollenProperty property);
-
- /**
- * Get the configuration of the application. Instantiate the default one
- * if needed.
- *
- * @return the ApplicationConfig
- */
- ApplicationConfig getConfiguration();
-
- /**
- * Return the current date from context
- *
- * @return a date
- */
- Date getCurrentDate();
-
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenException.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenException.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenException.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -1,34 +0,0 @@
-
-package org.chorem.pollen.business;
-
-/**
- * PollenException
- *
- * Created: 23 févr. 2010
- *
- * @author fdesbois
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
-public class PollenException extends RuntimeException {
-
- private static final long serialVersionUID = 1L;
-
- protected Object[] args;
-
-// public PollenException(Throwable eee, String message) {
-// super(message, eee);
-// }
-
- public PollenException(Throwable eee, String message, Object... args) {
- super(message, eee);
- this.args = args;
- }
-
- public Object[] getArgs() {
- return args;
- }
-
-}
Added: trunk/pollen-business/src/main/java/org/chorem/pollen/entity/ChoiceImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/entity/ChoiceImpl.java (rev 0)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/entity/ChoiceImpl.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -0,0 +1,46 @@
+
+package org.chorem.pollen.entity;
+
+import org.chorem.pollen.common.ChoiceType;
+import org.chorem.pollen.votecounting.business.NumberMethod;
+
+/**
+ * ChoiceImpl
+ *
+ * Created: 26 mars 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class ChoiceImpl extends ChoiceAbstract {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public ChoiceType getChoiceType() {
+ return ChoiceType.valueOf(getType());
+ }
+
+ @Override
+ public void setChoiceType(ChoiceType choiceType) {
+ setType(choiceType.ordinal());
+ }
+
+ @Override
+ public boolean getHidden() {
+ return getName().startsWith(NumberMethod.HIDDEN_PREFIX);
+ }
+
+ @Override
+ public void setHidden(boolean hidden) {
+ boolean previous = getHidden();
+ if (hidden && !previous) {
+ setName(NumberMethod.HIDDEN_PREFIX + name);
+ } else if (!hidden && previous) {
+ name.substring(NumberMethod.HIDDEN_PREFIX.length());
+ }
+ }
+}
Property changes on: trunk/pollen-business/src/main/java/org/chorem/pollen/entity/ChoiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/entity/PollImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/entity/PollImpl.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/entity/PollImpl.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -1,6 +1,10 @@
package org.chorem.pollen.entity;
+import org.chorem.pollen.common.ChoiceType;
+import org.chorem.pollen.common.PollType;
+import org.chorem.pollen.common.VoteCountingType;
+
/**
* PollImpl
*
@@ -36,4 +40,34 @@
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
+ public ChoiceType getChoiceType() {
+ return ChoiceType.valueOf(getTypeChoice());
+ }
+
+ @Override
+ public void setChoiceType(ChoiceType choiceType) {
+ setTypeChoice(choiceType.ordinal());
+ }
+
+ @Override
+ public PollType getPollType() {
+ return PollType.valueOf(getType());
+ }
+
+ @Override
+ public void setPollType(PollType pollType) {
+ setType(pollType.ordinal());
+ }
+
+ @Override
+ public VoteCountingType getVoteCountingType() {
+ return VoteCountingType.valueOf(getVoteCounting());
+ }
+
+ @Override
+ public void setVoteCountingType(VoteCountingType voteCountingType) {
+ setVoteCounting(voteCountingType.ordinal());
+ }
+
}
Copied: trunk/pollen-business/src/main/java/org/chorem/pollen/mail/BackgroundWorker.java (from rev 2956, trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/BackgroundWorker.java)
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/mail/BackgroundWorker.java (rev 0)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/mail/BackgroundWorker.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -0,0 +1,28 @@
+/* *##% Pollen
+ * Copyright (C) 2009 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.mail;
+
+/**
+ * Service lancé en parallèle de l'application. Ce service permet d'effectuer
+ * des actions en arrière-plan.
+ *
+ * @author rannou
+ * @version $Id$
+ */
+public interface BackgroundWorker {
+
+}
Property changes on: trunk/pollen-business/src/main/java/org/chorem/pollen/mail/BackgroundWorker.java
___________________________________________________________________
Added: svn:keywords
+ Date Author Revision Rev Id
Added: svn:mergeinfo
+
Copied: trunk/pollen-business/src/main/java/org/chorem/pollen/mail/BackgroundWorkerImpl.java (from rev 2956, trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/BackgroundWorkerImpl.java)
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/mail/BackgroundWorkerImpl.java (rev 0)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/mail/BackgroundWorkerImpl.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -0,0 +1,170 @@
+/* *##% Pollen
+ * Copyright (C) 2009 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.mail;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.pollen.PollenContext;
+import org.chorem.pollen.PollenProperty;
+import org.chorem.pollen.entity.Poll;
+import org.chorem.pollen.service.ServicePoll;
+
+/**
+ * Implémentation du service BackgroundWorker.
+ *
+ * @author rannou
+ * @version $Id$
+ */
+public class BackgroundWorkerImpl implements BackgroundWorker {
+
+ /** Timer gérant les threads. */
+ private Timer timer;
+
+ /** log. */
+ private static final Log log = LogFactory
+ .getLog(BackgroundWorkerImpl.class);
+
+ /** Messages internationalisés **/
+// private final Messages messages;
+
+ /** Injection du service de gestion de sondages. */
+ private ServicePoll servicePoll;
+
+ private PollenContext context;
+
+ /**
+ * Constructeur exécuté au lancement de l'application.
+ * @param servicePoll
+ * @param context
+ */
+ public BackgroundWorkerImpl(
+ ServicePoll servicePoll, PollenContext context) {
+ this.context = context;
+// this.messages = messages;
+ this.servicePoll = servicePoll;
+
+ timer = new Timer();
+ executeTasks();
+ }
+
+ /**
+ * Lancement des tâches en arrière-plan.
+ */
+ public void executeTasks() {
+ if (!context.hasProperty(PollenProperty.SERVER_URL)) {
+ log.warn("No property siteUrl. Reminder emails would not contain it");
+ }
+
+ // Exécution de la tâche toutes les 10 min
+ timer.schedule(new MailingTask(), 600000, 600000);
+ }
+
+ /**
+ * Tâche gérant l'envoi de mails de rappels.
+ */
+ private class MailingTask extends TimerTask {
+
+ @Override
+ public void run() {
+ if (log.isDebugEnabled()) {
+ log.debug("MailingTask running...");
+ }
+
+ // Récupération des sondages en cours
+ List<Poll> polls = servicePoll.getRunningPolls();
+ //servicePoll.findRunningPolls(true);
+
+ for (Poll poll : polls) {
+ Date now = new Date();
+
+ // Parcours des preventRules de chaque sondage
+ // envoi d'un email si endDate-nowDate <= preventRuleSensibility
+ if (poll.getEndDate() != null) {
+
+ // timeValue = endDate-nowDate
+ Long timeValue = poll.getEndDate().getTime()
+ - now.getTime();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Now: " + now.getTime() + " End: "
+ + poll.getEndDate().getTime() + " timeValue: "
+ + timeValue + "(" + timeValue / 3600000 + "h)");
+ }
+
+ // envoi des mails avec une sensibilité de l'ordre de l'heure
+ sendMailNotification(poll, timeValue / 3600000);
+ }
+ }
+ }
+ }
+
+ /**
+ * Envoi du mail de notification.
+ *
+ * @param poll sondage concerné
+ */
+ private void sendMailNotification(Poll poll, Long timeValue) {
+ // FIXME : create ServiceMail
+
+// String voteURL = context.getProperty(PollenProperty.SERVER_URL) +
+// "/poll/VoteFor/" + poll.getPollUId();
+// Map<String, String> data = new HashMap<String, String>();
+// data.put("host", context.getProperty(PollenProperty.EMAIL_HOST));
+// data.put("port", context.getProperty(PollenProperty.EMAIL_PORT));
+// data.put("from", context.getProperty(PollenProperty.EMAIL_FROM));
+//
+// // Mails aux votants
+// for (PreventRule rule : poll.getPreventRule()) {
+// if (rule.getActive()) {
+// Boolean hasRun = false;
+// PreventRuleManager manager = new PreventRuleManager(rule);
+// for (VotingListDTO list : poll.getVotingListDTOs()) {
+// for (PollAccountDTO account : list.getPollAccountDTOs()) {
+// if (account.getEmail() != null) {
+// String accountVoteURL = voteURL + ":"
+// + account.getAccountUId();
+//
+// data.put("to", account.getEmail());
+// data.put("title", messages.format(
+// "reminderEmail_subject", poll.getTitle()));
+// data.put("msg", messages.format(
+// "reminderEmail_msg", poll.getTitle(),
+// account.getVotingId(), accountVoteURL));
+//
+// // Exécution de la règle avec une valeur +1
+// // Sensibilité de 2h : 2h05 KO, 1h55 OK
+// hasRun = manager.execute("rappel", timeValue
+// .intValue() + 1, data);
+// }
+// }
+// }
+//
+// // désactivation de la règle de rappel pour éviter qu'elle soit réexécutée
+// if (hasRun) {
+// rule.setActive(false);
+// ServicePreventRule spr = new ServicePreventRuleImpl((PollenContextImplementor)context);
+// spr.updatePreventRule(rule);
+// }
+// }
+// }
+ }
+}
Property changes on: trunk/pollen-business/src/main/java/org/chorem/pollen/mail/BackgroundWorkerImpl.java
___________________________________________________________________
Added: svn:keywords
+ Date Author Revision Rev Id
Added: svn:mergeinfo
+
Added: trunk/pollen-business/src/main/java/org/chorem/pollen/mail/MailUtil.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/mail/MailUtil.java (rev 0)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/mail/MailUtil.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -0,0 +1,73 @@
+/* *##% Pollen
+ * Copyright (C) 2009 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.business.utils;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.mail.EmailException;
+import org.apache.commons.mail.SimpleEmail;
+
+/**
+ * Classe permettant d'envoyer des mails. Basée sur {@link SimpleEmail} (commons-email).
+ *
+ * @author rannou
+ * @version $Id$
+ */
+public class MailUtil {
+
+ /** log. */
+ private static final Log log = LogFactory.getLog(MailUtil.class);
+
+ /**
+ * Envoi d'un email.
+ *
+ * @param host Nom du serveur
+ * @param port Port SMTP
+ * @param from Adresse email de l'expéditeur
+ * @param to Adresse email du destinataire
+ * @param subject Sujet
+ * @param msg Message
+ */
+ public static void sendMail(String host, int port, String from, String to,
+ String subject, String msg) {
+ SimpleEmail email = new SimpleEmail();
+ try {
+ email.setHostName(host);
+ email.setSmtpPort(port);
+ email.setFrom(from);
+ email.addTo(to);
+ email.setSubject(subject);
+ email.setMsg(msg);
+ email.setCharset("UTF-8");
+ email.send();
+ } catch (EmailException e) {
+ log.error("Erreur à l'envoi d'email", e);
+ }
+
+ if (log.isInfoEnabled()) {
+ log.info("Mail sent to : " + to);
+
+ if (log.isDebugEnabled()) {
+ log.debug("Détail de l'email : " + "\ndate: " + email.getSentDate()
+ + "\nhostname: " + email.getHostName() + "\nport: "
+ + email.getSmtpPort() + "\nfrom: "
+ + email.getFromAddress().toString() + "\nto: " + to
+ + "\nsubject: " + email.getSubject());
+ }
+ }
+ }
+}
Property changes on: trunk/pollen-business/src/main/java/org/chorem/pollen/mail/MailUtil.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Added: trunk/pollen-business/src/main/java/org/chorem/pollen/mail/PreventRuleManager.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/mail/PreventRuleManager.java (rev 0)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/mail/PreventRuleManager.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -0,0 +1,195 @@
+/* *##% Pollen
+ * Copyright (C) 2009 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.mail;
+
+import java.lang.reflect.Method;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.pollen.business.utils.MailUtil;
+import org.chorem.pollen.entity.PreventRule;
+
+/**
+ * Classe de gestion des règles de notification. Cette classe exécute des
+ * méthodes en fonction de la règle définie.
+ *
+ * @author rannou
+ * @version $Id$
+ */
+public class PreventRuleManager {
+
+ /** log. */
+ private static final Log log = LogFactory.getLog(PreventRuleManager.class);
+
+ /** Représente l'action qui ne fait rien. */
+ public static final String NULL_ACTION = "nullAction";
+ /** Représente l'action qui écrit sur la sortie standard. */
+ public static final String PRINT_ACTION = "printAction";
+ /** Représente l'action qui envoi un email de notification. */
+ public static final String EMAIL_ACTION = "emailAction";
+
+ private PreventRule preventRule = null;
+
+ /**
+ * Constructeur.
+ *
+ * @param preventRule règle à utiliser
+ */
+ public PreventRuleManager(PreventRule preventRule) {
+ this.preventRule = preventRule;
+ }
+
+ /**
+ * Exécution de la méthode définie par la règle. La méthode s'exécute sans
+ * prise en compte de la sensibilité de la règle.
+ */
+ public boolean execute() {
+ return execute(null, null, null);
+ }
+
+ /**
+ * Exécution de la méthode définie par la règle. La méthode s'exécute si la
+ * valeur correspond à la sensibilité de la règle.
+ *
+ * @param value valeur conditionnant l'exécution de la règle.
+ */
+ public boolean execute(Integer value) {
+ return execute(null, value, null);
+ }
+
+ /**
+ * Exécution de la méthode définie par la règle. La méthode s'exécute si la
+ * portée est égale à la portée de la règle.
+ *
+ * @param scope portée de la règle.
+ */
+ public boolean execute(String scope) {
+ return execute(scope, null, null);
+ }
+
+ /**
+ * Exécution de la méthode définie par la règle. La méthode s'exécute si la
+ * valeur correspond à la sensibilité de la règle et si la portée est égale
+ * à la portée de la règle.
+ *
+ * @param scope portée de la règle.
+ * @param value valeur conditionnant l'exécution de la règle.
+ */
+ public boolean execute(String scope, Integer value) {
+ return execute(scope, value, null);
+ }
+
+ /**
+ * Exécution de la méthode définie par la règle. La méthode s'exécute si la
+ * valeur correspond à la sensibilité de la règle et si la portée est égale
+ * à la portée de la règle.
+ *
+ * @param scope portée de la règle.
+ * @param value valeur conditionnant l'exécution de la règle.
+ * @param data données utiles pour l'exécution de la règle.
+ * @return true si la méthode à été exécutée, false sinon.
+ */
+ public boolean execute(String scope, Integer value, Object data) {
+
+ // Si la règle n'est pas active, on ne fait rien
+ if (!preventRule.getActive()) {
+ log.debug("Règle non active");
+ return false;
+ }
+
+ // Si la règle est à exécution unique, on la désactive
+ if (preventRule.getOneTime()) {
+ log.debug("Règle à exécution unique : désactivation");
+ preventRule.setActive(false);
+ }
+
+ // Si la règle est répétitive (exécution tous les n), on met à jour la valeur
+ if (value != null && preventRule.getRepeated()
+ && preventRule.getSensibility() != 0) {
+ value = value % preventRule.getSensibility()
+ + preventRule.getSensibility();
+ }
+
+ try {
+ if ((value == null || value == preventRule.getSensibility())
+ && (scope == null || scope.equals(preventRule.getScope()))) {
+ if (log.isDebugEnabled()) {
+ log.debug("méthod " + preventRule.getMethod() + "(scope : "
+ + preventRule.getScope() + ", sensibility : "
+ + preventRule.getSensibility() + ")");
+ }
+
+ Method method = this.getClass().getMethod(
+ preventRule.getMethod(), Object.class);
+ method.invoke(this, data);
+ } else {
+ return false;
+ }
+ } catch (Exception e) {
+ log.error("Erreur lors de l'appel de la méthode "
+ + preventRule.getMethod(), e);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Action qui ne fait rien.
+ *
+ * TODO set this method to protected
+ */
+ public static void nullAction(Object data) {
+ // ne fait rien
+ }
+
+ /**
+ * Action qui écrit sur la sortie standard.
+ *
+ * TODO set this method to protected
+ */
+ public static void printAction(Object data) {
+ String message = "";
+ if (data instanceof String) {
+ message = (String) data;
+ }
+ System.out.println("printAction : " + message);
+ }
+
+ /**
+ * Action qui envoi un email de notification.
+ *
+ * @param data mail data
+ *
+ * TODO set this method to protected
+ */
+ public static void emailAction(Object data) {
+ Map<String, String> fields = null;
+ if (data instanceof Map<?, ?>) {
+ fields = (Map<String, String>) data;
+ MailUtil.sendMail(fields.get("host"), Integer.parseInt(fields
+ .get("port")), fields.get("from"), fields.get("to"), fields
+ .get("title"), fields.get("msg"));
+ }
+ else {
+ if (log.isWarnEnabled()) {
+ log.warn("emailAction data parameter is not instance of Map");
+ }
+ }
+
+ }
+}
Property changes on: trunk/pollen-business/src/main/java/org/chorem/pollen/mail/PreventRuleManager.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Added: trunk/pollen-business/src/main/java/org/chorem/pollen/mail/SendMail.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/mail/SendMail.java (rev 0)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/mail/SendMail.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -0,0 +1,259 @@
+/* *##% Pollen
+ * Copyright (C) 2009 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.mail;
+
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.Writer;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.io.FileUtils;
+import org.chorem.pollen.business.utils.MailUtil;
+import org.nuiton.util.FileUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import au.com.bytecode.opencsv.CSVReader;
+import au.com.bytecode.opencsv.CSVWriter;
+import org.apache.commons.io.IOUtils;
+import org.chorem.pollen.PollenContextImplementor;
+import org.chorem.pollen.PollenProperty;
+
+/**
+ * Mass mail management class.
+ *
+ * This class store email to send in a csv file, and send it (one per second) in
+ * a second time.
+ * This class can restart to send mail at application restart.
+ *
+ * For a mass mail sending to start, following files must be present:
+ * <ul>
+ * <li>xxx.emails : CSV file ("email", "subject", "body")</li>
+ * <li>xxx.index : next index to manage ( inited at 0)</li>
+ * </ul>
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class SendMail extends Thread {
+
+ /** logger. */
+ private static final Logger log = LoggerFactory.getLogger(SendMail.class);
+
+ protected PollenContextImplementor context;
+
+ public static final String EXTENSION_MAIL = ".mail";
+ public static final String EXTENSION_INDEX = ".index";
+
+ /** Mail storage directory. */
+ protected File mailStorageDirectory;
+
+ protected volatile boolean stop;
+
+ public SendMail(PollenContextImplementor context) {
+ this.context = context;
+ if (log.isInfoEnabled()) {
+ log.info("P:[ SendMail ] init");
+ }
+ // get email directory in configuration
+ // create it if not exists
+ String filename = context.getProperty(PollenProperty.EMAIL_DIR);
+ mailStorageDirectory = new File(filename);
+ if (!mailStorageDirectory.exists()) {
+ if (mailStorageDirectory.mkdirs()) {
+ if (log.isDebugEnabled()) {
+ log.debug("Email storage directory created in : " + mailStorageDirectory.getAbsolutePath());
+ }
+ }
+ }
+ }
+
+ public synchronized void stopExec() {
+ stop = true;
+ }
+
+ /*
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ if (log.isInfoEnabled()) {
+ log.info("P:[ SendMail ] start");
+ }
+
+ // try to find existing files
+ while (!stop) {
+ try {
+ sendAllMails();
+
+ // bloque thread until next notify
+ sleep();
+ }
+ catch (Exception ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Error during SendMail main loop", ex);
+ }
+ }
+ }
+ }
+
+ protected synchronized void sleep() throws InterruptedException {
+ wait();
+ }
+
+ public synchronized void wakeUp() {
+ notifyAll();
+ }
+
+ /**
+ * Look for all xx.index file, and restart mail sending on
+ * non ending mass mail sending.
+ *
+ * After execution, delete mail and index file.
+ * @throws IOException
+ */
+ protected void sendAllMails() throws IOException {
+
+ // don't do for, allways take the first found
+ // a new one can be created when managing one other
+ List<File> indexFiles = null;
+ do {
+
+ // filter is java valid : .*\\.index
+ indexFiles = FileUtil.find(mailStorageDirectory, ".*\\" + EXTENSION_INDEX, false);
+
+ if (!indexFiles.isEmpty()) {
+ File indexFile = indexFiles.get(0);
+ // convert index content to int
+ String indexContent = FileUtils.readFileToString(indexFile, "UTF-8");
+ int index = Integer.parseInt(indexContent);
+
+ // get mail content file
+ File mailFile = new File(indexFile.getAbsolutePath().replaceAll(EXTENSION_INDEX + "$", EXTENSION_MAIL));
+
+ if (log.isDebugEnabled()) {
+ log.debug("Managing mail file : " + mailFile + " (from index " + indexContent + ")");
+ }
+
+ Reader indexFileReader = new BufferedReader(new FileReader(mailFile));
+ CSVReader cvsReader = new CSVReader(indexFileReader);
+
+ int currentIndex = 0;
+ String[] currentLine = cvsReader.readNext();
+ while (currentLine != null) {
+ String receiver = currentLine[0];
+ String subject = currentLine[1];
+ String body = currentLine[2];
+
+ // index contains next index to treat so == is ok
+ if (currentIndex >= index) {
+ String host =
+ context.getProperty(PollenProperty.EMAIL_HOST);
+ int port = Integer.parseInt(
+ context.getProperty(PollenProperty.EMAIL_PORT));
+ String from =
+ context.getProperty(PollenProperty.EMAIL_FROM);
+ MailUtil.sendMail(host, port, from,
+ receiver, subject, body);
+
+ // index contains next index to treat
+ FileUtils.writeStringToFile(indexFile, String.valueOf(currentIndex + 1));
+
+ // wait 2 secondes between each mail to not
+ // load smtp server
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't wait between mail", ex);
+ }
+ }
+ }
+ else {
+ if (log.isDebugEnabled()) {
+ log.debug("Mail to " + receiver + " already sent in a previous execution, skip.");
+ }
+ }
+
+ currentIndex++;
+ currentLine = cvsReader.readNext();
+ }
+
+ // delete woth index and mail file
+ mailFile.delete();
+ indexFile.delete();
+ }
+ else {
+ if (log.isInfoEnabled()) {
+ log.info("No more index mail index file found, go to sleep a while :)");
+ }
+ }
+ } while (!indexFiles.isEmpty());
+ }
+
+ /**
+ * Prepare mail list.
+ *
+ * TODO : improve configuration reading
+ *
+ * @param id
+ * @param mailData
+ * @throws IOException
+ */
+ public void prepareMails(String id, List<Map<String, String>> mailData) throws IOException {
+
+ Writer fileWriter = null;
+ CSVWriter cvsWriter = null;
+ try {
+
+ // write CSV datas
+ File emailFile = new File(mailStorageDirectory, id + EXTENSION_MAIL);
+ fileWriter = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(emailFile)));
+ cvsWriter = new CSVWriter(fileWriter);
+
+ for (Map<String, String> singleMailData : mailData) {
+ String[] nextLine = new String[] {
+ singleMailData.get("receiver"),
+ singleMailData.get("subject"),
+ singleMailData.get("body")
+ };
+ cvsWriter.writeNext(nextLine);
+ }
+
+ // write index (default to 0)
+ File indexFile = new File(mailStorageDirectory, id + EXTENSION_INDEX);
+ FileUtil.writeString(indexFile, "0");
+ }
+ finally {
+ if (cvsWriter != null) {
+ cvsWriter.close();
+ }
+ IOUtils.closeQuietly(fileWriter);
+ }
+
+ }
+}
Property changes on: trunk/pollen-business/src/main/java/org/chorem/pollen/mail/SendMail.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -29,10 +29,6 @@
*/
public class ServicePollImpl extends ServicePollAbstract {
- public ServicePollImpl(PollenContextImplementor context) {
- super(context);
- }
-
@Override
protected Poll executeGetNewPoll() {
return new PollImpl();
@@ -131,4 +127,18 @@
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
+ protected Poll executeGetPollForResults(TopiaContext transaction,
+ List<Object> errorArgs, String pollUId)
+ throws PollenBusinessException, TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected Poll executeGetPollForVote(TopiaContext transaction,
+ List<Object> errorArgs, String pollUId)
+ throws PollenBusinessException, TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
}
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -22,10 +22,6 @@
*/
public class ServiceUserImpl extends ServiceUserAbstract {
- public ServiceUserImpl(PollenContextImplementor context) {
- super(context);
- }
-
@Override
protected UserAccount executeConnect(TopiaContext transaction,
List<Object> errorArgs, String login, String password)
Modified: trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties
===================================================================
--- trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties 2010-03-26 14:06:00 UTC (rev 2958)
@@ -19,7 +19,9 @@
pollen.error.servicePoll.getComments=
pollen.error.servicePoll.getNewPoll=
pollen.error.servicePoll.getPoll=
+pollen.error.servicePoll.getPollForResults=
pollen.error.servicePoll.getPollForUpdate=
+pollen.error.servicePoll.getPollForVote=
pollen.error.servicePoll.getPollsByUser=
pollen.error.servicePoll.getRestrictedAccount=Unable to retrieve restricted account with accountUId \= %1$s and poll with uid \= %2$s
pollen.error.servicePoll.getRunningPolls=
Modified: trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties
===================================================================
--- trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties 2010-03-26 14:06:00 UTC (rev 2958)
@@ -18,7 +18,9 @@
pollen.error.servicePoll.getComments=
pollen.error.servicePoll.getNewPoll=
pollen.error.servicePoll.getPoll=
+pollen.error.servicePoll.getPollForResults=
pollen.error.servicePoll.getPollForUpdate=
+pollen.error.servicePoll.getPollForVote=
pollen.error.servicePoll.getPollsByUser=
pollen.error.servicePoll.getRestrictedAccount=Unable to retrieve restricted account with accountUId \= %1$s and poll with uid \= %2$s
pollen.error.servicePoll.getRunningPolls=
Modified: trunk/pollen-business/src/main/xmi/pollen.zargo
===================================================================
--- trunk/pollen-business/src/main/xmi/pollen.zargo 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-business/src/main/xmi/pollen.zargo 2010-03-26 14:06:00 UTC (rev 2958)
@@ -1,145 +1,134 @@
-PK��w<pollen.argo�TKn�0��� �AQt!kcwѢA��]��,=�~�'�=z��"eRv�E6�ś��aEd+��Bѯ�y}�e���k�-���;!{¡��$HY�ٙ���C���x�T��r�=KA5�X-�<Q^0�l�R�5��
-�z�9F��ߏ߲U�*��@u���iT} LAU.A/4
-Z���,\�1#QJ48��9�4!�W��p��)m$A���q`�\�x�c� 3��x�R 5.w$A�T���x>��� Ax4ɕ؞�aD&S�"�
-�|���#T�HuW���B��C
-{�(�q�AlZi+�j��x;�ד�vE[�g �
-�@�z��,[=�p��c�K"��v2E�J�� Gl@Y�-��'�+�E�l���.�$�����_?o~��_��4�ޚ2T�Q��s{�d�k���i)a�~��bV���y�9��Q8��uC��+�������i���:�-�sg8+��B�g��){�6
-��}46n��k^L�����|����\�m͇�(L]��k-x�7�Ђ�W��D�� �렴�'w�ÊIf�f���PK����4:PK��w<pollen_Modèle.pgml�]�n�F�ߧ���"�3�k�p�dQ�i��E��IZ�
-�r��>оǾ�)���CrFQEٮ$R�|���7��������1X,�x~q�ε�I0�b?��.�>�=��&?^~��o/�~���W�������z39K����F��������������]���(���l�ޟ/7 �.���KV��|�x��u�.�/���gj�өmO�1�"
-O-l�x�t�"��qoo��S[Ӵ�Z��B3Ͼ�d��{\������7
-ξ��/?�-������L�^�����}�?2𓉮�O&� �?���M�>���&
-.n�h<[&�"��/��0�t�=��������B���37I��* �/���n�^����=���0���+Ͻ8�g���$�ߠˎ�
-ʗ�_�\|��_�[����ᣛ�g?T��_[^��gQP�y.���/QH�O�\�Ql��>�~rG/ �����]B_r��%feuۮK���.k2�a�V��Di�7�r]X�#�H^��?K��N��� ����%U�s
-�Q�:%@�p����%u��EׯXr݊s���I��Iu�]a������c�uh"�L���s�鷠�9�gūa�F�wq�ٶ��8���^��NA-��_�eކ���0���n��ۗ�Fɳ�}5L�|;����?���5,�n�<a���`L��zc��;Tےz�!�A��!��|Gѕ�ūyR��p%���p��?n�����H��_ߘ9�3��^�9�{�Pf���9����åU�<f.�5�u����z��bSnSR�����A�6�b�5 ��������c�ļq0�{�p���"�P���A���r�n[�*'����mk�,�s�{No��%��*���o:�D6]*�MW��������6��ɦ q4��NS�=�h?�I.�?����w���ge
-�L�q64��\�)��(��4�چ,� ܻa$��т4�U�1���������B��+�{�
-��5�дQ�S�]�>�S�o�8
-�y+�V�&���u
-�c�/)�h��i��n����� ��<���WK �vZ�vX��=|��p��HWϲ��+��S����O��q��B�c���0^P#a"MO��ړ &�6�q����
-!&L��%m��2�D���FUm:x�)1*�4LT��w�a"�d���)C?�Di�����D�a"Ą��Ƅ�QoL�&��a"�:L��9l�����2s]��&b��H������^k4�0QY�8�<ք��4z�S Y�5�:��)&}\����}�tE?��w�SM)�=}��~�/g�G�2�g8[���Fȿ"��G�X�g� 40�CG���E�jl_*Y�W������:V#L��[�'�/�*s7�c��i��n��w��/��ڱh;�^�hoо
-���)"w,�� ��G�S�#Wm6xǢ
-8j���m���w,���1�"�:�t��$4��߱h�fC��x�ϵh�'!&�� �]<��g�x�;
-�mz^$���p��b�
-'�J8�Tc�������DQ�����IXY4�Q �����{L�\0��Y���_R�~Ē0K"lő��7c:��$�P���CR8��
-��#I���)��Ն�2�fe~�ԶY�W��+7*�"H�m� /*d۬�}];Q��H���������&pK�s�#N*�S?����?�I�U�e<��F"��T�Y�k���o+���%�"���f9NWl�[a+��E@������K����,6m^��II���˥�hkc�a��I�16l�*��_c���Q�T�c�c����X*I>V�����!m^x��X�=��O1�fa6�dk�U��I�D�1̅�9�1������ǻ�9:��H~�7�,�� �h���� xL(#.��Ռ��k�3B�A�}��f�m�lCf������k#��
-E;�J�`;�`�`����d`{Q�|a�=�4���6[#�ހ�����_EQ�Iv6��Nx�c�����=�6�}�����
-0����|�4M������������[�\E����Lӂ��C�0����+��;��|�4@��x��p��\����O���6!E?Ab���N �|&��Q�����6u'��CE�<�H7�8-�+���atzH�i9�uk�4�dO�Hx�.y� Z�'O[(mDmᴛJ�t�'O�)���\��g �.�|m�߫�iRI��PY��"_,?dج.��
-t�<M�%O�
-Ԛ<���{�<M��i�\���W�~$O.y�B�Y�ha!�5&Og�7$O�J�4cH���zC2�����>M�hʟ&j�3�f��Ƽ�j�Լu��C��iּY&PR ��c�i C˟�H��FM��M�[��4� r���f������8n��:�v3����W�ݨ4d�[���8¥����sKkt7���K�4"���q8c`0
-s�3��57��.I�C[�*�<�lww��ŋ����K���;�W!j��\�^���߾/�(6�>&zm�Zx��x��/�z����[�*��}��_b��
-�w���%�݈����9TH�Tl��g�yx��p}i�o���D?�-]z�ڄ��Y�3�7{OU<�9�\�i,ԉ�{d;)m.����-no�Aj�*��u�Y��7�( �)�/`J�"���Nz�{�h���W�y�T-رd�+�G�"�P���mV���S���2@DR̡�9�_z�������_ѧ�q�k�j�kM�y7����JV.�syq�m�x�Z*�5��O&F����O�������h7����L����g��WJ=�UpӨ��]ƌ�l���Z~Z0�Go��3¨OCpswq�<�i�CF��/vU
- E�Gh��g���h�Ш�1��!��4�#F�f�D�zh��"x��[U�@�M턑�����1pM���
-\W��/�8ӄj�\��E[��7+R`�Qm�܌�z�pp�P<�"c���lN��o6n��&L(�l6��獡�6�6[*
-��V��1�i��,8mu�����r���-)~��
-$��-)N0���?�(�x�Di�,X��7��&4֬d�/�9�?(i����,��f�R8$8���v�$|$�6����HhT������^l�l�k�j�b��}���ps��$ �:]A�۳�$�b{*I�����z"���V�Ϧ����g����WE0Eu~�Ϗ0��#p������{�1lf$?bO�r���F��I�� d�`�4 ��q �UgD��Ɉ��
-`*�f2ā�W�a�=h���s,8[PD�r�<���+�q(��w�[��)}Ͷ�}�+#��0~�8m'��#��AѸ���=F㬡�8I�_��8MȪb,���i�r�U�8kh4N�
-V��a]��8��+�qV�y��j�:��y_�z!"W����I�u���z�n����$��.�E�Jh���z
-_n���p���y�[]�F}�%�����V���S�XU�R�~$��|��rP��'Z�o��jW{�T�H�;SoF��кn�ٔ�j+nՓuY�**�eU`ۺJ���F=�m3�^ٶc��C�e�H��F]琺�<T�^ט�j+nԓ �l6[S��o6�MK$L(��l�l�c-��n��Ґ�l�[sYm�M�
-<��&�`.k
-�X*�ͷ�aq��B�q��h��j6ߨ�����zlR��{�&�v�S�WEwIh�TکG�L0���6|�C.������F/�3����B�y�+�,8É_�
-�H��]<�f�p"P�t���t�@�P&F�2�y8(�e:_i,S��egb�r�Pfi��ђ�^��i�Ii�))�rW���� mz�
-���)V�q��4��`h�N�p:�=)��t�_5�������+eyiR����\i}'sk=�u�&3
-��hH���8�+�\VN����.TN���ӥr�1��c�ŧD�����"~�T���5G�+��G.'.�):�T�~�N��!�~jD��9K���I@G�f��ϡ��9�3�Y�ӺJvږ���j�"�}�������"����ӡ���(�E��ı��7X����.�+*Ccpo�c�]@�]R��,��o94E�T�bpo�c�J�.i���}e���Y��x8�4O.أ��F�{�XSnZҵyK�SH�0��.#r,��ö� !� ��'�8uO��Ue*"��T��Ř�vI��o�4�%6����+SQV���T�����u]j�%SOb���V�R�~�f�@�:��
-[P��X�*]�J�/��2f��%QoF�^��1NS)�J+Sצ�q6�
-�ƴuU)��f��h4mx?ӶW�\��A��U�����V��Tx�C���b�Hܨ��
-1��N��;����͗���
--�r.zb��</^͓�����xc�0���"�ݳ�����o��a��Y|����D8[�i�=ː�{�{��[%�+��mЇ��|t�UZH�ǫfN^[-%E�\L��p�]-e�vYj�͂�+�V��r��9#�Co�}����6z��$��Hf�i�ʼ~�&�_��6#F*�2뺝RJѺib����ܱ��Vg2�z�.�m[N������j���t���oG!?�Y-p�T�z�G!?�Y�f@���Q����:���#v.�z;2tG�o�r%��B��3�FLcc�T��7n���q̬q������7�Y��$6�92e]�-�=����͆�f�AM���X���J5B���-����1�n6��7[�f�?����Y��ղ��͗���a�I3��֪�sk3��n����]
-�[o�[�{��n����Z����aѡ�� �T%Ea%��\��P��U��aXUw,�8\ӓ��T��=�� ��5�Y\h�3U�@y�����JB�
-��w=�TU����z�����61!fM;*���\Dz��Ê���@�cX��P��q�Ō� Ob-�{����(Vd���
-�Q�2�+g�=��mճ�q����_���?3j�|9q�&:G_��G���PK����PK��w<pollen_Services.pgml�\ko�6��_�C��#J�é��M��@_X��P�D�\eѐh'��GJ�^�%���V
-;E=�9������]�F1��jO���=������S^L�ƿ��t����7�ҧ\~�����c�x=�#9��؍В$wÑ?p"�h'���G�b� ��D+��"8X��Շ��ǯ�>���a�o�}`��@���f]���g�5rf3��o��z��^�f�HI~Bg'�K����є�����٩䫛Ώsz�w!���q�_��Dac��?F���C�_Q��8�9A�Ǵ/��n �"x3Q��%���xӑ�64��;����Y}��?����h��G�A]Pϵ�3��c8��n�����5m�:_�����&��������a�A�8������IOn��7�#�I�»i�C�� �S4��j�jc�Zm�ۤ(��!u�p����].s�߲[V�F�n��y�%T��n�f�u�RΑ���D<(���_�_���6��f��6������[R5T�0�F#T�`le���Ea//>3�!}����8r'�$���8�Fv���-��*&h�\'!�����鳀<g����|�@?�Sv; ���ځ~?�q�"E��O�����ϟT�F��%{o�i�B����;�&�qT岈��,�)����҉Ȃ>=I%�������%*�\��s�e��%����"��ibՊ���o<��t�Xr��ٌ&��lj� �y���!�u�d�f���tu
-[cn�빡� #��'���sGx��=���C�������?�3�Ä`�2�G��Fv
-�%���n��P�;P^n�f@�A�UD��1��ސ/X�t��Zz�oJ��otq=>v֏�ݒ�n����=�݃���m)�&���;����.Ď��==n
-�H
-����fu�'� �*��_1��t�0�����W!i��.��H0�QG������"�lG�ѡ��лq��Ag���c#!��G��$
-�֓ ]�j�hLX��σ �e0��d��ń톲
-�*"�0Z`8�!A�n���ؒ��H��ڐ:��$��U�!�b�ke��G�P��nȊ_�]�0:^�/J
-���7vȔtq�Y���)b�0��9^��߸��c�D�]��[ڂBrC�t؊����(�.�+S�
-�CA��AR��j��4ϓW��������3����
-
-�����Kl��F�c�e��(�Ŋl�z�*��'���E��FE�~3-�x7VՍ�.�;��T�fG:���k�?K�8�O��&�F����pB����@`E':IO>R�8�Ou��Pߛ�T�>ը]PI�>�[ɴ>`�Z�$���Y>�SI(?K�8�O=�dB��ThR��_M�Sa��F����
-��K�z��}8g��zyUz��;.C:���#Q�oC�,�8��Quc���sOή����O�4S4>��R�L��vo�p!��6]Ӻ�}BCZ:ۖCN�h������0�[�J�XTԵD1?2�!�b&1�
-c$��M�uK��]�NP/����~=��8aG�-HjW�OhH�¶��h� -�G�}.�5�P��J�I@��Ԁ`�آ��a2�t�ƨa����껮5*��k���xpR�Eb#�A�(��rξ���S��L��PK�N�ŷ�@PK��w<pollen_Diagrammedeclasses.pgml�Zko�H��_�VU*��c0� PuIZEj���T�V�ʘ���a��G��w��/HC[Ԅ����9w�̽a��n�K7���.G2ꨲ�����7����(�,��8�0��tq&��tyu�^��Mg�g2�f8t x4e^�f]A'q͈�1{� �͉�o����+�;+ҹ~�n��ax���M���4�+
-R5�Ќ�������5,�úb��:P�Ծ| E����#yB��q�`���*�[�OM�~���,�����G�I��jꑄt�s`��G���G���$�����$�v���3[<7L:�������a��EU�)�5u5��ɜ�ڷp
->i(��%�s��S6�o�g���ﺶĝ���|M�y0rcs�n�6�n/=��d܍d=e�>sKf|>���2�ěsx5�HL%���J�R����*i�.�u�q�L9~:$[��:d.�(ߊ)K�c|�M���d��]Gx� �e�+���7��2�KP
-�� ȅ���*7;\�o��i,�'BX�N��F� ��2k���N�qB�� I/_��d�dPb�z��p�'�H�d,3O�?���!�*�2����8�z�L��ͤy���'�"�������XL��I��2���
-bt7+���މ�0mº�Z�kP�ø���}�����Q�f�=D�>�[ք.��<?R6KO�mo�M��~��uۥ�ʭ�Vi{��m%����Kы��g3h8��B�O��(X({�O[��8�3\��i��"0�'�x@��7������nGk���MN5j"�,��[���S}j�@�\��s�Dw�@z~<h��%o(��E���n�
-F��
-�$B�n�s�g������q���0�0����3�g�&2n~�_���)i<\rF��F&��L�$3���,s;�)�>���0Z�0j�V��=A*`Qwܗu��F�V��Z@�U�zO��cpb>�\#�_|i·kӏ������m[V���*�ѡ9���44[�����,HDM���{GRk��I:�^�fQ�6۳�Qd��(x�Q���Y���l1rvT��q���YT)��������j�GuU��=�X�5�gԯ; ?�g��<�
-�٢�dL4�ȓ�Ϟ/�Zem�Z��Rm$tY��i��t?�V�*�ڲ�8�I�����w+�X(��P����CZ뵨R��D�V���5��S�^�aխU�������R�ǟ>^
-�!��5�/a���k���ӝ�
-���2oY��A�o���c=l�Y)���
-�dE�0
-�2�����[8�>��5Ѻk�0�9�{�G�m�����|
-fx���WGM��[`y�V>������*�w���P���ai�,�*Z��b4s�1v<�v�C�1
-^� �?j���ݺU�V{y���WoS�l�H:���?>�PK9ܜ='PK��w<pollen.todo�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��q�(��;�D�*���+G���*(�8z)%)J
-@% ���,.2���E���9e�)�E�%��� Y,B3PK4�[-m�PK��w<pollen_profile.profile�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��qq��e��q��ÙPK7Rp:BPK��w<
-pollen.xmi�]뗣6��������Jv�\���N�g]~��9IO��:;���]L0xWw���W�[<$��<3��-�Օ�O������e�H/�lϕ�"�)�N���Y���_|zZ�O��槿��N��������q�7�~�������pCla�&���F�`����P���:D�}��o4U�/�$UV价�H~���o%����-tC"p��/����C�v�o<L����=
-�@����o�&������C�7鑿����u2P�� ����%�g�iB��-��e�^Q%y�&���2�V��#�,��_�f?H��oM^�<��0Ј�-D�,�H ���-����˷�@���m�������������8��3s?���'�{E��Wd�~��
-s8o���)X�'o�'�,��ӟGytw`�?�7�q�{'���4��mF��?��@���3_�������`f��T��dG�t f� �
-�~�&�͞^!y:ţ��k덢*��aBȄ�yxw|��?ȷ�F�D,��Pu ����s�C¯�L��&��];�'���#���wJ�Βr��q��LZ4��G�>��:4?��߀�ؤ�TQ�@��(�p�ʆ5A�w�S�\CH�"k���L�04����v�������Ҭ��*ɮ�]�džsae#>���C٘X�bD�<N-��I�����2�~e��ٳMD6@۰���no8��Ȓ�l�_���ɜ:2!����;��c��Yy]@�SC��*�+h$OLsHE��x��|�^����5��ϣ|��m�C��`�i�hᏴ�%�1����t:�3���~��:�?��.z�����5Ϧ�g�n x}x����s�8���D<�*��`�wB{��E�'uKM�٥���#�j����5't���_J��4���>#% ?�N��vɿ���#�4�:oM�����Yd�?vH�&q���Mh"�)A��O����$%H�'s2���L�nZ���߂���;,���:����������hOƊjY:I�S��Zf��=!:o(�:l( �
-�;,����c
-`�*�9�`E�
-��pH���Y�\f2�Z5f4��i����{�7���� �L��%��g�k�<b��h��υf�m��x�Z5�~I���^�
-���~�[�?8��n��H���7LJ��v�vX���@� �e^���r���J?vʙ$���!���L�e���>_�E;
-
-y�-Ƃ�B.�ɞ�Eu�p=�
-�b�;P��@q�HA��o'���*!g-)�Tj�|<�w��ʙiz{7�FK��F�#�j��[�;d��#��ya���;�v��m3��J�td:\���
-����6��8'+;��7*�G�@$!�=~F�h[$��vnXyڦA�J�X A��!��A��C���yf0��8:�۫���kF��d�l_����tX~��0�q.�gn
-����)�Q���h�+�BT�at�}��-FE���}��]�sz��+���:�6q,���*�/��$�@��2���=�����Y���O�z��P1��OU$xf:ܴ��@;�:~�O�
-�g�C�����n�̙3�1"��Ȝ�<s�u�-kj����N&mm��&N����>#:~v�'�N�u��E��n5����!�|��N�ca�#�@L�J>zt'��Bkqm�A�^���2�}���@a2f:�:��#���)�%�t�9��p�0�k���h9��Y�D#ѬM
-��"y�����Cǔ��q�C��ƕ��N��^�xh���ӋB�O2�P�tٍ�W�O���U���WCa��?8���nJV�OT�t���
-��i1+���^�k^<\Z���£s�=�������sͽ�C�
-���qyn����֑�����^j�v�GLI�#@��[���9�=ܚ̋M�����]+ղ��d�ʱqm��|R�*U�:i�������ĉV���l*�,3���4q*�����<�èjn���|��������͢9��5�4G��EM��N��(���W��nW�ffj�G���ǰ2z�L�X�B#f���
-D���5
-��$�����
-�)<8Э�p8�ft�Z�1Qռ�d�����p�3_W����D�V�A�C��A�uX���Ad� 0�ej�>wV��=�A@����.|�o9�������i\� ��j��~<� 0
-�-C�`J�+(:1)#�-�=a$�s�ͻS��
-4Hw����ܫ�:0�+D���K"��0�t�0������hS�C�6��şhE$��!K��M��;��%�D�A\�~)[5�a��=����@#��C�H�µ6;չه? pc��M�L�� ��������f!Pf"E1�L�+�̚�TX�-B�ۮ���6k���(�e:4�
-k�A�X���6˾��(J�e:\0ޕ�_bK�q�X�����L��O\���P_ї@�A*��b:^p�)�,���SuEL�+,�T�ج0s�����e��.��j��L��(��:�"� ��j��ĆQ�*��M��ش�5��S̅�ǻ�~�Bx����6s����W�L�с,n���3ޕ����# ������6��Vtհ�P��W��@,�`�X�@���6���D�W�H���b���62��E-����)�pp5&sۏPx�უ�l��EFξ
-�_v>���>��5���|'���"ܨ>�e�
-�'��h�f
-�ǚ1^�3ۅ���k]�_y5�c۬��D�(��p����XWF��
-���c8�9�6�/�s|Y��nP�#�N���L�+ˠ�\���;�q0kP�+�)9ՙ�����q��j�vs�6�"�:ӡ�P��9�R�.N�hR�/�5�x�=�5GQr�k^ӭ9y���M�ޚ�(�W!���ɩo2Ľ9in��j�t�3|�0[
-2��,�[UP�aI�&'�����j��=[������8h$.VlG�r�Y$��larr�j���{H,�k��� �@����M�4�W@,�iV�5�5�Q�N���j�G��Md�0���վy������M�M�TU�ut:C��#M��o��ܓ~a��k�61�{%���'�W[����YME}=ՉqHE->���������n��N�8ß�p�9����2��4�IXO��D6�ʅ�h`>{���C��D�N�HD�t�:P�9ϴO�r���َ�����8���\�.�T�k�2~�H��������Yd��oA�v7���ߡEz�l|�9>����,��\�ʲ����!����nDN���Z�N�D�(r�eҨ�W�^7�9"��B��N��r*Iӿ~�:��a+�˪��"y��a1Vu!V$ZW
-,�nu�@���o�8�#�Zx_���2]��1%W&��"��D���"?�Aw�e��q�&W%9kYYUc*�s�<��Ҙ�N�M��QQ�%�=�C]���zZ<��0��E�ъs�U+[#�9�[E��ujdt���Z�c��r�D��V#��VN`[�:A���U��T�ؕ�bt0� �EjWŮ%(|���N �LL�!�l���ՖV{[���vձE���su��^( ��,*���l@�
-Yfۼ�\����SJTF����H�G܊6VR 9�W�^C���nu�9�Δ���N: �,�9$^!\y��jw� -��hLK;=Rβδ��ʼn��V�R%�|��;%U#F�D�fW��k\�=�X ���O�L#8A<n,<�uk�:�Y�z��[��t�y������@Y�0��\��%|��8�N��9����p�~r��w��c��VPkZ�����@�
-�$̭9#�E��larr+��j����j��Fò�Yl�f²:Q��HS��ˀy�r���{RE�c��.(�H�m%��بN�H�8�D� &��qI�:B��Yh?Q�>�M���Z���(:1̸֚��g���C������ ���J>�(��sh氩�"���hm�^���
-�V(P����X�ҟ{(�ەѵ���j�,��G5G"���Я��E����#�v��,���@ym�'�?@z�v�є�+���^��O=���2���,�g2m��+=d�HL�G��9a��,��v�xK�8�f��T]㵪LF� u"���jI����rP -�Y�1,��"���YYi"�e�
-����D�_�L��ɢ;`@~-���LI����*�e����s����U=���*.��H͇BE����N��sE4��H�����l{��/0��}f�@�����bȔ�ޜ0��
-d�I�M�TS9_[���G��ɹE�����$�Gyc���ic0�V�������G���gχ���s�b�e����&v�~� ����f7_����K�x�Ԉ�Ce~
-�/b� ��|<�X}�<$�S��8���Ac���Vcr�dy7�X[9���$���-&�6�G�WwV�Zr��F#�p�+��*�z�<�A��F���t�]�[y�[b~���^�5K9��P�R�[u�&^yB^�q�z�ZFkA6+)˺`��c$^��B�gF��=�#i(�����h�݉,5u����$Bf��mR�/3��r����5jx!/r��?ƣ�ޝnr�O�a�tA������z��sⱓd����~f�ᾞ~��V��Bh����
-Ԣ��Vdx:5��z͆���h
-)+d���N6����:�
-�>��!mR�˹YS�?�C�ם
-���S˓�{TLn����% s��w^C����4F�z_'��j����K����������9����\�;W��\g�؝�[�0?��ձvU����r�Е��0I��������J�+��pX�����X8ϽK[`�U`!Q�=�CG5M�'n�G���larrN,�,T�HxH�^a9�ʝ@�-LNi|A a��P�����VئV�{3���-xs� Xx
-X�*<�c��ً����|�
-�@Ü�-L1!=9�AV��Ú�B�}6xG�E���N.� ������ȐH|do�ea+s����V7!�k
-����=�+�zL�aN�����;&N'GX�-�Ji�Q�M�ޛ�0�iC��]y~��}�Tx�x��(��[��Y]�"C�Q�Q���ۜ,�#c t�V$n��]΅�vhJ#
-ًA��R��aﺶ�a�?��0�Ii���?R�^�_a���$��Z�W'~RpJ7��s&p�$��!^d���}$9}s��>F��'����6hG��M�~:�5b�hzf�3���(�@p��\~ieN�W�� )u#B���cM��J+�)ਿPZ�6�mZ� 黚�o��%�s�<�F�a�&��S��.Ԅ�Մ��j�,�'������#(e���\���2'��W�9�q
-}�E����9����ޚ�Ԧv���y�"��95�Fi�����L���8�Ua�8}��*�Ŝ�R<�o������kFDE�P�� ;�t��(�b!�������(b ��<�<F�)Q&�f��57$x��\�{���.D��y+'����D�,,����0����0M�(���- �:��HR�fD<�oa6\�*I{��s>��caiJ���c��"
-_�<[�Ϸc@��[
-̔
-_F�¼���;��P�J�#mxHJ�%|���j$C��f@T��H�@��3�g��[CC�t�����P��չ��������4��e���K�f�6��$���"EU��^<�h5Qa" N�r�Qg�4���gχ�>����qef��~�7.p.d�Y(6a�o������ X~1����39���DBb���8����h
-+�bv�s�������H5��!b���� �B<Zۛ}���q�dN`�`�������m/���k��&E���ٶ�am�@~A�+��P���<�L϶�&~�K�9�;~� L���f�%��mH�v3������kϗ���
-�qin;�d��#�����u|���71�A|l0M�Á�x�#�*K*�3���m�NIܙ۫����_w6�2��xq�,����"���ƕ��ON��DX
-
-:�=v�}s�|��1�L���|㝖ш�(^��.-![�J
-t#�/�ڥSsܣ:���ڴ5����ͣ�����R�Ts��u���J��T�HO�z�g�q$J��V��}�mQ8�W�^K.��g ����ӱ�?��}�fL�_i�^��^2�+m����$�q����I��K2O����W�����hmK��t�b-��f���%[��
-2�}��-����m�Q�d�Õ����c��#fb]/�-��@��em�F�n���5;57�������P���p�hi$�auaׅ�E�R�I7�I�ό�^�.<� i�t+��\�U����;�Z����ȉ*���8J�U*q���-�<9�-��#��ï�[��ܓ�ub��)���0�����窻�����a˙�]���B�O�F�KDpd�#�2�0a9���r�cra͘PZ�aw�z�ͽE �F�8�7!��w-�Kw��j��̺�K6�3����3�UѪU�[6�N�� !��cK�h[ -��h-�vc�Ȍ�G¼�J��
-�+�1O��[�}Do�����B�(jߵ�Q�}3m��/Jo4��[���q��/L�47�2=
-+F�W�Hm�����j�' ���Es�Ʊ�$I�s�����B"r�vJ˵2;�Br������$T�$J��q�^5���ՐH���Ҋ���]��!�b=$�a W��s,���5�ҋ��L��=�?uk #�B��P�`N��o%ϋ�4�z��]C'$f���V�`���\�gx���K��x_�Yʐ�5z~�Hu�Ǚ���D@7�/t՟3�.�!.��g ���C��#+�$���;�v�P��;Ԯ('%S}�������+}zg���B��m�9r�Iv(}���,�b�g ��zR9:���p����X�����X?��U�����T�[>ӹ*�;^��_�w�gi�
-���H�~�}Q�k��E�*�~DO�^xi
-��"9��K�Z��uD0���#�b^ۜ��� ˊ
-�V�p��/\���ۡ�����Y�5-��~��,�Ӎe��4C��؛�i�`�-k������e�l�s�۽�xN� ������bF�g�o����}�p��!:`�3R��;i����Nȕ;l�%���:_dU����d�m{v�>.UV����l;V'��9Ij�� ъ�x2�G��T ��R��F�I@���
-z�ft�/�щ�<�
-3u.6��آ�L3�a��8[j����-�r�+e���6�C`MGk݈89VT��ubv�b~�������d���*�),���)��i��|�L;9��>��[Ed��Ē#��g:�Z�I"[^.�\l�4��[2��݄ޕ/�vx�7��'CSC5�B��(_��Xv*����d����.h���H��!��N�k�K�B�^b�w*�[�:��J���di/�[�g��
-�R��}Mh)�Tt�3^�E�N/j�<�o�����?6�sPS1���1G���f��;����t�-x�\�]��� �b�-�=e�R�}K�+'
-���t�X��`ߤ����ޑ�^�}+�����7��p��S1�+���n�SAvY��}\Xm��Zm+.���j�˪o==d���-d��EN�����rO�.����v�)C.���s�](<n����B�AyY(=u�-T�����>|���>Ӆ�\b
-]'��S��桖���?�
-j���)�4.tg����}h<��Z9�qʾ)�#����<4.�Z�۔W�������w�xp�.�r�)��ӹ�z��F,#.4�Q_�.#.�o�W�˄�x�b��x�b
�N�z�cʅ�oZ��}\<�}5z�\ﴧ�.��;���xH3]��;o�`��'��p��ʳt9e.�YO3��\���)��c�#V�c_��9��y_��s.v�yOx,\����^�'��eA�y{��%���X>K��N�c"�c�c��ּ&z���:jL��8 �V�jª������$^�<Z8q����jB����m��l
-i�8�D[խ{֭䞲���|9��xg]#g\hi�$Ղ��&-hi�$͂��F��ii�'��jJ0��Okb5l"�CK'9��d�M��ii�$�MKv9)�4��-s�:� ��ۄ��61�d��.�_keyv*8qP�5�@C'~;z�����\��ECYx�:;EA�΅��}��Ftz*8�Z�o�i.��
-N<RԄ��;zFCW �4�7�GFCWyd4�7��CCEǧ�_��C˚`d"����d��-�@�"�u�,��x�e!�N-�����,$��`y��
-��:���g%���L�X��s�V�d�N����]W�d��c�T�'����X��?-�V_����e��cyמ7���z����2�,4�y����zw<��̀`y��$�:��r��iєycYǫl��U�1��:.�����ק�e���i�G#mb��yX��II@�W��N��z��p�FQGk}=�5�tPO�k�ɒ���˻0�܌xR��S�:͵�D7���XSD��hOƊjY:Sj=��D@���U'������V&`�q~ �]�gAmٌ��r�sF�]�g�W�2Ь�
-�� (�䙻�@i(dGAG�Te��̈́�)�&�^��Z/�`"���]u����OE�&EAs��������Bb�cҜ�?�Nz�۰<����@o��������6Ah{.�i
-��_>x^����v��L���>0��fh��ׯRC�����~ ��;��G{�'3�C<�)�9��u��iN4X/��5�w�UjZ��]�\mx���H�Wz�HF�W�$�B��t~z����ѯn����Ϸ��?PK���#��PK��w<����4:pollen.argoPK��w<����mpollen_Modèle.pgmlPK��w<�N�ŷ�@�pollen_Services.pgmlPK��w<9ܜ='�pollen_Diagrammedeclasses.pgmlPK��w<4�[-m�i#pollen.todoPK��w<7Rp:B$pollen_profile.profilePK��w<���#��
-�$pollen.xmiPK�aH
\ No newline at end of file
+PK�hz<pollen.argo�TKn�0���@�AQt!kcwѢA��]�4� E�9�z�^��H��g�Mh1�=�<�3,��D6�T(�u�1�lDm8�j�:�b��^ȁr��" R8Ev�}��P��'�Ȫ,N�gP��1V�2O�.��
+�ơS!� <����A���[�"���T/{��U��)(�%�FAg�1�B��K0f�J��z>��&佢� >�F4J�aG���x�G9����2�|�G�(�R��D4J�q\l�ǑW$�&�R8ۛ4��d��~Cp꣖Z\���6��V���P/ﱁ=6(�v�AmZi+�j��؝��<[{��+�3y��Z=xn�Vϧ0!���vI�)�N&h�v���Q4��2�t �c���*�~���z �:������ͯ���S����ۙ�|������z��0��s۴���?삂��>�e�g��sǾ�n�8{�x8r-'R3;q�\Ȏ���pF�X�ܫP�Z � �o�ƭ�z͋i��P�m�����N�O��f~c��;y�oXע���L��/�η/��B]��̎��@u�PK(�:K/.PK�hz<pollen_Modèle.pgml�]���8�����8,�@�G$E}dҽ�t���#�I��v��m5l�����=�Ŏ�mI$Ke�j�$��,�毊���U����a1y
+W�(^^���l.��,Z�/�>}|�M�v����x�����?��<��
+�����w?N����Y2;cW�o���t=&�ū�E���v�3���*x�X'AM�{��6�d�
+/6�ŧ�Y����5�:w��s�;G��Y�����8�+��;���ݝ��ܳ,�U<�X��7��X��ُ�����Ͼ�b�_�W��q���hn��=���OI�Q�rb��� "���<��o�:�]��w�b~�N�U'_�ߢ���]�����������$YE��$Og��~�]����;���h�`�^O�E��<�|%a�v�ϰx������E0�'�*}���*z
+�p��[����*�&�r���D�}�t�����v��s4K��$�1�a4�O�)��OI#+�~\�xB�d��n,�]�h*�Vo~�ta�w���
+��(|�9��B�;$�r��v���W`�eJ�r5PAVH
+����A��rو3�`�I�/�8$��H���q`=j��8&���w��%��:/�y~6J�E4�<Km[~�6^̔������rP����:��i��07�M���WY$��?�l�|�˜�b^�?koX�ٸ{!�}`L��rc��;Lےr�!�A��!�+��/��i�Y&���+hm�s�p���U���}g�����;e�,�ܩ��3s#=3��>�y���5�8
+��@=�͘b3nSP�����0U�xuԘ�L�Uv���)LbU�8r�=�h��{:�0�`�A�K�r�aS�:#�ꔳ=w�,�?�9g�R�՛s�s��Igd�qy4�t�=�I���i�J6]H!�fׇp�»$��g�W�_��YęT�L-����#�g��>�v
+�HUh��@s�Ç Z�#Mk�&�J�Έ4G�s:v�,ް�Q-�N
+ԐK��F�9���!Z2�o�x�Z����Q�ˠ~���-c�m�O-�^
+Ԯ��k�X�x��!ެ��_���hō��"Z'0��Z\xe�iʱo_V9�x�ı_���Em"Ld�|�m��`B��<��0Qn�;&BR�Ȳ�İ����h��Dm:y�I*d4LTx�w;L��0�UX���)C7�DYTơ�b�D)�a"$��DcB2�(7&}}Z�+�02&�f�dg�p��\[.k��$3�0�3s�83w���/LT�$�2�5!��=�k��V��T%n��UL0�����lA�b��)����^>�Ѭ� �X>�Ѻ��QO��������:��Q5�fx�C�Ѻ����������>5Z'k��r~ȁS������J���
+��d�]� �,w��C��ן�ftA;m_�kdy#���h�N~Ҏ�" r'S(Rn(�1@�AS�����6ਁ�wD�I��;ki6D����Q�M0o��r�NF�t��
+q%V�kQOBR<�@��xR���$�Өm�����q�Nz��S�$,��p�t�c�ԑt��,�C]ԥ�G���h��@F�I�w<���`.�ދ��B7bIX�%���I���7�q�}��PBI�!ɝ�冤�$�d�
+!a�!�Զ���m�qkˏ���l�\��
+7�0�ݨ�o!$A�8J����-�NT��u|����&~\M��oq�`����j�Hg��E@�E8W1��d�"��N���r����]��a��f����}M���R���.E�<\��� �Z��օ�I���v6|dk���e-�n5����oq_�O��
+�2;@AxՂ��Ȇ,��&�:���_�b�Wc�ʏ�h�1_0�����ڣ�e��d��[tS0��������L���B�=x�|u"0>Cܢ���$�d�8�����:�}�sTa�d�ߟ�Q%'�)^x@�AG�P��6U=��+sTqq4tT���8��l?UԠ����)�.́�T?fZ|$�P��(Yh��`%�O��H�R�fT�j��U�r;�o�y�ܮ�u`%�OA�9S�G� ���"���P�P��Y���Aԃ��hFR��/[#��-C;���`W;���`�z�a�E�gڞ~���V Ð;�S���ͮ��s3ث}<Qu�O�U��^���^R:�f��AC��굥�@|�;��qs�>��p�Y$�0�^f:�h�˭z������^��t|@���S�#o��DիMׂV�c���b\D������)�c�6E;�F��P�^m�DUjؿ7��GykET�k7�aaS��}@��)�I��{�\�y�<�E�x/"䵼���LQ@p�C� ����ܼtjO��������X�%���K(�-�)#����
+T���0�w|OQ���E3&*�
+��SF�=e."�0��ck��qOY�xŞ2"�)�I�.7$}�Sv?�4��me�춲Լy6ݙ���U�����u���L6o"=�����H�6� R��Q���_���U�lrܖM�h7��P����� ȻM7��ӭg�qeӍK��to�L�#Jj��
+*�t�*?��J��J!"Jn�~qz�N�閛�zt�� ���U�.��r9�`��ǫ��)��e�]ў�+u��^��(�1��X.�[�c<L��x����U�~��MbcL�o�m�c�~�g�W��U|#��~"�zş9LHLl�a�3$S�3�^Z���߳����r�P����>����L�S�S��ş��ʜh�#�I|#�U�gʯ��[��0 ��u�Yt�7�$zd�,J��x�)I�Du�o�;�(���n9�^.�D�`�%۸��ҝA��Sos�q�iGq&կ������;K�~i�l�z���ٯ��\\����"SE��+S��o��ZV���\�/t+H^����7�)�Ka��!�E7�s��ωu��,t�j�O��lJA�+4�Tl�
+�͌����N~���������Mj,�)�NE\�pQw<�I��f��*)A7b�T�i�� �zx�N�1���]ѤBDS0y���|�=��a>�lĞتM3�d6�q��a��h�n��
+�P%�)6�rI!����Lڷh&�2�ˢ��ܙH�E;�I��29p��4��AN39�)���ӬX���iֳ(&<,N3��&Ub��&�L҃���\O�GͪT aJ0{@��Xsb�s�d��h�h.C�{F���n�
+nX�qKJ
+���A���9�hl��J���!U����`�DOa��*��E?�jP���e�1zh�[����C̀x���zU�A��㝚��?��7����Vl����=�S�-?�n�̞M=X~ �:���N}���*��*���y?�*#bNOR���r�,���O��A���Ŝ Osd5���'��t��ӟd�CS���~�9�~D�_���t=��v��q\8�E��˵2r�o�ơT������W��"<�Qȋ������H㬃h\v�քw{E���r��ƹ}�q
+1WO�,-��q�{L��o�ƹ}�q�[a`��8l7���<�8��y��u����]��e�6�ޱQ3��w�Omu|�H�/'��<���v��2���ΥN%�zBr��E�r�z�5�B�=�m7�������c,��(�'�zJ�����blEU�n��zJ���K��Z��r}c�k�xE��'$�Jf$/o[nF��溭�W����pMmE�ζ���[�mm%�yJ��l�(R��@�Vl��v��,WA
+�4J���<����)��Um�:Ǝ��qx�_O����N�$�a1�Q�=9�ǯ�4~WD`�������W4����]�=����輥������3���r��.���h�.��UU��zL��=
+ʒRnȠ?gm6�o��h�FCZ%�RC��}
+�6�o��Ï+���O�ؠ���x�� Ѝ�iz��o_�k���P;Г�ҒM���KL�'���lMi� �Z��#��d�ABKv�~�UF>��$�/T��rZ�
+��G����
+�NZ���~v��ϴ�Ӊ�tf�ߟ̖A�Jn���Ǩ�Ln9�����Z�����˵�U
+��-Q���8�U��������od?Lk�#�'��H�*��2�⽡u����L��e���ӝӄ���Fw���*7¼�t�D��r��:�C�R�0��b%uuK�'V��c����*T/3N����!T�ٞ3��K��/Nl�)�诘�C�r_�?�|-�(�>r9}�c��h��0d6�p��i:��&��t��l�����9�}>�)f1M+,�MF��
+M�w��0���i#�·�ӍjH���}��A>�f�]�;K[1�v�e�?Em��h�;�[7�0�e���|}��sD�,w�:����h�����,��l�>O�w��5�X��w�4"
+�������j��MoN�9����Q������_N|t�G*_�� "�``�_q�nν������7�o��"�k���8��t���R�A�ka٧�A7���@�8\i��w�>�}�����=�D3�����H���'��1�_+5m.ݙ6����9h�is��$�i�Ǚ��6ɥ���.9A�8ʺ������&��kBm�+��O����|ܔ�`*�N7r���z:�7ˤdov��`D7<K�E{�l��S��jNѡjު�����R�GQs�'�Sg���g�B����q�S������xs+uH��K�������u{{)
+�ͼy��
+�=�J�}���Л|��^v�NO*��v睄��:M�~�$�_o[����6S��B���qJ�_N��_�뤟�`���'���ж�
+��+�2��l�P^�-G!5�(����jZp�w�QHG�m��Ⱛ���t�QHG�m��8���X���(L!�rR�Q(�Ovv���_��f�T�
+�YWaj܈Cw��Ԓ�x��ڒ�*�Bٸ1x�۳.�i�\�6�$�Gɒ���&e��⊹�?E�����
+��d����~���)e�!�?N��,^��c�
+���J'�wOQ�=���,���,�v�5]�h�EM�&�hc�"7��.�)�Oq¦�q��\���mW�m���S�^���&-:_O�b�!�ȭ�q�+=p�*u�6��Я.�V9NW��wm��^�|L�֖��Q��l��-&�k��r`m An��I�;m��tՓηڦ.XĄ8p(�;.6���M�G<knD��ƫWT��U����q���Ā�s����nύ�
+�g�Q8��n��q�7��܈֗4�����M�7��:ߠ�oT�-�s��ķҹ�
+��9:����\|��B����=�-�9� 6װ��?2w�X��td��%���~]m��y�'s&�7N�^�9}�5��ɜ�{2gD��xT̒��6��*�]�Wњ3���U�f(�`\����.+iW?q��u���aq���PK�GCY�8PK�hz<pollen_Services.pgml�\�o�8���NSOJR�#]�i��Ӥ�6���4�(8�78i{�?�l |ٸ�I��B�d�1��y^��k?����җ60�QLd0Pd N�����_.��,����y�q��ۧi���]}�� ɴ0p�+���N�V8�-���y�4��^d/1�1r��q�v�:��5\x?��8~����o�}������7U����8�̑=�[�}KQ�s���F1�)� �%��W0� ��ɔԏ�(\��K��S����椗w���v���'я>R{����W6^|E1���dn�1|��0��+��ۉ�2\�Ȧύ�
+I���:�E�0��+}@�8�5�{N�,��j��2S�>���I���a4�o#�?`�iZ�5��m��4M.�W��f��J1�������a��AN��DV���}�p�\����m�"o�'2{[U3�ɪ�QJ��n�$�e��}gP���Rw��= ��vY���n�A3K��j���L�&U��3ڛ��5�k����Ecq��{���}�X����F�U#t�
+k�w2Bic�$ї�_��y2
+��W�"l�ș��VT߄��TҾc�E�D����9r�t�� �3���/|��~�v&}�
+������"ЇJ�à�i��A>>K&��PG?R}��� �<an�nF��3e�<��N��ǧ��+�2QD{Z���f�reGxI�����B�j��$�(Lݡb�&�%��.��?%��.�V�����p�;��b�%~�+�8K�dS�9�ی���NB��r�����<#7�A����zl�y�� �������Alx�8�Ѓ�xK���ߤs�>�q��D`��%0���+�����w�p��ୀ�x'�$���߄�}x]<'i�<>~�rw��q<^������<vS�����v�p�������U�{,��!I�N��/zZn
+�H����jj��Ky��Nf��!��$�� ���ܚ L���3�QG������b��Fѡθкq��AV���0J�FB��;�@�#x��@��*oL��06^�>E9N���(�t7�n��P����0��ڴŖ4!E�
+�Cvdh�7Q')��A@��A��ʪΎ��ڭ���$�����at�&_���R��#S��Z59'�f�L��%���+�>�v��.�#5(�=��b+����Q(L�+K�-���TN!]��:��_S�5^�5�g��l0>m�'����
+�e�|��'?QP=��1�@�E������oP�h*�~�\dl�Q�C�'
+��������P�v�L�n�"w#H�ܨ��l���Os�Oһ���ݪ~�'����"��%x��D�n���C�ś1U�+:�Uz�7�H���F���4o��y�������!z��"�د�-�'�aO��\��R�F�V(�
+7��?+4����M�Va��F��
+(�l����
+0�7�X)�VN�9mw� �<y��[�q|F�̱���@̮����.�T�7>����)�`���CK���8������%�!=Cޕ]L/�Ѻ#��b�x�C�9-�����!FgG�y'�G82R/e$WK�
+�u��]�NP/��{�|=A��C�� JwΑА��] PNX�.��3,\ڛ0B)��L<&<q~����n�H�/x$b����cb��֨�Z��z��`�h�N9D<x(*��{8�9ԩ����Gӓ�PK5��I��CPK�hz<pollen_Context.pgml�Zmo�H��_��S�J�a�1�خzNZEj���T�N� Â���hY祺��v�g%!�df_`�yfg�y �`�ɨ��^8�%$__�SLYz3>�v�ir���L
+}Xp�����$����]f�.�FB�F�߱�O�0I|\b�̞w"ns��q�t���Βt�?~�v������{�b�
+���bh�����B����y�@1UU����/H��x$O��;.�A<�]���;��?���9<�y�����G��t5�HB��5���3��4�#�"|�\L�}�?|;ROh��-��'���A���a��EU�)�5�4��Ȝ�ڷp�}�P��G��(�;4�l$���
+�o8?u%I&O��&����0d���8�;.ܮd;�^��A�I���z��}�斸|6���k����tc-*�դ�Z)�((�$Ilj"e��d���V�r�z@�^lY��kn�]�\��:��M3N�!�����<ʠ/�_���r.`d����
+��ۤn��� �����QT¨*��%�G)�n��$����.G2�p@�LJ�g$����4p+B�wD��j���eĉG{!,8s=<~��!k&}�>�c�ݚI�Ln��O�Uf���=�t��ɣ��u���s���l�b��
+�HRa��R�f�=��>��jB����3����mo�M��~�u۩��E{+�=�۶����ĩ��E�ip�3�.9��]$@;e��i+��s�sz�9-�P#�,�"Y�5��+�1�l�����Z=�&ɩF�'�e��;w�=���Sj��]�+�9t�;i �
+� Y����7��y��E�ۆB���AC�E�[۹�jg����X{�v���f�[�ܫ��fh/vv�1�`�����a���:2�G������~+5Ōf�0K��̎�CbJi���F(�V(����=|UJ��E1㾮K�0[0��P`��:C��%cpb>�Z#6���\זi��IKM�߶UŨ(hh��\�f��/۳�5E
+��I�}��v'�{E��l��{�����[�����ˢ��e�^���E�=o̢Jc�g��
+W=`?:��ҙ�Y�֬Y=�~����5�#�YTh� $C��@�Uo�|X��(kkӢݶic�C�J�N���U}ZT�Ӗ����i�c�=�Fm�
+�ھnm���W�*�ڊ7h5�O��o��+[��W.�u+V�f��{X�<�X��B�����+_2K= ��[@��F�AAq��:��%sP��-�5(��C��q�ց�O��:�*?��YGdb��S@h���y'���_������=�}/@�8�6oO�nϷ ����mԴ��w�i劣G$ 5��*���Cp(HM���*KYE+�]��>�@� ��V襜ݚ%G��<�����iz���?��PKd>�7�0'PK�hz<pollen.todo�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��q�(��;�D�*���+G���*(�8z)%)J
+@% ���,.2���E���9e�)�E�%��� Y,B3PK4�[-m�PK�hz<pollen_profile.profile�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��qq��e��q��ÙPK7Rp:BPK�hz<
+pollen.xmi�]m��6���_��me���LR�$:Y�i��sU���c�~�IHËD�Hjl����ȡ���@|%hw�
+��Fw㗿~�m�'���J�|'A��l���/>=��;�o������a��z��ۺ��O���������m���v0�яwR�?C���v+ߑ~���%e�Z�^+i�|�TY���|'I�u�Gl近��m�:���[�_����3�aZ~<x�`hB����|59�
+��_^ez��9n�F�ӡ���'ɇONm =�O�ly2����J��u�_��d����G�YB���E�~��$eߚ� zy�a�M;���p+%���h�ߧ'�/�+C��Wo�'=�0��!z��#Q���xfcm0�N�>(�:�����kE��������`*��k9����w���t�G���[��IN�q-g�X�x�Ok�
+ ��煙/~�`�����`f��T��dG��B̴a6h�L=7{x��0d����L�4Ե�ZQ��ش�dՅ<�;>]��T�S"�6AL�:�y��s�C�o�L��&�v\'�'���#���w�2���%���㜽�2i�(�Q���B���ɼ��`��SEE����Z�M{���Z7
+�ZCH�"k���L�04����n������ �Ѭ��*ɮ�]�dž�-��F|P��lNmY1#Q6F�m[:I����]��/�?z���F��1�?�[�bdIe��/��y�dN��YVX�Kȱ��c����,��a�:ZEx��e���Ⱥ�����O��"B�� <�y����w�CH^�����fD��&d����t�g�?�|�u���}��E�k�M;�X���@����-zL�
+ϟsΑ�l��lW1�6t��\�xR�dѤ�]�O�H�UC6�9����Rg��H>[�R����~�����>���fP等s��m2s�Y��ҨI� �-��"%HUu(�� )A�>���7�`z������H�mX����-`���s�a`!` ���`@��alc�4_D�d:QT��IJ��L�"��S�sԺ�S� �OwX c�!���U,k�)�� ��������ohf@��?Y�m+��,^��a���A\��H���Ŗ�C�0��y���T_�s���C�
+����սG������G��x����$�*$�z���tJ�vYzZ|��*t���v�e! �.�c�{�eWޙ�P�4G`����J�I�| ��ָ�Q̚�B]<b�9�N��C1�mϚO[��g'�j����ͅ��;��1QMMi&���6l�9!�05�-��}��s3�WhB�Z?�����F�F��<>KK�����#�T���W��������a����+'fA�Y���dp��'��(b�����E��*�NS��=/����s���{��;�oC�9���FA��:���ps|����^���B?}e^�xY��/+���S�$i������F0e:��F&�Wj�?��<R��cA\!F�N�:Z��{�@1�(r�o�!��f��>�E�8k������PR�����ݖ�Y�wpCn�Tz���XQ5�B���L��f����Oo�ۍ�`�h�Q��4�@�L����B/�x�)��Yٹ�&��2}DD���c�g�P���Ep���"+O�4(Yi$�%�=F�</<����#�x-8���)�^%l�\3%ceC��YN�I��� /z���int�1�S���.ӳ���=P���u�}�Po1.B=`��d�s�[���O�A�C��a��(�"��B�+���*��ړS�>>��a�Z�\�����*����4�L��V�B�� �烎���Ө�����/�o2��>r�̃p���/"g8��yY�#�6L0�0գ�t��m2�䃓�n�m�ψ����ɫ�w�nrqPF���S���k�x�
+α���sȭ�?zt��Bkq��A�N���2�}���@a2f:�:��#���)�%�u9��p�0�k�ҭh9�����T#ѬMO�E�5C����) GǙ��W�1D;��x-ؓ�m�& �O/
+�?��@��e7�_�>!��W��W_
+�U[o<q����\�P�>qsB�CO���Dbe���^�{�<|��o,�#�G� �eu �a*�u�nu��Inr�(�XҲ��!���ɉ�Z��Xg��{M�I�<U�-��އO�>��Bn�hN�}M� �1�ZT��SC։�eT�~���vUhf�����L�H��t�2]c
+����"�rV��F� ������ �Ej
+��V,82��;�V�fNU5/��|�G����c��;��2�h�
+<Hu�S?�Nk��Bw;�L4�Lm���J��g:( _��@����c�X�ڝ^P�ƅP2�Æ�2-D�M�|���Ġ�v0|�@��6�Na&r$� ݡoND��Wgu`�W ��'^ϞX����N7}�;�/�GI�8m�t��FQ�������N�kp����"o�G���pH����;{,��ت���� ��4m=Rm�$O!\k� ��[��}��@� 7����T ���8n�မ�me&R�t������H�5�"T����|m��+���[��@���tm�,\m��+���[��aC!�I�]�;�5�ޙ��,\m��T:�ĕ���}����ª/��n9$���]}�N�����p�E��W�FX��?����z$�!o;
+#�N�#�t�$8�aT���S�8�l}
+e9'��0��xw�g/�7��<n3���H_��p5���M��F�˘:�]9 �'&����0���QD����m@�&_1W���b�
+#kۄFd:\
+dHc]PNja<����$�t(j᱁幡��B�
+Wc"01���J����($C�up���`{(���������|Mj���I�gG+�7�B�_rٮ��n)�YC��fN�&9g���t��+�Fbbl�u��E�2�2zb�Mte.�0^��9��1q9��l x�B8Ǘ%;�F�_;�
+�t��
+��PZ�)�O��n�Ϧ P�Sg:ܶ��Rc
+ck@`W��A��@G���K���E)v��K4)�ݘsV�����ܘ�(��5��Ɯ<�Y�&no�Q��댐@^���7�Μ47j�B�0�A�_"�VL�!˄�VxXҲ���M�xXm>���B����Ǘ>0�����Rŗ9�
+e�XҲ��ɵ�$V��!��Y�"Z�#�'s7q�l_���Y�\�@�m�2 �Sl��f�������a�>4|�x��H1%�R�!$.��.���P�b�9���m7%���{7!���87�1�M3�Oy�L(f�Էh�$��Dc��c��'�V�آ�����U�9E���ݖ�M!���MxMz����M���7�D�bIa���|N�`0��8bc���s�c��8Q�0>s���@cg�Xf"4���m�N�>�D�~j,=���&�tU���R�H��� T�
+�z��,�,Y#so�/&���z�k2�1��1�rCU�uT�K��cM��|��9�!��0�גY���69ƙW{�Rk&�59m���s���Ts��v�VζY���FQ�9��*k�L��m�##�?]kk*[�J4�E�!|��ۅ�vSu�:}��@�C�ԁ:��Yx�s�c�&�v�?hF6���x����*pS�/]���E�ހ~��
+F��"�H}�����D�mһ�f������g!��
+V�m��r��u3��Mնuҍs�"���*����*��u� �RN%i���Q�=pC6leqYթ� �ԣ=� �%]��֕��[.�ŷ�'�3Nv�=����X��i�o����ɨNdO���:(2DV9��@�Y�\��eeU���3�饖�4tb̛�T��I��1H��I>l{�M��=qys�^��8G���\��\&(o�W������3����Љ�խF�#��̶w�����
+Z�"��,�^�*F�[�vU�JQ�z\�tٍ2V���r��#��fJ�ܖ:��]ulф:v;8[���6�Ø�,*p�8�P,�Bֆ�6�&֡z
+<�P��Qb,�1�5ᷢ��{N�4���אa�Ǡ[��#ε3e$���NB;��qɟW#��"��!�-�Ghј�v�Rβδ���DWa��L��WN%�NIՈ'w��fW��k\�=�x+���O�L#8AL7ú�Q���[�Zԭ
+�x��0�;e4=Pւ7L�C,l|�����m���9��U�<���h���m�����O{�Pܦ���S�5g��rd_o˭"n�6�V�<��5z,���M�̱�NT*Ei�W}0��n/��'U�x0fo/q!�*F���%��بN��8�D� &��qI�:�\����D
+�4y�Е���L��ij�d��o���a/�T,�&1��@�+��`�ϡ�æ���R,��A��C�_��2)$��'��(�s+/�( N5k�O5ɗ�&!�|�j6W����/����C'���s��Ug1�nn@� �'W �}����ˣ0�����܉r�����;p��'�Dkp�ҏ|��!��5e?��_�%!$� =�d�6�k;EW�V8�,�v���zj��w2�� +��[`�Ъң�Vy�i��?����9ѭ�%�5S5
+u�-
+�A�ԉ�W�%��O��ʡS�t�n���a!�_�PxK��&bř�X[
+c��5��ʴZ�,�gȿ1��eSi��7x�J{�51���-��zF_�T\86λř����{��B�T'��K� �����^����#C�逤�!�iJ������b����uC��L�]{��r��<S;�L��sKgBg{C�L�;�ӕ�H��}Uȉߜ �a��������p7�{�-t���2|���Y>��a���5"+��d_�q��K�x�Ԉ�Ce~
+�/bne>��[�o���[�*�',���5h,���jL��,�fQ+�6��pVݩŃ��=�<��]��b*
+4��p6�ɇ*_���F������Fӹ t��
+��Y�D{�J�,��"��KynmH�c������+��)(IAs�F!i=f�en���U3Ù���a�rO����mo4��D��̉���$Bf��cQ�/3���Y�#�k��B^�&�}�G��;�d����kL�a�� \'�`Z_=e��9198�b����_�f��5�2�"�ڟqVC�Z��Ҋ���Vדh6L]����c�V�&E��F8$�x 4���
+�tH.�fMe�Rg��;PY9���'7�Z��܈?z��K@�Y�<���堀Y��/�mͬzwg�ճbw�hw�uJ
+���#&W��U�:י)v��-�O�mu�0��=�/*t�D;.R�2�}U}Օ�5Vr�%శ����X8'��JO���^c!Q�=�CG���'n����larr��,�,T�º�xH��5rn-b��%-[������=FBy^�e�-Za�Z!1/6=%sZ��-̽(R`�5`�0)=����E� 4lC�(8��9-[�bBzr�gY�k������
+�6r|vr�}��g�`�e�H@�@�#{�=P�2��(/�meq_e�1���@�!��{���b�l^?<� �tr��ܢ��7����{���:m`�ݸ+Ϗuv����
+�O���֧�v�PqT�bT��8�)X�m����"q�܌G>�e�#!{1#��_J�>\�q7l�'4�9)
+��Gj�K�+�}6 ��o���Չ���ͫD� �3��yf��g�IN�\&c����je��sq`a�#o���&Z?��1L4=3��l�F ��÷�
+��2'��~������k��豦Px���PZ����N�EM����E�$O�Q�L"ԄvCbJ�م����@qw�5~/A`p�2�xw���0PLKi�_Õ�TT)XP�a�+Ƨ�l��N��q����r \l��.e�[/�8�1�ۅY�e�q0��!������8V�i��K���JŊ���^F�<?��0[o�t����^Y�l�F����x�P^83�Oqa�a�F�U�r�K�Ox�Y��J�^3"*r�zzl���Y�C�����,�f,������j)��Zz5�V�\��O^����_~s�6lG�_��)��Œ���u��~&1~�I�����R��6������0�"����=q�9��汰4�B`a��P^�/e�����;1 ��fJ��/#��2�pY���~y�\U�#mxHn%?��=�^�d$Nj���F�a�ƙڳ��[CC�t����P�e�*/#��z}�G?
+1x��i/풱Y�M�;�s��HQ���'�)ZMT�H��W'cyᅧ�*i(��Z��wC�����qef��~t6.�^Ȁ�� �DžA��j�=y�99�-�DBb���$����q1;ֹ������X.RM�<�9DLs~IN6�����ݎ�'����ڟ������./�.�-w;gۺS�
+m�!��
+M�>B ����Vz����S�U�a�������䫁4�m �G��@rv��Y����}��|���;`�osq�M&�>b�9-=�QǗ;g�1��41�����>�����>��/��q��ĝ���!������)5ŋ��PX���K�� b��p`o\�aP��)�9�A��РC�c���7���P��D`
+�f/���F|E�JNwi ٢WR��}���.���=��I�M[��YxNT�v\|]��j�ac�*�G<���>U;��C����n%J��v��C��Pl��$g-���%l�n�������!���aƔ��9�f��K���;Hp�p���~��%zz�)����<�����tzxt)Zے�!�X�~��l�����Lc�>��Y�`����(�S���J��9n�1?���3�������-��P��em�F�n�櫮5;57�������P���p�hi$�auaׅ�E�R�I7�I�ό�^�.����]��m���^]�۟o-����ȉ*�/�8J�U*q���-�<9�-�#���o�[���L�:��W�bi�<����v窻�����Qˑ�]��W��O�F�SDpd�#�2�0a9���r�cpa͘PZ�a�zz�[f�F�8콐�
+�����{�e5ivf]����QX��ªhժ�-]�U��{ر%q�-�dc4��丱Vd��#a^\�y�r����3O��[�}Do�����B�(jߵ�Q��m��/Jo4��[���q��/L�47�2=
++n`(�ڷ?rk��}�q�D
+�z�b|�m'AB�{L
+:F
+�c��SZ��ٹ�{-��n� ��(�RFD&J�jq�K�!�""��.�T ɍ֮S ���ϰ��`�1��y�E��WW�Q�x�O���H�E�9T!�)�[���*M��!v�� �٪5����ǣ-������<o��"��Wu�2�z��_!R�p:0�0����]��L��}�����H��Ш0e%��$^��-�]'���+
+�I��T�������� �J���qb`RQ�ˣc=FN=� ��2��U�,�?^2���C�߇{X���|��o����[\e谅�9x��|�90����ş�Uy~��/0,����'����&�^T`���G�T腗�`5��cVo\��r�/#� �w�����_/mNXVT赺�k$~�B��� =wx�-�e^Ӳ����1�Ύy����V�<�{�r�#m�a-ٞu8V���tN�pw؆���b�=������>p7yF_����Bz�ح�����t���'��=o�%���:_dU����d�m{v�>.UV�����l�
+N�<s�Ԗ�A���d0��XU�@�)�F��.��A� ����
+_0��y�f�\l:i�E��f�&��Rs�Ԉ��}]j�j�nۊe@�y�أ�d�u������1_6@�l�S�K�v�s�,�$����C�N-��\����v�?���v����9�O;��q^`/�wM9������#`�nF�9QT����˘�Ԕ�
+pW' #�G�VR�=HAv1T�At�\��n�&/�K���p}�n�Z6��}�%n`D��Ȗͩ-+ft5�12l�"�-/�u.6V��MnMJY�r���e���K���h:�0R#�!T�
+��ոN�e�B�g�O'*бA��3��X3&D�G
+�]u�\�^bz��Ј�Sy��j�9�V���&K{�b>k�h�0JŖS�5���Sѱ^�Lx�;��y����������o~���AMż�{�|^���
+�+���c>_p��yOW߂�eK��p.V�b�S�-UطT�r��P�q��QO����M�*�\�9�e�ٷRx`ߪ�z� g=㾲���
+z*�.����m�W�mŅ"[m=pY5⭧��lw�Ͽ����9���x����S��B�b�)�]~ʈ����}
+��B��PxP^JO�~U�}������B���t�6�FCEׁi�s�y��.��h��Z��r�?��Y#�~�oGF��8e����GF�[~��m�+�qazh}��h<�MZ�۔O��\l�zOO,c.4�q_�.c.�o�W�˔���Ŵ���)�;�k������(�Zq�>.<����k�4�e1�Bxg}�a��y�M'��|���ˬ<J�S�q�r��4Rmq��q�=9Ğ������1��[?~���;�i��b��Q����K�s��,ʋ�qʾ%��8-��~�R'�1�1��\k\=\ij�jL��89��ՄUAK'6mI�&|y�4p↧��Մ>GK'�-��\qR!���[��[�=eE�r��xg]#9.�4pjAKv��4pfAIv#�ݴ4��j5%i�5�5q�CK'1��d�Mm�����6-�MĤ��@���=�8�&�~n:�Ę�m��~���٩��@M��\,
+���� o.��
+�bho�b
+d��*w��r����*���,�Tp����D�\2
+�x�� �4�zFCW�4�7GFCWqd4�7�CCE�Y�/��#�6L0����t:�ֶL Y��:�\��w�۲�\�������c��<�`yLJ$+u"��;�Jd!������&>�2�j�Z����p�Bsǒ��O2k�˱��ZF��8���O˨������=o,4���`y�eYh�3����zw<�대`y��$�;��rQӢ)�Ʋ�Wٸ���c0w\�9&=�
+�6'@�4���6�I��<��Ф$��|S�@�64�_+�x��G�f���֛,�踼�͈'�85��\뭋LpcoF�6�&�y2�(�m�dL�5㍉�>2�!L�N?��
+%�V&`�q| �]�gAmٌ��r�sF�]�g�W�2Ь�
+�� (�䙻�@i�Ȏ��,��D��9N� �����4�z1ܜ�U�Y�x�Ttn��(h�x�TZK�oA\H�z�s���ION���O�{0ћ�$'�����v,:��Z�m�/</|����N��L���>���V�<���^��8���!���N�������
+�4�(��Yf(�5�`G�
+��pDލV�i����v�s���sk#Y^�}#m_��<�m[��
+���⳧}�Yn����E��W���0��
+�|����PK�X��U&g3PK�hz<(�:K/.pollen.argoPK�hz<�GCY�8hpollen_Modèle.pgmlPK�hz<5��I��Cpollen_Services.pgmlPK�hz<d>�7�0'pollen_Context.pgmlPK�hz<4�[-m��$pollen.todoPK�hz<7Rp:B�%pollen_profile.profilePK�hz<�X��U&g3
+&pollen.xmiPK��L
\ No newline at end of file
Modified: trunk/pollen-ui/pom.xml
===================================================================
--- trunk/pollen-ui/pom.xml 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/pom.xml 2010-03-26 14:06:00 UTC (rev 2958)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.chorem</groupId>
<artifactId>pollen</artifactId>
- <version>1.3.0-SNAPSHOT</version>
+ <version>2.0-SNAPSHOT</version>
</parent>
<groupId>org.chorem.pollen</groupId>
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/ContextLink.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/ContextLink.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/ContextLink.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -2,7 +2,6 @@
package org.chorem.pollen.ui.base;
import java.io.File;
-import org.chorem.pollen.business.PollenBusinessException;
/**
* ContextLink
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/Polls.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/Polls.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/Polls.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -34,12 +34,9 @@
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.BeanModelSource;
import org.apache.tapestry5.services.Response;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.services.ServicePoll;
-import org.chorem.pollen.business.services.ServicePollAccount;
-import org.chorem.pollen.business.services.ServiceResults;
+import org.chorem.pollen.entity.Poll;
+import org.chorem.pollen.entity.UserAccount;
+import org.chorem.pollen.service.ServicePoll;
import org.chorem.pollen.ui.data.EvenOdd;
import org.chorem.pollen.ui.data.AddressBarItem;
import org.chorem.pollen.ui.data.PollAction;
@@ -62,7 +59,7 @@
@SuppressWarnings("unused")
@SessionState
@Property
- private UserDTO user;
+ private UserAccount user;
@SuppressWarnings("unused")
@Property
private boolean userExists;
@@ -71,13 +68,13 @@
* Liste de sondages de l'utilisateur
*/
@SuppressWarnings("unused")
- private List<PollDTO> polls;
+ private List<Poll> polls;
/**
* Sondage servant à l'itération des sondages de la liste
*/
@Property
- private PollDTO poll;
+ private Poll poll;
/**
* Objet servant à changer la couleur à chaque ligne de la liste des
@@ -122,21 +119,21 @@
/** Injection des services */
@Inject
private ServicePoll servicePoll;
- @Inject
- private ServicePollAccount servicePollAccount;
- @Inject
- private ServiceResults serviceResults;
+// @Inject
+// private ServicePollAccount servicePollAccount;
+// @Inject
+// private ServiceResults serviceResults;
/**
* Récupération de l'identifiant de modification du sondage.
*
* @return l'identifiant.
*/
- public String getAdminId() {
- PollAccountDTO creator = servicePollAccount.findPollAccountById(poll
- .getCreatorId());
- return poll.getPollUId() + ":" + creator.getAccountUId();
- }
+// public String getAdminId() {
+// PollAccount creator = servicePollAccount.findPollAccountById(poll
+// .getCreatorId());
+// return poll.getPollUId() + ":" + creator.getAccountUId();
+// }
/**
* Fermeture du sondage.
@@ -170,7 +167,7 @@
}
confirmPoll.setBackPage(backPage);
confirmPoll.setAction(pollAction);
- confirmPoll.setPoll(servicePoll.getPoll(pollId));
+ confirmPoll.setPoll(poll);
return confirmPoll;
}
@@ -180,21 +177,24 @@
* @return le flux correspondant au fichier
*/
public Object onActionFromExport(String id) {
- final String filename = serviceResults.exportPoll(id);
+ // FIXME : create service for export
- // Retour d'un StreamResponse contenant le fichier XML
- return new StreamResponse() {
- public String getContentType() {
- return "text/xml";
- }
-
- public InputStream getStream() throws IOException {
- return new FileInputStream(new File(filename));
- }
-
- public void prepareResponse(Response response) {
- }
- };
+// final String filename = serviceResults.exportPoll(id);
+//
+// // Retour d'un StreamResponse contenant le fichier XML
+// return new StreamResponse() {
+// public String getContentType() {
+// return "text/xml";
+// }
+//
+// public InputStream getStream() throws IOException {
+// return new FileInputStream(new File(filename));
+// }
+//
+// public void prepareResponse(Response response) {
+// }
+// };
+ return null;
}
/**
@@ -211,7 +211,7 @@
address = new AddressBarItem[] { new AddressBarItem("Pollen", "Index"),
new AddressBarItem(title, null) };
- pollsModel = beanModelSource.createDisplayModel(PollDTO.class,
+ pollsModel = beanModelSource.createDisplayModel(Poll.class,
componentResources.getMessages());
pollsModel.add("functions", null);
pollsModel.include("title", "description", "beginChoiceDate",
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Border.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Border.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Border.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -24,7 +24,6 @@
import java.util.Locale;
import org.apache.tapestry5.BindingConstants;
-import org.apache.tapestry5.Block;
import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.IncludeStylesheet;
import org.apache.tapestry5.annotations.InjectComponent;
@@ -35,13 +34,14 @@
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.PersistentLocale;
import org.apache.tapestry5.services.Request;
-import org.chorem.pollen.business.PollenContext;
-import org.chorem.pollen.business.PollenProperty;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.services.ServiceAuth;
-import org.chorem.pollen.business.utils.MD5;
+import org.chorem.pollen.PollenContext;
+import org.chorem.pollen.PollenProperty;
+import org.chorem.pollen.entity.UserAccount;
import org.chorem.pollen.ui.base.ContextLink;
import org.chorem.pollen.ui.data.AddressBarItem;
+import org.chorem.pollen.MD5;
+import org.chorem.pollen.PollenBusinessException;
+import org.chorem.pollen.service.ServiceUser;
/**
* Classe du Layout Component Border.
@@ -129,7 +129,7 @@
*/
@SessionState
@Property
- private UserDTO user;
+ private UserAccount user;
/**
* vrai si l'utilisateur s'est identifié, faux sinon
@@ -170,7 +170,7 @@
/** Injection des services */
@Inject
- private ServiceAuth serviceAuth;
+ private ServiceUser serviceUser;
@InjectComponent
private ContextLink feedContext;
@@ -189,17 +189,23 @@
*
* @return la zone à mettre à jour
*/
- Object onSuccessFromLoginForm() {
- UserDTO userDTO = serviceAuth.getUser(login, MD5.encode(password));
- if (userDTO != null) {
- user = userDTO;
- feedback.addInfo(messages.get("loginOk"));
- } else {
+ Object onSuccessFromLoginCompForm() {
+ // Récupération de l'utilisateur identifié
+ UserAccount current;
+ try {
+ current = serviceUser.connect(login, MD5.encode(password));
+ if (current != null) {
+ user = current;
+ feedback.addInfo(messages.get("loginOk"));
+ } else {
+ feedback.addError(messages.get("loginFailed"));
+ }
+ } catch (PollenBusinessException ex) {
+ // TODO
feedback.addError(messages.get("loginFailed"));
}
- return null;
+ return this;
}
-
/**
* Methode appelée lorsque l'utilisateur se déconnecte. L'objet user est
* désinstancié (=null).
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FeedContextLink.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FeedContextLink.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FeedContextLink.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -3,9 +3,9 @@
import java.io.File;
import org.apache.tapestry5.ioc.annotations.Inject;
-import org.chorem.pollen.business.PollenContext;
+import org.chorem.pollen.PollenContext;
import org.chorem.pollen.ui.base.ContextLink;
-import org.chorem.pollen.business.PollenProperty;
+import org.chorem.pollen.PollenProperty;
/**
* FeedLink
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FileLink.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FileLink.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FileLink.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -16,7 +16,6 @@
package org.chorem.pollen.ui.components;
-import org.chorem.pollen.business.PollenBusinessException;
import org.chorem.pollen.ui.base.ContextLink;
import java.io.File;
import java.io.FileInputStream;
Deleted: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Image.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Image.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Image.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -1,172 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.ui.components;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.activation.MimetypesFileTypeMap;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.tapestry5.ComponentResources;
-import org.apache.tapestry5.Link;
-import org.apache.tapestry5.StreamResponse;
-import org.apache.tapestry5.annotations.Parameter;
-import org.apache.tapestry5.ioc.annotations.Inject;
-import org.apache.tapestry5.services.Response;
-import org.chorem.pollen.business.PollenBusinessException;
-import org.slf4j.Logger;
-
-/**
- * Composant qui affiche une image.
- *
- * Ce composant permet d'afficher une image dynamique (exemple : image uploadée
- * sur le serveur par un formulaire).
- *
- * <pre>
- * Utilisation :
- * <t:image src="/img/image.png" />
- * Pour afficher une image statique il est préférable d'utiliser :
- * <img src="${asset:context:img}/image.png" />
- * </pre>
- *
- * @author rannou
- * @version $Id$
- * @deprecated use links + event + serviceImage depends on page
- */
-@Deprecated
-public class Image extends ImageContextLink {
-
- /** Chemin de l'image */
- @Parameter(required = true)
- private String src;
-
- /** Texte alternatif */
- @Parameter
- private String alt;
-
- /** Largeur de l'image */
- @Parameter
- private int width;
-
- /** Hauteur de l'image */
- @Parameter
- private int height;
-
- @Inject
- private Logger logger;
-
- @Inject
- private ComponentResources resources;
-
- /**
- * @return the src
- */
- public String getSrc() {
- return src;
- }
-
- /**
- * @return the alt
- */
- public String getAlt() {
- return alt;
- }
-
- /**
- * @return the width
- */
- public int getWidth() {
- return width;
- }
-
- /**
- * @return the height
- */
- public int getHeight() {
- return height;
- }
-
- /**
- * Create a link to call "thumbLink" event.
- *
- * @return event link
- */
- public Link getThumbLink() {
- return resources.createEventLink("imageLink", src, width,
- height, true);
- }
-
- /**
- * Create a link to call "imageLink" event.
- *
- * @return event link
- */
- public Link getImageLink() {
- return resources.createEventLink("imageLink", src, width,
- height, false);
- }
-
- /** Affichage de l'image */
- public StreamResponse onImageLink(final String src, final int width,
- final int height, boolean thumb) {
-
- // security : src containing .. are filtered, to not access to full system
- if (StringUtils.isEmpty(src) || src.contains("..")) {
- return null;
- }
-
- File file = getFile(src, thumb);
- FileInputStream stream = null;
- try {
- stream = new FileInputStream(file);
- } catch (FileNotFoundException e) {
- logger.error("Fichier inexistant : " + file.getAbsolutePath(), e);
- }
-
- MimetypesFileTypeMap mimes = new MimetypesFileTypeMap();
- String type = mimes.getContentType(file);
-
- return new ImageStreamResponse(stream, type);
- }
-
- /** Création du flux de l'image */
- class ImageStreamResponse implements StreamResponse {
- protected String contentType;
- protected InputStream stream;
-
- public ImageStreamResponse(InputStream stream, String contentType) {
- this.stream = stream;
- this.contentType = contentType;
- }
-
- public String getContentType() {
- return contentType;
- }
-
- public InputStream getStream() throws IOException {
- return stream;
- }
-
- public void prepareResponse(Response response) {
-
- }
- }
-}
\ No newline at end of file
Deleted: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ImageContextLink.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ImageContextLink.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ImageContextLink.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -1,91 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.ui.components;
-
-import java.io.File;
-import org.apache.tapestry5.annotations.Parameter;
-import org.apache.tapestry5.ioc.annotations.Inject;
-import org.chorem.pollen.business.PollenContext;
-import org.chorem.pollen.business.PollenProperty;
-import org.chorem.pollen.ui.base.ContextLink;
-
-/**
- * ImageContextLink
- *
- * Created: 4 nov. 2009
- *
- * @author fdesbois
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- * @deprecated use {@link org.chorem.pollen.ui.services.ServiceImage } instead
- */
-@Deprecated
-public class ImageContextLink implements ContextLink {
-
- public static final String THUMB_PREFIX = "thumb_";
-
- @Inject
- private PollenContext pollen;
-
- /**
- * Directory for files getting or saving from this context
- * (ie. subdirectory where images are uploaded, main directory is defined by contextPath)
- */
- @Parameter
- private String dir;
-
- /**
- * true for thumbnails images prefixed by {@link Configuration.IMG_DIR}
- */
- @Parameter
- private boolean thumb;
-
- @Override
- public String getContextPath() {
- return pollen.getProperty(PollenProperty.IMG_DIR);
- }
-
- @Override
- public File getFile(String filename) {
- return getFile(filename, thumb);
- }
-
- public File getFile(String filename, boolean thumb) {
- if (thumb) {
- filename = THUMB_PREFIX + filename;
- }
- return new File(getImageDir(), filename);
- }
-
- /**
- * Get the directory where are uploaded the images from the context.
- * @return a File corresponding to the image directory
- * @
- */
- public File getImageDir() {
- File result = null;
- if (dir != null && !dir.isEmpty()) {
- result = new File(getContextPath(), dir);
- } else {
- result = new File(getContextPath());
- }
- return result;
- }
-
-}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/LoginComponent.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/LoginComponent.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/LoginComponent.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -16,15 +16,18 @@
package org.chorem.pollen.ui.components;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.IncludeStylesheet;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.services.ServiceAuth;
-import org.chorem.pollen.business.utils.MD5;
+import org.chorem.pollen.MD5;
+import org.chorem.pollen.PollenBusinessException;
+import org.chorem.pollen.entity.UserAccount;
+import org.chorem.pollen.service.ServiceUser;
/**
* Formulaire d'identification. Formulaire que l'utilisateur doit remplir pour
@@ -45,7 +48,7 @@
*/
@SuppressWarnings("unused")
@SessionState
- private UserDTO user;
+ private UserAccount user;
@SuppressWarnings("unused")
@Property
private boolean userExists;
@@ -67,7 +70,7 @@
/** Injection des services */
@Inject
- private ServiceAuth serviceAuth;
+ private ServiceUser serviceUser;
/**
* Methode appelée lorsque l'utilisateur s'identifie
@@ -75,13 +78,17 @@
* @return la zone à mettre à jour
*/
Object onSuccessFromLoginCompForm() {
-
// Récupération de l'utilisateur identifié
- UserDTO userDTO = serviceAuth.getUser(loginComp, MD5
- .encode(passwordComp));
- if (userDTO != null) {
- user = userDTO;
- } else {
+ UserAccount current;
+ try {
+ current = serviceUser.connect(loginComp, MD5.encode(passwordComp));
+ if (current != null) {
+ user = current;
+ } else {
+ feedback.addError(messages.get("loginFailed"));
+ }
+ } catch (PollenBusinessException ex) {
+ // TODO
feedback.addError(messages.get("loginFailed"));
}
return this;
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ChoiceField.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ChoiceField.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ChoiceField.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -4,11 +4,10 @@
import java.util.Date;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.lang.StringUtils;
-import org.apache.tapestry5.Block;
import org.apache.tapestry5.upload.services.UploadedFile;
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.dto.PollDTO;
import org.chorem.pollen.common.ChoiceType;
+import org.chorem.pollen.entity.Choice;
+import org.chorem.pollen.entity.Poll;
import org.chorem.pollen.ui.services.ServiceImage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -36,11 +35,11 @@
* Mise a jour: $Date$
* par : $Author$
*/
-public class ChoiceField extends ChoiceDTO {
+public class ChoiceField {
private static final Logger log = LoggerFactory.getLogger(ChoiceField.class);
- protected ChoiceType type;
+ protected Choice choice;
protected Date date;
@@ -56,7 +55,7 @@
}
- public ChoiceField(PollDTO poll) {
+ public ChoiceField(Poll poll) {
switch (poll.getChoiceType()) {
case DATE:
setDateType();
@@ -65,35 +64,36 @@
setTextType();
break;
case IMAGE:
- setImageType(poll.getPollUId());
+ setImageType(poll.getUId());
}
}
- public ChoiceField(PollDTO poll, ChoiceDTO dto) {
+ public ChoiceField(Poll poll, Choice choice) {
this(poll);
+ this.choice = choice;
if (log.isDebugEnabled()) {
log.debug("Instanciate ChoiceField : " +
- "type = " + poll.getChoiceType() +
- " _ name = " + dto.getName());
+ "type = " + getChoiceType() +
+ " _ name = " + getName());
}
- switch (poll.getChoiceType()) {
+ switch (getChoiceType()) {
case DATE:
- setDate(new Date(Long.parseLong(dto.getName())));
+ setDate(new Date(Long.parseLong(choice.getName())));
break;
case TEXT:
- setText(dto.getName());
+ setText(choice.getName());
break;
case IMAGE:
- setImageFileName(dto.getName());
+ setImageFileName(choice.getName());
}
- setDescription(dto.getDescription());
- setHidden(dto.getHidden());
- setId(dto.getId());
- setValidate(dto.getValidate());
-// setPollUId(dto.getPollUId());
- setName(dto.getName());
- //setValue(dto.getValue());
- //setVoteId(dto.getVoteId());
+// setDescription(dto.getDescription());
+// setHidden(dto.getHidden());
+// setTopiaId(dto.getTopiaId());
+// setValidate(dto.getValidate());
+//// setPollUId(dto.getPollUId());
+// setName(dto.getName());
+// //setValue(dto.getValue());
+// //setVoteId(dto.getVoteId());
}
/**
@@ -141,7 +141,7 @@
* @see #saveName()
*/
public void setDateType() {
- this.type = ChoiceType.DATE;
+ setChoiceType(ChoiceType.DATE);
image = null;
}
@@ -153,7 +153,7 @@
* @see #saveName()
*/
public void setImageType(String pollUId) {
- this.type = ChoiceType.IMAGE;
+ setChoiceType(ChoiceType.IMAGE);
imageDir = pollUId;
date = null;
}
@@ -162,15 +162,11 @@
* Change type of the choice to text type.
*/
public void setTextType() {
- this.type = ChoiceType.TEXT;
+ setChoiceType(ChoiceType.TEXT);
date = null;
image = null;
}
- public ChoiceType getType() {
- return type;
- }
-
public void setDate(Date date) {
this.date = date;
}
@@ -230,7 +226,7 @@
*/
public void saveName(ServiceImage serviceImage) {
String name = "";
- switch (type) {
+ switch (getChoiceType()) {
case DATE:
name = String.valueOf(getDate().getTime());
break;
@@ -260,4 +256,30 @@
}
setName(name);
}
+
+ public void setName(String name) {
+ choice.setName(name);
+ }
+
+ public void setDescription(String description) {
+ choice.setDescription(description);
+ }
+
+ public void setChoiceType(ChoiceType choiceType) {
+ choice.setChoiceType(choiceType);
+ }
+
+ public String getName() {
+ return choice.getName();
+ }
+
+ public String getDescription() {
+ return choice.getDescription();
+ }
+
+ public ChoiceType getChoiceType() {
+ return choice.getChoiceType();
+ }
+
+
}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/PollHelper.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/PollHelper.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/PollHelper.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -16,19 +16,6 @@
package org.chorem.pollen.ui.data;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.dto.PreventRuleDTO;
-import org.chorem.pollen.business.dto.VotingListDTO;
-import org.chorem.pollen.common.ChoiceType;
-import org.chorem.pollen.ui.data.uio.DateChoiceUIO;
-import org.chorem.pollen.ui.data.uio.ImageChoiceUIO;
-
/**
* Gestion de la copie d'un sondage existant pour en créer un nouveau.
*
@@ -43,150 +30,150 @@
* @param oldPoll le sondage existant
* @return le nouveau sondage
*/
- public static PollDTO getPoll(PollDTO oldPoll) {
- PollDTO newPoll = new PollDTO();
- newPoll.setTitle(oldPoll.getTitle());
- newPoll.setDescription(oldPoll.getDescription());
- newPoll.setBeginChoiceDate(oldPoll.getBeginChoiceDate());
- newPoll.setBeginDate(oldPoll.getBeginDate());
- newPoll.setEndDate(oldPoll.getEndDate());
- newPoll.setAnonymous(oldPoll.isAnonymous());
- newPoll.setAnonymousVoteAllowed(oldPoll.isAnonymousVoteAllowed());
- newPoll.setPublicResults(oldPoll.isPublicResults());
- newPoll.setContinuousResults(oldPoll.isContinuousResults());
- newPoll.setChoiceAddAllowed(oldPoll.isChoiceAddAllowed());
- newPoll.setMaxChoiceNb(oldPoll.getMaxChoiceNb());
- newPoll.setChoiceType(oldPoll.getChoiceType());
- newPoll.setPollType(oldPoll.getPollType());
- newPoll.setVoteCounting(oldPoll.getVoteCounting());
- return newPoll;
- }
-
- /**
- * Création de listes de votants à partir d'un sondage existant.
- *
- * @param oldPoll le sondage existant
- * @return les listes de votants
- */
- public static List<VotingListDTO> getVotingLists(PollDTO oldPoll) {
- List<VotingListDTO> votingLists = new ArrayList<VotingListDTO>();
- for (VotingListDTO oldList : oldPoll.getVotingListDTOs()) {
- VotingListDTO votingList = new VotingListDTO();
- votingList.setName(oldList.getName());
- votingList.setWeight(oldList.getWeight());
- votingList.setPollAccountDTOs(getPollAccounts(oldList));
- votingLists.add(votingList);
- }
- return votingLists;
- }
-
- private static List<PollAccountDTO> getPollAccounts(VotingListDTO oldList) {
- List<PollAccountDTO> pollAccounts = new ArrayList<PollAccountDTO>();
- for (PollAccountDTO oldAccount : oldList.getPollAccountDTOs()) {
- PollAccountDTO pollAccount = new PollAccountDTO();
- pollAccount.setVotingId(oldAccount.getVotingId());
- pollAccount.setEmail(oldAccount.getEmail());
- pollAccount.setWeight(oldAccount.getWeight());
- pollAccounts.add(pollAccount);
- }
- return pollAccounts;
- }
-
- /**
- * Création de choix de type Texte à partir d'un sondage existant.
- *
- * @param oldPoll le sondage existant
- * @return les choix
- */
- public static List<ChoiceDTO> getTextChoices(PollDTO oldPoll) {
- List<ChoiceDTO> choices = new ArrayList<ChoiceDTO>();
- if (oldPoll.getChoiceType() == ChoiceType.TEXT) {
- for (ChoiceDTO oldChoice : oldPoll.getChoices()) {
- ChoiceDTO choice = new ChoiceDTO();
- choice.setName(oldChoice.getName());
- choice.setDescription(oldChoice.getDescription());
- choices.add(choice);
- }
- }
- return choices;
- }
-
- /**
- * Création de choix de type Date à partir d'un sondage existant.
- *
- * @param oldPoll le sondage existant
- * @return les choix
- */
- public static List<DateChoiceUIO> getDateChoices(PollDTO oldPoll) {
- List<DateChoiceUIO> choices = new ArrayList<DateChoiceUIO>();
- if (oldPoll.getChoiceType() == ChoiceType.DATE) {
- for (ChoiceDTO oldChoice : oldPoll.getChoices()) {
- DateChoiceUIO choice = new DateChoiceUIO();
- choice.setName(oldChoice.getName());
- choice.setDescription(oldChoice.getDescription());
- Date date = new Date(Long.valueOf(choice.getName()));
- choice.setDate(date);
- choices.add(choice);
- }
- }
- return choices;
- }
-
- /**
- * Création de choix de type Image à partir d'un sondage existant.
- *
- * @param oldPoll le sondage existant
- * @return les choix
- */
- public static List<ImageChoiceUIO> getImageChoices(PollDTO oldPoll) {
- List<ImageChoiceUIO> choices = new ArrayList<ImageChoiceUIO>();
- if (oldPoll.getChoiceType() == ChoiceType.IMAGE) {
- /*for (ChoiceDTO oldChoice : oldPoll.getChoiceDTOs()) {
- ImageChoiceUIO choice = new ImageChoiceUIO();
- choice.setName(oldChoice.getName());
- choice.setDescription(oldChoice.getDescription());
- //TODO copie des images de l'ancien sondage et initialisation UploadedFile
- choices.add(choice);
- }*/
- }
- return choices;
- }
-
- /**
- * Création de la règle de notification à partir d'un sondage existant.
- *
- * @param oldPoll le sondage existant
- * @return la règle
- */
- public static PreventRuleDTO getNotificationPreventRule(PollDTO oldPoll) {
- PreventRuleDTO preventRule = new PreventRuleDTO();
- for (PreventRuleDTO oldRule : oldPoll.getPreventRuleDTOs()) {
- if ("vote".equals(oldRule.getScope())) {
- preventRule.setScope(oldRule.getScope());
- preventRule.setSensibility(oldRule.getSensibility());
- preventRule.setRepeated(oldRule.isRepeated());
- preventRule.setMethod(oldRule.getMethod());
- }
- }
- return preventRule;
- }
-
- /**
- * Création de la règle de rappel à partir d'un sondage existant.
- *
- * @param oldPoll le sondage existant
- * @return la règle
- */
- public static PreventRuleDTO getReminderPreventRule(PollDTO oldPoll) {
- PreventRuleDTO preventRule = new PreventRuleDTO();
- for (PreventRuleDTO oldRule : oldPoll.getPreventRuleDTOs()) {
- if ("rappel".equals(oldRule.getScope())) {
- preventRule.setScope(oldRule.getScope());
- preventRule.setSensibility(oldRule.getSensibility());
- preventRule.setRepeated(oldRule.isRepeated());
- preventRule.setMethod(oldRule.getMethod());
- }
- }
- return preventRule;
- }
+// public static PollDTO getPoll(PollDTO oldPoll) {
+// PollDTO newPoll = new PollDTO();
+// newPoll.setTitle(oldPoll.getTitle());
+// newPoll.setDescription(oldPoll.getDescription());
+// newPoll.setBeginChoiceDate(oldPoll.getBeginChoiceDate());
+// newPoll.setBeginDate(oldPoll.getBeginDate());
+// newPoll.setEndDate(oldPoll.getEndDate());
+// newPoll.setAnonymous(oldPoll.isAnonymous());
+// newPoll.setAnonymousVoteAllowed(oldPoll.isAnonymousVoteAllowed());
+// newPoll.setPublicResults(oldPoll.isPublicResults());
+// newPoll.setContinuousResults(oldPoll.isContinuousResults());
+// newPoll.setChoiceAddAllowed(oldPoll.isChoiceAddAllowed());
+// newPoll.setMaxChoiceNb(oldPoll.getMaxChoiceNb());
+// newPoll.setChoiceType(oldPoll.getChoiceType());
+// newPoll.setPollType(oldPoll.getPollType());
+// newPoll.setVoteCounting(oldPoll.getVoteCounting());
+// return newPoll;
+// }
+//
+// /**
+// * Création de listes de votants à partir d'un sondage existant.
+// *
+// * @param oldPoll le sondage existant
+// * @return les listes de votants
+// */
+// public static List<VotingListDTO> getVotingLists(PollDTO oldPoll) {
+// List<VotingListDTO> votingLists = new ArrayList<VotingListDTO>();
+// for (VotingListDTO oldList : oldPoll.getVotingListDTOs()) {
+// VotingListDTO votingList = new VotingListDTO();
+// votingList.setName(oldList.getName());
+// votingList.setWeight(oldList.getWeight());
+// votingList.setPollAccountDTOs(getPollAccounts(oldList));
+// votingLists.add(votingList);
+// }
+// return votingLists;
+// }
+//
+// private static List<PollAccountDTO> getPollAccounts(VotingListDTO oldList) {
+// List<PollAccountDTO> pollAccounts = new ArrayList<PollAccountDTO>();
+// for (PollAccountDTO oldAccount : oldList.getPollAccountDTOs()) {
+// PollAccountDTO pollAccount = new PollAccountDTO();
+// pollAccount.setVotingId(oldAccount.getVotingId());
+// pollAccount.setEmail(oldAccount.getEmail());
+// pollAccount.setWeight(oldAccount.getWeight());
+// pollAccounts.add(pollAccount);
+// }
+// return pollAccounts;
+// }
+//
+// /**
+// * Création de choix de type Texte à partir d'un sondage existant.
+// *
+// * @param oldPoll le sondage existant
+// * @return les choix
+// */
+// public static List<ChoiceDTO> getTextChoices(PollDTO oldPoll) {
+// List<ChoiceDTO> choices = new ArrayList<ChoiceDTO>();
+// if (oldPoll.getChoiceType() == ChoiceType.TEXT) {
+// for (ChoiceDTO oldChoice : oldPoll.getChoices()) {
+// ChoiceDTO choice = new ChoiceDTO();
+// choice.setName(oldChoice.getName());
+// choice.setDescription(oldChoice.getDescription());
+// choices.add(choice);
+// }
+// }
+// return choices;
+// }
+//
+// /**
+// * Création de choix de type Date à partir d'un sondage existant.
+// *
+// * @param oldPoll le sondage existant
+// * @return les choix
+// */
+// public static List<DateChoiceUIO> getDateChoices(PollDTO oldPoll) {
+// List<DateChoiceUIO> choices = new ArrayList<DateChoiceUIO>();
+// if (oldPoll.getChoiceType() == ChoiceType.DATE) {
+// for (ChoiceDTO oldChoice : oldPoll.getChoices()) {
+// DateChoiceUIO choice = new DateChoiceUIO();
+// choice.setName(oldChoice.getName());
+// choice.setDescription(oldChoice.getDescription());
+// Date date = new Date(Long.valueOf(choice.getName()));
+// choice.setDate(date);
+// choices.add(choice);
+// }
+// }
+// return choices;
+// }
+//
+// /**
+// * Création de choix de type Image à partir d'un sondage existant.
+// *
+// * @param oldPoll le sondage existant
+// * @return les choix
+// */
+// public static List<ImageChoiceUIO> getImageChoices(PollDTO oldPoll) {
+// List<ImageChoiceUIO> choices = new ArrayList<ImageChoiceUIO>();
+// if (oldPoll.getChoiceType() == ChoiceType.IMAGE) {
+// /*for (ChoiceDTO oldChoice : oldPoll.getChoiceDTOs()) {
+// ImageChoiceUIO choice = new ImageChoiceUIO();
+// choice.setName(oldChoice.getName());
+// choice.setDescription(oldChoice.getDescription());
+// //TODO copie des images de l'ancien sondage et initialisation UploadedFile
+// choices.add(choice);
+// }*/
+// }
+// return choices;
+// }
+//
+// /**
+// * Création de la règle de notification à partir d'un sondage existant.
+// *
+// * @param oldPoll le sondage existant
+// * @return la règle
+// */
+// public static PreventRuleDTO getNotificationPreventRule(PollDTO oldPoll) {
+// PreventRuleDTO preventRule = new PreventRuleDTO();
+// for (PreventRuleDTO oldRule : oldPoll.getPreventRuleDTOs()) {
+// if ("vote".equals(oldRule.getScope())) {
+// preventRule.setScope(oldRule.getScope());
+// preventRule.setSensibility(oldRule.getSensibility());
+// preventRule.setRepeated(oldRule.isRepeated());
+// preventRule.setMethod(oldRule.getMethod());
+// }
+// }
+// return preventRule;
+// }
+//
+// /**
+// * Création de la règle de rappel à partir d'un sondage existant.
+// *
+// * @param oldPoll le sondage existant
+// * @return la règle
+// */
+// public static PreventRuleDTO getReminderPreventRule(PollDTO oldPoll) {
+// PreventRuleDTO preventRule = new PreventRuleDTO();
+// for (PreventRuleDTO oldRule : oldPoll.getPreventRuleDTOs()) {
+// if ("rappel".equals(oldRule.getScope())) {
+// preventRule.setScope(oldRule.getScope());
+// preventRule.setSensibility(oldRule.getSensibility());
+// preventRule.setRepeated(oldRule.isRepeated());
+// preventRule.setMethod(oldRule.getMethod());
+// }
+// }
+// return preventRule;
+// }
}
Deleted: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/uio/DateChoiceUIO.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/uio/DateChoiceUIO.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/uio/DateChoiceUIO.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -1,41 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.ui.data.uio;
-
-import java.util.Date;
-
-import org.chorem.pollen.business.dto.ChoiceDTO;
-
-/**
- * Classe représentant un choix de type Date. Un DateChoiceUIO est un Choice
- * avec un champs date supplémentaire permettant à l'interface de gérer la date.
- *
- * @author kmorin
- * @version $Id$
- */
-public class DateChoiceUIO extends ChoiceDTO {
-
- private Date date;
-
- public Date getDate() {
- return date;
- }
-
- public void setDate(Date date) {
- this.date = date;
- }
-}
Deleted: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/uio/ImageChoiceUIO.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/uio/ImageChoiceUIO.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/uio/ImageChoiceUIO.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -1,40 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.ui.data.uio;
-
-import org.apache.tapestry5.upload.services.UploadedFile;
-import org.chorem.pollen.business.dto.ChoiceDTO;
-
-/**
- * Classe représentant un choix de type Image. Un ImageChoiceUIO est un Choice
- * avec un champs img supplémentaire permettant de gérer l'upload du fichier.
- *
- * @author kmorin
- * @version $Id$
- */
-public class ImageChoiceUIO extends ChoiceDTO {
-
- private UploadedFile img;
-
- public UploadedFile getImg() {
- return img;
- }
-
- public void setImg(UploadedFile img) {
- this.img = img;
- }
-}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/admin/PollsAdmin.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/admin/PollsAdmin.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/admin/PollsAdmin.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -24,9 +24,9 @@
import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.services.ServicePoll;
+import org.chorem.pollen.entity.Poll;
+import org.chorem.pollen.entity.UserAccount;
+import org.chorem.pollen.service.ServicePoll;
import org.chorem.pollen.ui.base.Polls;
import org.chorem.pollen.ui.components.FeedBack;
@@ -48,7 +48,7 @@
* Objet de session représentant l'utilisateur identifié.
*/
@SessionState
- private UserDTO user;
+ private UserAccount user;
private boolean userExists;
/**
@@ -56,7 +56,7 @@
*/
@SuppressWarnings("unused")
@Property
- private List<PollDTO> polls;
+ private List<Poll> polls;
/**
* Messages.
@@ -74,10 +74,10 @@
@Override
public void onActivate() {
super.onActivate();
- polls = servicePoll.selectPolls(null);
+ polls = servicePoll.getAllPolls();
// Affichage des erreurs
- if (userExists && !user.isAdministrator()) {
+ if (userExists && !user.getAdmin()) {
feedback.addError(messages.get("userNotAllowed"));
}
}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/admin/UsersAdmin.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/admin/UsersAdmin.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/admin/UsersAdmin.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -31,16 +31,13 @@
import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
-import org.chorem.pollen.business.PollenContext;
-import org.chorem.pollen.business.PollenProperty;
-import org.chorem.pollen.business.business.PreventRuleManager;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.services.ServiceList;
-import org.chorem.pollen.business.services.ServiceUser;
-import org.chorem.pollen.business.utils.MD5;
+import org.chorem.pollen.PollenContext;
+import org.chorem.pollen.PollenProperty;
+import org.chorem.pollen.entity.UserAccount;
+import org.chorem.pollen.mail.PreventRuleManager;
+import org.chorem.pollen.service.ServiceUser;
import org.chorem.pollen.ui.components.FeedBack;
import org.chorem.pollen.ui.data.AddressBarItem;
-import org.chorem.pollen.ui.utils.PasswordGenerator;
/**
* Classe d'administration des comptes utilisateurs. Si l'utilisateur n'est pas
@@ -67,7 +64,7 @@
*/
@SessionState
@Property
- private UserDTO user;
+ private UserAccount user;
@Property
private boolean userExists;
@@ -90,13 +87,13 @@
*/
@Property
@Persist
- private List<UserDTO> accounts;
+ private List<UserAccount> accounts;
/**
* Utilisateur courant.
*/
@Property
- private UserDTO account;
+ private UserAccount account;
/**
* Ressources de la page.
@@ -113,15 +110,15 @@
/** Injection des services */
@Inject
private ServiceUser serviceUser;
- @Inject
- private ServiceList serviceList;
+// @Inject
+// private ServiceList serviceList;
/**
* Initialisation du formulaire.
*/
public void onPrepareFromUsersForm() {
if (accounts == null) {
- accounts = serviceUser.selectUsers(null);
+ accounts = serviceUser.getUsers();
}
}
@@ -129,20 +126,24 @@
* Méthode appelée lors de la soumission du formulaire.
*/
public Object onSuccessFromUsersForm() {
- for (UserDTO usr : accounts) {
- if (serviceUser.findUserById(usr.getId()) != null) {
- serviceUser.updateUser(usr);
- } else {
- String password = PasswordGenerator.generate(8);
- if (serviceUser.createUser(usr, MD5.encode(password)) != null) {
- feedback.addInfo(messages.format("userCreated", usr
- .getLogin()));
- sendMailNotification(usr, password);
- } else {
- feedback.addError(messages.format("userNotCreated", usr
- .getLogin()));
- }
- }
+ for (UserAccount usr : accounts) {
+ serviceUser.createUpdateUser(usr);
+
+ // FIXME : test and refactor to manage errors
+
+// if (serviceUser.findUserById(usr.getId()) != null) {
+// serviceUser.createUpdateUser(usr);
+// } else {
+// String password = PasswordGenerator.generate(8);
+// if (serviceUser.createUser(usr, MD5.encode(password)) != null) {
+// feedback.addInfo(messages.format("userCreated", usr
+// .getLogin()));
+// sendMailNotification(usr, password);
+// } else {
+// feedback.addError(messages.format("userNotCreated", usr
+// .getLogin()));
+// }
+// }
}
feedback.addInfo(messages.get("dataSaved"));
resources.discardPersistentFieldChanges();
@@ -152,44 +153,47 @@
/**
* Méthode appelée lors de l'ajout d'un utilisateur.
*/
- Object onAddRowFromUsersLoop() {
- UserDTO usr = new UserDTO();
- usr.setId(String.valueOf(System.nanoTime()));
- accounts.add(usr);
- return usr;
- }
+// Object onAddRowFromUsersLoop() {
+// // FIXME : wtf ?
+//
+//
+// UserAccount usr = new UserAccountImpl();
+// //usr.setId(String.valueOf(System.nanoTime()));
+// accounts.add(usr);
+// return usr;
+// }
/**
* Méthode appelée lors de la suppression d'un utilisateur.
*/
- void onRemoveRowFromUsersLoop(UserDTO usr) {
- if (serviceUser.findUserById(usr.getId()) != null) {
+// void onRemoveRowFromUsersLoop(UserAccount usr) {
+// if (serviceUser.findUserById(usr.getId()) != null) {
+//
+// // suppression des listes de votants de l'utilisateur
+// serviceList.deletePersonLists(usr.getId());
+//
+// // suppression de l'utilisateur
+// if (serviceUser.deleteUser(usr)) {
+// accounts.remove(usr);
+// }
+// } else {
+// accounts.remove(usr);
+// }
+// }
- // suppression des listes de votants de l'utilisateur
- serviceList.deletePersonLists(usr.getId());
-
- // suppression de l'utilisateur
- if (serviceUser.deleteUser(usr)) {
- accounts.remove(usr);
- }
- } else {
- accounts.remove(usr);
- }
- }
-
/**
* Encoder permettant de transformer un ID en user.
*/
- public ValueEncoder<UserDTO> getUserEncoder() {
- return new ValueEncoder<UserDTO>() {
+ public ValueEncoder<UserAccount> getUserEncoder() {
+ return new ValueEncoder<UserAccount>() {
- public String toClient(UserDTO value) {
- return value.getId();
+ public String toClient(UserAccount value) {
+ return value.getTopiaId();
}
- public UserDTO toValue(String key) {
- for (UserDTO usr : accounts) {
- if (key.equals(usr.getId())) {
+ public UserAccount toValue(String key) {
+ for (UserAccount usr : accounts) {
+ if (key.equals(usr.getTopiaId())) {
return usr;
}
}
@@ -203,7 +207,7 @@
private PollenContext pollen;
/** Envoi du mail de notification */
- private void sendMailNotification(UserDTO newUser, String password) {
+ private void sendMailNotification(UserAccount newUser, String password) {
Map<String, String> data = new HashMap<String, String>();
data.put("host", pollen.getProperty(PollenProperty.EMAIL_HOST));
data.put("port", pollen.getProperty(PollenProperty.EMAIL_PORT));
@@ -225,7 +229,7 @@
*/
public boolean isMyAccount() {
if (userExists) {
- return user.getId().equals(account.getId());
+ return user.equals(account);
}
return false;
}
@@ -236,7 +240,7 @@
public void onActivate() {
// Affichage des erreurs
- if (userExists && !user.isAdministrator()) {
+ if (userExists && !user.getAdmin()) {
feedback.addError(messages.get("userNotAllowed"));
}
}
@@ -245,7 +249,7 @@
* Initialisation de l'affichage.
*/
public void setupRender() {
- accounts = serviceUser.selectUsers(null);
+ accounts = serviceUser.getUsers();
address = new AddressBarItem[] { new AddressBarItem("Pollen", "Index"),
new AddressBarItem(title, null) };
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CloseValidation.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CloseValidation.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CloseValidation.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -24,9 +24,10 @@
import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.services.ServicePollAccount;
+import org.chorem.pollen.entity.Poll;
+import org.chorem.pollen.entity.PollAccount;
+import org.chorem.pollen.service.ServicePoll;
+import org.chorem.pollen.service.ServiceUser;
import org.chorem.pollen.ui.components.FeedBack;
import org.chorem.pollen.ui.data.AddressBarItem;
@@ -55,13 +56,13 @@
* Sondage créé
*/
@Persist
- private PollDTO poll;
+ private Poll poll;
/**
* Créateur du sondage
*/
@Property
- private PollAccountDTO creator;
+ private PollAccount creator;
@Parameter(defaultPrefix = BindingConstants.MESSAGE, value = "title")
@Property
@@ -77,14 +78,16 @@
/** Injection des services */
@Inject
- private ServicePollAccount servicePollAccount;
+ private ServicePoll servicePoll;
+ @Inject
+ private ServiceUser serviceUser;
/**
* Retoure le sondage créé
*
* @return poll
*/
- public PollDTO getPoll() {
+ public Poll getPoll() {
return poll;
}
@@ -93,7 +96,7 @@
*
* @param poll la nouvelle valeur de l'attribut poll
*/
- public void setPoll(PollDTO poll) {
+ public void setPoll(Poll poll) {
this.poll = poll;
}
@@ -103,11 +106,11 @@
* @return l'identifiant.
*/
public String getAdminId() {
- return poll.getPollUId() + ":" + creator.getAccountUId();
+ return poll.getUId() + ":" + creator.getUId();
}
void onActivate() {
- creator = servicePollAccount.findPollAccountById(poll.getCreatorId());
+ creator = poll.getCreator();
feedback.addInfo(messages.get("closed"));
}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ConfirmPoll.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ConfirmPoll.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ConfirmPoll.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -25,9 +25,9 @@
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.services.ServicePoll;
+import org.chorem.pollen.entity.Choice;
+import org.chorem.pollen.entity.Poll;
+import org.chorem.pollen.service.ServicePoll;
import org.chorem.pollen.ui.data.AddressBarItem;
import org.chorem.pollen.ui.data.PollAction;
@@ -41,7 +41,7 @@
public class ConfirmPoll {
@Persist
- private PollDTO poll;
+ private Poll poll;
@Parameter(defaultPrefix = BindingConstants.MESSAGE, value = "title")
@Property
@@ -72,11 +72,11 @@
@Inject
private ServicePoll servicePoll;
- public PollDTO getPoll() {
+ public Poll getPoll() {
return poll;
}
- public void setPoll(PollDTO poll) {
+ public void setPoll(Poll poll) {
this.poll = poll;
}
@@ -114,9 +114,11 @@
* @return la page de validation de cloture
*/
private Object closePoll() {
- for (ChoiceDTO choice : poll.getChoices()) {
- choice.setValidate(true);
- }
+ // FIXME : carefull, validate attribute is not keep from 1.0
+
+// for (Choice choice : poll.getChoice()) {
+// choice.setValidate(true);
+// }
Date now = new Date();
if (poll.getEndDate() == null || now.before(poll.getEndDate())) {
poll.setEndDate(now);
@@ -133,7 +135,7 @@
* @return la page des sondages
*/
private Object deletePoll() {
- servicePoll.deletePoll(poll.getId());
+ servicePoll.deletePoll(poll);
return backPage;
}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CreationValidation.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CreationValidation.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CreationValidation.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -24,11 +24,11 @@
import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.services.ServicePollAccount;
+import org.chorem.pollen.entity.Poll;
+import org.chorem.pollen.entity.PollAccount;
import org.chorem.pollen.ui.components.FeedBack;
import org.chorem.pollen.ui.data.AddressBarItem;
+import org.chorem.pollen.votecounting.dto.PollDTO;
/**
* Classe de la page de confirmation de la création d'un sondage.
@@ -55,13 +55,13 @@
* Sondage créé
*/
@Persist
- private PollDTO poll;
+ private Poll poll;
/**
* Créateur du sondage
*/
@Property
- private PollAccountDTO creator;
+ private PollAccount creator;
@Parameter(defaultPrefix = BindingConstants.MESSAGE, value = "title")
@Property
@@ -75,16 +75,16 @@
@Inject
private Messages messages;
- /** Injection des services */
- @Inject
- private ServicePollAccount servicePollAccount;
+// /** Injection des services */
+// @Inject
+// private ServicePollAccount servicePollAccount;
/**
* Retoure le sondage créé
*
* @return poll
*/
- public PollDTO getPoll() {
+ public Poll getPoll() {
return poll;
}
@@ -93,7 +93,7 @@
*
* @param poll la nouvelle valeur de l'attribut poll
*/
- public void setPoll(PollDTO poll) {
+ public void setPoll(Poll poll) {
this.poll = poll;
}
@@ -103,11 +103,11 @@
* @return l'identifiant.
*/
public String getAdminId() {
- return poll.getPollUId() + ":" + creator.getAccountUId();
+ return poll.getUId() + ":" + creator.getUId();
}
void onActivate() {
- creator = servicePollAccount.findPollAccountById(poll.getCreatorId());
+ creator = poll.getCreator();
feedback.addInfo(messages.get("created"));
}
Deleted: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ImageDisplay.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ImageDisplay.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ImageDisplay.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -1,124 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.ui.pages.poll;
-
-import java.io.File;
-
-import org.apache.tapestry5.BindingConstants;
-import org.apache.tapestry5.annotations.InjectComponent;
-import org.apache.tapestry5.annotations.Parameter;
-import org.apache.tapestry5.annotations.Persist;
-import org.apache.tapestry5.annotations.Property;
-import org.apache.tapestry5.ioc.Messages;
-import org.apache.tapestry5.ioc.annotations.Inject;
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.ui.components.ImageContextLink;
-import org.chorem.pollen.ui.data.AddressBarItem;
-
-/**
- * Classe de la page de visualisation d'une image.
- *
- * @author rannou
- * @version $Id$
- *
- * @deprecated not used anymore (displayed by ligthbox now)
- */
-public class ImageDisplay {
-
- @Parameter(defaultPrefix = BindingConstants.MESSAGE, value = "title")
- @Property
- private String title;
-
- @SuppressWarnings("unused")
- @Property
- private AddressBarItem[] address;
-
- @Inject
- private Messages messages;
-
- /** Sondage */
- @Persist
- private PollDTO poll;
-
- /** Identifiant du choix */
- @Persist
- private String choiceId;
-
- /** Chaine définissant le style de la page */
- @Persist
- private String pageStyle;
-
- /** Choix */
- @Property
- private ChoiceDTO choice;
-
- @InjectComponent
- private ImageContextLink imgContext;
-
- public ImageContextLink getImgContext() {
- return imgContext;
- }
-
- public PollDTO getPoll() {
- return poll;
- }
-
- public void setPoll(PollDTO poll) {
- this.poll = poll;
- }
-
- public String getChoiceId() {
- return choiceId;
- }
-
- public void setChoiceId(String choiceId) {
- this.choiceId = choiceId;
- }
-
- public String getPageStyle() {
- if (pageStyle == null) {
- pageStyle = "Index";
- }
- return pageStyle;
- }
-
- public void setPageStyle(String pageStyle) {
- this.pageStyle = pageStyle;
- }
-
- /**
- * Initialisation de la page
- */
- void onActivate() {
- choice = new ChoiceDTO();
- for (ChoiceDTO c : poll.getChoices()) {
- if (choiceId.equals(c.getId())) {
- choice = c;
- }
- }
- }
-
- /**
- * Initialisation de l'affichage
- */
- void setupRender() {
- address = new AddressBarItem[] { new AddressBarItem("Pollen", "Index"),
- new AddressBarItem(title, null), new AddressBarItem(messages.get("title2"), null) };
- }
-
-}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ModificationValidation.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ModificationValidation.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ModificationValidation.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -24,9 +24,8 @@
import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.services.ServicePollAccount;
+import org.chorem.pollen.entity.Poll;
+import org.chorem.pollen.entity.PollAccount;
import org.chorem.pollen.ui.components.FeedBack;
import org.chorem.pollen.ui.data.AddressBarItem;
@@ -55,13 +54,13 @@
* Sondage créé
*/
@Persist
- private PollDTO poll;
+ private Poll poll;
/**
* Créateur du sondage
*/
@Property
- private PollAccountDTO creator;
+ private PollAccount creator;
@Parameter(defaultPrefix = BindingConstants.MESSAGE, value = "title")
@Property
@@ -76,15 +75,15 @@
private Messages messages;
/** Injection des services */
- @Inject
- private ServicePollAccount servicePollAccount;
+// @Inject
+// private ServicePollAccount servicePollAccount;
/**
* Retourne le sondage créé
*
* @return poll
*/
- public PollDTO getPoll() {
+ public Poll getPoll() {
return poll;
}
@@ -93,7 +92,7 @@
*
* @param poll la nouvelle valeur de l'attribut poll
*/
- public void setPoll(PollDTO poll) {
+ public void setPoll(Poll poll) {
this.poll = poll;
}
@@ -103,11 +102,13 @@
* @return l'identifiant.
*/
public String getAdminId() {
- return poll.getPollUId() + ":" + creator.getAccountUId();
+ // FIXME : user PollUri
+
+ return poll.getUId() + ":" + creator.getUId();
}
- void onActivate() {
- creator = servicePollAccount.findPollAccountById(poll.getCreatorId());
+ void onActivate() {
+ creator = poll.getCreator();
feedback.addInfo(messages.get("modified"));
}
Deleted: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollCreation.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollCreation.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollCreation.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -1,1291 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.ui.pages.poll;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.fileupload.FileUploadException;
-import org.apache.commons.lang.StringUtils;
-import org.apache.tapestry5.BindingConstants;
-import org.apache.tapestry5.ComponentResources;
-import org.apache.tapestry5.Link;
-import org.apache.tapestry5.ValidationException;
-import org.apache.tapestry5.annotations.Component;
-import org.apache.tapestry5.annotations.IncludeStylesheet;
-import org.apache.tapestry5.annotations.InjectComponent;
-import org.apache.tapestry5.annotations.InjectPage;
-import org.apache.tapestry5.annotations.Log;
-import org.apache.tapestry5.annotations.Parameter;
-import org.apache.tapestry5.annotations.Persist;
-import org.apache.tapestry5.annotations.Property;
-import org.apache.tapestry5.annotations.SessionState;
-import org.apache.tapestry5.corelib.components.Form;
-import org.apache.tapestry5.corelib.components.Select;
-import org.apache.tapestry5.corelib.components.Zone;
-import org.apache.tapestry5.ioc.Messages;
-import org.apache.tapestry5.ioc.annotations.Inject;
-import org.apache.tapestry5.ioc.annotations.Symbol;
-import org.apache.tapestry5.ioc.services.PropertyAccess;
-import org.apache.tapestry5.json.JSONObject;
-import org.apache.tapestry5.upload.services.UploadSymbols;
-import org.chorem.pollen.business.PollenContext;
-import org.chorem.pollen.business.PollenContextImpl;
-import org.chorem.pollen.business.PollenProperty;
-import org.chorem.pollen.business.business.PreventRuleManager;
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.dto.PersonListDTO;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.dto.PreventRuleDTO;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.dto.VotingListDTO;
-import org.chorem.pollen.business.services.ServiceList;
-import org.chorem.pollen.business.services.ServicePoll;
-import org.chorem.pollen.business.services.ServicePollAccount;
-import org.chorem.pollen.common.ChoiceType;
-import org.chorem.pollen.common.PollType;
-import org.chorem.pollen.common.VoteCountingType;
-import org.chorem.pollen.ui.base.ContextLink;
-import org.chorem.pollen.ui.components.FeedBack;
-import org.chorem.pollen.ui.components.ImageContextLink;
-import org.chorem.pollen.ui.data.GenericSelectModel;
-import org.chorem.pollen.ui.data.AddressBarItem;
-import org.chorem.pollen.ui.data.PollHelper;
-import org.chorem.pollen.ui.data.PollStep;
-import org.chorem.pollen.ui.data.uio.DateChoiceUIO;
-import org.chorem.pollen.ui.data.uio.ImageChoiceUIO;
-import org.chorem.pollen.ui.services.ServiceImage;
-import org.chorem.pollen.ui.utils.FeedUtil;
-import org.chorem.pollen.ui.utils.UnitConverter;
-import org.slf4j.Logger;
-
-/**
- * Classe de la page de création d'un sondage.
- *
- * @author kmorin
- * @author rannou
- * @version $Id$
- */
-@IncludeStylesheet("context:css/pollCreation.css")
-public class PollCreation {
-
- @Inject
- private Logger log;
- /** Étape courante du formulaire */
- @Persist
- private PollStep step;
- /**
- * Objet de session représentant l'utilisateur identifié.
- */
- @SessionState
- private UserDTO user;
- @Property
- private boolean userExists;
- /**
- * Objet de session représentant l'url du site.
- */
- @SessionState
- @Property
- private String siteURL;
- /** Date de début du sondage (utilisée pour la validation). */
- private Date beginDateValidation;
- /** Date de début d'ajout des choix (utilisée pour la validation). */
- private Date beginChoiceDateValidation;
- /** Mixin de selection de liste de favoris */
- @SuppressWarnings("unused")
- private Select listSelect;
- @InjectComponent
- private Zone pollCreationZone;
- /**
- * Sondage créé par le formulaire
- */
- @Property
- @Persist
- private PollDTO poll;
- /**
- * Sondage copié pour créer un nouveau sondage
- */
- @Persist
- private PollDTO oldPoll;
- /**
- * Sondage copié existe.
- */
- private boolean oldPollExists = false;
- /**
- * variable utilisée pour déterminer si le bouton cliqué mène à l'étape
- * suivante
- */
- private boolean noStepSubmitSelected = false;
- /**
- * variable utilisée pour déterminer si le bouton d'ajout de choix a été
- * cliqué
- */
- @Persist
- private boolean addChoiceSelected;
- /**
- * variable utilisée pour déterminer le groupe à supprimer
- */
- private int deleteGroupId = -1;
- /**
- * variable utilisée pour déterminer s'il y a eu une exception lors de
- * l'upload des images
- */
- @Persist
- private boolean uploadExceptionCatched;
- /** variable utilisée pour l'affichage de la choiceNbCheckBox */
- @Property
- @Persist
- private boolean choiceNbCheckBox;
- /** variable utilisée pour l'affichage de la notificationCheckBox */
- @Property
- @Persist
- private boolean notificationCheckBox;
- /** variable utilisée pour l'affichage de la reminderCheckBox */
- @Property
- @Persist
- private boolean reminderCheckBox;
- /** Règle de notification de vote */
- @Property
- @Persist
- private PreventRuleDTO notificationPreventRule;
- /** Règle de notification pour le rappel des votants */
- @Property
- @Persist
- private PreventRuleDTO reminderPreventRule;
- /**
- * Groupes de votants à créer
- */
- @Property
- @Persist
- private List<VotingListDTO> votingLists;
- /**
- * Objet utilisé dans la boucle de parcours des listes de votants
- */
- @Property
- private VotingListDTO votingList;
- /**
- * Objet utilisé dans la boucle de parcours de la liste de votants courante
- */
- @SuppressWarnings("unused")
- @Property
- private PollAccountDTO votingListPerson;
- /**
- * Nombre de votants affichés initialement
- */
- @Property
- private int nbVotingListPersons = 5;
- /**
- * Liste modifiée actuellement
- */
- @Persist
- private int currentList;
- /**
- * Listes de favoris de l'utilisateur.
- */
- @Property
- @Persist
- private GenericSelectModel<PersonListDTO> personLists;
- /**
- * Liste de favoris sélectionnée.
- */
- @Property
- private PersonListDTO personList;
- /**
- * Nombre de choix affichés initialement
- */
- @Property
- private int nbChoices = 5;
- /**
- * Objet utilisé dans la boucle de parcours de la liste des choix
- */
- @SuppressWarnings("unused")
- @Property
- private ChoiceDTO choice;
- /**
- * Objet utilisé dans la boucle de parcours de la liste des choix
- */
- @SuppressWarnings("unused")
- @Property
- private DateChoiceUIO dateTypeChoice;
- /**
- * Objet utilisé dans la boucle de parcours de la liste des choix
- */
- @SuppressWarnings("unused")
- @Property
- private ImageChoiceUIO imgTypeChoice;
- /**
- * Liste des choix à créer
- */
- @Property
- @Persist
- private List<ChoiceDTO> choices;
- /**
- * Liste des choix à créer
- */
- @Property
- @Persist
- private List<DateChoiceUIO> dateTypeChoices;
- /**
- * Liste des choix à créer
- */
- @Property
- @Persist
- private List<ImageChoiceUIO> imgTypeChoices;
- /**
- * Contexte pour l'upload des images (parametres definis dans .tml)
- */
- @InjectComponent
- private ImageContextLink imgContext;
- /**
- * Contexte pour la gestion du flux RSS
- */
- @InjectComponent
- private ContextLink feedContext;
- /**
- * Formulaire de création de sondage
- */
- @Component(id = "pollCreationForm")
- private Form pollCreationForm;
-
- @Component(id = "choicesCreationForm")
- private Form choicesCreationForm;
-
- @InjectPage
- private CreationValidation creationValidation;
-
- @Parameter(defaultPrefix = BindingConstants.MESSAGE, value = "title")
- @Property
- private String title;
-
- @SuppressWarnings("unused")
- @Property
- private AddressBarItem[] address;
-
- @Inject
- private PropertyAccess _propertyAccess;
-
- @Inject
- private ComponentResources resources;
-
- /** Affichage des messages pour l'utilisateur */
- @Component(id = "feedback")
- private FeedBack feedback;
-
- /** Tailles maximales des fichiers uploadés */
- @Inject
- @Symbol(UploadSymbols.FILESIZE_MAX)
- private int fileSizeMax;
-
- @Inject
- @Symbol(UploadSymbols.REQUESTSIZE_MAX)
- private int requestSizeMax;
-
- @Inject
- private Messages messages;
-
- @Inject
- private Logger logger;
-
- /** Injection des services */
- @Inject
- private ServicePoll servicePoll;
-
- @Inject
- private ServicePollAccount servicePollAccount;
-
- @Inject
- private ServiceList serviceList;
-
- /**
- * Méthode appelée lorsqu'on souhaite accéder à l'étape suivante de la
- * création de sondage.
- */
- @Log
- Object onSuccessFromPollCreationForm() {
- if (log.isDebugEnabled()) {
- log.debug("Step : " + step);
- }
- switch (step) {
- case POLL:
- adaptStepPoll();
- step = PollStep.OPTIONS;
- break;
- case OPTIONS:
- adaptStepOptions();
- if (isFreePoll()) {
- step = PollStep.CHOICES;
- } else {
- step = PollStep.LISTS;
- }
- break;
- case LISTS:
- if (deleteGroupId >= 0) {
- votingLists.remove(deleteGroupId);
- }
- if (!noStepSubmitSelected) {
- step = PollStep.CHOICES;
- }
- break;
- case CHOICES:
- break;
- default:
- step = PollStep.POLL;
- break;
- }
- // Cas particulier, autre formulaire pour les choix
- if (step.equals(PollStep.CHOICES)) {
- return choicesCreationForm;
- }
- return pollCreationForm;
- }
-
- /**
- * Méthode appelée que le formulaire soit valide ou non. Il est nécessaire
- * de la redéfinir pour qu'en cas d'erreur de validation, la zone soit tout
- * de même mise à jour pour afficher l'erreur.
- */
- @Log
- Object onSubmitFromPollCreationForm() {
- return pollCreationForm;
- }
-
- /**
- * Méthode appelée lorsqu'on souhaite valider la création du sondage.
- */
- Object onSuccessFromChoicesCreationForm() throws FileUploadException {
- if (!addChoiceSelected) {
-
- // Préparation et création du sondage
- if (!preparePoll()) {
- return this;
- }
- createPoll();
-
- creationValidation.setPoll(poll);
- return creationValidation;
- }
-
- return this;
- }
-
- /**
- * Méthode appelée lorsqu'on souhaite accéder à l'étape précédente de la
- * création de sondage.
- */
- Object onPrevious() {
- switch (step) {
- case OPTIONS:
- step = PollStep.POLL;
- break;
- case LISTS:
- step = PollStep.OPTIONS;
- break;
- case CHOICES:
- if (isFreePoll()) {
- step = PollStep.OPTIONS;
- } else {
- step = PollStep.LISTS;
- }
- break;
- default:
- step = PollStep.POLL;
- break;
- }
- return pollCreationForm; // Pas de gestion du formulaire des choix car derniere etape
- }
-
- /**
- * Méthode appelée lors de la validation du formulaire. Validation du champs
- * beginDate.
- *
- * @throws ValidationException
- */
- void onValidateFromBeginDate(Date value) throws ValidationException {
- beginDateValidation = value;
- if (value != null && value.before(new Date())) {
- throw new ValidationException(messages.get("beginDate-validate"));
- }
- }
-
- /**
- * Méthode appelée lors de la validation du formulaire. Validation du champs
- * endDate.
- *
- * @throws ValidationException
- */
- void onValidateFromEndDate(Date value) throws ValidationException {
- if (beginDateValidation == null) {
- beginDateValidation = new Date();
- }
-
- if (value != null && value.before(beginDateValidation)) {
- throw new ValidationException(messages.get("endDate-validate"));
- }
- }
-
- /**
- * Méthode appelée lors de la validation du formulaire. Validation du champs
- * beginChoiceDate.
- *
- * @throws ValidationException
- */
- void onValidateFromBeginChoiceDate(Date value) throws ValidationException {
- if (beginDateValidation == null) {
- beginDateValidation = new Date();
- }
- beginChoiceDateValidation = value;
- if (value != null && value.after(beginDateValidation)) {
- throw new ValidationException(messages.get("beginChoiceDate-validate"));
- }
- }
-
- /**
- * Méthode appelée lors de la validation du formulaire. Validation du champs
- * endChoiceDate.
- *
- * @throws ValidationException
- */
- void onValidateFromEndChoiceDate(Date value) throws ValidationException {
- if (beginChoiceDateValidation == null) {
- beginChoiceDateValidation = new Date();
- }
-
- if (value != null && value.before(beginChoiceDateValidation)) {
- throw new ValidationException(messages.get("endChoiceDate-validate"));
- }
- }
-
- /**
- * Méthode appelée lors de la validation du formulaire. Validation des
- * listes de votants.
- *
- * @throws ValidationException
- */
- void onValidateFormFromPollCreationForm() throws ValidationException {
- if (noStepSubmitSelected) {
- return;
- }
-
- // Validation des votants
- if (step == PollStep.LISTS) {
- int nbListEqual = 0;
- int nbEqual = 0;
- int nbNotNull = 0;
-
- // Repérage des doublons (listes)
- for (VotingListDTO list1 : votingLists) {
- for (VotingListDTO list2 : votingLists) {
- if (list1.getName().equals(list2.getName())) {
- nbListEqual++;
- }
- }
- }
-
- if (nbListEqual > votingLists.size()) {
- throw new ValidationException(messages.get("lists-validate"));
- }
-
- // Repérage des doublons (votants)
- for (VotingListDTO list1 : votingLists) {
- int nbLocalNotNull = 0;
- for (PollAccountDTO account1 : list1.getPollAccountDTOs()) {
- if (account1.getVotingId() != null && account1.getVotingId() != "") {
- nbNotNull++;
- nbLocalNotNull++;
-
- // comparaison avec les autres votants
- for (VotingListDTO list2 : votingLists) {
- for (PollAccountDTO account2 : list2.getPollAccountDTOs()) {
- if (account2.getVotingId() != null && account1.getVotingId() != "") {
- if (account1.getVotingId().equals(
- account2.getVotingId())) {
- nbEqual++;
- }
- }
- }
- }
- }
- }
- if (nbLocalNotNull == 0) {
- throw new ValidationException(messages.get("noList-validate"));
- }
- }
-
- if (logger.isDebugEnabled()) {
- logger.debug("Votants (equal/notNull) : " + nbEqual + "/" + nbNotNull);
- }
- if (nbEqual > nbNotNull) {
- throw new ValidationException(messages.get("list-validate"));
- }
- }
- }
-
- /**
- * Méthode appelée lors de la validation du formulaire. Validation de la
- * liste de choix.
- *
- * @throws ValidationException
- */
- void onValidateFormFromChoicesCreationForm() throws ValidationException {
- int nbEqual = 0;
- int nbNotNull = 0;
-
- // Validation des choix
- if (step == PollStep.CHOICES) {
-
- // Repérage des doublons (type Texte)
- if (isTextChoices()) {
- for (ChoiceDTO choice1 : choices) {
- if (choice1.getName() != null) {
- nbNotNull++;
- for (ChoiceDTO choice2 : choices) {
- if (choice2.getName() != null) {
- if (choice1.getName().equals(choice2.getName())) {
- nbEqual++;
- }
- }
- }
- }
- }
- // Repérage des doublons (type Date)
- } else if (isDateChoices()) {
- for (DateChoiceUIO choice1 : dateTypeChoices) {
- if (choice1.getDate() != null) {
- nbNotNull++;
- for (DateChoiceUIO choice2 : dateTypeChoices) {
- if (choice2.getDate() != null) {
- if (choice1.getDate().equals(choice2.getDate())) {
- nbEqual++;
- }
- }
- }
- }
- }
- // Repérage des doublons (type Image)
- } else if (isImgChoices()) {
- for (ImageChoiceUIO choice1 : imgTypeChoices) {
- if (choice1.getImg() != null) {
- nbNotNull++;
- for (ImageChoiceUIO choice2 : imgTypeChoices) {
- if (choice2.getImg() != null) {
- if (choice1.getImg().getFileName().equals(
- choice2.getImg().getFileName())) {
- nbEqual++;
- }
- }
- }
- }
- }
- }
-
- if (nbNotNull == 0) {
- throw new ValidationException(messages.get("noChoice-validate"));
- }
- if (nbEqual > nbNotNull) {
- throw new ValidationException(messages.get("choice-validate"));
- }
- }
- }
-
- /** Echec lors du téléchargement */
- Object onUploadException(FileUploadException e) {
- logger.error(e.getMessage());
- String fSize = UnitConverter.getFormattedFileSize(fileSizeMax);
- String rSize = UnitConverter.getFormattedFileSize(requestSizeMax);
- feedback.addError(messages.format("uploadError", fSize, rSize));
- uploadExceptionCatched = true;
- return this;
- }
-
- /**
- * Réinitialisation des options en fonction des autres options.
- */
- private void adaptStepOptions() {
- if (poll.isAnonymous()) {
- poll.setAnonymousVoteAllowed(true);
- }
- if (poll.isContinuousResults()) {
- poll.setPublicResults(true);
- }
- }
-
- /**
- * Réinitialisation des listes de votants en fonction du type de sondage.
- */
- @Log
- private void adaptStepPoll() {
-
- // Sondage libre : suppression de toutes les listes
- if (isFreePoll()) {
- votingLists.clear();
- } // Sondage restreint : suppression des listes supplémentaires
- else if (isRestrictedPoll() && votingLists.size() > 1) {
- for (int i = 1; i < votingLists.size(); i++) {
- votingLists.remove(i);
- }
- currentList = 0;
- } // Sondage non libre : création d'une liste initiale
- else if (votingLists.isEmpty()) {
- votingList = new VotingListDTO();
- for (int i = 0; i < nbVotingListPersons; i++) {
- votingList.getPollAccountDTOs().add(new PollAccountDTO());
- }
- votingLists.add(votingList);
- currentList = getVotingListIndex();
- }
-
- if (poll.getBeginDate() != null) {
- poll.setEndChoiceDate(poll.getBeginDate());
- }
- }
-
- /**
- * Préparation du sondage.
- */
- @Log
- private boolean preparePoll() {
-
- // Ajout de l'identifiant du créateur
- if (userExists) {
- poll.setUserId(user.getId());
- }
-
- // Ajout des règles de notification au sondage
- if (notificationCheckBox) {
- poll.getPreventRuleDTOs().add(notificationPreventRule);
- }
- if (reminderCheckBox) {
- poll.getPreventRuleDTOs().add(reminderPreventRule);
- }
-
- // Ajout des groupes de votants au sondage
- // après suppression des entrées vides
- if (!isFreePoll()) {
- for (VotingListDTO list : votingLists) {
- Iterator<PollAccountDTO> it = list.getPollAccountDTOs().iterator();
- while (it.hasNext()) {
- if (it.next().getVotingId() == null) {
- it.remove();
- }
- }
- }
- poll.setVotingListDTOs(votingLists);
- }
-
-
- // Ajout des choix au sondage
- if (isTextChoices()) {
- for (ChoiceDTO choice : choices) {
- if (choice.getName() != null) {
- choice.setValidate(true);
- poll.getChoices().add(choice);
- }
- }
- } else if (isDateChoices()) {
- for (DateChoiceUIO choice : dateTypeChoices) {
- if (choice.getDate() != null) {
- choice.setValidate(true);
- choice.setName(String.valueOf(choice.getDate().getTime()));
- poll.getChoices().add(choice);
- }
- }
- } else if (isImgChoices()) {
- for (ImageChoiceUIO imgChoice : imgTypeChoices) {
- if (imgChoice.getImg() != null) {
- logger.debug("Image: " + imgChoice.getImg().getFileName() + ", type: " + imgChoice.getImg().getContentType());
- if (imgChoice.getImg().getContentType().contains("image") || imgChoice.getImg().getContentType().contains(
- "IMAGE")) {
- imgChoice.setValidate(true);
- imgChoice.setName(imgChoice.getImg().getFileName().replace(' ', '_'));
- poll.getChoices().add(imgChoice);
- } else {
- return false;
- }
- }
- }
- }
-
- // Retouche des attributs dépendants l'un de l'autre
- if (poll.getBeginDate() == null) {
- poll.setBeginDate(new Date());
- }
- if (poll.isAnonymous()) {
- poll.setAnonymousVoteAllowed(true);
- }
- if (poll.isContinuousResults()) {
- poll.setPublicResults(true);
- }
- if (poll.getMaxChoiceNb() < 1 || poll.getMaxChoiceNb() > poll.getChoices().size()) {
- poll.setMaxChoiceNb(poll.getChoices().size());
- }
-
- return true;
- }
-
- @Inject
- private ServiceImage serviceImage;
-
- /**
- * Création du sondage.
- */
- private void createPoll() throws FileUploadException {
-
-
- // FD-20100226 : Can't be null, an exception will be thrown if a
- // problem comes from createPoll
- //if (poll.getId() != null) {
-
- // Création des images
- if (poll.getChoiceType() == ChoiceType.IMAGE) {
- for (ImageChoiceUIO image : imgTypeChoices) {
- if (image.getImg() != null) {
-// String contentType = image.getImg().getContentType();
-// if (!contentType.equals("image") ||
-// !contentType.equals("IMAGE")) {
-// throw new FileUploadException("wrong type for image upload");
-// }
- serviceImage.saveImage(image.getImg(), poll.getPollUId());
- }
- }
- //File dir = imgContext.getImageDir();
- //ImageUtil.saveImages(imgTypeChoices, dir);
- }
-
-
- // Création du sondage
- servicePoll.createPoll(poll);
-
- // FD-20100226 : not necessary, the service will update
- // automatically the poll when it was created
- // Mise à jour du sondage :
- //poll = servicePoll.findPollById(poll.getId());
-
- // Mise à jour du flux Atom et envoi d'un mail de confirmation
- addFeedEntry();
-
- // on les passe en parametres car au
- // moment de l'execution du thread, il y a des NPE
- // à l'utilisation des valeurs
- final String localSiteURL = siteURL;
- final ServicePollAccount localServicePollAccount = servicePollAccount;
- final PollDTO localPoll = poll;
- final Messages localMessages = messages;
-
- // Mise à jour du flux Atom et envoi d'un mail de confirmation
- // FIXME replace this ugly thread code !!!
- new Thread() {
- @Override
- public void run() {
- sendMailNotification(localSiteURL, localServicePollAccount,
- localPoll, localMessages);
- }
- }.start();
-
- }
-
- /** Ajout d'une entrée dans le flux de syndication */
- private void addFeedEntry() {
- PollAccountDTO creator = servicePollAccount.findPollAccountById(poll.getCreatorId());
- String voteURL = siteURL + "poll/votefor/" + poll.getPollUId();
- File feedFile = feedContext.getFile(poll.getPollUId());
-
- FeedUtil.createFeed(feedFile, "atom_1.0", messages.format(
- "pollFeed_title", poll.getTitle()), siteURL, messages.format(
- "pollFeed_desc", poll.getDescription()));
- FeedUtil.feedFeed(feedFile, messages.format("pollFeed_createTitle",
- creator.getVotingId()), voteURL, messages.get("pollFeed_createContent"));
- }
-
- @Inject
- private PollenContext pollen;
-
- /** Envoi du mail de notification */
- private void sendMailNotification(String siteURL, ServicePollAccount servicePollAccount,
- PollDTO poll, Messages messages) {
- PollAccountDTO creator = servicePollAccount.findPollAccountById(poll.getCreatorId());
- String voteURL = siteURL + "poll/VoteFor/" + poll.getPollUId();
- String modifURL = siteURL + "poll/Modification/" + poll.getPollUId() + ":" + creator.getAccountUId();
- Map<String, String> data = new HashMap<String, String>();
- data.put("host", pollen.getProperty(PollenProperty.EMAIL_HOST));
- data.put("port", pollen.getProperty(PollenProperty.EMAIL_PORT));
- data.put("from", pollen.getProperty(PollenProperty.EMAIL_FROM));
-
- // Mail au créateur
- if (poll.getCreatorEmail() != null) {
- data.put("to", poll.getCreatorEmail());
- data.put("title", messages.format("creatorEmail_subject", poll.getTitle()));
- data.put("msg", messages.format("creatorEmail_msg",
- poll.getTitle(), voteURL, modifURL));
-
- // FIXME call directly MailUtil.sendMail()
- // skip fill map, get from map...
- PreventRuleManager.emailAction(data);
- }
-
- // Mails aux votants
- for (VotingListDTO list : poll.getVotingListDTOs()) {
-
- List<Map<String, String>> mailList = new ArrayList<Map<String, String>>();
- for (PollAccountDTO account : list.getPollAccountDTOs()) {
- if (account.getEmail() != null) {
- String accountVoteURL = voteURL + ":" + account.getAccountUId();
-
- /*data.put("to", account.getEmail());
- data.put("title", messages.format("votingEmail_subject",
- poll.getTitle()));
- data.put("msg", messages.format("votingEmail_msg", poll
- .getTitle(), account.getVotingId(),
- accountVoteURL));
-
- // FIXME call directly MailUtil.sendMail()
- // skip fill map, get from map...
- PreventRuleManager.emailAction(data);*/
-
- Map<String, String> mailData = new HashMap<String, String>();
- mailData.put("receiver", account.getEmail());
- mailData.put("subject", messages.format("votingEmail_subject", poll.getTitle()));
- mailData.put("body", messages.format("votingEmail_msg", poll.getTitle(), account.getVotingId(), accountVoteURL));
- mailList.add(mailData);
- }
- }
-
- // send mail preparation
- try {
- pollen.getSendMail().prepareMails(poll.getId(), mailList);
- pollen.getSendMail().wakeUp();
- } catch (IOException ex) {
- if (log.isErrorEnabled()) {
- log.error("Can't prepare send mail on disk, mail won't be send !!!", ex);
- }
- }
- }
- }
-
- public String getChoiceDateDisplay() {
- return poll.isChoiceAddAllowed() ? "display: block;" : "display: none;";
- }
-
- public String getChoiceNbDisplay() {
- return choiceNbCheckBox ? "display: block;" : "display: none;";
- }
-
- public String getNotificationDisplay() {
- return notificationCheckBox ? "display: block;" : "display: none;";
- }
-
- public String getReminderDisplay() {
- return reminderCheckBox ? "display: block;" : "display: none;";
- }
-
- /** Retourne l'index de la liste courante */
- public int getVotingListIndex() {
- return votingLists.indexOf(votingList);
- }
-
- /** Retourne le numéro de la liste courante (index+1) */
- public int getVotingListNumber() {
- return votingLists.indexOf(votingList) + 1;
- }
-
- /** Retourne la chaîne correspondant à l'étape courante */
- public String getStepLegend() {
- Integer index = step.getIndex();
-
- // corrections selon le type de sondage
- if (isFreePoll()) {
- if (step == PollStep.CHOICES) {
- index--;
- }
- }
-
- // mise en forme du message
- switch (step) {
- case POLL:
- return messages.format("pollLegend", index);
- case OPTIONS:
- return messages.format("optionsLegend", index);
- case LISTS:
- return messages.format("listsLegend", index);
- case CHOICES:
- return messages.format("choicesLegend", index);
- default:
- return "";
- }
- }
-
- /** Retourne la classe CSS correspondant au groupe courant */
- public String getCurrentListClass() {
- if (votingLists.size() > 1 && getVotingListIndex() == currentList) {
- return "currentGroupDiv";
- }
- return "groupDiv";
- }
-
- /**
- * Retourne s'il existe plusieurs groupes.
- */
- public boolean isSeveralGroups() {
- return votingLists.size() > 1;
- }
-
- public boolean isInPoll() {
- return step == PollStep.POLL;
- }
-
- public boolean isInLists() {
- return step == PollStep.LISTS;
- }
-
- public boolean isInChoices() {
- return step == PollStep.CHOICES;
- }
-
- public boolean isInOptions() {
- return step == PollStep.OPTIONS;
- }
-
- public boolean isNormalVoteCounting() {
- return poll.getVoteCounting() == VoteCountingType.NORMAL;
- }
-
- public boolean isPercentageVoteCounting() {
- return poll.getVoteCounting() == VoteCountingType.PERCENTAGE;
- }
-
- public boolean isCondorcetVoteCounting() {
- return poll.getVoteCounting() == VoteCountingType.CONDORCET;
- }
-
- public boolean isNumberVoteCounting() {
- return poll.getVoteCounting() == VoteCountingType.NUMBER;
- }
-
- public boolean isFreePoll() {
- return poll.getPollType() == PollType.FREE;
- }
-
- public boolean isRestrictedPoll() {
- return poll.getPollType() == PollType.RESTRICTED;
- }
-
- public boolean isGroupPoll() {
- return poll.getPollType() == PollType.GROUP;
- }
-
- public boolean isTextChoices() {
- return poll.getChoiceType() == ChoiceType.TEXT;
- }
-
- public boolean isDateChoices() {
- return poll.getChoiceType() == ChoiceType.DATE;
- }
-
- public boolean isImgChoices() {
- return poll.getChoiceType() == ChoiceType.IMAGE;
- }
-
- /**
- * Méthode appelée à la sélection d'une liste de votants. Le mixin
- * ck/OnEvent ne permet pas de retourner le contenu d'une zone. Il faut donc
- * passer par une fonction JavaScript pour activer un event link. Un lien
- * est créé. Il sera retourné à la fonction JavaScript onCompleteCallback
- * pour mettre à jour la zone.
- *
- * @param value
- * @return un JSONObject contenant l'url de l'évènement mettant à jour la
- * zone.
- */
- public JSONObject onChangeFromListSelect(String value) {
- JSONObject result = new JSONObject();
- if (StringUtils.isNotEmpty(value)) {
- personList = serviceList.findPersonListById(value);
-
- // Copie des personnes de la liste de favoris dans la liste de votants
- for (PollAccountDTO account : personList.getPollAccounts()) {
- account.setId("");
- account.setPersonListId("");
- }
-
- votingLists.get(currentList).setPollAccountDTOs(
- personList.getPollAccounts());
-
- int size = personList.getPollAccounts().size();
-
- if (log.isDebugEnabled()) {
- log.debug("List size : " + size);
- }
-
- // If the list size is too large, an alert message will be shown
- if (size > LIST_MAX_SHOW_PERSONS) {
- result.put("listAlert", messages.format("list-maxSize-alert",
- personList.getName(), size));
- }
- }
- return createParamsForCallback(result);
- }
- /** TODO : move this value to pollen.properties, waiting for 1.3 version **/
- public static final int LIST_MAX_SHOW_PERSONS = 20;
-
- /**
- * Test if the list size made an alert (too large to be shown).
- *
- * @return true if the current list size is > to LIST_MAX_SHOW_PERSONS
- */
- public boolean isListSizeAlert() {
- return votingList.getPollAccountDTOs().size() > LIST_MAX_SHOW_PERSONS;
- }
-
- /**
- * Get the message to show when the too large list size is loaded.
- *
- * @return the localized message to show when big list is loaded.
- */
- public String getListMaxSizeLoadedMessage() {
- return messages.format("list-maxSize-loaded", votingList.getName(),
- votingList.getPollAccountDTOs().size());
- }
-
- /**
- * Méthode appelée à la sélection d'un type de choix. Le mixin ck/OnEvent ne
- * permet pas de retourner le contenu d'une zone. Il faut donc passer par
- * une fonction JavaScript pour activer un event link. Un lien est créé. Il
- * sera retourné à la fonction JavaScript onCompleteCallback pour mettre à
- * jour la zone.
- *
- * @return un JSONObject contenant l'url de l'évènement mettant à jour la
- * zone.
- */
- public JSONObject onChangeFromChoiceType(String value) {
- poll.setChoiceType(ChoiceType.valueOf(value));
- return createParamsForCallback(new JSONObject());
- }
-
- /**
- * Création d'un JSONObject contenant un identifiant de zone et une url pour
- * un évènement.
- *
- * @return un JSONObject contenant un zoneId et une url.
- */
- private JSONObject createParamsForCallback(JSONObject json) {
- //JSONObject json = new JSONObject();
- Link link = resources.createEventLink("updatePollCreationZone");
- json.put("link", link.toAbsoluteURI());
- json.put("zoneId", "pollCreationZone");
- return json;
- }
-
- /**
- * Méthode appelée par le callback JavaScript pour mettre à jour la zone.
- *
- * @return le contenu mis à jour de la zone.
- */
- public Object onUpdatePollCreationZone() {
- return pollCreationZone.getBody();
- }
-
- /**
- * Méthode appelée pour l'ajout d'une ligne supplémentaire dans le
- * formulaire des listes de votants.
- */
- void onSelectedFromAddPerson(int i) {
- votingLists.get(i).getPollAccountDTOs().add(new PollAccountDTO());
- noStepSubmitSelected = true;
- }
-
- /**
- * Méthode appelée pour l'ajout d'un groupe dans le formulaire des listes de
- * votants.
- */
- void onSelectedFromAddGroup() {
- votingList = new VotingListDTO();
- for (int i = 0; i < nbVotingListPersons; i++) {
- votingList.getPollAccountDTOs().add(new PollAccountDTO());
- }
- votingLists.add(votingList);
- currentList = getVotingListIndex();
- noStepSubmitSelected = true;
- }
-
- /**
- * Méthode appelée lors de la suppression d'un groupe dans le formulaire des
- * listes de votants.
- */
- void onSelectedFromDeleteGroup(int i) {
- //votingLists.remove(i);
- if (currentList == i) {
- currentList = votingLists.size() - 1;
- } else if (currentList > i) {
- currentList--;
- }
- deleteGroupId = i;
- noStepSubmitSelected = true;
- }
-
- /**
- * Méthode appelée à la selection d'un groupe dans le formulaire des listes
- * de votants.
- */
- void onSelectedFromEditGroup(int i) {
- currentList = i;
- noStepSubmitSelected = true;
- }
-
- /**
- * Méthode appelée pour l'ajout d'une ligne supplémentaire dans le
- * formulaire des choix.
- */
- void onSelectedFromAddChoice() {
- if (poll.getChoiceType() == ChoiceType.DATE) {
- dateTypeChoices.add(new DateChoiceUIO());
- } else if (poll.getChoiceType() == ChoiceType.IMAGE) {
- imgTypeChoices.add(new ImageChoiceUIO());
- } else {
- choices.add(new ChoiceDTO());
- }
- addChoiceSelected = true;
- }
-
- /** Retourne vrai si des listes de favoris existent */
- public boolean isPersonListsExists() {
- return personLists != null && !personLists.getList().isEmpty();
- }
-
- /**
- * Activation de la page
- */
- void onActivate(String id) {
-
- // Si un sondage est fourni (copie de sondage)
- if (id != null && !"".equals(id)) {
-
- // Réinitialisation des variables de session
- // Si l'ancien sondage n'existe pas ou est différent de celui fourni
- if (oldPoll == null || !id.equals(oldPoll.getPollUId())) {
- oldPoll = servicePoll.getPoll(id);
- if (oldPoll != null) {
- initWithExistingPoll(oldPoll);
- oldPoll = null;
- oldPollExists = true;
- }
- }
- }
- }
-
- /**
- * Initialisation de l'affichage
- */
- void setupRender() {
- address = new AddressBarItem[]{new AddressBarItem("Pollen", "Index"),
- new AddressBarItem(title, null)};
-
- if (!addChoiceSelected && !uploadExceptionCatched && !choicesCreationForm.getHasErrors()) {
- step = PollStep.POLL;
- if (!oldPollExists) {
- oldPoll = null;
- initPoll();
- }
- initPersonLists();
- }
-
- addChoiceSelected = false;
- uploadExceptionCatched = false;
- }
-
- /**
- * Initialisation du sondage.
- */
- private void initPoll() {
-
- // Initialisation du sondage
- //poll = new PollDTO();
- poll = servicePoll.getNewPoll();
- if (userExists) {
- poll.setCreatorName(user.getLogin());
- poll.setCreatorEmail(user.getEmail());
- }
-
- // Initialisation des règles de notification
- notificationPreventRule = new PreventRuleDTO("vote", 0, true,
- PreventRuleManager.EMAIL_ACTION);
- reminderPreventRule = new PreventRuleDTO("rappel", 0, false,
- PreventRuleManager.EMAIL_ACTION);
-
- notificationCheckBox = false;
- reminderCheckBox = false;
- choiceNbCheckBox = false;
-
- // Initialisation des choix
- choices = new ArrayList<ChoiceDTO>();
- dateTypeChoices = new ArrayList<DateChoiceUIO>();
- imgTypeChoices = new ArrayList<ImageChoiceUIO>();
- for (int i = 0; i < nbChoices; i++) {
- choices.add(new ChoiceDTO());
- dateTypeChoices.add(new DateChoiceUIO());
- imgTypeChoices.add(new ImageChoiceUIO());
- }
-
- // Initialisation des listes de votants
- votingLists = new ArrayList<VotingListDTO>();
- }
-
- /**
- * Initialisation du sondage à partir d'un sondage existant.
- */
- private void initWithExistingPoll(PollDTO oldPoll) {
-
- // Initialisation du sondage
- poll = PollHelper.getPoll(oldPoll);
-
- // Initialisation du créateur du sondage
-// PollAccountDTO creator = servicePollAccount.findPollAccountById(oldPoll
-// .getCreatorId());
- //poll.setCreatorId(oldPoll.getCreatorId());
- poll.setCreatorName(oldPoll.getCreatorName());
- poll.setCreatorEmail(oldPoll.getCreatorEmail());
-
- // Initialisation des règles de notification
- notificationPreventRule = PollHelper.getNotificationPreventRule(oldPoll);
- notificationCheckBox = !"".equals(notificationPreventRule.getScope());
- reminderPreventRule = PollHelper.getReminderPreventRule(oldPoll);
- reminderCheckBox = !"".equals(reminderPreventRule.getScope());
-
- // Initialisation des choix
- choices = PollHelper.getTextChoices(oldPoll);
- dateTypeChoices = PollHelper.getDateChoices(oldPoll);
- imgTypeChoices = PollHelper.getImageChoices(oldPoll);
-
- // Initialisation des listes de votants
- votingLists = PollHelper.getVotingLists(oldPoll);
- }
-
- /**
- * Initialisation de la liste de favoris.
- */
- private void initPersonLists() {
- if (userExists) {
- List<PersonListDTO> _personLists = serviceList.findPersonListByUser(user.getId());
- personLists = new GenericSelectModel<PersonListDTO>(_personLists,
- PersonListDTO.class, "name", "id", _propertyAccess);
- }
- }
-}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -21,14 +21,15 @@
import org.apache.tapestry5.corelib.components.FormFragment;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
-import org.chorem.pollen.business.business.PreventRuleManager;
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.dto.PreventRuleDTO;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.services.ServicePoll;
+import org.chorem.pollen.PollenBusinessException;
import org.chorem.pollen.common.PollType;
import org.chorem.pollen.common.VoteCountingType;
+import org.chorem.pollen.entity.Choice;
+import org.chorem.pollen.entity.Poll;
+import org.chorem.pollen.entity.PreventRule;
+import org.chorem.pollen.entity.UserAccount;
+import org.chorem.pollen.mail.PreventRuleManager;
+import org.chorem.pollen.service.ServicePoll;
import org.chorem.pollen.ui.data.AddressBar;
import org.chorem.pollen.ui.data.ChoiceField;
import org.slf4j.Logger;
@@ -66,7 +67,7 @@
private Logger log;
@SessionState
- private UserDTO user;
+ private UserAccount user;
@Property
private boolean userExists;
@@ -80,7 +81,7 @@
private String pollUID;
@Persist
- private PollDTO poll;
+ private Poll poll;
void onActivate(String id) {
pollUID = id;
@@ -102,26 +103,29 @@
*
* @return poll existing or a new one
*/
- public PollDTO getPoll() {
+ public Poll getPoll() throws PollenBusinessException {
if (poll == null) {
if (StringUtils.isNotEmpty(pollUID)) {
if (log.isDebugEnabled()) {
log.debug("Get existing poll with pollUID = " + pollUID);
}
- poll = servicePoll.getPoll(pollUID);
+ poll = servicePoll.getPollForUpdate(pollUID);
// TODO : init advancedOptions
} else {
if (log.isDebugEnabled()) {
log.debug("Init new poll");
}
poll = servicePoll.getNewPoll();
- if (userExists) {
- String creatorName =
- user.getFirstName() + " " + user.getLastName();
- poll.setCreatorName(creatorName);
- poll.setCreatorEmail(user.getEmail());
- poll.setUserId(user.getId());
- }
+
+ // FIXME : manage PollAccount creator
+
+// if (userExists) {
+// String creatorName =
+// user.getFirstName() + " " + user.getLastName();
+// poll.setCreatorName(creatorName);
+// poll.setCreatorEmail(user.getEmail());
+// poll.setUserId(user.getId());
+// }
}
}
return poll;
@@ -132,8 +136,8 @@
*
* @return true if it's the create mode, false otherwise
*/
- public boolean isCreateMode() {
- return StringUtils.isEmpty(getPoll().getId());
+ public boolean isCreateMode() throws PollenBusinessException {
+ return StringUtils.isEmpty(getPoll().getTopiaId());
}
/**
@@ -141,7 +145,7 @@
*
* @return the page title depends on create or update mode.
*/
- public String getPageTitle() {
+ public String getPageTitle() throws PollenBusinessException {
String title = "";
if (isCreateMode()) {
title = messages.get("pageTitle-create");
@@ -156,11 +160,11 @@
*
* @return the address bar.
*/
- public AddressBar getAddressBar() {
+ public AddressBar getAddressBar() throws PollenBusinessException {
return new AddressBar().appendCurrent(getPageTitle());
}
- public void setPollCopyFromPoll(PollDTO poll) {
+ public void setPollCopyFromPoll(Poll poll) {
this.poll = servicePoll.getNewPoll(poll);
}
@@ -234,7 +238,7 @@
*
* @return a list of ChoiceDTO
*/
- public List<ChoiceField> getChoices() {
+ public List<ChoiceField> getChoices() throws PollenBusinessException {
if (choices == null) {
choices = new ArrayList<ChoiceField>();
if (isCreateMode()) {
@@ -243,8 +247,8 @@
choices.add(ChoiceField.getChoiceText());
}
} else {
- for (ChoiceDTO current : getPoll().getChoices()) {
- choices.add((ChoiceField)current);
+ for (Choice current : getPoll().getChoice()) {
+ choices.add(new ChoiceField(getPoll(), current));
}
}
}
@@ -298,7 +302,7 @@
private boolean hasNotification;
@Persist
- private PreventRuleDTO notification;
+ private PreventRule notification;
/** Reminder option **/
@Property
@@ -306,7 +310,7 @@
private boolean hasReminder;
@Persist
- private PreventRuleDTO reminder;
+ private PreventRule reminder;
protected void initOptions() {
anonymousVoteAllowedDisabled = false;
@@ -316,9 +320,9 @@
hasReminder = false;
}
- public boolean isChoiceNbDisabled() {
+ public boolean isChoiceNbDisabled() throws PollenBusinessException {
// voteCounting not set to NORMAL
- return getPoll().getVoteCounting() != VoteCountingType.NORMAL;
+ return !getPoll().getVoteCountingType().isNormal();
}
@@ -329,10 +333,11 @@
*
* @return the notification
*/
- public PreventRuleDTO getNotification() {
+ public PreventRule getNotification() {
if (notification == null) {
- notification = new PreventRuleDTO("vote", 0, true,
- PreventRuleManager.EMAIL_ACTION);
+// notification = new PreventRuleImpl("vote", 0, true,
+// PreventRuleManager.EMAIL_ACTION);
+// notification.set
}
return notification;
}
@@ -342,10 +347,10 @@
*
* @return true if the mail is not defined
*/
- public boolean isNotificationDisabled() {
- // no email defined
- return StringUtils.isEmpty(getPoll().getCreatorEmail());
- }
+// public boolean isNotificationDisabled() {
+// // no email defined
+// return StringUtils.isEmpty(getPoll().getCreatorEmail());
+// }
//~~~~~~~~ OPTION REMINDER ~~~~~~~~~~~~~~~~//
@@ -354,10 +359,10 @@
*
* @return the reminder
*/
- public PreventRuleDTO getReminder() {
+ public PreventRule getReminder() {
if (reminder == null) {
- reminder = new PreventRuleDTO("rappel", 0, false,
- PreventRuleManager.EMAIL_ACTION);
+// reminder = new PreventRuleDTO("rappel", 0, false,
+// PreventRuleManager.EMAIL_ACTION);
}
return reminder;
}
@@ -366,10 +371,11 @@
* Condition to enable or not the reminder option.
*
* @return true if the poll has a FREE pollType
+ * @throws PollenBusinessException
*/
- public boolean isReminderDisabled() {
+ public boolean isReminderDisabled() throws PollenBusinessException {
// pollType is FREE
- return getPoll().getPollType() == PollType.FREE;
+ return getPoll().getPollType().isFree();
}
Deleted: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollModification.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollModification.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollModification.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -1,675 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.ui.pages.poll;
-
-import java.text.DateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import org.apache.tapestry5.BindingConstants;
-import org.apache.tapestry5.ValidationException;
-import org.apache.tapestry5.annotations.Component;
-import org.apache.tapestry5.annotations.IncludeStylesheet;
-import org.apache.tapestry5.annotations.InjectComponent;
-import org.apache.tapestry5.annotations.InjectPage;
-import org.apache.tapestry5.annotations.Parameter;
-import org.apache.tapestry5.annotations.Persist;
-import org.apache.tapestry5.annotations.Property;
-import org.apache.tapestry5.annotations.SessionState;
-import org.apache.tapestry5.corelib.components.Zone;
-import org.apache.tapestry5.ioc.Messages;
-import org.apache.tapestry5.ioc.annotations.Inject;
-import org.chenillekit.tapestry.core.components.DateTimeField;
-import org.chorem.pollen.business.PollenContext;
-import org.chorem.pollen.business.PollenProperty;
-import org.chorem.pollen.business.business.PreventRuleManager;
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.dto.PreventRuleDTO;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.dto.VotingListDTO;
-import org.chorem.pollen.business.services.ServiceList;
-import org.chorem.pollen.business.services.ServicePoll;
-import org.chorem.pollen.business.services.ServicePollAccount;
-import org.chorem.pollen.common.ChoiceType;
-import org.chorem.pollen.common.PollType;
-import org.chorem.pollen.ui.components.FeedBack;
-import org.chorem.pollen.ui.data.AddressBarItem;
-import org.chorem.pollen.ui.data.PollAction;
-import org.chorem.pollen.ui.data.PollStep;
-
-/**
- * Classe de la page de modification d'un sondage.
- *
- * @author kmorin
- * @author rannou
- * @version $Id$
- */
-@IncludeStylesheet("context:css/pollCreation.css")
-public class PollModification {
-
- @Parameter(defaultPrefix = BindingConstants.MESSAGE, value = "title")
- @Property
- private String title;
-
- @SuppressWarnings("unused")
- @Property
- private AddressBarItem[] address;
-
- /** Paramètres de la page */
- private String param;
-
- /** Affichage des messages pour l'utilisateur */
- @Component(id = "feedback")
- private FeedBack feedback;
-
- /** Étape courante du formulaire */
- @Persist
- private PollStep step;
-
- /**
- * Objet de session représentant l'utilisateur identifié.
- */
- @SuppressWarnings("unused")
- @SessionState
- private UserDTO user;
- @SuppressWarnings("unused")
- @Property
- private boolean userExists;
-
- /**
- * Objet de session représentant l'url du site.
- */
- @SessionState
- @Property
- private String siteURL;
-
- /** Composants DateTimeField pour le début des ajouts de choix */
- @SuppressWarnings("unused")
- @Component(parameters = { "timePicker=true", "timePickerAdjacent=true" })
- private DateTimeField beginChoiceDate;
- @SuppressWarnings("unused")
- @Component(parameters = { "timePicker=true", "timePickerAdjacent=true" })
- private DateTimeField endChoiceDate;
-
- /** Composants DateTimeField pour le début et la fin du sondage */
- @SuppressWarnings("unused")
- @Component(parameters = { "timePicker=true", "timePickerAdjacent=true" })
- private DateTimeField beginDate;
- @SuppressWarnings("unused")
- @Component(parameters = { "timePicker=true", "timePickerAdjacent=true" })
- private DateTimeField endDate;
-
- /** Format des dates */
- @SuppressWarnings("unused")
- @Persist
- @Property
- private DateFormat dateFormat;
-
- /** Locale courante */
- @Inject
- private Locale currentLocale;
-
- /**
- * Sondage
- */
- @Property
- @Persist
- private PollDTO poll;
-
- /**
- * Créateur du sondage
- */
- @Property
- @Persist
- private PollAccountDTO creator;
-
- /** Indique si l'utilisateur est authorisé */
- @Property
- private boolean userAllowed = false;
-
- /** Date de début du sondage (utilisée pour la validation). */
- private Date beginDateValidation;
-
- /** Date de début d'ajout des choix (utilisée pour la validation). */
- private Date beginChoiceDateValidation;
-
- @InjectComponent
- private Zone pollCreationZone;
-
- @InjectPage
- private ConfirmPoll confirmPoll;
-
- /** variable utilisée pour l'affichage de la notificationCheckBox */
- @Property
- @Persist
- private boolean notificationCheckBox;
-
- /** Règle de notification */
- @Property
- @Persist
- private PreventRuleDTO newRule;
-
- /**
- * Objet utilisé dans la boucle de parcours de la liste des votants
- */
- @Property
- private VotingListDTO votingList;
-
- /**
- * Objet utilisé dans la boucle de parcours de la liste des votants
- */
- @SuppressWarnings("unused")
- @Property
- private PollAccountDTO votingListPerson;
-
- /**
- * Objet utilisé dans la boucle de parcours de la liste des choix
- */
- @Property
- private ChoiceDTO choice;
-
- @InjectPage
- private ModificationValidation modificationValidation;
-
- @Inject
- private Messages messages;
-
- /** Injection des services */
- @Inject
- private ServicePoll servicePoll;
- @Inject
- private ServicePollAccount servicePollAccount;
- @Inject
- private ServiceList serviceList;
-
- /**
- * Méthode appelée lorsqu'on souhaite accéder à l'étape suivante de la
- * modification de sondage.
- */
- Object onSuccessFromPollCreationForm() {
- switch (step) {
- case POLL:
- step = PollStep.OPTIONS;
- break;
- case OPTIONS:
- if (poll.isContinuousResults()) {
- poll.setPublicResults(true);
- }
-
- if (isFreePoll()) {
- step = PollStep.CHOICES;
- } else {
- step = PollStep.LISTS;
- }
- break;
- case LISTS:
- step = PollStep.CHOICES;
- break;
- case CHOICES:
-
- // Règles de notification
- PreventRuleDTO oldRule = null;
- for (PreventRuleDTO rule : poll.getPreventRuleDTOs()) {
- if (rule.getId().equals(newRule.getId())) {
- oldRule = rule;
- }
- }
- if (oldRule != null) { // remplacement de oldRule par newRule
- poll.getPreventRuleDTOs().remove(oldRule);
- if (notificationCheckBox) {
- poll.getPreventRuleDTOs().add(newRule);
- }
- } else { // création d'une nouvelle règle
- if (notificationCheckBox) {
- poll.getPreventRuleDTOs().add(newRule);
- }
- }
-
- // sauvegarde des comptes modifiés
- List<PollAccountDTO> modifiedAccounts = getModifiedAccounts();
-
- // mise à jour des listes de votants du sondage
- servicePollAccount.updatePollAccount(creator);
- for (VotingListDTO votingList : poll.getVotingListDTOs()) {
- for (PollAccountDTO account : votingList.getPollAccountDTOs()) {
- servicePollAccount.updatePollAccount(account);
- }
- serviceList.updateVotingList(votingList);
- }
-
- if (poll.isContinuousResults()) {
- poll.setPublicResults(true);
- }
-
- for (ChoiceDTO choice : poll.getChoices()) {
- choice.setValidate(true);
- }
- servicePoll.updatePoll(poll);
-
- // envoi de mails aux comptes modifiés
- sendMailNotification(modifiedAccounts);
-
- step = PollStep.POLL;
- modificationValidation.setPoll(poll);
- return modificationValidation;
- default:
- step = PollStep.POLL;
- break;
- }
- return pollCreationZone.getBody();
- }
-
- /**
- * Méthode appelée que le formulaire soit valide ou non. Il est nécessaire
- * de la redéfinir pour qu'en cas d'erreur de validation, la zone soit tout
- * de même mise à jour pour afficher l'erreur.
- */
- Object onSubmitFromPollCreationForm() {
- return pollCreationZone.getBody();
- }
-
- /**
- * Méthode appelée lorsqu'on souhaite accéder à l'étape précédente de la
- * création de sondage.
- */
- Object onPrevious() {
- switch (step) {
- case OPTIONS:
- step = PollStep.POLL;
- break;
- case LISTS:
- step = PollStep.OPTIONS;
- break;
- case CHOICES:
- if (isFreePoll()) {
- step = PollStep.OPTIONS;
- } else {
- step = PollStep.LISTS;
- }
- break;
- default:
- step = PollStep.POLL;
- break;
- }
- return pollCreationZone.getBody();
- }
-
- /**
- * Méthode appelée lors de la validation du formulaire. Validation du champs
- * endDate.
- *
- * @throws ValidationException
- */
- void onValidateFromEndDate(Date value) throws ValidationException {
- if (beginDateValidation == null) {
- beginDateValidation = new Date();
- }
-
- if (value != null && value.before(beginDateValidation)) {
- throw new ValidationException(messages.get("endDate-validate"));
- }
- }
-
- /**
- * Méthode appelée lors de la validation du formulaire. Validation du champs
- * beginChoiceDate.
- *
- * @throws ValidationException
- */
- void onValidateFromBeginChoiceDate(Date value) throws ValidationException {
- if (beginDateValidation == null) {
- beginDateValidation = new Date();
- }
- beginChoiceDateValidation = value;
- if (value != null && value.after(beginDateValidation)) {
- throw new ValidationException(messages
- .get("beginChoiceDate-validate"));
- }
- }
-
- /**
- * Méthode appelée lors de la validation du formulaire. Validation du champs
- * endChoiceDate.
- *
- * @throws ValidationException
- */
- void onValidateFromEndChoiceDate(Date value) throws ValidationException {
- if (beginChoiceDateValidation == null) {
- beginChoiceDateValidation = new Date();
- }
-
- if (value != null && value.before(beginChoiceDateValidation)) {
- throw new ValidationException(messages.get("endChoiceDate-validate"));
- }
- }
-
- /**
- * Méthode appelée lors de la validation du formulaire. Validation des
- * listes de votants.
- *
- * @throws ValidationException
- */
- void onValidateFormFromPollCreationForm() throws ValidationException {
-
- // Validation des votants
- if (step == PollStep.LISTS) {
- List<VotingListDTO> votingLists = poll.getVotingListDTOs();
- int nbListEqual = 0;
- int nbEqual = 0;
- int nbNotNull = 0;
-
- // Repérage des doublons (listes)
- for (VotingListDTO list1 : votingLists) {
- for (VotingListDTO list2 : votingLists) {
- if (list1.getName().equals(list2.getName())) {
- nbListEqual++;
- }
- }
- }
-
- if (nbListEqual > votingLists.size()) {
- throw new ValidationException(messages.get("lists-validate"));
- }
-
- // Repérage des doublons (votants)
- for (VotingListDTO list1 : votingLists) {
- int nbLocalNotNull = 0;
- for (PollAccountDTO account1 : list1.getPollAccountDTOs()) {
- if (account1.getVotingId() != null
- && account1.getVotingId() != "") {
- nbNotNull++;
- nbLocalNotNull++;
-
- // comparaison avec les autres votants
- for (VotingListDTO list2 : votingLists) {
- for (PollAccountDTO account2 : list2
- .getPollAccountDTOs()) {
- if (account2.getVotingId() != null
- && account1.getVotingId() != "") {
- if (account1.getVotingId().equals(
- account2.getVotingId())) {
- nbEqual++;
- }
- }
- }
- }
- }
- }
- if (nbLocalNotNull == 0) {
- throw new ValidationException(messages
- .get("noList-validate"));
- }
- }
-
- if (nbEqual > nbNotNull) {
- throw new ValidationException(messages.get("list-validate"));
- }
- }
- }
-
- Object onActionFromCloseButton() {
- String backPage = "poll/modification";
- confirmPoll.setBackPage(backPage);
- confirmPoll.setAction(PollAction.CLOSE);
- confirmPoll.setPoll(poll);
- return confirmPoll;
- }
-
- public String getChoiceDateDisplay() {
- return poll.isChoiceAddAllowed() ? "display: block;" : "display: none;";
- }
-
- public String getNotificationDisplay() {
- return notificationCheckBox ? "display: block;" : "display: none;";
- }
-
- /** Retourne la date correspondant au choix courant */
- public Date getChoiceNameAsDate() {
- return new Date(Long.valueOf(choice.getName()));
- }
-
- /** Retourne le poids en entier de la liste courante */
- public int getWeightAsInt() {
- return votingList.getWeight().intValue();
- }
-
- /** Retourne le numéro de la liste courante (index+1) */
- public int getVotingListNumber() {
- return poll.getVotingListDTOs().indexOf(votingList) + 1;
- }
-
- /** Retourne la chaîne correspondant à l'étape courante */
- public String getStepLegend() {
- Integer index = step.getIndex();
-
- // corrections selon le type de sondage
- if (poll.getPollType() == PollType.FREE) {
- if (step == PollStep.CHOICES) {
- index--;
- }
- }
-
- // mise en forme du message
- switch (step) {
- case POLL:
- return messages.format("pollLegend", index);
- case OPTIONS:
- return messages.format("optionsLegend", index);
- case LISTS:
- return messages.format("listsLegend", index);
- case CHOICES:
- return messages.format("choicesLegend", index);
- default:
- return "";
- }
- }
-
- public boolean isListSizeAlert() {
- return votingList.getPollAccountDTOs().size() >
- PollCreation.LIST_MAX_SHOW_PERSONS;
- }
-
- public boolean isInPoll() {
- return step == PollStep.POLL;
- }
-
- public boolean isInLists() {
- return step == PollStep.LISTS;
- }
-
- public boolean isInChoices() {
- return step == PollStep.CHOICES;
- }
-
- public boolean isInOptions() {
- return step == PollStep.OPTIONS;
- }
-
- public boolean isFreePoll() {
- return poll.getPollType() == PollType.FREE;
- }
-
- public boolean isRestrictedPoll() {
- return poll.getPollType() == PollType.RESTRICTED;
- }
-
- public boolean isGroupPoll() {
- return poll.getPollType() == PollType.GROUP;
- }
-
- public boolean isTextChoices() {
- return poll.getChoiceType() == ChoiceType.TEXT;
- }
-
- public boolean isDateChoices() {
- return poll.getChoiceType() == ChoiceType.DATE;
- }
-
- public boolean isImgChoices() {
- return poll.getChoiceType() == ChoiceType.IMAGE;
- }
-
- @Inject
- private PollenContext pollen;
-
- /** Envoi du mail de notification */
- private void sendMailNotification(List<PollAccountDTO> modifiedAccounts) {
- String voteURL = siteURL + "poll/VoteFor/" + poll.getPollUId();
- Map<String, String> data = new HashMap<String, String>();
- data.put("host", pollen.getProperty(PollenProperty.EMAIL_HOST));
- data.put("port", pollen.getProperty(PollenProperty.EMAIL_PORT));
- data.put("from", pollen.getProperty(PollenProperty.EMAIL_FROM));
-
- // Mails aux votants
- for (PollAccountDTO account : modifiedAccounts) {
- if (account.getEmail() != null) {
- String accountVoteURL = voteURL + ":" + account.getAccountUId();
-
- data.put("to", account.getEmail());
- data.put("title", messages.format("votingEmail_subject", poll
- .getTitle()));
- data.put("msg", messages.format("votingEmail_msg", poll
- .getTitle(), account.getVotingId(), accountVoteURL));
-
- // FIXME call directly MailUtil.sendMail()
- // skip fill map, get from map...
- PreventRuleManager.emailAction(data);
- }
- }
- }
-
- /** Récupération des votants modifiés */
- private List<PollAccountDTO> getModifiedAccounts() {
- List<PollAccountDTO> modifiedAccounts = new ArrayList<PollAccountDTO>();
-
- // Parcours des listes de votants du sondage et comparaison
- // avec les listes de votants de la base de données
- for (VotingListDTO list : poll.getVotingListDTOs()) {
- for (PollAccountDTO newAccount : list.getPollAccountDTOs()) {
- PollAccountDTO oldAccount = servicePollAccount
- .findPollAccountById(newAccount.getId());
-
- if (oldAccount.getEmail() == null
- && newAccount.getEmail() != null) {
- modifiedAccounts.add(newAccount);
- } else if (oldAccount.getEmail() != null
- && newAccount.getEmail() != null) {
- if (!newAccount.getVotingId().equals(
- oldAccount.getVotingId())
- || !newAccount.getEmail().equals(
- oldAccount.getEmail())) {
- modifiedAccounts.add(newAccount);
- }
- }
- }
- }
-
- return modifiedAccounts;
- }
-
- void onActivate(String id) {
- param = id;
-
- if (id != null && !"".equals(id)) {
- String pollId = id.split(":", 2)[0];
-
- // Réinitialisation des variables de session
- if (poll == null || !pollId.equals(poll.getPollUId())) {
- poll = servicePoll.getPoll(pollId);
- creator = null;
- newRule = null;
- }
-
- if (poll != null) {
-
- // Identification de l'utilisateur
- if (creator == null) {
- creator = servicePollAccount.findPollAccountById(poll
- .getCreatorId());
- }
- if (id.split(":", 2).length == 2) {
- String creatorId = id.split(":", 2)[1];
- if (creatorId.equals(creator.getAccountUId())) {
- userAllowed = true;
- }
- }
-
- // Règles de notification
- if (newRule == null) {
- initNotificationRule();
- }
- }
- }
-
- // Affichage des erreurs
- if (poll == null) {
- feedback.addError(messages.get("pollNotFound"));
- } else if (poll.isClosed()) {
- feedback.addError(messages.get("pollClosed"));
- } else if (!userAllowed) {
- feedback.addError(messages.get("userNotAllowed"));
- }
- }
-
- /**
- * Méthode appelée au moment de la désactivation de la page
- *
- * @return l'identifiant du sondage et du créateur
- */
- String onPassivate() {
- return param;
- }
-
- /**
- * Initialisation de l'affichage
- */
- void setupRender() {
- address = new AddressBarItem[] { new AddressBarItem("Pollen", "Index"),
- new AddressBarItem(title, null) };
- dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT,
- DateFormat.SHORT, currentLocale);
-
- // Réinitialisation des variables de session
- if (poll != null) {
- poll = servicePoll.getPoll(poll.getPollUId());
- creator = servicePollAccount.findPollAccountById(poll
- .getCreatorId());
- initNotificationRule();
- }
- step = PollStep.POLL;
- }
-
- /** Initialisation de la règle de notification */
- private void initNotificationRule() {
- notificationCheckBox = false;
- newRule = new PreventRuleDTO("vote", 0, true,
- PreventRuleManager.EMAIL_ACTION);
- newRule.setPollId(poll.getId());
- for (PreventRuleDTO rule : poll.getPreventRuleDTOs()) {
- if ("vote".equals(rule.getScope())) {
- notificationCheckBox = true;
- newRule = rule;
- }
- }
- }
-}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -17,6 +17,7 @@
package org.chorem.pollen.ui.pages.poll;
import java.text.DateFormat;
+import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@@ -33,29 +34,25 @@
import org.apache.tapestry5.annotations.IncludeJavaScriptLibrary;
import org.apache.tapestry5.annotations.IncludeStylesheet;
import org.apache.tapestry5.annotations.InjectComponent;
-import org.apache.tapestry5.annotations.InjectPage;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.corelib.components.Zone;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.dto.ResultDTO;
-import org.chorem.pollen.business.dto.ResultListDTO;
-import org.chorem.pollen.business.services.ServicePoll;
-import org.chorem.pollen.business.services.ServicePollAccount;
-import org.chorem.pollen.business.services.ServiceResults;
+import org.chorem.pollen.PollenBusinessException;
import org.chorem.pollen.common.ChoiceType;
import org.chorem.pollen.common.PollType;
import org.chorem.pollen.common.VoteCountingType;
+import org.chorem.pollen.entity.Poll;
+import org.chorem.pollen.entity.PollAccount;
+import org.chorem.pollen.entity.Result;
+import org.chorem.pollen.service.ServicePoll;
import org.chorem.pollen.ui.components.Chart;
import org.chorem.pollen.ui.components.FeedBack;
-import org.chorem.pollen.ui.components.ImageContextLink;
import org.chorem.pollen.ui.data.AddressBarItem;
import org.chorem.pollen.votecounting.business.NumberMethod;
+import org.chorem.pollen.votecounting.dto.ChoiceDTO;
import org.chorem.pollen.votecounting.dto.VoteCountingResultDTO;
import org.slf4j.Logger;
@@ -105,16 +102,16 @@
/** Sondage concerné par les résultats */
@Property
@Persist
- private PollDTO poll;
+ private Poll poll;
/** Créateur du sondage */
@Property
- private PollAccountDTO creator;
+ private PollAccount creator;
/** Résultats du sondage */
@Persist
@Property(write = false)
- private List<ResultDTO> results;
+ private List<Result> results;
/**
* Résultats du sondage.
@@ -136,7 +133,7 @@
/** Résultat courant */
@Property
- private ResultDTO result;
+ private Result result;
/** Choix courant (diagramme) */
@SuppressWarnings("unused")
@@ -148,8 +145,8 @@
private Messages messages;
/** Page d'affichage d'une image */
- @InjectPage
- private ImageDisplay imageDisplay;
+// @InjectPage
+// private ImageDisplay imageDisplay;
/** Format des dates */
@Persist
@@ -169,27 +166,27 @@
/** Injection des services */
@Inject
private ServicePoll servicePoll;
- @Inject
- private ServicePollAccount servicePollAccount;
- @Inject
- private ServiceResults serviceResults;
+// @Inject
+// private ServicePollAccount servicePollAccount;
+// @Inject
+// private ServiceResults serviceResults;
- @InjectComponent
- private ImageContextLink imgContext;
+// @InjectComponent
+// private ImageContextLink imgContext;
+//
+// public ImageContextLink getImgContext() {
+// return imgContext;
+// }
- public ImageContextLink getImgContext() {
- return imgContext;
- }
-
/** Récupération de la liste des résultats pour le diagramme. */
public ArrayList<ArrayList<String>> getChoices() {
ArrayList<ArrayList<String>> choices = new ArrayList<ArrayList<String>>();
ArrayList<String> choiceValues = new ArrayList<String>();
- countPoll();
- for (ResultDTO result : results) {
- String name = result.getName();
- String value = result.getValue();
+ //countPoll();
+ for (Result result : results) {
+ String name = result.getChoice().getName();
+ String value = String.valueOf(result.getValue());
if (poll.getChoiceType() == ChoiceType.DATE) { // mise en forme de la date
Date date = new Date(Long.parseLong(name));
@@ -205,15 +202,15 @@
}
/** Récupération de la liste des résultats pour le classement. */
- public List<ResultDTO> getRanking() {
- countPoll();
- List<ResultDTO> ranking = results;
+ public List<Result> getRanking() {
+ //countPoll();
+ List<Result> ranking = results;
- Collections.sort(ranking, new Comparator<ResultDTO>() {
+ Collections.sort(ranking, new Comparator<Result>() {
@Override
- public int compare(ResultDTO o1, ResultDTO o2) {
- Double result1 = Double.parseDouble(o1.getValue());
- Double result2 = Double.parseDouble(o2.getValue());
+ public int compare(Result o1, Result o2) {
+ double result1 = o1.getValue();
+ double result2 = o2.getValue();
int comp = 0; // résultat de la comparaison
if (result1 > result2) {
@@ -222,7 +219,8 @@
comp = 1;
}
if (comp == 0) {
- comp = o1.getName().compareTo(o2.getName());
+ comp = o1.getChoice().getName().compareTo(
+ o2.getChoice().getName());
}
return comp;
}
@@ -232,19 +230,19 @@
}
/** Récupération des résultats gagnants. */
- public List<ResultDTO> getTopRanking() {
- List<ResultDTO> ranking = getRanking();
- List<ResultDTO> winners = new ArrayList<ResultDTO>();
+ public List<Result> getTopRanking() {
+ List<Result> ranking = getRanking();
+ List<Result> winners = new ArrayList<Result>();
- String winValue = null;
+ double winValue = 0.;
if (ranking.size() > 0) {
winValue = ranking.get(0).getValue();
} else {
return winners;
}
- for (ResultDTO r : ranking) {
- if (winValue.equals(r.getValue())) {
+ for (Result r : ranking) {
+ if (winValue == r.getValue()) {
winners.add(r);
}
}
@@ -297,7 +295,7 @@
/** Retourne le message d'aide correspondant au type de sondage. */
public String getHelpMessage() {
- switch (poll.getVoteCounting()) {
+ switch (poll.getVoteCountingType()) {
case NORMAL:
return messages.get("normalVote-help");
case PERCENTAGE:
@@ -313,11 +311,11 @@
/** Retourne le message de victoire indiquant le ou les gagnants. */
public String getVictoryMessage() {
- if (poll.getVoteCounting() == VoteCountingType.NUMBER) {
+ if (poll.getVoteCountingType().equals(VoteCountingType.NUMBER)) {
return null;
}
- List<ResultDTO> winners = getTopRanking();
+ List<Result> winners = getTopRanking();
if (winners.size() == 0) {
return "";
@@ -330,159 +328,164 @@
/** Retourne la valeur du résultat courant sans le .0 final */
public String getTrimValue() {
- String value = result.getValue();
+// String value = result.getValue();
+//
+// // le résultat peut-être un double : 1,0 -> 1 et 1,2 -> 1,2
+// if (value.endsWith(".0")) {
+// value = value.substring(0, value.indexOf('.'));
+// }
- // le résultat peut-être un double : 1,0 -> 1 et 1,2 -> 1,2
- if (value.endsWith(".0")) {
- value = value.substring(0, value.indexOf('.'));
- }
- return value;
+ // FIXME : carefull with Locale !!
+
+ return NumberFormat.getNumberInstance().format(result.getValue());
}
/** Retourne la date correspondant au résultat courant */
public Date getResultNameAsDate() {
- return new Date(Long.valueOf(result.getName()));
+ return new Date(Long.valueOf(result.getChoice().getName()));
}
/** Action réalisée lorsqu'on clique sur l'image */
- Object onDisplayImage(String resultName) {
- String choiceId = "";
+// Object onDisplayImage(String resultName) {
+// String choiceId = "";
+//
+// // Récupération du choix correspondant au résultat
+// for (Choice choice : poll.getChoice()) {
+// if (resultName.equals(choice.getName())) {
+// choiceId = choice.getTopiaId();
+// }
+// }
+//
+// imageDisplay.setPoll(poll);
+// imageDisplay.setChoiceId(choiceId);
+// imageDisplay.setPageStyle("VoteCounting");
+// return imageDisplay;
+// }
- // Récupération du choix correspondant au résultat
- for (ChoiceDTO choice : poll.getChoices()) {
- if (resultName.equals(choice.getName())) {
- choiceId = choice.getId();
- }
- }
-
- imageDisplay.setPoll(poll);
- imageDisplay.setChoiceId(choiceId);
- imageDisplay.setPageStyle("VoteCounting");
- return imageDisplay;
- }
-
/** Dépouillement du sondage. Mise à jour des résultats. */
- private void countPoll() {
- ResultListDTO resultListDTO = null;
-
- if (byGroup) {
- resultListDTO = serviceResults.getGroupResults(poll.getPollUId());
- } else {
- resultListDTO = serviceResults.getNormalResults(poll.getPollUId());
- }
+// private void countPoll() {
+// ResultListDTO resultListDTO = null;
+//
+// if (byGroup) {
+// resultListDTO = serviceResults.getGroupResults(poll.getPollUId());
+// } else {
+// resultListDTO = serviceResults.getNormalResults(poll.getPollUId());
+// }
+//
+// results = resultListDTO.getResultDTOs();
+// computeResults(resultListDTO);
+//
+// for (ResultDTO res : results) {
+// logger.debug(res.getName() + ": " + res.getValue()
+// + ", (voteCounting=" + res.getVoteCounting() + ", byGroup="
+// + res.isByGroup() + ")");
+// }
+// }
- results = resultListDTO.getResultDTOs();
- computeResults(resultListDTO);
-
- for (ResultDTO res : results) {
- logger.debug(res.getName() + ": " + res.getValue()
- + ", (voteCounting=" + res.getVoteCounting() + ", byGroup="
- + res.isByGroup() + ")");
- }
- }
-
- private void computeResults(ResultListDTO resultListDTO) {
- if (poll.getVoteCounting() == VoteCountingType.NUMBER) {
- // resultats des choix cachés
- choicesResults = new LinkedHashMap<String, List<String>>();
-
- // sous-titres des vrais choix (les choix pas cachés)
- subtitles = new LinkedHashMap<String, List<String>>();
-
- /*
- * liste des vrais choix (les choix pas cachés).
- * cette variable sera affectée à la variable results
- */
- List<ResultDTO> results2 = new ArrayList<ResultDTO>();
-
- // Ajout des résultats des choix cachés
- for (ResultDTO result : results) {
- if (result.isHidden()) {
- String name = result.getName();
- int indexOf = name.indexOf('#');
- String choice = name.substring(
- NumberMethod.HIDDEN_PREFIX.length(), indexOf);
-
- List<String> votes = choicesResults.get(choice);
- if (votes == null) {
- votes = new ArrayList<String>();
- }
-
- String votingId = name.substring(indexOf + 1);
- String value = result.getValue();
-
- votes.add(votingId);
- votes.add(value);
-
- choicesResults.put(choice, votes);
-
- } else {
- results2.add(result);
- }
- }
-
- Set<Entry<String, List<String>>> entries = choicesResults.entrySet();
- for (Entry<String, List<String>> entry : entries) {
- String choiceName = entry.getKey();
- List<String> values = entry.getValue();
-
- // Récupération du choix correspondant au résultat
- VoteCountingResultDTO voteCountingResultDTO = resultListDTO
- .getVoteCountingResultDTO();
-
- for (org.chorem.pollen.votecounting.dto.ChoiceDTO choice :
- voteCountingResultDTO.getChoices()) {
- if (choiceName.equals(choice.getName())) {
- List<String> choiceSubtitles = subtitles.get(choice);
- if (choiceSubtitles == null) {
- choiceSubtitles = new ArrayList<String>();
- }
-
- choiceSubtitles.add(messages.get("numberVote-total"));
- choiceSubtitles.add(String.valueOf(choice.getValue()));
-
- choiceSubtitles.add(messages.get("numberVote-average"));
- choiceSubtitles.add(String.valueOf(choice.getAverage()));
-
- choiceSubtitles.add(messages.get("numberVote-blank-votes"));
- choiceSubtitles.add(String.valueOf(choice.getNbBlankVotes()));
-
- choiceSubtitles.add(messages.get("numberVote-total-votes"));
- choiceSubtitles.add(String.valueOf(values.size() / 2));
-
- subtitles.put(choiceName, choiceSubtitles);
- break;
- }
- }
-
- }
-
- results = results2;
- if (results.size() == 1) {
- results.remove(0);
- }
- }
- }
+// private void computeResults(ResultListDTO resultListDTO) {
+// if (poll.getVoteCounting() == VoteCountingType.NUMBER) {
+// // resultats des choix cachés
+// choicesResults = new LinkedHashMap<String, List<String>>();
+//
+// // sous-titres des vrais choix (les choix pas cachés)
+// subtitles = new LinkedHashMap<String, List<String>>();
+//
+// /*
+// * liste des vrais choix (les choix pas cachés).
+// * cette variable sera affectée à la variable results
+// */
+// List<ResultDTO> results2 = new ArrayList<ResultDTO>();
+//
+// // Ajout des résultats des choix cachés
+// for (ResultDTO result : results) {
+// if (result.isHidden()) {
+// String name = result.getName();
+// int indexOf = name.indexOf('#');
+// String choice = name.substring(
+// NumberMethod.HIDDEN_PREFIX.length(), indexOf);
+//
+// List<String> votes = choicesResults.get(choice);
+// if (votes == null) {
+// votes = new ArrayList<String>();
+// }
+//
+// String votingId = name.substring(indexOf + 1);
+// String value = result.getValue();
+//
+// votes.add(votingId);
+// votes.add(value);
+//
+// choicesResults.put(choice, votes);
+//
+// } else {
+// results2.add(result);
+// }
+// }
+//
+// Set<Entry<String, List<String>>> entries = choicesResults.entrySet();
+// for (Entry<String, List<String>> entry : entries) {
+// String choiceName = entry.getKey();
+// List<String> values = entry.getValue();
+//
+// // Récupération du choix correspondant au résultat
+// VoteCountingResultDTO voteCountingResultDTO = resultListDTO
+// .getVoteCountingResultDTO();
+//
+// for (org.chorem.pollen.votecounting.dto.ChoiceDTO choice :
+// voteCountingResultDTO.getChoices()) {
+// if (choiceName.equals(choice.getName())) {
+// List<String> choiceSubtitles = subtitles.get(choice);
+// if (choiceSubtitles == null) {
+// choiceSubtitles = new ArrayList<String>();
+// }
+//
+// choiceSubtitles.add(messages.get("numberVote-total"));
+// choiceSubtitles.add(String.valueOf(choice.getValue()));
+//
+// choiceSubtitles.add(messages.get("numberVote-average"));
+// choiceSubtitles.add(String.valueOf(choice.getAverage()));
+//
+// choiceSubtitles.add(messages.get("numberVote-blank-votes"));
+// choiceSubtitles.add(String.valueOf(choice.getNbBlankVotes()));
+//
+// choiceSubtitles.add(messages.get("numberVote-total-votes"));
+// choiceSubtitles.add(String.valueOf(values.size() / 2));
+//
+// subtitles.put(choiceName, choiceSubtitles);
+// break;
+// }
+// }
+//
+// }
+//
+// results = results2;
+// if (results.size() == 1) {
+// results.remove(0);
+// }
+// }
+// }
/** Initialisation des objets de session */
- void onActivate(String id) {
+ void onActivate(String id) throws PollenBusinessException {
param = id;
String pollId = null;
if (id != null && !"".equals(id)) {
pollId = id.split(":", 2)[0];
- poll = servicePoll.getPoll(pollId);
+
+ poll = servicePoll.getPollForResults(pollId);
if (poll != null) {
// Identification de l'utilisateur
- creator = servicePollAccount.findPollAccountById(poll
- .getCreatorId());
- if (poll.isPublicResults()) {
+ creator = poll.getCreator();
+// creator = servicePollAccount.findPollAccountById(poll
+// .getCreatorId());
+ if (poll.getPublicResults()) {
userAllowed = true;
} else if (id.split(":", 2).length == 2) {
String creatorId = id.split(":", 2)[1];
- if (creatorId.equals(creator.getAccountUId())) {
+ if (creatorId.equals(creator.getUId())) {
userAllowed = true;
}
}
@@ -494,7 +497,7 @@
feedback.addError(messages.get("pollNotFound"));
} else if (!userAllowed) {
feedback.addError(messages.get("userNotAllowed"));
- } else if (!poll.isClosed()) {
+ } else if (!poll.getClosed()) {
feedback.addError(messages.get("pollNotClosed"));
}
}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -16,77 +16,51 @@
package org.chorem.pollen.ui.pages.poll;
-import java.io.File;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import org.apache.commons.fileupload.FileUploadException;
+import java.util.Locale;
import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.Block;
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.EventContext;
import org.apache.tapestry5.Link;
import org.apache.tapestry5.StreamResponse;
-import org.apache.tapestry5.ValidationException;
import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.IncludeJavaScriptLibrary;
import org.apache.tapestry5.annotations.IncludeStylesheet;
import org.apache.tapestry5.annotations.InjectComponent;
-import org.apache.tapestry5.annotations.InjectPage;
import org.apache.tapestry5.annotations.Log;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
-import org.apache.tapestry5.annotations.Retain;
import org.apache.tapestry5.annotations.SessionState;
-import org.apache.tapestry5.beaneditor.BeanModel;
-import org.apache.tapestry5.corelib.components.Form;
import org.apache.tapestry5.corelib.components.Zone;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
-import org.apache.tapestry5.upload.services.UploadedFile;
-import org.chorem.pollen.business.PollenBusinessException;
-import org.chorem.pollen.business.PollenBusinessException.PollenExceptionType;
-import org.chorem.pollen.business.PollenProperty;
-import org.chorem.pollen.business.PollenContext;
-import org.chorem.pollen.business.business.PreventRuleManager;
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.dto.CommentDTO;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.dto.PreventRuleDTO;
-import org.chorem.pollen.business.dto.ResultDTO;
-import org.chorem.pollen.business.dto.ResultListDTO;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.dto.VoteDTO;
-import org.chorem.pollen.business.services.ServicePoll;
-import org.chorem.pollen.business.services.ServicePollAccount;
-import org.chorem.pollen.business.services.ServiceResults;
-import org.chorem.pollen.business.services.ServiceVote;
-import org.chorem.pollen.business.utils.MD5;
-import org.chorem.pollen.common.ChoiceType;
-import org.chorem.pollen.common.PollType;
-import org.chorem.pollen.common.VoteCountingType;
+import org.chorem.pollen.PollenBusinessException;
+import org.chorem.pollen.PollenBusinessException.PollenExceptionType;
+import org.chorem.pollen.PollenContext;
+import org.chorem.pollen.PollenProperty;
+import org.chorem.pollen.entity.Choice;
+import org.chorem.pollen.entity.Comment;
+import org.chorem.pollen.entity.CommentImpl;
+import org.chorem.pollen.entity.Poll;
+import org.chorem.pollen.entity.PollAccount;
+import org.chorem.pollen.entity.UserAccount;
+import org.chorem.pollen.entity.Vote;
+import org.chorem.pollen.service.ServicePoll;
+import org.chorem.pollen.service.ServiceUser;
import org.chorem.pollen.ui.base.AbstractUploadPage;
-import org.chorem.pollen.ui.base.ContextLink;
import org.chorem.pollen.ui.components.Border;
import org.chorem.pollen.ui.components.FeedBack;
import org.chorem.pollen.ui.components.Pager;
import org.chorem.pollen.ui.data.AddressBar;
import org.chorem.pollen.ui.data.ChoiceField;
-import org.chorem.pollen.ui.data.EvenOdd;
-import org.chorem.pollen.ui.data.PollAction;
import org.chorem.pollen.ui.data.PollUri;
-import org.chorem.pollen.ui.data.uio.DateChoiceUIO;
-import org.chorem.pollen.ui.data.uio.ImageChoiceUIO;
import org.chorem.pollen.ui.services.ServiceImage;
-import org.chorem.pollen.ui.utils.FeedUtil;
import org.slf4j.Logger;
/**
@@ -99,862 +73,863 @@
@IncludeStylesheet({"context:css/vote.css", "context:css/lightbox.css"})
@IncludeJavaScriptLibrary({"${tapestry.scriptaculous}/builder.js","context:js/lightbox.js"})
public class VoteForPoll extends AbstractUploadPage {
-
- @Inject
- private Logger log;
-
- @Parameter(defaultPrefix = BindingConstants.MESSAGE, value = "title")
- @Property
- private String title;
-
- /** Paramètres de la page */
- private String param;
-
- /** Affichage des messages pour l'utilisateur */
- @Component(id = "feedback")
- private FeedBack feedback;
-
-
- /**
- * Objet de session représentant l'url du site.
- */
- @SessionState
- @Property
- private String siteURL;
-
- @Component
- private Form voteForm;
-
-// @Component(id = "pollAccountName")
-// private TextField nameField;
-
-// /** Composant DateTimeField pour les choix du sondage */
+//
+// @Parameter(defaultPrefix = BindingConstants.MESSAGE, value = "title")
+// @Property
+// private String title;
+//
+// /** Paramètres de la page */
+// private String param;
+//
+// /** Affichage des messages pour l'utilisateur */
+// @Component(id = "feedback")
+// private FeedBack feedback;
+//
+//
+// /**
+// * Objet de session représentant l'url du site.
+// */
+// @SessionState
+// @Property
+// private String siteURL;
+//
+// @Component
+// private Form voteForm;
+//
+//// @Component(id = "pollAccountName")
+//// private TextField nameField;
+//
+//// /** Composant DateTimeField pour les choix du sondage */
+//// @SuppressWarnings("unused")
+//// @Component(parameters = { "timePicker=true", "timePickerAdjacent=true" })
+//// private DateTimeField dateDTF;
+//
+// /** Locale courante */
+// @Inject
+// private Locale currentLocale;
+//
+// @Inject
+// private Logger logger;
+//
+// @Inject
+// private Messages messages;
+//
+// /**
+// * Vote courant de l'utilisateur
+// */
+// @Property
+// private Vote vote;
+//
+// /** Choix courant du sondage */
+// @Property
+// private Choice choiceOfPoll;
+// /** Choix courant du nouveau vote */
+// @Property
+// private Choice choiceOfVote;
+//
+// /** Résultats du sondage */
+// @Persist
+// private List<Result> results;
+//
+// /**
+// * Modèle pour l'affichage de la liste des sondages
+// */
+// @SuppressWarnings( { "unchecked", "unused" })
+// @Property
+// @Retain
+// private BeanModel voteModel;
+//
+// /*@InjectPage
+// private ImageDisplay imageDisplay;*/
+//
+//// @InjectComponent
+//// private Zone pollZone;
+//
+// /**
+// * Objet servant à changer la couleur à chaque ligne de la liste des
+// * sondages
+// */
// @SuppressWarnings("unused")
-// @Component(parameters = { "timePicker=true", "timePickerAdjacent=true" })
-// private DateTimeField dateDTF;
-
- /** Locale courante */
- @Inject
- private Locale currentLocale;
-
- @Inject
- private Logger logger;
-
- @Inject
- private Messages messages;
-
- /**
- * Vote courant de l'utilisateur
- */
- @Property
- private VoteDTO vote;
-
- /** Choix courant du sondage */
- @Property
- private ChoiceDTO choiceOfPoll;
- /** Choix courant du nouveau vote */
- @Property
- private ChoiceDTO choiceOfVote;
-
- /** Résultats du sondage */
- @Persist
- private List<ResultDTO> results;
-
- /**
- * Modèle pour l'affichage de la liste des sondages
- */
- @SuppressWarnings( { "unchecked", "unused" })
- @Property
- @Retain
- private BeanModel voteModel;
-
- /*@InjectPage
- private ImageDisplay imageDisplay;*/
-
-// @InjectComponent
-// private Zone pollZone;
-
- /**
- * Objet servant à changer la couleur à chaque ligne de la liste des
- * sondages
- */
- @SuppressWarnings("unused")
- @Property
- private EvenOdd evenOdd = new EvenOdd();
-
- /** Choix courant (type texte) */
- private boolean addChoice;
-
- /** Le votant a déjà voté ? */
- private boolean alreadyVoted;
-
- /** Le vote est anonyme */
- @Property
- private boolean anonymousVote = false;
-
- /** Liste des choix */
-// private List<ChoiceDTO> voteChoices = new ArrayList<ChoiceDTO>();
-
- /** Identifiant du compte correspondant à l'adresse forgée */
-// private String pollAccountId;
-
- /** Compte du votant */
// @Property
-// private PollAccountDTO pollAccount;
-
-// /** Nouveau choix de type texte */
+// private EvenOdd evenOdd = new EvenOdd();
+//
+// /** Choix courant (type texte) */
+// private boolean addChoice;
+//
+// /** Le votant a déjà voté ? */
+// private boolean alreadyVoted;
+//
+// /** Le vote est anonyme */
// @Property
+// private boolean anonymousVote = false;
+//
+// /** Liste des choix */
+//// private List<ChoiceDTO> voteChoices = new ArrayList<ChoiceDTO>();
+//
+// /** Identifiant du compte correspondant à l'adresse forgée */
+//// private String pollAccountId;
+//
+// /** Compte du votant */
+//// @Property
+//// private PollAccountDTO pollAccount;
+//
+//// /** Nouveau choix de type texte */
+//// @Property
+//// @Persist
+//// private ChoiceDTO newChoice;
+//
+// /** Nouveau choix de type date */
+// @Property
// @Persist
-// private ChoiceDTO newChoice;
-
- /** Nouveau choix de type date */
- @Property
- @Persist
- private DateChoiceUIO newDateChoice;
-
- /** Nouveau choix de type image */
- @Property
- @Persist
- private ImageChoiceUIO newImageChoice;
-
- /** Injection des services */
- @Inject
- private ServicePoll servicePoll;
- @Inject
- private ServiceVote serviceVote;
-
- @Inject
- private ServicePollAccount servicePollAccount;
- @Inject
- private ServiceResults serviceResults;
-
- /**
- * Composant pour la gestion des flux RSS
- */
- @InjectComponent
- private ContextLink feedContext;
-
- /**
- * Context to get feed of the current poll
- * @return a FeedContext defined in .tml file
- */
- public ContextLink getFeedContext() {
- return feedContext;
- }
-
+// private DateChoiceUIO newDateChoice;
+//
+// /** Nouveau choix de type image */
+// @Property
+// @Persist
+// private ImageChoiceUIO newImageChoice;
+//
+// /** Injection des services */
+// @Inject
+// private ServicePoll servicePoll;
+// @Inject
+// private ServiceVote serviceVote;
+//
+// @Inject
+// private ServicePollAccount servicePollAccount;
+// @Inject
+// private ServiceResults serviceResults;
+//
// /**
-// * Composant pour la gestion des upload d'images
+// * Composant pour la gestion des flux RSS
// */
// @InjectComponent
-// private ImageContextLink imgContext;
+// private ContextLink feedContext;
//
// /**
-// * Context to get images for choices.
-// * @return an ImageContextLink defined in .tml file
+// * Context to get feed of the current poll
+// * @return a FeedContext defined in .tml file
// */
-// public ImageContextLink getImgContext() {
-// return imgContext;
+// public ContextLink getFeedContext() {
+// return feedContext;
// }
-
- @InjectComponent
- private FeedBack voteFeedback;
-
- public String getVoteSizeMessage() throws PollenBusinessException {
- if (log.isDebugEnabled()) {
- log.debug("poll voteDTOs list size : " + getVotes().size());
- log.debug("poll nbVotes : " + getPoll().getNbVotes());
- }
- return messages.format("vote-size", getPoll().getNbVotes());
- }
-
- /** Méthode appelée après la soumission du vote. */
-// @Log
-// Object onSuccessFromVoteForm() throws PollenBusinessException {
-// if (initPollAccount()) {
-// List<ChoiceDTO> choiceDTOs = new ArrayList<ChoiceDTO>();
-// if (getPoll().getVoteCounting() == VoteCountingType.NORMAL) {
-// int nbChoices = 0;
-// for (ChoiceDTO choice : getPoll().getChoices()) {
-// if (choice.getValue() == 1) {
-// nbChoices++;
-// }
-// choiceDTOs.add(choice);
-// }
-// if (nbChoices > getPoll().getMaxChoiceNb()) {
-// voteForm.recordError(messages.format(("tooManyChoices"),
-// getPoll().getMaxChoiceNb()));
-// return pollZone.getBody();
-// }
//
-// } else if (getPoll().getVoteCounting() == VoteCountingType.PERCENTAGE) {
-// int total = 0;
-// for (ChoiceDTO choice : getPoll().getChoices()) {
-// total = total + choice.getValue();
-// choiceDTOs.add(choice);
-// }
-// if (total != 100) {
-// voteForm.recordError(messages.get("not100percent"));
-// return pollZone.getBody();
-// }
+//// /**
+//// * Composant pour la gestion des upload d'images
+//// */
+//// @InjectComponent
+//// private ImageContextLink imgContext;
+////
+//// /**
+//// * Context to get images for choices.
+//// * @return an ImageContextLink defined in .tml file
+//// */
+//// public ImageContextLink getImgContext() {
+//// return imgContext;
+//// }
//
-// } else if (getPoll().getVoteCounting() == VoteCountingType.CONDORCET) {
-// for (ChoiceDTO choice : getPoll().getChoices()) {
-// if (choice.getValue() == 0) {
-// choice.setValue(100);
-// }
-// choiceDTOs.add(choice);
-// }
+// @InjectComponent
+// private FeedBack voteFeedback;
//
-// } else if (getPoll().getVoteCounting() == VoteCountingType.NUMBER) {
-// String votingId = pollAccount.getVotingId();
-// if (anonymousVote) {
-// votingId = "anonymous" + UUID.randomUUID().toString().replaceAll("-", "");
-// }
+// public String getVoteSizeMessage() throws PollenBusinessException {
+// if (log.isDebugEnabled()) {
+// log.debug("poll voteDTOs list size : " + getVotes().size());
+// log.debug("poll nbVotes : " + getPoll().getNbVotes());
+// }
+// return messages.format("vote-size", getPoll().getNbVotes());
+// }
//
-// for (ChoiceDTO choice : getPoll().getChoices()) {
-// if (!choice.isHidden()) {
-// choiceDTOs.add(choice);
+// /** Méthode appelée après la soumission du vote. */
+//// @Log
+//// Object onSuccessFromVoteForm() throws PollenBusinessException {
+//// if (initPollAccount()) {
+//// List<ChoiceDTO> choiceDTOs = new ArrayList<ChoiceDTO>();
+//// if (getPoll().getVoteCounting() == VoteCountingType.NORMAL) {
+//// int nbChoices = 0;
+//// for (ChoiceDTO choice : getPoll().getChoices()) {
+//// if (choice.getValue() == 1) {
+//// nbChoices++;
+//// }
+//// choiceDTOs.add(choice);
+//// }
+//// if (nbChoices > getPoll().getMaxChoiceNb()) {
+//// voteForm.recordError(messages.format(("tooManyChoices"),
+//// getPoll().getMaxChoiceNb()));
+//// return pollZone.getBody();
+//// }
+////
+//// } else if (getPoll().getVoteCounting() == VoteCountingType.PERCENTAGE) {
+//// int total = 0;
+//// for (ChoiceDTO choice : getPoll().getChoices()) {
+//// total = total + choice.getValue();
+//// choiceDTOs.add(choice);
+//// }
+//// if (total != 100) {
+//// voteForm.recordError(messages.get("not100percent"));
+//// return pollZone.getBody();
+//// }
+////
+//// } else if (getPoll().getVoteCounting() == VoteCountingType.CONDORCET) {
+//// for (ChoiceDTO choice : getPoll().getChoices()) {
+//// if (choice.getValue() == 0) {
+//// choice.setValue(100);
+//// }
+//// choiceDTOs.add(choice);
+//// }
+////
+//// } else if (getPoll().getVoteCounting() == VoteCountingType.NUMBER) {
+//// String votingId = pollAccount.getVotingId();
+//// if (anonymousVote) {
+//// votingId = "anonymous" + UUID.randomUUID().toString().replaceAll("-", "");
+//// }
+////
+//// for (ChoiceDTO choice : getPoll().getChoices()) {
+//// if (!choice.isHidden()) {
+//// choiceDTOs.add(choice);
+////
+//// // creates a new hidden choice
+////// ChoiceDTO hiddenChoice = new ChoiceDTO();
+////// hiddenChoice.setName(NumberMethod.HIDDEN_PREFIX +
+////// choice.getName() + "#" + votingId);
+////// hiddenChoice.setHidden(true);
+////// hiddenChoice.setValue(choice.getValue());
+////// hiddenChoice.setPollId(choice.getPollId());
+////// hiddenChoice.setVoteId(choice.getVoteId());
+////// hiddenChoice.setValidate(false);
+//// ChoiceDTO hiddenChoice =
+//// servicePoll.getNewHiddenChoice(choice, votingId);
+////
+//// String choiceId =
+//// serviceChoice.createChoice(hiddenChoice);
+//// hiddenChoice.setId(choiceId);
+//// choiceDTOs.add(hiddenChoice);
+//// }
+//// }
+//// }
+////
+//// VoteDTO vote = new VoteDTO(null, getPoll().getId(), null);
+//// vote.setChoiceDTOs(choiceDTOs);
+//// vote.setWeight(pollAccount.getWeight());
+//// vote.setAnonymous(anonymousVote);
+////
+//// // mise à jour du vote ou création d'un nouveau vote
+//// if (alreadyVoted) {
+//// for (VoteDTO v : getVotes()) {
+//// PollAccountDTO voteAccount = servicePollAccount
+//// .findPollAccountById(v.getPollAccountId());
+////
+//// if (voteAccount.getVotingId().equals(getPollAccount().getVotingId())) {
+//// vote.setId(v.getId());
+//// deleteVote(vote.getId());
+//// serviceVote.createVote(vote, getPollAccount());
+//// }
+//// }
+//// } else {
+//// serviceVote.createVote(vote, getPollAccount());
+//// }
+////
+//// // Mise à jour du sondage et des résultats
+//// //poll = servicePoll.findPollByPollId(getPoll().getPollId());
+//// poll = null;
+//// countPoll();
+////
+//// addFeedEntry(PollAction.ADDVOTE, getPollAccount().getVotingId(),
+//// getResultsAsString());
+//// sendMailNotification();
+//// voteFeedback.addInfo(messages.get("vote-success"));
+//// page = pager.getLastPage();
+//// // Reset votes to reload them depends on page change.
+//// votes = null;
+//// return this;
+//// }
+////// voteChoices.clear();
+//// return pollZone.getBody();
+//// }
//
-// // creates a new hidden choice
-//// ChoiceDTO hiddenChoice = new ChoiceDTO();
-//// hiddenChoice.setName(NumberMethod.HIDDEN_PREFIX +
-//// choice.getName() + "#" + votingId);
-//// hiddenChoice.setHidden(true);
-//// hiddenChoice.setValue(choice.getValue());
-//// hiddenChoice.setPollId(choice.getPollId());
-//// hiddenChoice.setVoteId(choice.getVoteId());
-//// hiddenChoice.setValidate(false);
-// ChoiceDTO hiddenChoice =
-// servicePoll.getNewHiddenChoice(choice, votingId);
+//// private void deleteVote(String voteId) throws PollenBusinessException {
+//// for (VoteDTO vote : getVotes()) {
+//// if (vote.getId().equals(voteId)) {
+////
+//// List<ChoiceDTO> choiceDTOs = vote.getChoiceDTOs();
+//// for (ChoiceDTO choiceDTO : choiceDTOs) {
+////
+//// if (choiceDTO.isHidden()) {
+//// serviceChoice.deleteChoice(choiceDTO.getId());
+//// }
+//// }
+////
+//// break;
+//// }
+//// }
+////
+//// serviceVote.deleteVote(voteId);
+//// }
+////
+//// /** Méthode appelée lors de la suppression d'un vote. */
+//// Object onActionFromDeleteVote(String voteId) throws PollenBusinessException {
+//// deleteVote(voteId);
+////
+//// // Mise à jour du sondage et des résultats
+////// poll = servicePoll.findPollByPollId(poll.getPollId());
+//// poll = null;
+//// countPoll();
+////
+//// return pollZone.getBody();
+//// }
//
-// String choiceId =
-// serviceChoice.createChoice(hiddenChoice);
-// hiddenChoice.setId(choiceId);
-// choiceDTOs.add(hiddenChoice);
-// }
-// }
-// }
+// /** Initialisation du pollAccount et contrôle du nom. */
+//// private boolean initPollAccount() throws PollenBusinessException {
+////
+//// //// Contrôle et définition du votingId
+//// alreadyVoted = false;
+//// boolean modifAllowed = false;
+//// boolean restrictedListsForbidden = false;
+////
+//// // Suppression des espaces pouvant provoquer un double vote
+//// String votingId = getPollAccount().getVotingId().trim();
+//// getPollAccount().setVotingId(votingId);
+////
+//// // Contrôle de la présence du votant dans les listes de votants
+//// // du sondage (si le sondage n'est pas libre)
+////// if (!isFreePoll()) {
+////// restrictedListsForbidden = true;
+////// for (VotingListDTO list : poll.getVotingListDTOs()) {
+////// for (PollAccountDTO account : list.getPollAccountDTOs()) {
+////// if (pollAccount.getVotingId().equals(account.getVotingId())) {
+////// restrictedListsForbidden = false;
+////// pollAccount = servicePollAccount
+////// .findPollAccountById(account.getId());
+////// pollAccount.setVotingListId(list.getId());
+////// pollAccount.setWeight(account.getWeight());
+////// logger.debug("Compte \"" + account.getVotingId()
+////// + "\" présent dans la liste \""
+////// + list.getName() + "\" (poids="
+////// + account.getWeight() + ")");
+////// }
+////// }
+////// }
+////// }
+////
+//// // The calcul of alreadyVoted will be needed for no double votingId
+//// // Carefull, not correct for an anonymous vote
+//// alreadyVoted = serviceVote.hasAlreadyVoted(votingId, getPoll());
+////
+//// // Check for restricted poll
+//// if (!alreadyVoted && !isFreePoll()) {
+//// if (uri.getAccountUId() != null) {
+//// // The accountUId must be valid for the poll
+//// PollAccountDTO restrictedAccount =
+//// servicePoll.getRestrictedAccount(uri.getAccountUId(), getPoll());
+////
+//// if (restrictedAccount != null) {
+//// // PollAccount is replaced by the good account from db
+//// pollAccount = restrictedAccount;
+//// // Refresh alreadyVoted value depends on getPollAccount()
+//// alreadyVoted = getPollAccount().isHasVoted();
+//// // Existing account is null is forbidden for a restricted poll
+//// } else {
+//// restrictedListsForbidden = true;
+//// }
+//// // Not allowed to vote without an accountUId
+//// } else {
+//// restrictedListsForbidden = true;
+//// }
+////
+//// if (restrictedListsForbidden) {
+////// voteForm.recordError(nameField,
+////// messages.get("restrictedListsForbidden"));
+//// }
+//// }
+////
+//// // Génération d'un identifiant de vote (si le sondage est libre et anonyme)
+//// if (getPoll().isAnonymous()) {
+//// anonymousVote = true;
+//// if (isFreePoll()) {
+//// getPollAccount().setVotingId("anonymous"
+//// + UUID.randomUUID().toString().replaceAll("-", ""));
+//// }
+//// }
+////
+//// //// Définition de l'userId
+//// if (userExists) {
+//// getPollAccount().setUserId(user.getId());
+//// } else {
+//// getPollAccount().setUserId("");
+//// }
+////
+//// modifAllowed = isModifAllowed(getPollAccount().getVotingId());
+//// if (alreadyVoted && !modifAllowed) {
+////// voteForm.recordError(nameField, messages.format("alreadyVoted",
+////// getPollAccount().getVotingId()));
+//// }
+////
+//// logger.debug("votingId: " + getPollAccount().getVotingId());
+//// logger.debug("alreadyVoted: " + alreadyVoted);
+//// logger.debug("modifAllowed: " + modifAllowed);
+//// logger.debug("restrictedListsForbidden: " + restrictedListsForbidden);
+//// return ((!alreadyVoted || modifAllowed) && !restrictedListsForbidden);
+//// }
//
-// VoteDTO vote = new VoteDTO(null, getPoll().getId(), null);
-// vote.setChoiceDTOs(choiceDTOs);
-// vote.setWeight(pollAccount.getWeight());
-// vote.setAnonymous(anonymousVote);
+// /**
+// * Retourne vrai si la modification du vote est autorisée. C'est à dire si
+// * l'utilisateur connecté est l'auteur du vote ou si le votant défini par
+// * l'url est l'auteur du vote.
+// *
+// * @param votingId le votant a rechercher
+// * @return vrai si la modification du vote est autorisée
+// */
+//// public boolean isModifAllowed(String votingId) throws PollenBusinessException {
+//// boolean modifAllowed = false;
+//// int i = 0;
+////
+//// // parcours des votes pour trouver celui correspondant au votingId
+//// // et contrôle du droit de modification
+//// while (i < getVotes().size() && !modifAllowed) {
+////
+//// // account : compte associé au vote courant
+//// //String id = getVotes().get(i).getPollAccountId();
+//// //PollAccountDTO account = servicePollAccount.findPollAccountById(id);
+//// VoteDTO curr = getVotes().get(i);
+////
+//// // si le votant du vote correspond au votingId
+//// if (curr.getName().equals(votingId)) {
+//// if (logger.isDebugEnabled()) {
+//// logger.debug("vote name: " + curr.getName());
+//// logger.debug("vote account: " + curr.getPollAccountId());
+////// logger.debug("voting account: " + pollAccountId);
+//// }
+////
+//// // si le votant du vote correspond au votant actuel (pollAccountId)
+////// if (pollAccountId != null
+////// && pollAccountId.equals(curr.getPollAccountId())) {
+////// modifAllowed = true;
+////// }
+////
+//// // si l'utilisateur du vote correspond à l'utilisateur actuel (user)
+//// if (userExists && user.getId().length() > 0) {
+//// modifAllowed = user.getId().equals(curr.getUserId());
+//// }
+//// }
+////
+//// i++;
+//// }
+////
+//// return modifAllowed;
+//// }
//
-// // mise à jour du vote ou création d'un nouveau vote
-// if (alreadyVoted) {
-// for (VoteDTO v : getVotes()) {
-// PollAccountDTO voteAccount = servicePollAccount
-// .findPollAccountById(v.getPollAccountId());
+// /** Ajout d'une entrée dans le flux de syndication */
+// private void addFeedEntry(PollAction pollAction, String titleStr,
+// String contentStr) throws PollenBusinessException {
+// String voteURL = siteURL + "poll/VoteFor/" + getPoll().getPollUId();
+// File feedFile = getFeedContext().getFile(getPoll().getPollUId());
+// String title = null;
+// String content = null;
//
-// if (voteAccount.getVotingId().equals(getPollAccount().getVotingId())) {
-// vote.setId(v.getId());
-// deleteVote(vote.getId());
-// serviceVote.createVote(vote, getPollAccount());
-// }
-// }
-// } else {
-// serviceVote.createVote(vote, getPollAccount());
+// switch (pollAction) {
+// case ADDVOTE:
+// if (isVoteAnonymous()) {
+// titleStr = messages.get("anonymous");
// }
+// title = messages.format("pollFeed_voteTitle", titleStr);
+// content = messages.format("pollFeed_voteContent", contentStr);
+// break;
+// case ADDCHOICE:
+// title = messages.format("pollFeed_choiceTitle", titleStr);
+// content = messages.format("pollFeed_choiceContent", contentStr);
+// break;
+// case ADDCOMMENT:
+// title = messages.format("pollFeed_commentTitle", titleStr);
+// content = messages.format("pollFeed_commentContent", contentStr);
+// break;
+// }
//
-// // Mise à jour du sondage et des résultats
-// //poll = servicePoll.findPollByPollId(getPoll().getPollId());
-// poll = null;
-// countPoll();
-//
-// addFeedEntry(PollAction.ADDVOTE, getPollAccount().getVotingId(),
-// getResultsAsString());
-// sendMailNotification();
-// voteFeedback.addInfo(messages.get("vote-success"));
-// page = pager.getLastPage();
-// // Reset votes to reload them depends on page change.
-// votes = null;
-// return this;
+// if (!feedFile.exists()) {
+// FeedUtil.createFeed(feedFile, "atom_1.0", messages.format(
+// "pollFeed_title", getPoll().getTitle()), siteURL, messages
+// .format("pollFeed_desc", getPoll().getDescription()));
// }
-//// voteChoices.clear();
-// return pollZone.getBody();
+// FeedUtil.feedFeed(feedFile, title, voteURL, content);
// }
-
-// private void deleteVote(String voteId) throws PollenBusinessException {
-// for (VoteDTO vote : getVotes()) {
-// if (vote.getId().equals(voteId)) {
//
-// List<ChoiceDTO> choiceDTOs = vote.getChoiceDTOs();
-// for (ChoiceDTO choiceDTO : choiceDTOs) {
+// /** Envoi du mail de notification */
+// private void sendMailNotification() throws PollenBusinessException {
+// String voteURL = siteURL + "poll/VoteFor/" + getPoll().getPollUId();
+// String modifURL = siteURL + "poll/Modification/" + getPoll().getPollUId()
+// + ":" + MD5.encode(getPoll().getCreatorId());
+// Map<String, String> data = new HashMap<String, String>();
+// data.put("host", pollen.getProperty(PollenProperty.EMAIL_HOST));
+// data.put("port", pollen.getProperty(PollenProperty.EMAIL_PORT));
+// data.put("from", pollen.getProperty(PollenProperty.EMAIL_FROM));
//
-// if (choiceDTO.isHidden()) {
-// serviceChoice.deleteChoice(choiceDTO.getId());
-// }
-// }
+// // Mail au créateur
+// data.put("to", getPoll().getCreatorEmail());
+// data.put("title", messages.format("voteEmail_subject", getPoll().getTitle()));
+// data.put("msg", messages.format("voteEmail_msg", getPoll().getTitle(), getPoll()
+// .getNbVotes(), voteURL, modifURL));
//
-// break;
-// }
+// for (PreventRuleDTO rule : getPoll().getPreventRuleDTOs()) {
+// PreventRuleManager manager = new PreventRuleManager(rule);
+// manager.execute("vote", getVotes().size(), data);
// }
+// }
//
-// serviceVote.deleteVote(voteId);
+// public boolean isAddChoice() {
+// return addChoice;
// }
//
-// /** Méthode appelée lors de la suppression d'un vote. */
-// Object onActionFromDeleteVote(String voteId) throws PollenBusinessException {
-// deleteVote(voteId);
+// public void setAddChoice(boolean addChoice) {
+// choiceOfVote.setValue((addChoice) ? 1 : 0);
+// }
//
-// // Mise à jour du sondage et des résultats
-//// poll = servicePoll.findPollByPollId(poll.getPollId());
-// poll = null;
-// countPoll();
+// public void setAddNumberVote(Integer value) {
+// if (value != null) {
+// choiceOfVote.setValue(value);
//
-// return pollZone.getBody();
+// } else {
+// choiceOfVote.setValue(-1);
+// }
// }
-
- /** Initialisation du pollAccount et contrôle du nom. */
-// private boolean initPollAccount() throws PollenBusinessException {
//
-// //// Contrôle et définition du votingId
-// alreadyVoted = false;
-// boolean modifAllowed = false;
-// boolean restrictedListsForbidden = false;
+// public Integer getAddNumberVote() {
+// return null;
+// }
//
-// // Suppression des espaces pouvant provoquer un double vote
-// String votingId = getPollAccount().getVotingId().trim();
-// getPollAccount().setVotingId(votingId);
//
-// // Contrôle de la présence du votant dans les listes de votants
-// // du sondage (si le sondage n'est pas libre)
-//// if (!isFreePoll()) {
-//// restrictedListsForbidden = true;
-//// for (VotingListDTO list : poll.getVotingListDTOs()) {
-//// for (PollAccountDTO account : list.getPollAccountDTOs()) {
-//// if (pollAccount.getVotingId().equals(account.getVotingId())) {
-//// restrictedListsForbidden = false;
-//// pollAccount = servicePollAccount
-//// .findPollAccountById(account.getId());
-//// pollAccount.setVotingListId(list.getId());
-//// pollAccount.setWeight(account.getWeight());
-//// logger.debug("Compte \"" + account.getVotingId()
-//// + "\" présent dans la liste \""
-//// + list.getName() + "\" (poids="
-//// + account.getWeight() + ")");
-//// }
-//// }
+// /**
+// * Retourne si le choix fait partie du vote (s'il a été renseigné par le
+// * votant).
+// *
+// * @param choice le choix concerné
+// * @return true si le choix est dans le vote
+// */
+// public Boolean isChoiceInVote(ChoiceDTO choice) throws PollenBusinessException {
+// if (choice != null) {
+// switch (getPoll().getVoteCounting()) {
+// case NORMAL:
+// return choice.getValue() > 0;
+// case PERCENTAGE:
+// return true;
+// case CONDORCET:
+// return choice.getValue() < 100;
+// case NUMBER:
+// return choice.getValue() >= 0;
+// }
+// }
+// return null;
+// }
+//
+// public boolean isChoiceHidden() {
+// return choiceOfPoll.isHidden();
+// }
+//
+// /**
+// * Retourne le choix de vote correspondant au choix de sondage courant.
+// *
+// * @return un choix de vote
+// */
+// @Property(write = false)
+// private ChoiceDTO currentVoteChoice;
+//
+// public char setCurrentVoteChoice() {
+//// currentVoteChoice = null;
+//// for (ChoiceDTO choice : vote.getChoiceDTOs()) {
+//// if (choice.getId().equals(choiceOfPoll.getId())) {
+//// currentVoteChoice = choice;
+//// break;
//// }
//// }
//
-// // The calcul of alreadyVoted will be needed for no double votingId
-// // Carefull, not correct for an anonymous vote
-// alreadyVoted = serviceVote.hasAlreadyVoted(votingId, getPoll());
+// return 0;
+// }
//
-// // Check for restricted poll
-// if (!alreadyVoted && !isFreePoll()) {
-// if (uri.getAccountUId() != null) {
-// // The accountUId must be valid for the poll
-// PollAccountDTO restrictedAccount =
-// servicePoll.getRestrictedAccount(uri.getAccountUId(), getPoll());
+// /**
+// * Retourne le résultat correspondant au choix de sondage courant.
+// *
+// * @return le résultat du choix
+// */
+// public String getCurrentChoiceResult() {
+// String val = "";
+// for (ResultDTO result : results) {
+// if (result.getName().equals(choiceOfPoll.getName())) {
+// val = removeTrailing0(result.getValue());
+// }
+// }
+// return val;
+// }
//
-// if (restrictedAccount != null) {
-// // PollAccount is replaced by the good account from db
-// pollAccount = restrictedAccount;
-// // Refresh alreadyVoted value depends on getPollAccount()
-// alreadyVoted = getPollAccount().isHasVoted();
-// // Existing account is null is forbidden for a restricted poll
-// } else {
-// restrictedListsForbidden = true;
-// }
-// // Not allowed to vote without an accountUId
+// /**
+// * Vérifie que le fichier de flux de syndication existe.
+// *
+// * @return vrai si le fichier existe
+// */
+// @Log
+// public boolean isFeedFileExisting() throws PollenBusinessException {
+// File feedFile = getFeedContext().getFile(getPoll().getPollUId());
+// if (log.isDebugEnabled()) {
+// log.debug("feed context path : " + getFeedContext().getContextPath());
+// log.debug("feed absolute path : " + feedFile.getAbsolutePath());
+// }
+// return feedFile.exists() ? true : false;
+// }
+//
+// /**
+// * Supprime le 0 final d'un nombre à virgule. Le résultat peut-être un
+// * double : 1,0 -> 1 et 1,2 -> 1,2.
+// *
+// * @param val le nombre
+// * @return le nombre sans 0 final
+// */
+// private String removeTrailing0(String val) {
+// if (val.endsWith(".0")) {
+// val = val.substring(0, val.indexOf('.'));
+// }
+// return val;
+// }
+//
+// /**
+// * Retourne une chaîne contenant les résultats du sondage.
+// *
+// * @return les résultats
+// */
+// public String getResultsAsString() throws PollenBusinessException {
+// StringBuffer res = new StringBuffer("");
+// Iterator<ResultDTO> it = results.iterator();
+// while (it.hasNext()) {
+// ResultDTO result = it.next();
+// if (isDateType()) {
+// Date date = new Date(Long.parseLong(result.getName()));
+// res.append(dateFormat.format(date));
// } else {
-// restrictedListsForbidden = true;
+// res.append(result.getName());
// }
-//
-// if (restrictedListsForbidden) {
-//// voteForm.recordError(nameField,
-//// messages.get("restrictedListsForbidden"));
+// res.append("=" + removeTrailing0(result.getValue()));
+// if (it.hasNext()) {
+// res.append(", ");
// }
// }
+// return res.toString();
+// }
//
-// // Génération d'un identifiant de vote (si le sondage est libre et anonyme)
-// if (getPoll().isAnonymous()) {
-// anonymousVote = true;
-// if (isFreePoll()) {
-// getPollAccount().setVotingId("anonymous"
-// + UUID.randomUUID().toString().replaceAll("-", ""));
+// /**
+// * Retourne true si le sondage est anonyme ou si le vote soumis est anonyme.
+// * Utilisé lors de la soumission d'un vote.
+// *
+// * @return true si le vote est anonyme
+// */
+// public boolean isVoteAnonymous() throws PollenBusinessException {
+// return getPoll().isAnonymous() || anonymousVote;
+// }
+//
+// /**
+// * Retourne true si le sondage est anonyme ou si le vote courant est
+// * anonyme. Utilisé dans la boucle de parcours des votes.
+// *
+// * @return true si le vote est anonyme
+// */
+// public boolean isCurrentVoteAnonymous() throws PollenBusinessException {
+// return getPoll().isAnonymous() || vote.isAnonymous();
+// }
+//
+// /** Retourne vrai si la checkbox anonymousVote doit être affichée. */
+// public boolean isAnonymousVoteDisplayed() throws PollenBusinessException {
+// return getPoll().isAnonymousVoteAllowed() && !getPoll().isAnonymous();
+// }
+//
+// /** Retourne l'identifiant du votant du vote courant */
+// public String getCurrentVotingId() {
+// return vote.getName();
+// }
+//
+// /** Validation du champs de saisie du choix (texte). */
+// void onValidateFromTextName(String value) throws ValidationException, PollenBusinessException {
+// validateNewChoice(value);
+// }
+//
+// /** Validation du champs de saisie du choix (date). */
+// void onValidateFromDateDTF(Date value) throws ValidationException, PollenBusinessException {
+// validateNewChoice(String.valueOf(value.getTime()));
+// }
+//
+// /** Validation du champs de saisie du choix (image). */
+// void onValidateFromImgFile(UploadedFile value) throws ValidationException, PollenBusinessException {
+// validateNewChoice(value.getFileName().replace(' ', '_'));
+// }
+//
+// /** Validation du champs de saisie du choix. */
+// private void validateNewChoice(String value) throws ValidationException, PollenBusinessException {
+// for (ChoiceDTO choice : getPoll().getChoices()) {
+// if (value.equals(choice.getName())) {
+// throw new ValidationException(messages.format("choiceExists",
+// value));
// }
// }
+// }
//
-// //// Définition de l'userId
-// if (userExists) {
-// getPollAccount().setUserId(user.getId());
-// } else {
-// getPollAccount().setUserId("");
+// /** Méthode appelée lors de l'ajout d'un choix. */
+// Object onSuccessFromChoiceForm() throws PollenBusinessException {
+// String choiceName = null;
+// String choiceDesc = null;
+// if (isTextType()) {
+// if (newChoice.getName() != null) {
+// newChoice.setValidate(true);
+// newChoice.setPollUId(getPoll().getPollUId());
+// getPoll().getChoices().add(newChoice);
+// choiceName = newChoice.getName();
+// choiceDesc = newChoice.getDescription();
+// }
+// } else if (isDateType()) {
+// if (newDateChoice.getDate() != null) {
+// newDateChoice.setValidate(true);
+// newDateChoice.setPollUId(getPoll().getPollUId());
+// newDateChoice.setName(String.valueOf(newDateChoice.getDate()
+// .getTime()));
+// getPoll().getChoices().add(newDateChoice);
+// Date date = new Date(Long.parseLong(newDateChoice.getName()));
+// choiceName = dateFormat.format(date);
+// choiceDesc = newDateChoice.getDescription();
+// }
+// } else if (isImageType()) {
+// if (newImageChoice.getImg() != null) {
+// newImageChoice.setValidate(true);
+// newImageChoice.setPollUId(getPoll().getPollUId());
+// newImageChoice.setName(newImageChoice.getImg().getFileName()
+// .replace(' ', '_'));
+// getPoll().getChoices().add(newImageChoice);
+// //File imgFile = getImgContext().getImageDir(); // dir set in getImgContext()
+//// File imgFile = getImgContext().getImageDir(); // dir set in getImgContext()
+//// ImageUtil.saveImage(newImageChoice, imgFile);
+// choiceName = newImageChoice.getName();
+// choiceDesc = newImageChoice.getDescription();
+// }
// }
//
-// modifAllowed = isModifAllowed(getPollAccount().getVotingId());
-// if (alreadyVoted && !modifAllowed) {
-//// voteForm.recordError(nameField, messages.format("alreadyVoted",
-//// getPollAccount().getVotingId()));
-// }
+// servicePoll.updatePoll(getPoll());
+// poll = null;
+// //poll = servicePoll.findPollByPollId(getPoll().getPollId());
+// addFeedEntry(PollAction.ADDCHOICE, choiceName, choiceDesc);
+//// newChoice = new ChoiceDTO();
+//// newDateChoice = new DateChoiceUIO();
+//// newImageChoice = new ImageChoiceUIO();
+// return this;
+// }
//
-// logger.debug("votingId: " + getPollAccount().getVotingId());
-// logger.debug("alreadyVoted: " + alreadyVoted);
-// logger.debug("modifAllowed: " + modifAllowed);
-// logger.debug("restrictedListsForbidden: " + restrictedListsForbidden);
-// return ((!alreadyVoted || modifAllowed) && !restrictedListsForbidden);
+//// public boolean isPollNull() {
+//// return poll == null;
+//// }
+//
+//
+// public boolean isPollChoiceOrVoteStarted() throws PollenBusinessException {
+// return isPollChoiceStarted() || isPollStarted();
// }
-
- /**
- * Retourne vrai si la modification du vote est autorisée. C'est à dire si
- * l'utilisateur connecté est l'auteur du vote ou si le votant défini par
- * l'url est l'auteur du vote.
- *
- * @param votingId le votant a rechercher
- * @return vrai si la modification du vote est autorisée
- */
-// public boolean isModifAllowed(String votingId) throws PollenBusinessException {
-// boolean modifAllowed = false;
-// int i = 0;
//
-// // parcours des votes pour trouver celui correspondant au votingId
-// // et contrôle du droit de modification
-// while (i < getVotes().size() && !modifAllowed) {
+//// public boolean isDescNull() {
+//// return choiceOfPoll.getDescription() == null
+//// || "".equals(choiceOfPoll.getDescription());
+//// }
//
-// // account : compte associé au vote courant
-// //String id = getVotes().get(i).getPollAccountId();
-// //PollAccountDTO account = servicePollAccount.findPollAccountById(id);
-// VoteDTO curr = getVotes().get(i);
//
-// // si le votant du vote correspond au votingId
-// if (curr.getName().equals(votingId)) {
-// if (logger.isDebugEnabled()) {
-// logger.debug("vote name: " + curr.getName());
-// logger.debug("vote account: " + curr.getPollAccountId());
-//// logger.debug("voting account: " + pollAccountId);
-// }
+// public boolean isFreePoll() throws PollenBusinessException {
+// return getPoll().getPollType() == PollType.FREE;
+// }
//
-// // si le votant du vote correspond au votant actuel (pollAccountId)
-//// if (pollAccountId != null
-//// && pollAccountId.equals(curr.getPollAccountId())) {
-//// modifAllowed = true;
-//// }
+// public boolean isRestrictedPoll() throws PollenBusinessException {
+// return getPoll().getPollType() == PollType.RESTRICTED;
+// }
//
-// // si l'utilisateur du vote correspond à l'utilisateur actuel (user)
-// if (userExists && user.getId().length() > 0) {
-// modifAllowed = user.getId().equals(curr.getUserId());
-// }
-// }
+// public boolean isGroupPoll() throws PollenBusinessException {
+// return getPoll().getPollType() == PollType.GROUP;
+// }
//
-// i++;
+// public boolean isTextType() throws PollenBusinessException {
+// return getPoll().getChoiceType() == ChoiceType.TEXT;
+// }
+//
+// public boolean isDateType() throws PollenBusinessException {
+// return getPoll().getChoiceType() == ChoiceType.DATE;
+// }
+//
+// public boolean isImageType() throws PollenBusinessException {
+// return getPoll().getChoiceType() == ChoiceType.IMAGE;
+// }
+//
+// public boolean isNormalVoteCounting() throws PollenBusinessException {
+// return getPoll().getVoteCounting() == VoteCountingType.NORMAL;
+// }
+//
+// public boolean isPercentageVoteCounting() throws PollenBusinessException {
+// return getPoll().getVoteCounting() == VoteCountingType.PERCENTAGE;
+// }
+//
+// public boolean isCondorcetVoteCounting() throws PollenBusinessException {
+// return getPoll().getVoteCounting() == VoteCountingType.CONDORCET;
+// }
+//
+// public boolean isNumberVoteCounting() throws PollenBusinessException {
+// return getPoll().getVoteCounting() == VoteCountingType.NUMBER;
+// }
+//
+// /** Retourne le message d'aide correspondant au type de sondage. */
+// public String getHelpMessage() throws PollenBusinessException {
+// switch (getPoll().getVoteCounting()) {
+// case NORMAL:
+// return messages.get("normalVote-help");
+// case PERCENTAGE:
+// return messages.get("percentageVote-help");
+// case CONDORCET:
+// return messages.get("condorcetVote-help");
+// case NUMBER:
+// return messages.get("numberVote-help");
+// default:
+// return "";
// }
+// }
//
-// return modifAllowed;
+// /**
+// * Retourne la date correspondant au choix courant
+// *
+// * @return date
+// */
+// public Date getChoiceNameAsDate() {
+// return new Date(Long.valueOf(choiceOfPoll.getName()));
// }
-
- /** Ajout d'une entrée dans le flux de syndication */
- private void addFeedEntry(PollAction pollAction, String titleStr,
- String contentStr) throws PollenBusinessException {
- String voteURL = siteURL + "poll/VoteFor/" + getPoll().getPollUId();
- File feedFile = getFeedContext().getFile(getPoll().getPollUId());
- String title = null;
- String content = null;
-
- switch (pollAction) {
- case ADDVOTE:
- if (isVoteAnonymous()) {
- titleStr = messages.get("anonymous");
- }
- title = messages.format("pollFeed_voteTitle", titleStr);
- content = messages.format("pollFeed_voteContent", contentStr);
- break;
- case ADDCHOICE:
- title = messages.format("pollFeed_choiceTitle", titleStr);
- content = messages.format("pollFeed_choiceContent", contentStr);
- break;
- case ADDCOMMENT:
- title = messages.format("pollFeed_commentTitle", titleStr);
- content = messages.format("pollFeed_commentContent", contentStr);
- break;
- }
-
- if (!feedFile.exists()) {
- FeedUtil.createFeed(feedFile, "atom_1.0", messages.format(
- "pollFeed_title", getPoll().getTitle()), siteURL, messages
- .format("pollFeed_desc", getPoll().getDescription()));
- }
- FeedUtil.feedFeed(feedFile, title, voteURL, content);
- }
-
- /** Envoi du mail de notification */
- private void sendMailNotification() throws PollenBusinessException {
- String voteURL = siteURL + "poll/VoteFor/" + getPoll().getPollUId();
- String modifURL = siteURL + "poll/Modification/" + getPoll().getPollUId()
- + ":" + MD5.encode(getPoll().getCreatorId());
- Map<String, String> data = new HashMap<String, String>();
- data.put("host", pollen.getProperty(PollenProperty.EMAIL_HOST));
- data.put("port", pollen.getProperty(PollenProperty.EMAIL_PORT));
- data.put("from", pollen.getProperty(PollenProperty.EMAIL_FROM));
-
- // Mail au créateur
- data.put("to", getPoll().getCreatorEmail());
- data.put("title", messages.format("voteEmail_subject", getPoll().getTitle()));
- data.put("msg", messages.format("voteEmail_msg", getPoll().getTitle(), getPoll()
- .getNbVotes(), voteURL, modifURL));
-
- for (PreventRuleDTO rule : getPoll().getPreventRuleDTOs()) {
- PreventRuleManager manager = new PreventRuleManager(rule);
- manager.execute("vote", getVotes().size(), data);
- }
- }
-
- public boolean isAddChoice() {
- return addChoice;
- }
-
- public void setAddChoice(boolean addChoice) {
- choiceOfVote.setValue((addChoice) ? 1 : 0);
- }
-
- public void setAddNumberVote(Integer value) {
- if (value != null) {
- choiceOfVote.setValue(value);
-
- } else {
- choiceOfVote.setValue(-1);
- }
- }
-
- public Integer getAddNumberVote() {
- return null;
- }
-
-
- /**
- * Retourne si le choix fait partie du vote (s'il a été renseigné par le
- * votant).
- *
- * @param choice le choix concerné
- * @return true si le choix est dans le vote
- */
- public Boolean isChoiceInVote(ChoiceDTO choice) throws PollenBusinessException {
- if (choice != null) {
- switch (getPoll().getVoteCounting()) {
- case NORMAL:
- return choice.getValue() > 0;
- case PERCENTAGE:
- return true;
- case CONDORCET:
- return choice.getValue() < 100;
- case NUMBER:
- return choice.getValue() >= 0;
- }
- }
- return null;
- }
-
- public boolean isChoiceHidden() {
- return choiceOfPoll.isHidden();
- }
-
- /**
- * Retourne le choix de vote correspondant au choix de sondage courant.
- *
- * @return un choix de vote
- */
- @Property(write = false)
- private ChoiceDTO currentVoteChoice;
-
- public char setCurrentVoteChoice() {
-// currentVoteChoice = null;
-// for (ChoiceDTO choice : vote.getChoiceDTOs()) {
-// if (choice.getId().equals(choiceOfPoll.getId())) {
-// currentVoteChoice = choice;
-// break;
+//
+// /** Dépouillement du sondage. Mise à jour des résultats. */
+// private void countPoll() throws PollenBusinessException {
+// ResultListDTO resultListDTO = null;
+// if (getPoll().getContinuousResults()) {
+//
+// if (isGroupPoll()) {
+// resultListDTO = serviceResults.getGroupResults(getPoll().getPollUId());
+// } else {
+// resultListDTO = serviceResults.getNormalResults(getPoll().getPollUId());
// }
+//
+// results = resultListDTO.getResultDTOs();
+//
+// if (logger.isDebugEnabled()) {
+// for (ResultDTO res : results) {
+// logger.debug(res.getName() + ": " + res.getValue()
+// + ", (voteCounting=" + res.getVoteCounting()
+// + ", byGroup=" + res.isByGroup() + ")");
+// }
+// }
// }
-
- return 0;
- }
-
- /**
- * Retourne le résultat correspondant au choix de sondage courant.
- *
- * @return le résultat du choix
- */
- public String getCurrentChoiceResult() {
- String val = "";
- for (ResultDTO result : results) {
- if (result.getName().equals(choiceOfPoll.getName())) {
- val = removeTrailing0(result.getValue());
- }
- }
- return val;
- }
-
- /**
- * Vérifie que le fichier de flux de syndication existe.
- *
- * @return vrai si le fichier existe
- */
- @Log
- public boolean isFeedFileExisting() throws PollenBusinessException {
- File feedFile = getFeedContext().getFile(getPoll().getPollUId());
- if (log.isDebugEnabled()) {
- log.debug("feed context path : " + getFeedContext().getContextPath());
- log.debug("feed absolute path : " + feedFile.getAbsolutePath());
- }
- return feedFile.exists() ? true : false;
- }
-
- /**
- * Supprime le 0 final d'un nombre à virgule. Le résultat peut-être un
- * double : 1,0 -> 1 et 1,2 -> 1,2.
- *
- * @param val le nombre
- * @return le nombre sans 0 final
- */
- private String removeTrailing0(String val) {
- if (val.endsWith(".0")) {
- val = val.substring(0, val.indexOf('.'));
- }
- return val;
- }
-
- /**
- * Retourne une chaîne contenant les résultats du sondage.
- *
- * @return les résultats
- */
- public String getResultsAsString() throws PollenBusinessException {
- StringBuffer res = new StringBuffer("");
- Iterator<ResultDTO> it = results.iterator();
- while (it.hasNext()) {
- ResultDTO result = it.next();
- if (isDateType()) {
- Date date = new Date(Long.parseLong(result.getName()));
- res.append(dateFormat.format(date));
- } else {
- res.append(result.getName());
- }
- res.append("=" + removeTrailing0(result.getValue()));
- if (it.hasNext()) {
- res.append(", ");
- }
- }
- return res.toString();
- }
-
- /**
- * Retourne true si le sondage est anonyme ou si le vote soumis est anonyme.
- * Utilisé lors de la soumission d'un vote.
- *
- * @return true si le vote est anonyme
- */
- public boolean isVoteAnonymous() throws PollenBusinessException {
- return getPoll().isAnonymous() || anonymousVote;
- }
-
- /**
- * Retourne true si le sondage est anonyme ou si le vote courant est
- * anonyme. Utilisé dans la boucle de parcours des votes.
- *
- * @return true si le vote est anonyme
- */
- public boolean isCurrentVoteAnonymous() throws PollenBusinessException {
- return getPoll().isAnonymous() || vote.isAnonymous();
- }
-
- /** Retourne vrai si la checkbox anonymousVote doit être affichée. */
- public boolean isAnonymousVoteDisplayed() throws PollenBusinessException {
- return getPoll().isAnonymousVoteAllowed() && !getPoll().isAnonymous();
- }
-
- /** Retourne l'identifiant du votant du vote courant */
- public String getCurrentVotingId() {
- return vote.getName();
- }
-
- /** Validation du champs de saisie du choix (texte). */
- void onValidateFromTextName(String value) throws ValidationException, PollenBusinessException {
- validateNewChoice(value);
- }
-
- /** Validation du champs de saisie du choix (date). */
- void onValidateFromDateDTF(Date value) throws ValidationException, PollenBusinessException {
- validateNewChoice(String.valueOf(value.getTime()));
- }
-
- /** Validation du champs de saisie du choix (image). */
- void onValidateFromImgFile(UploadedFile value) throws ValidationException, PollenBusinessException {
- validateNewChoice(value.getFileName().replace(' ', '_'));
- }
-
- /** Validation du champs de saisie du choix. */
- private void validateNewChoice(String value) throws ValidationException, PollenBusinessException {
- for (ChoiceDTO choice : getPoll().getChoices()) {
- if (value.equals(choice.getName())) {
- throw new ValidationException(messages.format("choiceExists",
- value));
- }
- }
- }
-
- /** Méthode appelée lors de l'ajout d'un choix. */
- Object onSuccessFromChoiceForm() throws PollenBusinessException {
- String choiceName = null;
- String choiceDesc = null;
- if (isTextType()) {
- if (newChoice.getName() != null) {
- newChoice.setValidate(true);
- newChoice.setPollUId(getPoll().getPollUId());
- getPoll().getChoices().add(newChoice);
- choiceName = newChoice.getName();
- choiceDesc = newChoice.getDescription();
- }
- } else if (isDateType()) {
- if (newDateChoice.getDate() != null) {
- newDateChoice.setValidate(true);
- newDateChoice.setPollUId(getPoll().getPollUId());
- newDateChoice.setName(String.valueOf(newDateChoice.getDate()
- .getTime()));
- getPoll().getChoices().add(newDateChoice);
- Date date = new Date(Long.parseLong(newDateChoice.getName()));
- choiceName = dateFormat.format(date);
- choiceDesc = newDateChoice.getDescription();
- }
- } else if (isImageType()) {
- if (newImageChoice.getImg() != null) {
- newImageChoice.setValidate(true);
- newImageChoice.setPollUId(getPoll().getPollUId());
- newImageChoice.setName(newImageChoice.getImg().getFileName()
- .replace(' ', '_'));
- getPoll().getChoices().add(newImageChoice);
- //File imgFile = getImgContext().getImageDir(); // dir set in getImgContext()
-// File imgFile = getImgContext().getImageDir(); // dir set in getImgContext()
-// ImageUtil.saveImage(newImageChoice, imgFile);
- choiceName = newImageChoice.getName();
- choiceDesc = newImageChoice.getDescription();
- }
- }
-
- servicePoll.updatePoll(getPoll());
- poll = null;
- //poll = servicePoll.findPollByPollId(getPoll().getPollId());
- addFeedEntry(PollAction.ADDCHOICE, choiceName, choiceDesc);
-// newChoice = new ChoiceDTO();
-// newDateChoice = new DateChoiceUIO();
-// newImageChoice = new ImageChoiceUIO();
- return this;
- }
-
-// public boolean isPollNull() {
-// return poll == null;
// }
- public boolean isPollChoiceOrVoteStarted() throws PollenBusinessException {
- return isPollChoiceStarted() || isPollStarted();
- }
-// public boolean isDescNull() {
-// return choiceOfPoll.getDescription() == null
-// || "".equals(choiceOfPoll.getDescription());
-// }
- public boolean isFreePoll() throws PollenBusinessException {
- return getPoll().getPollType() == PollType.FREE;
- }
- public boolean isRestrictedPoll() throws PollenBusinessException {
- return getPoll().getPollType() == PollType.RESTRICTED;
- }
- public boolean isGroupPoll() throws PollenBusinessException {
- return getPoll().getPollType() == PollType.GROUP;
- }
- public boolean isTextType() throws PollenBusinessException {
- return getPoll().getChoiceType() == ChoiceType.TEXT;
- }
- public boolean isDateType() throws PollenBusinessException {
- return getPoll().getChoiceType() == ChoiceType.DATE;
- }
-
- public boolean isImageType() throws PollenBusinessException {
- return getPoll().getChoiceType() == ChoiceType.IMAGE;
- }
-
- public boolean isNormalVoteCounting() throws PollenBusinessException {
- return getPoll().getVoteCounting() == VoteCountingType.NORMAL;
- }
-
- public boolean isPercentageVoteCounting() throws PollenBusinessException {
- return getPoll().getVoteCounting() == VoteCountingType.PERCENTAGE;
- }
-
- public boolean isCondorcetVoteCounting() throws PollenBusinessException {
- return getPoll().getVoteCounting() == VoteCountingType.CONDORCET;
- }
-
- public boolean isNumberVoteCounting() throws PollenBusinessException {
- return getPoll().getVoteCounting() == VoteCountingType.NUMBER;
- }
-
- /** Retourne le message d'aide correspondant au type de sondage. */
- public String getHelpMessage() throws PollenBusinessException {
- switch (getPoll().getVoteCounting()) {
- case NORMAL:
- return messages.get("normalVote-help");
- case PERCENTAGE:
- return messages.get("percentageVote-help");
- case CONDORCET:
- return messages.get("condorcetVote-help");
- case NUMBER:
- return messages.get("numberVote-help");
- default:
- return "";
- }
- }
-
- /**
- * Retourne la date correspondant au choix courant
- *
- * @return date
- */
- public Date getChoiceNameAsDate() {
- return new Date(Long.valueOf(choiceOfPoll.getName()));
- }
-
- /** Dépouillement du sondage. Mise à jour des résultats. */
- private void countPoll() throws PollenBusinessException {
- ResultListDTO resultListDTO = null;
- if (getPoll().getContinuousResults()) {
-
- if (isGroupPoll()) {
- resultListDTO = serviceResults.getGroupResults(getPoll().getPollUId());
- } else {
- resultListDTO = serviceResults.getNormalResults(getPoll().getPollUId());
- }
-
- results = resultListDTO.getResultDTOs();
-
- if (logger.isDebugEnabled()) {
- for (ResultDTO res : results) {
- logger.debug(res.getName() + ": " + res.getValue()
- + ", (voteCounting=" + res.getVoteCounting()
- + ", byGroup=" + res.isByGroup() + ")");
- }
- }
- }
- }
-
-
-
-
-
-
-
-
-
////////////////// NEW IMPLEMENTATION
+ @Inject
+ private Logger log;
+ @Inject
+ private Messages messages;
@Inject
private PollenContext pollen;
@@ -964,12 +939,30 @@
@InjectComponent
private Border border;
+
+ /** TEMP : Affichage des messages pour l'utilisateur */
+ @Component(id = "feedback")
+ private FeedBack feedback;
+ @Parameter(defaultPrefix = BindingConstants.MESSAGE, value = "title")
+ @Property
+ private String title;
+
+ /** Locale courante */
+ @Inject
+ private Locale currentLocale;
+
+ @Inject
+ private ServicePoll servicePoll;
+
+ @Inject
+ private ServiceUser serviceUser;
+
/**
* Sondage pour lequel l'utilisateur vote
*/
@Persist
- private PollDTO poll;
+ private Poll poll;
@Property
private boolean pollNull;
@@ -978,12 +971,13 @@
* Objet de session représentant l'utilisateur identifié.
*/
@SessionState
- private UserDTO user;
+ private UserAccount user;
+
@Property
private boolean userExists;
/** Compte du votant */
- private PollAccountDTO pollAccount;
+ private PollAccount pollAccount;
/** Format des dates */
private DateFormat dateFormat;
@@ -1018,7 +1012,7 @@
poll = null;
getPoll();
- if (getPoll().isClosed()) {
+ if (getPoll().getClosed()) {
feedback.addInfo(messages.get("pollClosed"));
} else if (!isPollStarted()) {
feedback.addInfo(messages.get("pollNotStarted"));
@@ -1029,7 +1023,7 @@
feedback.addInfo(messages.get("pollChoiceRunning"));
}
- countPoll();
+ //countPoll();
} catch (PollenBusinessException eee) {
feedback.addError(messages.get(eee.getMessage()));
pollNull = true;
@@ -1058,16 +1052,16 @@
return dateFormat;
}
- public PollDTO getPoll() throws PollenBusinessException {
+ public Poll getPoll() throws PollenBusinessException {
if (poll == null) {
- poll = servicePoll.getPoll(uri.getPollUId());
+ poll = servicePoll.getPollForVote(uri.getPollUId());
if (poll != null) {
// Initialisations pour les formulaires
// newChoice = new ChoiceDTO();
- newDateChoice = new DateChoiceUIO();
- newImageChoice = new ImageChoiceUIO();
+// newDateChoice = new DateChoiceUIO();
+// newImageChoice = new ImageChoiceUIO();
} else {
throw new PollenBusinessException(
PollenExceptionType.POLL_NOT_EXIST);
@@ -1089,7 +1083,7 @@
}
public boolean isPollRunning() throws PollenBusinessException {
- return isPollStarted() && !isPollFinished() && !getPoll().isClosed();
+ return isPollStarted() && !isPollFinished() && !getPoll().getClosed();
}
/**
@@ -1100,17 +1094,16 @@
*
* @return
*/
- public PollAccountDTO getPollAccount() {
+ public PollAccount getPollAccount() throws PollenBusinessException {
if (pollAccount == null) {
// Identification du votant
if (uri.getAccountUId() != null) {
- pollAccount = servicePollAccount
- .findPollAccountByAccountId(uri.getAccountUId());
+ pollAccount = serviceUser.getPerson(uri.getAccountUId());
// pollAccountId = pollAccount.getId();
}
if (pollAccount == null) {
- pollAccount = serviceVote.getNewPollAccount(user);//new PollAccountDTO();
+ pollAccount = serviceUser.getNewPerson(user);//new PollAccountDTO();
// if (userExists) {
// if (user.getFirstName() != null && user.getLastName() != null) {
// pollAccount.setVotingId(
@@ -1135,7 +1128,7 @@
* @throws PollenBusinessException
*/
public boolean isCreatorUser() throws PollenBusinessException {
- return userExists && user.getId().equals(getPoll().getUserId());
+ return userExists && user.equals(getPoll().getCreator().getUserAccount());
}
/************** PAGER *****************************************************/
@@ -1182,11 +1175,14 @@
}
public String getNoPagerText() throws PollenBusinessException {
- if (getPoll().getNbVotes() == 0) {
- return messages.get("pollen.ui.vote.noVote");
- }
- return messages.format("pollen.ui.vote.noPager",
- getPoll().getNbVotes());
+ // FIXME : manage nbVotes in Poll
+
+// if (getPoll().getNbVotes() == 0) {
+// return messages.get("pollen.ui.vote.noVote");
+// }
+// return messages.format("pollen.ui.vote.noPager",
+// getPoll().getNbVotes());
+ return "";
}
/************** CHOICES ***************************************************/
@@ -1236,7 +1232,7 @@
log.info("Prepare choices for render");
}
choices = new ArrayList<ChoiceField>();
- for (ChoiceDTO curr : getPoll().getChoices()) {
+ for (Choice curr : getPoll().getChoice()) {
ChoiceField field = new ChoiceField(getPoll(), curr);
choices.add(field);
}
@@ -1326,7 +1322,7 @@
// newChoice = ChoiceField.getChoiceText();
// }
// Don't know what validate is
- newChoice.setValidate(true);
+// newChoice.setValidate(true);
}
return newChoice;
}
@@ -1351,7 +1347,7 @@
// }
public boolean isPollChoiceRunning() throws PollenBusinessException {
- return getPoll().isChoiceAddAllowed() && isPollChoiceStarted();
+ return getPoll().getChoiceAddAllowed() && isPollChoiceStarted();
}
/**
@@ -1379,7 +1375,8 @@
void onActionFromDeleteChoice(String choiceId)
throws PollenBusinessException {
if (getCanDeleteChoice()) {
- servicePoll.deleteChoice(getPoll(), choiceId);
+
+// servicePoll.deleteChoice(getPoll(), choiceId);
// Reset choices (ChoiceField list) to retrieve the updated one
// from poll
choices = null;
@@ -1400,18 +1397,18 @@
// No validation done on choice with existing name
// Save name depends on choice type
newChoice.saveName(serviceImage);
- servicePoll.createChoice(getPoll(), newChoice);
+ //getPoll().addChoice(newChoice.getChoice());
}
}
/************** VOTES *****************************************************/
- private List<VoteDTO> votes;
+ private List<Vote> votes;
@Property
private int voteIndex;
- private VoteDTO currentVote;
+ private Vote currentVote;
/**
* Retrieve votes of the current poll from business module.
@@ -1421,45 +1418,45 @@
* @return the list of votes to display
* @throws PollenBusinessException
*/
- public List<VoteDTO> getVotes() throws PollenBusinessException {
+ public List<Vote> getVotes() throws PollenBusinessException {
if (votes == null) {
- votes = serviceVote.getVotesByPoll(getPoll(),
- pager.getStartIndex(), pager.getEndIndex());
+// votes = servicePoll.getVotes(getPoll(),
+// pager.getStartIndex(), pager.getEndIndex());
}
return votes;
}
- public VoteDTO getCurrentVote() {
+ public Vote getCurrentVote() {
if (currentVote == null) {
- currentVote = serviceVote.getNewVote(getPollAccount());
+// currentVote = serviceVote.getNewVote(getPollAccount());
}
return currentVote;
}
- /**
- * Retourne vrai si le champs pollAccount doit apparaître.
- *
- * FD-20100322 ::
- * Strange behavior ? why testing pollType (restricted or group) to
- * display accountField ?!? Even it's anonymous, the field appears for
- * restricted poll ?!?
- *
- * @return
- * @throws PollenBusinessException
- * @deprecated strange method
- */
- @Deprecated
- public boolean isAccountFieldDisplayed() throws PollenBusinessException {
- return !getPoll().isAnonymous() || isRestrictedPoll() || isGroupPoll();
- }
+// /**
+// * Retourne vrai si le champs pollAccount doit apparaître.
+// *
+// * FD-20100322 ::
+// * Strange behavior ? why testing pollType (restricted or group) to
+// * display accountField ?!? Even it's anonymous, the field appears for
+// * restricted poll ?!?
+// *
+// * @return
+// * @throws PollenBusinessException
+// * @deprecated strange method
+// */
+// @Deprecated
+// public boolean isAccountFieldDisplayed() throws PollenBusinessException {
+// return !getPoll().getAnonymous() || isRestrictedPoll() || isGroupPoll();
+// }
public void setChoiceValue(Integer value) {
- getCurrentVote().setChoiceValue(choice.getId(), value);
+// getCurrentVote().setChoiceValue(choice.getId(), value);
}
- public Integer getChoiceValue() {
- return getCurrentVote().getChoiceValue(choice.getId());
- }
+// public Integer getChoiceValue() {
+// return getCurrentVote().getChoiceValue(choice.getId());
+// }
public boolean getCanVote() throws PollenBusinessException {
return isPollRunning();
@@ -1467,17 +1464,17 @@
public boolean canEditVote() throws PollenBusinessException {
// If the current account exist from uri and equals to the current vote
- String newAccountId = getPollAccount().getId();
- if (newAccountId != null &&
- newAccountId.equals(vote.getPollAccountId())) {
- return true;
- // If the connected user is an admin
- } else if (userExists && user.isAdministrator()) {
- return true;
- // If the connected user is the poll creator
- } else if (isCreatorUser()) {
- return true;
- }
+// String newAccountId = getPollAccount().getId();
+// if (newAccountId != null &&
+// newAccountId.equals(vote.getPollAccountId())) {
+// return true;
+// // If the connected user is an admin
+// } else if (userExists && user.isAdministrator()) {
+// return true;
+// // If the connected user is the poll creator
+// } else if (isCreatorUser()) {
+// return true;
+// }
return false;
}
@@ -1493,20 +1490,20 @@
@InjectComponent
private Zone commentZone;
- private List<CommentDTO> comments;
+ private List<Comment> comments;
/** Commentaire courant pour l'affichage des commentaires */
@SuppressWarnings("unused")
@Property
@Persist
- private CommentDTO comment;
+ private Comment comment;
/** Nouveau commentaire posté */
- private CommentDTO newComment;
+ private Comment newComment;
- public List<CommentDTO> getComments() throws PollenBusinessException {
+ public List<Comment> getComments() throws PollenBusinessException {
if (comments == null) {
- comments = servicePoll.getComments(poll);
+ comments = servicePoll.getComments(poll, -1, -1);
}
return comments;
}
@@ -1516,9 +1513,9 @@
*
* @return the current newComment.
*/
- public CommentDTO getNewComment() {
+ public Comment getNewComment() {
if (newComment == null) {
- newComment = new CommentDTO();
+ newComment = new CommentImpl();
}
return newComment;
}
@@ -1531,7 +1528,7 @@
* @throws PollenBusinessException
*/
Object onActionFromDeleteComment(String commentId) throws PollenBusinessException {
- servicePoll.deleteComment(getPoll(), commentId);
+// servicePoll.deleteComment(getPoll(), commentId);
return commentZone.getBody();
}
@@ -1547,11 +1544,11 @@
log.debug("newComment author : " + getNewComment().getAuthor());
log.debug("newComment text : " + getNewComment().getText());
}
- getNewComment().setPostDate(new Date());
- servicePoll.createComment(getPoll(), getNewComment());
- addFeedEntry(PollAction.ADDCOMMENT,
- getNewComment().getAuthor(),
- getNewComment().getText());
+// getNewComment().setPostDate(new Date());
+// servicePoll.createComment(getPoll(), getNewComment());
+// addFeedEntry(PollAction.ADDCOMMENT,
+// getNewComment().getAuthor(),
+// getNewComment().getText());
return commentZone.getBody();
}
}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/Account.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/Account.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/Account.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -29,10 +29,9 @@
import org.apache.tapestry5.corelib.components.Zone;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.services.ServiceAuth;
-import org.chorem.pollen.business.services.ServiceUser;
-import org.chorem.pollen.business.utils.MD5;
+import org.chorem.pollen.MD5;
+import org.chorem.pollen.entity.UserAccount;
+import org.chorem.pollen.service.ServiceUser;
import org.chorem.pollen.ui.data.AddressBarItem;
/**
@@ -50,7 +49,7 @@
*/
@SessionState
@Property
- private UserDTO user;
+ private UserAccount user;
@Property
private boolean userExists;
@@ -60,7 +59,7 @@
*/
@Property
@Persist
- private UserDTO newUser;
+ private UserAccount newUser;
/** Ancien mot de passe */
@Persist
@@ -119,8 +118,8 @@
/** Injection des services */
@Inject
private ServiceUser serviceUser;
- @Inject
- private ServiceAuth serviceAuth;
+// @Inject
+// private ServiceAuth serviceAuth;
/**
* Méthode appelée quand l'utilisateur modifie ses données
@@ -129,40 +128,40 @@
*/
Object onSuccessFromMyAccountForm() {
modify = true;
+//
+// // L'utilisateur a renseigné le mauvais mot de passe
+// if (!serviceAuth.isLoginRight(newUser.getLogin(), MD5.encode(password))) {
+// myAccountForm.recordError(passwordField, messages
+// .get("badPassword"));
+// }
+//
+// // L'utilisateur ne s'est pas trompé en répétant son mot de passe
+// if (newPassword1 != null && !newPassword1.equals("")) {
+// if (!newPassword1.equals(newPassword2)) {
+// myAccountForm.recordError(newPasswordField, messages
+// .get("passwords-dont-match"));
+// }
+// }
+//
+// // L'email existe déjà
+// if (!oldEmail.equals(newUser.getEmail())) {
+// if (serviceUser.isUserEmailExisting(newUser.getEmail())) {
+// myAccountForm.recordError(emailField, messages
+// .get("emailAlreadyExists"));
+// }
+// }
+//
+// // Modification de l'utilisateur
+// if (!myAccountForm.getHasErrors()) {
+// if (serviceUser.updateUser(newUser)) {
+// if (newPassword1 != null && !newPassword1.equals("")) {
+// serviceUser.updatePasswordUser(newUser, MD5
+// .encode(newPassword1));
+// }
+// modify = false;
+// }
+// }
- // L'utilisateur a renseigné le mauvais mot de passe
- if (!serviceAuth.isLoginRight(newUser.getLogin(), MD5.encode(password))) {
- myAccountForm.recordError(passwordField, messages
- .get("badPassword"));
- }
-
- // L'utilisateur ne s'est pas trompé en répétant son mot de passe
- if (newPassword1 != null && !newPassword1.equals("")) {
- if (!newPassword1.equals(newPassword2)) {
- myAccountForm.recordError(newPasswordField, messages
- .get("passwords-dont-match"));
- }
- }
-
- // L'email existe déjà
- if (!oldEmail.equals(newUser.getEmail())) {
- if (serviceUser.isUserEmailExisting(newUser.getEmail())) {
- myAccountForm.recordError(emailField, messages
- .get("emailAlreadyExists"));
- }
- }
-
- // Modification de l'utilisateur
- if (!myAccountForm.getHasErrors()) {
- if (serviceUser.updateUser(newUser)) {
- if (newPassword1 != null && !newPassword1.equals("")) {
- serviceUser.updatePasswordUser(newUser, MD5
- .encode(newPassword1));
- }
- modify = false;
- }
- }
-
return myAccountZone.getBody();
}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/Register.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/Register.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/Register.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -30,13 +30,12 @@
import org.apache.tapestry5.corelib.components.TextField;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
-import org.chorem.pollen.business.PollenContext;
-import org.chorem.pollen.business.PollenProperty;
-import org.chorem.pollen.business.business.PreventRuleManager;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.services.ServiceAuth;
-import org.chorem.pollen.business.services.ServiceUser;
-import org.chorem.pollen.business.utils.MD5;
+import org.chorem.pollen.MD5;
+import org.chorem.pollen.PollenContext;
+import org.chorem.pollen.PollenProperty;
+import org.chorem.pollen.entity.UserAccount;
+import org.chorem.pollen.mail.PreventRuleManager;
+import org.chorem.pollen.service.ServiceUser;
import org.chorem.pollen.ui.data.AddressBarItem;
/**
@@ -60,7 +59,7 @@
*/
@SuppressWarnings("unused")
@SessionState
- private UserDTO user;
+ private UserAccount user;
@SuppressWarnings("unused")
@Property
private boolean userExists;
@@ -69,7 +68,7 @@
* Utilisateur créé via le formulaire
*/
@Property
- private UserDTO newUser = new UserDTO();
+ private UserAccount newUser;
@Component
private Form registerForm;
@@ -108,8 +107,8 @@
/** Injection des services */
@Inject
private ServiceUser serviceUser;
- @Inject
- private ServiceAuth serviceAuth;
+// @Inject
+// private ServiceAuth serviceAuth;
/**
* Méthode appelée quand l'utilisateur s'enregistre
@@ -126,27 +125,27 @@
}
// Le login existe déjà
- if (serviceUser.isUserLoginExisting(newUser.getLogin())) {
- registerForm.recordError(loginField, messages
- .get("loginAlreadyExists"));
- }
+// if (serviceUser.isUserLoginExisting(newUser.getLogin())) {
+// registerForm.recordError(loginField, messages
+// .get("loginAlreadyExists"));
+// }
+//
+// // L'email existe déjà
+// if (serviceUser.isUserEmailExisting(newUser.getEmail())) {
+// registerForm.recordError(emailField, messages
+// .get("emailAlreadyExists"));
+// }
+//
+// // Création de l'utilisateur, envoi d'un email de notification et connexion
+// if (!registerForm.getHasErrors()) {
+// if (serviceUser.createUser(newUser, MD5.encode(password1)) != null) {
+// sendMailNotification();
+// user = serviceAuth.getUser(newUser.getLogin(), MD5
+// .encode(password1));
+// return "Index";
+// }
+// }
- // L'email existe déjà
- if (serviceUser.isUserEmailExisting(newUser.getEmail())) {
- registerForm.recordError(emailField, messages
- .get("emailAlreadyExists"));
- }
-
- // Création de l'utilisateur, envoi d'un email de notification et connexion
- if (!registerForm.getHasErrors()) {
- if (serviceUser.createUser(newUser, MD5.encode(password1)) != null) {
- sendMailNotification();
- user = serviceAuth.getUser(newUser.getLogin(), MD5
- .encode(password1));
- return "Index";
- }
- }
-
return this;
}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserLists.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserLists.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserLists.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -16,7 +16,6 @@
package org.chorem.pollen.ui.pages.user;
-import java.util.Iterator;
import java.util.List;
import org.apache.commons.fileupload.FileUploadException;
@@ -37,11 +36,8 @@
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.BeanModelSource;
import org.apache.tapestry5.upload.services.UploadedFile;
-import org.chorem.pollen.business.dto.PersonListDTO;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.services.ServiceList;
-import org.chorem.pollen.business.services.ServicePollAccount;
+import org.chorem.pollen.entity.PollAccount;
+import org.chorem.pollen.entity.UserAccount;
import org.chorem.pollen.ui.components.FeedBack;
import org.chorem.pollen.ui.data.EvenOdd;
import org.chorem.pollen.ui.data.AddressBarItem;
@@ -63,7 +59,7 @@
* Objet de session représentant l'utilisateur identifié.
*/
@SessionState
- private UserDTO user;
+ private UserAccount user;
@Property
private boolean userExists;
@@ -74,34 +70,34 @@
/**
* Listes de favoris de l'utilisateur.
*/
- @Property
- private List<PersonListDTO> lists;
+// @Property
+// private List<PersonListDTO> lists;
- /**
- * Liste de favoris sélectionnée.
- */
- @Persist
- @Property
- private PersonListDTO selectedList;
+// /**
+// * Liste de favoris sélectionnée.
+// */
+// @Persist
+// @Property
+// private PersonListDTO selectedList;
+//
+// /**
+// * Nouvelle liste de favoris.
+// */
+// @Property
+// private PersonListDTO newList;
/**
- * Nouvelle liste de favoris.
- */
- @Property
- private PersonListDTO newList;
-
- /**
* Compte courant (pour l'itération des votants de la liste).
*/
@SuppressWarnings("unused")
@Property
- private PollAccountDTO account;
+ private PollAccount account;
/**
* Nouveau compte.
*/
@Property
- private PollAccountDTO newAccount;
+ private PollAccount newAccount;
/**
* Fichier CSV contenant une liste de votants.
@@ -175,66 +171,66 @@
private BeanModel listModel;
/** Injection des services */
- @Inject
- private ServiceList serviceList;
- @Inject
- private ServicePollAccount servicePollAccount;
+// @Inject
+// private ServiceList serviceList;
+// @Inject
+// private ServicePollAccount servicePollAccount;
/**
* Méthode appelée à la création d'une liste.
*/
Object onSuccessFromCreateListForm() {
+//
+// // Contrôle du nom de la liste
+// for (PersonListDTO list : lists) {
+// if (list.getName().equals(newList.getName())) {
+// createListForm.recordError(messages.format("listExists",
+// newList.getName()));
+// return this;
+// }
+// }
+//
+// // Import CVS des comptes
+// if (accountsFile != null) {
+// if (!accountsFile.getContentType().equals("text/csv")) {
+// createListForm.recordError(messages.format("invalidCsv",
+// accountsFile.getFileName()));
+// return this;
+// }
+// List<PollAccountDTO> accounts = CSVAccountUtil
+// .importList(accountsFile);
+// if (accounts.size() == 0) {
+// createListForm.recordError(messages.format("noAccountCsv",
+// accountsFile.getFileName()));
+// return this;
+// }
+// newList.getPollAccounts().addAll(accounts);
+// }
+//
+// // Import LDAP des comptes
+// if (accountsUrl != null) {
+// List<PollAccountDTO> accounts = LDAPAccountUtil
+// .importList(accountsUrl);
+// if (accounts.size() == 0) {
+// createListForm.recordError(messages.format("noAccountLdap",
+// accountsUrl));
+// return this;
+// }
+// newList.getPollAccounts().addAll(accounts);
+// }
+//
+// // Création de la nouvelle liste
+// newList.setUserId(user.getId());
+// newList.setId(serviceList.createPersonList(newList));
+//
+// // Sélection de la liste courante
+// lists = serviceList.findPersonListByUser(user.getId());
+// for (PersonListDTO list : lists) {
+// if (list.getId().equals(newList.getId())) {
+// selectedList = list;
+// }
+// }
- // Contrôle du nom de la liste
- for (PersonListDTO list : lists) {
- if (list.getName().equals(newList.getName())) {
- createListForm.recordError(messages.format("listExists",
- newList.getName()));
- return this;
- }
- }
-
- // Import CVS des comptes
- if (accountsFile != null) {
- if (!accountsFile.getContentType().equals("text/csv")) {
- createListForm.recordError(messages.format("invalidCsv",
- accountsFile.getFileName()));
- return this;
- }
- List<PollAccountDTO> accounts = CSVAccountUtil
- .importList(accountsFile);
- if (accounts.size() == 0) {
- createListForm.recordError(messages.format("noAccountCsv",
- accountsFile.getFileName()));
- return this;
- }
- newList.getPollAccounts().addAll(accounts);
- }
-
- // Import LDAP des comptes
- if (accountsUrl != null) {
- List<PollAccountDTO> accounts = LDAPAccountUtil
- .importList(accountsUrl);
- if (accounts.size() == 0) {
- createListForm.recordError(messages.format("noAccountLdap",
- accountsUrl));
- return this;
- }
- newList.getPollAccounts().addAll(accounts);
- }
-
- // Création de la nouvelle liste
- newList.setUserId(user.getId());
- newList.setId(serviceList.createPersonList(newList));
-
- // Sélection de la liste courante
- lists = serviceList.findPersonListByUser(user.getId());
- for (PersonListDTO list : lists) {
- if (list.getId().equals(newList.getId())) {
- selectedList = list;
- }
- }
-
return this;
}
@@ -242,20 +238,20 @@
* Méthode appelée à la suppression d'une liste.
*/
Object onActionFromDeleteList() {
- if (selectedList != null) {
- for (PersonListDTO dto : lists) {
- if (dto.getId().equals(selectedList.getId())) {
- if (serviceList.deletePersonList(selectedList.getId())) {
- feedback.addInfo(messages.format("listDeleted",
- selectedList.getName()));
- } else {
- feedback.addError(messages.format("listNotDeleted",
- selectedList.getName()));
- }
- }
- }
- }
- selectedList = null;
+// if (selectedList != null) {
+// for (PersonListDTO dto : lists) {
+// if (dto.getId().equals(selectedList.getId())) {
+// if (serviceList.deletePersonList(selectedList.getId())) {
+// feedback.addInfo(messages.format("listDeleted",
+// selectedList.getName()));
+// } else {
+// feedback.addError(messages.format("listNotDeleted",
+// selectedList.getName()));
+// }
+// }
+// }
+// }
+// selectedList = null;
return this;
}
@@ -265,19 +261,19 @@
Object onSuccessFromCreateAccountForm() {
// TODO : use onValidateForm method : test return block, may be
// a problem between failure and success
- for (PollAccountDTO dto : selectedList.getPollAccounts()) {
- if (dto.getVotingId().equals(newAccount.getVotingId())) {
- createAccountForm.recordError(messages.format("accountExists",
- newAccount.getVotingId()));
- }
- }
- if (!createAccountForm.getHasErrors()) {
-// newAccount.setPersonListId(selectedList.getId());
-// selectedList.getPollAccounts().add(newAccount);
-// serviceList.updatePersonList(selectedList);
-// selectedList = serviceList.findPersonListById(selectedList.getId());
- serviceList.createAccountInPersonList(selectedList, account);
- }
+// for (PollAccountDTO dto : selectedList.getPollAccounts()) {
+// if (dto.getVotingId().equals(newAccount.getVotingId())) {
+// createAccountForm.recordError(messages.format("accountExists",
+// newAccount.getVotingId()));
+// }
+// }
+// if (!createAccountForm.getHasErrors()) {
+//// newAccount.setPersonListId(selectedList.getId());
+//// selectedList.getPollAccounts().add(newAccount);
+//// serviceList.updatePersonList(selectedList);
+//// selectedList = serviceList.findPersonListById(selectedList.getId());
+// serviceList.createAccountInPersonList(selectedList, account);
+// }
return listsZone.getBody();
}
@@ -295,7 +291,7 @@
// serviceList.updatePersonList(selectedList);
// servicePollAccount.deletePollAccount(accountId);
// selectedList = serviceList.findPersonListById(selectedList.getId());
- serviceList.deleteAccountFromPersonList(selectedList, accountId);
+// serviceList.deleteAccountFromPersonList(selectedList, accountId);
return listsZone.getBody();
}
@@ -307,26 +303,26 @@
return this;
}
- /** Retourne vrai s'il n'existe aucune liste */
- public boolean isListsNull() {
- return lists == null || lists.size() == 0;
- }
+// /** Retourne vrai s'il n'existe aucune liste */
+// public boolean isListsNull() {
+// return lists == null || lists.size() == 0;
+// }
+//
+// /** Retourne vrai si la liste sélectionnée est vide */
+// public boolean isSelectedListNull() {
+// return selectedList == null;
+// }
- /** Retourne vrai si la liste sélectionnée est vide */
- public boolean isSelectedListNull() {
- return selectedList == null;
- }
-
/**
* Méthode d'initialisation des listes de favoris.
*/
void onActivate() {
evenOdd = new EvenOdd();
- if (userExists) {
- lists = serviceList.findPersonListByUser(user.getId());
- }
- newList = new PersonListDTO();
- newAccount = new PollAccountDTO();
+// if (userExists) {
+// lists = serviceList.findPersonListByUser(user.getId());
+// }
+// newList = new PersonListDTO();
+// newAccount = new PollAccountDTO();
}
/**
@@ -336,7 +332,7 @@
address = new AddressBarItem[] { new AddressBarItem("Pollen", "Index"),
new AddressBarItem(title, null) };
- listModel = beanModelSource.createDisplayModel(PollAccountDTO.class,
+ listModel = beanModelSource.createDisplayModel(PollAccount.class,
componentResources.getMessages());
listModel.add("functions", null);
listModel.include("votingId", "email", "functions");
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsCreated.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsCreated.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsCreated.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -25,10 +25,9 @@
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.upload.services.UploadedFile;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.services.ServicePoll;
-import org.chorem.pollen.business.services.ServiceResults;
+import org.chorem.pollen.entity.Poll;
+import org.chorem.pollen.entity.UserAccount;
+import org.chorem.pollen.service.ServicePoll;
import org.chorem.pollen.ui.base.Polls;
/**
@@ -46,7 +45,7 @@
* Objet de session représentant l'utilisateur identifié.
*/
@SessionState
- private UserDTO user;
+ private UserAccount user;
private boolean userExists;
/**
@@ -54,7 +53,7 @@
*/
@SuppressWarnings("unused")
@Property
- private List<PollDTO> polls;
+ private List<Poll> polls;
/**
* Fichier XML d'un sondage exporté.
@@ -77,8 +76,8 @@
/** Injection des services */
@Inject
private ServicePoll servicePoll;
- @Inject
- private ServiceResults serviceResults;
+// @Inject
+// private ServiceResults serviceResults;
/**
* Méthode appelée à l'importation d'un sondage.
@@ -92,7 +91,7 @@
pollFile.getFileName()));
return this;
}
- serviceResults.importPoll(pollFile.getFilePath(), user);
+// serviceResults.importPoll(pollFile.getFilePath(), user);
}
return this;
@@ -105,7 +104,7 @@
public void onActivate() {
super.onActivate();
if (userExists) {
- polls = servicePoll.findPollsByUser(user.getId());
+ polls = servicePoll.getPollsByUser(user);
}
}
}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsParticipated.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsParticipated.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsParticipated.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -22,12 +22,11 @@
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.ioc.annotations.Inject;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.dto.VotingListDTO;
-import org.chorem.pollen.business.services.ServicePoll;
+import org.chorem.pollen.entity.Poll;
+import org.chorem.pollen.entity.UserAccount;
+import org.chorem.pollen.service.ServicePoll;
import org.chorem.pollen.ui.base.Polls;
+import org.chorem.pollen.votecounting.dto.PollDTO;
/**
* Classe de la page d'affichage des sondages auxquels l'utilisateur a
@@ -44,7 +43,7 @@
* Objet de session représentant l'utilisateur identifié.
*/
@SessionState
- private UserDTO user;
+ private UserAccount user;
private boolean userExists;
/**
@@ -52,14 +51,14 @@
*/
@SuppressWarnings("unused")
@Property
- private List<PollDTO> participatedPolls;
+ private List<Poll> participatedPolls;
/**
* Liste des sondages auxquels l'utilisateur est invité
*/
@SuppressWarnings("unused")
@Property
- private List<PollDTO> invitedPolls;
+ private List<Poll> invitedPolls;
/** Injection des services */
@Inject
@@ -70,15 +69,15 @@
*
* @return l'identifiant.
*/
- public String getVoteId(PollDTO poll) {
- for (VotingListDTO list : poll.getVotingListDTOs()) {
- for (PollAccountDTO account : list.getPollAccountDTOs()) {
- if (account.getEmail().equals(user.getEmail())) {
- return poll.getPollUId() + ":" + account.getAccountUId();
- }
- }
- }
- return poll.getPollUId();
+ public String getVoteId(Poll poll) {
+// for (VotingListDTO list : poll.getVotingListDTOs()) {
+// for (PollAccountDTO account : list.getPollAccountDTOs()) {
+// if (account.getEmail().equals(user.getEmail())) {
+// return poll.getPollUId() + ":" + account.getAccountUId();
+// }
+// }
+// }
+ return poll.getUId();
}
/**
@@ -88,8 +87,8 @@
public void onActivate() {
super.onActivate();
if (userExists) {
- participatedPolls = servicePoll.findParticipatedPolls(user.getId());
- invitedPolls = servicePoll.findInvitedPolls(user.getId());
+ invitedPolls = participatedPolls = servicePoll.getPollsByUser(user);
+// invitedPolls = servicePoll.findInvitedPolls(user.getId());
}
}
}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -19,33 +19,20 @@
import org.apache.tapestry5.SymbolConstants;
import org.apache.tapestry5.ioc.Configuration;
import org.apache.tapestry5.ioc.MappedConfiguration;
-import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.OrderedConfiguration;
import org.apache.tapestry5.ioc.ServiceBinder;
-import org.apache.tapestry5.ioc.annotations.EagerLoad;
import org.apache.tapestry5.ioc.annotations.InjectService;
import org.apache.tapestry5.ioc.services.Coercion;
import org.apache.tapestry5.ioc.services.CoercionTuple;
import org.apache.tapestry5.ioc.services.SymbolProvider;
-import org.apache.tapestry5.services.ComponentSource;
import org.apache.tapestry5.upload.services.UploadSymbols;
-import org.chorem.pollen.business.PollenContext;
-import org.chorem.pollen.business.PollenContextImpl;
-import org.chorem.pollen.business.PollenContextImplementor;
-import org.chorem.pollen.business.services.ServiceAuth;
-import org.chorem.pollen.business.services.ServiceAuthImpl;
-import org.chorem.pollen.business.services.ServiceList;
-import org.chorem.pollen.business.services.ServiceListImpl;
-import org.chorem.pollen.business.services.ServicePoll;
-import org.chorem.pollen.business.services.ServicePollAccount;
-import org.chorem.pollen.business.services.ServicePollAccountImpl;
-import org.chorem.pollen.business.services.ServicePollImpl;
-import org.chorem.pollen.business.services.ServiceResults;
-import org.chorem.pollen.business.services.ServiceResultsImpl;
-import org.chorem.pollen.business.services.ServiceUser;
-import org.chorem.pollen.business.services.ServiceUserImpl;
-import org.chorem.pollen.business.services.ServiceVote;
-import org.chorem.pollen.business.services.ServiceVoteImpl;
+import org.chorem.pollen.PollenContext;
+import org.chorem.pollen.PollenContextImpl;
+import org.chorem.pollen.PollenContextImplementor;
+import org.chorem.pollen.service.ServicePoll;
+import org.chorem.pollen.service.ServicePollImpl;
+import org.chorem.pollen.service.ServiceUser;
+import org.chorem.pollen.service.ServiceUserImpl;
import org.chorem.pollen.ui.data.PollUri;
/**
@@ -58,17 +45,6 @@
public class AppModule {
public static void bind(ServiceBinder binder) {
- // Pollen-Business services
-// binder.bind(ServiceAuth.class);
-// binder.bind(ServiceList.class);
-// binder.bind(ServiceUser.class);
-// binder.bind(ServicePoll.class);
-// binder.bind(ServicePollAccount.class);
-// binder.bind(ServiceResults.class);
-// binder.bind(ServiceVote.class);
-// binder.bind(ServiceChoice.class);
-// binder.bind(ServiceImage.class);
-// binder.bind(PollenContext.class, PollenContextImpl.class);
}
/**
@@ -82,45 +58,20 @@
return context;
}
- /** Will be merged with serviceUser **/
- public static ServiceAuth buildServiceAuth(
- @InjectService("PollenContext") PollenContextImplementor context) {
- return new ServiceAuthImpl(context);
- }
- /** Will be divided between servicePoll and serviceUser, maybe other
- * services for LDAP or CSV
- **/
- public static ServiceList buildServiceList(
- @InjectService("PollenContext") PollenContextImplementor context) {
- return new ServiceListImpl(context);
- }
-
public static ServiceUser buildServiceUser(
@InjectService("PollenContext") PollenContextImplementor context) {
- return new ServiceUserImpl(context);
+ ServiceUserImpl service = new ServiceUserImpl();
+ service.setContext(context);
+ return service;
}
public static ServicePoll buildServicePoll(
@InjectService("PollenContext") PollenContextImplementor context) {
- return new ServicePollImpl(context);
+ ServicePollImpl service = new ServicePollImpl();
+ service.setContext(context);
+ return service;
}
- /** Will be divided between serviceVote, serviceUser and servicePoll **/
- public static ServicePollAccount buildServicePollAccount(
- @InjectService("PollenContext") PollenContextImplementor context) {
- return new ServicePollAccountImpl(context);
- }
-
- public static ServiceResults buildServiceResults(
- @InjectService("PollenContext") PollenContextImplementor context) {
- return new ServiceResultsImpl(context);
- }
-
- public static ServiceVote buildServiceVote(
- @InjectService("PollenContext") PollenContextImplementor context) {
- return new ServiceVoteImpl(context);
- }
-
public static ServiceImage buildServiceImage(
@InjectService("PollenContext") PollenContextImplementor context) {
return new ServiceImageImpl(context);
@@ -184,14 +135,14 @@
* This is the BackgroundWorker service definition. It build the service
* giving a Messages object for localization in the service.
*/
- @EagerLoad
- public static BackgroundWorker buildBackgroundWorker(
- ComponentSource componentSource,
- ServicePoll servicePoll, PollenContext context) {
- Messages messages = componentSource.getPage("LocalMessages")
- .getComponentResources().getMessages();
- return new BackgroundWorkerImpl(messages, servicePoll, context);
- }
+// @EagerLoad
+// public static BackgroundWorker buildBackgroundWorker(
+// ComponentSource componentSource,
+// ServicePoll servicePoll, PollenContext context) {
+// Messages messages = componentSource.getPage("LocalMessages")
+// .getComponentResources().getMessages();
+// return new BackgroundWorkerImpl(messages, servicePoll, context);
+// }
/**
* Make configuration from a Properties file available as symbols.
Deleted: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/BackgroundWorker.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/BackgroundWorker.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/BackgroundWorker.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -1,28 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.ui.services;
-
-/**
- * Service lancé en parallèle de l'application. Ce service permet d'effectuer
- * des actions en arrière-plan.
- *
- * @author rannou
- * @version $Id$
- */
-public interface BackgroundWorker {
-
-}
Deleted: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/BackgroundWorkerImpl.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/BackgroundWorkerImpl.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/BackgroundWorkerImpl.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -1,175 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.ui.services;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.tapestry5.ioc.Messages;
-import org.chorem.pollen.business.PollenContext;
-import org.chorem.pollen.business.PollenContextImplementor;
-import org.chorem.pollen.business.PollenProperty;
-import org.chorem.pollen.business.business.PreventRuleManager;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.dto.PreventRuleDTO;
-import org.chorem.pollen.business.dto.VotingListDTO;
-import org.chorem.pollen.business.services.ServicePoll;
-import org.chorem.pollen.business.services.ServicePreventRule;
-import org.chorem.pollen.business.services.ServicePreventRuleImpl;
-
-/**
- * Implémentation du service BackgroundWorker.
- *
- * @author rannou
- * @version $Id$
- */
-public class BackgroundWorkerImpl implements BackgroundWorker {
-
- /** Timer gérant les threads. */
- private Timer timer;
-
- /** log. */
- private static final Log log = LogFactory
- .getLog(BackgroundWorkerImpl.class);
-
- /** Messages internationalisés **/
- private final Messages messages;
-
- /** Injection du service de gestion de sondages. */
- private ServicePoll servicePoll;
-
- private PollenContext context;
-
- /**
- * Constructeur exécuté au lancement de l'application.
- */
- public BackgroundWorkerImpl(Messages messages,
- ServicePoll servicePoll, PollenContext context) {
- this.context = context;
- this.messages = messages;
- this.servicePoll = servicePoll;
-
- timer = new Timer();
- executeTasks();
- }
-
- /**
- * Lancement des tâches en arrière-plan.
- */
- public void executeTasks() {
- if (!context.hasProperty(PollenProperty.SERVER_URL)) {
- log.warn("No property siteUrl. Reminder emails would not contain it");
- }
-
- // Exécution de la tâche toutes les 10 min
- timer.schedule(new MailingTask(), 600000, 600000);
- }
-
- /**
- * Tâche gérant l'envoi de mails de rappels.
- */
- private class MailingTask extends TimerTask {
-
- @Override
- public void run() {
- if (log.isDebugEnabled()) {
- log.debug("MailingTask running...");
- }
-
- // Récupération des sondages en cours
- List<PollDTO> polls = servicePoll.findRunningPolls(true);
-
- for (PollDTO poll : polls) {
- Date now = new Date();
-
- // Parcours des preventRules de chaque sondage
- // envoi d'un email si endDate-nowDate <= preventRuleSensibility
- if (poll.getEndDate() != null) {
-
- // timeValue = endDate-nowDate
- Long timeValue = poll.getEndDate().getTime()
- - now.getTime();
-
- if (log.isDebugEnabled()) {
- log.debug("Now: " + now.getTime() + " End: "
- + poll.getEndDate().getTime() + " timeValue: "
- + timeValue + "(" + timeValue / 3600000 + "h)");
- }
-
- // envoi des mails avec une sensibilité de l'ordre de l'heure
- sendMailNotification(poll, timeValue / 3600000);
- }
- }
- }
- }
-
- /**
- * Envoi du mail de notification.
- *
- * @param poll sondage concerné
- */
- private void sendMailNotification(PollDTO poll, Long timeValue) {
- String voteURL = context.getProperty(PollenProperty.SERVER_URL) +
- "/poll/VoteFor/" + poll.getPollUId();
- Map<String, String> data = new HashMap<String, String>();
- data.put("host", context.getProperty(PollenProperty.EMAIL_HOST));
- data.put("port", context.getProperty(PollenProperty.EMAIL_PORT));
- data.put("from", context.getProperty(PollenProperty.EMAIL_FROM));
-
- // Mails aux votants
- for (PreventRuleDTO rule : poll.getPreventRuleDTOs()) {
- if (rule.isActive()) {
- Boolean hasRun = false;
- PreventRuleManager manager = new PreventRuleManager(rule);
- for (VotingListDTO list : poll.getVotingListDTOs()) {
- for (PollAccountDTO account : list.getPollAccountDTOs()) {
- if (account.getEmail() != null) {
- String accountVoteURL = voteURL + ":"
- + account.getAccountUId();
-
- data.put("to", account.getEmail());
- data.put("title", messages.format(
- "reminderEmail_subject", poll.getTitle()));
- data.put("msg", messages.format(
- "reminderEmail_msg", poll.getTitle(),
- account.getVotingId(), accountVoteURL));
-
- // Exécution de la règle avec une valeur +1
- // Sensibilité de 2h : 2h05 KO, 1h55 OK
- hasRun = manager.execute("rappel", timeValue
- .intValue() + 1, data);
- }
- }
- }
-
- // désactivation de la règle de rappel pour éviter qu'elle soit réexécutée
- if (hasRun) {
- rule.setActive(false);
- ServicePreventRule spr = new ServicePreventRuleImpl((PollenContextImplementor)context);
- spr.updatePreventRule(rule);
- }
- }
- }
- }
-}
Deleted: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenManager.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenManager.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PollenManager.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -1,58 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.ui.services;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.tapestry5.ioc.services.RegistryShutdownListener;
-import org.chorem.pollen.business.PollenContext;
-import org.chorem.pollen.business.PollenContextImpl;
-
-/**
- * Service de gestion de l'arrêt du serveur. Ce service exécute une action à la
- * fermeture du registre Tapestry.
- *
- * @author rannou
- * @version $Id$
- */
-public class PollenManager implements RegistryShutdownListener /*, Runnable */{
-
- private static final Log log = LogFactory.getLog(PollenManager.class);
-
- private PollenContext context;
-
- public PollenManager(PollenContext context) {
- this.context = context;
- }
-
-// @Override
-// public void run() {
-// if (log.isInfoEnabled()) {
-// log.info("Start Pollen");
-// }
-// context.start();
-// }
-
- @Override
- public void registryDidShutdown() {
- if (log.isInfoEnabled()) {
- log.info("Stop Pollen");
- }
- context.stop();
- }
-
-}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PropertiesFileSymbolProvider.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PropertiesFileSymbolProvider.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/PropertiesFileSymbolProvider.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -10,7 +10,7 @@
import org.apache.tapestry5.ioc.services.SymbolProvider;
import org.apache.tapestry5.ioc.util.CaseInsensitiveMap;
-import org.chorem.pollen.business.PollenContext;
+import org.chorem.pollen.PollenContext;
import org.slf4j.Logger;
public class PropertiesFileSymbolProvider implements SymbolProvider {
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/ServiceImageImpl.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/ServiceImageImpl.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/ServiceImageImpl.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -16,8 +16,8 @@
import org.apache.tapestry5.StreamResponse;
import org.apache.tapestry5.services.Response;
import org.apache.tapestry5.upload.services.UploadedFile;
-import org.chorem.pollen.business.PollenContext;
-import org.chorem.pollen.business.PollenProperty;
+import org.chorem.pollen.PollenProperty;
+import org.chorem.pollen.PollenContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/CSVAccountUtil.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/CSVAccountUtil.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/CSVAccountUtil.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -24,10 +24,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.tapestry5.upload.services.UploadedFile;
-import org.chorem.pollen.business.dto.PollAccountDTO;
import au.com.bytecode.opencsv.bean.ColumnPositionMappingStrategy;
import au.com.bytecode.opencsv.bean.CsvToBean;
+import org.chorem.pollen.entity.PollAccount;
/**
* Classe permettant de gérer l'import de listes de votants au format CSV.
@@ -48,24 +48,24 @@
* @param reader which contains the input stream
* @return the new PollAccountDTO list from results imported
*/
- public static List<PollAccountDTO> importList(Reader reader) {
- List<PollAccountDTO> accounts = null;
+ public static List<PollAccount> importList(Reader reader) {
+ List<PollAccount> accounts = null;
// Définition de la stratégie de mapping
- ColumnPositionMappingStrategy<PollAccountDTO> strat =
- new ColumnPositionMappingStrategy<PollAccountDTO>();
- String[] columns = new String[] { "votingId", "email", "weight" };
- strat.setType(PollAccountDTO.class);
+ ColumnPositionMappingStrategy<PollAccount> strat =
+ new ColumnPositionMappingStrategy<PollAccount>();
+ String[] columns = new String[] { "name", "email", "weight" };
+ strat.setType(PollAccount.class);
strat.setColumnMapping(columns);
// Parsing du fichier CSV
- CsvToBean<PollAccountDTO> csv = new CsvToBean<PollAccountDTO>();
+ CsvToBean<PollAccount> csv = new CsvToBean<PollAccount>();
accounts = csv.parse(strat, reader);
// Suppression des comptes null
- Iterator<PollAccountDTO> it = accounts.iterator();
+ Iterator<PollAccount> it = accounts.iterator();
while (it.hasNext()) {
- if ("".equals(it.next().getVotingId())) {
+ if ("".equals(it.next().getName())) {
it.remove();
}
}
@@ -84,7 +84,7 @@
* @return a PollAccountDTO list
* @see #importList(java.io.Reader)
*/
- public static List<PollAccountDTO> importList(UploadedFile file) {
+ public static List<PollAccount> importList(UploadedFile file) {
if (log.isInfoEnabled()) {
log.info("Import du fichier " + file.getFileName() + " ("
+ file.getContentType() + ")...");
Deleted: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/ImageUtil.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/ImageUtil.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/ImageUtil.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -1,129 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.ui.utils;
-
-import java.awt.Graphics2D;
-import java.awt.Image;
-import java.awt.RenderingHints;
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.imageio.ImageIO;
-import javax.swing.ImageIcon;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.ui.components.ImageContextLink;
-import org.chorem.pollen.ui.data.uio.ImageChoiceUIO;
-
-/**
- * Classe permettant de gérer l'enregistrement d'images et la création de
- * miniatures.
- *
- * @author rannou
- * @version $Id$
- * @deprecated use {@link org.chorem.pollen.ui.services.ServiceImage} instead
- */
-@Deprecated
-public class ImageUtil {
-
- /** log. */
- private static final Log log = LogFactory.getLog(ImageUtil.class);
-
- /**
- * Sauvegarde d'une image et de sa miniature.
- *
- * @param dir Le répertoire de destination.
- * @param imgChoice L'UIO de l'image à enregistrer.
- */
- public static void saveImage(ImageChoiceUIO imgChoice, File dir) {
- List<ImageChoiceUIO> imgChoices = new ArrayList<ImageChoiceUIO>();
- imgChoices.add(imgChoice);
- saveImages(imgChoices, dir);
- }
-
- /**
- * Sauvegarde des images et de leurs miniatures.
- *
- * @param imgChoices Les UIO des images à enregistrer.
- * @param dir Le répertoire de destination.
- */
- public static void saveImages(List<ImageChoiceUIO> imgChoices, File dir) {
- if (imgChoices != null && imgChoices.size() > 0) {
- if (!dir.exists()) {
- dir.mkdirs();
- }
- if (log.isDebugEnabled()) {
- log.debug("Destination folder: " + dir.getAbsolutePath());
- }
- for (ImageChoiceUIO imgChoice : imgChoices) {
- if (imgChoice.getImg() != null
- && (imgChoice.getImg().getContentType().contains(
- "image") || imgChoice.getImg().getContentType()
- .contains("IMAGE"))) {
-
- // Enregistrement de l'image
- File img = new File(dir, imgChoice.getName());
- imgChoice.getImg().write(img);
- if (log.isDebugEnabled()) {
- log.debug("Image saved: "
- + imgChoice.getImg().getFileName() + " (size="
- + imgChoice.getImg().getSize() + ")");
- }
-
- // Création de la miniature
- createThumbnail(dir, img, 100);
- }
- }
- }
- }
-
- /**
- * Création d'une miniature.
- *
- * @param dir Le répertoire de destination.
- * @param img L'image à miniaturiser.
- * @param width La largeur de la miniature.
- */
- public static void createThumbnail(File dir, File img, int width) {
- ImageIcon ii = new ImageIcon(img.getAbsolutePath());
- Image image = ii.getImage();
- double imageRatio = (double) image.getHeight(null)
- / (double) image.getWidth(null);
- int height = (int) (width * imageRatio);
-
- BufferedImage thumbImage = new BufferedImage(width, height,
- BufferedImage.TYPE_INT_RGB);
- Graphics2D graphics2D = thumbImage.createGraphics();
- graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
- RenderingHints.VALUE_INTERPOLATION_BILINEAR);
- graphics2D.drawImage(image, 0, 0, width, height, null);
- File thumbCopied = new File(dir, ImageContextLink.THUMB_PREFIX + img.getName());
- try {
- ImageIO.write(thumbImage, "jpg", thumbCopied);
- } catch (IOException e) {
- log.error("Erreur à l'enregistrement de la miniature", e);
- }
- if (log.isDebugEnabled()) {
- log.debug("Thumbnail created: " + thumbCopied.getName() + " (size="
- + thumbCopied.length() + ")");
- }
- }
-}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/LDAPAccountUtil.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/LDAPAccountUtil.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/LDAPAccountUtil.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -30,7 +30,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.dto.PollAccountDTO;
+import org.chorem.pollen.entity.PollAccount;
+import org.chorem.pollen.entity.PollAccountImpl;
/**
* Classe permettant de gérer l'import de listes de votants à partir d'un
@@ -50,7 +51,7 @@
* @param url l'URL correspondant à la recherche
* @return la liste de votants
*/
- public static List<PollAccountDTO> importList(String url) {
+ public static List<PollAccount> importList(String url) {
return importList(null, url, null);
}
@@ -62,10 +63,10 @@
* @param filter le filtre à apposer pour la recherche
* @return la liste de votants
*/
- public static List<PollAccountDTO> importList(String server,
+ public static List<PollAccount> importList(String server,
String context, String filter) {
long start = System.nanoTime();
- List<PollAccountDTO> accounts = new ArrayList<PollAccountDTO>();
+ List<PollAccount> accounts = new ArrayList<PollAccount>();
try {
@@ -97,8 +98,8 @@
Attribute emailAttr = r.getAttributes().get("mail");
if (nameAttr != null) {
- PollAccountDTO account = new PollAccountDTO();
- account.setVotingId(nameAttr.get().toString());
+ PollAccount account = new PollAccountImpl();
+ account.setName(nameAttr.get().toString());
account.setEmail(emailAttr.get().toString());
accounts.add(account);
Deleted: trunk/pollen-ui/src/test/java/org/chorem/pollen/ui/PropertiesLoaderTest.java
===================================================================
--- trunk/pollen-ui/src/test/java/org/chorem/pollen/ui/PropertiesLoaderTest.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/test/java/org/chorem/pollen/ui/PropertiesLoaderTest.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -1,66 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.ui;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Properties;
-
-import org.chorem.pollen.business.utils.PropertiesLoader;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests du chargement des fichiers de propriétés.
- *
- * @author zhykos
- * @version $Id$
- */
-public class PropertiesLoaderTest {
-
- public PropertiesLoaderTest() {
- }
-
- @BeforeClass
- public static void setUpClass() throws Exception {
- }
-
- @AfterClass
- public static void tearDownClass() throws Exception {
- }
-
- @Before
- public void setUp() {
- }
-
- @After
- public void tearDown() {
- }
-
- /**
- * Test of loadPropertiesFile method, of class PropertiesLoader.
- */
- @Test
- public void testLoadPropertiesFile() {
- String filename = "pollen.properties";
- Properties result = PropertiesLoader.loadPropertiesFile(filename);
- assertEquals("bot(a)pollen.org", result.getProperty("email_from"));
- }
-}
\ No newline at end of file
Modified: trunk/pollen-ui/src/test/java/org/chorem/pollen/ui/utils/CSVAccountUtilTest.java
===================================================================
--- trunk/pollen-ui/src/test/java/org/chorem/pollen/ui/utils/CSVAccountUtilTest.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-ui/src/test/java/org/chorem/pollen/ui/utils/CSVAccountUtilTest.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -4,18 +4,20 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.List;
-import org.chorem.pollen.business.dto.PollAccountDTO;
+import org.chorem.pollen.entity.PollAccount;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
/**
*
* @author fdesbois
*/
+@Ignore
public class CSVAccountUtilTest {
public CSVAccountUtilTest() {
@@ -47,13 +49,13 @@
InputStream input = getClass().getResourceAsStream("/import.csv");
InputStreamReader reader = new InputStreamReader(input);
- List<PollAccountDTO> accounts = CSVAccountUtil.importList(reader);
+ List<PollAccount> accounts = CSVAccountUtil.importList(reader);
Assert.assertEquals(3, accounts.size());
- PollAccountDTO account = accounts.get(0);
+ PollAccount account = accounts.get(0);
- Assert.assertEquals("toto", account.getVotingId());
+ Assert.assertEquals("toto", account.getName());
Assert.assertEquals("toto(a)titi.fr", account.getEmail());
Assert.assertEquals(3., account.getWeight(), 0.1);
}
@@ -61,7 +63,7 @@
/**
* Test of importList method, of class CSVAccountUtil.
*/
- @Test
+ //@Test
public void testImportList_UploadedFile() {
System.out.println("importList");
}
Modified: trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/ChoiceType.java
===================================================================
--- trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/ChoiceType.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/ChoiceType.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -30,4 +30,13 @@
public boolean isImage() {
return this.equals(IMAGE);
}
+
+ public static ChoiceType valueOf(int ordinal) {
+ for (ChoiceType curr : ChoiceType.values()) {
+ if (curr.ordinal() == ordinal) {
+ return curr;
+ }
+ }
+ return null;
+ }
}
Modified: trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/PollType.java
===================================================================
--- trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/PollType.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/PollType.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -38,4 +38,13 @@
public static boolean isGroupType(String value) {
return GROUP.name().equals(value);
}
+
+ public static PollType valueOf(int ordinal) {
+ for (PollType curr : PollType.values()) {
+ if (curr.ordinal() == ordinal) {
+ return curr;
+ }
+ }
+ return null;
+ }
}
Modified: trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/VoteCountingType.java
===================================================================
--- trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/VoteCountingType.java 2010-03-23 23:38:20 UTC (rev 2957)
+++ trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/VoteCountingType.java 2010-03-26 14:06:00 UTC (rev 2958)
@@ -34,4 +34,13 @@
public boolean isNumber() {
return this.equals(NUMBER);
}
+
+ public static VoteCountingType valueOf(int ordinal) {
+ for (VoteCountingType curr : VoteCountingType.values()) {
+ if (curr.ordinal() == ordinal) {
+ return curr;
+ }
+ }
+ return null;
+ }
}
1
0
r2957 - in trunk: . pollen-business pollen-business/src/main/java/org/chorem/pollen pollen-business/src/main/java/org/chorem/pollen/service pollen-business/src/main/resources/i18n pollen-business/src/main/xmi pollen-business/src/test/java/org/chorem/pollen/business
by fdesbois@users.chorem.org 23 Mar '10
by fdesbois@users.chorem.org 23 Mar '10
23 Mar '10
Author: fdesbois
Date: 2010-03-24 00:38:20 +0100 (Wed, 24 Mar 2010)
New Revision: 2957
Log:
rename PollenServiceTransformer in BusinessTransformer and put it in Topia
Removed:
trunk/pollen-topia-template/
Modified:
trunk/pollen-business/pom.xml
trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java
trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties
trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties
trunk/pollen-business/src/main/xmi/pollen.zargo
trunk/pollen-business/src/test/java/org/chorem/pollen/business/TestManager.java
trunk/pom.xml
Modified: trunk/pollen-business/pom.xml
===================================================================
--- trunk/pollen-business/pom.xml 2010-03-23 15:39:36 UTC (rev 2956)
+++ trunk/pollen-business/pom.xml 2010-03-23 23:38:20 UTC (rev 2957)
@@ -19,11 +19,6 @@
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>pollen-template</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
<artifactId>pollen-votecounting</artifactId>
<version>${project.version}</version>
</dependency>
@@ -118,7 +113,7 @@
<defaultPackage>org.chorem.pollen</defaultPackage>
<templates>
org.nuiton.topia.generator.TopiaMetaTransformer,
- org.chorem.pollen.template.PollenServiceTransformer
+ org.nuiton.topia.generator.BusinessTransformer
</templates>
</configuration>
<goals>
@@ -147,6 +142,13 @@
<artifactId>maven-i18n-plugin</artifactId>
<executions>
<execution>
+ <configuration>
+ <entries>
+ <entry>
+ <basedir>${maven.gen.dir}/java</basedir>
+ </entry>
+ </entries>
+ </configuration>
<goals>
<goal>parserJava</goal>
<goal>gen</goal>
@@ -154,12 +156,12 @@
</execution>
<execution>
<id>make-bundle</id>
+ <configuration>
+ <bundleOutputName>pollen-business</bundleOutputName>
+ </configuration>
<goals>
<goal>bundle</goal>
</goals>
- <configuration>
- <bundleOutputName>pollen-business</bundleOutputName>
- </configuration>
</execution>
</executions>
</plugin>
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java 2010-03-23 15:39:36 UTC (rev 2956)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java 2010-03-23 23:38:20 UTC (rev 2957)
@@ -14,12 +14,12 @@
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaContextFactory;
import org.nuiton.topia.TopiaException;
-import org.nuiton.topia.TopiaNotFoundException;
import org.nuiton.util.ApplicationConfig;
import org.nuiton.util.ArgumentsParserException;
import static org.nuiton.i18n.I18n._;
import static org.nuiton.i18n.I18n.n_;
import org.nuiton.i18n.init.DefaultI18nInitializer;
+import org.nuiton.topia.TopiaNotFoundException;
/**
* PollenContext
@@ -221,7 +221,6 @@
*
* @return the main TopiaContext needed to begin new transaction
*/
- @Override
public TopiaContext getTopiaRootContext() {
try {
return TopiaContextFactory.getContext(getProperties());
@@ -231,6 +230,11 @@
return null;
}
+ @Override
+ public TopiaContext beginTransaction() throws TopiaException {
+ return getTopiaRootContext().beginTransaction();
+ }
+
// @Override
// public PollenConverter getConverter() {
// if (converter == null) {
@@ -247,7 +251,7 @@
* @param eee the exception to manage
* @param message the message to add to the new PollenException
* @param args for message
- * @throws PollenException which contains the exception as the cause
+ * @throws PollenException which contains the exception as the cause
*/
@Override
public void doCatch(Exception eee, String message, Object... args)
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java 2010-03-23 15:39:36 UTC (rev 2956)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java 2010-03-23 23:38:20 UTC (rev 2957)
@@ -12,6 +12,7 @@
import org.chorem.pollen.entity.PollAccount;
import org.chorem.pollen.entity.PollImpl;
import org.chorem.pollen.entity.UserAccount;
+import org.nuiton.i18n.I18n;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
@@ -33,86 +34,100 @@
}
@Override
- protected Poll executeGetNewPoll(TopiaContext transaction)
- throws TopiaException {
-
- PollDAO dao = PollenDAOHelper.getPollDAO(transaction);
-
+ protected Poll executeGetNewPoll() {
return new PollImpl();
}
@Override
- protected Poll executeGetNewPoll(TopiaContext transaction, Poll poll)
- throws TopiaException {
+ protected Poll executeGetNewPoll(Poll poll) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected void executeCreatePoll(TopiaContext transaction, Poll poll)
- throws TopiaException {
+ protected void executeCreatePoll(TopiaContext transaction,
+ List<Object> errorArgs, Poll poll) throws TopiaException {
- PollDAO dao = PollenDAOHelper.getPollDAO(transaction);
+ errorArgs.add(poll.getTitle());
+ errorArgs.add(poll.getUId());
-
+ PollenDAOHelper.getPollDAO(transaction).create(poll);
+
+ transaction.commitTransaction();
}
@Override
- protected void executeUpdatePoll(TopiaContext transaction, Poll poll) throws TopiaException {
+ protected void executeUpdatePoll(TopiaContext transaction,
+ List<Object> errorArgs, Poll poll) throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected void executeSavePoll(TopiaContext transaction, Poll poll) throws TopiaException {
+ protected void executeSavePoll(TopiaContext transaction,
+ List<Object> errorArgs, Poll poll) throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected void executeDeletePoll(TopiaContext transaction, Poll poll) throws TopiaException {
+ protected void executeDeletePoll(TopiaContext transaction,
+ List<Object> errorArgs, Poll poll) throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected void executeDeleteChoice(TopiaContext transaction, Choice choice) throws TopiaException {
+ protected void executeDeleteChoice(TopiaContext transaction,
+ List<Object> errorArgs, Choice choice) throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected void executeCreateUpdateVote(TopiaContext transaction, PollAccount person) throws TopiaException {
+ protected void executeCreateUpdateVote(TopiaContext transaction,
+ List<Object> errorArgs, PollAccount person) throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected void executeDeleteVote(TopiaContext transaction, Poll poll, PollAccount person) throws TopiaException {
+ protected void executeDeleteVote(TopiaContext transaction,
+ List<Object> errorArgs, Poll poll, PollAccount person)
+ throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected Poll executeGetPollForUpdate(TopiaContext transaction, String pollUId) throws PollenBusinessException, TopiaException {
+ protected Poll executeGetPollForUpdate(TopiaContext transaction,
+ List<Object> errorArgs, String pollUId)
+ throws PollenBusinessException, TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected List<Poll> executeGetAllPolls(TopiaContext transaction) throws TopiaException {
+ protected List<Poll> executeGetAllPolls(TopiaContext transaction,
+ List<Object> errorArgs) throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected List<Poll> executeGetRunningPolls(TopiaContext transaction) throws TopiaException {
+ protected List<Poll> executeGetRunningPolls(TopiaContext transaction,
+ List<Object> errorArgs) throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected List<Poll> executeGetPollsByUser(TopiaContext transaction, UserAccount user) throws TopiaException {
+ protected List<Poll> executeGetPollsByUser(TopiaContext transaction,
+ List<Object> errorArgs, UserAccount user) throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected List<Comment> executeGetComments(TopiaContext transaction, Poll poll, int startIndex, int endIndex) throws TopiaException {
+ protected List<Comment> executeGetComments(TopiaContext transaction,
+ List<Object> errorArgs, Poll poll, int startIndex, int endIndex)
+ throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected List<PollAccount> executeGetVotes(TopiaContext transaction, Poll poll, int startIndex, int endIndex) throws TopiaException {
+ protected List<PollAccount> executeGetVotes(TopiaContext transaction,
+ List<Object> errorArgs, Poll poll, int startIndex, int endIndex)
+ throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java 2010-03-23 15:39:36 UTC (rev 2956)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java 2010-03-23 23:38:20 UTC (rev 2957)
@@ -27,52 +27,65 @@
}
@Override
- protected UserAccount executeConnect(TopiaContext transaction, String login, String password) throws PollenBusinessException, TopiaException {
+ protected UserAccount executeConnect(TopiaContext transaction,
+ List<Object> errorArgs, String login, String password)
+ throws PollenBusinessException, TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected void executeCreateUpdateUser(TopiaContext transaction, UserAccount user) throws TopiaException {
+ protected void executeCreateUpdateUser(TopiaContext transaction,
+ List<Object> errorArgs, UserAccount user) throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected void executeDeleteUser(TopiaContext transaction, UserAccount user) throws TopiaException {
+ protected void executeDeleteUser(TopiaContext transaction,
+ List<Object> errorArgs, UserAccount user) throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected List<UserAccount> executeGetUsers(TopiaContext transaction) throws TopiaException {
+ protected List<UserAccount> executeGetUsers(TopiaContext transaction,
+ List<Object> errorArgs) throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected PollAccount executeGetNewList(TopiaContext transaction) throws TopiaException {
+ protected PollAccount executeGetNewList(TopiaContext transaction,
+ List<Object> errorArgs) throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected void executeCreateUpdateList(TopiaContext transaction, PollAccount list) throws TopiaException {
+ protected void executeCreateUpdateList(TopiaContext transaction,
+ List<Object> errorArgs, PollAccount list) throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected void executeDeleteList(TopiaContext transaction, PollAccount list) throws TopiaException {
+ protected void executeDeleteList(TopiaContext transaction,
+ List<Object> errorArgs, PollAccount list) throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected List<PollAccount> executeGetFavoriteLists(TopiaContext transaction) throws TopiaException {
+ protected List<PollAccount> executeGetFavoriteLists(
+ TopiaContext transaction, List<Object> errorArgs)
+ throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected PollAccount executeGetNewPerson(TopiaContext transaction, UserAccount user) throws TopiaException {
+ protected PollAccount executeGetNewPerson(TopiaContext transaction,
+ List<Object> errorArgs, UserAccount user) throws TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
- protected PollAccount executeGetPerson(TopiaContext transaction, String accountUId) throws PollenBusinessException, TopiaException {
+ protected PollAccount executeGetPerson(TopiaContext transaction,
+ List<Object> errorArgs, String accountUId)
+ throws PollenBusinessException, TopiaException {
throw new UnsupportedOperationException("Not supported yet.");
}
Modified: trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties
===================================================================
--- trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties 2010-03-23 15:39:36 UTC (rev 2956)
+++ trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties 2010-03-23 23:38:20 UTC (rev 2957)
@@ -9,17 +9,35 @@
pollen.error.servicePoll.addComment=
pollen.error.servicePoll.createChoice=
pollen.error.servicePoll.createPoll=
+pollen.error.servicePoll.createUpdateVote=
pollen.error.servicePoll.delete=
pollen.error.servicePoll.deleteChoice=
pollen.error.servicePoll.deleteComment=
pollen.error.servicePoll.deletePoll=
+pollen.error.servicePoll.deleteVote=
pollen.error.servicePoll.getAllPolls=
pollen.error.servicePoll.getComments=
+pollen.error.servicePoll.getNewPoll=
pollen.error.servicePoll.getPoll=
+pollen.error.servicePoll.getPollForUpdate=
+pollen.error.servicePoll.getPollsByUser=
pollen.error.servicePoll.getRestrictedAccount=Unable to retrieve restricted account with accountUId \= %1$s and poll with uid \= %2$s
+pollen.error.servicePoll.getRunningPolls=
+pollen.error.servicePoll.getVotes=
+pollen.error.servicePoll.savePoll=
pollen.error.servicePoll.updatePoll=
pollen.error.serviceResults.importPoll=
+pollen.error.serviceUser.connect=
pollen.error.serviceUser.createDefaultAdmin=
+pollen.error.serviceUser.createUpdateList=
+pollen.error.serviceUser.createUpdateUser=
+pollen.error.serviceUser.deleteList=
+pollen.error.serviceUser.deleteUser=
+pollen.error.serviceUser.getFavoriteLists=
+pollen.error.serviceUser.getNewList=
+pollen.error.serviceUser.getNewPerson=
+pollen.error.serviceUser.getPerson=
+pollen.error.serviceUser.getUsers=
pollen.error.serviceVote.getVote=
pollen.error.serviceVote.getVotesByPoll=Unable to load votes from poll with uid \= %1$s
pollen.error.serviceVote.hasAlreadyVoted=Unable test vote existing for account with votingId \= %1$s and poll with uid \= %2$s
Modified: trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties
===================================================================
--- trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties 2010-03-23 15:39:36 UTC (rev 2956)
+++ trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties 2010-03-23 23:38:20 UTC (rev 2957)
@@ -9,16 +9,34 @@
pollen.error.servicePoll.addComment=Impossible d'ajouter un nouveau commentaire cr\u00E9\u00E9 par %1$s pour le sondage %2$s (%3$s)
pollen.error.servicePoll.createChoice=
pollen.error.servicePoll.createPoll=Impossible d'enregistrer le sondage %1$s cr\u00E9\u00E9 par %2$s
+pollen.error.servicePoll.createUpdateVote=
pollen.error.servicePoll.deleteChoice=
pollen.error.servicePoll.deleteComment=Impossible de supprimer le commentaire ayant pour identifiant "%1$s", appartenenant au sondage %2$s (%3$s)
pollen.error.servicePoll.deletePoll=Impossible de supprimer le sondage ayant pou identifiant "%1$s"
+pollen.error.servicePoll.deleteVote=
pollen.error.servicePoll.getAllPolls=
pollen.error.servicePoll.getComments=
+pollen.error.servicePoll.getNewPoll=
pollen.error.servicePoll.getPoll=
+pollen.error.servicePoll.getPollForUpdate=
+pollen.error.servicePoll.getPollsByUser=
pollen.error.servicePoll.getRestrictedAccount=Unable to retrieve restricted account with accountUId \= %1$s and poll with uid \= %2$s
+pollen.error.servicePoll.getRunningPolls=
+pollen.error.servicePoll.getVotes=
+pollen.error.servicePoll.savePoll=
pollen.error.servicePoll.updatePoll=Impossible de mettre \u00E0 jour le sondage %1$s (%2$s)
pollen.error.serviceResults.importPoll=
+pollen.error.serviceUser.connect=
pollen.error.serviceUser.createDefaultAdmin=Impossible de cr\u00E9er l'administrateur par d\u00E9faut \: %1$s (%2$s)
+pollen.error.serviceUser.createUpdateList=
+pollen.error.serviceUser.createUpdateUser=
+pollen.error.serviceUser.deleteList=
+pollen.error.serviceUser.deleteUser=
+pollen.error.serviceUser.getFavoriteLists=
+pollen.error.serviceUser.getNewList=
+pollen.error.serviceUser.getNewPerson=
+pollen.error.serviceUser.getPerson=
+pollen.error.serviceUser.getUsers=
pollen.error.serviceVote.getVote=
pollen.error.serviceVote.getVotesByPoll=
pollen.error.serviceVote.hasAlreadyVoted=
Modified: trunk/pollen-business/src/main/xmi/pollen.zargo
===================================================================
--- trunk/pollen-business/src/main/xmi/pollen.zargo 2010-03-23 15:39:36 UTC (rev 2956)
+++ trunk/pollen-business/src/main/xmi/pollen.zargo 2010-03-23 23:38:20 UTC (rev 2957)
@@ -1,11 +1,10 @@
-PKۄw<pollen.argo�TKn�0��� �AQt!kcwѢA��]��$=�~�'�=z��"mRv�E61�g��ޣ8���D6�T(�u�1�ﲬ��1M�Eb1bt/�@8�U�,R8Av����B}_<|*VUyZ{��j$��Z�y��`,p�Z�@k:��9F�ΐ�ߏ߲U�*��A����iT���*���Aƀ}.��H�
-�����&�^Qqׄ
-��P�F4J�aG�ͅx�G9����0�|�G�(�R��D4J�q\��בW$�&^)���4��d
-\����QK,�zB��T���ݡ+��{��G��1����B�v������3��'(��<�W��Ճ��Ų��)L��>v�$B�l'P$�$��XGx�6nx�I
-�"�~$��z �:������ͯ���S������L�B~�����~��!���ƴ��7�EqRz�K�g��=
-Ǿ�o�8{��������W�p"
-��[�Bv�{�g���P�Uhv�~�F ��¾�k�5/��&B�����
-�w��T�m��.�m���ShA�+�n�C�$�qPZȣ��a�,�i��w�PKZ�949PKۄw<pollen_Modèle.pgml�]�n�F�ߧ���"�3�k�p�dQ�i��E��IZ�
+PK��w<pollen.argo�TKn�0��� �AQt!kcwѢA��]��,=�~�'�=z��"eRv�E6�ś��aEd+��Bѯ�y}�e���k�-���;!{¡��$HY�ٙ���C���x�T��r�=KA5�X-�<Q^0�l�R�5��
+�z�9F��ߏ߲U�*��@u���iT} LAU.A/4
+Z���,\�1#QJ48��9�4!�W��p��)m$A���q`�\�x�c� 3��x�R 5.w$A�T���x>��� Ax4ɕ؞�aD&S�"�
+�|���#T�HuW���B��C
+{�(�q�AlZi+�j��x;�ד�vE[�g �
+�@�z��,[=�p��c�K"��v2E�J�� Gl@Y�-��'�+�E�l���.�$�����_?o~��_��4�ޚ2T�Q��s{�d�k���i)a�~��bV���y�9��Q8��uC��+�������i���:�-�sg8+��B�g��){�6
+��}46n��k^L�����|����\�m͇�(L]��k-x�7�Ђ�W��D�� �렴�'w�ÊIf�f���PK����4:PK��w<pollen_Modèle.pgml�]�n�F�ߧ���"�3�k�p�dQ�i��E��IZ�
�r��>оǾ�)���CrFQEٮ$R�|���7��������1X,�x~q�ε�I0�b?��.�>�=��&?^~��o/�~���W�������z39K����F��������������]���(���l�ޟ/7 �.���KV��|�x��u�.�/���gj�өmO�1�"
O-l�x�t�"��qoo��S[Ӵ�Z��B3Ͼ�d��{\������7
ξ��/?�-������L�^�����}�?2𓉮�O&� �?���M�>���&
@@ -46,24 +45,20 @@
-�r.zb��</^͓�����xc�0���"�ݳ�����o��a��Y|����D8[�i�=ː�{�{��[%�+��mЇ��|t�UZH�ǫfN^[-%E�\L��p�]-e�vYj�͂�+�V��r��9#�Co�}����6z��$��Hf�i�ʼ~�&�_��6#F*�2뺝RJѺib����ܱ��Vg2�z�.�m[N������j���t���oG!?�Y-p�T�z�G!?�Y�f@���Q����:���#v.�z;2tG�o�r%��B��3�FLcc�T��7n���q̬q������7�Y��$6�92e]�-�=����͆�f�AM���X���J5B���-����1�n6��7[�f�?����Y��ղ��͗���a�I3��֪�sk3��n����]
�[o�[�{��n����Z����aѡ�� �T%Ea%��\��P��U��aXUw,�8\ӓ��T��=�� ��5�Y\h�3U�@y�����JB�
��w=�TU����z�����61!fM;*���\Dz��Ê���@�cX��P��q�Ō� Ob-�{����(Vd���
-�Q�2�+g�=��mճ�q����_���?3j�|9q�&:G_��G���PK����PKۄw<pollen_Services.pgml�\�o�8�����ԤB ]�i��Ӥ}��!M��D�!���������K�d�.tJZcx��_���/|e
-��`�=�����.
-�q���ku�7���/�L��}=W��������'��
-=���"���� ђĽ���١�W�����B{ы�M��WDCV!�P���ǩoG���Ϳ�A�۵�.0�]�j]S3o}`�g�9�g3�k��z�ީ�Α���;�0\#F�� �y!^-�K�S7���洗���v��Z�Dac��?����M�7(B�>�l?��#�b�7ލ��x C�=7�4��Ú��}�!�Q�4��v��8V����l`�3��T���!ߧ}���q8����F
-�?`�iR�6��m��4�/��!Z����R1��C���a��^F�����7��b��d>�Px75s��9�m�YuVm�R�U��45��;�������e���˲����B����'ZB���zh&i�2��)�uă��
-��E���^��,�7X`o���/PK�'e#@��l�!0B��VF�M�P���+3з�Ӱ����GθOay�-�]�����B�^E͐c'#d
-ٜ��<y���63�+�V���u']���W[�=JB���i<饅*�ٓ���aɄ����i�B����;I_��墈��(�%[L�bi�dA����,@t�����W,��Ĵ��
-����<��ebي�Ӟ��.ug�V,�įl�cg��V65
-����h�א�* e2r�
->
-�������ؠWcC���'u�{ԝ;��
-�dz�|�wl�:�M9S�s�l]��_�`�8�K��������Gg��V@��F�k��G�7��6-``��3�WKw�R�u��������nJa7D�����Bn������[�s�sL7b�N������?��o�~��-�1�I���g�L�1݅D8H�����U@��;0�K��?@"�q�P�O@'��dth@0.�v\�t�?C���؈I���R�/I����H���&�����v��}�ror?����Pv�BCE=Fz0 �<�X�GҔ�VX��#C��Æ�?VA@��^���5�-}�Q�� ��y�p��xE�(5��B��!S�͵f
-2��e*ej���7*���!���֠����-�v܌B�6��4�P�̂8H
-�Zm���y�L�0��1�}�Z,��}�\Q��(�5Ŗ{�nD>��u���E7Y�
-�/P�s�BU>���H�(��o�E&�F�,���e>`g2����H�s�un�g�|��)�_'�(����N�3(�-fXъN���T�N�SE����M�JR��Pɬ}Z��i}�n�>q<��x/%��,���>Հ"�JI���>����)�Pf�F���X�-R���>�3�
-\��+=�i`���(Ȏ�O�v��|0]8�y$fWEAUF�|�Pt���g�3�Gs5��q4�����c��ٶrD�=y� � a�7��i���j�8b~dC��<Lb>�;�H&mL9� ,��H�^1�>�zF
-p�"�K�6�Ӑ��m J �TAXhU� t����8D OH?%<��R�!b�VN��ӵ�����Sb���V���%�[��"��N���D<�����9��
-�N��O09�PKF;�!��@PKۄw<pollen_Diagrammedeclasses.pgml�Zko�H��_�VU*��c0� PuIZEj���T�V�ʘ���a��G��w��/HC[Ԅ����9w�̽a��n�K7���.G2ꨲ�����7����(�,��8�0��tq&��tyu�^��Mg�g2�f8t x4e^�f]A'q͈�1{� �͉�o����+�;+ҹ~�n��ax���M���4�+
+�Q�2�+g�=��mճ�q����_���?3j�|9q�&:G_��G���PK����PK��w<pollen_Services.pgml�\ko�6��_�C��#J�é��M��@_X��P�D�\eѐh'��GJ�^�%���V
+;E=�9������]�F1��jO���=������S^L�ƿ��t����7�ҧ\~�����c�x=�#9��؍В$wÑ?p"�h'���G�b� ��D+��"8X��Շ��ǯ�>���a�o�}`��@���f]���g�5rf3��o��z��^�f�HI~Bg'�K����є�����٩䫛Ώsz�w!���q�_��Dac��?F���C�_Q��8�9A�Ǵ/��n �"x3Q��%���xӑ�64��;����Y}��?����h��G�A]Pϵ�3��c8��n�����5m�:_�����&��������a�A�8������IOn��7�#�I�»i�C�� �S4��j�jc�Zm�ۤ(��!u�p����].s�߲[V�F�n��y�%T��n�f�u�RΑ���D<(���_�_���6��f��6������[R5T�0�F#T�`le���Ea//>3�!}����8r'�$���8�Fv���-��*&h�\'!�����鳀<g����|�@?�Sv; ���ځ~?�q�"E��O�����ϟT�F��%{o�i�B����;�&�qT岈��,�)����҉Ȃ>=I%�������%*�\��s�e��%����"��ibՊ���o<��t�Xr��ٌ&��lj� �y���!�u�d�f���tu
+[cn�빡� #��'���sGx��=���C�������?�3�Ä`�2�G��Fv
+�%���n��P�;P^n�f@�A�UD��1��ސ/X�t��Zz�oJ��otq=>v֏�ݒ�n����=�݃���m)�&���;����.Ď��==n
+�H
+����fu�'� �*��_1��t�0�����W!i��.��H0�QG������"�lG�ѡ��лq��Ag���c#!��G��$
+�֓ ]�j�hLX��σ �e0��d��ń톲
+�*"�0Z`8�!A�n���ؒ��H��ڐ:��$��U�!�b�ke��G�P��nȊ_�]�0:^�/J
+���7vȔtq�Y���)b�0��9^��߸��c�D�]��[ڂBrC�t؊����(�.�+S�
+�CA��AR��j��4ϓW��������3����
+
+�����Kl��F�c�e��(�Ŋl�z�*��'���E��FE�~3-�x7VՍ�.�;��T�fG:���k�?K�8�O��&�F����pB����@`E':IO>R�8�Ou��Pߛ�T�>ը]PI�>�[ɴ>`�Z�$���Y>�SI(?K�8�O=�dB��ThR��_M�Sa��F����
+��K�z��}8g��zyUz��;.C:���#Q�oC�,�8��Quc���sOή����O�4S4>��R�L��vo�p!��6]Ӻ�}BCZ:ۖCN�h������0�[�J�XTԵD1?2�!�b&1�
+c$��M�uK��]�NP/����~=��8aG�-HjW�OhH�¶��h� -�G�}.�5�P��J�I@��Ԁ`�آ��a2�t�ƨa����껮5*��k���xpR�Eb#�A�(��rξ���S��L��PK�N�ŷ�@PK��w<pollen_Diagrammedeclasses.pgml�Zko�H��_�VU*��c0� PuIZEj���T�V�ʘ���a��G��w��/HC[Ԅ����9w�̽a��n�K7���.G2ꨲ�����7����(�,��8�0��tq&��tyu�^��Mg�g2�f8t x4e^�f]A'q͈�1{� �͉�o����+�;+ҹ~�n��ax���M���4�+
R5�Ќ�������5,�úb��:P�Ծ| E����#yB��q�`���*�[�OM�~���,�����G�I��jꑄt�s`��G���G���$�����$�v���3[<7L:�������a��EU�)�5u5��ɜ�ڷp
>i(��%�s��S6�o�g���ﺶĝ���|M�y0rcs�n�6�n/=��d܍d=e�>sKf|>���2�ěsx5�HL%���J�R����*i�.�u�q�L9~:$[��:d.�(ߊ)K�c|�M���d��]Gx� �e�+���7��2�KP
�� ȅ���*7;\�o��i,�'BX�N��F� ��2k���N�qB�� I/_��d�dPb�z��p�'�H�d,3O�?���!�*�2����8�z�L��ͤy���'�"�������XL��I��2���
@@ -76,79 +71,75 @@
�dE�0
�2�����[8�>��5Ѻk�0�9�{�G�m�����|
fx���WGM��[`y�V>������*�w���P���ai�,�*Z��b4s�1v<�v�C�1
-^� �?j���ݺU�V{y���WoS�l�H:���?>�PK9ܜ='PKۄw<pollen.todo�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��q�(��;�D�*���+G���*(�8z)%)J
-@% ���,.2���E���9e�)�E�%��� Y,B3PK4�[-m�PKۄw<pollen_profile.profile�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��qq��e��q��ÙPK7Rp:BPKۄw<
-pollen.xmi�]�㶕��M���H�S�ؙ�Z�k��wo�� R3�H-I���V��HQMJ��(AI��x?�?���Α��؞+�EzP��]ӳlw����q5�<H}��O����eg3������?�����Co��.��`L8D?>H����n��}<@�W�K�&)���䵡K��GI����7��_7|����I:�my�a�������������[���!�Cx�5n a��۷Q��x�`��U�7鑿����Cu2T�� ����%�g�iB��-��1PTI����+��������?K��_�ר�ҟ��[�D/�"4�i=:R��|�F�mzb��2Կ}�&~ґ� GM�
-�s��D]_�zz�m����`2(�`���`��צ6�n��l6�׃�,˯���Q=ه���s�>Hv�aM{c��x�O��������@�y���D;����f��i�N�X:3m��Z���F�f_~!y:ţ���z�n��LFk@&X]�����R� ߤ�1�@bBա�ӫ���~�g�4Y����=�p}�a�|�|x����,)����U�I�F��"�gZ��g��0����**H�e7���&h�n��T77���cz:�5��|�|���<Do�ï4�:�J��peW�����A@Xو�`���%+�H���ԲL�$����!��v̟<�Dd#�����֎m2��2[�fh?C2�NL�,�,�.%���éAVD^�`�6���
-��Ԉ�Ȇ�����O��"B�� <�y���зׇ���#Lt}-��>�d0&�=��OGz�����7^����Gϰ]���Ŵ���-/O�p�cB�oax��K��f�?��g�Yż�Nh����nɢI5���S"}�W
-}<ؼ��q�k ��&"�8�g�$�G?H��>����}"�͠.[���d����:�Q��A�H5EJ��S��)I R�ɜ̨��ӫ�|7-��E�o����=�oTl���7
-^��#��"�Ǔ��Z�AR�e���)~����\�ZGJu��dṟ0gӜ�
-�"�����q��?���V��+cZl4?��aύ�����Yx�
-R��k���5��U�R�i4���B3�6�o�t�F�$�
-�ܿ���z?�-��7�Z�ׁ�և��CMo��;,�K
-w�\��2��]FV9�ed���L�f�us]�S��I�y��Ԣ���<R��cA\!W�d��:Z��{�@1�(j��-Rл�[ĉ�6�J�EK
-%�,/�t�rf���
-��RE��̳��Ȩ�j��a���`�Ρ|^���ֺ_�+Gیr��(�7��B/�"��?"����E7���=�G����C�m�����"+O�4(Yi$Hw�!$`p1�s�rH`�3��O��G'|{���r�p��a�������/{A6����M!qC8%7�w�=+Z�ʰ�Uy]�v��z�Q�kg�}~%Cǜ�ނ��J>���?�M��������!>�$�����7(jO��}4|����0����u�TL�=�S ��w���.P��烎���Ө�����/�o2��>s�pʟ�/2g8ϜyY�eM�`db���d�o,2����i���gD��n����m7��ѭb�T"�{ĚϞljs,,}��)R�G@��Qh-nl?߉�9Z��o2R(L�L�{���y���<�D�!2�3n4��MÌ��Z�t˜�$��Ia�X$�P3t�~蘒@:�t�߸��� � 0�k�k�Z]b���P��L?,]v#�����p����PX!��ΰ�Ҁ���3z*�Css^̊Ac!����Z�g����%}���d@������0��\����5�o�?\�8�ae�a*�u��#|϶���=�SR�z����rNr�&��CDSa��?l�J�,D���rj\��<���J��Z�09D}9=9q�U�+���:�L=�-�F܄J��.'�k3���0��[&�7>#�zpD�}n�h��}���#|u�"�&S� �S���U�7��U�����,f"�1�L��*�5֡Љ�',�n�h9k�_�B'��G��x0%�Ej
-�t+&ԦЌ��B�C_OT5�0Y �p��w�i���Uw�Ae"Ѣx��P�~�q�ֲ���v�hh�ڦϝ�F�w�tP@�F�t9�?���{������4.�Z��p�X0O-̵���z
-��WPbRF;>y�H��j�w�0� 4Hw����ܫ�:0�+D���K"��0�t�0������hS�C�6��şhE$��!K��]��;��%�D�A\�~-[u�a��=����@#�7�j�D$y�F��f����ß
-�pk��M�L�� ��������f!Pf"E1�L��̚�TX�-B������6k���(�e:4�k�A�X���6˾��(J�e:�0ޕ�_bK���~�����_�JG��25ӡ��/3�҃TX��t���S�Y8�Uѧ���/�7X��z�Ya���3˚9x]�#����x�QAuEA��� ��
-�UF��`DZi(�9�� Nw��������m�0)�2n�� �Y�(xSg�+���G@@o! �'h㑮ET+����P��W��@,��a�X�@���6���D�7�Ȑ4�b���>Z#�Z60=7��RX��fL&�=�$��'!ڮ�����C,��}W`}��kR{?�AZ{V�ҋp�� �%��*����#�u����fM>�]X�����7� 11�ͺ^L��^�7�=1�dž2�om��z�q9��l x�B8Ǘ%��V�_;�
-�t��
-��P�Z���F O��B��@�S��p�P�N�P��j7�hS(r�3z��ܞ�(�.Q�┉&���[s.��_Г[s%���-ݚ��9�����9�Rz���+���&Cܛ��FMP�@GP8� �� x�2!�U��larr��<�6��a�uܹ�/~��F�b�v�.7�E@bI�&'�Xm>���»f��h�0��؞���M�}�қf ��]�1��6�Lhj�G��Md�0���վy�����`��|��|���&:��L�.Cr��ea�I�0���D��y�Ž��D�ܓL��-��t��k��L
-bRQ����;�}g��r������(��g:�dN�x2�ֆ6�r6Ӎ9�Mr�ra28�O��0���n2Ѫ�'�2���aG�3�s��5y��$�Ac0����34=ׅf�K2�x�Z���(R��;�lo1�E��@�[з�-�&�wh���[nOOt=�=17W��l�/�O�t�1֑Sk���e�*�*��~�4*�U��
-N�*��u� �RN%i���Q�=pC6leqY�_� �ԣ=� ƪ�ĊD�J�������{���wdZ���el�(Ӎj����D�^�Y�Ȟ�X�:�.�l:.��$-+�jL�y.���Z�Љ�c��^5*j���£$�'w���ZOcA�G���\�(1Zq��jek�9�p��:�M���a0�PKz��Q�(\�jd=��� l�Q'([��j���B�U�&D�H��؍��o����� $��I>D��~����j�K[ܯ:�hB8{���%�ՒE����m(�B!k�l�w��P�\}��@��(1����{��J
-$G��]�k�0�cЭ�w�s�Lфvv�Ihg��0�!���B�.���'�4�Ѣ1-��H9�:�/�'�
-[Kq���Q��T��ܚ]��s�
-P��b��#t�>�2����֭��g�ղnP���-�'O�SF�e-x�:�r������v�P;C眣��[�������
-���[A-�ia���!7,�W�0�挨YҲ��ɭ"�EV��n�E�{�
-��ɻ �D�R�"M��/�qʵ�K~�I5���;��"����&c�:}"a�&���%=����D
-{4y"��k�n����Xk2��?��a/�T,��`,�D'V��G��C3�M��XDk���B8�n��B�T|��ʤ ��ܫ@ޮ��
-DT�f��=�9Q�L�~E5�*�� w�&b9���K�$8a���H��؍�] ���e��*��e���
-� �1ˢ&�F���C��aw��Ty�y�3���خ}o�����z�n�ZU&��
-"���jI��3��rP -�Y�1,��"���YYi"�e�
-����D�_�L��٢;b@~-���LI����*�e����s����U=���*.���H͇BE����N��sE4��H�����l{��/0��}f�@�w���;bȔ�ޜ0��-d�I�M�TS9_Z^��'��ɹE����$�'yc���ic0�V�������G���'χ���s�c�e����&v�~�
-����f7_����k�x�ԉ�Ce~
-�/b� ��|<�X}�<$�S��8���Ac���Vcr�F���M���T�@��E݀�i�ˎ�ό�;+�|-9UH��l8���C� W=�Q �~��|k:�.�<ۭ1��di/����\~�{)ϭ:D��
-!��8w�r^-�� ���e]0
-I�Y'^��B��Ό4�
-{8�G�P��s���\�Yj��٥I���gۤ_f8,�w�X�#���J^䦏�G��;��7�0Nè�pQU� ������c'�#����6���;�t�rsp���s{���>p]���-ؑ.rM!��-[�����
-��������d,5�>"�Q�p�2�~Xశ����X8ϽS`�M`!���)�)�L&��=q�=`'���e��{�I`�
-`�"�5��@���ʹ�j��larJ]� {���0�قZa�Za���KZ��-̽H@`�-`��hY���'/��4lC�(8��9-[�b�1=9�QV��Ún4�}6xG�E���N��π�����Ȑtbo�ea+s����V��O���ݥ=�+�@D�aN�����J��#��E�4�(��^�M�R�봅!v�<?�م��
-*<g< XT�J�Oo��q��n��Ũ�Lᝌg���1:{+��|#c�qy�GB�"Fw���?���n��Oh$LsR��+�Բ��W��{4 �ǯ�"��vď�ߞ�_�3C�=���C$&}�F�)#�z~�hG���WD�~z�ubNhzf����(
-�#��÷���2'�_�������k��豦Px�p�_� -I����]M���{���$O�QzrD� �濔&�5�e5��^�S�ó3�]yޤ�"�_VC��8�>.{+��V��V<�����[����Ԏ��;�N�6���(���#}�|��S��*
-�Ow��p{r�sp���3�+�eDT�
-�P�2���L����-��Xx�X�VB���������
-JM�29�qE��#���e������RU!z����{9�'N�&jga���_�I�_�iRD�~m��i�D��7[@ �q~��b��PI�7����KS���Q�R��
-<{��8��R`�T��2�x��]�D_�����BVBi�CRZ�/���W#�D��QQ�"5
-[4�Ԟ�j�
+^� �?j���ݺU�V{y���WoS�l�H:���?>�PK9ܜ='PK��w<pollen.todo�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��q�(��;�D�*���+G���*(�8z)%)J
+@% ���,.2���E���9e�)�E�%��� Y,B3PK4�[-m�PK��w<pollen_profile.profile�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��qq��e��q��ÙPK7Rp:BPK��w<
+pollen.xmi�]뗣6��������Jv�\���N�g]~��9IO��:;���]L0xWw���W�[<$��<3��-�Օ�O������e�H/�lϕ�"�)�N���Y���_|zZ�O��槿��N��������q�7�~�������pCla�&���F�`����P���:D�}��o4U�/�$UV价�H~���o%����-tC"p��/����C�v�o<L����=
+�@����o�&������C�7鑿����u2P�� ����%�g�iB��-��e�^Q%y�&���2�V��#�,��_�f?H��oM^�<��0Ј�-D�,�H ���-����˷�@���m�������������8��3s?���'�{E��Wd�~��
+s8o���)X�'o�'�,��ӟGytw`�?�7�q�{'���4��mF��?��@���3_�������`f��T��dG�t f� �
+�~�&�͞^!y:ţ��k덢*��aBȄ�yxw|��?ȷ�F�D,��Pu ����s�C¯�L��&��];�'���#���wJ�Βr��q��LZ4��G�>��:4?��߀�ؤ�TQ�@��(�p�ʆ5A�w�S�\CH�"k���L�04����v�������Ҭ��*ɮ�]�džsae#>���C٘X�bD�<N-��I�����2�~e��ٳMD6@۰���no8��Ȓ�l�_���ɜ:2!����;��c��Yy]@�SC��*�+h$OLsHE��x��|�^����5��ϣ|��m�C��`�i�hᏴ�%�1����t:�3���~��:�?��.z�����5Ϧ�g�n x}x����s�8���D<�*��`�wB{��E�'uKM�٥���#�j����5't���_J��4���>#% ?�N��vɿ���#�4�:oM�����Yd�?vH�&q���Mh"�)A��O����$%H�'s2���L�nZ���߂���;,���:����������hOƊjY:I�S��Zf��=!:o(�:l( �
+�;,����c
+`�*�9�`E�
+��pH���Y�\f2�Z5f4��i����{�7���� �L��%��g�k�<b��h��υf�m��x�Z5�~I���^�
+���~�[�?8��n��H���7LJ��v�vX���@� �e^���r���J?vʙ$���!���L�e���>_�E;
-���
-��wpCQ�W�2�ޡ�{����u<��.��ئ��<�n�Uɚz���D��$,|u6����:���x�vh>y>�
-��>X�d+3�U&�����u�s%.B� ~�F�xl�� �x�M��yEh�I$�!덺Gc]�<�����C�����m�,RM�y�s�X���p��6����~\?�X!�n��;py�����u���n�l[w����6�x ��ɕ�'(���Ih�g[z?�ߥ��ǽ�ۆ?&_
-��eIx>B�����:>�c������\��B4�0����F_:��mL� ��
-��yu�&����ʒ
-�j��۵Sw���.t�s��]�L��X�8
-K�sc�FuӅ��{�F�A�'���a"���Շ��<���H�@j���Nˀh�W��t���-z%����ҩ9�Q�MFomښ���*�Qe��q�u�r����:U�xB%os�v���z�g�q�5��=�D��ۡ&p�����\��6`�����c�H��� �'̘2ҿ��� ��i_��dW��=�I��,-�ӓN�d��������';���-Yґ�����c�/�le+����?w�J[���Gy��W��vS��>�o��y\�um�����C�f���5��;�����3��[���jB9:x��5�����Յ]W�qJ�&݄&�?3�{e��w��E�ҭ�os�W�����rk�;^��#'�俠�P(q7�ĉ����ķtb�����
-�o�sO�։�?C�K���J��]���oߵ�3��6�����������HG�e"a�r,jߵ����1��~����4�{��ԍq6�oB�+��Z���a�դٙu�7jVgDaM�'��U�"�lt�V�G��Î-��m�� ��$ۍ�"3� ��&͋�+�w�X��<�n�"��e"vf����}��G}�ʹU�f�(�Ѡ��GnU.����ʾ0=�ܨ��(�L�_- �m�־�;�q��DJ�z�b|Ƕ�$!�=
-:e
-�0�m�)-���\ɽ�j�S�P��(�RF�I�z�▗VC"E D�JH+JHn�v�J��h/���x�%\;α��[�(J/��1�"���ԭQ�H��
-QԞC�9����<��Ҕ�bw
-����Z�[���:<�ra�bo'�y���!�k���ꆏ3��ݞ�,�U�4�އ�Ȼ?���N�i�GV�kI���wp�:�x_v�]Q NJ<����y? \1V��֊&�>?��S�ԓ�P�/�Y\������rt����އ��>=�+��~z��(����ʷ|�sU>w��S�*�������� t�����ۋ
-�WT`���
-�����E&r:���k�\�ˈ�k���oN܋yAlsƯ�6g,+*�Z]�u�p�W�`��;<���g�״���s��0O7����g�co^/x�
-�}� �%�3�����.)�Nh�9A�',�_S?_9�ٞM�a�w�g���������u��HDO���~�;!W��~��r�U�B˳�F���
-��T]XY���X�8Wx �$�-#�D+���`X��R��s:H��_�1*����&��������4VT�2b�b~Z��L#�� ��Ix��m����4|ĴS����h�i�%��V��zb��:�c�M-�$�-/�u.6V��-�Y��݄ޕ/�vx�ˢ��f*@S#�!T�
-��ըN�e���)�M�*0𮇯���H���Dk
-�]u�\�^bF��Љ�Sy��j�9�V���&K{ �b>k�h����-��kBK���c����Z-
-v*xQ�诐���E?���������yO��9��7���1�/�`��o���2��%�N8�o��)��*������r��i=�;�c.�7��r�w丗�g�J�}���ͫ&�}�T��ʾ&��T�]V=`V۪�Vۊ�yE��z�j�[OO�������w����x����S��B�b�)�]~����~���m���p[(<(/��N��*s��U_�ǃ�t���g�P�KL�����4vʹ�<��\^��C��B-�|9�΅u?������B/�?N�7�}����΅�@/w��
-~\�z_�.:nӅ^�6�}[��ӈ�bą�<��e�����v��/_Lz/_L��I_�xL�p�M˽V�����Ǵ�F���4�e1�Bxg}�i��y�MLU�d.�Yy�.�����2�i��p�#9Ş�{���x��1��[?~���;���ł�P����K�s��,�;oط�}�g�ߣ� {Lt�x,4ך��D@W�Zg@��T'� �*QMX�4pbSЖ�kGK'nx�_M�s�4p��ђ�A!�'�h��uϺ��S�qP�/��k�-
-��Z�D�-
-��YP��Hr7-
-�ĺZM F�iM��&B<�4p�JI��Dh��N۴d7��BK��2���`�0��Ml#N� �r��V�g��5�zs�4Tpⷣ'��\*���!���]4T�����S�\H��W�mDg������&��R�i���#EM����g4Tp�OCxsyd4Tp�GFCxs�<4Tt|��%>�Y�t
-F&"y�M&}c��Y�s�eyǻ-�uj�,��X?f!���;V0��ԉh,��8+���fĪ������$�ujm,���%�K��?ɬ�/����i���X��?-�V��������\�׃��]� d���s,�/�3��Qg��;�~` yԱn�DM����:^e�����l�q��dL���*�zL�h3���^��Z��&%]_�: 4���n��kEm��f�k�A=E��&K&:.��Ds3�IA7N��4�z�"�؛
-XSD��<��ղ2��z⍉�>2�!L�N?��
-J�L����@&����>�ڲ/����(
-��Ϯ�<e�Y��9�P~�3w;��PȎ��,��Dk̈́�)�&�^��Z/�`"���]u����O��&EAs��������Jb�SҜv?�Az�{m;x*������A��{h�������
-p�y�y�����/l2�f� �f�4C��|�*5��?L�
-��>�h}��.p2��7�Ә��>�d����DW��(@�@���Rӂ�������sk$���ܓ,���I��&����F���o�?�|��PK���"��PKۄw<Z�949pollen.argoPKۄw<����mpollen_Modèle.pgmlPKۄw<F;�!��@�pollen_Services.pgmlPKۄw<9ܜ='�pollen_Diagrammedeclasses.pgmlPKۄw<4�[-m�h#pollen.todoPKۄw<7Rp:B$pollen_profile.profilePKۄw<���"��
-�$pollen.xmiPK��G
\ No newline at end of file
+y�-Ƃ�B.�ɞ�Eu�p=�
+�b�;P��@q�HA��o'���*!g-)�Tj�|<�w��ʙiz{7�FK��F�#�j��[�;d��#��ya���;�v��m3��J�td:\���
+����6��8'+;��7*�G�@$!�=~F�h[$��vnXyڦA�J�X A��!��A��C���yf0��8:�۫���kF��d�l_����tX~��0�q.�gn
+����)�Q���h�+�BT�at�}��-FE���}��]�sz��+���:�6q,���*�/��$�@��2���=�����Y���O�z��P1��OU$xf:ܴ��@;�:~�O�
+�g�C�����n�̙3�1"��Ȝ�<s�u�-kj����N&mm��&N����>#:~v�'�N�u��E��n5����!�|��N�ca�#�@L�J>zt'��Bkqm�A�^���2�}���@a2f:�:��#���)�%�t�9��p�0�k���h9��Y�D#ѬM
+��"y�����Cǔ��q�C��ƕ��N��^�xh���ӋB�O2�P�tٍ�W�O���U���WCa��?8���nJV�OT�t���
+��i1+���^�k^<\Z���£s�=�������sͽ�C�
+���qyn����֑�����^j�v�GLI�#@��[���9�=ܚ̋M�����]+ղ��d�ʱqm��|R�*U�:i�������ĉV���l*�,3���4q*�����<�èjn���|��������͢9��5�4G��EM��N��(���W��nW�ffj�G���ǰ2z�L�X�B#f���
+D���5
+��$�����
+�)<8Э�p8�ft�Z�1Qռ�d�����p�3_W����D�V�A�C��A�uX���Ad� 0�ej�>wV��=�A@����.|�o9�������i\� ��j��~<� 0
+�-C�`J�+(:1)#�-�=a$�s�ͻS��
+4Hw����ܫ�:0�+D���K"��0�t�0������hS�C�6��şhE$��!K��M��;��%�D�A\�~)[5�a��=����@#��C�H�µ6;չه? pc��M�L�� ��������f!Pf"E1�L�+�̚�TX�-B�ۮ���6k���(�e:4�
+k�A�X���6˾��(J�e:\0ޕ�_bK�q�X�����L��O\���P_ї@�A*��b:^p�)�,���SuEL�+,�T�ج0s�����e��.��j��L��(��:�"� ��j��ĆQ�*��M��ش�5��S̅�ǻ�~�Bx����6s����W�L�с,n���3ޕ����# ������6��Vtհ�P��W��@,�`�X�@���6���D�W�H���b���62��E-����)�pp5&sۏPx�უ�l��EFξ
+�_v>���>��5���|'���"ܨ>�e�
+�'��h�f
+�ǚ1^�3ۅ���k]�_y5�c۬��D�(��p����XWF��
+���c8�9�6�/�s|Y��nP�#�N���L�+ˠ�\���;�q0kP�+�)9ՙ�����q��j�vs�6�"�:ӡ�P��9�R�.N�hR�/�5�x�=�5GQr�k^ӭ9y���M�ޚ�(�W!���ɩo2Ľ9in��j�t�3|�0[
+2��,�[UP�aI�&'�����j��=[������8h$.VlG�r�Y$��larr�j���{H,�k��� �@����M�4�W@,�iV�5�5�Q�N���j�G��Md�0���վy������M�M�TU�ut:C��#M��o��ܓ~a��k�61�{%���'�W[����YME}=ՉqHE->���������n��N�8ß�p�9����2��4�IXO��D6�ʅ�h`>{���C��D�N�HD�t�:P�9ϴO�r���َ�����8���\�.�T�k�2~�H��������Yd��oA�v7���ߡEz�l|�9>����,��\�ʲ����!����nDN���Z�N�D�(r�eҨ�W�^7�9"��B��N��r*Iӿ~�:��a+�˪��"y��a1Vu!V$ZW
+,�nu�@���o�8�#�Zx_���2]��1%W&��"��D���"?�Aw�e��q�&W%9kYYUc*�s�<��Ҙ�N�M��QQ�%�=�C]���zZ<��0��E�ъs�U+[#�9�[E��ujdt���Z�c��r�D��V#��VN`[�:A���U��T�ؕ�bt0� �EjWŮ%(|���N �LL�!�l���ՖV{[���vձE���su��^( ��,*���l@�
+Yfۼ�\����SJTF����H�G܊6VR 9�W�^C���nu�9�Δ���N: �,�9$^!\y��jw� -��hLK;=Rβδ��ʼn��V�R%�|��;%U#F�D�fW��k\�=�X ���O�L#8A<n,<�uk�:�Y�z��[��t�y������@Y�0��\��%|��8�N��9����p�~r��w��c��VPkZ�����@�
+�$̭9#�E��larr+��j����j��Fò�Yl�f²:Q��HS��ˀy�r���{RE�c��.(�H�m%��بN�H�8�D� &��qI�:B��Yh?Q�>�M���Z���(:1̸֚��g���C������ ���J>�(��sh氩�"���hm�^���
+�V(P����X�ҟ{(�ەѵ���j�,��G5G"���Я��E����#�v��,���@ym�'�?@z�v�є�+���^��O=���2���,�g2m��+=d�HL�G��9a��,��v�xK�8�f��T]㵪LF� u"���jI����rP -�Y�1,��"���YYi"�e�
+����D�_�L��ɢ;`@~-���LI����*�e����s����U=���*.��H͇BE����N��sE4��H�����l{��/0��}f�@�����bȔ�ޜ0��
+d�I�M�TS9_[���G��ɹE�����$�Gyc���ic0�V�������G���gχ���s�b�e����&v�~� ����f7_����K�x�Ԉ�Ce~
+�/b� ��|<�X}�<$�S��8���Ac���Vcr�dy7�X[9���$���-&�6�G�WwV�Zr��F#�p�+��*�z�<�A��F���t�]�[y�[b~���^�5K9��P�R�[u�&^yB^�q�z�ZFkA6+)˺`��c$^��B�gF��=�#i(�����h�݉,5u����$Bf��mR�/3��r����5jx!/r��?ƣ�ޝnr�O�a�tA������z��sⱓd����~f�ᾞ~��V��Bh����
+Ԣ��Vdx:5��z͆���h
+)+d���N6����:�
+�>��!mR�˹YS�?�C�ם
+���S˓�{TLn����% s��w^C����4F�z_'��j����K����������9����\�;W��\g�؝�[�0?��ձvU����r�Е��0I��������J�+��pX�����X8ϽK[`�U`!Q�=�CG5M�'n�G���larrN,�,T�HxH�^a9�ʝ@�-LNi|A a��P�����VئV�{3���-xs� Xx
+X�*<�c��ً����|�
+�@Ü�-L1!=9�AV��Ú�B�}6xG�E���N.� ������ȐH|do�ea+s����V7!�k
+����=�+�zL�aN�����;&N'GX�-�Ji�Q�M�ޛ�0�iC��]y~��}�Tx�x��(��[��Y]�"C�Q�Q���ۜ,�#c t�V$n��]΅�vhJ#
+ًA��R��aﺶ�a�?��0�Ii���?R�^�_a���$��Z�W'~RpJ7��s&p�$��!^d���}$9}s��>F��'����6hG��M�~:�5b�hzf�3���(�@p��\~ieN�W�� )u#B���cM��J+�)ਿPZ�6�mZ� 黚�o��%�s�<�F�a�&��S��.Ԅ�Մ��j�,�'������#(e���\���2'��W�9�q
+}�E����9����ޚ�Ԧv���y�"��95�Fi�����L���8�Ua�8}��*�Ŝ�R<�o������kFDE�P�� ;�t��(�b!�������(b ��<�<F�)Q&�f��57$x��\�{���.D��y+'����D�,,����0����0M�(���- �:��HR�fD<�oa6\�*I{��s>��caiJ���c��"
+_�<[�Ϸc@��[
+̔
+_F�¼���;��P�J�#mxHJ�%|���j$C��f@T��H�@��3�g��[CC�t�����P��չ��������4��e���K�f�6��$���"EU��^<�h5Qa" N�r�Qg�4���gχ�>����qef��~�7.p.d�Y(6a�o������ X~1����39���DBb���8����h
++�bv�s�������H5��!b���� �B<Zۛ}���q�dN`�`�������m/���k��&E���ٶ�am�@~A�+��P���<�L϶�&~�K�9�;~� L���f�%��mH�v3������kϗ���
+�qin;�d��#�����u|���71�A|l0M�Á�x�#�*K*�3���m�NIܙ۫����_w6�2��xq�,����"���ƕ��ON��DX
+
+:�=v�}s�|��1�L���|㝖ш�(^��.-![�J
+t#�/�ڥSsܣ:���ڴ5����ͣ�����R�Ts��u���J��T�HO�z�g�q$J��V��}�mQ8�W�^K.��g ����ӱ�?��}�fL�_i�^��^2�+m����$�q����I��K2O����W�����hmK��t�b-��f���%[��
+2�}��-����m�Q�d�Õ����c��#fb]/�-��@��em�F�n���5;57�������P���p�hi$�auaׅ�E�R�I7�I�ό�^�.<� i�t+��\�U����;�Z����ȉ*���8J�U*q���-�<9�-��#��ï�[��ܓ�ub��)���0�����窻�����a˙�]���B�O�F�KDpd�#�2�0a9���r�cra͘PZ�aw�z�ͽE �F�8�7!��w-�Kw��j��̺�K6�3����3�UѪU�[6�N�� !��cK�h[ -��h-�vc�Ȍ�G¼�J��
+�+�1O��[�}Do�����B�(jߵ�Q�}3m��/Jo4��[���q��/L�47�2=
++F�W�Hm�����j�' ���Es�Ʊ�$I�s�����B"r�vJ˵2;�Br������$T�$J��q�^5���ՐH���Ҋ���]��!�b=$�a W��s,���5�ҋ��L��=�?uk #�B��P�`N��o%ϋ�4�z��]C'$f���V�`���\�gx���K��x_�Yʐ�5z~�Hu�Ǚ���D@7�/t՟3�.�!.��g ���C��#+�$���;�v�P��;Ԯ('%S}�������+}zg���B��m�9r�Iv(}���,�b�g ��zR9:���p����X�����X?��U�����T�[>ӹ*�;^��_�w�gi�
+���H�~�}Q�k��E�*�~DO�^xi
+��"9��K�Z��uD0���#�b^ۜ��� ˊ
+�V�p��/\���ۡ�����Y�5-��~��,�Ӎe��4C��؛�i�`�-k������e�l�s�۽�xN� ������bF�g�o����}�p��!:`�3R��;i����Nȕ;l�%���:_dU����d�m{v�>.UV����l;V'��9Ij�� ъ�x2�G��T ��R��F�I@���
+z�ft�/�щ�<�
+3u.6��آ�L3�a��8[j����-�r�+e���6�C`MGk݈89VT��ubv�b~�������d���*�),���)��i��|�L;9��>��[Ed��Ē#��g:�Z�I"[^.�\l�4��[2��݄ޕ/�vx�7��'CSC5�B��(_��Xv*����d����.h���H��!��N�k�K�B�^b�w*�[�:��J���di/�[�g��
+�R��}Mh)�Tt�3^�E�N/j�<�o�����?6�sPS1���1G���f��;����t�-x�\�]��� �b�-�=e�R�}K�+'
+���t�X��`ߤ����ޑ�^�}+�����7��p��S1�+���n�SAvY��}\Xm��Zm+.���j�˪o==d���-d��EN�����rO�.����v�)C.���s�](<n����B�AyY(=u�-T�����>|���>Ӆ�\b
+]'��S��桖���?�
+j���)�4.tg����}h<��Z9�qʾ)�#����<4.�Z�۔W�������w�xp�.�r�)��ӹ�z��F,#.4�Q_�.#.�o�W�˄�x�b��x�b
�N�z�cʅ�oZ��}\<�}5z�\ﴧ�.��;���xH3]��;o�`��'��p��ʳt9e.�YO3��\���)��c�#V�c_��9��y_��s.v�yOx,\����^�'��eA�y{��%���X>K��N�c"�c�c��ּ&z���:jL��8 �V�jª������$^�<Z8q����jB����m��l
+i�8�D[խ{֭䞲���|9��xg]#g\hi�$Ղ��&-hi�$͂��F��ii�'��jJ0��Okb5l"�CK'9��d�M��ii�$�MKv9)�4��-s�:� ��ۄ��61�d��.�_keyv*8qP�5�@C'~;z�����\��ECYx�:;EA�΅��}��Ftz*8�Z�o�i.��
+N<RԄ��;zFCW �4�7�GFCWyd4�7��CCEǧ�_��C˚`d"����d��-�@�"�u�,��x�e!�N-�����,$��`y��
+��:���g%���L�X��s�V�d�N����]W�d��c�T�'����X��?-�V_����e��cyמ7���z����2�,4�y����zw<��̀`y��$�:��r��iєycYǫl��U�1��:.�����ק�e���i�G#mb��yX��II@�W��N��z��p�FQGk}=�5�tPO�k�ɒ���˻0�܌xR��S�:͵�D7���XSD��hOƊjY:Sj=��D@���U'������V&`�q~ �]�gAmٌ��r�sF�]�g�W�2Ь�
+�� (�䙻�@i(dGAG�Te��̈́�)�&�^��Z/�`"���]u����OE�&EAs��������Bb�cҜ�?�Nz�۰<����@o��������6Ah{.�i
+��_>x^����v��L���>0��fh��ׯRC�����~ ��;��G{�'3�C<�)�9��u��iN4X/��5�w�UjZ��]�\mx���H�Wz�HF�W�$�B��t~z����ѯn����Ϸ��?PK���#��PK��w<����4:pollen.argoPK��w<����mpollen_Modèle.pgmlPK��w<�N�ŷ�@�pollen_Services.pgmlPK��w<9ܜ='�pollen_Diagrammedeclasses.pgmlPK��w<4�[-m�i#pollen.todoPK��w<7Rp:B$pollen_profile.profilePK��w<���#��
+�$pollen.xmiPK�aH
\ No newline at end of file
Modified: trunk/pollen-business/src/test/java/org/chorem/pollen/business/TestManager.java
===================================================================
--- trunk/pollen-business/src/test/java/org/chorem/pollen/business/TestManager.java 2010-03-23 15:39:36 UTC (rev 2956)
+++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/TestManager.java 2010-03-23 23:38:20 UTC (rev 2957)
@@ -69,7 +69,7 @@
}
public static TopiaContext beginTransaction() throws TopiaException {
- return getContext().getTopiaRootContext().beginTransaction();
+ return getContext().beginTransaction();
}
}
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-03-23 15:39:36 UTC (rev 2956)
+++ trunk/pom.xml 2010-03-23 23:38:20 UTC (rev 2957)
@@ -19,7 +19,6 @@
<modules>
<!-- <module>pollen-ui</module>-->
- <module>pollen-template</module>
<module>pollen-business</module>
<module>pollen-votecounting</module>
</modules>
1
0
Author: fdesbois
Date: 2010-03-23 16:39:36 +0100 (Tue, 23 Mar 2010)
New Revision: 2956
Log:
- Clean business module to begin 2.0 version
- Use a Transformer (in a module name pollen-template) to generate abstract services + context interfaces
Added:
trunk/pollen-business/src/main/java/org/chorem/pollen/PollenBusinessException.java
trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/PollenProperty.java
trunk/pollen-business/src/main/java/org/chorem/pollen/entity/
trunk/pollen-business/src/main/java/org/chorem/pollen/entity/PollImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/entity/VoteImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/service/
trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java
trunk/pollen-topia-template/
trunk/pollen-topia-template/LICENSE.txt
trunk/pollen-topia-template/README.txt
trunk/pollen-topia-template/changelog.txt
trunk/pollen-topia-template/pom.xml
trunk/pollen-topia-template/src/
trunk/pollen-topia-template/src/main/
trunk/pollen-topia-template/src/main/java/
trunk/pollen-topia-template/src/main/java/org/
trunk/pollen-topia-template/src/main/java/org/chorem/
trunk/pollen-topia-template/src/main/java/org/chorem/pollen/
trunk/pollen-topia-template/src/main/java/org/chorem/pollen/template/
trunk/pollen-topia-template/src/main/java/org/chorem/pollen/template/PollenContextImplementor.java
trunk/pollen-topia-template/src/main/java/org/chorem/pollen/template/PollenServiceTransformer.java
Removed:
trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenBusinessException.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenContextImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenContextImplementor.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenConverter.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenProperty.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/business/PreventRuleManager.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/business/package-info.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataChoiceConverter.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataConverter.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPersonListConverter.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollAccountConverter.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollConverter.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPreventRuleConverter.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataResultConverter.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataUserConverter.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVoteConverter.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVoteCountingConverter.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVotingListConverter.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/package-info.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/ChoiceDTO.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/CommentDTO.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PersonListDTO.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PollAccountDTO.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PollDTO.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PreventRuleDTO.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/ResultDTO.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/ResultListDTO.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/UserDTO.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/VoteDTO.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/VotingListDTO.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/package-info.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/migration/PollenMigrationCallbackHandler.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/migration/package-info.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/SendMail.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceAuth.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceAuthImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceChoice.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceChoiceImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceList.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceListImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePoll.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccount.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccountImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePreventRule.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePreventRuleImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceResults.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceResultsImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceUser.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceUserImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVote.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVoteImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/package-info.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/ContextUtil.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/MD5.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/MailUtil.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/PropertiesLoader.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/package-info.java
trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/ChoiceImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/ChoiceTypeImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/CommentImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PersonListImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PersonToListImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PollAccountImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PollImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PollTypeImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PreventRuleImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/ResultImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/UserAccountImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/VoteCountingImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/VoteImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/VoteToChoiceImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/VotingListImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/ChoiceImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/ChoiceTypeImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/CommentImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PersonListImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PersonToListImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PollAccountImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PollImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PollTypeImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PreventRuleImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/ResultImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/UserAccountImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/VoteCountingImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/VoteImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/VoteToChoiceImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/VotingListImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/ChoiceImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/ChoiceTypeImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/CommentImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PersonListImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PersonToListImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PollAccountImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PollImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PollTypeImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PreventRuleImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/ResultImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/UserAccountImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/VoteCountingImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/VoteImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/VoteToChoiceImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/VotingListImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/ChoiceImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/CommentImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PersonListImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PersonToListImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PollAccountImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PollImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PreventRuleImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/ResultImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/UserAccountImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/VoteImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/VoteToChoiceImpl.hbm.xml
trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/VotingListImpl.hbm.xml
trunk/pollen-business/src/test/java/org/chorem/pollen/business/business/PreventRuleManagerTest.java
trunk/pollen-business/src/test/java/org/chorem/pollen/business/scaling/ScalingVote.java
trunk/pollen-business/src/test/java/org/chorem/pollen/business/scaling/package-info.java
trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/SendMailTest.java
trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceAuthImplTest.java
trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceListImplTest.java
trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServicePollImplTest.java
trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServicePreventRuleImplTest.java
trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceUserImplTest.java
Modified:
trunk/pollen-business/pom.xml
trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenContext.java
trunk/pollen-business/src/main/xmi/pollen.properties
trunk/pollen-business/src/main/xmi/pollen.zargo
trunk/pollen-business/src/test/java/org/chorem/pollen/business/TestData.java
trunk/pollen-business/src/test/java/org/chorem/pollen/business/TestManager.java
trunk/pollen-votecounting/pom.xml
trunk/pom.xml
Modified: trunk/pollen-business/pom.xml
===================================================================
--- trunk/pollen-business/pom.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/pom.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.chorem</groupId>
<artifactId>pollen</artifactId>
- <version>1.3.0-SNAPSHOT</version>
+ <version>2.0-SNAPSHOT</version>
</parent>
<groupId>org.chorem.pollen</groupId>
@@ -19,6 +19,11 @@
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
+ <artifactId>pollen-template</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
<artifactId>pollen-votecounting</artifactId>
<version>${project.version}</version>
</dependency>
@@ -108,32 +113,33 @@
<!-- By default, generation from ObjectModel -->
<configuration>
<!-- Corresponding to extracted package from zargo file -->
- <fullPackagePath>org.chorem.pollen.business</fullPackagePath>
+ <fullPackagePath>org.chorem.pollen</fullPackagePath>
<!-- DefaultPackage used for DAOHelper generation -->
- <defaultPackage>org.chorem.pollen.business.persistence</defaultPackage>
+ <defaultPackage>org.chorem.pollen</defaultPackage>
<templates>
- org.nuiton.topia.generator.TopiaMetaTransformer
+ org.nuiton.topia.generator.TopiaMetaTransformer,
+ org.chorem.pollen.template.PollenServiceTransformer
</templates>
</configuration>
<goals>
<goal>smart-generate</goal>
</goals>
</execution>
- <execution>
+ <!--<execution>
<phase>generate-sources</phase>
<id>copy-mapping-files</id>
<configuration>
- <!-- Config for copyVersionFiles -->
+ Config for copyVersionFiles
<includes>**/*.objectmodel</includes>
<copyVersionDir>${project.basedir}/src/main/resources/oldmappings/pollen</copyVersionDir>
<copyVersionFiles>**/*.hbm.xml</copyVersionFiles>
- <!-- Warning : the overwrite is working for both goals -->
+ Warning : the overwrite is working for both goals
<overwrite>true</overwrite>
</configuration>
<goals>
<goal>copyVersionFiles</goal>
</goals>
- </execution>
+ </execution>-->
</executions>
</plugin>
<plugin>
Copied: trunk/pollen-business/src/main/java/org/chorem/pollen/PollenBusinessException.java (from rev 2951, trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenBusinessException.java)
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/PollenBusinessException.java (rev 0)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/PollenBusinessException.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -0,0 +1,51 @@
+
+package org.chorem.pollen;
+import static org.nuiton.i18n.I18n.n_;
+
+/**
+ * PollenBusinessException
+ *
+ * Created: 24 févr. 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class PollenBusinessException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ protected PollenExceptionType type;
+
+ protected Object[] args;
+
+ public PollenBusinessException(PollenExceptionType type) {
+ super(type.getMessage());
+ }
+
+ public PollenBusinessException(PollenExceptionType type, Object... args) {
+ super(type.getMessage());
+ this.args = args;
+ }
+
+ public enum PollenExceptionType {
+ //LOAD_CONFIGURATION(n_("pollen.exception.load_configuration")),
+ POLL_NOT_EXIST(n_("pollen.exception.poll_not_exist"));
+
+ private String message;
+
+ PollenExceptionType(String message) {
+ this.message = message;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+ }
+
+ public Object[] getArgs() {
+ return args;
+ }
+}
Property changes on: trunk/pollen-business/src/main/java/org/chorem/pollen/PollenBusinessException.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Added: svn:mergeinfo
+
Copied: trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java (from rev 2953, trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenContextImpl.java)
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java (rev 0)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/PollenContextImpl.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -0,0 +1,342 @@
+
+package org.chorem.pollen;
+
+import java.util.Date;
+import java.util.Properties;
+import java.util.UUID;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.pollen.business.PollenException;
+//import org.chorem.pollen.PollenDAOHelper;
+//import org.chorem.pollen.business.services.SendMail;
+//import org.chorem.pollen.business.services.ServiceUserImpl;
+import org.nuiton.i18n.I18n;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaContextFactory;
+import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.TopiaNotFoundException;
+import org.nuiton.util.ApplicationConfig;
+import org.nuiton.util.ArgumentsParserException;
+import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.n_;
+import org.nuiton.i18n.init.DefaultI18nInitializer;
+
+/**
+ * PollenContext
+ *
+ * Created: 24 févr. 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class PollenContextImpl implements PollenContextImplementor {
+
+ /** log. */
+ private static final Log log = LogFactory.getLog(PollenContextImpl.class);
+
+ public static final String DEFAULT_FILENAME = "pollen.properties";
+
+ private ApplicationConfig configuration;
+
+ private Date currentDate;
+
+// private SendMail sendMail;
+
+ /** Conversion service for services **/
+// private PollenConverter converter;
+
+ public PollenContextImpl() {
+
+ }
+
+ @Override
+ public void finalize() {
+ stop();
+ }
+
+ /**
+ * Default configuration file will be loaded using
+ * {@link org.nuiton.util.ApplicationConfig }.
+ * Then the other configuration initialization will be done in
+ * {@link #loadConfiguration(ApplicationConfig)} method.
+ */
+ private void loadDefaultConfiguration() {
+ try {
+ if (log.isInfoEnabled()) {
+ log.info("load default configuration from " +
+ PollenContextImpl.DEFAULT_FILENAME);
+ }
+ ApplicationConfig conf = new ApplicationConfig();
+ conf.setConfigFileName(PollenContextImpl.DEFAULT_FILENAME);
+ conf.parse(new String[]{});
+
+ conf.printConfig();
+
+ loadConfiguration(conf);
+ } catch (ArgumentsParserException eee) {
+ doCatch(eee, n_("pollen.error.context.parse"),
+ PollenContextImpl.DEFAULT_FILENAME);
+ }
+ }
+
+ /**
+ * Load the application configuration :
+ * <pre>
+ * - Add entities implementation classes for Topia-persistence
+ * - Add model version for Topia-migration-service
+ * </pre>
+ *
+ * @param conf ApplicationConfig
+ */
+ @Override
+ public void loadConfiguration(ApplicationConfig conf) {
+ configuration = conf;
+ configuration.setOption("topia.persistence.classes",
+ PollenDAOHelper.getImplementationClassesAsString());
+ configuration.setOption("topia.service.migration.version",
+ PollenDAOHelper.getModelVersion());
+ }
+
+ /**
+ * Start of the application. The application configuration will be loaded
+ * automatically if needed using {@link #loadDefaultConfiguration }. Also
+ * you can manually load the configuration using
+ * {@link #loadConfiguration(ApplicationConfig)}
+ * This start does :
+ * <pre>
+ * - Initialize i18n for error messages
+ * - Create default admin if needed (this will load the topiaRootContext).
+ * </pre>
+ *
+ */
+ @Override
+ public void start() {
+ try {
+ if (log.isInfoEnabled()) {
+ log.info("Start Pollen");
+ log.info("Initialize i18n bundle");
+ }
+ I18n.setInitializer(new DefaultI18nInitializer("pollen-business"));
+ I18n.init();
+
+// ServiceUserImpl serviceUser = new ServiceUserImpl(this);
+// serviceUser.createDefaultAdmin(
+// getProperty(PollenProperty.ADMIN_LOGIN),
+// getProperty(PollenProperty.ADMIN_PASSWORD),
+// getProperty(PollenProperty.ADMIN_EMAIL)
+// );
+//
+// sendMail = new SendMail(this);
+// sendMail.start();
+
+ if (log.isInfoEnabled()) {
+ log.info("pollen is started !");
+ }
+
+ } catch (Exception eee) {
+ doCatch(eee, n_("pollen.error.context.start"));
+ }
+ }
+
+ /**
+ * Stop the application. Close the Topia rootContext.
+ */
+ @Override
+ public void stop() {
+ try {
+ if (log.isDebugEnabled()) {
+ log.debug("Stop Pollen");
+ }
+ getTopiaRootContext().closeContext();
+// sendMail.stopExec();
+ } catch (Exception eee) {
+ doCatch(eee, n_("pollen.error.context.stop"));
+ }
+ }
+
+// @Override
+// public SendMail getSendMail() {
+// return sendMail;
+// }
+
+ /**
+ * Get a property from the configuration.
+ *
+ * @param property PollenProperty
+ * @return value of this property
+ */
+ @Override
+ public String getProperty(PollenProperty property) {
+ return getConfiguration().getOption(property.getKey());
+ }
+
+ /**
+ * Test if the property is defined in this context
+ *
+ * @param property PollenProperty
+ * @return value of this property
+ */
+ @Override
+ public boolean hasProperty(PollenProperty property) {
+ return !getProperty(property).equals("");
+ }
+
+ /**
+ * Get a property from the configuration.
+ *
+ * @param key of the property
+ * @return value of this property
+ */
+ public String getProperty(String key) {
+ return getConfiguration().getOption(key);
+ }
+
+ /**
+ * Get all properties from the configuration
+ *
+ * @return the Properties of the application
+ */
+ public Properties getProperties() {
+ return getConfiguration().getOptions();
+ }
+
+ /**
+ * Get the configuration of the application.
+ *
+ * @return the ApplicationConfig
+ */
+ @Override
+ public ApplicationConfig getConfiguration() {
+ if (configuration == null) {
+ loadDefaultConfiguration();
+ }
+ return configuration;
+ }
+
+ /**
+ * Get the Topia rootContext.
+ *
+ * @return the main TopiaContext needed to begin new transaction
+ */
+ @Override
+ public TopiaContext getTopiaRootContext() {
+ try {
+ return TopiaContextFactory.getContext(getProperties());
+ } catch (TopiaNotFoundException eee) {
+ doCatch(eee, n_("pollen.error.context.getRootContext"));
+ }
+ return null;
+ }
+
+// @Override
+// public PollenConverter getConverter() {
+// if (converter == null) {
+// converter = new PollenConverter();
+// }
+// return converter;
+// }
+
+ /**
+ * Manage exceptions. The {@code exception} will be embedded in a
+ * PollenException with the {@code message} provided.
+ * Used in catch statement in services.
+ *
+ * @param eee the exception to manage
+ * @param message the message to add to the new PollenException
+ * @param args for message
+ * @throws PollenException which contains the exception as the cause
+ */
+ @Override
+ public void doCatch(Exception eee, String message, Object... args)
+ throws PollenException {
+ doCatch(null, eee, message);
+ }
+
+ /**
+ * Manage exceptions. The {@code exception} will be embedded in a
+ * PollenException with the {@code message} provided. Also, the current
+ * {@code transaction} will be rollback.
+ * Used in catch statement in services.
+ *
+ * @param transaction the current TopiaContext
+ * @param eee the exception to manage
+ * @param message the message to add to the new PollenException
+ * @param args for message
+ */
+ @Override
+ public void doCatch(TopiaContext transaction, Exception eee, String message,
+ Object... args) throws PollenException {
+ if (log.isErrorEnabled()) {
+ log.error(_(message, args), eee);
+ }
+
+ // rollback de la transaction courante
+ if (transaction != null) {
+ try {
+ transaction.rollbackTransaction();
+ } catch (TopiaException ex) {
+ if (log.isErrorEnabled()) {
+ log.error(_("pollen.error.context.rollback"), ex);
+ }
+ }
+ }
+ // PollenBusinessException must be managed (catch and throw) when needed
+// if (! (eee instanceof PollenBusinessException)) {
+ throw new PollenException(eee, message, args);
+// }
+ }
+
+ /**
+ * Close current TopiaContext.
+ * Used in finally statement in services.
+ *
+ * @param transaction current TopiaContext
+ */
+ @Override
+ public void doFinally(TopiaContext transaction) {
+ if (transaction != null) {
+ try {
+ transaction.closeContext();
+ } catch (TopiaException eee) {
+ if (log.isErrorEnabled()) {
+ log.error(_("pollen.error.context.close"), eee);
+ }
+ }
+ }
+ }
+
+ /**
+ * Create an id to easily managed polls using urls.
+ *
+ * @return a fresh generated String
+ */
+ @Override
+ public String createPollenUrlId() {
+ return UUID.randomUUID().toString().replaceAll("-", "");
+ }
+
+// public void setCurrentDate(Date currentDate) {
+// PollenContextBusiness.currentDate = currentDate;
+// }
+
+ @Override
+ public Date getCurrentDate() {
+ if (currentDate == null) {
+ currentDate = new Date();
+ }
+ return currentDate;
+ }
+
+ /**
+ * Set the current date in context. Used for test
+ *
+ * @param currentDate to set in the context
+ */
+ public void setCurrentDate(Date currentDate) {
+ this.currentDate = currentDate;
+ }
+
+}
Copied: trunk/pollen-business/src/main/java/org/chorem/pollen/PollenProperty.java (from rev 2953, trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenProperty.java)
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/PollenProperty.java (rev 0)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/PollenProperty.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -0,0 +1,60 @@
+
+package org.chorem.pollen;
+
+/**
+ * PollenProp
+ *
+ * Created: 25 févr. 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public enum PollenProperty {
+ /** version of the application **/
+ APP_VERSION("version"),
+ /** url of the server **/
+ SERVER_URL("siteUrl"),
+ /** login for default admin **/
+ ADMIN_LOGIN("adminLogin"),
+ /** password for default admin **/
+ ADMIN_PASSWORD("adminPassword"),
+ /** email for default admin **/
+ ADMIN_EMAIL("adminEmail"),
+ /** email for contact link **/
+ CONTACT_EMAIL(ADMIN_EMAIL.getKey()),
+ /** host for email sending configuration **/
+ EMAIL_HOST("email_host"),
+ /** port for email sending configuration **/
+ EMAIL_PORT("email_port"),
+ /** from for email sending configuration **/
+ EMAIL_FROM("email_from"),
+ /** directory to store emails before sending them **/
+ EMAIL_DIR("pollen.emails.directory"),
+ /** path for feed directory **/
+ FEED_DIR("feedDir"),
+ /** path for uploaded images directory **/
+ IMG_DIR("upImgDir"),
+ /** nb votes to display per page **/
+ NB_VOTES_PER_PAGE("pollen.ui.nbVotesPerPage");
+
+ String key;
+
+ PollenProperty(String key) {
+ this.key = key;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+// public String getValue() {
+// return PollenContexImpl.getProperty(this);
+// }
+
+// public boolean hasValue() {
+// return !getValue().equals("");
+// }
+}
Property changes on: trunk/pollen-business/src/main/java/org/chorem/pollen/PollenProperty.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Added: svn:mergeinfo
+
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenBusinessException.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenBusinessException.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenBusinessException.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,52 +0,0 @@
-
-package org.chorem.pollen.business;
-import static org.nuiton.i18n.I18n._;
-import static org.nuiton.i18n.I18n.n_;
-
-/**
- * PollenBusinessException
- *
- * Created: 24 févr. 2010
- *
- * @author fdesbois
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
-public class PollenBusinessException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
- protected PollenExceptionType type;
-
- protected Object[] args;
-
- public PollenBusinessException(PollenExceptionType type) {
- super(type.getMessage());
- }
-
- public PollenBusinessException(PollenExceptionType type, Object... args) {
- super(type.getMessage());
- this.args = args;
- }
-
- public enum PollenExceptionType {
- //LOAD_CONFIGURATION(n_("pollen.exception.load_configuration")),
- POLL_NOT_EXIST(n_("pollen.exception.poll_not_exist"));
-
- private String message;
-
- PollenExceptionType(String message) {
- this.message = message;
- }
-
- public String getMessage() {
- return message;
- }
- }
-
- public Object[] getArgs() {
- return args;
- }
-}
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenContext.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenContext.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenContext.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,9 +1,9 @@
package org.chorem.pollen.business;
+import org.chorem.pollen.PollenProperty;
import java.util.Date;
-import java.util.Properties;
-import org.chorem.pollen.business.services.SendMail;
+//import org.chorem.pollen.business.services.SendMail;
import org.nuiton.util.ApplicationConfig;
/**
@@ -54,7 +54,7 @@
*
* @return the SendMail running thread
*/
- SendMail getSendMail();
+// SendMail getSendMail();
/**
* Get a property from the configuration.
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenContextImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenContextImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenContextImpl.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,342 +0,0 @@
-
-package org.chorem.pollen.business;
-
-import java.util.Date;
-import java.util.Properties;
-import java.util.UUID;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.business.services.SendMail;
-import org.chorem.pollen.business.services.ServiceUserImpl;
-import org.nuiton.i18n.I18n;
-import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.TopiaContextFactory;
-import org.nuiton.topia.TopiaException;
-import org.nuiton.topia.TopiaNotFoundException;
-import org.nuiton.util.ApplicationConfig;
-import org.nuiton.util.ArgumentsParserException;
-import static org.nuiton.i18n.I18n._;
-import static org.nuiton.i18n.I18n.n_;
-import org.nuiton.i18n.init.DefaultI18nInitializer;
-
-/**
- * PollenContext
- *
- * Created: 24 févr. 2010
- *
- * @author fdesbois
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
-public class PollenContextImpl implements PollenContextImplementor {
-
- /** log. */
- private static final Log log = LogFactory.getLog(PollenContextImpl.class);
-
- public static final String DEFAULT_FILENAME = "pollen.properties";
-
- private ApplicationConfig configuration;
-
- private Date currentDate;
-
- private SendMail sendMail;
-
- /** Conversion service for services **/
- private PollenConverter converter;
-
- public PollenContextImpl() {
-
- }
-
- @Override
- public void finalize() {
- stop();
- }
-
- /**
- * Default configuration file will be loaded using
- * {@link org.nuiton.util.ApplicationConfig }.
- * Then the other configuration initialization will be done in
- * {@link #loadConfiguration(ApplicationConfig)} method.
- */
- private void loadDefaultConfiguration() {
- try {
- if (log.isInfoEnabled()) {
- log.info("load default configuration from " +
- PollenContextImpl.DEFAULT_FILENAME);
- }
- ApplicationConfig conf = new ApplicationConfig();
- conf.setConfigFileName(PollenContextImpl.DEFAULT_FILENAME);
- conf.parse(new String[]{});
-
- conf.printConfig();
-
- loadConfiguration(conf);
- } catch (ArgumentsParserException eee) {
- doCatch(eee, n_("pollen.error.context.parse"),
- PollenContextImpl.DEFAULT_FILENAME);
- }
- }
-
- /**
- * Load the application configuration :
- * <pre>
- * - Add entities implementation classes for Topia-persistence
- * - Add model version for Topia-migration-service
- * </pre>
- *
- * @param conf ApplicationConfig
- */
- @Override
- public void loadConfiguration(ApplicationConfig conf) {
- configuration = conf;
- configuration.setOption("topia.persistence.classes",
- PollenModelDAOHelper.getImplementationClassesAsString());
- configuration.setOption("topia.service.migration.version",
- PollenModelDAOHelper.getModelVersion());
- }
-
- /**
- * Start of the application. The application configuration will be loaded
- * automatically if needed using {@link #loadDefaultConfiguration }. Also
- * you can manually load the configuration using
- * {@link #loadConfiguration(ApplicationConfig)}
- * This start does :
- * <pre>
- * - Initialize i18n for error messages
- * - Create default admin if needed (this will load the topiaRootContext).
- * </pre>
- *
- */
- @Override
- public void start() {
- try {
- if (log.isInfoEnabled()) {
- log.info("Start Pollen");
- log.info("Initialize i18n bundle");
- }
- I18n.setInitializer(new DefaultI18nInitializer("pollen-business"));
- I18n.init();
-
- ServiceUserImpl serviceUser = new ServiceUserImpl(this);
- serviceUser.createDefaultAdmin(
- getProperty(PollenProperty.ADMIN_LOGIN),
- getProperty(PollenProperty.ADMIN_PASSWORD),
- getProperty(PollenProperty.ADMIN_EMAIL)
- );
-
- sendMail = new SendMail(this);
- sendMail.start();
-
- if (log.isInfoEnabled()) {
- log.info("pollen is started !");
- }
-
- } catch (Exception eee) {
- doCatch(eee, n_("pollen.error.context.start"));
- }
- }
-
- /**
- * Stop the application. Close the Topia rootContext.
- */
- @Override
- public void stop() {
- try {
- if (log.isDebugEnabled()) {
- log.debug("Stop Pollen");
- }
- getRootContext().closeContext();
- sendMail.stopExec();
- } catch (Exception eee) {
- doCatch(eee, n_("pollen.error.context.stop"));
- }
- }
-
- @Override
- public SendMail getSendMail() {
- return sendMail;
- }
-
- /**
- * Get a property from the configuration.
- *
- * @param property PollenProperty
- * @return value of this property
- */
- @Override
- public String getProperty(PollenProperty property) {
- return getConfiguration().getOption(property.getKey());
- }
-
- /**
- * Test if the property is defined in this context
- *
- * @param property PollenProperty
- * @return value of this property
- */
- @Override
- public boolean hasProperty(PollenProperty property) {
- return !getProperty(property).equals("");
- }
-
- /**
- * Get a property from the configuration.
- *
- * @param key of the property
- * @return value of this property
- */
- public String getProperty(String key) {
- return getConfiguration().getOption(key);
- }
-
- /**
- * Get all properties from the configuration
- *
- * @return the Properties of the application
- */
- public Properties getProperties() {
- return getConfiguration().getOptions();
- }
-
- /**
- * Get the configuration of the application.
- *
- * @return the ApplicationConfig
- */
- @Override
- public ApplicationConfig getConfiguration() {
- if (configuration == null) {
- loadDefaultConfiguration();
- }
- return configuration;
- }
-
- /**
- * Get the Topia rootContext.
- *
- * @return the main TopiaContext needed to begin new transaction
- */
- @Override
- public TopiaContext getRootContext() {
- try {
- return TopiaContextFactory.getContext(getProperties());
- } catch (TopiaNotFoundException eee) {
- doCatch(eee, n_("pollen.error.context.getRootContext"));
- }
- return null;
- }
-
- @Override
- public PollenConverter getConverter() {
- if (converter == null) {
- converter = new PollenConverter();
- }
- return converter;
- }
-
- /**
- * Manage exceptions. The {@code exception} will be embedded in a
- * PollenException with the {@code message} provided.
- * Used in catch statement in services.
- *
- * @param eee the exception to manage
- * @param message the message to add to the new PollenException
- * @param args for message
- * @throws PollenException which contains the exception as the cause
- */
- @Override
- public void doCatch(Exception eee, String message, Object... args)
- throws PollenException {
- doCatch(null, eee, message);
- }
-
- /**
- * Manage exceptions. The {@code exception} will be embedded in a
- * PollenException with the {@code message} provided. Also, the current
- * {@code transaction} will be rollback.
- * Used in catch statement in services.
- *
- * @param transaction the current TopiaContext
- * @param eee the exception to manage
- * @param message the message to add to the new PollenException
- * @param args for message
- * @throws PollenException
- */
- @Override
- public void doCatch(TopiaContext transaction, Exception eee, String message,
- Object... args) throws PollenException {
- if (log.isErrorEnabled()) {
- log.error(_(message, args), eee);
- }
-
- // rollback de la transaction courante
- if (transaction != null) {
- try {
- transaction.rollbackTransaction();
- } catch (TopiaException ex) {
- if (log.isErrorEnabled()) {
- log.error(_("pollen.error.context.rollback"), ex);
- }
- }
- }
- // PollenBusinessException must be managed (catch and throw) when needed
-// if (! (eee instanceof PollenBusinessException)) {
- throw new PollenException(eee, message, args);
-// }
- }
-
- /**
- * Close current TopiaContext.
- * Used in finally statement in services.
- *
- * @param transaction current TopiaContext
- */
- @Override
- public void doFinally(TopiaContext transaction) {
- if (transaction != null) {
- try {
- transaction.closeContext();
- } catch (TopiaException eee) {
- if (log.isErrorEnabled()) {
- log.error(_("pollen.error.context.close"), eee);
- }
- }
- }
- }
-
- /**
- * Create an id to easily managed polls using urls.
- *
- * @return a fresh generated String
- */
- @Override
- public String createPollenUrlId() {
- return UUID.randomUUID().toString().replaceAll("-", "");
- }
-
-// public void setCurrentDate(Date currentDate) {
-// PollenContextBusiness.currentDate = currentDate;
-// }
-
- @Override
- public Date getCurrentDate() {
- if (currentDate == null) {
- currentDate = new Date();
- }
- return currentDate;
- }
-
- /**
- * Set the current date in context. Used for test
- *
- * @param currentDate to set in the context
- */
- public void setCurrentDate(Date currentDate) {
- this.currentDate = currentDate;
- }
-
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenContextImplementor.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenContextImplementor.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenContextImplementor.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,78 +0,0 @@
-
-package org.chorem.pollen.business;
-
-import org.nuiton.topia.TopiaContext;
-
-/**
- * PollenContextImplementor
- *
- * Created: 20 mars 2010
- *
- * @author fdesbois
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
-public interface PollenContextImplementor extends PollenContext {
-
- /**
- * Topia main context used to open new transaction.
- *
- * @return the topia root context
- */
- TopiaContext getRootContext();
-
- /**
- * Pollen converter used to convert entities to DTO.
- *
- * @return the current pollen converter
- */
- PollenConverter getConverter();
-
- /**
- * Manage exceptions. The {@code exception} will be embedded in a
- * PollenException with the {@code message} provided.
- * Used in catch statement in services.
- *
- * @param eee the exception to manage
- * @param message the message to add to the new PollenException
- * @param args for message
- * @throws PollenException which contains the exception as the cause
- */
- void doCatch(Exception eee, String message, Object... args)
- throws PollenException;
-
- /**
- * Manage exceptions. The {@code exception} will be embedded in a
- * PollenException with the {@code message} provided. Also, the current
- * {@code transaction} will be rollback.
- * Used in catch statement in services.
- *
- * @param transaction the current TopiaContext
- * @param eee the exception to manage
- * @param message the message to add to the new PollenException
- * @param args for message
- * @throws PollenException
- */
- void doCatch(TopiaContext transaction, Exception eee, String message,
- Object... args) throws PollenException;
-
- /**
- * Close current TopiaContext.
- * Used in finally statement in services.
- *
- * @param transaction current TopiaContext
- */
- void doFinally(TopiaContext transaction);
-
- /**
- * Create a unique UId for entities which need it (PollAccount, Poll).
- * This UId represent the entity in UI module.
- *
- * @return a new pollenUrlId (UId)
- */
- String createPollenUrlId();
-
-
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenConverter.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenConverter.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenConverter.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,312 +0,0 @@
-
-package org.chorem.pollen.business;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.dto.CommentDTO;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.dto.PreventRuleDTO;
-import org.chorem.pollen.business.dto.VoteDTO;
-import org.chorem.pollen.business.dto.VotingListDTO;
-import org.chorem.pollen.business.persistence.Choice;
-import org.chorem.pollen.business.persistence.Comment;
-import org.chorem.pollen.business.persistence.Poll;
-import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.business.persistence.PreventRule;
-import org.chorem.pollen.business.persistence.UserAccount;
-import org.chorem.pollen.business.persistence.Vote;
-import org.chorem.pollen.business.persistence.VoteToChoice;
-import org.chorem.pollen.business.persistence.VotingList;
-import org.chorem.pollen.common.ChoiceType;
-import org.chorem.pollen.common.PollType;
-import org.chorem.pollen.common.VoteCountingType;
-import org.chorem.pollen.votecounting.business.NumberMethod;
-import org.nuiton.topia.persistence.TopiaEntity;
-import org.nuiton.util.beans.BinderBuilder;
-import org.nuiton.util.beans.BinderProvider;
-
-/**
- * PollenConverter
- *
- * Created: 22 févr. 2010
- *
- * @author fdesbois
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
-public class PollenConverter {
-
- private static final Log log = LogFactory.getLog(PollenConverter.class);
-
- private BinderBuilder builder;
-
- private List<Class<? extends TopiaEntity>> prepareLoaded;
-
- public PollenConverter() {
- builder = new BinderBuilder();
- prepareLoaded = new ArrayList<Class<? extends TopiaEntity>>();
- }
-
- private final void prepare(Class<? extends TopiaEntity> entityClass,
- Class<?> dtoClass, String... properties) {
-
- if (prepareLoaded.contains(entityClass)) {
- return;
- }
-
- // Binder DTO -> Entity
- builder.createBinderModel(dtoClass, entityClass).
- addSimpleProperties(properties);
-
- BinderProvider.registerBinder(builder);
-
- // Binder Entity -> DTO
- builder.createBinderModel(entityClass, dtoClass).
- addSimpleProperties(properties);
- //builder.addProperty(TopiaEntity.TOPIA_ID, "id");
-
- BinderProvider.registerBinder(builder);
-
- prepareLoaded.add(entityClass);
- }
-
- public void preparePollConverters() {
- String[] properties = new String[] {
- Poll.TITLE,
- Poll.DESCRIPTION,
- Poll.BEGIN_CHOICE_DATE,
- Poll.END_CHOICE_DATE,
- Poll.BEGIN_DATE,
- Poll.END_DATE,
- Poll.CLOSED,
- Poll.ANONYMOUS,
- Poll.ANONYMOUS_VOTE_ALLOWED,
- Poll.PUBLIC_RESULTS,
- Poll.CONTINUOUS_RESULTS,
- Poll.CHOICE_ADD_ALLOWED,
- Poll.MAX_CHOICE_NB
- };
-
- prepare(Poll.class, PollDTO.class, properties);
- }
-
- public void prepareChoiceConverters() {
- String[] properties = new String[] {
- Choice.NAME,
- Choice.DESCRIPTION,
- Choice.VALIDATE
- };
-
- prepare(Choice.class, ChoiceDTO.class, properties);
- }
-
- public void prepareVotingListConverters() {
- String[] properties = new String[] {
- VotingList.NAME,
- VotingList.WEIGHT
- };
-
- prepare(VotingList.class, VotingListDTO.class, properties);
- }
-
- public void preparePollAccountConverters() {
- String[] properties = new String[] {
- PollAccount.VOTING_ID,
- PollAccount.EMAIL
- };
-
- prepare(PollAccount.class, PollAccountDTO.class, properties);
- }
-
- public void preparePreventRuleConverters() {
- String[] properties = new String[] {
- PreventRule.ACTIVE,
- PreventRule.METHOD,
- PreventRule.ONE_TIME,
- PreventRule.REPEATED,
- PreventRule.SCOPE,
- PreventRule.SENSIBILITY
- };
-
- prepare(PreventRule.class, PreventRuleDTO.class, properties);
- }
-
- public void prepareVoteConverters() {
- String[] properties = new String[] {
- Vote.WEIGHT,
- Vote.COMMENT,
- Vote.ANONYMOUS
- };
-
- prepare(Vote.class, VoteDTO.class, properties);
- }
-
- public void prepareCommentConverters() {
- String[] properties = new String[] {
- Comment.TEXT,
- Comment.POST_DATE,
- Comment.AUTHOR
- };
-
- prepare(Comment.class, CommentDTO.class, properties);
- }
-
- public Choice convert(ChoiceDTO dto, Choice entity) {
- BinderProvider.getBinder(
- ChoiceDTO.class, Choice.class).copy(dto, entity);
- return entity;
- }
-
- public ChoiceDTO convert(Choice entity, ChoiceDTO dto) {
- BinderProvider.getBinder(
- Choice.class, ChoiceDTO.class).copy(entity, dto);
- dto.setId(entity.getTopiaId());
- String name = entity.getName();
- dto.setHidden(name != null
- && name.startsWith(NumberMethod.HIDDEN_PREFIX));
- dto.setPollUId(entity.getPoll().getPollId());
- return dto;
- }
-
- public Poll convert(PollDTO dto, Poll entity) {
- BinderProvider.getBinder(PollDTO.class, Poll.class).copy(dto, entity);
- entity.setChoiceType(dto.getChoiceType().name());
- entity.setPollType(dto.getPollType().name());
- entity.setVoteCounting(dto.getVoteCounting().name());
- return entity;
- }
-
- public PollDTO convert(Poll entity, PollDTO dto) {
- BinderProvider.getBinder(Poll.class, PollDTO.class).copy(entity, dto);
- dto.setId(entity.getTopiaId());
- dto.setPollUId(entity.getPollId());
- dto.setChoiceType(ChoiceType.valueOf(entity.getChoiceType()));
- dto.setPollType(PollType.valueOf(entity.getPollType()));
- dto.setVoteCounting(VoteCountingType.valueOf(entity.getVoteCounting()));
-
- PollAccount creator = entity.getCreator();
- UserAccount user = creator.getUserAccount();
- dto.setCreatorId(creator.getTopiaId());
- dto.setCreatorName(creator.getVotingId());
- dto.setCreatorEmail(creator.getEmail());
- if (creator.getUserAccount() != null) {
- dto.setUserId(user.getTopiaId());
- }
- return dto;
- }
-
- public VotingList convert(VotingListDTO dto, VotingList entity) {
- BinderProvider.getBinder(
- VotingListDTO.class, VotingList.class).copy(dto, entity);
- return entity;
- }
-
- public VotingListDTO convert(VotingList entity, VotingListDTO dto) {
- BinderProvider.getBinder(
- VotingList.class, VotingListDTO.class).copy(entity, dto);
- dto.setId(entity.getTopiaId());
- return dto;
- }
-
- public PollAccount convert(PollAccountDTO dto, PollAccount entity) {
- BinderProvider.getBinder(
- PollAccountDTO.class, PollAccount.class).copy(dto, entity);
- return entity;
- }
-
- public PollAccountDTO convert(PollAccount entity, PollAccountDTO dto) {
- BinderProvider.getBinder(
- PollAccount.class, PollAccountDTO.class).copy(entity, dto);
- dto.setId(entity.getTopiaId());
- dto.setAccountUId(entity.getAccountId());
- return dto;
- }
-
- public PreventRule convert(PreventRuleDTO dto, PreventRule entity) {
- BinderProvider.getBinder(
- PreventRuleDTO.class, PreventRule.class).copy(dto, entity);
- return entity;
- }
-
- public PreventRuleDTO convert(PreventRule entity, PreventRuleDTO dto) {
- BinderProvider.getBinder(
- PreventRule.class, PreventRuleDTO.class).copy(entity, dto);
- dto.setId(entity.getTopiaId());
- Poll poll = entity.getPoll();
- dto.setPollId(poll.getTopiaId());
- return dto;
- }
-
- public Vote convert(VoteDTO dto, Vote entity) {
- BinderProvider.getBinder(VoteDTO.class, Vote.class).copy(dto, entity);
- return entity;
- }
-
- /**
- * Convert a Vote entity to a VoteDTO.
- * Add pollId in the DTO corresponding to the poll topiaId owner of the
- * vote. Add choices (ChoiceDTO) for vote values.
- * The user linked with the vote may be a votingList (group voteCounting)
- * or a pollAccount (other voteCounting type).
- *
- * @param entity Vote
- * @param dto VoteDTO
- * @return VoteDTO
- */
- public VoteDTO convert(Vote entity, VoteDTO dto) {
- BinderProvider.getBinder(Vote.class, VoteDTO.class).copy(entity, dto);
- dto.setId(entity.getTopiaId());
- Poll poll = entity.getPoll();
- dto.setPollId(poll.getTopiaId());
-
- // Set reference only if not anonymous
- //if (!entity.getAnonymous()) {
- PollAccount account = entity.getPollAccount();
- VotingList list = entity.getVotingList();
- // Set references
- // vote for a list
- if (list != null) {
- dto.setVotingListId(list.getTopiaId());
- // vote for a person (pollAccount)
- } else {/*if (account != null) { must have a pollaccount */
- //dto.setPollAccountId(account.getTopiaId());
- dto.setName(account.getVotingId());
-// if (account.getUserAccount() != null) {
-// dto.setUserId(account.getUserAccount().getTopiaId());
-// }
- }
- //}
-
- // Choices for voteValues
- for (VoteToChoice choice : entity.getChoiceVoteToChoice()) {
-// ChoiceDTO choiceDTO =
-// convert(choice.getChoice(), new ChoiceDTO());
-// choiceDTO.setValue(choice.getVoteValue());
-// dto.addChoice(choiceDTO);
- dto.setChoiceValue(choice.getChoice().getTopiaId(),
- choice.getVoteValue());
- }
- return dto;
- }
-
- public Comment convert(CommentDTO dto, Comment entity) {
- BinderProvider.getBinder(
- CommentDTO.class, Comment.class).copy(dto, entity);
- return entity;
- }
-
- public CommentDTO convert(Comment entity, CommentDTO dto) {
- BinderProvider.getBinder(
- Comment.class, CommentDTO.class).copy(entity, dto);
- dto.setId(entity.getTopiaId());
- return dto;
- }
-
-
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenProperty.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenProperty.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenProperty.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,60 +0,0 @@
-
-package org.chorem.pollen.business;
-
-/**
- * PollenProp
- *
- * Created: 25 févr. 2010
- *
- * @author fdesbois
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
-public enum PollenProperty {
- /** version of the application **/
- APP_VERSION("version"),
- /** url of the server **/
- SERVER_URL("siteUrl"),
- /** login for default admin **/
- ADMIN_LOGIN("adminLogin"),
- /** password for default admin **/
- ADMIN_PASSWORD("adminPassword"),
- /** email for default admin **/
- ADMIN_EMAIL("adminEmail"),
- /** email for contact link **/
- CONTACT_EMAIL(ADMIN_EMAIL.getKey()),
- /** host for email sending configuration **/
- EMAIL_HOST("email_host"),
- /** port for email sending configuration **/
- EMAIL_PORT("email_port"),
- /** from for email sending configuration **/
- EMAIL_FROM("email_from"),
- /** directory to store emails before sending them **/
- EMAIL_DIR("pollen.emails.directory"),
- /** path for feed directory **/
- FEED_DIR("feedDir"),
- /** path for uploaded images directory **/
- IMG_DIR("upImgDir"),
- /** nb votes to display per page **/
- NB_VOTES_PER_PAGE("pollen.ui.nbVotesPerPage");
-
- String key;
-
- PollenProperty(String key) {
- this.key = key;
- }
-
- public String getKey() {
- return key;
- }
-
-// public String getValue() {
-// return PollenContexImpl.getProperty(this);
-// }
-
-// public boolean hasValue() {
-// return !getValue().equals("");
-// }
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/business/PreventRuleManager.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/business/PreventRuleManager.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/business/PreventRuleManager.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,195 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.business;
-
-import java.lang.reflect.Method;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.dto.PreventRuleDTO;
-import org.chorem.pollen.business.utils.MailUtil;
-
-/**
- * Classe de gestion des règles de notification. Cette classe exécute des
- * méthodes en fonction de la règle définie.
- *
- * @author rannou
- * @version $Id$
- */
-public class PreventRuleManager {
-
- /** log. */
- private static final Log log = LogFactory.getLog(PreventRuleManager.class);
-
- /** Représente l'action qui ne fait rien. */
- public static final String NULL_ACTION = "nullAction";
- /** Représente l'action qui écrit sur la sortie standard. */
- public static final String PRINT_ACTION = "printAction";
- /** Représente l'action qui envoi un email de notification. */
- public static final String EMAIL_ACTION = "emailAction";
-
- private PreventRuleDTO preventRule = null;
-
- /**
- * Constructeur.
- *
- * @param preventRule règle à utiliser
- */
- public PreventRuleManager(PreventRuleDTO preventRule) {
- this.preventRule = preventRule;
- }
-
- /**
- * Exécution de la méthode définie par la règle. La méthode s'exécute sans
- * prise en compte de la sensibilité de la règle.
- */
- public boolean execute() {
- return execute(null, null, null);
- }
-
- /**
- * Exécution de la méthode définie par la règle. La méthode s'exécute si la
- * valeur correspond à la sensibilité de la règle.
- *
- * @param value valeur conditionnant l'exécution de la règle.
- */
- public boolean execute(Integer value) {
- return execute(null, value, null);
- }
-
- /**
- * Exécution de la méthode définie par la règle. La méthode s'exécute si la
- * portée est égale à la portée de la règle.
- *
- * @param scope portée de la règle.
- */
- public boolean execute(String scope) {
- return execute(scope, null, null);
- }
-
- /**
- * Exécution de la méthode définie par la règle. La méthode s'exécute si la
- * valeur correspond à la sensibilité de la règle et si la portée est égale
- * à la portée de la règle.
- *
- * @param scope portée de la règle.
- * @param value valeur conditionnant l'exécution de la règle.
- */
- public boolean execute(String scope, Integer value) {
- return execute(scope, value, null);
- }
-
- /**
- * Exécution de la méthode définie par la règle. La méthode s'exécute si la
- * valeur correspond à la sensibilité de la règle et si la portée est égale
- * à la portée de la règle.
- *
- * @param scope portée de la règle.
- * @param value valeur conditionnant l'exécution de la règle.
- * @param data données utiles pour l'exécution de la règle.
- * @return true si la méthode à été exécutée, false sinon.
- */
- public boolean execute(String scope, Integer value, Object data) {
-
- // Si la règle n'est pas active, on ne fait rien
- if (!preventRule.isActive()) {
- log.debug("Règle non active");
- return false;
- }
-
- // Si la règle est à exécution unique, on la désactive
- if (preventRule.isOneTime()) {
- log.debug("Règle à exécution unique : désactivation");
- preventRule.setActive(false);
- }
-
- // Si la règle est répétitive (exécution tous les n), on met à jour la valeur
- if (value != null && preventRule.isRepeated()
- && preventRule.getSensibility() != 0) {
- value = value % preventRule.getSensibility()
- + preventRule.getSensibility();
- }
-
- try {
- if ((value == null || value == preventRule.getSensibility())
- && (scope == null || scope.equals(preventRule.getScope()))) {
- if (log.isDebugEnabled()) {
- log.debug("méthod " + preventRule.getMethod() + "(scope : "
- + preventRule.getScope() + ", sensibility : "
- + preventRule.getSensibility() + ")");
- }
-
- Method method = this.getClass().getMethod(
- preventRule.getMethod(), Object.class);
- method.invoke(this, data);
- } else {
- return false;
- }
- } catch (Exception e) {
- log.error("Erreur lors de l'appel de la méthode "
- + preventRule.getMethod(), e);
- return false;
- }
- return true;
- }
-
- /**
- * Action qui ne fait rien.
- *
- * TODO set this method to protected
- */
- public static void nullAction(Object data) {
- // ne fait rien
- }
-
- /**
- * Action qui écrit sur la sortie standard.
- *
- * TODO set this method to protected
- */
- public static void printAction(Object data) {
- String message = "";
- if (data instanceof String) {
- message = (String) data;
- }
- System.out.println("printAction : " + message);
- }
-
- /**
- * Action qui envoi un email de notification.
- *
- * @param data mail data
- *
- * TODO set this method to protected
- */
- public static void emailAction(Object data) {
- Map<String, String> fields = null;
- if (data instanceof Map<?, ?>) {
- fields = (Map<String, String>) data;
- MailUtil.sendMail(fields.get("host"), Integer.parseInt(fields
- .get("port")), fields.get("from"), fields.get("to"), fields
- .get("title"), fields.get("msg"));
- }
- else {
- if (log.isWarnEnabled()) {
- log.warn("emailAction data parameter is not instance of Map");
- }
- }
-
- }
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/business/package-info.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/business/package-info.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/business/package-info.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,4 +0,0 @@
-/**
- * Classes métiers utiles pour l'application.
- */
-package org.chorem.pollen.business.business;
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataChoiceConverter.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataChoiceConverter.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataChoiceConverter.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,104 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.converters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.persistence.Choice;
-import org.chorem.pollen.business.persistence.Poll;
-import org.chorem.pollen.business.persistence.PollDAO;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.votecounting.business.NumberMethod;
-import org.nuiton.topia.TopiaException;
-
-/**
- * Gestion de la conversion des dtos Choice en entité et vice-versa.
- *
- * @author enema
- * @version $Id$
- */
-public class DataChoiceConverter extends DataConverter {
-
- /**
- * Création d'une entité choix à partir d'un dto choix.
- *
- * @param choiceDTO Le dto choix
- * @param eChoice L'entité choix
- * @deprecated use {@link org.chorem.pollen.business.PollenConverter}
- */
- @Deprecated
- public void populateChoiceEntity(ChoiceDTO choiceDTO, Choice eChoice)
- throws TopiaException {
- eChoice.setName(choiceDTO.getName());
- eChoice.setDescription(choiceDTO.getDescription());
- eChoice.setValidate(choiceDTO.isValidate());
-
- // Very bad, must create the choice on the poll not the inverse
- if (choiceDTO.getPollId().length() > 0) {
- PollDAO pollDAO = PollenModelDAOHelper
- .getPollDAO(super.transaction);
- Poll pollEntity = pollDAO.findByTopiaId(choiceDTO.getPollId());
- eChoice.setPoll(pollEntity);
- }
- }
-
- /**
- * Création d'un dto choix à partir d'une entité choix.
- *
- * @param eChoice L'entité choix
- * @return Le dto choix
- * @deprecated use {@link org.chorem.pollen.business.PollenConverter}
- */
- @Deprecated
- public ChoiceDTO createChoiceDTO(Choice eChoice) {
- ChoiceDTO choiceDTO = new ChoiceDTO();
- choiceDTO.setId(eChoice.getTopiaId());
- String eChoiceName = eChoice.getName();
- choiceDTO.setName(eChoiceName);
- choiceDTO.setHidden(eChoiceName != null
- && eChoiceName.startsWith(NumberMethod.HIDDEN_PREFIX));
- choiceDTO.setDescription(eChoice.getDescription());
- choiceDTO.setValidate(eChoice.getValidate());
-
- if (eChoice.getPoll() != null) {
- choiceDTO.setPollUId(eChoice.getPoll().getPollId());
- }
-
- return choiceDTO;
- }
-
- /**
- * Retourne une liste de dtos choix à partir d'une collection d'entités.
- *
- * @param cChoices Les entités choix
- * @return la liste des dtos choix
- * @deprecated use {@link ConverterHelper}
- */
- @Deprecated
- public List<ChoiceDTO> createChoiceDTOs(Collection<Choice> cChoices) {
- List<ChoiceDTO> results = new ArrayList<ChoiceDTO>();
- ChoiceDTO dto;
- for (Choice c : cChoices) {
- dto = this.createChoiceDTO(c);
- results.add(dto);
- }
- return results;
- }
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataConverter.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataConverter.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataConverter.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,54 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.converters;
-
-import org.nuiton.topia.TopiaContext;
-
-/**
- * Classe de base pour la conversion dto - entité.
- *
- * @author enema
- * @version $Id$
- */
-public class DataConverter {
- TopiaContext transaction = null;
-
- public DataConverter() {
-
- }
-
- public DataConverter(TopiaContext transaction) {
- this.transaction = transaction;
- }
-
- /**
- *
- * @param transaction le topiaContext
- */
- public void setTransaction(TopiaContext transaction) {
- this.transaction = transaction;
- }
-
- /**
- *
- * @return transaction topiaContext
- */
- public TopiaContext getTransaction() {
- return this.transaction;
- }
-
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPersonListConverter.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPersonListConverter.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPersonListConverter.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,98 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.converters;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.chorem.pollen.business.dto.PersonListDTO;
-import org.chorem.pollen.business.persistence.PersonList;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.business.persistence.UserAccount;
-import org.chorem.pollen.business.persistence.UserAccountDAO;
-import org.nuiton.topia.TopiaException;
-
-/**
- * Conversion des dtos PersonList en entités et vice-versa.
- *
- * @author tcicognani
- * @author rannou
- * @version $Id: DataPersonListConverter.java 2615 2009-07-01 13:47:45Z nrannou
- * $
- */
-public class DataPersonListConverter extends DataConverter {
-
- /**
- * Création d'une liste à partir d'un dto liste.
- *
- * @param ePersonList L'entité liste.
- * @param personListDTO le dto liste.
- */
- public void populatePersonListEntity(PersonListDTO personListDTO,
- PersonList ePersonList) throws TopiaException {
- ePersonList.setName(personListDTO.getName());
-
- if (personListDTO.getUserId().length() > 0) {
- UserAccountDAO userDAO = PollenModelDAOHelper
- .getUserAccountDAO(super.transaction);
- UserAccount userAccountEntity = userDAO.findByTopiaId(personListDTO
- .getUserId());
- ePersonList.setOwner(userAccountEntity);
- }
- }
-
- /**
- * Création d'un dto liste à partir d'une liste.
- *
- * @param ePersonList L'entité liste.
- * @return le dto liste.
- */
- public PersonListDTO createPersonListDTO(PersonList ePersonList) {
- PersonListDTO personListDTO = new PersonListDTO();
- personListDTO.setId(ePersonList.getTopiaId());
- personListDTO.setName(ePersonList.getName());
-
- if (ePersonList.getOwner() != null) {
- personListDTO.setUserId(ePersonList.getOwner().getTopiaId());
- }
- if (ePersonList.getPollAccount().size() > 0) {
- DataPollAccountConverter converter = new DataPollAccountConverter();
- personListDTO.setPollAccounts(converter
- .createPollAccountDTOs(ePersonList.getPollAccount()));
- }
-
- return personListDTO;
- }
-
- /**
- * Création d'une liste de dtos personList à partir d'une liste d'entité
- * personList.
- *
- * @param lPersonLists liste d'entités personList
- * @return la liste des dtos personList
- */
- public List<PersonListDTO> createPersonListDTOs(
- List<PersonList> lPersonLists) {
- ArrayList<PersonListDTO> results = new ArrayList<PersonListDTO>();
- PersonListDTO dto;
- for (PersonList l : lPersonLists) {
- dto = this.createPersonListDTO(l);
- results.add(dto);
- }
- return results;
- }
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollAccountConverter.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollAccountConverter.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollAccountConverter.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,160 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.converters;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.persistence.PersonList;
-import org.chorem.pollen.business.persistence.PersonListDAO;
-import org.chorem.pollen.business.persistence.PersonToList;
-import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.business.persistence.UserAccount;
-import org.chorem.pollen.business.persistence.UserAccountDAO;
-import org.nuiton.topia.TopiaException;
-
-/**
- * Gestion de la conversion des dtos pollAccount en entité et vice-versa.
- *
- * @author kmorin
- * @version $Id: DataPollAccountConverter.java 2652 2009-07-17 08:10:26Z nrannou
- * $
- */
-public class DataPollAccountConverter extends DataConverter {
-
- /**
- * Création d'un compte à partir d'un dto compte.
- *
- * @param pollAccountDTO le dto compte
- * @param ePollAccount l'entité compte
- * @throws TopiaException
- */
- public void populatePollAccountEntity(PollAccountDTO pollAccountDTO,
- PollAccount ePollAccount) throws TopiaException {
- //ePollAccount.setAccountId(pollAccountDTO.getAccountId());
- ePollAccount.setEmail(pollAccountDTO.getEmail());
- ePollAccount.setVotingId(pollAccountDTO.getVotingId());
-
- if (pollAccountDTO.getUserId().length() > 0) {
- UserAccountDAO userAccountDAO = PollenModelDAOHelper
- .getUserAccountDAO(super.transaction);
- UserAccount userAccountEntity = userAccountDAO
- .findByTopiaId(pollAccountDTO.getUserId());
- ePollAccount.setUserAccount(userAccountEntity);
- }
- if (pollAccountDTO.getPersonListId().length() > 0) {
- PersonListDAO personListDAO = PollenModelDAOHelper
- .getPersonListDAO(super.transaction);
- PersonList personListEntity = personListDAO
- .findByTopiaId(pollAccountDTO.getPersonListId());
- ePollAccount.setPersonList(personListEntity);
- }
-
- // Conversion des PersonToList
- if (ePollAccount.getVotingListPersonToList() != null) {
- for (PersonToList personToList : ePollAccount
- .getVotingListPersonToList()) {
- personToList.setWeight(pollAccountDTO.getWeight());
- personToList.setHasVoted(pollAccountDTO.isHasVoted());
- //votingLists
- }
- }
- }
-
- /**
- * Création d'un compte à partir de ses attributs.
- *
- * @param votingId le votingId
- * @param email l'email
- * @param ePollAccount l'entité compte
- * @throws TopiaException
- */
- public void populatePollAccountEntity(String votingId, String email,
- String userId, PollAccount ePollAccount) throws TopiaException {
- ePollAccount.setEmail(email);
- ePollAccount.setVotingId(votingId);
-
- if (userId != null && userId.length() > 0) {
- UserAccountDAO userAccountDAO = PollenModelDAOHelper
- .getUserAccountDAO(super.transaction);
- UserAccount userAccountEntity = userAccountDAO
- .findByTopiaId(userId);
- ePollAccount.setUserAccount(userAccountEntity);
- }
- }
-
- /**
- * Création d'un dto pollAccount à partir d'une entité.
- *
- * @param ePollAccount l'entité
- * @return le dto PollAccount
- */
- public PollAccountDTO createPollAccountDTO(PollAccount ePollAccount) {
- PollAccountDTO dto = new PollAccountDTO();
- dto.setId(ePollAccount.getTopiaId());
- dto.setAccountUId(ePollAccount.getAccountId());
- dto.setEmail(ePollAccount.getEmail());
- dto.setVotingId(ePollAccount.getVotingId());
-
- if (ePollAccount.getUserAccount() != null) {
- dto.setUserId(ePollAccount.getUserAccount().getTopiaId());
- }
- if (ePollAccount.getPersonList() != null) {
- dto.setPersonListId(ePollAccount.getPersonList().getTopiaId());
- }
-
- if (ePollAccount.getVote().size() > 0) {
- DataVoteConverter voteConverter = new DataVoteConverter();
- dto.setVoteDTOs(voteConverter
- .createVoteDTOs(ePollAccount.getVote()));
- }
-
- // Conversion des PersonToList
- if (ePollAccount.getVotingListPersonToList() != null) {
- //DataVotingListConverter votingListConverter = new DataVotingListConverter();
- for (PersonToList personToList : ePollAccount
- .getVotingListPersonToList()) {
- //VotingListDTO votingListDTO = votingListConverter.createVotingListDTO(personToList.getVotingList());
-
- dto.setWeight(personToList.getWeight());
- dto.setHasVoted(personToList.getHasVoted());
- //dto.setVotingListId(votingListDTO.getId());
- }
- }
-
- return dto;
- }
-
- /**
- * Retourne une liste de dtos pollAccount à partir d'une liste d'entités.
- *
- * @param lPollAccounts liste de entités pollAccount
- * @return la liste des dtos pollAccount
- */
- public List<PollAccountDTO> createPollAccountDTOs(
- List<PollAccount> lPollAccounts) {
- ArrayList<PollAccountDTO> results = new ArrayList<PollAccountDTO>();
- PollAccountDTO dto;
- for (PollAccount p : lPollAccounts) {
- dto = this.createPollAccountDTO(p);
- results.add(dto);
- }
- return results;
- }
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollConverter.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollConverter.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollConverter.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,219 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.converters;
-
-import org.chorem.pollen.business.PollenConverter;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.PollenBusinessException;
-import org.chorem.pollen.business.PollenContextImplementor;
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.dto.CommentDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.dto.PreventRuleDTO;
-import org.chorem.pollen.business.persistence.Choice;
-import org.chorem.pollen.business.persistence.Comment;
-import org.chorem.pollen.business.persistence.Poll;
-import org.chorem.pollen.business.persistence.PreventRule;
-import org.chorem.pollen.business.services.ServicePreventRule;
-import org.chorem.pollen.business.services.ServicePreventRuleImpl;
-import org.nuiton.topia.TopiaException;
-
-/**
- * Gestion de la conversion des dtos Poll en entité et vice-versa.
- *
- * @author enema
- * @version $Id$
- */
-public class DataPollConverter extends DataConverter {
- DataChoiceConverter choiceConverter = new DataChoiceConverter();
- DataVoteConverter voteConverter = new DataVoteConverter();
- DataPreventRuleConverter preventRuleConverter = new DataPreventRuleConverter();
- DataVotingListConverter votingListConverter = new DataVotingListConverter();
-
- /** log. */
- private static final Log log = LogFactory.getLog(DataPollConverter.class);
-
- /**
- * Création d'un dto sondage à partir d'une entité.
- *
- * @param ePoll l'entité sondage
- * @return le dto sondage
- * @deprecated use {@link ConverterHelper}
- */
- @Deprecated
- public PollDTO createPollDTO(Poll ePoll, PollenConverter converter) {
- PollDTO pollDTO = converter.convert(ePoll, new PollDTO());
-
-// pollDTO.setId(ePoll.getTopiaId());
-// pollDTO.setPollId(ePoll.getPollId());
-// pollDTO.setTitle(ePoll.getTitle());
-// pollDTO.setDescription(ePoll.getDescription());
-// pollDTO.setBeginChoiceDate(ePoll.getBeginChoiceDate());
-// pollDTO.setEndChoiceDate(ePoll.getEndChoiceDate());
-// pollDTO.setBeginDate(ePoll.getBeginDate());
-// pollDTO.setEndDate(ePoll.getEndDate());
-// pollDTO.setAnonymous(ePoll.getAnonymous());
-// pollDTO.setAnonymousVoteAllowed(ePoll.getAnonymousVoteAllowed());
-// pollDTO.setPublicResults(ePoll.getPublicResults());
-// pollDTO.setContinuousResults(ePoll.getContinuousResults());
-// pollDTO.setChoiceAddAllowed(ePoll.getChoiceAddAllowed());
-// pollDTO.setClosed(ePoll.getClosed());
-// pollDTO.setMaxChoiceNb(ePoll.getMaxChoiceNb());
-// pollDTO.setChoiceType(EnumController.getChoiceType(ePoll));
-// pollDTO.setPollType(EnumController.getPollType(ePoll));
-// pollDTO.setVoteCounting(EnumController.getVoteCountingType(ePoll));
-
- if (ePoll.getCreator() != null) {
- pollDTO.setCreatorId(ePoll.getCreator().getTopiaId());
- pollDTO.setCreatorEmail(ePoll.getCreator().getEmail());
- }
- if (ePoll.getChoice().size() > 0) {
- pollDTO.setChoices(choiceConverter.createChoiceDTOs(ePoll
- .getChoice()));
- }
-// if (ePoll.getVote().size() > 0) {
-// pollDTO.setVoteDTOs(voteConverter.createVoteDTOs(ePoll.getVote()));
-// }
- for (Comment comment : ePoll.getComment()) {
- CommentDTO dto =
- converter.convert(comment, new CommentDTO());
- pollDTO.addComment(dto);
- }
-// if (ePoll.getComment().size() > 0) {
-// pollDTO.setComments(commentConverter.createCommentDTOs(ePoll
-// .getComment()));
-// }
- if (ePoll.getPreventRule().size() > 0) {
- pollDTO.setPreventRuleDTOs(preventRuleConverter
- .createPreventRuleDTOs(ePoll.getPreventRule()));
- }
- if (ePoll.getVotingList().size() > 0) {
- pollDTO.setVotingListDTOs(votingListConverter
- .createVotingListDTOs(ePoll.getVotingList()));
- }
-
- return pollDTO;
- }
-
- /**
- * Retourne une liste de dtos sondage à partir d'une liste d'entités.
- *
- * @param lPolls liste de entités sondages
- * @param converter
- * @return la liste des dtos sondages
- * @deprecated use {@link ConverterHelper}
- */
- @Deprecated
- public List<PollDTO> createPollDTOs(List<Poll> lPolls, PollenConverter converter) {
- ArrayList<PollDTO> results = new ArrayList<PollDTO>();
- PollDTO dto;
- for (Poll p : lPolls) {
- dto = this.createPollDTO(p, converter);
- results.add(dto);
- }
- return results;
- }
-
-// /**
-// * Persistance des choix d'une entité sondage à partir d'un DTO.
-// *
-// * @param pollDTO le dto sondage
-// * @param ePoll l'entité sondage
-// * @deprecated use dao managment instead
-// */
-// @Deprecated
-// public void persistChoices(PollDTO pollDTO, Poll ePoll, PollenContextImplementor context)
-// throws TopiaException, PollenBusinessException {
-//
-// // mise à jour ou création des choix
-// ServiceChoice sChoice = new ServiceChoiceImpl(context);
-// for (ChoiceDTO choiceDTO : pollDTO.getChoices()) {
-// boolean updated = sChoice.updateChoice(choiceDTO);
-// if (!updated) {
-// choiceDTO.setId(sChoice.createChoice(choiceDTO));
-// }
-//
-// if (log.isDebugEnabled()) {
-// log.debug("Choice " + choiceDTO.getName() + " ("
-// + choiceDTO.getId() + ") updated: " + updated);
-// }
-// }
-//
-// // suppression des choix
-// boolean validChoice = false;
-// Iterator<Choice> itChoice = ePoll.getChoice().iterator();
-// while (itChoice.hasNext()) {
-// Choice currentChoice = itChoice.next();
-// for (ChoiceDTO choiceDTO : pollDTO.getChoices()) {
-// if (currentChoice.getTopiaId().equals(choiceDTO.getId())) {
-// validChoice = true;
-// }
-// }
-// if (!validChoice) {
-// sChoice.deleteChoice(currentChoice.getTopiaId());
-// }
-// validChoice = false;
-// }
-// }
-
- /**
- * Persistance des règles de notification d'une entité sondage à partir d'un
- * DTO.
- *
- * @param pollDTO le dto sondage
- * @param ePoll l'entité sondage
- */
- public void persistPreventRules(PollDTO pollDTO, Poll ePoll, PollenContextImplementor context)
- throws TopiaException, PollenBusinessException {
-
- // mise à jour ou création des règles de notification
- ServicePreventRule sPreventRule = new ServicePreventRuleImpl(context);
- for (PreventRuleDTO preventRuleDTO : pollDTO.getPreventRuleDTOs()) {
- boolean updated = sPreventRule.updatePreventRule(preventRuleDTO);
- if (!updated) {
- preventRuleDTO.setId(sPreventRule
- .createPreventRule(preventRuleDTO));
- }
-
- if (log.isDebugEnabled()) {
- log.debug("PreventRule (" + preventRuleDTO.getId()
- + ") updated: " + updated);
- }
- }
-
- // suppression des règles de notification
- boolean validRule = false;
- Iterator<PreventRule> it = ePoll.getPreventRule().iterator();
- while (it.hasNext()) {
- PreventRule currentRule = it.next();
- for (PreventRuleDTO preventRuleDTO : pollDTO.getPreventRuleDTOs()) {
- if (currentRule.getTopiaId().equals(preventRuleDTO.getId())) {
- validRule = true;
- }
- }
- if (!validRule) {
- sPreventRule.deletePreventRule(currentRule.getTopiaId());
- }
- validRule = false;
- }
- }
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPreventRuleConverter.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPreventRuleConverter.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPreventRuleConverter.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,105 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.converters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.chorem.pollen.business.dto.PreventRuleDTO;
-import org.chorem.pollen.business.persistence.Poll;
-import org.chorem.pollen.business.persistence.PollDAO;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.business.persistence.PreventRule;
-import org.nuiton.topia.TopiaException;
-
-/**
- * Gestion de la conversion des dtos règle en entité et vice-versa.
- *
- * @author rannou
- * @version $Id: DataPreventRuleConverter.java 2615 2009-07-01 13:47:45Z nrannou
- * $
- */
-public class DataPreventRuleConverter extends DataConverter {
-
- /**
- * Création d'une entité à partir d'un dto règle.
- *
- * @param preventRuleDTO le dto de la règle
- * @param ePreventRule l'entité de la règle
- */
- public void populatePreventRuleEntity(PreventRuleDTO preventRuleDTO,
- PreventRule ePreventRule) throws TopiaException {
- ePreventRule.setScope(preventRuleDTO.getScope());
- ePreventRule.setSensibility(preventRuleDTO.getSensibility());
- ePreventRule.setActive(preventRuleDTO.isActive());
- ePreventRule.setOneTime(preventRuleDTO.isOneTime());
- ePreventRule.setRepeated(preventRuleDTO.isRepeated());
- ePreventRule.setMethod(preventRuleDTO.getMethod());
-
- if (preventRuleDTO.getPollId().length() > 0) {
- PollDAO pollDAO = PollenModelDAOHelper
- .getPollDAO(super.transaction);
- Poll pollEntity = pollDAO.findByTopiaId(preventRuleDTO.getPollId());
- ePreventRule.setPoll(pollEntity);
- }
- }
-
- /**
- * Création d'un dto à partir d'une entité règle.
- *
- * @param preventRule l'entité de la règle
- * @return Le dto règle créé *
- * @deprecated use {@link ConverterHelper}
- */
- @Deprecated
- public PreventRuleDTO createPreventRuleDTO(PreventRule preventRule) {
- PreventRuleDTO preventRuleDTO = new PreventRuleDTO();
- preventRuleDTO.setId(preventRule.getTopiaId());
- preventRuleDTO.setScope(preventRule.getScope());
- preventRuleDTO.setSensibility(preventRule.getSensibility());
- preventRuleDTO.setActive(preventRule.getActive());
- preventRuleDTO.setOneTime(preventRule.getOneTime());
- preventRuleDTO.setRepeated(preventRule.getRepeated());
- preventRuleDTO.setMethod(preventRule.getMethod());
-
- if (preventRule.getPoll() != null) {
- preventRuleDTO.setPollId(preventRule.getPoll().getTopiaId());
- }
-
- return preventRuleDTO;
- }
-
- /**
- * Retourne une liste de dtos règle à partir d'une collection d'entités.
- *
- * @param cPreventRules collection des entités règle
- * @return la liste des dtos règle
- * @deprecated use {@link ConverterHelper}
- */
- @Deprecated
- public List<PreventRuleDTO> createPreventRuleDTOs(
- Collection<PreventRule> cPreventRules) {
- List<PreventRuleDTO> results = new ArrayList<PreventRuleDTO>();
- PreventRuleDTO dto;
- for (PreventRule r : cPreventRules) {
- dto = this.createPreventRuleDTO(r);
- results.add(dto);
- }
- return results;
- }
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataResultConverter.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataResultConverter.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataResultConverter.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,107 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.converters;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.chorem.pollen.business.dto.ResultDTO;
-import org.chorem.pollen.business.persistence.Choice;
-import org.chorem.pollen.business.persistence.ChoiceDAO;
-import org.chorem.pollen.business.persistence.Poll;
-import org.chorem.pollen.business.persistence.PollDAO;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.business.persistence.Result;
-import org.chorem.pollen.business.persistence.ResultDAO;
-import org.chorem.pollen.common.ChoiceType;
-import org.chorem.pollen.common.VoteCountingType;
-import org.chorem.pollen.votecounting.business.NumberMethod;
-import org.chorem.pollen.votecounting.dto.ChoiceDTO;
-import org.chorem.pollen.votecounting.dto.VoteCountingResultDTO;
-import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.TopiaException;
-
-/**
- * Gestion de la conversion des dtos en entité pour les résultats.
- *
- * @author fdesbois
- * @version $Id$
- */
-public class DataResultConverter extends DataConverter {
-
- public DataResultConverter(TopiaContext transaction) {
- super(transaction);
- }
-
- /**
- * Création des résultats de sondage à partir d'un dto de résultats de
- * sondage.
- *
- * @param dto le dto des résultats de sondage.
- */
- public void populateResultEntities(VoteCountingResultDTO dto)
- throws TopiaException {
- for (ChoiceDTO choice : dto.getChoices()) {
- //if (choice.isResult) {
- ResultDAO daoResult = PollenModelDAOHelper.getResultDAO(transaction);
- Result eResult = daoResult.create();
-
- ChoiceDAO daoChoice = PollenModelDAOHelper.getChoiceDAO(transaction);
- Choice eChoice = daoChoice.findByTopiaId(choice.getIdChoice());
-
- PollDAO daoPoll = PollenModelDAOHelper.getPollDAO(transaction);
- Poll ePoll = daoPoll.findByPollId(dto.getIdPoll());
- ePoll.addResult(eResult);
-
- eResult.setName(eChoice.getName());
- eResult.setByGroup(dto.isByGroup());
- eResult.setPoll(ePoll);
- eResult.setResultValue(String.valueOf(choice.getValue()));
-
-// EnumController enumCtrl = new EnumController(transaction);
-// enumCtrl.setVoteCounting(dto.getTypeVoteCounting(), eResult);
- eResult.setVoteCounting(dto.getTypeVoteCounting().name());
- //}
- }
- }
-
- /**
- * Retourne la liste des résultats d'un sondage sous forme de DTOs.
- *
- * @param ePoll le sondage (entitée Poll)
- * @return la liste des DTO Result
- */
- public List<ResultDTO> createResultDTOs(Poll ePoll) {
- List<ResultDTO> results = new ArrayList<ResultDTO>();
- for (Result res : ePoll.getResult()) {
- ResultDTO dto = new ResultDTO();
- dto.setId(res.getTopiaId());
- dto.setPollId(ePoll.getPollId());
- String resName = res.getName();
- dto.setName(resName);
- dto.setHidden(resName != null &&
- resName.startsWith(NumberMethod.HIDDEN_PREFIX));
- dto.setValue(res.getResultValue());
- dto.setByGroup(res.getByGroup());
- dto.setChoiceType(ChoiceType.valueOf(ePoll.getChoiceType()));
- dto.setVoteCounting(VoteCountingType.valueOf(ePoll.getVoteCounting()));
- results.add(dto);
- }
- return results;
- }
-
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataUserConverter.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataUserConverter.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataUserConverter.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,98 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.converters;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.persistence.UserAccount;
-
-/**
- * Gestion de la conversion des dtos User en entité et vice-versa.
- *
- * @author enema
- * @version $Id$
- */
-public class DataUserConverter extends DataConverter {
-
- /**
- * Création d'une entité utilisateur à partir d'un dto utilisateur.
- *
- * @param userDTO Le dto utilisateur
- * @param eUser L'entité utilisateur
- */
- public void populateUserEntity(UserDTO userDTO, UserAccount eUser,
- String password) {
- eUser.setLogin(userDTO.getLogin());
- eUser.setEmail(userDTO.getEmail());
- eUser.setFirstName(userDTO.getFirstName());
- eUser.setLastName(userDTO.getLastName());
- eUser.setLanguage(userDTO.getLanguage());
- eUser.setAdministrator(userDTO.isAdministrator());
- eUser.setPassword(password);
- }
-
- /**
- * Mise à jour d'un utilisateur à partir d'un dto utilisateur.
- *
- * @param userDTO Le dto utilisateur
- * @param eUser l'entité utilisateur
- */
- public void populateUserEntity(UserDTO userDTO, UserAccount eUser) {
- eUser.setEmail(userDTO.getEmail());
- eUser.setFirstName(userDTO.getFirstName());
- eUser.setLastName(userDTO.getLastName());
- eUser.setLanguage(userDTO.getLanguage());
- eUser.setAdministrator(userDTO.isAdministrator());
- }
-
- /**
- * Création d'un DTO utilisateur à partir d'une entité utilisateur.
- *
- * @param eUser L'entité utilisateur
- * @return Le DTO utilisateur
- */
- public UserDTO createUserDTO(UserAccount eUser) {
- UserDTO userDTO = new UserDTO();
- userDTO.setId(eUser.getTopiaId());
- userDTO.setLogin(eUser.getLogin());
- userDTO.setEmail(eUser.getEmail());
- userDTO.setFirstName(eUser.getFirstName());
- userDTO.setLastName(eUser.getLastName());
- userDTO.setLanguage(eUser.getLanguage());
- userDTO.setAdministrator(eUser.getAdministrator());
- return userDTO;
- }
-
- /**
- * retourne une liste de dtos des utilisateurs à partir d'une liste
- * d'entité.
- *
- * @param lUsers Liste de entités utilisateur
- * @return la liste des dtos utilisateurs
- */
- public List<UserDTO> createUserDTOs(List<UserAccount> lUsers) {
- ArrayList<UserDTO> results = new ArrayList<UserDTO>();
- UserDTO dto;
- for (UserAccount u : lUsers) {
- dto = this.createUserDTO(u);
- results.add(dto);
- }
- return results;
- }
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVoteConverter.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVoteConverter.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVoteConverter.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,231 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.converters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import java.util.Map;
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.dto.VoteDTO;
-import org.chorem.pollen.business.persistence.Choice;
-import org.chorem.pollen.business.persistence.ChoiceDAO;
-import org.chorem.pollen.business.persistence.Poll;
-import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.business.persistence.PollAccountDAO;
-import org.chorem.pollen.business.persistence.PollDAO;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.business.persistence.UserAccount;
-import org.chorem.pollen.business.persistence.Vote;
-import org.chorem.pollen.business.persistence.VoteDAO;
-import org.chorem.pollen.business.persistence.VoteToChoice;
-import org.chorem.pollen.business.persistence.VoteToChoiceDAO;
-import org.chorem.pollen.business.persistence.VotingList;
-import org.chorem.pollen.business.persistence.VotingListDAO;
-import org.nuiton.topia.TopiaException;
-
-/**
- * Gestion de la conversion des dtos Vote en entité et vice-versa.
- *
- * @version $Id$
- */
-public class DataVoteConverter extends DataConverter {
-
- /**
- * Création d'une entité vote à partir d'un dto vote.
- *
- * @param voteDTO Le dto vote.
- * @param eVote L'entité vote.
- */
- public void populateVoteEntity(VoteDTO voteDTO, Vote eVote)
- throws TopiaException {
- eVote.setWeight(voteDTO.getWeight());
- eVote.setComment(voteDTO.getComment());
- eVote.setAnonymous(voteDTO.isAnonymous());
-
- if (voteDTO.getPollId() != null) {
- PollDAO pollDAO = PollenModelDAOHelper.getPollDAO(transaction);
- Poll pollEntity = pollDAO.findByTopiaId(voteDTO.getPollId());
- pollEntity.addVote(eVote); // Rajout du vote au sondage
- eVote.setPoll(pollEntity);
- }
- if (voteDTO.getPollAccountId() != null) {
- PollAccountDAO pollAccountDAO = PollenModelDAOHelper
- .getPollAccountDAO(super.transaction);
- PollAccount pollAccountEntity = pollAccountDAO
- .findByTopiaId(voteDTO.getPollAccountId());
- eVote.setPollAccount(pollAccountEntity);
- }
- if (voteDTO.getVotingListId() != null) {
- VotingListDAO votingListDAO = PollenModelDAOHelper
- .getVotingListDAO(super.transaction);
- VotingList votingListEntity = votingListDAO.findByTopiaId(voteDTO
- .getVotingListId());
- eVote.setVotingList(votingListEntity);
- }
- }
-
- /**
- * Création d'un dto vote à partir d'une entité vote.
- *
- * @param eVote L'entité vote
- * @return Le dto vote
- * @deprecated use {@link ConverterHelper}
- */
- @Deprecated
- public VoteDTO createVoteDTO(Vote eVote) {
- VoteDTO voteDTO = new VoteDTO();
- voteDTO.setId(eVote.getTopiaId());
- voteDTO.setWeight(eVote.getWeight());
- voteDTO.setComment(eVote.getComment());
- voteDTO.setAnonymous(eVote.getAnonymous());
-
- if (eVote.getPoll() != null) {
- voteDTO.setPollId(eVote.getPoll().getTopiaId());
- }
- if (eVote.getPollAccount() != null) {
- voteDTO.setPollAccountId(eVote.getPollAccount().getTopiaId());
- voteDTO.setName(eVote.getPollAccount().getVotingId());
- UserAccount user = eVote.getPollAccount().getUserAccount();
- if (user != null) {
- voteDTO.setUserId(user.getTopiaId());
- }
- }
- if (eVote.getVotingList() != null) {
- voteDTO.setVotingListId(eVote.getVotingList().getTopiaId());
- }
-
- // Conversion des VoteToChoice
- if (eVote.getChoiceVoteToChoice() != null) {
- DataChoiceConverter choiceConverter = new DataChoiceConverter();
- for (VoteToChoice voteToChoice : eVote.getChoiceVoteToChoice()) {
- Choice choice = voteToChoice.getChoice();
- if (choice != null) {
-// ChoiceDTO choiceDTO = choiceConverter
-// .createChoiceDTO(voteToChoice.getChoice());
-// choiceDTO.setValue(voteToChoice.getVoteValue());
-// voteDTO.getChoiceDTOs().add(choiceDTO);
- voteDTO.setChoiceValue(choice.getTopiaId(),
- voteToChoice.getVoteValue());
- }
- }
- }
-
- return voteDTO;
- }
-
- /**
- * Retourne une liste de dtos vote à partir d'une collection d'entités.
- *
- * @param cVotes collection des entités vote
- * @return la liste des dtos vote
- * @deprecated use {@link ConverterHelper}
- */
- @Deprecated
- public List<VoteDTO> createVoteDTOs(Collection<Vote> cVotes) {
- List<VoteDTO> results = new ArrayList<VoteDTO>();
- VoteDTO dto;
- for (Vote v : cVotes) {
- dto = this.createVoteDTO(v);
- results.add(dto);
- }
- return results;
- }
-
- /**
- * Mise à jour des VoteToChoice d'une entité vote à partir d'un dto vote.
- *
- * @param voteDTO Le dto vote.
- * @param eVote L'entité vote.
- * @throws TopiaException
- * @deprecated must copy this code in serviceVote
- */
- @Deprecated
- public void populateChoiceVote(VoteDTO voteDTO, Vote eVote)
- throws TopiaException {
-//
-// for (ChoiceDTO choiceDTO : voteDTO.getChoiceDTOs()) {
-// choiceDTO.setVoteId(eVote.getTopiaId());
-// }
-//
-// eVote.setChoiceVoteToChoice(this.getVoteToChoices(voteDTO
-// .getChoiceDTOs()));
-
- VoteToChoiceDAO dao =
- PollenModelDAOHelper.getVoteToChoiceDAO(super.transaction);
-
- ChoiceDAO choiceDAO = PollenModelDAOHelper.getChoiceDAO(super.transaction);
-
- for (Map.Entry<String, Integer> choiceValue :
- voteDTO.getChoiceValues().entrySet()) {
-
- // Find existing choice
- Choice choice = choiceDAO.findByTopiaId(choiceValue.getKey());
-
- // Find existing vote
- VoteToChoice voteToChoice = dao.findByProperties(
- VoteToChoice.CHOICE, choice,
- VoteToChoice.VOTE, eVote);
-
- // Create new vote if needed
- if (voteToChoice == null) {
- voteToChoice = dao.create(
- VoteToChoice.CHOICE, choice,
- VoteToChoice.VOTE, eVote);
- }
- // Update vote value
- voteToChoice.setVoteValue(choiceValue.getValue());
- }
-
- }
-
- /**
- * Retourne la liste des VoteToChoice à partir d'une liste de dtos choix.
- *
- * @param choiceDTOs La liste des dtos choix
- * @return la liste d'entités VoteToChoice
- */
- @Deprecated
- private List<VoteToChoice> getVoteToChoices(List<ChoiceDTO> choiceDTOs)
- throws TopiaException {
- List<VoteToChoice> liste = new ArrayList<VoteToChoice>();
-
- for (ChoiceDTO choice : choiceDTOs) {
- VoteToChoiceDAO voteToChoiceDAO = PollenModelDAOHelper
- .getVoteToChoiceDAO(super.transaction);
- VoteToChoice voteToChoice = voteToChoiceDAO.create();
- voteToChoice.setVoteValue(choice.getValue());
-
- // Ajout du vote
- VoteDAO voteDAO = PollenModelDAOHelper
- .getVoteDAO(super.transaction);
- Vote voteEntity = voteDAO.findByTopiaId(choice.getVoteId());
- voteToChoice.setVote(voteEntity);
-
- // Ajout choix
- ChoiceDAO choiceDAO = PollenModelDAOHelper
- .getChoiceDAO(super.transaction);
- Choice choiceEntity = choiceDAO.findByTopiaId(choice.getId());
- voteToChoice.setChoice(choiceEntity);
-
- liste.add(voteToChoice);
- }
-
- return liste;
- }
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVoteCountingConverter.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVoteCountingConverter.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVoteCountingConverter.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,223 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.converters;
-
-import org.chorem.pollen.business.persistence.Choice;
-import org.chorem.pollen.business.persistence.Comment;
-import org.chorem.pollen.business.persistence.PersonToList;
-import org.chorem.pollen.business.persistence.Poll;
-import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.business.persistence.Vote;
-import org.chorem.pollen.business.persistence.VoteToChoice;
-import org.chorem.pollen.business.persistence.VotingList;
-import org.chorem.pollen.business.services.ServicePollAccount;
-import org.chorem.pollen.business.services.ServicePollAccountImpl;
-import org.chorem.pollen.common.ChoiceType;
-import org.chorem.pollen.common.PollType;
-import org.chorem.pollen.common.VoteCountingType;
-import org.chorem.pollen.votecounting.business.NumberMethod;
-import org.chorem.pollen.votecounting.dto.CommentDTO;
-import org.chorem.pollen.votecounting.dto.PollChoiceDTO;
-import org.chorem.pollen.votecounting.dto.PollDTO;
-import org.chorem.pollen.votecounting.dto.VoteToChoiceDTO;
-import org.chorem.pollen.votecounting.dto.VotingGroupDTO;
-import org.chorem.pollen.votecounting.dto.VotingPersonDTO;
-
-/**
- * Classe de conversion d'entités en DTO pour le module voteCounting.
- *
- * @author fdesbois
- * @author rannou
- * @version $Id: DataVoteCountingConverter.java 2696 2009-08-10 16:18:15Z
- * nrannou $
- */
-public class DataVoteCountingConverter extends DataConverter {
-
- /**
- * Création d'un DTO sondage d'export à partir d'une entité sondage.
- *
- * @param ePoll l'entité sondage
- * @return le DTO sondage d'export
- */
- public static PollDTO createPollDTOForVoteCounting(Poll ePoll) {
- PollDTO pollDTO = new PollDTO(ePoll.getPollId());
- pollDTO.setTitle(ePoll.getTitle());
- pollDTO.setDescription(ePoll.getDescription());
- pollDTO.setBeginChoiceDate(ePoll.getBeginChoiceDate());
- pollDTO.setBeginDate(ePoll.getBeginDate());
- pollDTO.setEndDate(ePoll.getEndDate());
- pollDTO.setAnonymous(ePoll.getAnonymous());
- pollDTO.setAnonymousVoteAllowed(ePoll.getAnonymousVoteAllowed());
- pollDTO.setPublicResults(ePoll.getPublicResults());
- pollDTO.setContinuousResults(ePoll.getContinuousResults());
- pollDTO.setChoiceAddAllowed(ePoll.getChoiceAddAllowed());
- pollDTO.setClosed(ePoll.getClosed());
- pollDTO.setCreatorId(ePoll.getCreator().getVotingId());
- pollDTO.setCreatorEmail(ePoll.getCreator().getEmail());
- pollDTO.setMaxChoiceNb(ePoll.getMaxChoiceNb());
- pollDTO.setPollType(PollType.valueOf(ePoll.getPollType()));
- pollDTO.setChoiceType(ChoiceType.valueOf(ePoll.getChoiceType()));
- pollDTO.setVoteCounting(VoteCountingType.valueOf(ePoll.getVoteCounting()));
-
- for (Comment comment : ePoll.getComment()) {
- pollDTO.getComments().add(createPollCommentDTO(comment));
- }
- for (Choice choice : ePoll.getChoice()) {
- pollDTO.getChoices().add(createPollChoiceDTO(choice));
- }
- if (ePoll.getVotingList() != null && !ePoll.getVotingList().isEmpty()) {
- for (VotingList list : ePoll.getVotingList()) {
- pollDTO.getVotingGroups().add(createVotingGroupDTO(list));
- }
- } else {
- // un groupe par défaut si il y en a pas
- VotingGroupDTO group = new VotingGroupDTO("unique", 1);
- group.setName("unique");
- for (Vote vote : ePoll.getVote()) {
- group.getVotingPersons().add(createVotingPersonDTO(vote));
- }
- pollDTO.getVotingGroups().add(group);
- }
- return pollDTO;
- }
-
- private static CommentDTO createPollCommentDTO(Comment comment) {
- CommentDTO commentDTO = new CommentDTO(comment.getAuthor(), comment.getText());
- return commentDTO;
- }
-
- private static PollChoiceDTO createPollChoiceDTO(Choice choice) {
- PollChoiceDTO choiceDTO = new PollChoiceDTO(choice.getTopiaId());
- String choiceName = choice.getName();
- choiceDTO.setName(choiceName);
- choiceDTO.setHidden(choiceName != null &&
- choiceName.startsWith(NumberMethod.HIDDEN_PREFIX));
- choiceDTO.setDescription(choice.getDescription());
- return choiceDTO;
- }
-
- private static VotingGroupDTO createVotingGroupDTO(VotingList list) {
- VotingGroupDTO group = new VotingGroupDTO(list.getTopiaId(), list
- .getWeight());
- group.setName(list.getName());
-
- for (PersonToList pToList : list.getPollAccountPersonToList()) {
- Vote vote = getPollVoteByPollAccount(list.getPoll(), pToList
- .getPollAccount());
- if (vote != null) { // Pas de vote pour cette personne : doit engendrer erreur ?!?
- group.getVotingPersons().add(createVotingPersonDTO(vote));
- }
- }
- return group;
- }
-
- private static VotingPersonDTO createVotingPersonDTO(Vote vote) {
- VotingPersonDTO votingPerson = new VotingPersonDTO(vote
- .getPollAccount().getVotingId(), vote.getWeight());
- votingPerson.setEmail(vote.getPollAccount().getEmail());
-
- for (VoteToChoice vToChoice : vote.getChoiceVoteToChoice()) {
- if (vToChoice != null && vToChoice.getChoice() != null) {
- votingPerson.getChoices().add(createVoteToChoiceDTO(vToChoice));
- }
- }
- return votingPerson;
- }
-
- private static VoteToChoiceDTO createVoteToChoiceDTO(VoteToChoice vToChoice) {
- String topiaId = vToChoice.getChoice().getTopiaId();
- VoteToChoiceDTO vote = new VoteToChoiceDTO(topiaId, vToChoice
- .getVoteValue());
-
- return vote;
- }
-
- /* A Deplacer au bon endroit (PollImpl) si c'est possible */
- private static Vote getPollVoteByPollAccount(Poll poll, PollAccount account) {
- for (Vote vote : poll.getVote()) {
- if (account.getTopiaId().equals(vote.getPollAccount().getTopiaId())) {
- return vote;
- }
- }
- return null;
- }
-
- /**
- * Création d'un DTO sondage à partir d'un DTO sondage d'export.
- *
- * @param pollDTO le DTO sondage d'export
- * @return le DTO sondage
- */
- public static org.chorem.pollen.business.dto.PollDTO createPollDTO(
- PollDTO pollDTO) {
- org.chorem.pollen.business.dto.PollDTO bPollDTO = new org.chorem.pollen.business.dto.PollDTO(
- pollDTO.getPollId());
- bPollDTO.setTitle(pollDTO.getTitle());
- bPollDTO.setDescription(pollDTO.getDescription());
- bPollDTO.setBeginChoiceDate(pollDTO.getBeginChoiceDate());
- bPollDTO.setBeginDate(pollDTO.getBeginDate());
- bPollDTO.setEndDate(pollDTO.getEndDate());
- bPollDTO.setAnonymous(pollDTO.isAnonymous());
- bPollDTO.setAnonymousVoteAllowed(pollDTO.isAnonymousVoteAllowed());
- bPollDTO.setPublicResults(pollDTO.isPublicResults());
- bPollDTO.setContinuousResults(pollDTO.isContinuousResults());
- bPollDTO.setChoiceAddAllowed(pollDTO.isChoiceAddAllowed());
- bPollDTO.setClosed(pollDTO.isClosed());
- bPollDTO.setCreatorId(pollDTO.getCreatorId());
- bPollDTO.setCreatorEmail(pollDTO.getCreatorEmail());
- bPollDTO.setMaxChoiceNb(pollDTO.getMaxChoiceNb());
- bPollDTO.setPollType(pollDTO.getPollType());
- bPollDTO.setChoiceType(pollDTO.getChoiceType());
- bPollDTO.setVoteCounting(pollDTO.getVoteCounting());
-
- for (CommentDTO comment : pollDTO.getComments()) {
- bPollDTO.getComments().add(createPollCommentDTO(comment));
- }
- for (PollChoiceDTO choice : pollDTO.getChoices()) {
- bPollDTO.getChoices().add(createPollChoiceDTO(choice));
- }
- // TODO conversion des groupes et des votes
-
- return bPollDTO;
- }
-
- private static org.chorem.pollen.business.dto.CommentDTO createPollCommentDTO(
- CommentDTO commentDTO) {
-// ServicePollAccount spa = new ServicePollAccountImpl();
-// PollAccount account = spa.createPollAccount(commentDTO.getVotingID(),
-// null, null);
-// org.chorem.pollen.business.dto.CommentDTO bCommentDTO = new org.chorem.pollen.business.dto.CommentDTO(
-// commentDTO.getText(), null, account.getTopiaId());
-
- org.chorem.pollen.business.dto.CommentDTO bCommentDTO = new org.chorem.pollen.business.dto.CommentDTO();
- bCommentDTO.setText(commentDTO.getText());
- bCommentDTO.setAuthor(commentDTO.getVotingID());
- return bCommentDTO;
- }
-
- private static org.chorem.pollen.business.dto.ChoiceDTO createPollChoiceDTO(
- PollChoiceDTO pollChoiceDTO) {
- org.chorem.pollen.business.dto.ChoiceDTO bChoiceDTO = new org.chorem.pollen.business.dto.ChoiceDTO();
- String pollChoiceName = pollChoiceDTO.getName();
- bChoiceDTO.setName(pollChoiceName);
- bChoiceDTO.setHidden(pollChoiceName != null
- && pollChoiceName.startsWith(NumberMethod.HIDDEN_PREFIX));
- bChoiceDTO.setDescription(pollChoiceDTO.getDescription());
- return bChoiceDTO;
- }
-
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVotingListConverter.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVotingListConverter.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVotingListConverter.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,197 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.converters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.VotingListDTO;
-import org.chorem.pollen.business.persistence.PersonToList;
-import org.chorem.pollen.business.persistence.PersonToListDAO;
-import org.chorem.pollen.business.persistence.Poll;
-import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.business.persistence.PollAccountDAO;
-import org.chorem.pollen.business.persistence.PollDAO;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.business.persistence.Vote;
-import org.chorem.pollen.business.persistence.VoteDAO;
-import org.chorem.pollen.business.persistence.VotingList;
-import org.chorem.pollen.business.persistence.VotingListDAO;
-import org.nuiton.topia.TopiaException;
-
-/**
- * Gestion de la conversion des dtos VotingList en entité et vice-versa.
- *
- * @author enema
- * @version $Id: DataVotingListConverter.java 2650 2009-07-16 12:57:46Z nrannou
- * $
- */
-public class DataVotingListConverter extends DataConverter {
-
- /**
- * Création d'une liste à partir d'un dto liste.
- *
- * @param votingListDTO le dto votingList
- * @param eVotingList l'entité votingList
- */
- public void populateVotingListEntity(VotingListDTO votingListDTO,
- VotingList eVotingList) throws TopiaException {
- eVotingList.setName(votingListDTO.getName());
- eVotingList.setWeight(votingListDTO.getWeight());
-
- if (votingListDTO.getPollId() != null) {
- if (votingListDTO.getPollId().length() > 0) {
- PollDAO pollDAO = PollenModelDAOHelper
- .getPollDAO(super.transaction);
- Poll pollEntity = pollDAO.findByTopiaId(votingListDTO
- .getPollId());
- eVotingList.setPoll(pollEntity);
- }
- }
- if (votingListDTO.getVoteId() != null) {
- if (votingListDTO.getVoteId().length() > 0) {
- VoteDAO voteDAO = PollenModelDAOHelper
- .getVoteDAO(super.transaction);
- Vote voteEntity = voteDAO.findByTopiaId(votingListDTO
- .getVoteId());
- eVotingList.setVote(voteEntity);
- }
- }
- }
-
- /**
- * Création d'un dto votingList à partir d'une entité.
- *
- * @param eVotingList l'entité votingList
- * @return le dto votingList
- */
- public VotingListDTO createVotingListDTO(VotingList eVotingList) {
- VotingListDTO dto = new VotingListDTO();
- dto.setId(eVotingList.getTopiaId());
- dto.setName(eVotingList.getName());
- dto.setWeight(eVotingList.getWeight());
-
- dto.setPollAccountDTOs(this.getPollAccountDTOs(eVotingList
- .getPollAccountPersonToList()));
-
- if (eVotingList.getPoll() != null) {
- dto.setPollId(eVotingList.getPoll().getTopiaId());
- }
- if (eVotingList.getVote() != null) {
- dto.setVoteId(eVotingList.getVote().getTopiaId());
- }
-
- return dto;
- }
-
- /**
- * Retourne une liste de dtos votingList à partir d'une liste d'entités.
- *
- * @param lVotingLists liste de entités votingList
- * @return la liste des dtos votingList
- */
- public List<VotingListDTO> createVotingListDTOs(
- List<VotingList> lVotingLists) {
- List<VotingListDTO> results = new ArrayList<VotingListDTO>();
- VotingListDTO dto;
- for (VotingList v : lVotingLists) {
- dto = this.createVotingListDTO(v);
- results.add(dto);
- }
- return results;
- }
-
- /**
- * Retourne une liste de pollAccount correspondant aux personnes de la
- * liste.
- *
- * @param persons les personnes
- * @return liste des comptes
- */
- private List<PollAccountDTO> getPollAccountDTOs(
- Collection<PersonToList> persons) {
-
- List<PollAccountDTO> accounts = new ArrayList<PollAccountDTO>();
- DataPollAccountConverter converter = new DataPollAccountConverter();
-
- for (PersonToList p : persons) {
- accounts.add(converter.createPollAccountDTO(p.getPollAccount()));
- }
-
- return accounts;
- }
-
- /**
- * Mise à jour des PersonToList d'une entité votingList à partir d'un dto
- * votingList.
- *
- * @param votingListDTO Le dto votingList.
- * @param eVotingList L'entité votingList.
- */
- public void populatePersonVotingList(VotingListDTO votingListDTO,
- VotingList eVotingList) throws TopiaException {
-
- // Mise à jour des identifiants de liste dans les pollAccounts
- for (PollAccountDTO pollAccountDTO : votingListDTO.getPollAccountDTOs()) {
- pollAccountDTO.setVotingListId(eVotingList.getTopiaId());
- }
-
- // Mise à jour des PersonToList correspondants à la liste de votants
- eVotingList.setPollAccountPersonToList(this
- .getPersonToLists(votingListDTO.getPollAccountDTOs()));
- }
-
- /**
- * Retourne la liste des PersonToList à partir d'une liste de dtos
- * votingList.
- *
- * @param pollAccountDTOs La liste des dtos votingList
- * @return la liste d'entités PersonToList
- */
- private List<PersonToList> getPersonToLists(
- List<PollAccountDTO> pollAccountDTOs) throws TopiaException {
- List<PersonToList> liste = new ArrayList<PersonToList>();
-
- for (PollAccountDTO pollAccountDTO : pollAccountDTOs) {
- PersonToListDAO personToListDAO = PollenModelDAOHelper
- .getPersonToListDAO(super.transaction);
- PersonToList personToListEntity = personToListDAO.create();
- personToListEntity.setWeight(pollAccountDTO.getWeight());
- personToListEntity.setHasVoted(pollAccountDTO.isHasVoted());
-
- // Ajout de la votingList
- VotingListDAO votingListDAO = PollenModelDAOHelper
- .getVotingListDAO(super.transaction);
- VotingList votingListEntity = votingListDAO
- .findByTopiaId(pollAccountDTO.getVotingListId());
- personToListEntity.setVotingList(votingListEntity);
-
- // Ajout du pollAccount
- PollAccountDAO pollAccountDAO = PollenModelDAOHelper
- .getPollAccountDAO(super.transaction);
- PollAccount pollAccountEntity = pollAccountDAO
- .findByTopiaId(pollAccountDTO.getId());
- personToListEntity.setPollAccount(pollAccountEntity);
-
- liste.add(personToListEntity);
- }
-
- return liste;
- }
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/package-info.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/package-info.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/package-info.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,4 +0,0 @@
-/**
- * Gestion de la conversion des DTO en entités et des entités en DTO.
- */
-package org.chorem.pollen.business.converters;
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/ChoiceDTO.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/ChoiceDTO.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/ChoiceDTO.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,167 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.dto;
-
-import java.io.Serializable;
-
-import org.chorem.pollen.votecounting.dto.PollChoiceDTO;
-
-/**
- * Classe DTO représentant un choix de sondage.
- *
- * @author amine
- * @author rannou
- * @version $Id$
- */
-public class ChoiceDTO implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- /** main id (topiaId) **/
- private String id = "";
-
- /** name of the choice **/
- private String name = "";
-
- /** description of the choice **/
- private String description = "";
-
- /** ?? **/
- private Boolean validate = false;
-
- /**
- * VOTE context : value of the choice in a vote.
- * Not fill by servicePoll
- **/
- private Integer value = 0;
-
- /**
- * VOTE context : topiaId of the vote where the choice is done
- * FIXME-FD20100224 Is it really needed ??
- **/
- private String voteId = "";
-
- /**
- * topiaId of the poll owner of this choice
- * FIXME-FD20100224 Is it really needed ??
- */
- private String pollId = "";
-
- /**
- * pollUId of the poll owner of this choice
- */
- private String pollUId;
-
- /** used for specific choice in Number VoteCounting **/
- private Boolean hidden = false;
-
- public ChoiceDTO() {
-
- }
-
- @Deprecated
- public ChoiceDTO(String id) {
- this.id = id;
- }
-
- @Deprecated
- public ChoiceDTO(String name, String voteId, String pollId) {
- this.name = name;
- this.voteId = voteId;
- //this.pollId = pollId;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public Integer getValue() {
- return value;
- }
-
- public void setValue(Integer value) {
- this.value = value;
- }
-
- public Boolean isValidate() {
- return validate;
- }
-
- public Boolean getValidate() {
- return isValidate();
- }
-
- public void setValidate(Boolean validate) {
- this.validate = validate;
- }
-
- public String getVoteId() {
- return voteId;
- }
-
- public void setVoteId(String voteId) {
- this.voteId = voteId;
- }
-
- public String getPollId() {
- return pollId;
- }
-
- public void setPollId(String pollId) {
- this.pollId = pollId;
- }
-
- public String getPollUId() {
- return pollUId;
- }
-
- public void setPollUId(String pollUId) {
- this.pollUId = pollUId;
- }
-
- public Boolean isHidden() {
- return hidden;
- }
-
- public Boolean getHidden() {
- return isHidden();
- }
-
- public void setHidden(Boolean hidden) {
- this.hidden = hidden;
- }
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/CommentDTO.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/CommentDTO.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/CommentDTO.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,75 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.dto;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * Classe DTO représentant un commentaire.
- *
- * @author amine
- * @author rannou
- * @version $Id$
- */
-public class CommentDTO implements Serializable {
-
- /** main id (topiaId) **/
- private String id;
-
- /** content of the comment **/
- private String text;
-
- /** date where the comment were created **/
- private Date postDate;
-
- /** author of the comment **/
- private String author;
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getText() {
- return text;
- }
-
- public void setText(String text) {
- this.text = text;
- }
-
- public Date getPostDate() {
- return postDate;
- }
-
- public void setPostDate(Date postDate) {
- this.postDate = postDate;
- }
-
- public String getAuthor() {
- return author;
- }
-
- public void setAuthor(String author) {
- this.author = author;
- }
-
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PersonListDTO.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PersonListDTO.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PersonListDTO.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,110 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.dto;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Classe DTO représentant une liste de personnes.
- *
- * @author amine
- * @author rannou
- * @version $Id$
- */
-public class PersonListDTO implements Serializable {
-
- private String id = "";
-
- private String userId = "";
-
- private String name = "";
-
- private List<PollAccountDTO> persons = new ArrayList<PollAccountDTO>();
-
- public PersonListDTO() {
-
- }
-
- public PersonListDTO(String id) {
- this.id = id;
- }
-
- public PersonListDTO(String name, String userId) {
- super();
- this.name = name;
- this.userId = userId;
-
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getUserId() {
- return userId;
- }
-
- public void setUserId(String userId) {
- this.userId = userId;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public List<PollAccountDTO> getPollAccounts() {
- return persons;
- }
-
- public void setPollAccounts(List<PollAccountDTO> persons) {
- this.persons = persons;
- }
-
- public boolean addPollAccount(PollAccountDTO account) {
- if (persons == null) {
- persons = new ArrayList<PollAccountDTO>();
- }
- return persons.add(account);
- }
-
- public boolean removePollAccount(String accountId) {
- if (persons == null) {
- return false;
- }
- Iterator<PollAccountDTO> it = persons.iterator();
- while (it.hasNext()) {
- PollAccountDTO account = it.next();
- if (accountId.equals(account.getId())) {
- it.remove();
- return true;
- }
- }
- return false;
- }
-
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PollAccountDTO.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PollAccountDTO.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PollAccountDTO.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,176 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.dto;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Classe DTO représentant un votant.
- *
- * @author amine
- * @author rannou
- * @version $Id$
- */
-public class PollAccountDTO implements Serializable {
-
- private String id;
-
- /** UId of the account used in urls **/
- private String accountUId;
-
- /** Name of the account **/
- private String votingId;
-
- /** TopiaId of the user linked with the account **/
- private String userId;
-
- /** Email of the account **/
- private String email;
-
- /** Weight of the account (already defined in the vote) **/
- private Double weight;
-
- /**
- * Determine if the account has already voted (used for vote page)
- * Seems not necessary to manage vote, no constraint define on changing
- * existing vote if it's the correct user or account.
- **/
- private Boolean hasVoted;
-
-
-
- private String votingListId = "";
-
- private String personListId = "";
-
- private List<VoteDTO> voteDTOs = new ArrayList<VoteDTO>();
-
- public PollAccountDTO() {
-
- }
-
- @Deprecated
- public PollAccountDTO(String id) {
- this.id = id;
- }
-
- @Deprecated
- public PollAccountDTO(String votingId, String email, String personListId,
- String votingListId, String userId) {
- super();
- this.votingId = votingId;
- this.email = email;
- this.personListId = personListId;
- this.votingListId = votingListId;
- this.userId = userId;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getAccountUId() {
- return accountUId;
- }
-
- public void setAccountUId(String accountUId) {
- this.accountUId = accountUId;
- }
-
- public String getVotingId() {
- return votingId;
- }
-
- public void setVotingId(String votingId) {
- this.votingId = votingId;
- }
-
- public String getUserId() {
- return userId;
- }
-
- public void setUserId(String userId) {
- this.userId = userId;
- }
-
- public String getEmail() {
- return email;
- }
-
- public void setEmail(String email) {
- this.email = email;
- }
-
- @Deprecated
- public Double getWeight() {
- return weight;
- }
-
- @Deprecated
- public void setWeight(Double weight) {
- this.weight = weight;
- }
-
- public Boolean isHasVoted() {
- return hasVoted;
- }
-
- public Boolean getHasVoted() {
- return isHasVoted();
- }
-
- public void setHasVoted(Boolean hasVoted) {
- this.hasVoted = hasVoted;
- }
-
- @Deprecated
- public String getVotingListId() {
- return votingListId;
- }
-
- @Deprecated
- public void setVotingListId(String votingListId) {
- this.votingListId = votingListId;
- }
-
- @Deprecated
- public String getPersonListId() {
- return personListId;
- }
-
- @Deprecated
- public void setPersonListId(String personListId) {
- this.personListId = personListId;
- }
-
- @Deprecated
- public List<VoteDTO> getVoteDTOs() {
- return voteDTOs;
- }
-
- @Deprecated
- public void setVoteDTOs(List<VoteDTO> voteDTOs) {
- this.voteDTOs = voteDTOs;
- }
-
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PollDTO.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PollDTO.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PollDTO.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,424 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.dto;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-
-import org.chorem.pollen.common.ChoiceType;
-import org.chorem.pollen.common.PollType;
-import org.chorem.pollen.common.VoteCountingType;
-
-/**
- * Classe DTO représentant un sondage.
- *
- * @author amine
- * @author rannou
- * @version $Id$
- */
-public class PollDTO implements Serializable {
-
- private String id = "";
-
- private String pollUId;
-
- private String title = "";
-
- private String description = "";
-
- private Date beginDate = null;
-
- private Date endDate = null;
-
- private Date beginChoiceDate = null;
-
- private Date endChoiceDate = null;
-
- private Integer maxChoiceNb = 0;
-
- private Boolean closed = false;
-
- private Boolean choiceAddAllowed = false;
-
- private Boolean anonymousVoteAllowed = false;
-
- private Boolean anonymous = false;
-
- private Boolean publicResults = false;
-
- private Boolean continuousResults = false;
-
- private PollType pollType = null;
-
- private VoteCountingType voteCounting = null;
-
- private ChoiceType choiceType = ChoiceType.TEXT;
-
- private String userId = "";
-
- /** topiaId of the creator (pollAccount) **/
- private String creatorId = "";
-
- /** name of the creator (pollAccount.votingId) **/
- private String creatorName;
-
- /** email of the creator **/
- private String creatorEmail = "";
-
- private List<CommentDTO> comments = new ArrayList<CommentDTO>();
-
- private List<VotingListDTO> votingListDTOs = new ArrayList<VotingListDTO>();
-
- private int nbVotes;
-
- private List<PreventRuleDTO> preventRuleDTOs = new ArrayList<PreventRuleDTO>();
-
- private List<ChoiceDTO> choices = new ArrayList<ChoiceDTO>();
-
- private List<ResultDTO> resultDTOs = new ArrayList<ResultDTO>();
-
- public PollDTO() {
-
- }
-
- public PollDTO(String id) {
- this.id = id;
- }
-
- public PollDTO(String title, String creatorId, ChoiceType choiceType,
- PollType pollType, VoteCountingType voteCounting) {
- super();
- this.title = title;
- this.pollType = pollType;
- this.creatorId = creatorId;
- this.choiceType = choiceType;
- this.voteCounting = voteCounting;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getPollUId() {
- return pollUId;
- }
-
- public void setPollUId(String pollId) {
- this.pollUId = pollId;
- }
-
- public String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public Date getBeginDate() {
- return beginDate;
- }
-
- public void setBeginDate(Date beginDate) {
- this.beginDate = beginDate;
- }
-
- /**
- * Get the value of endChoiceDate
- *
- * @return the value of endChoiceDate
- */
- public Date getEndChoiceDate() {
- return endChoiceDate;
- }
-
- /**
- * Set the value of endChoiceDate
- *
- * @param endChoiceDate new value of endChoiceDate
- */
- public void setEndChoiceDate(Date endChoiceDate) {
- this.endChoiceDate = endChoiceDate;
- }
-
- public Date getEndDate() {
- return endDate;
- }
-
- public void setEndDate(Date endDate) {
- this.endDate = endDate;
- }
-
- public Date getBeginChoiceDate() {
- return beginChoiceDate;
- }
-
- public void setBeginChoiceDate(Date beginChoiceDate) {
- this.beginChoiceDate = beginChoiceDate;
- }
-
- public Integer getMaxChoiceNb() {
- return maxChoiceNb;
- }
-
- public void setMaxChoiceNb(Integer maxChoiceNb) {
- this.maxChoiceNb = maxChoiceNb;
- }
-
- public Boolean isClosed() {
- return closed;
- }
-
- public Boolean getClosed() {
- return isClosed();
- }
-
- public void setClosed(Boolean closed) {
- this.closed = closed;
- }
-
- public Boolean isChoiceAddAllowed() {
- return choiceAddAllowed;
- }
-
- public Boolean getChoiceAddAllowed() {
- return isChoiceAddAllowed();
- }
-
- public void setChoiceAddAllowed(Boolean choiceAddAllowed) {
- this.choiceAddAllowed = choiceAddAllowed;
- }
-
- public Boolean isAnonymousVoteAllowed() {
- return anonymousVoteAllowed;
- }
-
- public Boolean getAnonymousVoteAllowed() {
- return isAnonymousVoteAllowed();
- }
-
- public void setAnonymousVoteAllowed(Boolean anonymousVoteAllowed) {
- this.anonymousVoteAllowed = anonymousVoteAllowed;
- }
-
- public Boolean isAnonymous() {
- return anonymous;
- }
-
- public Boolean getAnonymous() {
- return isAnonymous();
- }
-
- public void setAnonymous(Boolean anonymous) {
- this.anonymous = anonymous;
- }
-
- public Boolean isPublicResults() {
- return publicResults;
- }
-
- public Boolean getPublicResults() {
- return isPublicResults();
- }
-
- public void setPublicResults(Boolean publicResults) {
- this.publicResults = publicResults;
- }
-
- public Boolean isContinuousResults() {
- return continuousResults;
- }
-
- public Boolean getContinuousResults() {
- return isContinuousResults();
- }
-
- public void setContinuousResults(Boolean continuousResults) {
- this.continuousResults = continuousResults;
- }
-
- public PollType getPollType() {
- return pollType;
- }
-
- public void setPollType(PollType pollType) {
- this.pollType = pollType;
- }
-
- public VoteCountingType getVoteCounting() {
- return voteCounting;
- }
-
- public void setVoteCounting(VoteCountingType voteCounting) {
- this.voteCounting = voteCounting;
- }
-
- public ChoiceType getChoiceType() {
- return choiceType;
- }
-
- public void setChoiceType(ChoiceType choiceType) {
- this.choiceType = choiceType;
- }
-
- public String getUserId() {
- return userId;
- }
-
- public void setUserId(String userId) {
- this.userId = userId;
- }
-
- public String getCreatorId() {
- return creatorId;
- }
-
- public void setCreatorId(String creatorId) {
- this.creatorId = creatorId;
- }
-
- public String getCreatorName() {
- return creatorName;
- }
-
- public void setCreatorName(String creatorName) {
- this.creatorName = creatorName;
- }
-
- public String getCreatorEmail() {
- return creatorEmail;
- }
-
- public void setCreatorEmail(String creatorEmail) {
- this.creatorEmail = creatorEmail;
- }
-
- public List<CommentDTO> getComments() {
- return comments;
- }
-
- public void setComments(List<CommentDTO> commentDTOs) {
- this.comments = commentDTOs;
- }
-
- public boolean addComment(CommentDTO comment) {
- if (comments == null) {
- comments = new ArrayList<CommentDTO>();
- }
- return comments.add(comment);
- }
-
- public boolean removeComment(String commentId) {
- if (comments == null) {
- return false;
- }
- Iterator<CommentDTO> it = comments.iterator();
- while (it.hasNext()) {
- CommentDTO comment = it.next();
- if (commentId.equals(comment.getId())) {
- it.remove();
- return true;
- }
- }
- return false;
- }
-
- public List<VotingListDTO> getVotingListDTOs() {
- return votingListDTOs;
- }
-
- public void setVotingListDTOs(List<VotingListDTO> votingListDTOs) {
- this.votingListDTOs = votingListDTOs;
- }
-
- public int getNbVotes() {
- return nbVotes;
- }
-
- public void setNbVotes(int nbVotes) {
- this.nbVotes = nbVotes;
- }
-
- public List<PreventRuleDTO> getPreventRuleDTOs() {
- return preventRuleDTOs;
- }
-
- public void setPreventRuleDTOs(List<PreventRuleDTO> preventRuleDTOs) {
- this.preventRuleDTOs = preventRuleDTOs;
- }
-
- public void addPreventRule(PreventRuleDTO rule) {
- if (preventRuleDTOs == null) {
- preventRuleDTOs = new ArrayList<PreventRuleDTO>();
- }
- preventRuleDTOs.add(rule);
- }
-
- public List<ChoiceDTO> getChoices() {
- return choices;
- }
-
- public void setChoices(List<ChoiceDTO> choiceDTOs) {
- this.choices = choiceDTOs;
- }
-
- public void addChoice(ChoiceDTO choice) {
- if (choices == null) {
- choices = new ArrayList<ChoiceDTO>();
- }
- choices.add(choice);
- }
-
- public boolean removeChoice(String choiceId) {
- if (choices == null) {
- return false;
- }
- Iterator<ChoiceDTO> it = choices.iterator();
- while (it.hasNext()) {
- ChoiceDTO choice = it.next();
- if (choiceId.equals(choice.getId())) {
- it.remove();
- return true;
- }
- }
- return false;
- }
-
- public List<ResultDTO> getResultDTOs() {
- return resultDTOs;
- }
-
- public void setResultDTOs(List<ResultDTO> resultDTOs) {
- this.resultDTOs = resultDTOs;
- }
-
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PreventRuleDTO.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PreventRuleDTO.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PreventRuleDTO.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,152 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.dto;
-
-import java.io.Serializable;
-
-/**
- * Classe DTO représentant une règle de notification.
- *
- * @author amine
- * @author rannou
- * @version $Id$
- */
-public class PreventRuleDTO implements Serializable {
-
- /** main id (topiaId) **/
- private String id = "";
-
- /**
- * topiaId of the poll owner of this preventRule
- * FIXME-FD20100224 Is it really needed ??
- **/
- private String pollId = "";
-
- private String scope = "";
-
- private Integer sensibility = 0;
-
- private Boolean active = true;
-
- private Boolean oneTime = false;
-
- private Boolean repeated = false;
-
- private String method = "";
-
- public PreventRuleDTO() {
- }
-
- public PreventRuleDTO(String id) {
- this.id = id;
- }
-
- public PreventRuleDTO(String pollId, String scope, int sensibility,
- boolean repeated, String method) {
- super();
- this.scope = scope;
- this.sensibility = sensibility;
- this.repeated = repeated;
- this.method = method;
- this.pollId = pollId;
- }
-
- public PreventRuleDTO(String scope, int sensibility, boolean repeated,
- String method) {
- super();
- this.scope = scope;
- this.sensibility = sensibility;
- this.repeated = repeated;
- this.method = method;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getPollId() {
- return pollId;
- }
-
- public void setPollId(String pollId) {
- this.pollId = pollId;
- }
-
- public String getScope() {
- return scope;
- }
-
- public void setScope(String scope) {
- this.scope = scope;
- }
-
- public Integer getSensibility() {
- return sensibility;
- }
-
- public void setSensibility(Integer sensibility) {
- this.sensibility = sensibility;
- }
-
- public Boolean isActive() {
- return active;
- }
-
- public Boolean getActive() {
- return isActive();
- }
-
- public void setActive(Boolean active) {
- this.active = active;
- }
-
- public Boolean isOneTime() {
- return oneTime;
- }
-
- public Boolean getOneTime() {
- return isOneTime();
- }
-
- public void setOneTime(Boolean oneTime) {
- this.oneTime = oneTime;
- }
-
- public Boolean isRepeated() {
- return repeated;
- }
-
- public Boolean getRepeated() {
- return isRepeated();
- }
-
- public void setRepeated(Boolean repeated) {
- this.repeated = repeated;
- }
-
- public String getMethod() {
- return method;
- }
-
- public void setMethod(String method) {
- this.method = method;
- }
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/ResultDTO.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/ResultDTO.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/ResultDTO.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,129 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.dto;
-
-import java.io.Serializable;
-
-import org.chorem.pollen.common.ChoiceType;
-import org.chorem.pollen.common.VoteCountingType;
-
-/**
- * Classe DTO représentant un résultat de sondage.
- *
- * @author amine
- * @author rannou
- * @version $Id$
- */
-public class ResultDTO implements Serializable {
-
- private String id = "";
-
- private String name = "";
-
- private String value = "";
-
- private String pollId = "";
-
- private ChoiceType choiceType;
-
- private VoteCountingType voteCounting;
-
- private boolean byGroup = false;
-
- private boolean hidden = false;
-
- public ResultDTO() {
-
- }
-
- public ResultDTO(String id) {
- this.id = id;
- }
-
- public ResultDTO(String name, String pollId, ChoiceType choiceType,
- VoteCountingType myVoteCounting) {
- super();
- this.name = name;
- this.pollId = pollId;
- this.choiceType = choiceType;
- this.voteCounting = myVoteCounting;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public String getPollId() {
- return pollId;
- }
-
- public void setPollId(String pollId) {
- this.pollId = pollId;
- }
-
- public ChoiceType getChoiceType() {
- return choiceType;
- }
-
- public void setChoiceType(ChoiceType choiceType) {
- this.choiceType = choiceType;
- }
-
- public VoteCountingType getVoteCounting() {
- return voteCounting;
- }
-
- public void setVoteCounting(VoteCountingType voteCounting) {
- this.voteCounting = voteCounting;
- }
-
- public boolean isByGroup() {
- return byGroup;
- }
-
- public void setByGroup(boolean byGroup) {
- this.byGroup = byGroup;
- }
-
- public boolean isHidden() {
- return hidden;
- }
-
- public void setHidden(boolean hidden) {
- this.hidden = hidden;
- }
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/ResultListDTO.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/ResultListDTO.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/ResultListDTO.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,38 +0,0 @@
-package org.chorem.pollen.business.dto;
-
-import java.util.List;
-
-import org.chorem.pollen.votecounting.dto.VoteCountingResultDTO;
-
-/**
- * Classe DTO représentant une liste de résultats.
- *
- * @version $Revision$ $Date$
- * @since 1.2.2
- */
-public class ResultListDTO {
-
- /** Liste des résultats */
- private List<ResultDTO> resultDTOs = null;
-
- /** Résultat issu du dépouillement du vote */
- private VoteCountingResultDTO voteCountingResultDTO = null;
-
- public List<ResultDTO> getResultDTOs() {
- return resultDTOs;
- }
-
- public void setResultDTOs(List<ResultDTO> resultDTOs) {
- this.resultDTOs = resultDTOs;
- }
-
- public VoteCountingResultDTO getVoteCountingResultDTO() {
- return voteCountingResultDTO;
- }
-
- public void setVoteCountingResultDTO(VoteCountingResultDTO voteCountingResultDTO) {
- this.voteCountingResultDTO = voteCountingResultDTO;
- }
-
-
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/UserDTO.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/UserDTO.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/UserDTO.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,136 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.dto;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Classe DTO représentant un utilisateur.
- *
- * @author amine
- * @author rannou
- * @version $Id$
- */
-public class UserDTO implements Serializable {
-
- private String id = "";
-
- private String login = "";
-
- private String firstName = "";
-
- private String lastName = "";
-
- private boolean administrator = false;
-
- private String language = "";
-
- private String email = "";
-
- private List<PersonListDTO> personListDTOs = new ArrayList<PersonListDTO>();
-
- private List<PollAccountDTO> pollAccountDTOs = new ArrayList<PollAccountDTO>();
-
- public UserDTO() {
-
- }
-
- public UserDTO(String id) {
- this.id = id;
- }
-
- public UserDTO(String login, String firstName, String lastName) {
- this.login = login;
- this.firstName = firstName;
- this.lastName = lastName;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getLogin() {
- return login;
- }
-
- public void setLogin(String login) {
- this.login = login;
- }
-
- public String getFirstName() {
- return firstName;
- }
-
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
-
- public String getLastName() {
- return lastName;
- }
-
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
-
- public boolean isAdministrator() {
- return administrator;
- }
-
- public void setAdministrator(boolean administrator) {
- this.administrator = administrator;
- }
-
- public String getLanguage() {
- return language;
- }
-
- public void setLanguage(String language) {
- this.language = language;
- }
-
- public String getEmail() {
- return email;
- }
-
- public void setEmail(String email) {
- this.email = email;
- }
-
- public List<PersonListDTO> getPersonListDTOs() {
- return personListDTOs;
- }
-
- public void setPersonListDTOs(List<PersonListDTO> personListDTOs) {
- this.personListDTOs = personListDTOs;
- }
-
- public List<PollAccountDTO> getPollAccountDTOs() {
- return pollAccountDTOs;
- }
-
- public void setPollAccountDTOs(List<PollAccountDTO> pollAccountDTOs) {
- this.pollAccountDTOs = pollAccountDTOs;
- }
-
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/VoteDTO.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/VoteDTO.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/VoteDTO.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,197 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.dto;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Classe DTO représentant un vote.
- *
- * @author amine
- * @author rannou
- * @version $Id$
- */
-public class VoteDTO implements Serializable {
-
- /** main id (topiaId) **/
- private String id = "";
-
- /** weight of the person who has voted depends on poll context **/
- private Double weight = 0.;
-
- /**
- * FIXME-FD20100224 comment on the vote. Where is it used in ui ?
- **/
- private String comment = "";
-
- /** the vote is anonymous or not **/
- private Boolean anonymous = false;
-
- /** account who has voted : only defined if anonymous = false **/
- private String pollAccountId;
-
- /** QUICK FIX to have pollAccount votingId **/
- private String name;
-
- /** QUICK FIX to have pollAccount userId **/
- private String userId;
-
- /**
- * topiaId of the poll where the vote is done
- * FIXME-FD20100224 Is it really needed ??
- **/
- private String pollId = "";
-
- /** topiaId of the list corresponding to this vote **/
- private String votingListId = "";
-
- /** choices made by this vote **/
-// private List<ChoiceDTO> choiceDTOs = new ArrayList<ChoiceDTO>();
- private Map<String, Integer> choiceValues;
-
- public VoteDTO() {
- }
-
- @Deprecated
- public VoteDTO(String id) {
- this.id = id;
- }
-
- @Deprecated
- public VoteDTO(String accountUId, String pollId, String votingListId) {
-// this.accountUId = accountUId;
- this.pollId = pollId;
- this.votingListId = votingListId;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public Double getWeight() {
- return weight;
- }
-
- public void setWeight(Double weight) {
- this.weight = weight;
- }
-
- @Deprecated
- public String getComment() {
- return comment;
- }
-
- @Deprecated
- public void setComment(String comment) {
- this.comment = comment;
- }
-
- public Boolean isAnonymous() {
- return anonymous;
- }
-
- public Boolean getAnonymous() {
- return isAnonymous();
- }
-
- public void setAnonymous(Boolean anonymous) {
- this.anonymous = anonymous;
- }
-
- public String getPollAccountId() {
- return pollAccountId;
- }
-
- public void setPollAccountId(String pollAccountId) {
- this.pollAccountId = pollAccountId;
- }
-
- @Deprecated
- public String getName() {
- return name;
- }
-
- @Deprecated
- public void setName(String name) {
- this.name = name;
- }
-
- @Deprecated
- public String getUserId() {
- return userId;
- }
-
- @Deprecated
- public void setUserId(String userId) {
- this.userId = userId;
- }
-
- @Deprecated
- public String getPollId() {
- return pollId;
- }
-
- @Deprecated
- public void setPollId(String pollId) {
- this.pollId = pollId;
- }
-
- public String getVotingListId() {
- return votingListId;
- }
-
- public void setVotingListId(String votingListId) {
- this.votingListId = votingListId;
- }
-
- public void setChoiceValue(String choiceId, Integer value) {
- getChoiceValues().put(choiceId, value);
- }
-
- public Integer getChoiceValue(String choiceId) {
- return getChoiceValues().get(choiceId);
- }
-
- public Map<String, Integer> getChoiceValues() {
- if (choiceValues == null) {
- choiceValues = new HashMap<String, Integer>();
- }
- return choiceValues;
- }
-
-// public List<ChoiceDTO> getChoiceDTOs() {
-// return choiceDTOs;
-// }
-//
-// public void setChoiceDTOs(List<ChoiceDTO> choiceDTOs) {
-// this.choiceDTOs = choiceDTOs;
-// }
-//
-// public void addChoice(ChoiceDTO choice) {
-// if (choiceDTOs == null) {
-// choiceDTOs = new ArrayList<ChoiceDTO>();
-// }
-// choiceDTOs.add(choice);
-// }
-
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/VotingListDTO.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/VotingListDTO.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/VotingListDTO.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,106 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.dto;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Classe DTO représentant une liste de votants.
- *
- * @author amine
- * @author rannou
- * @version $Id$
- */
-public class VotingListDTO implements Serializable {
-
- private String id = "";
-
- private String name = "";
-
- private Double weight = 1.;
-
- private String pollId = "";
-
- private String voteId = "";
-
- private List<PollAccountDTO> pollAccountDTOs = new ArrayList<PollAccountDTO>();
-
- public VotingListDTO() {
-
- }
-
- public VotingListDTO(String id) {
- this.id = id;
- }
-
- public VotingListDTO(String name, String pollId) {
- super();
- this.name = name;
- this.pollId = pollId;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Double getWeight() {
- return weight;
- }
-
- public void setWeight(Double weight) {
- this.weight = weight;
- }
-
- public String getPollId() {
- return pollId;
- }
-
- public void setPollId(String pollId) {
- this.pollId = pollId;
- }
-
- public String getVoteId() {
- return voteId;
- }
-
- public void setVoteId(String voteId) {
- this.voteId = voteId;
- }
-
- public List<PollAccountDTO> getPollAccountDTOs() {
- return pollAccountDTOs;
- }
-
- public void setPollAccountDTOs(List<PollAccountDTO> pollAccountDTOs) {
- this.pollAccountDTOs = pollAccountDTOs;
- }
-
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/package-info.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/package-info.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/package-info.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,4 +0,0 @@
-/**
- * Data Transfert Objects.
- */
-package org.chorem.pollen.business.dto;
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/migration/PollenMigrationCallbackHandler.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/migration/PollenMigrationCallbackHandler.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/migration/PollenMigrationCallbackHandler.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,252 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.migration;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.hibernate.dialect.Dialect;
-import org.hibernate.dialect.H2Dialect;
-import org.hibernate.dialect.PostgreSQLDialect;
-import org.nuiton.topia.migration.DatabaseManager;
-import org.nuiton.topia.migration.callback.MigrationCallbackHandler;
-import org.nuiton.util.VersionUtil;
-
-/**
- * Classe d'interaction avant la migration (MigrationCallbackHandler).
- *
- * @author rannou
- * @version $Id: PollenMigrationCallbackHandler.java 2615 2009-07-01 13:47:45Z
- * nrannou $
- */
-public class PollenMigrationCallbackHandler implements MigrationCallbackHandler {
-
- /** log. */
- private static final Log log = LogFactory
- .getLog(PollenMigrationCallbackHandler.class);
-
- @Override
- public MigrationChoice doMigration(DatabaseManager dbManager,
- String dbVersion, String applicationVersion) {
-
- if (log.isInfoEnabled()) {
- log.info("Migration : version de la base : " + dbVersion
- + ", version de l'application : " + applicationVersion);
- }
-
- Dialect dialect = dbManager.getDbConfiguration().buildSettings()
- .getDialect();
- MigrationChoice result = MigrationChoice.NO_MIGRATION;
-
- // ouverture d'une connexion direct JDBC sur la base
- try {
- Connection conn = dbManager.getConnection();
- try {
- conn.setAutoCommit(false);
- if (VersionUtil.valueOf(dbVersion).before(
- VersionUtil.valueOf("1.1"))) {
- migrateTo1_1(conn, dialect);
- }
- if (VersionUtil.valueOf(dbVersion).before(
- VersionUtil.valueOf("1.2"))) {
- migrate1_1To1_2(conn, dialect);
- }
- if (VersionUtil.valueOf(dbVersion).before(
- VersionUtil.valueOf("1.3"))) {
- migrate1_2To1_3(conn, dialect);
- }
- conn.commit();
- result = MigrationChoice.CUSTOM_MIGRATION;
- } catch (Exception eee) {
- log.error("Migration impossible de la base", eee);
- conn.rollback();
- } finally {
- conn.close();
- }
- } catch (Exception eee) {
- log.error("Erreur lors de la tentative de migration", eee);
- }
- return result;
- }
-
- /** Migration de la version 0 à 1.1 */
- private void migrateTo1_1(Connection conn, Dialect dialect)
- throws SQLException {
- log.info("Migrate to version 1_1");
- String[] sqls = null;
-
- // Script de migration
- if (dialect instanceof PostgreSQLDialect) {
- sqls = new String[] {
- "alter table useraccount rename langage to language;",
- "alter table pollaccount add accountid varchar;",
- "update pollaccount set accountid=md5(topiaid);",
- "alter table persontolist drop column hasvoted;",
- "alter table persontolist add hasvoted boolean default false;",
- "alter table vote add anonymous boolean default false;",
- "alter table preventrule add active boolean default true;",
- "alter table preventrule add onetime boolean default false;", };
- } else if (dialect instanceof H2Dialect) {
- sqls = new String[] {
- "alter table useraccount alter column langage rename to language;",
- "alter table pollaccount add accountid varchar;",
- "update pollaccount set accountid=hash('sha256', stringtoutf8(topiaid), 1000);",
- "alter table persontolist drop column hasvoted;",
- "alter table persontolist add hasvoted boolean default false;",
- "alter table vote add anonymous boolean default false;",
- "alter table preventrule add active boolean default true;",
- "alter table preventrule add onetime boolean default false;", };
- } else {
- if (log.isErrorEnabled()) {
- log
- .error("Migration non prise en charge pour ce type de dialect : "
- + dialect);
- }
- }
-
- // Exécution de la migration
- for (String sql : sqls) {
- log.info("try " + sql);
- PreparedStatement sta = conn.prepareStatement(sql);
- sta.executeUpdate();
- log.info("done " + sql);
- }
- }
-
- /** Migration de la version 1.1 à 1.2 */
- private void migrate1_1To1_2(Connection conn, Dialect dialect)
- throws SQLException {
- log.info("Migrate version 1_1 to version 1_2");
- String[] sqls = null;
-
- // Script de migration
- if (dialect instanceof PostgreSQLDialect) {
- sqls = new String[] {
- "alter table poll add endchoicedate timestamp without time zone;" };
- } else if (dialect instanceof H2Dialect) {
- sqls = new String[] {
- "alter table poll add endchoicedate timestamp before begindate;" };
- } else {
- if (log.isErrorEnabled()) {
- log
- .error("Migration non prise en charge pour ce type de dialect : "
- + dialect);
- }
- }
-
- // Exécution de la migration
- for (String sql : sqls) {
- log.info("try " + sql);
- PreparedStatement sta = conn.prepareStatement(sql);
- sta.executeUpdate();
- log.info("done " + sql);
- }
- }
-
- /** Migration de la version 1.2 à 1.3 */
- private void migrate1_2To1_3(Connection conn, Dialect dialect)
- throws SQLException {
- log.info("Migrate version 1_1 to version 1_2");
- String[] sqls = null;
-
- // Script de migration
- if (dialect instanceof PostgreSQLDialect) {
- sqls = new String[] {
- // VoteCounting becomes a String field instead of a table
- "alter table poll add votecounting1 varchar;",
- "update poll as p set votecounting1 = (select v.name from votecounting v where v.topiaId = p.votecounting);",
- "alter table poll drop column votecounting;",
- "alter table poll rename votecounting1 to votecounting;",
- "alter table result add votecounting1 varchar;",
- "update result as r set votecounting1 = (select v.name from votecounting v where v.topiaId = r.votecounting);",
- "alter table result drop column votecounting;",
- "alter table result rename votecounting1 to votecounting;",
- "drop table votecounting;",
- // PollType becomes a String field instead of a table
- "alter table poll add polltype1 varchar;",
- "update poll as p set polltype1 = (select t.name from polltype t where t.topiaId = p.polltype);",
- "alter table poll drop column polltype;",
- "alter table poll rename polltype1 to polltype;",
- "drop table polltype;",
- // ChoiceType becomes a String field instead of a table
- "alter table poll add choicetype1 varchar;",
- "update poll as p set choicetype1 = (select t.name from choicetype t where t.topiaId = p.choicetype);",
- "alter table poll drop column choicetype;",
- "alter table poll rename choicetype1 to choicetype;",
- "drop table choicetype;",
- // Remove link between comment and pollAccount : only name
- // is needed
- "alter table comment add author varchar;",
- "update comment as c set author = (select a.votingId from pollaccount a where a.topiaId = c.pollaccount);",
- "alter table comment drop column pollaccount;"
- };
- } else if (dialect instanceof H2Dialect) {
- sqls = new String[] {
- // VoteCounting becomes a String field instead of a table
- "alter table poll add votecounting1 varchar;",
- "update poll as p set votecounting1 = (select v.name from votecounting v where v.topiaId = p.votecounting);",
- "alter table result add votecounting1 varchar;",
- "update result as r set votecounting1 = (select v.name from votecounting v where v.topiaId = r.votecounting);",
- "drop table votecounting;",
- "alter table poll drop column votecounting;",
- "alter table poll alter column votecounting1 rename to votecounting;",
- "alter table result drop column votecounting;",
- "alter table result alter column votecounting1 rename to votecounting;",
- // PollType becomes a String field instead of a table
- "alter table poll add polltype1 varchar;",
- "update poll as p set polltype1 = (select t.name from polltype t where t.topiaId = p.polltype);",
- "drop table polltype;",
- "alter table poll drop column polltype;",
- "alter table poll alter column polltype1 rename to polltype;",
- // ChoiceType becomes a String field instead of a table
- "alter table poll add choicetype1 varchar;",
- "update poll as p set choicetype1 = (select t.name from choicetype t where t.topiaId = p.choicetype);",
- "drop table choicetype;",
- "alter table poll drop column choicetype;",
- "alter table poll alter column choicetype1 rename to choicetype;",
- // Remove link between comment and pollAccount : only name
- // is needed
- "alter table comment add author varchar;",
- "update comment as c set author = (select a.votingId from pollaccount a where a.topiaId = c.pollaccount);",
- "update comment set pollaccount = null;"
- // FIXME-FD20100224
- // org.h2.jdbc.JdbcSQLException: Column may be referenced
- // by "PUBLIC.FK38A5EE5F65D3F731"; SQL statement:
- // can't drop constraint because the name is generated by
- // hibernate
-// "alter table comment drop column pollaccount;"
- };
- } else {
- if (log.isErrorEnabled()) {
- log
- .error("Migration non prise en charge pour ce type de dialect : "
- + dialect);
- }
- }
-
- // Exécution de la migration
- for (String sql : sqls) {
- log.info("try " + sql);
- PreparedStatement sta = conn.prepareStatement(sql);
- sta.executeUpdate();
- log.info("done " + sql);
- }
- }
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/migration/package-info.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/migration/package-info.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/migration/package-info.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,4 +0,0 @@
-/**
- * Migration de la base de données.
- */
-package org.chorem.pollen.business.migration;
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/SendMail.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/SendMail.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/SendMail.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,259 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import java.io.BufferedOutputStream;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.Reader;
-import java.io.Writer;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.io.FileUtils;
-import org.chorem.pollen.business.utils.MailUtil;
-import org.nuiton.util.FileUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import au.com.bytecode.opencsv.CSVReader;
-import au.com.bytecode.opencsv.CSVWriter;
-import org.apache.commons.io.IOUtils;
-import org.chorem.pollen.business.PollenContextImplementor;
-import org.chorem.pollen.business.PollenProperty;
-
-/**
- * Mass mail management class.
- *
- * This class store email to send in a csv file, and send it (one per second) in
- * a second time.
- * This class can restart to send mail at application restart.
- *
- * For a mass mail sending to start, following files must be present:
- * <ul>
- * <li>xxx.emails : CSV file ("email", "subject", "body")</li>
- * <li>xxx.index : next index to manage ( inited at 0)</li>
- * </ul>
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-public class SendMail extends Thread {
-
- /** logger. */
- private static final Logger log = LoggerFactory.getLogger(SendMail.class);
-
- protected PollenContextImplementor context;
-
- public static final String EXTENSION_MAIL = ".mail";
- public static final String EXTENSION_INDEX = ".index";
-
- /** Mail storage directory. */
- protected File mailStorageDirectory;
-
- protected volatile boolean stop;
-
- public SendMail(PollenContextImplementor context) {
- this.context = context;
- if (log.isInfoEnabled()) {
- log.info("P:[ SendMail ] init");
- }
- // get email directory in configuration
- // create it if not exists
- String filename = context.getProperty(PollenProperty.EMAIL_DIR);
- mailStorageDirectory = new File(filename);
- if (!mailStorageDirectory.exists()) {
- if (mailStorageDirectory.mkdirs()) {
- if (log.isDebugEnabled()) {
- log.debug("Email storage directory created in : " + mailStorageDirectory.getAbsolutePath());
- }
- }
- }
- }
-
- public synchronized void stopExec() {
- stop = true;
- }
-
- /*
- * @see java.lang.Runnable#run()
- */
- @Override
- public void run() {
- if (log.isInfoEnabled()) {
- log.info("P:[ SendMail ] start");
- }
-
- // try to find existing files
- while (!stop) {
- try {
- sendAllMails();
-
- // bloque thread until next notify
- sleep();
- }
- catch (Exception ex) {
- if (log.isErrorEnabled()) {
- log.error("Error during SendMail main loop", ex);
- }
- }
- }
- }
-
- protected synchronized void sleep() throws InterruptedException {
- wait();
- }
-
- public synchronized void wakeUp() {
- notifyAll();
- }
-
- /**
- * Look for all xx.index file, and restart mail sending on
- * non ending mass mail sending.
- *
- * After execution, delete mail and index file.
- * @throws IOException
- */
- protected void sendAllMails() throws IOException {
-
- // don't do for, allways take the first found
- // a new one can be created when managing one other
- List<File> indexFiles = null;
- do {
-
- // filter is java valid : .*\\.index
- indexFiles = FileUtil.find(mailStorageDirectory, ".*\\" + EXTENSION_INDEX, false);
-
- if (!indexFiles.isEmpty()) {
- File indexFile = indexFiles.get(0);
- // convert index content to int
- String indexContent = FileUtils.readFileToString(indexFile, "UTF-8");
- int index = Integer.parseInt(indexContent);
-
- // get mail content file
- File mailFile = new File(indexFile.getAbsolutePath().replaceAll(EXTENSION_INDEX + "$", EXTENSION_MAIL));
-
- if (log.isDebugEnabled()) {
- log.debug("Managing mail file : " + mailFile + " (from index " + indexContent + ")");
- }
-
- Reader indexFileReader = new BufferedReader(new FileReader(mailFile));
- CSVReader cvsReader = new CSVReader(indexFileReader);
-
- int currentIndex = 0;
- String[] currentLine = cvsReader.readNext();
- while (currentLine != null) {
- String receiver = currentLine[0];
- String subject = currentLine[1];
- String body = currentLine[2];
-
- // index contains next index to treat so == is ok
- if (currentIndex >= index) {
- String host =
- context.getProperty(PollenProperty.EMAIL_HOST);
- int port = Integer.parseInt(
- context.getProperty(PollenProperty.EMAIL_PORT));
- String from =
- context.getProperty(PollenProperty.EMAIL_FROM);
- MailUtil.sendMail(host, port, from,
- receiver, subject, body);
-
- // index contains next index to treat
- FileUtils.writeStringToFile(indexFile, String.valueOf(currentIndex + 1));
-
- // wait 2 secondes between each mail to not
- // load smtp server
- try {
- Thread.sleep(1000);
- } catch (InterruptedException ex) {
- if (log.isErrorEnabled()) {
- log.error("Can't wait between mail", ex);
- }
- }
- }
- else {
- if (log.isDebugEnabled()) {
- log.debug("Mail to " + receiver + " already sent in a previous execution, skip.");
- }
- }
-
- currentIndex++;
- currentLine = cvsReader.readNext();
- }
-
- // delete woth index and mail file
- mailFile.delete();
- indexFile.delete();
- }
- else {
- if (log.isInfoEnabled()) {
- log.info("No more index mail index file found, go to sleep a while :)");
- }
- }
- } while (!indexFiles.isEmpty());
- }
-
- /**
- * Prepare mail list.
- *
- * TODO : improve configuration reading
- *
- * @param id
- * @param mailData
- * @throws IOException
- */
- public void prepareMails(String id, List<Map<String, String>> mailData) throws IOException {
-
- Writer fileWriter = null;
- CSVWriter cvsWriter = null;
- try {
-
- // write CSV datas
- File emailFile = new File(mailStorageDirectory, id + EXTENSION_MAIL);
- fileWriter = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(emailFile)));
- cvsWriter = new CSVWriter(fileWriter);
-
- for (Map<String, String> singleMailData : mailData) {
- String[] nextLine = new String[] {
- singleMailData.get("receiver"),
- singleMailData.get("subject"),
- singleMailData.get("body")
- };
- cvsWriter.writeNext(nextLine);
- }
-
- // write index (default to 0)
- File indexFile = new File(mailStorageDirectory, id + EXTENSION_INDEX);
- FileUtil.writeString(indexFile, "0");
- }
- finally {
- if (cvsWriter != null) {
- cvsWriter.close();
- }
- IOUtils.closeQuietly(fileWriter);
- }
-
- }
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceAuth.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceAuth.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceAuth.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,47 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import org.chorem.pollen.business.dto.UserDTO;
-
-/**
- * Interface du service d'authentification.
- *
- * @author kmorin
- * @version $Id$
- */
-public interface ServiceAuth {
-
- /**
- * Identification d'un utilisateur. Vérification du couple login, password.
- *
- * @param login le login de l'utilisateur à identifié
- * @param password le password entré par l'utilisateur
- * @return vrai si l'utilisateur est identifié, false sinon
- */
- public boolean isLoginRight(String login, String password);
-
- /**
- * Identification d'un utilisateur. Récupération des informations de cet
- * utilisateur.
- *
- * @param login le login de l'utilisateur à identifié
- * @param password le password entré par l'utilisateur
- * @return l'utilisateur identifié par le login
- */
- public UserDTO getUser(String login, String password);
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceAuthImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceAuthImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceAuthImpl.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,111 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.PollenContext;
-import org.chorem.pollen.business.PollenContextImplementor;
-import org.chorem.pollen.business.converters.DataUserConverter;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.business.persistence.UserAccount;
-import org.chorem.pollen.business.persistence.UserAccountDAO;
-import org.chorem.pollen.business.utils.ContextUtil;
-import org.nuiton.topia.TopiaContext;
-
-/**
- * Implémentation du service d'authentification.
- *
- * @author kmorin
- * @author rannou
- * @version $Id$
- */
-public class ServiceAuthImpl implements ServiceAuth {
-
- private PollenContextImplementor context;
- private UserAccountDAO userDAO = null;
- private DataUserConverter converter = new DataUserConverter();
-
- /** log. */
- private static final Log log = LogFactory.getLog(ServiceAuthImpl.class);
-
- public ServiceAuthImpl(PollenContextImplementor context) {
- this.context = context;
- }
-
- @Override
- public boolean isLoginRight(String login, String password) {
- TopiaContext transaction = null;
- boolean result = false;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- userDAO = PollenModelDAOHelper.getUserAccountDAO(transaction);
-
- UserAccount userEntity = userDAO.findByLogin(login);
- if (userEntity != null && password.equals(userEntity.getPassword())) {
- result = true;
- }
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity found: "
- + ((userEntity == null) ? "null" : userEntity
- .getLogin()));
- }
-
- return result;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return false;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public UserDTO getUser(String login, String password) {
- TopiaContext transaction = null;
- UserDTO result = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- userDAO = PollenModelDAOHelper.getUserAccountDAO(transaction);
-
- UserAccount userEntity = userDAO.findByLogin(login);
- if (userEntity != null && password.equals(userEntity.getPassword())) {
- result = converter.createUserDTO(userEntity);
- }
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity found: "
- + ((result == null) ? "null" : result.getLogin()));
- }
-
- return result;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceChoice.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceChoice.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceChoice.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,94 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import java.util.List;
-import java.util.Map;
-
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.persistence.Choice;
-import org.nuiton.topia.TopiaContext;
-
-/**
- * Interface de gestion des choix
- *
- * @author enema
- * @version $Id$
- */
-public interface ServiceChoice {
-
- /**
- * Création d'un choix
- *
- * @param choice le dto choix
- * @return l'identifiant du choix
- * @deprecated only used for tests or internal
- */
- @Deprecated
- public String createChoice(ChoiceDTO choice);
-
- /**
- * Mise à jour d'un choix pour un sondage
- *
- * @param choiceDTO
- * @return true si le choix a été mise à jours
- * @deprecated only used for tests or internal
- */
- @Deprecated
- public boolean updateChoice(ChoiceDTO choiceDTO);
-
- /**
- * Suppression d'un choix de sondage
- *
- * @param choiceId l'identifiant du choix
- * @return true si le choix a été mis à jours
- * @deprecated use {@link org.chorem.pollen.business.services.ServicePoll#deleteChoice(org.chorem.pollen.business.dto.PollDTO, java.lang.String) }
- */
- @Deprecated
- public boolean deleteChoice(String choiceId);
-
- /**
- * Recherche d'un choix par son identifiant
- *
- * @param choiceId l'identifiant du choix
- * @return le choix
- * @deprecated only used for tests or internal
- */
- @Deprecated
- public ChoiceDTO findChoiceById(String choiceId);
-
- /**
- * Recherche de choix d'un sondage à partir du nom
- *
- * @param choiceName le nom du choix
- * @param pollId l'identifiant du sondage
- * @return les choix
- * @deprecated never used
- */
- @Deprecated
- public List<ChoiceDTO> findChoicesByName(String choiceName, String pollId);
-
- /**
- * Recherche de tous les choix d'un sondage
- *
- * @param properties filtre sur les champs de la table choix
- * @return les choix du sondage
- * @deprecated only used for tests
- */
- @Deprecated
- public List<ChoiceDTO> selectChoices(Map<String, Object> properties);
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceChoiceImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceChoiceImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceChoiceImpl.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,273 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.PollenContextImpl;
-import org.chorem.pollen.business.PollenContextImplementor;
-import org.chorem.pollen.business.converters.DataChoiceConverter;
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.persistence.Choice;
-import org.chorem.pollen.business.persistence.ChoiceDAO;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.business.utils.ContextUtil;
-import org.nuiton.topia.TopiaContext;
-
-/**
- * Gestion des choix d'un sondage.
- *
- * @author enema
- * @version $Id$
- */
-public class ServiceChoiceImpl implements ServiceChoice {
-
- private PollenContextImplementor context;
- private ChoiceDAO choiceDAO = null;
- private DataChoiceConverter converter = new DataChoiceConverter();
-
- /** log. */
- private static final Log log = LogFactory.getLog(ServiceChoiceImpl.class);
-
- public ServiceChoiceImpl(PollenContextImplementor context) {
- this.context = context;
- }
-
- @Override
- public String createChoice(ChoiceDTO choice) {
- TopiaContext transaction = null;
- String topiaId = "";
- try {
- transaction = context.getRootContext().beginTransaction();
-
- choiceDAO = PollenModelDAOHelper.getChoiceDAO(transaction);
-
- Choice choiceEntity = choiceDAO.create();
- converter.setTransaction(transaction);
- converter.populateChoiceEntity(choice, choiceEntity);
-
- topiaId = choiceEntity.getTopiaId();
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity created: " + topiaId);
- }
-
- return topiaId;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return "";
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
-// @Override
-// public List<Choice> createChoices(List<ChoiceDTO> choices, String pollId,
-// TopiaContext transaction) {
-// if (choices.isEmpty() || pollId.length() == 0) {
-// return null;
-// }
-//
-// List<Choice> result = null;
-// try {
-// choiceDAO = PollenModelDAOHelper.getChoiceDAO(transaction);
-// converter.setTransaction(transaction);
-//
-// result = new ArrayList<Choice>();
-// for (ChoiceDTO choice : choices) {
-// Choice choiceEntity = choiceDAO.create();
-// choice.setId(choiceEntity.getTopiaId());
-// //choice.setPollUId(pollId);
-// converter.populateChoiceEntity(choice, choiceEntity);
-// result.add(choiceEntity);
-// }
-//
-// return result;
-// } catch (Exception e) {
-// ContextUtil.doCatch(e, transaction);
-// return null;
-// }
-// }
-
- @Override
- public boolean updateChoice(ChoiceDTO choiceDTO) {
- TopiaContext transaction = null;
- boolean resu = false;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- choiceDAO = PollenModelDAOHelper.getChoiceDAO(transaction);
-
- Choice choiceEntity = choiceDAO.findByTopiaId(choiceDTO.getId());
- if (choiceEntity != null) {
- converter.setTransaction(transaction);
- converter.populateChoiceEntity(choiceDTO, choiceEntity);
-
- choiceDAO.update(choiceEntity);
- transaction.commitTransaction();
- resu = true;
- }
-
- if (log.isDebugEnabled()) {
- log.debug("Entity updated: " + choiceDTO.getId());
- }
-
- return resu;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return false;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public boolean deleteChoice(String choiceId) {
- TopiaContext transaction = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- choiceDAO = PollenModelDAOHelper.getChoiceDAO(transaction);
-
- Choice choiceEntity = choiceDAO.findByTopiaId(choiceId);
-
- choiceDAO.delete(choiceEntity);
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity deleted: " + choiceId);
- }
-
- return true;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return false;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public ChoiceDTO findChoiceById(String choiceId) {
- TopiaContext transaction = null;
- ChoiceDTO result = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- choiceDAO = PollenModelDAOHelper.getChoiceDAO(transaction);
-
- Choice choiceEntity = choiceDAO.findByTopiaId(choiceId);
-
- if (choiceEntity != null) {
- converter.setTransaction(transaction);
- result = converter.createChoiceDTO(choiceEntity);
- }
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity found: "
- + ((result == null) ? "null" : result.getId()));
- }
-
- return result;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public List<ChoiceDTO> findChoicesByName(String choiceName, String pollId) {
- TopiaContext transaction = null;
- List<ChoiceDTO> results = null;
- List<Choice> choiceEntities = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- choiceDAO = PollenModelDAOHelper.getChoiceDAO(transaction);
-
- HashMap<String, Object> properties = new HashMap<String, Object>();
- properties.put("pollId", pollId);
- properties.put("name", choiceName);
-
- choiceEntities = choiceDAO.findAllByProperties(properties);
-
- converter.setTransaction(transaction);
- results = converter.createChoiceDTOs(choiceEntities);
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entities found: "
- + ((results == null) ? "null" : results.size()));
- }
-
- return results;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public List<ChoiceDTO> selectChoices(Map<String, Object> properties) {
- TopiaContext transaction = null;
- List<ChoiceDTO> results = null;
- List<Choice> choiceEntities = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- choiceDAO = PollenModelDAOHelper.getChoiceDAO(transaction);
-
- if (properties == null) {
- choiceEntities = choiceDAO.findAll();
- if (log.isWarnEnabled()) {
- log
- .warn("Attention : tous les choix ont été sélectionnés !");
- }
- } else {
- choiceEntities = choiceDAO.findAllByProperties(properties);
- }
- converter.setTransaction(transaction);
- results = converter.createChoiceDTOs(choiceEntities);
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entities found: "
- + ((results == null) ? "null" : results.size()));
- }
-
- return results;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceList.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceList.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceList.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,111 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import java.util.List;
-import java.util.Map;
-
-import org.chorem.pollen.business.dto.PersonListDTO;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.VotingListDTO;
-import org.chorem.pollen.business.persistence.VotingList;
-import org.nuiton.topia.TopiaContext;
-
-/**
- * Interface du service de gestion des listes de votants et des listes de
- * favoris.
- *
- * @author enema
- * @version $Id$
- */
-public interface ServiceList {
-
- /**
- * Création d'une liste de votant
- *
- * @param votingList la liste
- * @return identifiant de la liste créée
- * @deprecated useless method : used only in tests
- */
- @Deprecated
- public String createVotingList(VotingListDTO votingList);
-
- /**
- * Mise à jour d'une liste de votant
- *
- * @param votingList la liste
- * @return true si la liste a été mise à jours
- */
- public boolean updateVotingList(VotingListDTO votingList);
-
- /**
- * Création d'une liste de favoris
- *
- * @param personList la liste
- * @return identifiant de la liste créée
- */
- public String createPersonList(PersonListDTO personList);
-
- /**
- * Create an {@code account} in a {@code personList}.
- *
- * @param personList where the account will be added
- * @param account to create
- */
- void createAccountInPersonList(PersonListDTO personList,
- PollAccountDTO account);
-
- /**
- * Delete an account using its {@code accountId} from a {@code personList}.
- *
- * @param personList where the account will be removed
- * @param accountId topiaId of the account to delete
- */
- void deleteAccountFromPersonList(PersonListDTO personList, String accountId);
-
- /**
- * Suppression d'une liste de favoris
- *
- * @param personListId l'identifiant de la liste
- * @return true si la liste a été supprimée
- */
- public boolean deletePersonList(String personListId);
-
- /**
- * Suppression des listes de favoris d'un utilisateur
- *
- * @param userId l'identifiant de l'utilisateur
- * @return true si les listes ont été supprimées
- */
- public boolean deletePersonLists(String userId);
-
- /**
- * Recherche d'une liste par son identifiant
- *
- * @param personListId l'identifiant de la liste
- * @return la liste
- */
- public PersonListDTO findPersonListById(String personListId);
-
- /**
- * Recherche des listes de favoris d'un utilisateur.
- *
- * @param userId Le créateur de la liste
- * @return les listes
- */
- public List<PersonListDTO> findPersonListByUser(String userId);
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceListImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceListImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceListImpl.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,385 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.PollenContext;
-import org.chorem.pollen.business.PollenContextImplementor;
-import org.chorem.pollen.business.converters.DataPersonListConverter;
-import org.chorem.pollen.business.converters.DataVotingListConverter;
-import org.chorem.pollen.business.dto.PersonListDTO;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.VotingListDTO;
-import org.chorem.pollen.business.persistence.PersonList;
-import org.chorem.pollen.business.persistence.PersonListDAO;
-import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.business.persistence.PollAccountDAO;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.business.persistence.UserAccount;
-import org.chorem.pollen.business.persistence.UserAccountDAO;
-import org.chorem.pollen.business.persistence.VotingList;
-import org.chorem.pollen.business.persistence.VotingListDAO;
-import org.chorem.pollen.business.utils.ContextUtil;
-import org.nuiton.topia.TopiaContext;
-import static org.nuiton.i18n.I18n.n_;
-
-/**
- * Implémentation du service de gestion des listes.
- *
- * @author enema
- * @author rannou
- * @version $Id$
- */
-public class ServiceListImpl implements ServiceList {
-
- private PollenContextImplementor context;
- private VotingListDAO votingListDAO = null;
- private PersonListDAO personListDAO = null;
- private DataVotingListConverter votingListConverter = new DataVotingListConverter();
- private DataPersonListConverter personListConverter = new DataPersonListConverter();
-
- /** log. */
- private static final Log log = LogFactory.getLog(ServiceListImpl.class);
-
- public ServiceListImpl(PollenContextImplementor context) {
- this.context = context;
-
- this.context.getConverter().preparePollAccountConverters();
- this.context.getConverter().prepareVotingListConverters();
- }
-
- @Override
- public String createVotingList(VotingListDTO votingList) {
- TopiaContext transaction = null;
- String topiaId = "";
- try {
- transaction = context.getRootContext().beginTransaction();
-
- votingListDAO = PollenModelDAOHelper.getVotingListDAO(transaction);
-
- VotingList votingListEntity = votingListDAO.create();
-
- votingListConverter.setTransaction(transaction);
- votingListConverter.populateVotingListEntity(votingList,
- votingListEntity);
-
- // Création des pollAccount de la liste si nécessaire
- // FIXME do not call a Service from an other one
- ServicePollAccount spa = new ServicePollAccountImpl(context);
- //spa.createPollAccounts(votingList.getPollAccountDTOs(), transaction);
- for (PollAccountDTO account : votingList.getPollAccountDTOs()) {
- if (spa.findPollAccountById(account.getId()) == null) {
- account.setId(spa.createPollAccount(account));
- }
- }
-
- // Création des PersonToList
- votingListConverter.populatePersonVotingList(votingList,
- votingListEntity);
-
- topiaId = votingListEntity.getTopiaId();
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity created: " + topiaId);
- }
-
- return topiaId;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return "";
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public boolean updateVotingList(VotingListDTO votingList) {
- TopiaContext transaction = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- votingListDAO = PollenModelDAOHelper.getVotingListDAO(transaction);
-
- VotingList entity = votingListDAO.findByTopiaId(votingList.getId());
-
- votingListConverter.setTransaction(transaction);
- votingListConverter.populateVotingListEntity(votingList, entity);
-
- votingListDAO.update(entity);
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity updated: " + votingList.getId());
- }
-
- return true;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return false;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public String createPersonList(PersonListDTO personList) {
- TopiaContext transaction = null;
- String topiaId = "";
- try {
- transaction = context.getRootContext().beginTransaction();
-
- personListDAO = PollenModelDAOHelper.getPersonListDAO(transaction);
- PersonList entity = personListDAO.create();
-
- personListConverter.setTransaction(transaction);
- personListConverter.populatePersonListEntity(personList, entity);
-
- // Création des comptes de la liste
- // FIXME do not call a Service from an other one
- ServicePollAccount spa = new ServicePollAccountImpl(context);
- for (PollAccountDTO account : personList.getPollAccounts()) {
- account.setPersonListId(entity.getTopiaId());
- }
- entity.setPollAccount(spa.createPollAccounts(personList
- .getPollAccounts(), transaction));
-
- topiaId = entity.getTopiaId();
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity created: " + topiaId);
- }
-
- return topiaId;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return "";
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public void createAccountInPersonList(PersonListDTO personList, PollAccountDTO account) {
- TopiaContext transaction = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- personListDAO = PollenModelDAOHelper.getPersonListDAO(transaction);
-
- PersonList eList = personListDAO.findByTopiaId(personList.getId());
-
- PollAccountDAO accountDAO =
- PollenModelDAOHelper.getPollAccountDAO(transaction);
-
- // Create new pollAccount
- String accountUID = context.createPollenUrlId();
- PollAccount eAccount = accountDAO.create(accountUID);
- context.getConverter().convert(account, eAccount);
-
- // Add the account into the list
- eList.addPollAccount(eAccount);
-
- transaction.commitTransaction();
-
- // Update change in dtos
- account.setId(eAccount.getTopiaId());
- account.setAccountUId(eAccount.getAccountId());
- personList.addPollAccount(account);
-
- } catch (Exception eee) {
- context.doCatch(transaction, eee,
- n_("pollen.error.serviceList.createAccountForPersonList"),
- personList.getName(), account.getVotingId());
- } finally {
- context.doFinally(transaction);
- }
- }
-
- @Override
- public void deleteAccountFromPersonList(PersonListDTO personList, String accountId) {
- TopiaContext transaction = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- // Find the account
- PollAccountDAO accountDAO =
- PollenModelDAOHelper.getPollAccountDAO(transaction);
- PollAccount eAccount = accountDAO.findByTopiaId(accountId);
-
- personListDAO = PollenModelDAOHelper.getPersonListDAO(transaction);
-
- PersonList eList = personListDAO.findByTopiaId(personList.getId());
-
- // The remove will delete the comment because no poll will be
- // attached to him (delete-orphan)
- eList.removePollAccount(eAccount);
-
- accountDAO.delete(eAccount);
-
- transaction.commitTransaction();
-
- // Update change in dto
- personList.removePollAccount(accountId);
-
- } catch (Exception eee) {
- context.doCatch(transaction, eee,
- n_("pollen.error.serviceList.deleteAccountFromPersonList"),
- accountId, personList.getName(), personList.getId());
- } finally {
- context.doFinally(transaction);
- }
- }
-
- @Override
- public boolean deletePersonList(String personListId) {
- TopiaContext transaction = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- personListDAO = PollenModelDAOHelper.getPersonListDAO(transaction);
-
- PersonList entity = personListDAO.findByTopiaId(personListId);
-
- personListDAO.delete(entity);
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity deleted: " + personListId);
- }
-
- return true;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return false;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public boolean deletePersonLists(String userId) {
- TopiaContext transaction = null;
- List<PersonList> personListEntities = null;
- UserAccountDAO userDAO = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- userDAO = PollenModelDAOHelper.getUserAccountDAO(transaction);
- UserAccount user = userDAO.findByTopiaId(userId);
-
- personListEntities = new ArrayList<PersonList>();
- personListEntities.addAll(user.getFavoriteList());
-
- personListDAO = PollenModelDAOHelper.getPersonListDAO(transaction);
-
- for (PersonList entity : personListEntities) {
- personListDAO.delete(entity);
- }
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug(personListEntities.size()
- + " entities deleted for user: " + userId);
- }
-
- return true;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return false;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public PersonListDTO findPersonListById(String personListId) {
- TopiaContext transaction = null;
- PersonListDTO result = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- personListDAO = PollenModelDAOHelper.getPersonListDAO(transaction);
-
- PersonList personListEntity = personListDAO
- .findByTopiaId(personListId);
-
- if (personListEntity != null) {
- personListConverter.setTransaction(transaction);
- result = personListConverter
- .createPersonListDTO(personListEntity);
- }
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity found: "
- + ((result == null) ? "null" : result.getId()));
- }
-
- return result;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public List<PersonListDTO> findPersonListByUser(String userId) {
- TopiaContext transaction = null;
- List<PersonListDTO> results = null;
- List<PersonList> personListEntities = null;
- UserAccountDAO userDAO = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- userDAO = PollenModelDAOHelper.getUserAccountDAO(transaction);
- UserAccount user = userDAO.findByTopiaId(userId);
-
- personListEntities = new ArrayList<PersonList>();
- personListEntities.addAll(user.getFavoriteList());
-
- personListConverter.setTransaction(transaction);
- results = personListConverter
- .createPersonListDTOs(personListEntities);
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entities found: "
- + ((results == null) ? "null" : results.size()));
- }
-
- return results;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePoll.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePoll.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePoll.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,164 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import java.util.List;
-import java.util.Map;
-
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.dto.CommentDTO;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-
-/**
- * Interface du service de gestion des sondages.
- *
- * @author enema
- * @version $Id$
- */
-public interface ServicePoll {
-
- /**
- * Création d'un sondage
- *
- * @param poll le sondage
- * @return identifiant du sondage créé
- */
- public String createPoll(PollDTO poll);
-
- /**
- * Mise à jour du sondage
- *
- * @param poll le sondage
- * @return true si le sondage a été mise à jour
- */
- public boolean updatePoll(PollDTO poll);
-
- /**
- * Suppression du sondage
- *
- * @param pollId le sondage
- * @return true si le sondage a été supprimé
- */
- public boolean deletePoll(String pollId);
-
- /**
- * Get a new poll for creation form.
- *
- * @return a new PollDTO with params initialized
- */
- public PollDTO getNewPoll();
-
- /**
- * Get a new poll which is a copy from the {@code poll}.
- *
- * @param poll to copy
- * @return a new poll which is a copy from the one in argument
- */
- public PollDTO getNewPoll(PollDTO poll);
-
- /**
- * Récupération d'un sondage à partir de son identifiant.
- *
- * @param pollId identifiant du sondage (différent du topiaId)
- * @return le sondage
- */
- public PollDTO getPoll(String pollId);
-
- /**
- * Récupération des sondages d'un utilisateur
- *
- * @param userId Le créateur du sondage
- * @return liste de sondages
- */
- public List<PollDTO> findPollsByUser(String userId);
-
- /**
- * Récupération des sondages auxquels un utilisateur a participé.
- *
- * @param userId L'identifiant de l'utilisateur
- * @return liste de sondages
- */
- public List<PollDTO> findParticipatedPolls(String userId);
-
- /**
- * Récupération des sondages auxquels un utilisateur est invité.
- *
- * @param userId L'identifiant de l'utilisateur
- * @return liste de sondages
- */
- public List<PollDTO> findInvitedPolls(String userId);
-
- /**
- * Récupération des sondages en cours.
- *
- * @param withEndDate sélectionner uniquement les sondages ayant une date de
- * fin
- * @return liste de sondages
- */
- public List<PollDTO> findRunningPolls(boolean withEndDate);
-
- /**
- * Récupération des sondages
- *
- * @param properties filtre
- * @return liste de sondages
- */
- public List<PollDTO> selectPolls(Map<String, Object> properties);
-
- /**
- * Create a comment for the poll.
- *
- * @param poll owner of the comment
- * @param comment to create
- */
- public void createComment(PollDTO poll, CommentDTO comment);
-
- /**
- * Delete a comment from a {@code poll}.
- *
- * @param poll owner of the comment
- * @param commentId id of the comment to delete
- */
- public void deleteComment(PollDTO poll, String commentId);
-
- /**
- * Retrieve all comments for the {@code poll}
- *
- * @param poll owner of the comment
- * @return the list of comments of the poll
- */
- public List<CommentDTO> getComments(PollDTO poll);
-
-
- /**
- * Return the pollAccount corresponding to the {@code accountUId} for the
- * restricted {@code poll}.
- * TODO : need JUnit test, must be done for 1.3
- *
- * @param accountUId to check the restriction constraint
- * @param poll reference
- * @return the pollAccount found from poll or null if there is no
- * pollAccount in poll restriction for the accountUId in argument
- */
- public PollAccountDTO getRestrictedAccount(String accountUId, PollDTO poll);
-
- public ChoiceDTO getNewHiddenChoice(ChoiceDTO choice, String votingId);
-
- public void createChoice(PollDTO poll, ChoiceDTO choice);
-
- public void deleteChoice(PollDTO poll, String choiceId);
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccount.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccount.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccount.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,89 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import java.util.List;
-
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.persistence.PollAccount;
-import org.nuiton.topia.TopiaContext;
-
-/**
- * Interface du service de gestion des comptes.
- *
- * @author kmorin
- * @version $Id$
- */
-public interface ServicePollAccount {
-
- /**
- * Creation d'un compte utilisateur.
- *
- * @param pollAccount le compte à creer
- * @return le topiaId du compte créé
- * @deprecated useless method : not used in UI
- */
- @Deprecated
- public String createPollAccount(PollAccountDTO pollAccount);
-
- /**
- * Creation des comptes utilisateur.
- *
- * @param pollAccounts les comptes à creer
- * @param transaction la transaction
- * @return les comptes créés
- * @deprecated useless method : not used in UI
- */
- @Deprecated
- public List<PollAccount> createPollAccounts(
- List<PollAccountDTO> pollAccounts, TopiaContext transaction);
-
- /**
- * Suppression d'un compte.
- *
- * @param pollAccountId le compte a creer
- * @return true si le compte a été supprimer
- * @deprecated never used
- */
- @Deprecated
- public boolean deletePollAccount(String pollAccountId);
-
- /**
- * Modification d'un compte.
- *
- * @param pollAccount le compte a modifier
- * @return true si le compte à été modifier
- */
- public boolean updatePollAccount(PollAccountDTO pollAccount);
-
- /**
- * Récupération du compte à partir de son identifiant ToPIA.
- *
- * @param pollAccountId l'identifiant Topia du compte à rechercher
- * @return un compte
- */
- public PollAccountDTO findPollAccountById(String pollAccountId);
-
- /**
- * Récupération du compte à partir de son identifiant.
- *
- * @param pollAccountId l'identifiant du compte à rechercher
- * @return un compte
- */
- public PollAccountDTO findPollAccountByAccountId(String pollAccountId);
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccountImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccountImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccountImpl.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,250 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.PollenContext;
-import org.chorem.pollen.business.PollenContextImplementor;
-import org.chorem.pollen.business.converters.DataPollAccountConverter;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.business.persistence.PollAccountDAO;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.business.utils.ContextUtil;
-import org.nuiton.topia.TopiaContext;
-
-/**
- * Implémentation du service de gestion des comptes.
- *
- * @author kmorin
- * @author rannou
- * @version $Id$
- */
-public class ServicePollAccountImpl implements ServicePollAccount {
-
- private PollenContextImplementor context;
- private PollAccountDAO pollAccountDAO = null;
- private DataPollAccountConverter converter = new DataPollAccountConverter();
-
- /** log. */
- private static final Log log = LogFactory
- .getLog(ServicePollAccountImpl.class);
-
- public ServicePollAccountImpl(PollenContextImplementor context) {
- this.context = context;
- }
-
- @Override
- public String createPollAccount(PollAccountDTO pollAccountDTO) {
- TopiaContext transaction = null;
- String topiaId;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- pollAccountDAO = PollenModelDAOHelper
- .getPollAccountDAO(transaction);
-
- // Identifiant du compte
- String id = ContextUtil.createPollenUrlId();
- PollAccount pollAccountEntity = pollAccountDAO.create(id);
-
- converter.setTransaction(transaction);
- converter.populatePollAccountEntity(pollAccountDTO,
- pollAccountEntity);
-
- topiaId = pollAccountEntity.getTopiaId();
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity created: " + topiaId);
- }
- return topiaId;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public List<PollAccount> createPollAccounts(
- List<PollAccountDTO> pollAccounts, TopiaContext transaction) {
- if (pollAccounts.isEmpty()) {
- return null;
- }
-
- List<PollAccount> result = null;
- try {
- pollAccountDAO = PollenModelDAOHelper.getPollAccountDAO(transaction);
-
- converter.setTransaction(transaction);
-
- result = new ArrayList<PollAccount>();
- for (PollAccountDTO pollAccount : pollAccounts) {
- PollAccount entity = pollAccountDAO.create();
-
- // Identifiants du compte
- String id = UUID.randomUUID().toString();
- pollAccount.setAccountUId(id.replaceAll("-", ""));
- pollAccount.setId(entity.getTopiaId());
-
- converter.populatePollAccountEntity(pollAccount, entity);
- result.add(entity);
- }
-
- return result;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- }
- }
-
- @Override
- public boolean deletePollAccount(String pollAccountId) {
- TopiaContext transaction = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- pollAccountDAO = PollenModelDAOHelper
- .getPollAccountDAO(transaction);
- PollAccount pollAccountEntity = pollAccountDAO
- .findByTopiaId(pollAccountId);
- pollAccountDAO.delete(pollAccountEntity);
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity deleted: " + pollAccountId);
- }
-
- return true;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return false;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public boolean updatePollAccount(PollAccountDTO pollAccountDTO) {
- TopiaContext transaction = null;
- boolean resu = false;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- pollAccountDAO = PollenModelDAOHelper
- .getPollAccountDAO(transaction);
- PollAccount pollAccountEntity = pollAccountDAO
- .findByTopiaId(pollAccountDTO.getId());
-
- if (pollAccountEntity != null) {
- converter.setTransaction(transaction);
- converter.populatePollAccountEntity(pollAccountDTO,
- pollAccountEntity);
-
- pollAccountDAO.update(pollAccountEntity);
- transaction.commitTransaction();
- resu = true;
- }
-
- if (log.isDebugEnabled()) {
- log.debug("Entity updated: " + pollAccountDTO.getId());
- }
-
- return resu;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return false;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public PollAccountDTO findPollAccountById(String pollAccountId) {
- TopiaContext transaction = null;
- PollAccountDTO result = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- pollAccountDAO = PollenModelDAOHelper
- .getPollAccountDAO(transaction);
-
- PollAccount pollAccountEntity = pollAccountDAO
- .findByTopiaId(pollAccountId);
-
- if (pollAccountEntity != null) {
- converter.setTransaction(transaction);
- result = converter.createPollAccountDTO(pollAccountEntity);
- }
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity found: "
- + ((result == null) ? "null" : result.getId()));
- }
-
- return result;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public PollAccountDTO findPollAccountByAccountId(String pollAccountId) {
- TopiaContext transaction = null;
- PollAccountDTO result = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- pollAccountDAO = PollenModelDAOHelper
- .getPollAccountDAO(transaction);
-
- PollAccount pollAccountEntity = pollAccountDAO
- .findByAccountId(pollAccountId);
-
- if (pollAccountEntity != null) {
- converter.setTransaction(transaction);
- result = converter.createPollAccountDTO(pollAccountEntity);
- }
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity found: "
- + ((result == null) ? "null" : result.getId()));
- }
-
- return result;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollImpl.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,885 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-
-import java.util.Set;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.PollenContext;
-import org.chorem.pollen.business.converters.DataPollConverter;
-import org.chorem.pollen.business.converters.DataVotingListConverter;
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.dto.CommentDTO;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.dto.PreventRuleDTO;
-import org.chorem.pollen.business.dto.VotingListDTO;
-import org.chorem.pollen.business.persistence.Choice;
-import org.chorem.pollen.business.persistence.ChoiceDAO;
-import org.chorem.pollen.business.persistence.Comment;
-import org.chorem.pollen.business.persistence.CommentDAO;
-import org.chorem.pollen.business.persistence.PersonToList;
-import org.chorem.pollen.business.persistence.Poll;
-import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.business.persistence.PollAccountDAO;
-import org.chorem.pollen.business.persistence.PollDAO;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.business.persistence.PreventRule;
-import org.chorem.pollen.business.persistence.PreventRuleDAO;
-import org.chorem.pollen.business.persistence.UserAccount;
-import org.chorem.pollen.business.persistence.UserAccountDAO;
-import org.chorem.pollen.business.persistence.Vote;
-import org.chorem.pollen.business.persistence.VotingList;
-import org.chorem.pollen.business.persistence.VotingListDAO;
-import org.chorem.pollen.business.utils.ContextUtil;
-import org.chorem.pollen.business.PollenContextImplementor;
-import org.chorem.pollen.business.persistence.PersonToListDAO;
-import org.chorem.pollen.common.PollType;
-import org.chorem.pollen.common.VoteCountingType;
-import org.chorem.pollen.votecounting.business.NumberMethod;
-import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.TopiaException;
-import org.nuiton.topia.framework.TopiaQuery;
-import org.nuiton.topia.framework.TopiaQuery.Op;
-import static org.nuiton.i18n.I18n._;
-import static org.nuiton.i18n.I18n.n_;
-
-/**
- * Implémentation du service de gestion des sondages.
- *
- * @author Erwan Nema
- * @author rannou
- * @version $Id$
- */
-public class ServicePollImpl implements ServicePoll {
-
- private PollenContextImplementor context;
- private PollDAO pollDAO = null;
- private DataPollConverter converter = new DataPollConverter();
- /** log. */
- private static final Log log = LogFactory.getLog(ServicePollImpl.class);
-
- public ServicePollImpl(PollenContextImplementor context) {
- this.context = context;
-
- this.context.getConverter().preparePollConverters();
- this.context.getConverter().prepareChoiceConverters();
- this.context.getConverter().prepareVotingListConverters();
- this.context.getConverter().preparePollAccountConverters();
- this.context.getConverter().preparePreventRuleConverters();
- this.context.getConverter().prepareVoteConverters();
- this.context.getConverter().prepareCommentConverters();
- }
-
- @Override
- public String createPoll(PollDTO pollDTO) {
- TopiaContext transaction = null;
- String result = null;
- try {
-
- if (log.isInfoEnabled()) {
- log.info("P:[ createPoll ] : " + pollDTO);
- }
-
- transaction = context.getRootContext().beginTransaction();
-
- pollDAO = PollenModelDAOHelper.getPollDAO(transaction);
-
- // Create with the pollId from dto
- String pollId = pollDTO.getPollUId();
- Poll entity = pollDAO.create(pollId);
- context.getConverter().convert(pollDTO, entity);
-
- // ** Manage the poll creator
- PollAccount creator = prepareCreator(transaction, pollDTO);
- entity.setCreator(creator);
-
- // ** Create new choices
- ChoiceDAO choiceDAO = PollenModelDAOHelper.getChoiceDAO(transaction);
- for (ChoiceDTO choiceDTO : pollDTO.getChoices()) {
- Choice choice =
- context.getConverter().convert(choiceDTO, choiceDAO.create());
- choice.setPoll(entity);
- }
-
- // ** Create new votingLists
- for (VotingListDTO listDTO : pollDTO.getVotingListDTOs()) {
- VotingList votingList = createVotingList(transaction, listDTO);
- votingList.setPoll(entity);
- }
-
- // ** Create new preventRules
- PreventRuleDAO ruleDAO =
- PollenModelDAOHelper.getPreventRuleDAO(transaction);
- for (PreventRuleDTO ruleDTO : pollDTO.getPreventRuleDTOs()) {
- PreventRule rule =
- context.getConverter().convert(ruleDTO, ruleDAO.create());
- rule.setPoll(entity);
- }
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity created: " + entity);
- }
-
- result = entity.getTopiaId();
-
- // Update dto : need creator and id update
- // WARN : Update for choices, preventRules and
- // votingLists is not needed in this case
- context.getConverter().convert(entity, pollDTO);
-
- } catch (Exception eee) {
- context.doCatch(transaction, eee,
- n_("pollen.error.servicePoll.createPoll"),
- pollDTO.getTitle(), pollDTO.getCreatorId());
- } finally {
- context.doFinally(transaction);
- }
- return result;
- }
-
- /**
- * Prepare pollAccount as creator for {@code poll} save. If userId is
- * defined, the pollAccount will be searched in database testing all fields
- * (user, creatorName as votingId and email). If no result is found or no
- * userId, a new pollAccount is created.
- *
- * @param transaction current TopiaContext
- * @param poll PollDTO which contains creator data (userId, creatorId,
- * creatorEmail)
- * @return the PollAccount used as creator for this poll
- * @throws TopiaException
- */
- private final PollAccount prepareCreator(TopiaContext transaction,
- PollDTO poll) throws TopiaException {
-
- // Search user from database
- UserAccount user = PollenModelDAOHelper.getUserAccountDAO(transaction).
- findByTopiaId(poll.getUserId());
-
- // Prepare properties for find or create
- Map<String, Object> accountProperties = new HashMap<String, Object>();
- accountProperties.put(PollAccount.USER_ACCOUNT, user);
- accountProperties.put(PollAccount.VOTING_ID, poll.getCreatorName());
- accountProperties.put(PollAccount.EMAIL, poll.getCreatorEmail());
-
- PollAccountDAO accountDAO =
- PollenModelDAOHelper.getPollAccountDAO(transaction);
-
- PollAccount creator = null;
- // Get existing account (profile) for user
- if (user != null) {
- creator = accountDAO.findByProperties(accountProperties);
- }
- // Create new account if account properties changed or no user found
- if (creator == null) {
- accountProperties.put(
- PollAccount.ACCOUNT_ID, context.createPollenUrlId());
- creator = accountDAO.create(accountProperties);
- }
- return creator;
- }
-
- /**
- * Create a new votingList from a VotingListDTO. Used when poll is created.
- * Each pollAccount of the list will be created unless it already exists
- * in database (Don't know if needed because pollAccounts can't be loaded
- * in a new poll creation).
- *
- * @param transaction current TopiaContext
- * @param listDTO VotingListDTO source
- * @return VotingList entity created
- * @throws TopiaException
- */
- private final VotingList createVotingList(TopiaContext transaction,
- VotingListDTO listDTO) throws TopiaException {
-
- VotingListDAO dao = PollenModelDAOHelper.getVotingListDAO(transaction);
- VotingList votingList =
- context.getConverter().convert(listDTO, dao.create());
-
- PollAccountDAO pollAccountDAO =
- PollenModelDAOHelper.getPollAccountDAO(transaction);
-
- for (PollAccountDTO accountDTO : listDTO.getPollAccountDTOs()) {
- double weight = accountDTO.getWeight();
- PollAccount account =
- pollAccountDAO.findByTopiaId(accountDTO.getId());
-
- // Create a new PollAccount if not already exists
- if (account == null) {
- String accountId = context.createPollenUrlId();
- account = pollAccountDAO.create(accountId);
- context.getConverter().convert(accountDTO, account);
- }
-
- // Create association between VotingList and PollAccount
- PollenModelDAOHelper.getPersonToListDAO(transaction).create(
- PersonToList.POLL_ACCOUNT, account,
- PersonToList.VOTING_LIST, votingList,
- PersonToList.WEIGHT, weight);
- }
-
- return votingList;
- }
-
- @Override
- public boolean updatePoll(PollDTO pollDTO) {
- TopiaContext transaction = null;
- try {
-
- if (log.isInfoEnabled()) {
- log.info("P:[ updatePoll ] : " + pollDTO);
- }
-
- transaction = context.getRootContext().beginTransaction();
-
- pollDAO = PollenModelDAOHelper.getPollDAO(transaction);
-
- Poll pollEntity = pollDAO.findByTopiaId(pollDTO.getId());
-
- context.getConverter().convert(pollDTO, pollEntity);
-
- ChoiceDAO choiceDAO = PollenModelDAOHelper.getChoiceDAO(transaction);
-
- // ** Update choices (no add, no remove)
- for (ChoiceDTO choiceDTO : pollDTO.getChoices()) {
- Choice choice = choiceDAO.findByTopiaId(choiceDTO.getId());
- context.getConverter().convert(choiceDTO, choice);
- choice.update();
- }
-
- // Les règles de notifications restent mystérieuses
- // Y a t-il un besoin de suppression ?
- converter.persistPreventRules(pollDTO, pollEntity, context);
-
- pollDAO.update(pollEntity);
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity updated: " + pollDTO.getId());
- }
-
- return true;
- } catch (Exception eee) {
- context.doCatch(transaction, eee,
- n_("pollen.error.servicePoll.updatePoll"),
- pollDTO.getTitle(), pollDTO.getPollUId());
- return false;
- } finally {
- context.doFinally(transaction);
- }
- }
-
- @Override
- public PollDTO getNewPoll() {
- PollDTO newPoll = new PollDTO();
- newPoll.setVoteCounting(VoteCountingType.NORMAL);
- newPoll.setPollType(PollType.FREE);
- newPoll.setPollUId(context.createPollenUrlId());
- return newPoll;
- }
-
- @Override
- public PollDTO getNewPoll(PollDTO poll) {
- PollDTO newPoll = new PollDTO();
- return newPoll;
- }
-
- @Override
- public boolean deletePoll(String pollId) {
- TopiaContext transaction = null;
- try {
-
- if (log.isInfoEnabled()) {
- log.info("P:[ deletePoll ] : pollId = " + pollId);
- }
-
- transaction = context.getRootContext().beginTransaction();
-
- pollDAO = PollenModelDAOHelper.getPollDAO(transaction);
-
- Poll pollEntity = pollDAO.findByTopiaId(pollId);
-
- pollDAO.delete(pollEntity);
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity deleted: " + pollId);
- }
-
- return true;
- } catch (Exception eee) {
- context.doCatch(transaction, eee,
- n_("pollen.error.servicePoll.deletePoll"), pollId);
- return false;
- } finally {
- context.doFinally(transaction);
- }
- }
-
- @Override
- public PollDTO getPoll(String pollId) {
- TopiaContext transaction = null;
- PollDTO result = null;
- try {
- if (log.isInfoEnabled()) {
- log.info("P:[ getPoll ] : pollUId = " + pollId);
- }
-
- transaction = context.getRootContext().beginTransaction();
-
- pollDAO = PollenModelDAOHelper.getPollDAO(transaction);
-
- Poll pollEntity = pollDAO.findByPollId(pollId);
-
- if (pollEntity != null) {
- result = context.getConverter().convert(pollEntity, new PollDTO());
-
- // Load choices
- for (Choice choice : pollEntity.getChoice()) {
- ChoiceDTO dto =
- context.getConverter().convert(choice, new ChoiceDTO());
- result.addChoice(dto);
- }
-
-
-// List<Long> tmp = transaction.find(
-// "SELECT COUNT(*)" +
-// " FROM " + Vote.class.getName() +
-// " WHERE poll.pollId = :pollUId",
-// "pollUId", pollId);
-// int count = tmp.get(0).intValue();
-
-// VoteDAO voteDAO = PollenModelDAOHelper.getVoteDAO(transaction);
-// int count = voteDAO.createQuery().add(Poll.POLL_ID, pollId).executeCount();
-
- // Need the number total of votes to push in the dto
- int count = new TopiaQuery(Vote.class).
- add(Vote.POLL + "." + Poll.POLL_ID, pollId).
- executeCount(transaction);
-
- result.setNbVotes(count);
-
- // Load votes
-// for (Vote vote : pollEntity.getVote()) {
-// VoteDTO dto =
-// context.getConverter().convert(vote, new VoteDTO());
-// result.addVote(dto);
-// }
-
- // Load comments
-// for (Comment comment : pollEntity.getComment()) {
-// CommentDTO dto =
-// context.getConverter().convert(comment, new CommentDTO());
-// result.addComment(dto);
-// }
-
- // Load preventRules
- for (PreventRule rule : pollEntity.getPreventRule()) {
- PreventRuleDTO dto =
- context.getConverter().convert(rule, new PreventRuleDTO());
- result.addPreventRule(dto);
- }
-
- // TODO Refactor this
- if (pollEntity.getVotingList().size() > 0) {
- DataVotingListConverter votingListConverter = new DataVotingListConverter();
- result.setVotingListDTOs(votingListConverter.createVotingListDTOs(pollEntity.getVotingList()));
- }
- }
-
- //transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity found: " + ((result == null) ? "null" : result.getId()));
- }
-
- return result;
- } catch (Exception eee) {
- context.doCatch(transaction, eee,
- n_("pollen.error.servicePoll.getPoll"), pollId);
- return null;
- } finally {
- context.doFinally(transaction);
- }
- }
-
- @Override
- public List<PollDTO> findPollsByUser(String userId) {
- TopiaContext transaction = null;
- List<PollDTO> results = null;
- UserAccountDAO userDAO = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- userDAO = PollenModelDAOHelper.getUserAccountDAO(transaction);
- UserAccount user = userDAO.findByTopiaId(userId);
-
- List<Poll> pollEntities = new ArrayList<Poll>();
- for (PollAccount pollAccount : user.getPollAccount()) {
- pollEntities.addAll(pollAccount.getPollsCreated());
- }
-
- converter.setTransaction(transaction);
- results = converter.createPollDTOs(pollEntities,
- context.getConverter());
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entities found: " + ((results == null) ? "null" : results.size()));
- }
-
- return results;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- context.doFinally(transaction);
- }
- }
-
- @Override
- public List<PollDTO> findParticipatedPolls(String userId) {
- TopiaContext transaction = null;
- List<PollDTO> results = null;
- UserAccountDAO userDAO = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- userDAO = PollenModelDAOHelper.getUserAccountDAO(transaction);
- UserAccount user = userDAO.findByTopiaId(userId);
-
- Set<Poll> pollEntities = new HashSet<Poll>();
- for (PollAccount pollAccount : user.getPollAccount()) {
- for (Vote vote : pollAccount.getVote()) {
- pollEntities.add(vote.getPoll());
- }
- }
-
- converter.setTransaction(transaction);
- results = converter.createPollDTOs(
- new ArrayList<Poll>(pollEntities), context.getConverter());
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entities found: " + ((results == null) ? "null" : results.size()));
- }
-
- return results;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- context.doFinally(transaction);
- }
- }
-
- @Override
- public List<PollDTO> findInvitedPolls(String userId) {
- TopiaContext transaction = null;
- List<PollDTO> results = null;
- UserAccountDAO userDAO = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- userDAO = PollenModelDAOHelper.getUserAccountDAO(transaction);
- UserAccount user = userDAO.findByTopiaId(userId);
-
- pollDAO = PollenModelDAOHelper.getPollDAO(transaction);
- List<Poll> polls = pollDAO.findAll();
-
- Set<Poll> pollEntities = new HashSet<Poll>();
- for (Poll poll : polls) {
- for (VotingList votingList : poll.getVotingList()) {
- for (PersonToList personToList : votingList.getPollAccountPersonToList()) {
- if (!personToList.getHasVoted()) {
- PollAccount pollAccount = personToList.getPollAccount();
- if (pollAccount != null && pollAccount.getEmail() != null && pollAccount.getEmail().equals(
- user.getEmail())) {
- pollEntities.add(poll);
- }
- }
- }
- }
- }
-
- converter.setTransaction(transaction);
- results = converter.createPollDTOs(
- new ArrayList<Poll>(pollEntities),
- context.getConverter());
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entities found: " + ((results == null) ? "null" : results.size()));
- }
-
- return results;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- context.doFinally(transaction);
- }
- }
-
- @Override
- public List<PollDTO> findRunningPolls(boolean withEndDate) {
- TopiaContext transaction = null;
- List<PollDTO> results = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- PollDAO dao = PollenModelDAOHelper.getPollDAO(transaction);
-
- String beginDate = Poll.BEGIN_DATE;
- String endDate = Poll.END_DATE;
- Date currentDate = context.getCurrentDate();
-
- TopiaQuery query = dao.createQuery().
- addNullOr(beginDate, Op.LT, currentDate);
-
- if (withEndDate) {
- query.add(endDate, Op.GT, currentDate);
- } else {
- query.addNullOr(endDate, Op.GT, currentDate);
- }
-
- List<Poll> entities = dao.findAllByQuery(query);
-
- // requête de sélection des sondages
-// if (withEndDate) {
-// pollEntities = transaction
-// .find("from "
-// + Poll.class.getName()
-// + " as poll where (poll.endDate is not null and poll.endDate > current_timestamp())"
-// + " and (poll.beginDate is null or poll.beginDate < current_timestamp())");
-// } else {
-// pollEntities = transaction
-// .find("from "
-// + Poll.class.getName()
-// + " as poll where (poll.endDate is null or poll.endDate > current_timestamp())"
-// + " and (poll.beginDate is null or poll.beginDate < current_timestamp())");
-// }
-
- converter.setTransaction(transaction);
- results = converter.createPollDTOs(entities,
- context.getConverter());
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entities found: " + ((results == null) ? "null" : results.size()));
- }
-
- return results;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- context.doFinally(transaction);
- }
- }
-
- @Override
- public List<PollDTO> selectPolls(Map<String, Object> properties) {
- TopiaContext transaction = null;
- List<PollDTO> results = null;
- List<Poll> pollEntities = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- pollDAO = PollenModelDAOHelper.getPollDAO(transaction);
-
- if (properties == null) {
- pollEntities = pollDAO.findAll();
- if (log.isWarnEnabled()) {
- log.warn("Attention : tous les sondages ont été sélectionnés !");
- }
- } else {
- pollEntities = pollDAO.findAllByProperties(properties);
- }
- converter.setTransaction(transaction);
- results = converter.createPollDTOs(pollEntities,
- context.getConverter());
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entities found: " + ((results == null) ? "null" : results.size()));
- }
-
- return results;
- } catch (Exception eee) {
- ContextUtil.doCatch(eee, transaction,
- _("pollen.error.servicePoll.getAllPolls"));
- return null;
- } finally {
- context.doFinally(transaction);
- }
- }
-
- @Override
- public void createComment(PollDTO poll, CommentDTO comment) {
- TopiaContext transaction = null;
- try {
- if (log.isInfoEnabled()) {
- log.info("P:[ createComment ] : pollUId = " + poll.getPollUId() +
- " _ comment = " + comment);
- }
- transaction = context.getRootContext().beginTransaction();
-
- // Create the new comment
- CommentDAO dao = PollenModelDAOHelper.getCommentDAO(transaction);
- Comment eComment =
- context.getConverter().convert(comment, dao.create());
-
- // Get the poll entity corresponding
- Poll ePoll = PollenModelDAOHelper.getPollDAO(transaction).
- findByTopiaId(poll.getId());
-
- // Add the comment into the poll
- ePoll.addComment(eComment);
-
- transaction.commitTransaction();
-
- // Update change in dtos
- comment.setId(eComment.getTopiaId());
- poll.addComment(comment);
-
- } catch (Exception eee) {
- context.doCatch(transaction, eee,
- n_("pollen.error.servicePoll.addComment"),
- comment.getAuthor(), poll.getTitle(), poll.getId());
- } finally {
- context.doFinally(transaction);
- }
- }
-
- @Override
- public void deleteComment(PollDTO poll, String commentId) {
- TopiaContext transaction = null;
- try {
- if (log.isInfoEnabled()) {
- log.info("P:[ deleteComment ] : pollUId = " + poll.getPollUId() +
- " _ commentId = " + commentId);
- }
- transaction = context.getRootContext().beginTransaction();
-
- // Find the comment
- CommentDAO dao = PollenModelDAOHelper.getCommentDAO(transaction);
- Comment eComment = dao.findByTopiaId(commentId);
-
- // Get the poll entity corresponding
- Poll ePoll = PollenModelDAOHelper.getPollDAO(transaction).
- findByTopiaId(poll.getId());
-
- // The remove will delete the comment because no poll will be
- // attached to him (delete-orphan)
- ePoll.removeComment(eComment);
-
- transaction.commitTransaction();
-
- // Update change in dto
- poll.removeComment(commentId);
-
- } catch (Exception eee) {
- context.doCatch(transaction, eee,
- n_("pollen.error.servicePoll.deleteComment"), commentId,
- poll.getTitle(), poll.getId());
- } finally {
- context.doFinally(transaction);
- }
- }
-
- @Override
- public List<CommentDTO> getComments(PollDTO poll) {
- TopiaContext transaction = null;
- List<CommentDTO> results = new ArrayList<CommentDTO>();
- try {
- if (log.isInfoEnabled()) {
- log.info("P:[ getComments ] : pollUId = " + poll.getPollUId());
- }
- transaction = context.getRootContext().beginTransaction();
-
- CommentDAO dao = PollenModelDAOHelper.getCommentDAO(transaction);
- TopiaQuery query = dao.createQuery().
- add(Comment.POLL + "." + Poll.POLL_ID, poll.getPollUId());
-
- List<Comment> entities = dao.findAllByQuery(query);
-
- for (Comment entity : entities) {
- CommentDTO dto =
- context.getConverter().convert(entity, new CommentDTO());
- results.add(dto);
- }
-
- } catch (Exception eee) {
- context.doCatch(transaction, eee,
- n_("pollen.error.servicePoll.getComments"),
- poll.getTitle(), poll.getId());
- } finally {
- context.doFinally(transaction);
- }
- return results;
- }
-
- @Override
- public PollAccountDTO getRestrictedAccount(String accountUId, PollDTO poll) {
- TopiaContext transaction = null;
- PollAccountDTO result = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- if (log.isInfoEnabled()) {
- log.info("P:[ getRestrictedAccount ] : accountUId = " + accountUId +
- " _ pollUId = " + poll.getPollUId());
- }
-
- // Use PersonToList association entity to find coherence between
- // the poll and votingId
-// List<PersonToList> tmp = transaction.find(
-// "FROM " + PersonToList.class.getName() +
-// " WHERE pollAccount.accountId = :accountUId" +
-// " AND votingList.poll.pollId = :pollUId",
-// "accountUId", accountUId,
-// "pollUId", poll.getPollId());
-
- PersonToListDAO dao =
- PollenModelDAOHelper.getPersonToListDAO(transaction);
- TopiaQuery query = dao.createQuery().
- add(PersonToList.POLL_ACCOUNT + "." +
- PollAccount.ACCOUNT_ID, accountUId).
- add(PersonToList.VOTING_LIST + "." +
- VotingList.POLL + "." + Poll.POLL_ID, poll.getPollUId());
-
- PersonToList assoc = dao.findByQuery(query);
-
- if (assoc != null) {
- PollAccount account = assoc.getPollAccount();
- context.getConverter().convert(account, result);
- }
-
- } catch (Exception eee) {
- context.doCatch(transaction, eee,
- n_("pollen.error.servicePoll.getRestrictedAccount"),
- accountUId, poll.getPollUId());
- } finally {
- context.doFinally(transaction);
- }
- return result;
- }
-
- @Override
- public ChoiceDTO getNewHiddenChoice(ChoiceDTO choice, String votingId) {
- ChoiceDTO hiddenChoice = new ChoiceDTO();
- hiddenChoice.setName(NumberMethod.HIDDEN_PREFIX +
- choice.getName() + "#" + votingId);
- hiddenChoice.setHidden(true);
- hiddenChoice.setValue(choice.getValue()); // ??
-// hiddenChoice.setPollUId(choice.getPollUId());
-// hiddenChoice.setVoteId(choice.getVoteId()); // ??
- hiddenChoice.setValidate(false);
- return hiddenChoice;
- }
-
- @Override
- public void createChoice(PollDTO poll, ChoiceDTO choice) {
- TopiaContext transaction = null;
- try {
- if (log.isInfoEnabled()) {
- log.info("P:[ createChoice ] : pollUId = " + poll.getPollUId() +
- " _ choiceName = " + choice.getName() +
- " _ choiceDescription = " + choice.getDescription());
- }
- transaction = context.getRootContext().beginTransaction();
-
- // Get the poll entity corresponding
- Poll ePoll = PollenModelDAOHelper.getPollDAO(transaction).
- findByTopiaId(poll.getId());
-
- // Create the new choice entity
- ChoiceDAO dao = PollenModelDAOHelper.getChoiceDAO(transaction);
- Choice eChoice = context.getConverter().convert(choice,
- dao.create());
-
- // Add the choice in the Poll
- ePoll.addChoice(eChoice);
-
- transaction.commitTransaction();
-
- // Update changes in dtos
- choice.setId(eChoice.getTopiaId());
- poll.addChoice(choice);
-
- } catch (Exception eee) {
- context.doCatch(transaction, eee,
- n_("pollen.error.servicePoll.createChoice"),
- poll.getTitle(), poll.getId());
- } finally {
- context.doFinally(transaction);
- }
- }
-
- @Override
- public void deleteChoice(PollDTO poll, String choiceId) {
- TopiaContext transaction = null;
- try {
- if (log.isInfoEnabled()) {
- log.info("P:[ deleteChoice ] : pollUId = " + poll.getPollUId() +
- " _ choiceId = " + choiceId);
- }
- transaction = context.getRootContext().beginTransaction();
-
- // Find the choice
- ChoiceDAO dao = PollenModelDAOHelper.getChoiceDAO(transaction);
- Choice eChoice = dao.findByTopiaId(choiceId);
-
- // Get the poll entity corresponding
- Poll ePoll = PollenModelDAOHelper.getPollDAO(transaction).
- findByTopiaId(poll.getId());
-
- // The remove will delete the choice because no poll will be
- // attached to him (delete-orphan)
- ePoll.removeChoice(eChoice);
-
- transaction.commitTransaction();
-
- // Update change in dto
- poll.removeChoice(choiceId);
-
- } catch (Exception eee) {
- context.doCatch(transaction, eee,
- n_("pollen.error.servicePoll.deleteChoice"), choiceId,
- poll.getTitle(), poll.getId());
- } finally {
- context.doFinally(transaction);
- }
- }
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePreventRule.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePreventRule.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePreventRule.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,90 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import java.util.List;
-import java.util.Map;
-
-import org.chorem.pollen.business.dto.PreventRuleDTO;
-import org.chorem.pollen.business.persistence.PreventRule;
-import org.nuiton.topia.TopiaContext;
-
-/**
- * Interface de gestion des règles de notification.
- *
- * @author rannou
- * @version $Id$
- */
-public interface ServicePreventRule {
-
- /**
- * Création d'une règle de notification.
- *
- * @param preventRule le dto de la règle
- * @return l'identifiant de la règle
- */
- public String createPreventRule(PreventRuleDTO preventRule);
-
- /**
- * Création des règles de notification du sondage
- *
- * @param preventRules les dtos des règles
- * @param pollId l'identifiant du sondage
- * @param transaction la transaction du sondage
- * @return les règles créées
- */
- public List<PreventRule> createPreventRules(
- List<PreventRuleDTO> preventRules, String pollId,
- TopiaContext transaction);
-
- /**
- * Mise à jour d'une règle de notification.
- *
- * @param preventRuleDTO le dto de la règle
- * @return true si la règle a été mise à jours
- */
- public boolean updatePreventRule(PreventRuleDTO preventRuleDTO);
-
- /**
- * Suppression d'une règle de notification.
- *
- * @param preventRuleId l'identifiant de la règle
- * @return true si la règle a été mise à jours
- */
- public boolean deletePreventRule(String preventRuleId);
-
- /**
- * Recherche d'un règle de notification par son identifiant.
- *
- * @param preventRuleId l'identifiant de la règle
- * @return la règle
- * @deprecated useless method : used only in tests
- */
- @Deprecated
- public PreventRuleDTO findPreventRuleById(String preventRuleId);
-
- /**
- * Recherche de toutes les règles de notification.
- *
- * @param properties filtre sur les champs de la table preventRule
- * @return les règles
- * @deprecated useless method : used only in tests
- */
- @Deprecated
- public List<PreventRuleDTO> selectPreventRules(
- Map<String, Object> properties);
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePreventRuleImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePreventRuleImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePreventRuleImpl.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,252 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.PollenContext;
-import org.chorem.pollen.business.PollenContextImplementor;
-import org.chorem.pollen.business.converters.DataPreventRuleConverter;
-import org.chorem.pollen.business.dto.PreventRuleDTO;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.business.persistence.PreventRule;
-import org.chorem.pollen.business.persistence.PreventRuleDAO;
-import org.chorem.pollen.business.utils.ContextUtil;
-import org.nuiton.topia.TopiaContext;
-
-/**
- * Gestion des règles de notification.
- *
- * @author rannou
- * @version $Id$
- */
-public class ServicePreventRuleImpl implements ServicePreventRule {
-
- private PollenContextImplementor context;
- private PreventRuleDAO preventRuleDAO = null;
- private DataPreventRuleConverter converter = new DataPreventRuleConverter();
-
- /** log. */
- private static final Log log = LogFactory
- .getLog(ServicePreventRuleImpl.class);
-
- public ServicePreventRuleImpl(PollenContextImplementor context) {
- this.context = context;
- }
-
- @Override
- public String createPreventRule(PreventRuleDTO preventRule) {
- TopiaContext transaction = null;
- String topiaId = "";
- try {
- transaction = context.getRootContext().beginTransaction();
-
- preventRuleDAO = PollenModelDAOHelper
- .getPreventRuleDAO(transaction);
-
- PreventRule preventRuleEntity = preventRuleDAO.create();
- converter.setTransaction(transaction);
- converter.populatePreventRuleEntity(preventRule, preventRuleEntity);
-
- topiaId = preventRuleEntity.getTopiaId();
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity created: " + topiaId);
- }
-
- return topiaId;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return "";
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public List<PreventRule> createPreventRules(
- List<PreventRuleDTO> preventRules, String pollId, TopiaContext transaction) {
- if (preventRules.isEmpty() || pollId.length() == 0) {
- return null;
- }
-
- List<PreventRule> result = null;
- try {
- preventRuleDAO = PollenModelDAOHelper.getPreventRuleDAO(transaction);
-
- converter.setTransaction(transaction);
-
- result = new ArrayList<PreventRule>();
- for (PreventRuleDTO preventRule : preventRules) {
- PreventRule preventRuleEntity = preventRuleDAO.create();
- preventRule.setId(preventRuleEntity.getTopiaId());
- preventRule.setPollId(pollId);
- converter.populatePreventRuleEntity(preventRule,
- preventRuleEntity);
- result.add(preventRuleEntity);
- }
-
- return result;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- }
- }
-
- @Override
- public boolean updatePreventRule(PreventRuleDTO preventRuleDTO) {
- TopiaContext transaction = null;
- boolean resu = false;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- preventRuleDAO = PollenModelDAOHelper
- .getPreventRuleDAO(transaction);
-
- PreventRule preventRuleEntity = preventRuleDAO
- .findByTopiaId(preventRuleDTO.getId());
- if (preventRuleEntity != null) {
- converter.setTransaction(transaction);
- converter.populatePreventRuleEntity(preventRuleDTO,
- preventRuleEntity);
-
- preventRuleDAO.update(preventRuleEntity);
- transaction.commitTransaction();
- resu = true;
- }
-
- if (log.isDebugEnabled()) {
- log.debug("Entity updated: " + preventRuleDTO.getId());
- }
-
- return resu;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return false;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public boolean deletePreventRule(String preventRuleId) {
- TopiaContext transaction = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- preventRuleDAO = PollenModelDAOHelper
- .getPreventRuleDAO(transaction);
-
- PreventRule preventRuleEntity = preventRuleDAO
- .findByTopiaId(preventRuleId);
-
- preventRuleDAO.delete(preventRuleEntity);
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity deleted: " + preventRuleId);
- }
-
- return true;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return false;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public PreventRuleDTO findPreventRuleById(String preventRuleId) {
- TopiaContext transaction = null;
- PreventRuleDTO result = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- preventRuleDAO = PollenModelDAOHelper
- .getPreventRuleDAO(transaction);
-
- PreventRule preventRuleEntity = preventRuleDAO
- .findByTopiaId(preventRuleId);
-
- if (preventRuleEntity != null) {
- converter.setTransaction(transaction);
- result = converter.createPreventRuleDTO(preventRuleEntity);
- }
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity found: "
- + ((result == null) ? "null" : result.getId()));
- }
-
- return result;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public List<PreventRuleDTO> selectPreventRules(
- Map<String, Object> properties) {
- TopiaContext transaction = null;
- List<PreventRuleDTO> results = null;
- List<PreventRule> preventRuleEntities = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- preventRuleDAO = PollenModelDAOHelper
- .getPreventRuleDAO(transaction);
-
- if (properties == null) {
- preventRuleEntities = preventRuleDAO.findAll();
- if (log.isWarnEnabled()) {
- log
- .warn("Attention : toutes les règles de notification ont été sélectionnées !");
- }
- } else {
- preventRuleEntities = preventRuleDAO
- .findAllByProperties(properties);
- }
- converter.setTransaction(transaction);
- results = converter.createPreventRuleDTOs(preventRuleEntities);
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entities found: "
- + ((results == null) ? "null" : results.size()));
- }
-
- return results;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceResults.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceResults.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceResults.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,92 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import org.chorem.pollen.business.dto.ResultListDTO;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.common.VoteCountingType;
-
-/**
- * Interface du service de gestion de résultats.
- *
- * @author fdesbois
- * @version $Id$
- */
-public interface ServiceResults {
-
- /**
- * Récupère les résultats d'un sondage.
- *
- * @param pollId identifiant du sondage
- * @return resultats, null si le sondage n'est pas fermé
- */
- public ResultListDTO getAllResults(String pollId);
-
- /**
- * Récupère les résultats d'un sondage pour un seul type de dépouillement.
- *
- * @param pollId identifiant du sondage
- * @param voteCounting : type de dépouillement
- * @return results, null si le sondage n'est pas fermé ou ne peut être
- * dépouillé de cette façon
- */
- public ResultListDTO getResultsByVoteCounting(String pollId,
- VoteCountingType voteCounting);
-
- /**
- * Récupère les résultats d'un sondage avec le dépouillement normal sans
- * gestion des groupes. Utile si PollType == GROUP.
- *
- * @param pollId identifiant du sondage
- * @return results
- */
- public ResultListDTO getNormalResults(String pollId);
-
- /**
- * Récupère les résultats d'un sondage avec le dépouillement normal avec
- * gestion des groupes. Possible uniquement si PollType == GROUP.
- *
- * @param pollId identifiant du sondage
- * @return results si PollType == GROUP, null sinon
- */
- public ResultListDTO getGroupResults(String pollId);
-
- /**
- * Export d'un sondage au format XML.
- *
- * @param pollId identifiant ToPIA du sondage
- * @return chemin du fichier créé sur le serveur
- */
- public String exportPoll(String pollId);
-
- /**
- * Import d'un fichier XML.
- *
- * @param filePath chemin du fichier à importer
- * @return identifiant du sondage nouvellement importé
- */
- public String importPoll(String filePath);
-
- /**
- * Import d'un fichier XML.
- *
- * @param filePath chemin du fichier à importer
- * @param user l'utilisateur important le fichier
- * @return identifiant du sondage nouvellement importé
- */
- public String importPoll(String filePath, UserDTO user);
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceResultsImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceResultsImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceResultsImpl.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,305 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.PollenContext;
-import org.chorem.pollen.business.PollenContextImplementor;
-import org.chorem.pollen.business.converters.DataResultConverter;
-import org.chorem.pollen.business.converters.DataVoteCountingConverter;
-import org.chorem.pollen.business.dto.ResultDTO;
-import org.chorem.pollen.business.dto.ResultListDTO;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.persistence.Poll;
-import org.chorem.pollen.business.persistence.PollDAO;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.business.persistence.Result;
-import org.chorem.pollen.business.utils.ContextUtil;
-import org.chorem.pollen.common.PollType;
-import org.chorem.pollen.common.VoteCountingType;
-import org.chorem.pollen.votecounting.dto.PollDTO;
-import org.chorem.pollen.votecounting.dto.PollExportDTO;
-import org.chorem.pollen.votecounting.dto.VoteCountingResultDTO;
-import org.chorem.pollen.votecounting.services.ServiceExport;
-import org.chorem.pollen.votecounting.services.ServiceExportImpl;
-import org.chorem.pollen.votecounting.services.ServiceVoteCounting;
-import org.chorem.pollen.votecounting.services.ServiceVoteCountingImpl;
-import org.nuiton.topia.TopiaContext;
-import static org.nuiton.i18n.I18n.n_;
-
-/**
- * Implémentation du service de gestion des résultats.
- *
- * @author fdesbois
- * @author rannou
- * @version $Id$
- */
-public class ServiceResultsImpl implements ServiceResults {
-
- private PollenContextImplementor context;
-
- /** log. */
- private static final Log log = LogFactory.getLog(ServiceResultsImpl.class);
-
- public ServiceResultsImpl(PollenContextImplementor context) {
- this.context = context;
- }
-
- @Override
- public ResultListDTO getAllResults(String pollId) {
- return getResults(pollId, null, false, false);
- }
-
- @Override
- public ResultListDTO getResultsByVoteCounting(String pollId,
- VoteCountingType voteCounting) {
- return getResults(pollId, voteCounting, false, false);
- }
-
- @Override
- public ResultListDTO getGroupResults(String pollId) {
- return getResults(pollId, null, true, true);
- }
-
- @Override
- public ResultListDTO getNormalResults(String pollId) {
- return getResults(pollId, null, true, false);
- }
-
- /**
- * Récupère les résultats d'un sondage.
- *
- * @param pollId le sondage
- * @param voteCounting type de dépouillement
- * @param byGroup résultats par groupe
- * @param groupOnly résultats uniquement par groupe
- * @return les résultats du sondage
- */
- private ResultListDTO getResults(String pollId,
- VoteCountingType voteCounting, boolean byGroup, boolean groupOnly) {
- TopiaContext transaction = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- PollDAO daoPoll = PollenModelDAOHelper.getPollDAO(transaction);
- Poll ePoll = daoPoll.findByPollId(pollId);
-
- DataResultConverter converter = new DataResultConverter(transaction);
- if (log.isDebugEnabled()) {
- log.debug(ePoll.getPollId() + " (" + voteCounting
- + ") has results: " + hasResults(ePoll, voteCounting));
- }
-
- // Dépouillement du sondage.
- // S'il n'existe pas de résultats ou si le sondage est encore ouvert.
- //if (!hasResults(ePoll, voteCounting) || !ePoll.getIsClosed()) {
- PollDTO dto = DataVoteCountingConverter
- .createPollDTOForVoteCounting(ePoll);
-
- if (voteCounting != null) {
- dto.setVoteCounting(voteCounting);
- }
-
- ePoll.clearResult();
-
- ServiceVoteCounting service = new ServiceVoteCountingImpl();
- VoteCountingResultDTO result = service.executeVoteCounting(dto);
- converter.populateResultEntities(result);
- if (PollType.isGroupType(ePoll.getPollType())) {
- result = service.executeGroupCounting(dto);
- converter.populateResultEntities(result);
- }
-
- //}
-
- transaction.commitTransaction();
-
- // Conversion et trie des résultats
- List<ResultDTO> list = converter.createResultDTOs(ePoll);
-
- VoteCountingType voteCountingType =
- VoteCountingType.valueOf(ePoll.getVoteCounting());
-
- Iterator<ResultDTO> it = list.iterator();
- while (it.hasNext()) {
- ResultDTO curr = it.next();
-
- // Cas d'un dépouillement particulier
- // Suppression des resultats qui ne sont pas de se dépouillement
- if (voteCounting != null
- && curr.getVoteCounting() != voteCounting) {
- it.remove();
- }
-
- // Cas d'un sondage de type GROUP avec filtre
- if (byGroup) {
-
- // Filtre group : Suppression resultats non group
- if (groupOnly && !curr.isByGroup()) {
- it.remove();
- }
-
- // Filtre non group : Suppression resultats group
- else if (!groupOnly && curr.isByGroup()) {
- it.remove();
- }
-
- // Suppression des autres resultats de depouillements differents
- if (curr.getVoteCounting() != voteCountingType) {
- it.remove();
- }
- }
- }
-
- ResultListDTO resultListDTO = new ResultListDTO();
- resultListDTO.setResultDTOs(list);
- resultListDTO.setVoteCountingResultDTO(result);
-
- return resultListDTO;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- /**
- * Retourne vrai si le sondage a des résultats.
- *
- * @param ePoll le sondage
- * @param type type de dépouillement
- * @return vrai si le sondage a des résultats
- */
- private boolean hasResults(Poll ePoll, VoteCountingType type) {
- Collection<Result> results = ePoll.getResult();
- if (results == null || results.isEmpty()) {
- return false;
- }
- if (!results.isEmpty() && type == null) {
- return true;
- }
-
- for (Result curr : results) {
- if (VoteCountingType.valueOf(curr.getVoteCounting()) == type) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public String exportPoll(String pollId) {
- TopiaContext transaction = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- // Recherche du sondage
- PollDAO daoPoll = PollenModelDAOHelper.getPollDAO(transaction);
- Poll ePoll = daoPoll.findByPollId(pollId);
-
- // Dépouillement du sondage.
- DataResultConverter converter = new DataResultConverter(transaction);
- PollDTO dto = DataVoteCountingConverter
- .createPollDTOForVoteCounting(ePoll);
-
- ePoll.clearResult();
-
- ServiceVoteCounting service = new ServiceVoteCountingImpl();
- List<VoteCountingResultDTO> results = new ArrayList<VoteCountingResultDTO>();
- VoteCountingResultDTO result = service.executeVoteCounting(dto);
- converter.populateResultEntities(result);
- results.add(result);
-
- if (PollType.isGroupType(ePoll.getPollType())) {
- VoteCountingResultDTO groupResult = service
- .executeGroupCounting(dto);
- converter.populateResultEntities(groupResult);
- results.add(groupResult);
- }
-
- transaction.commitTransaction();
-
- // Transformation du sondage
- PollExportDTO pollExport = new PollExportDTO();
- pollExport.setPollId(pollId);
- pollExport.setPoll(dto);
- pollExport.setVoteCountingResults(results);
-
- // Export du sondage
- ServiceExport serviceExport = new ServiceExportImpl();
- String filename = serviceExport.executeExport(pollExport);
-
- if (log.isInfoEnabled()) {
- log.info("Poll exported: " + pollId);
- }
-
- return filename;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public String importPoll(String filePath) {
- return importPoll(filePath, null);
- }
-
- @Override
- public String importPoll(String filePath, UserDTO user) {
- String topiaId = "";
-
- try {
-
- // Import du sondage
- ServiceExport serviceExport = new ServiceExportImpl();
- PollExportDTO pollExportDTO = serviceExport.executeImport(filePath);
-
- // Transformation du sondage
- // FIXME do not call a Service from an other one
- ServicePoll servicePoll;
- servicePoll = new ServicePollImpl(context);
- org.chorem.pollen.business.dto.PollDTO poll = DataVoteCountingConverter
- .createPollDTO(pollExportDTO.getPoll());
-
- // Enregistrement du sondage
- if (user != null) {
- poll.setUserId(user.getId());
- }
- topiaId = servicePoll.createPoll(poll);
-
- if (log.isInfoEnabled()) {
- log.info("Poll imported: " + topiaId);
- }
-
- } catch (Exception eee) {
- context.doCatch(eee,
- n_("pollen.error.serviceResults.importPoll"));
- }
-
- return topiaId;
- }
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceUser.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceUser.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceUser.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,105 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import java.util.List;
-import java.util.Map;
-
-import org.chorem.pollen.business.dto.UserDTO;
-
-/**
- * Interface du service de gestion des utilisateurs.
- *
- * @author amine
- * @version $Id$
- */
-public interface ServiceUser {
-
- /**
- * Création des utilisateurs
- *
- * @param user l'utilisateur
- * @param password le mot de passe
- * @return l'identifiant de l'utilisateur créé
- */
- public String createUser(UserDTO user, String password);
-
- /**
- * Modification d'un utilistaeur
- *
- * @param user utilisateur
- * @return true si l'utilisateur a été modifié
- */
- public boolean updateUser(UserDTO user);
-
- /**
- * Suppression d'un utilisateur
- *
- * @param login de l'utilisateur à supprimer
- * @return true si l'utilisateur a été supprimé
- */
- public boolean deleteUser(String login);
-
- /**
- * Suppression d'un utilisateur
- *
- * @param user un utilisateur
- * @return true si l'utilisateur a été supprimé
- */
- public boolean deleteUser(UserDTO user);
-
- /**
- * Récupération d'un utilisateur à partir de son identifiant
- *
- * @param userId identifiant de l'utilisateur
- * @return l'utilisateur
- */
- public UserDTO findUserById(String userId);
-
- /**
- * Récupération des utilisateurs
- *
- * @param properties filtre
- * @return liste d'utilisateurs
- */
- public List<UserDTO> selectUsers(Map<String, Object> properties);
-
- /**
- * Mise à jour du mot de passe d'un utilisateur
- *
- * @param user l'utilisateur
- * @param newPassword le nouveau mot de passe
- * @return true si le mot de passe a été modifié
- */
- public boolean updatePasswordUser(UserDTO user, String newPassword);
-
- /**
- * Test de l'existance d'un identifiant utilisateur
- *
- * @param login l'identifiant utilisateur
- * @return true si l'identifiant existe, false sinon
- */
- public boolean isUserLoginExisting(String login);
-
- /**
- * Test de l'existance d'un email utilisateur
- *
- * @param email l'email utilisateur
- * @return true si l'email existe, false sinon
- */
- public boolean isUserEmailExisting(String email);
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceUserImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceUserImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceUserImpl.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,349 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.PollenContext;
-import org.chorem.pollen.business.PollenContextImplementor;
-import org.chorem.pollen.business.converters.DataUserConverter;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.business.persistence.UserAccount;
-import org.chorem.pollen.business.persistence.UserAccountDAO;
-import org.chorem.pollen.business.utils.ContextUtil;
-import org.chorem.pollen.business.utils.MD5;
-import org.nuiton.topia.TopiaContext;
-import static org.nuiton.i18n.I18n.n_;
-
-/**
- * Implémentation du service de gestion des utilisateurs.
- *
- * @author amine
- * @author rannou
- * @version $Id$
- */
-public class ServiceUserImpl implements ServiceUser {
- private PollenContextImplementor context;
- private UserAccountDAO userDAO = null;
- private DataUserConverter converter = new DataUserConverter();
-
- /** log. */
- private static final Log log = LogFactory.getLog(ServiceUserImpl.class);
-
- public ServiceUserImpl(PollenContextImplementor context) {
- this.context = context;
- }
-
- @Override
- public String createUser(UserDTO user, String password) {
- TopiaContext transaction = null;
- String topiaId = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- userDAO = PollenModelDAOHelper.getUserAccountDAO(transaction);
- if (userDAO.findByLogin(user.getLogin()) != null
- || (!"".equals(user.getEmail()) && userDAO.findByEmail(user
- .getEmail()) != null)) {
- return null;
- }
-
- UserAccount userEntity = userDAO.create();
- converter.populateUserEntity(user, userEntity, password);
-
- topiaId = userEntity.getTopiaId();
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity created: " + topiaId);
- }
-
- return topiaId;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public boolean deleteUser(String login) {
- TopiaContext transaction = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- userDAO = PollenModelDAOHelper.getUserAccountDAO(transaction);
-
- UserAccount userEntity = userDAO.findByLogin(login);
-
- userDAO.delete(userEntity);
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity deleted: " + userEntity.getTopiaId());
- }
-
- return true;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return false;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public boolean deleteUser(UserDTO user) {
- TopiaContext transaction = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- userDAO = PollenModelDAOHelper.getUserAccountDAO(transaction);
-
- UserAccount userEntity = userDAO.findByTopiaId(user.getId());
- userDAO.delete(userEntity);
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity deleted: " + userEntity.getTopiaId());
- }
-
- return true;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return false;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public UserDTO findUserById(String userId) {
- TopiaContext transaction = null;
- UserDTO result = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- userDAO = PollenModelDAOHelper.getUserAccountDAO(transaction);
-
- UserAccount userEntity = userDAO.findByTopiaId(userId);
-
- if (userEntity != null) {
- converter.setTransaction(transaction);
- result = converter.createUserDTO(userEntity);
- }
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity found: "
- + ((result == null) ? "null" : result.getId()));
- }
-
- return result;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public List<UserDTO> selectUsers(Map<String, Object> properties) {
- TopiaContext transaction = null;
- List<UserDTO> results = null;
- List<UserAccount> userEntities = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- userDAO = PollenModelDAOHelper.getUserAccountDAO(transaction);
-
- if (properties == null) {
- userEntities = userDAO.findAll();
- if (log.isWarnEnabled()) {
- log
- .warn("Attention : tous les utilisateurs ont été sélectionnés !");
- }
- } else {
- userEntities = userDAO.findAllByProperties(properties);
- }
-
- results = converter.createUserDTOs(userEntities);
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entities found: "
- + ((results == null) ? "null" : results.size()));
- }
-
- return results;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public boolean updateUser(UserDTO user) {
- TopiaContext transaction = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- userDAO = PollenModelDAOHelper.getUserAccountDAO(transaction);
-
- UserAccount userEntity = userDAO.findByTopiaId(user.getId());
-
- converter.setTransaction(transaction);
- converter.populateUserEntity(user, userEntity);
-
- userDAO.update(userEntity);
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity updated: " + user.getId());
- }
-
- return true;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return false;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public boolean updatePasswordUser(UserDTO user, String newPassword) {
- TopiaContext transaction = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- userDAO = PollenModelDAOHelper.getUserAccountDAO(transaction);
-
- UserAccount userEntity = userDAO.findByTopiaId(user.getId());
-
- userEntity.setPassword(newPassword);
- userEntity.update();
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity updated: " + user.getId());
- }
-
- return true;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return false;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public boolean isUserLoginExisting(String login) {
- TopiaContext transaction = null;
- boolean userExists = true;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- userDAO = PollenModelDAOHelper.getUserAccountDAO(transaction);
- if (userDAO.findByLogin(login) == null) {
- userExists = false;
- }
-
- if (log.isDebugEnabled()) {
- log.debug("Entity exists for the login " + login + ": "
- + userExists);
- }
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return true;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- return userExists;
- }
-
- @Override
- public boolean isUserEmailExisting(String email) {
- TopiaContext transaction = null;
- boolean userExists = true;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- userDAO = PollenModelDAOHelper.getUserAccountDAO(transaction);
- if (userDAO.findByEmail(email) == null) {
- userExists = false;
- }
-
- if (log.isDebugEnabled()) {
- log.debug("Entity exists for the email " + email + ": "
- + userExists);
- }
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return true;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- return userExists;
- }
-
- public void createDefaultAdmin(String login, String password, String email) {
- TopiaContext transaction = null;
- try {
-
- transaction = context.getRootContext().beginTransaction();
-
- UserAccountDAO dao =
- PollenModelDAOHelper.getUserAccountDAO(transaction);
-
- int nbAdmin = dao.createQuery().
- add(UserAccount.ADMINISTRATOR, Boolean.TRUE).executeCount();
-
- if (nbAdmin == 0) {
- UserAccount userEntity = dao.create();
- userEntity.setLogin(login);
- String encodedPassword = MD5.encode(password);
- userEntity.setPassword(encodedPassword);
- userEntity.setEmail(email);
- userEntity.setAdministrator(true);
-
- if (log.isInfoEnabled()) {
- log.info("Utilisateur " + userEntity.getLogin() + " créé.");
- }
-
- transaction.commitTransaction();
- }
- } catch (Exception eee) {
- context.doCatch(transaction, eee,
- n_("pollen.error.serviceUser.createDefaultAdmin"),
- login, email);
- } finally {
- context.doFinally(transaction);
- }
- }
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVote.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVote.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVote.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,95 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import java.util.List;
-import java.util.Map;
-
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.dto.VoteDTO;
-
-/**
- * Interface du service de vote.
- *
- * @version $Id$
- */
-public interface ServiceVote {
-
- /**
- * Rajouter un vote à un sondage
- *
- * @param voteDTO Le DTO du vote
- * @return L'ID du vote créé
- */
- public String createVote(VoteDTO voteDTO, PollAccountDTO pollAccountDTO);
-
- /**
- * Mise à jour d'un vote
- *
- * @param voteDTO Le DTO du vote
- * @return Retourne TRUE si la mise à jour s'est correctement déroulée
- */
- public boolean updateVote(VoteDTO voteDTO);
-
- /**
- * Supprime un vote de la base de données
- *
- * @param voteId L'identifiant du vote
- * @return Retourne TRUE si la suppression s'est correctement déroulée
- */
- public boolean deleteVote(String voteId);
-
- /**
- * Retrieve existings votes from the {@code poll}. Only needed votes inside
- * the range ({@code startIndex} and {@code endIndex}) will be retrieve.
- * The results will be ordered by creationDate (the last vote done will
- * be at the end of the list).
- *
- * @param poll to retrieve votes
- * @param startIndex begin range for resulting votes
- * @param endIndex end range for resulting votes
- * @return the votes corresponding to the poll between the range
- */
- public List<VoteDTO> getVotesByPoll(PollDTO poll,
- int startIndex, int endIndex);
-
- public PollAccountDTO getNewPollAccount(UserDTO user);
-
- /**
- * Test if the {@code votingId} has already voted for the {@code poll}.
- *
- * @param votingId to test existing vote
- * @param poll where the votingId can have already voted
- * @return true if the votingId has already voted or false otherwise
- */
- public boolean hasAlreadyVoted(String votingId, PollDTO poll);
-
- /**
- * Retourne les votes d'un sondage
- *
- * @param properties La HashMap pour sélectionner les votes d'un sondage. Il
- * faut y mettre le bon champs pollId
- * @return Les votes d'un sondage dans un DTO, le tout stocké dans une
- * liste.
- */
- public List<VoteDTO> selectVotes(Map<String, Object> properties);
-
- public VoteDTO getNewVote(PollAccountDTO account);
-
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVoteImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVoteImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVoteImpl.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,524 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.PollenContextImplementor;
-import org.chorem.pollen.business.converters.DataPollAccountConverter;
-import org.chorem.pollen.business.converters.DataVoteConverter;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.dto.VoteDTO;
-import org.chorem.pollen.business.persistence.Choice;
-import org.chorem.pollen.business.persistence.ChoiceDAO;
-import org.chorem.pollen.business.persistence.PersonToList;
-import org.chorem.pollen.business.persistence.PersonToListDAO;
-import org.chorem.pollen.business.persistence.Poll;
-import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.business.persistence.PollAccountDAO;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.business.persistence.UserAccount;
-import org.chorem.pollen.business.persistence.Vote;
-import org.chorem.pollen.business.persistence.VoteDAO;
-import org.chorem.pollen.business.persistence.VoteToChoice;
-import org.chorem.pollen.business.persistence.VoteToChoiceDAO;
-import org.chorem.pollen.business.persistence.VotingList;
-import org.chorem.pollen.business.persistence.VotingListDAO;
-import org.chorem.pollen.business.utils.ContextUtil;
-import org.chorem.pollen.common.PollType;
-import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.TopiaException;
-import org.nuiton.topia.framework.TopiaQuery;
-import org.nuiton.topia.persistence.TopiaEntity;
-import static org.nuiton.i18n.I18n.n_;
-
-/**
- * Implémentation du service de gestion des votes.
- *
- * @author rannou
- * @version $Id$
- */
-public class ServiceVoteImpl implements ServiceVote {
-
- private PollenContextImplementor context;
- private DataVoteConverter converter = new DataVoteConverter();
-
- /** log. */
- private static final Log log = LogFactory.getLog(ServiceVoteImpl.class);
-
- public ServiceVoteImpl(PollenContextImplementor context) {
- this.context = context;
-
- this.context.getConverter().prepareVoteConverters();
- }
-
- @Override
- public String createVote(VoteDTO voteDTO, PollAccountDTO pollAccountDTO) {
- TopiaContext transaction = null;
- String topiaId = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- // création du compte associé au vote s'il n'existe pas
- // sinon mise à jour du compte
- //ServicePollAccount spa = new ServicePollAccountImpl();
- if (pollAccountDTO != null) {
- pollAccountDTO.setHasVoted(true);
- PollAccountDAO pollAccountDAO = PollenModelDAOHelper.getPollAccountDAO(transaction);
-
- PollAccount pollAccountEntity =
- pollAccountDAO.findByTopiaId(pollAccountDTO.getId());
-
-// PollAccountDTO account = spa.findPollAccountById(pollAccountDTO
-// .getId());
- if (pollAccountEntity == null) {
- log.debug("Nouveau compte associé au vote");
- pollAccountEntity = pollAccountDAO.create(
- context.createPollenUrlId());
- // EVO #108 : Migration to ToPIA 2.3, the entity must be
- // commited because an other findBy is called in the
- // converter (wtf ?! :/). This behavior doesn't work
- // anymore.
- transaction.commitTransaction();
-// voteDTO.setPollAccountId(spa
-// .createPollAccount(pollAccountDTO));
- } else {
- log.debug("Compte associé au vote : " + pollAccountEntity.getTopiaId());
- //spa.updatePollAccount(pollAccountDTO);
- //voteDTO.setPollAccountId(account.getId());
-
- }
- // Fill pollAccountEntity from DTO in argument
- DataPollAccountConverter pollAccountConverter = new DataPollAccountConverter();
- pollAccountConverter.setTransaction(transaction);
- pollAccountConverter.populatePollAccountEntity(pollAccountDTO,
- pollAccountEntity);
- // Update pollAccountEntity
- pollAccountDAO.update(pollAccountEntity);
-
- voteDTO.setPollAccountId(pollAccountEntity.getTopiaId());
- voteDTO.setVotingListId(pollAccountDTO.getVotingListId());
- voteDTO.setWeight(pollAccountDTO.getWeight());
- log.debug("Poids du vote : " + voteDTO.getWeight());
- } else {
- voteDTO.setPollAccountId(null);
- }
-
- VoteDAO voteDAO = PollenModelDAOHelper.getVoteDAO(transaction);
-
- Vote voteEntity = voteDAO.create();
- converter.setTransaction(transaction);
- converter.populateVoteEntity(voteDTO, voteEntity);
-
- transaction.commitTransaction();
-
- converter.populateChoiceVote(voteDTO, voteEntity);
-
- topiaId = voteEntity.getTopiaId();
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity created: " + topiaId);
- }
-
- return topiaId;
- } catch (Exception eee) {
- ContextUtil.doCatch(eee, transaction, "Problem when creating vote with pollAccount");
- return null;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public boolean updateVote(VoteDTO voteDTO) {
- TopiaContext transaction = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- VoteDAO voteDAO = PollenModelDAOHelper.getVoteDAO(transaction);
- Vote voteEntity = voteDAO.findByTopiaId(voteDTO.getId());
- converter.setTransaction(transaction);
- converter.populateVoteEntity(voteDTO, voteEntity);
- voteEntity.update();
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity updated: " + voteDTO.getId());
- }
-
- return true;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return false;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public boolean deleteVote(String voteId) {
- TopiaContext transaction = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- VoteDAO voteDAO = PollenModelDAOHelper.getVoteDAO(transaction);
- Vote voteEntity = voteDAO.findByTopiaId(voteId);
- voteEntity.delete();
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entity deleted: " + voteId);
- }
-
- return true;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return false;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public List<VoteDTO> getVotesByPoll(PollDTO poll,
- int startIndex, int endIndex) {
- TopiaContext transaction = null;
- List<VoteDTO> results = new ArrayList<VoteDTO>();
- try {
- if (log.isInfoEnabled()) {
- log.info("P:[ getVotesByPoll ] : " +
- "pollUId = " + poll.getPollUId() +
- " _ startIndex = " + startIndex +
- " _ endIndex = " + endIndex);
- }
-
- // No need to load votes for an anonymous poll
- if (poll.isAnonymous()) {
- return results;
- }
-
- // FIXME-FD20100309 : change dto to suppress link from poll to vote
- // It's not necessary to have votes when retrieving the poll, this
- // method do this job only when it's needed
- transaction = context.getRootContext().beginTransaction();
-
-// List<Vote> votes = transaction.find(
-// "FROM " + Vote.class.getName() +
-// " WHERE poll.pollId = :pollUId" +
-// " ORDER BY topiaCreateDate",
-// startIndex, endIndex,
-// "pollUId", poll.getPollId());
-
- VoteDAO voteDAO = PollenModelDAOHelper.getVoteDAO(transaction);
- // Order the results by creation date (the last vote done will be
- // at the end of the list)
- TopiaQuery query = voteDAO.createQuery().
- add(Vote.POLL + "." + Poll.POLL_ID, poll.getPollUId()).
- addOrder(TopiaEntity.TOPIA_CREATE_DATE).
- setLimit(startIndex, endIndex);
-
- List<Vote> eVotes = voteDAO.findAllByQuery(query);
-
- if (log.isDebugEnabled()) {
- log.debug("Nb votes found : " + eVotes.size());
- }
- for (Vote eVote : eVotes) {
- VoteDTO vote = context.getConverter().convert(eVote, new VoteDTO());
- results.add(vote);
- }
-// converter.setTransaction(transaction);
-// results = converter.createVoteDTOs(votes);
-
- } catch (Exception eee) {
- context.doCatch(transaction, eee,
- n_("pollen.error.serviceVote.getVotesByPoll"),
- poll.getPollUId());
- } finally {
- context.doFinally(transaction);
- }
- return results;
- }
-
- @Override
- public PollAccountDTO getNewPollAccount(UserDTO user) {
- PollAccountDTO result = new PollAccountDTO();
- if (user == null) {
- return result;
- }
- // Initialize the default account for user
- if (user.getFirstName() != null && user.getLastName() != null) {
- result.setVotingId(
- user.getFirstName() + " " + user.getLastName());
-
- } else if (user.getFirstName() != null) {
- result.setVotingId(user.getFirstName());
-
- } else if (user.getLastName() != null) {
- result.setVotingId(user.getLastName());
- }
- // Link the new account with the user
- result.setUserId(user.getId());
- return result;
- }
-
- @Override
- public boolean hasAlreadyVoted(String votingId, PollDTO poll) {
- TopiaContext transaction = null;
- boolean result = false;
- try {
- if (log.isInfoEnabled()) {
- log.info("P:[ hasAlreadyVoted ] : votingId = " + votingId +
- " _ pollUId = " + poll.getPollUId());
- }
-
- transaction = context.getRootContext().beginTransaction();
-
-// List<Long> tmp = transaction.find(
-// "SELECT COUNT(*)" +
-// " FROM " + Vote.class.getName() +
-// " WHERE poll.pollId = :pollUId" +
-// " AND pollAccount.votingId = :votingId",
-// "pollUId", poll.getPollId(),
-// "votingId", votingId);
-
- // Test using a count on votes
- TopiaQuery query = new TopiaQuery(Vote.class).
- add(Vote.POLL + "." + Poll.POLL_ID, poll.getPollUId()).
- add(Vote.POLL_ACCOUNT + "." + PollAccount.VOTING_ID,
- votingId);
-
- int count = query.executeCount(transaction);
-
- // If the count is greater than 0, there is an existing votingId
- // who has already voted for the poll
- result = count > 0;
-
- } catch (Exception eee) {
- context.doCatch(transaction, eee,
- n_("pollen.error.serviceVote.hasAlreadyVoted"),
- votingId, poll.getPollUId());
- } finally {
- context.doFinally(transaction);
- }
- return result;
- }
-
- @Override
- public List<VoteDTO> selectVotes(Map<String, Object> properties) {
- TopiaContext transaction = null;
- List<VoteDTO> results = null;
- List<Vote> voteEntities = null;
- try {
- transaction = context.getRootContext().beginTransaction();
-
- VoteDAO voteDAO = PollenModelDAOHelper.getVoteDAO(transaction);
-
- if (properties == null) {
- voteEntities = voteDAO.findAll();
- if (log.isWarnEnabled()) {
- log.warn("Attention : tous les votes ont été sélectionnés !");
- }
- } else {
- voteEntities = voteDAO.findAllByProperties(properties);
- }
-
- converter.setTransaction(transaction);
- results = converter.createVoteDTOs(voteEntities);
-
- transaction.commitTransaction();
-
- if (log.isDebugEnabled()) {
- log.debug("Entities found: "
- + ((results == null) ? "null" : results.size()));
- }
-
- return results;
- } catch (Exception e) {
- ContextUtil.doCatch(e, transaction);
- return null;
- } finally {
- ContextUtil.doFinally(transaction);
- }
- }
-
- @Override
- public VoteDTO getNewVote(PollAccountDTO account) {
- VoteDTO result = new VoteDTO();
- result.setWeight(1.);
- result.setPollAccountId(account.getId());
- return result;
- }
-
- private void updateChoiceValues(TopiaContext transaction,
- VoteDTO vote, Vote eVote) throws TopiaException {
-
- VoteToChoiceDAO voteToChoiceDAO =
- PollenModelDAOHelper.getVoteToChoiceDAO(transaction);
-
- ChoiceDAO choiceDAO = PollenModelDAOHelper.getChoiceDAO(transaction);
-
- for (Map.Entry<String, Integer> choiceValue :
- vote.getChoiceValues().entrySet()) {
-
- // Find existing choice
- Choice choice = choiceDAO.findByTopiaId(choiceValue.getKey());
-
- // Find existing vote
- VoteToChoice voteToChoice = voteToChoiceDAO.findByProperties(
- VoteToChoice.CHOICE, choice,
- VoteToChoice.VOTE, eVote);
-
- // Create new vote if needed
- if (voteToChoice == null) {
- voteToChoice = voteToChoiceDAO.create(
- VoteToChoice.CHOICE, choice,
- VoteToChoice.VOTE, eVote);
- }
- // Update vote value
- voteToChoice.setVoteValue(choiceValue.getValue());
- }
- }
-
- private PersonToList validateForRestrictedPoll(TopiaContext transaction,
- VoteDTO vote, PollAccount eAccount, Poll ePoll)
- throws TopiaException {
- PersonToList person = null;
- if (eAccount == null) {
- //throw exception : not allowed
- return person;
- } else {
- PersonToListDAO personDAO =
- PollenModelDAOHelper.getPersonToListDAO(transaction);
-
- String pPoll =
- PersonToList.VOTING_LIST + "." + VotingList.POLL;
-
- TopiaQuery query = personDAO.createQuery().
- add(PersonToList.POLL_ACCOUNT, eAccount).
- add(PersonToList.HAS_VOTED, Boolean.FALSE).
- add(pPoll, ePoll);
-
- person = personDAO.findByQuery(query);
- if (person == null && !ePoll.getAnonymous()) {
- // throw exception : not allowed
- return person;
- }
- }
- return person;
- }
-
-// @Override
-// public void createOrUpdateVote(VoteDTO vote, PollDTO poll) {
-// TopiaContext transaction = null;
-// try {
-// PollType pollType = poll.getPollType();
-//
-// //PollAccountDTO account = vote.getAccount();
-//
-// if (log.isInfoEnabled()) {
-// log.info("P:[ getNewVote ] : " +
-// "accountName = " + account.getVotingId() +
-// " _ accountUId = " + account.getAccountUId() +
-// " _ pollUId = " + poll.getPollUId() +
-// " _ pollType = " + pollType);
-// }
-//
-// transaction = context.getRootContext().beginTransaction();
-//
-// VoteDAO dao = PollenModelDAOHelper.getVoteDAO(transaction);
-//
-// Vote eVote = dao.findByTopiaId(vote.getId());
-//
-// if (eVote != null) {
-//
-// updateChoiceValues(transaction, vote, eVote);
-//
-// // Don't touch to pollAccount for existing vote
-// } else {
-//
-// Poll ePoll = PollenModelDAOHelper.getPollDAO(transaction).
-// findByTopiaId(poll.getId());
-//
-// // Retrieve existing account
-// PollAccountDAO accountDAO =
-// PollenModelDAOHelper.getPollAccountDAO(transaction);
-// PollAccount eAccount =
-// accountDAO.findByTopiaId(account.getId());
-//
-// PersonToList person = null;
-// if (pollType.isRestrictedOrGroup()) {
-// person = validateForRestrictedPoll(transaction, vote,
-// eAccount, ePoll);
-// } else {
-// if (eAccount == null) {
-// // Create new Account
-// eAccount =
-// accountDAO.create(context.createPollenUrlId());
-// context.getConverter().convert(account, eAccount);
-// }
-//
-// VotingListDAO listDAO =
-// PollenModelDAOHelper.getVotingListDAO(transaction);
-//
-// VotingList list = null;
-// if (ePoll.sizeVotingList() == 0) {
-// list = listDAO.create();
-// } else {
-// list = ePoll.getVotingList().get(0);
-//
-// }
-// }
-//
-// // Link with existing connected user
-// if (account.getUserId() != null) {
-// UserAccount user =
-// PollenModelDAOHelper.getUserAccountDAO(transaction).
-// findByTopiaId(account.getUserId());
-//
-// user.addPollAccount(eAccount);
-// }
-//
-// eVote = context.getConverter().convert(vote, dao.create());
-// if (!eVote.getAnonymous()) {
-// eVote.setPollAccount(eAccount);
-// }
-//
-// ePoll.addVote(eVote);
-//
-//
-// }
-//
-//
-//
-// } catch (Exception eee) {
-// context.doCatch(transaction, eee,
-// n_("pollen.error.serviceVote.getVote"),
-// poll.getTitle(), poll.getId());
-// } finally {
-// context.doFinally(transaction);
-// }
-// }
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/package-info.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/package-info.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/package-info.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,4 +0,0 @@
-/**
- * Services proposés par le module Business.
- */
-package org.chorem.pollen.business.services;
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/ContextUtil.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/ContextUtil.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/ContextUtil.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,387 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.utils;
-
-import java.util.Properties;
-
-import java.util.UUID;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.PollenBusinessException;
-import org.chorem.pollen.business.PollenContextImpl;
-import org.chorem.pollen.business.PollenException;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.business.persistence.UserAccount;
-import org.chorem.pollen.business.persistence.UserAccountDAO;
-import org.chorem.pollen.business.services.ServiceUserImpl;
-import org.hibernate.exception.SQLGrammarException;
-import org.nuiton.i18n.I18n;
-import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.TopiaContextFactory;
-import org.nuiton.topia.TopiaException;
-import org.nuiton.topia.TopiaNotFoundException;
-import org.nuiton.topia.persistence.TopiaDAO;
-import org.nuiton.topia.persistence.TopiaEntity;
-
-/**
- * Charge et génère le contexte global.
- *
- * @author rannou
- * @version $Id$
- * @deprecated use class {@link org.chorem.pollen.business.PollenContext}
- */
-@Deprecated
-public class ContextUtil {
-
- /** log. */
- private static final Log log = LogFactory.getLog(ContextUtil.class);
-
- /**
- * Instance de la classe (patron singleton)
- */
- private static ContextUtil instance = null;
-
- /**
- * Contexte global
- */
- private TopiaContext context = null;
-
- /**
- * Propriétés de la base de données.
- */
- @Deprecated
- private Properties conf;
- /**
- * Retourne le contexte global.
- *
- * @return le contexte global
- * @
- * @deprecated use {@link #getRootContext } instead
- */
-// @Deprecated
-// public TopiaContext getContext() {
-// return PollenContexImpl.getRootContext();
-// }
-//
-// /**
-// * Retourne la configuration de la base de données.
-// *
-// * @return la configuration
-// * @
-// */
-// public Properties getConf() {
-// return PollenContexImpl.getProperties();
-// }
- /**
- * Construction du contexte global
- * @deprecated use directly {@link #getRootContext} method
- */
- @Deprecated
- public void buildContext() {
- if (context == null || context.isClosed()) {
- try {
- if (log.isInfoEnabled()) {
- log.info("Construction du contexte global...");
- }
- context = TopiaContextFactory.getContext(conf);
- } catch (TopiaNotFoundException e) {
- if (log.isErrorEnabled()) {
- log.error("Erreur lors de la construction du contexte", e);
- }
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Fermeture du contexte global
- * @deprecated not necessary, the close will be done in PollenRunner
- */
- @Deprecated
- public void closeContext() {
- if (context != null && !context.isClosed()) {
- try {
- if (log.isInfoEnabled()) {
- log.info("Fermeture du contexte global...");
- }
- context.closeContext();
- } catch (TopiaException e) {
- if (log.isErrorEnabled()) {
- log.error("Erreur lors de la fermeture du contexte", e);
- }
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Retourne l'instance unique de la classe (patron singleton)
- *
- * @return L'instance de la classe
- * @deprecated ContextUtil methods are static
- */
- @Deprecated
- public static ContextUtil getInstance() {
- if (instance == null) {
- instance = new ContextUtil();
- }
- return instance;
- }
-
- /**
- * Use to get properties filename in JNDI envirronement.
- *
- * Usefull to use un different war in embedded war context.
- *
- * @return properties filename found in JNDI (or a default one)
- * @deprecated not usefull anymore, the default properties file is loaded
- * even if the application is embedded.
- */
- @Deprecated
- protected String getPropertiesFileName() {
- String filename = null;
-
- try {
- Context jndiContext = new InitialContext();
-
- filename = (String) jndiContext.lookup("configurationfilename");
- } catch (NamingException e) {
-
- // ce n'est pas forcement une erreur
- // elle arrive si l'application est lancé normalement
- // c'est a dire (hors war embarqué par winstone)
- if (log.isInfoEnabled()) {
- log.info("JNDI context not found (normal launch, jndi only exist in winstone launch)");
-
- if (log.isTraceEnabled()) {
- log.trace("Can't get jndi", e);
- }
- }
- }
-
- // .. if styll null, set default one
- if (filename == null || filename.isEmpty()) {
- filename = "pollen.properties";
- }
-
- return filename;
- }
-
- /**
- * Constructeur. Construit le contexte global après avoir lu le fichier de
- * configuration de Pollen.
- */
- private ContextUtil() {
-
-// String propertiesFilename = getPropertiesFileName();
- String propertiesFilename = "pollen.properties";
-
- // Chargement du fichier de configuration
- conf = PropertiesLoader.loadPropertiesFile(propertiesFilename);
- conf.setProperty("topia.persistence.classes",
- PollenModelDAOHelper.getImplementationClassesAsString());
- conf.setProperty("topia.service.migration.version",
- PollenModelDAOHelper.getModelVersion());
-
- I18n.init();
-
- // Construction du contexte global
- buildContext();
-
- // Initialisation de la base de données. Si elle n'existe pas on la crée
- // FIXME Il ne faudrait pas se baser sur l'exception SQLGrammarException pour détecter que la base n'existe pas
- try {
- initDB();
- } catch (TopiaException e) {
- log.error("Base de données inexistante");
- if (e.getCause() instanceof SQLGrammarException) {
- log.info("Création de la base de données...");
- try {
- context.createSchema();
- log.info("Base de données créée");
- initDB();
- } catch (TopiaException ex) {
- log.error("Échec lors de la création de la base", ex);
- }
- }
- }
- }
-
- /**
- * Chargement des valeurs initiales dans la base de données.
- *
- * @throws TopiaException
- * @deprecated use
- * {@link ServiceUserImpl#createDefaultAdmin(String, String, String) }
- * method to create the default admin
- */
- @Deprecated
- protected void initDB() throws TopiaException {
- TopiaContext transaction = null;
- transaction = context.beginTransaction();
-
- // Chargement des types de choix dans la table choiceType
-// ChoiceTypeDAO choiceTypeDAO = PollenModelDAOHelper
-// .getChoiceTypeDAO(transaction);
-// loadDB("choiceType", choiceTypeDAO);
-// transaction.commitTransaction();
-
- // Chargement des types de sondage dans la table pollType
-// PollTypeDAO pollTypeDAO = PollenModelDAOHelper
-// .getPollTypeDAO(transaction);
-// loadDB("pollType", pollTypeDAO);
-// transaction.commitTransaction();
-
- // Chargement des types de dépouillement dans la table voteCounting
-// VoteCountingDAO voteCountingDAO = PollenModelDAOHelper
-// .getVoteCountingDAO(transaction);
-// loadDB("voteCounting", voteCountingDAO);
-// transaction.commitTransaction();
-
- // Chargement de l'utilisateur par défaut
- UserAccountDAO userAccountDAO = PollenModelDAOHelper
- .getUserAccountDAO(transaction);
- loadAdmin(userAccountDAO);
- transaction.commitTransaction();
-
- transaction.closeContext();
- }
-
- /**
- * Chargement des types dans la base de données à partir du fichier de
- * configuration.
- *
- * @param element la clé du type dans le fichier de configuration
- * @param dao le DAO correspondant au type
- * @throws TopiaException
- */
- private void loadDB(String element, TopiaDAO dao) throws TopiaException {
- String strType = conf.getProperty(element);
- String[] tabTypes = strType.split(",");
-
- // Recherche chaque element de la liste et le crée dans
- // la base de données s'il n'existe pas
- for (int i = 0; i < tabTypes.length; i++) {
- TopiaEntity entity = dao.findByProperty("name", tabTypes[i]);
-
- if (entity == null) {
- dao.create("name", tabTypes[i]);
- }
- }
-
- if (log.isInfoEnabled()) {
- log.info("Types " + element + " créés.");
- }
- }
-
- /**
- * Chargement de l'utilisateur par défaut dans la base de données à partir
- * du fichier de configuration.
- *
- * @param dao le DAO pour les utilisateurs
- * @throws TopiaException
- */
- private void loadAdmin(UserAccountDAO dao) throws TopiaException {
- if (dao.findAllByAdministrator(true).size() == 0) {
- UserAccount userEntity = dao.create();
- userEntity.setLogin(conf.getProperty("adminLogin"));
- userEntity.setPassword(MD5
- .encode(conf.getProperty("adminPassword")));
- userEntity.setEmail(conf.getProperty("adminEmail"));
- userEntity.setAdministrator(true);
-
- if (log.isInfoEnabled()) {
- log.info("Utilisateur " + userEntity.getLogin() + " créé.");
- }
- }
- }
-
- /**
- *
- * @param e
- * @param transaction
- * @throws PollenException
- * @deprecated must defined a message using {@link PollenContext#doCatch(Exception, TopiaContext, String) }
- */
- @Deprecated
- public static void doCatch(Exception e, TopiaContext transaction) throws PollenException {
- doCatch(e, transaction, "Échec lors du déroulement de la transaction");
- }
-
- /**
- * Méthode exécutée lorsqu'une exception est détectée.
- *
- * @param eee
- * @param message
- * @param transaction la transaction courante
- * @throws PollenException
- * @deprecated must defined a message using {@link PollenContext#doCatch(Exception, TopiaContext, String) }
- */
- @Deprecated
- public static void doCatch(Exception eee, TopiaContext transaction, String message) throws PollenException {
- if (log.isErrorEnabled()) {
- log.error(message, eee);
- }
-
- // rollback de la transaction courante
- if (transaction != null) {
- try {
- transaction.rollbackTransaction();
- } catch (TopiaException ex) {
- if (log.isErrorEnabled()) {
- log.error("Échec lors du rollback de la transaction", ex);
- }
- }
- }
- // PollenBusinessException must be managed (catch and throw) when needed
-// if (! (eee instanceof PollenBusinessException)) {
- throw new PollenException(eee, message);
-// }
- }
-
- /**
- * Méthode exécutée dans tous les cas pour libérer la transaction.
- *
- * @param transaction transaction en cours
- * @deprecated must defined a message using {@link PollenContext#doFinally(TopiaContext) }
- */
- @Deprecated
- public static void doFinally(TopiaContext transaction) {
- if (transaction != null) {
- try {
- transaction.closeContext();
- } catch (TopiaException ex) {
- if (log.isErrorEnabled()) {
- log.error("Échec lors de la fermeture de la transaction", ex);
- }
- }
- }
- }
-
- /**
- * @return generated string for urlId
- * @deprecated must defined a message using {@link PollenContext#createPollenUrlId() }
- */
- @Deprecated
- public static String createPollenUrlId() {
- return UUID.randomUUID().toString().replaceAll("-", "");
- }
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/MD5.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/MD5.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/MD5.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,59 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.utils;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-/**
- * Classe utilitaire permettant d'encoder des chaîne en MD5.
- *
- * @version $Id$
- */
-public class MD5 {
-
- /**
- * Encode la chaine passé en paramètre avec l’algorithme MD5
- *
- * @param key : la chaine à encoder
- * @return la valeur (string) hexadécimale sur 32 bits
- */
- public static String encode(String key) {
-
- byte[] uniqueKey = key.getBytes();
- byte[] hash = null;
-
- try {
- // on récupère un objet qui permettra de crypter la chaine
- hash = MessageDigest.getInstance("MD5").digest(uniqueKey);
- } catch (NoSuchAlgorithmException e) {
- throw new Error("no MD5 support in this VM");
- }
-
- StringBuffer hashString = new StringBuffer();
- for (int i = 0; i < hash.length; ++i) {
- String hex = Integer.toHexString(hash[i]);
- if (hex.length() == 1) {
- hashString.append("0");
- hashString.append(hex.charAt(hex.length() - 1));
- } else {
- hashString.append(hex.substring(hex.length() - 2));
- }
- }
- return hashString.toString();
- }
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/MailUtil.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/MailUtil.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/MailUtil.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,73 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.utils;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.commons.mail.EmailException;
-import org.apache.commons.mail.SimpleEmail;
-
-/**
- * Classe permettant d'envoyer des mails. Basée sur {@link SimpleEmail} (commons-email).
- *
- * @author rannou
- * @version $Id$
- */
-public class MailUtil {
-
- /** log. */
- private static final Log log = LogFactory.getLog(MailUtil.class);
-
- /**
- * Envoi d'un email.
- *
- * @param host Nom du serveur
- * @param port Port SMTP
- * @param from Adresse email de l'expéditeur
- * @param to Adresse email du destinataire
- * @param subject Sujet
- * @param msg Message
- */
- public static void sendMail(String host, int port, String from, String to,
- String subject, String msg) {
- SimpleEmail email = new SimpleEmail();
- try {
- email.setHostName(host);
- email.setSmtpPort(port);
- email.setFrom(from);
- email.addTo(to);
- email.setSubject(subject);
- email.setMsg(msg);
- email.setCharset("UTF-8");
- email.send();
- } catch (EmailException e) {
- log.error("Erreur à l'envoi d'email", e);
- }
-
- if (log.isInfoEnabled()) {
- log.info("Mail sent to : " + to);
-
- if (log.isDebugEnabled()) {
- log.debug("Détail de l'email : " + "\ndate: " + email.getSentDate()
- + "\nhostname: " + email.getHostName() + "\nport: "
- + email.getSmtpPort() + "\nfrom: "
- + email.getFromAddress().toString() + "\nto: " + to
- + "\nsubject: " + email.getSubject());
- }
- }
- }
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/PropertiesLoader.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/PropertiesLoader.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/PropertiesLoader.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,72 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.utils;
-
-import java.util.Properties;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.util.Resource;
-
-/**
- * Charge les propriétés du fichier properties pour la configuration de la base
- * de données
- *
- * @author rannou
- * @version $Id$
- * @deprecated use {@link org.chorem.pollen.business.PollenContext } to manage
- * configuration using {@link org.nuiton.util.ApplicationConfig }
- */
-@Deprecated
-public class PropertiesLoader {
-
- /** log. */
- private static final Log log = LogFactory.getLog(PropertiesLoader.class);
-
- /**
- * Charge le fichier properties et retourne les propriétés créées
- *
- * @param filename Le fichier properties
- * @return Les propriétés de la base de données
- */
- public static Properties loadPropertiesFile(String filename) {
- Properties conf = null;
-
- try {
- conf = new Properties();
-
- //URL url = Resource.getURL(filename);
- //conf.load(url.openStream());
-
- Properties confAll = Resource.getConfigProperties(filename);
- for (String key : confAll.stringPropertyNames()) {
- conf.setProperty(key, confAll.getProperty(key));
- }
-
- if (log.isDebugEnabled()) {
- log.debug("Propriétés: " + conf);
- }
- } catch (Exception e) {
- if (log.isErrorEnabled()) {
- log.error("Lecture impossible du fichier de propriétés : "
- + filename, e);
- }
- }
-
- return conf;
- }
-}
Deleted: trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/package-info.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/package-info.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/utils/package-info.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,4 +0,0 @@
-/**
- * Classes utilitaires.
- */
-package org.chorem.pollen.business.utils;
\ No newline at end of file
Added: trunk/pollen-business/src/main/java/org/chorem/pollen/entity/PollImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/entity/PollImpl.java (rev 0)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/entity/PollImpl.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -0,0 +1,39 @@
+
+package org.chorem.pollen.entity;
+
+/**
+ * PollImpl
+ *
+ * Created: 23 mars 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class PollImpl extends PollAbstract {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public boolean canVote(PollAccount person) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean canAdminPoll(PollAccount person) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean canCreateChoice(PollAccount person) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean canAccessPoll(PollAccount person) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+}
Property changes on: trunk/pollen-business/src/main/java/org/chorem/pollen/entity/PollImpl.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Added: trunk/pollen-business/src/main/java/org/chorem/pollen/entity/VoteImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/entity/VoteImpl.java (rev 0)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/entity/VoteImpl.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -0,0 +1,24 @@
+
+package org.chorem.pollen.entity;
+
+/**
+ * VoteImpl
+ *
+ * Created: 23 mars 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class VoteImpl extends VoteAbstract {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public boolean canUpdateVote(PollAccount person) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+}
Property changes on: trunk/pollen-business/src/main/java/org/chorem/pollen/entity/VoteImpl.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Added: trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java (rev 0)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -0,0 +1,119 @@
+
+package org.chorem.pollen.service;
+
+import java.util.List;
+import org.chorem.pollen.PollenBusinessException;
+import org.chorem.pollen.PollenContextImplementor;
+import org.chorem.pollen.PollenDAOHelper;
+import org.chorem.pollen.entity.PollDAO;
+import org.chorem.pollen.entity.Choice;
+import org.chorem.pollen.entity.Comment;
+import org.chorem.pollen.entity.Poll;
+import org.chorem.pollen.entity.PollAccount;
+import org.chorem.pollen.entity.PollImpl;
+import org.chorem.pollen.entity.UserAccount;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaException;
+
+/**
+ * ServicePoll
+ *
+ * Created: 23 mars 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class ServicePollImpl extends ServicePollAbstract {
+
+ public ServicePollImpl(PollenContextImplementor context) {
+ super(context);
+ }
+
+ @Override
+ protected Poll executeGetNewPoll(TopiaContext transaction)
+ throws TopiaException {
+
+ PollDAO dao = PollenDAOHelper.getPollDAO(transaction);
+
+ return new PollImpl();
+ }
+
+ @Override
+ protected Poll executeGetNewPoll(TopiaContext transaction, Poll poll)
+ throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected void executeCreatePoll(TopiaContext transaction, Poll poll)
+ throws TopiaException {
+
+ PollDAO dao = PollenDAOHelper.getPollDAO(transaction);
+
+
+ }
+
+ @Override
+ protected void executeUpdatePoll(TopiaContext transaction, Poll poll) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected void executeSavePoll(TopiaContext transaction, Poll poll) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected void executeDeletePoll(TopiaContext transaction, Poll poll) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected void executeDeleteChoice(TopiaContext transaction, Choice choice) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected void executeCreateUpdateVote(TopiaContext transaction, PollAccount person) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected void executeDeleteVote(TopiaContext transaction, Poll poll, PollAccount person) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected Poll executeGetPollForUpdate(TopiaContext transaction, String pollUId) throws PollenBusinessException, TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected List<Poll> executeGetAllPolls(TopiaContext transaction) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected List<Poll> executeGetRunningPolls(TopiaContext transaction) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected List<Poll> executeGetPollsByUser(TopiaContext transaction, UserAccount user) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected List<Comment> executeGetComments(TopiaContext transaction, Poll poll, int startIndex, int endIndex) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected List<PollAccount> executeGetVotes(TopiaContext transaction, Poll poll, int startIndex, int endIndex) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+}
Property changes on: trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Added: trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java (rev 0)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -0,0 +1,79 @@
+
+package org.chorem.pollen.service;
+
+import java.util.List;
+import org.chorem.pollen.PollenBusinessException;
+import org.chorem.pollen.PollenContextImplementor;
+import org.chorem.pollen.entity.PollAccount;
+import org.chorem.pollen.entity.UserAccount;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaException;
+
+/**
+ * ServiceUserImpl
+ *
+ * Created: 23 mars 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class ServiceUserImpl extends ServiceUserAbstract {
+
+ public ServiceUserImpl(PollenContextImplementor context) {
+ super(context);
+ }
+
+ @Override
+ protected UserAccount executeConnect(TopiaContext transaction, String login, String password) throws PollenBusinessException, TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected void executeCreateUpdateUser(TopiaContext transaction, UserAccount user) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected void executeDeleteUser(TopiaContext transaction, UserAccount user) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected List<UserAccount> executeGetUsers(TopiaContext transaction) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected PollAccount executeGetNewList(TopiaContext transaction) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected void executeCreateUpdateList(TopiaContext transaction, PollAccount list) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected void executeDeleteList(TopiaContext transaction, PollAccount list) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected List<PollAccount> executeGetFavoriteLists(TopiaContext transaction) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected PollAccount executeGetNewPerson(TopiaContext transaction, UserAccount user) throws TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ protected PollAccount executeGetPerson(TopiaContext transaction, String accountUId) throws PollenBusinessException, TopiaException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+}
Property changes on: trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServiceUserImpl.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/ChoiceImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/ChoiceImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/ChoiceImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.ChoiceImpl" node="org.chorem.pollen.business.persistence.ChoiceImpl" proxy="org.chorem.pollen.business.persistence.Choice" table="choice">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="name" name="name" node="name" type="text"/>
- <property access="field" column="description" name="description" node="description" type="text"/>
- <property access="field" column="validate" name="validate" node="validate" type="java.lang.Boolean"/>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="voteVoteToChoice" node="voteVoteToChoice">
- <key column="choice"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VoteToChoiceImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <many-to-one class="org.chorem.pollen.business.persistence.PollImpl" column="poll" embed-xml="false" name="poll" node="poll/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/ChoiceTypeImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/ChoiceTypeImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/ChoiceTypeImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.ChoiceTypeImpl" node="org.chorem.pollen.business.persistence.ChoiceTypeImpl" proxy="org.chorem.pollen.business.persistence.ChoiceType" table="choiceType">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="name" name="name" node="name" type="text"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/CommentImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/CommentImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/CommentImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.CommentImpl" node="org.chorem.pollen.business.persistence.CommentImpl" proxy="org.chorem.pollen.business.persistence.Comment" table="comment">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="text" name="text" node="text" type="text"/>
- <property access="field" column="postDate" name="postDate" node="postDate" type="java.util.Date"/>
- <many-to-one class="org.chorem.pollen.business.persistence.PollImpl" column="poll" embed-xml="false" name="poll" node="poll/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.PollAccountImpl" column="pollAccount" embed-xml="false" name="pollAccount" node="pollAccount/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PersonListImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PersonListImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PersonListImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.PersonListImpl" node="org.chorem.pollen.business.persistence.PersonListImpl" proxy="org.chorem.pollen.business.persistence.PersonList" table="personList">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="name" name="name" node="name" type="text"/>
- <many-to-one class="org.chorem.pollen.business.persistence.UserAccountImpl" column="owner" embed-xml="false" name="owner" node="owner/@topiaId"/>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="pollAccount" node="pollAccount">
- <key column="personList"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PollAccountImpl" embed-xml="false" node="topiaId"/>
- </bag>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PersonToListImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PersonToListImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PersonToListImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.PersonToListImpl" node="org.chorem.pollen.business.persistence.PersonToListImpl" proxy="org.chorem.pollen.business.persistence.PersonToList" table="personToList">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="weight" name="weight" node="weight" type="double"/>
- <property access="field" column="hasVoted" name="hasVoted" node="hasVoted" type="text"/>
- <many-to-one class="org.chorem.pollen.business.persistence.VotingListImpl" column="votingList" embed-xml="false" name="votingList" node="votingList/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.PollAccountImpl" column="pollAccount" embed-xml="false" name="pollAccount" node="pollAccount/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PollAccountImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PollAccountImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PollAccountImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.PollAccountImpl" node="org.chorem.pollen.business.persistence.PollAccountImpl" proxy="org.chorem.pollen.business.persistence.PollAccount" table="pollAccount">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="votingId" name="votingId" node="votingId" type="text"/>
- <property access="field" column="email" name="email" node="email" type="text"/>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="votingListPersonToList" node="votingListPersonToList">
- <key column="pollAccount"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PersonToListImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <bag embed-xml="false" inverse="true" lazy="true" name="pollsCreated" node="pollsCreated">
- <key column="creator"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PollImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <bag embed-xml="false" inverse="true" lazy="true" name="comment" node="comment">
- <key column="pollAccount"/>
- <one-to-many class="org.chorem.pollen.business.persistence.CommentImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <bag embed-xml="false" inverse="true" lazy="true" name="vote" node="vote">
- <key column="pollAccount"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VoteImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <many-to-one class="org.chorem.pollen.business.persistence.PersonListImpl" column="personList" embed-xml="false" name="personList" node="personList/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.UserAccountImpl" column="userAccount" embed-xml="false" name="userAccount" node="userAccount/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PollImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PollImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PollImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.PollImpl" node="org.chorem.pollen.business.persistence.PollImpl" proxy="org.chorem.pollen.business.persistence.Poll" table="poll">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="pollId" name="pollId" node="pollId" type="text"/>
- <property access="field" column="title" name="title" node="title" type="text"/>
- <property access="field" column="description" name="description" node="description" type="text"/>
- <property access="field" column="beginChoiceDate" name="beginChoiceDate" node="beginChoiceDate" type="java.util.Date"/>
- <property access="field" column="beginDate" name="beginDate" node="beginDate" type="java.util.Date"/>
- <property access="field" column="endDate" name="endDate" node="endDate" type="java.util.Date"/>
- <property access="field" column="maxChoiceNb" name="maxChoiceNb" node="maxChoiceNb" type="int"/>
- <property access="field" column="closed" name="closed" node="closed" type="java.lang.Boolean"/>
- <property access="field" column="choiceAddAllowed" name="choiceAddAllowed" node="choiceAddAllowed" type="java.lang.Boolean"/>
- <property access="field" column="anonymousVoteAllowed" name="anonymousVoteAllowed" node="anonymousVoteAllowed" type="java.lang.Boolean"/>
- <property access="field" column="anonymous" name="anonymous" node="anonymous" type="java.lang.Boolean"/>
- <property access="field" column="publicResults" name="publicResults" node="publicResults" type="java.lang.Boolean"/>
- <property access="field" column="continuousResults" name="continuousResults" node="continuousResults" type="java.lang.Boolean"/>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="vote" node="vote">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VoteImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="choice" node="choice">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.ChoiceImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="result" node="result">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.ResultImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <many-to-one class="org.chorem.pollen.business.persistence.PollAccountImpl" column="creator" embed-xml="false" name="creator" node="creator/@topiaId"/>
- <bag embed-xml="false" inverse="true" lazy="true" name="comment" node="comment">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.CommentImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <bag embed-xml="false" inverse="true" lazy="true" name="preventRule" node="preventRule">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PreventRuleImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="votingList" node="votingList">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VotingListImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <many-to-one class="org.chorem.pollen.business.persistence.PollTypeImpl" column="pollType" embed-xml="false" name="pollType" node="pollType/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.ChoiceTypeImpl" column="choiceType" embed-xml="false" name="choiceType" node="choiceType/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.VoteCountingImpl" column="voteCounting" embed-xml="false" name="voteCounting" node="voteCounting/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PollTypeImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PollTypeImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PollTypeImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.PollTypeImpl" node="org.chorem.pollen.business.persistence.PollTypeImpl" proxy="org.chorem.pollen.business.persistence.PollType" table="pollType">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="name" name="name" node="name" type="text"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PreventRuleImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PreventRuleImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/PreventRuleImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.PreventRuleImpl" node="org.chorem.pollen.business.persistence.PreventRuleImpl" proxy="org.chorem.pollen.business.persistence.PreventRule" table="preventRule">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="scope" name="scope" node="scope" type="text"/>
- <property access="field" column="sensibility" name="sensibility" node="sensibility" type="int"/>
- <property access="field" column="repeated" name="repeated" node="repeated" type="java.lang.Boolean"/>
- <property access="field" column="method" name="method" node="method" type="text"/>
- <many-to-one class="org.chorem.pollen.business.persistence.PollImpl" column="poll" embed-xml="false" name="poll" node="poll/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/ResultImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/ResultImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/ResultImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.ResultImpl" node="org.chorem.pollen.business.persistence.ResultImpl" proxy="org.chorem.pollen.business.persistence.Result" table="result">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="name" name="name" node="name" type="text"/>
- <property access="field" column="resultValue" name="ResultValue" node="ResultValue" type="text"/>
- <property access="field" column="byGroup" name="byGroup" node="byGroup" type="java.lang.Boolean"/>
- <many-to-one class="org.chorem.pollen.business.persistence.PollImpl" column="poll" embed-xml="false" name="poll" node="poll/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.VoteCountingImpl" column="voteCounting" embed-xml="false" name="voteCounting" node="voteCounting/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/UserAccountImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/UserAccountImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/UserAccountImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.UserAccountImpl" node="org.chorem.pollen.business.persistence.UserAccountImpl" proxy="org.chorem.pollen.business.persistence.UserAccount" table="userAccount">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="login" name="login" node="login" type="text"/>
- <property access="field" column="password" name="password" node="password" type="text"/>
- <property access="field" column="firstName" name="firstName" node="firstName" type="text"/>
- <property access="field" column="lastName" name="lastName" node="lastName" type="text"/>
- <property access="field" column="administrator" name="administrator" node="administrator" type="java.lang.Boolean"/>
- <property access="field" column="langage" name="langage" node="langage" type="text"/>
- <property access="field" column="email" name="email" node="email" type="text"/>
- <bag embed-xml="false" inverse="true" lazy="true" name="favoriteList" node="favoriteList">
- <key column="owner"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PersonListImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <bag embed-xml="false" inverse="true" lazy="true" name="pollAccount" node="pollAccount">
- <key column="userAccount"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PollAccountImpl" embed-xml="false" node="topiaId"/>
- </bag>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/VoteCountingImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/VoteCountingImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/VoteCountingImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.VoteCountingImpl" node="org.chorem.pollen.business.persistence.VoteCountingImpl" proxy="org.chorem.pollen.business.persistence.VoteCounting" table="voteCounting">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="name" name="name" node="name" type="text"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/VoteImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/VoteImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/VoteImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.VoteImpl" node="org.chorem.pollen.business.persistence.VoteImpl" proxy="org.chorem.pollen.business.persistence.Vote" table="vote">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="weight" name="weight" node="weight" type="double"/>
- <property access="field" column="comment" name="comment" node="comment" type="text"/>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="choiceVoteToChoice" node="choiceVoteToChoice">
- <key column="vote"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VoteToChoiceImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <many-to-one class="org.chorem.pollen.business.persistence.PollImpl" column="poll" embed-xml="false" name="poll" node="poll/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.PollAccountImpl" column="pollAccount" embed-xml="false" name="pollAccount" node="pollAccount/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.VotingListImpl" column="votingList" embed-xml="false" name="votingList" node="votingList/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/VoteToChoiceImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/VoteToChoiceImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/VoteToChoiceImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.VoteToChoiceImpl" node="org.chorem.pollen.business.persistence.VoteToChoiceImpl" proxy="org.chorem.pollen.business.persistence.VoteToChoice" table="voteToChoice">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="voteValue" name="voteValue" node="voteValue" type="int"/>
- <many-to-one class="org.chorem.pollen.business.persistence.VoteImpl" column="vote" embed-xml="false" name="vote" node="vote/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.ChoiceImpl" column="choice" embed-xml="false" name="choice" node="choice/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/VotingListImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/VotingListImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/0/org/chorem/pollen/business/persistence/VotingListImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.VotingListImpl" node="org.chorem.pollen.business.persistence.VotingListImpl" proxy="org.chorem.pollen.business.persistence.VotingList" table="votingList">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="name" name="name" node="name" type="text"/>
- <property access="field" column="weight" name="weight" node="weight" type="double"/>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="pollAccountPersonToList" node="pollAccountPersonToList">
- <key column="votingList"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PersonToListImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <many-to-one class="org.chorem.pollen.business.persistence.PollImpl" column="poll" embed-xml="false" name="poll" node="poll/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.VoteImpl" column="vote" embed-xml="false" name="vote" node="vote/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/ChoiceImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/ChoiceImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/ChoiceImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.ChoiceImpl" node="org.chorem.pollen.business.persistence.ChoiceImpl" proxy="org.chorem.pollen.business.persistence.Choice" table="choice">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="name" name="name" node="name" type="text"/>
- <property access="field" column="description" name="description" node="description" type="text"/>
- <property access="field" column="validate" name="validate" node="validate" type="java.lang.Boolean"/>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="voteVoteToChoice" node="voteVoteToChoice">
- <key column="choice"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VoteToChoiceImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <many-to-one class="org.chorem.pollen.business.persistence.PollImpl" column="poll" embed-xml="false" name="poll" node="poll/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/ChoiceTypeImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/ChoiceTypeImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/ChoiceTypeImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.ChoiceTypeImpl" node="org.chorem.pollen.business.persistence.ChoiceTypeImpl" proxy="org.chorem.pollen.business.persistence.ChoiceType" table="choiceType">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="name" name="name" node="name" type="text"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/CommentImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/CommentImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/CommentImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.CommentImpl" node="org.chorem.pollen.business.persistence.CommentImpl" proxy="org.chorem.pollen.business.persistence.Comment" table="comment">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="text" name="text" node="text" type="text"/>
- <property access="field" column="postDate" name="postDate" node="postDate" type="java.util.Date"/>
- <many-to-one class="org.chorem.pollen.business.persistence.PollImpl" column="poll" embed-xml="false" name="poll" node="poll/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.PollAccountImpl" column="pollAccount" embed-xml="false" name="pollAccount" node="pollAccount/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PersonListImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PersonListImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PersonListImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.PersonListImpl" node="org.chorem.pollen.business.persistence.PersonListImpl" proxy="org.chorem.pollen.business.persistence.PersonList" table="personList">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="name" name="name" node="name" type="text"/>
- <many-to-one class="org.chorem.pollen.business.persistence.UserAccountImpl" column="owner" embed-xml="false" name="owner" node="owner/@topiaId"/>
- <bag embed-xml="false" inverse="true" lazy="true" name="pollAccount" node="pollAccount">
- <key column="personList"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PollAccountImpl" embed-xml="false" node="topiaId"/>
- </bag>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PersonToListImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PersonToListImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PersonToListImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.PersonToListImpl" node="org.chorem.pollen.business.persistence.PersonToListImpl" proxy="org.chorem.pollen.business.persistence.PersonToList" table="personToList">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="weight" name="weight" node="weight" type="java.lang.Double"/>
- <property access="field" column="hasVoted" name="hasVoted" node="hasVoted" type="java.lang.Boolean"/>
- <many-to-one class="org.chorem.pollen.business.persistence.VotingListImpl" column="votingList" embed-xml="false" name="votingList" node="votingList/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.PollAccountImpl" column="pollAccount" embed-xml="false" name="pollAccount" node="pollAccount/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PollAccountImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PollAccountImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PollAccountImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.PollAccountImpl" node="org.chorem.pollen.business.persistence.PollAccountImpl" proxy="org.chorem.pollen.business.persistence.PollAccount" table="pollAccount">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="accountId" name="accountId" node="accountId" type="text"/>
- <property access="field" column="votingId" name="votingId" node="votingId" type="text"/>
- <property access="field" column="email" name="email" node="email" type="text"/>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="votingListPersonToList" node="votingListPersonToList">
- <key column="pollAccount"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PersonToListImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <bag embed-xml="false" inverse="true" lazy="true" name="pollsCreated" node="pollsCreated">
- <key column="creator"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PollImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <bag embed-xml="false" inverse="true" lazy="true" name="comment" node="comment">
- <key column="pollAccount"/>
- <one-to-many class="org.chorem.pollen.business.persistence.CommentImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <bag embed-xml="false" inverse="true" lazy="true" name="vote" node="vote">
- <key column="pollAccount"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VoteImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <many-to-one class="org.chorem.pollen.business.persistence.PersonListImpl" column="personList" embed-xml="false" name="personList" node="personList/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.UserAccountImpl" column="userAccount" embed-xml="false" name="userAccount" node="userAccount/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PollImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PollImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PollImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.PollImpl" node="org.chorem.pollen.business.persistence.PollImpl" proxy="org.chorem.pollen.business.persistence.Poll" table="poll">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="pollId" name="pollId" node="pollId" type="text"/>
- <property access="field" column="title" name="title" node="title" type="text"/>
- <property access="field" column="description" name="description" node="description" type="text"/>
- <property access="field" column="beginChoiceDate" name="beginChoiceDate" node="beginChoiceDate" type="java.util.Date"/>
- <property access="field" column="beginDate" name="beginDate" node="beginDate" type="java.util.Date"/>
- <property access="field" column="endDate" name="endDate" node="endDate" type="java.util.Date"/>
- <property access="field" column="maxChoiceNb" name="maxChoiceNb" node="maxChoiceNb" type="java.lang.Integer"/>
- <property access="field" column="closed" name="closed" node="closed" type="java.lang.Boolean"/>
- <property access="field" column="choiceAddAllowed" name="choiceAddAllowed" node="choiceAddAllowed" type="java.lang.Boolean"/>
- <property access="field" column="anonymousVoteAllowed" name="anonymousVoteAllowed" node="anonymousVoteAllowed" type="java.lang.Boolean"/>
- <property access="field" column="anonymous" name="anonymous" node="anonymous" type="java.lang.Boolean"/>
- <property access="field" column="publicResults" name="publicResults" node="publicResults" type="java.lang.Boolean"/>
- <property access="field" column="continuousResults" name="continuousResults" node="continuousResults" type="java.lang.Boolean"/>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="vote" node="vote">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VoteImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="choice" node="choice">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.ChoiceImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="result" node="result">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.ResultImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <many-to-one class="org.chorem.pollen.business.persistence.PollAccountImpl" column="creator" embed-xml="false" name="creator" node="creator/@topiaId"/>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="comment" node="comment">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.CommentImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="preventRule" node="preventRule">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PreventRuleImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="votingList" node="votingList">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VotingListImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <many-to-one class="org.chorem.pollen.business.persistence.PollTypeImpl" column="pollType" embed-xml="false" name="pollType" node="pollType/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.ChoiceTypeImpl" column="choiceType" embed-xml="false" name="choiceType" node="choiceType/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.VoteCountingImpl" column="voteCounting" embed-xml="false" name="voteCounting" node="voteCounting/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PollTypeImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PollTypeImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PollTypeImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.PollTypeImpl" node="org.chorem.pollen.business.persistence.PollTypeImpl" proxy="org.chorem.pollen.business.persistence.PollType" table="pollType">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="name" name="name" node="name" type="text"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PreventRuleImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PreventRuleImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/PreventRuleImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.PreventRuleImpl" node="org.chorem.pollen.business.persistence.PreventRuleImpl" proxy="org.chorem.pollen.business.persistence.PreventRule" table="preventRule">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="scope" name="scope" node="scope" type="text"/>
- <property access="field" column="sensibility" name="sensibility" node="sensibility" type="java.lang.Integer"/>
- <property access="field" column="repeated" name="repeated" node="repeated" type="java.lang.Boolean"/>
- <property access="field" column="active" name="active" node="active" type="java.lang.Boolean"/>
- <property access="field" column="oneTime" name="oneTime" node="oneTime" type="java.lang.Boolean"/>
- <property access="field" column="method" name="method" node="method" type="text"/>
- <many-to-one class="org.chorem.pollen.business.persistence.PollImpl" column="poll" embed-xml="false" name="poll" node="poll/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/ResultImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/ResultImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/ResultImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.ResultImpl" node="org.chorem.pollen.business.persistence.ResultImpl" proxy="org.chorem.pollen.business.persistence.Result" table="result">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="name" name="name" node="name" type="text"/>
- <property access="field" column="resultValue" name="ResultValue" node="ResultValue" type="text"/>
- <property access="field" column="byGroup" name="byGroup" node="byGroup" type="java.lang.Boolean"/>
- <many-to-one class="org.chorem.pollen.business.persistence.PollImpl" column="poll" embed-xml="false" name="poll" node="poll/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.VoteCountingImpl" column="voteCounting" embed-xml="false" name="voteCounting" node="voteCounting/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/UserAccountImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/UserAccountImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/UserAccountImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.UserAccountImpl" node="org.chorem.pollen.business.persistence.UserAccountImpl" proxy="org.chorem.pollen.business.persistence.UserAccount" table="userAccount">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="login" name="login" node="login" type="text"/>
- <property access="field" column="password" name="password" node="password" type="text"/>
- <property access="field" column="firstName" name="firstName" node="firstName" type="text"/>
- <property access="field" column="lastName" name="lastName" node="lastName" type="text"/>
- <property access="field" column="administrator" name="administrator" node="administrator" type="java.lang.Boolean"/>
- <property access="field" column="language" name="language" node="language" type="text"/>
- <property access="field" column="email" name="email" node="email" type="text"/>
- <bag embed-xml="false" inverse="true" lazy="true" name="favoriteList" node="favoriteList">
- <key column="owner"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PersonListImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <bag embed-xml="false" inverse="true" lazy="true" name="pollAccount" node="pollAccount">
- <key column="userAccount"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PollAccountImpl" embed-xml="false" node="topiaId"/>
- </bag>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/VoteCountingImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/VoteCountingImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/VoteCountingImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.VoteCountingImpl" node="org.chorem.pollen.business.persistence.VoteCountingImpl" proxy="org.chorem.pollen.business.persistence.VoteCounting" table="voteCounting">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="name" name="name" node="name" type="text"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/VoteImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/VoteImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/VoteImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.VoteImpl" node="org.chorem.pollen.business.persistence.VoteImpl" proxy="org.chorem.pollen.business.persistence.Vote" table="vote">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="weight" name="weight" node="weight" type="java.lang.Double"/>
- <property access="field" column="comment" name="comment" node="comment" type="text"/>
- <property access="field" column="anonymous" name="anonymous" node="anonymous" type="java.lang.Boolean"/>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="choiceVoteToChoice" node="choiceVoteToChoice">
- <key column="vote"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VoteToChoiceImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <many-to-one class="org.chorem.pollen.business.persistence.PollImpl" column="poll" embed-xml="false" name="poll" node="poll/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.PollAccountImpl" column="pollAccount" embed-xml="false" name="pollAccount" node="pollAccount/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.VotingListImpl" column="votingList" embed-xml="false" name="votingList" node="votingList/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/VoteToChoiceImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/VoteToChoiceImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/VoteToChoiceImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.VoteToChoiceImpl" node="org.chorem.pollen.business.persistence.VoteToChoiceImpl" proxy="org.chorem.pollen.business.persistence.VoteToChoice" table="voteToChoice">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="voteValue" name="voteValue" node="voteValue" type="java.lang.Integer"/>
- <many-to-one class="org.chorem.pollen.business.persistence.VoteImpl" column="vote" embed-xml="false" name="vote" node="vote/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.ChoiceImpl" column="choice" embed-xml="false" name="choice" node="choice/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/VotingListImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/VotingListImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.1/org/chorem/pollen/business/persistence/VotingListImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping auto-import="true" default-access="field" package="org.chorem.pollen.business.persistence">
- <class abstract="false" name="org.chorem.pollen.business.persistence.VotingListImpl" node="org.chorem.pollen.business.persistence.VotingListImpl" proxy="org.chorem.pollen.business.persistence.VotingList" table="votingList">
- <id length="255" name="topiaId" node="@topiaId" type="string"/>
- <version name="topiaVersion" node="@topiaVersion" type="long"/>
- <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/>
- <property access="field" column="name" name="name" node="name" type="text"/>
- <property access="field" column="weight" name="weight" node="weight" type="java.lang.Double"/>
- <bag cascade="all,delete-orphan" embed-xml="false" inverse="true" lazy="true" name="pollAccountPersonToList" node="pollAccountPersonToList">
- <key column="votingList"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PersonToListImpl" embed-xml="false" node="topiaId"/>
- </bag>
- <many-to-one class="org.chorem.pollen.business.persistence.PollImpl" column="poll" embed-xml="false" name="poll" node="poll/@topiaId"/>
- <many-to-one class="org.chorem.pollen.business.persistence.VoteImpl" column="vote" embed-xml="false" name="vote" node="vote/@topiaId"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/ChoiceImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/ChoiceImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/ChoiceImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.ChoiceImpl" table="choice" node="org.chorem.pollen.business.persistence.ChoiceImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.Choice" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="name" type="text" access="field" column="name" node="name"/>
- <property name="description" type="text" access="field" column="description" node="description"/>
- <property name="validate" type="java.lang.Boolean" access="field" column="validate" node="validate"/>
- <bag name="voteVoteToChoice" inverse="true" lazy="true" cascade="all,delete-orphan" node="voteVoteToChoice" embed-xml="false">
- <key column="choice"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VoteToChoiceImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <many-to-one name="poll" class="org.chorem.pollen.business.persistence.PollImpl" column="poll" node="poll/@topiaId" embed-xml="false"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/ChoiceTypeImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/ChoiceTypeImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/ChoiceTypeImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.ChoiceTypeImpl" table="choiceType" node="org.chorem.pollen.business.persistence.ChoiceTypeImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.ChoiceType" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="name" type="text" access="field" column="name" node="name"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/CommentImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/CommentImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/CommentImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.CommentImpl" table="comment" node="org.chorem.pollen.business.persistence.CommentImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.Comment" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="text" type="text" access="field" column="text" node="text"/>
- <property name="postDate" type="java.util.Date" access="field" column="postDate" node="postDate"/>
- <many-to-one name="poll" class="org.chorem.pollen.business.persistence.PollImpl" column="poll" node="poll/@topiaId" embed-xml="false"/>
- <many-to-one name="pollAccount" class="org.chorem.pollen.business.persistence.PollAccountImpl" column="pollAccount" node="pollAccount/@topiaId" embed-xml="false"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PersonListImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PersonListImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PersonListImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.PersonListImpl" table="personList" node="org.chorem.pollen.business.persistence.PersonListImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.PersonList" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="name" type="text" access="field" column="name" node="name"/>
- <many-to-one name="owner" class="org.chorem.pollen.business.persistence.UserAccountImpl" column="owner" node="owner/@topiaId" embed-xml="false"/>
- <bag name="pollAccount" inverse="true" lazy="true" node="pollAccount" embed-xml="false">
- <key column="personList"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PollAccountImpl" node="topiaId" embed-xml="false"/>
- </bag>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PersonToListImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PersonToListImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PersonToListImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.PersonToListImpl" table="personToList" node="org.chorem.pollen.business.persistence.PersonToListImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.PersonToList" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="weight" type="java.lang.Double" access="field" column="weight" node="weight"/>
- <property name="hasVoted" type="java.lang.Boolean" access="field" column="hasVoted" node="hasVoted"/>
- <many-to-one name="votingList" class="org.chorem.pollen.business.persistence.VotingListImpl" column="votingList" node="votingList/@topiaId" embed-xml="false" />
- <many-to-one name="pollAccount" class="org.chorem.pollen.business.persistence.PollAccountImpl" column="pollAccount" node="pollAccount/@topiaId" embed-xml="false" />
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PollAccountImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PollAccountImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PollAccountImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.PollAccountImpl" table="pollAccount" node="org.chorem.pollen.business.persistence.PollAccountImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.PollAccount" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="accountId" type="text" access="field" column="accountId" node="accountId"/>
- <property name="votingId" type="text" access="field" column="votingId" node="votingId"/>
- <property name="email" type="text" access="field" column="email" node="email"/>
- <bag name="votingListPersonToList" inverse="true" lazy="true" cascade="all,delete-orphan" node="votingListPersonToList" embed-xml="false">
- <key column="pollAccount"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PersonToListImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <bag name="pollsCreated" inverse="true" lazy="true" node="pollsCreated" embed-xml="false">
- <key column="creator"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PollImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <bag name="comment" inverse="true" lazy="true" node="comment" embed-xml="false">
- <key column="pollAccount"/>
- <one-to-many class="org.chorem.pollen.business.persistence.CommentImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <bag name="vote" inverse="true" lazy="true" node="vote" embed-xml="false">
- <key column="pollAccount"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VoteImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <many-to-one name="personList" class="org.chorem.pollen.business.persistence.PersonListImpl" column="personList" node="personList/@topiaId" embed-xml="false"/>
- <many-to-one name="userAccount" class="org.chorem.pollen.business.persistence.UserAccountImpl" column="userAccount" node="userAccount/@topiaId" embed-xml="false"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PollImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PollImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PollImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.PollImpl" table="poll" node="org.chorem.pollen.business.persistence.PollImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.Poll" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="pollId" type="text" access="field" column="pollId" node="pollId"/>
- <property name="title" type="text" access="field" column="title" node="title"/>
- <property name="description" type="text" access="field" column="description" node="description"/>
- <property name="beginChoiceDate" type="java.util.Date" access="field" column="beginChoiceDate" node="beginChoiceDate"/>
- <property name="beginDate" type="java.util.Date" access="field" column="beginDate" node="beginDate"/>
- <property name="endDate" type="java.util.Date" access="field" column="endDate" node="endDate"/>
- <property name="maxChoiceNb" type="java.lang.Integer" access="field" column="maxChoiceNb" node="maxChoiceNb"/>
- <property name="closed" type="java.lang.Boolean" access="field" column="closed" node="closed"/>
- <property name="choiceAddAllowed" type="java.lang.Boolean" access="field" column="choiceAddAllowed" node="choiceAddAllowed"/>
- <property name="anonymousVoteAllowed" type="java.lang.Boolean" access="field" column="anonymousVoteAllowed" node="anonymousVoteAllowed"/>
- <property name="anonymous" type="java.lang.Boolean" access="field" column="anonymous" node="anonymous"/>
- <property name="publicResults" type="java.lang.Boolean" access="field" column="publicResults" node="publicResults"/>
- <property name="continuousResults" type="java.lang.Boolean" access="field" column="continuousResults" node="continuousResults"/>
- <property name="endChoiceDate" type="java.util.Date" access="field" column="endChoiceDate" node="endChoiceDate"/>
- <bag name="vote" inverse="true" lazy="true" cascade="all,delete-orphan" node="vote" embed-xml="false">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VoteImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <bag name="choice" inverse="true" lazy="true" cascade="all,delete-orphan" node="choice" embed-xml="false">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.ChoiceImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <bag name="result" inverse="true" lazy="true" cascade="all,delete-orphan" node="result" embed-xml="false">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.ResultImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <many-to-one name="creator" class="org.chorem.pollen.business.persistence.PollAccountImpl" column="creator" node="creator/@topiaId" embed-xml="false"/>
- <bag name="comment" inverse="true" lazy="true" cascade="all,delete-orphan" node="comment" embed-xml="false">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.CommentImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <bag name="preventRule" inverse="true" lazy="true" cascade="all,delete-orphan" node="preventRule" embed-xml="false">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PreventRuleImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <bag name="votingList" inverse="true" lazy="true" cascade="all,delete-orphan" node="votingList" embed-xml="false">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VotingListImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <many-to-one name="pollType" class="org.chorem.pollen.business.persistence.PollTypeImpl" column="pollType" node="pollType/@topiaId" embed-xml="false"/>
- <many-to-one name="choiceType" class="org.chorem.pollen.business.persistence.ChoiceTypeImpl" column="choiceType" node="choiceType/@topiaId" embed-xml="false"/>
- <many-to-one name="voteCounting" class="org.chorem.pollen.business.persistence.VoteCountingImpl" column="voteCounting" node="voteCounting/@topiaId" embed-xml="false"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PollTypeImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PollTypeImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PollTypeImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.PollTypeImpl" table="pollType" node="org.chorem.pollen.business.persistence.PollTypeImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.PollType" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="name" type="text" access="field" column="name" node="name"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PreventRuleImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PreventRuleImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/PreventRuleImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.PreventRuleImpl" table="preventRule" node="org.chorem.pollen.business.persistence.PreventRuleImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.PreventRule" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="scope" type="text" access="field" column="scope" node="scope"/>
- <property name="sensibility" type="java.lang.Integer" access="field" column="sensibility" node="sensibility"/>
- <property name="repeated" type="java.lang.Boolean" access="field" column="repeated" node="repeated"/>
- <property name="active" type="java.lang.Boolean" access="field" column="active" node="active"/>
- <property name="oneTime" type="java.lang.Boolean" access="field" column="oneTime" node="oneTime"/>
- <property name="method" type="text" access="field" column="method" node="method"/>
- <many-to-one name="poll" class="org.chorem.pollen.business.persistence.PollImpl" column="poll" node="poll/@topiaId" embed-xml="false"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/ResultImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/ResultImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/ResultImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.ResultImpl" table="result" node="org.chorem.pollen.business.persistence.ResultImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.Result" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="name" type="text" access="field" column="name" node="name"/>
- <property name="ResultValue" type="text" access="field" column="resultValue" node="ResultValue"/>
- <property name="byGroup" type="java.lang.Boolean" access="field" column="byGroup" node="byGroup"/>
- <many-to-one name="poll" class="org.chorem.pollen.business.persistence.PollImpl" column="poll" node="poll/@topiaId" embed-xml="false"/>
- <many-to-one name="voteCounting" class="org.chorem.pollen.business.persistence.VoteCountingImpl" column="voteCounting" node="voteCounting/@topiaId" embed-xml="false"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/UserAccountImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/UserAccountImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/UserAccountImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.UserAccountImpl" table="userAccount" node="org.chorem.pollen.business.persistence.UserAccountImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.UserAccount" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="login" type="text" access="field" column="login" node="login"/>
- <property name="password" type="text" access="field" column="password" node="password"/>
- <property name="firstName" type="text" access="field" column="firstName" node="firstName"/>
- <property name="lastName" type="text" access="field" column="lastName" node="lastName"/>
- <property name="administrator" type="java.lang.Boolean" access="field" column="administrator" node="administrator"/>
- <property name="language" type="text" access="field" column="language" node="language"/>
- <property name="email" type="text" access="field" column="email" node="email"/>
- <bag name="favoriteList" inverse="true" lazy="true" node="favoriteList" embed-xml="false">
- <key column="owner"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PersonListImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <bag name="pollAccount" inverse="true" lazy="true" node="pollAccount" embed-xml="false">
- <key column="userAccount"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PollAccountImpl" node="topiaId" embed-xml="false"/>
- </bag>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/VoteCountingImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/VoteCountingImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/VoteCountingImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.VoteCountingImpl" table="voteCounting" node="org.chorem.pollen.business.persistence.VoteCountingImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.VoteCounting" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="name" type="text" access="field" column="name" node="name"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/VoteImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/VoteImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/VoteImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.VoteImpl" table="vote" node="org.chorem.pollen.business.persistence.VoteImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.Vote" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="weight" type="java.lang.Double" access="field" column="weight" node="weight"/>
- <property name="comment" type="text" access="field" column="comment" node="comment"/>
- <property name="anonymous" type="java.lang.Boolean" access="field" column="anonymous" node="anonymous"/>
- <bag name="choiceVoteToChoice" inverse="true" lazy="true" cascade="all,delete-orphan" node="choiceVoteToChoice" embed-xml="false">
- <key column="vote"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VoteToChoiceImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <many-to-one name="poll" class="org.chorem.pollen.business.persistence.PollImpl" column="poll" node="poll/@topiaId" embed-xml="false"/>
- <many-to-one name="pollAccount" class="org.chorem.pollen.business.persistence.PollAccountImpl" column="pollAccount" node="pollAccount/@topiaId" embed-xml="false"/>
- <many-to-one name="votingList" class="org.chorem.pollen.business.persistence.VotingListImpl" column="votingList" node="votingList/@topiaId" embed-xml="false"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/VoteToChoiceImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/VoteToChoiceImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/VoteToChoiceImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.VoteToChoiceImpl" table="voteToChoice" node="org.chorem.pollen.business.persistence.VoteToChoiceImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.VoteToChoice" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="voteValue" type="java.lang.Integer" access="field" column="voteValue" node="voteValue"/>
- <many-to-one name="vote" class="org.chorem.pollen.business.persistence.VoteImpl" column="vote" node="vote/@topiaId" embed-xml="false" />
- <many-to-one name="choice" class="org.chorem.pollen.business.persistence.ChoiceImpl" column="choice" node="choice/@topiaId" embed-xml="false" />
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/VotingListImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/VotingListImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.2/org/chorem/pollen/business/persistence/VotingListImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.VotingListImpl" table="votingList" node="org.chorem.pollen.business.persistence.VotingListImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.VotingList" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="name" type="text" access="field" column="name" node="name"/>
- <property name="weight" type="java.lang.Double" access="field" column="weight" node="weight"/>
- <bag name="pollAccountPersonToList" inverse="true" lazy="true" cascade="all,delete-orphan" node="pollAccountPersonToList" embed-xml="false">
- <key column="votingList"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PersonToListImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <many-to-one name="poll" class="org.chorem.pollen.business.persistence.PollImpl" column="poll" node="poll/@topiaId" embed-xml="false"/>
- <many-to-one name="vote" class="org.chorem.pollen.business.persistence.VoteImpl" column="vote" node="vote/@topiaId" embed-xml="false"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/ChoiceImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/ChoiceImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/ChoiceImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.ChoiceImpl" table="choice" node="org.chorem.pollen.business.persistence.ChoiceImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.Choice" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="name" type="text" access="field" column="name" node="name"/>
- <property name="description" type="text" access="field" column="description" node="description"/>
- <property name="validate" type="java.lang.Boolean" access="field" column="validate" node="validate"/>
- <bag name="voteVoteToChoice" inverse="true" lazy="true" cascade="all,delete-orphan" node="voteVoteToChoice" embed-xml="false">
- <key column="choice"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VoteToChoiceImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <many-to-one name="poll" class="org.chorem.pollen.business.persistence.PollImpl" column="poll" node="poll/@topiaId" embed-xml="false"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/CommentImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/CommentImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/CommentImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.CommentImpl" table="comment" node="org.chorem.pollen.business.persistence.CommentImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.Comment" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="text" type="text" access="field" column="text" node="text"/>
- <property name="postDate" type="java.util.Date" access="field" column="postDate" node="postDate"/>
- <property name="author" type="text" access="field" column="author" node="author"/>
- <many-to-one name="poll" class="org.chorem.pollen.business.persistence.PollImpl" column="poll" node="poll/@topiaId" embed-xml="false"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PersonListImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PersonListImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PersonListImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.PersonListImpl" table="personList" node="org.chorem.pollen.business.persistence.PersonListImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.PersonList" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="name" type="text" access="field" column="name" node="name"/>
- <many-to-one name="owner" class="org.chorem.pollen.business.persistence.UserAccountImpl" column="owner" node="owner/@topiaId" embed-xml="false"/>
- <bag name="pollAccount" inverse="true" lazy="true" node="pollAccount" embed-xml="false">
- <key column="personList"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PollAccountImpl" node="topiaId" embed-xml="false"/>
- </bag>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PersonToListImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PersonToListImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PersonToListImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.PersonToListImpl" table="personToList" node="org.chorem.pollen.business.persistence.PersonToListImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.PersonToList" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="weight" type="java.lang.Double" access="field" column="weight" node="weight"/>
- <property name="hasVoted" type="java.lang.Boolean" access="field" column="hasVoted" node="hasVoted"/>
- <many-to-one name="votingList" class="org.chorem.pollen.business.persistence.VotingListImpl" column="votingList" node="votingList/@topiaId" embed-xml="false" />
- <many-to-one name="pollAccount" class="org.chorem.pollen.business.persistence.PollAccountImpl" column="pollAccount" node="pollAccount/@topiaId" embed-xml="false" />
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PollAccountImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PollAccountImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PollAccountImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.PollAccountImpl" table="pollAccount" node="org.chorem.pollen.business.persistence.PollAccountImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.PollAccount" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <natural-id>
- <property name="accountId" type="text" access="field" column="accountId" node="accountId"/>
- </natural-id>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="votingId" type="text" access="field" column="votingId" node="votingId"/>
- <property name="email" type="text" access="field" column="email" node="email"/>
- <bag name="votingListPersonToList" inverse="true" lazy="true" cascade="all,delete-orphan" node="votingListPersonToList" embed-xml="false">
- <key column="pollAccount"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PersonToListImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <bag name="pollsCreated" inverse="true" lazy="true" node="pollsCreated" embed-xml="false">
- <key column="creator"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PollImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <bag name="vote" inverse="true" lazy="true" node="vote" embed-xml="false">
- <key column="pollAccount"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VoteImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <many-to-one name="personList" class="org.chorem.pollen.business.persistence.PersonListImpl" column="personList" node="personList/@topiaId" embed-xml="false"/>
- <many-to-one name="userAccount" class="org.chorem.pollen.business.persistence.UserAccountImpl" column="userAccount" node="userAccount/@topiaId" embed-xml="false"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PollImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PollImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PollImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.PollImpl" table="poll" node="org.chorem.pollen.business.persistence.PollImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.Poll" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <natural-id>
- <property name="pollId" type="text" access="field" column="pollId" node="pollId"/>
- </natural-id>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="title" type="text" access="field" column="title" node="title"/>
- <property name="description" type="text" access="field" column="description" node="description"/>
- <property name="beginChoiceDate" type="java.util.Date" access="field" column="beginChoiceDate" node="beginChoiceDate"/>
- <property name="beginDate" type="java.util.Date" access="field" column="beginDate" node="beginDate"/>
- <property name="endDate" type="java.util.Date" access="field" column="endDate" node="endDate"/>
- <property name="maxChoiceNb" type="java.lang.Integer" access="field" column="maxChoiceNb" node="maxChoiceNb"/>
- <property name="closed" type="java.lang.Boolean" access="field" column="closed" node="closed"/>
- <property name="choiceAddAllowed" type="java.lang.Boolean" access="field" column="choiceAddAllowed" node="choiceAddAllowed"/>
- <property name="anonymousVoteAllowed" type="java.lang.Boolean" access="field" column="anonymousVoteAllowed" node="anonymousVoteAllowed"/>
- <property name="anonymous" type="java.lang.Boolean" access="field" column="anonymous" node="anonymous"/>
- <property name="publicResults" type="java.lang.Boolean" access="field" column="publicResults" node="publicResults"/>
- <property name="continuousResults" type="java.lang.Boolean" access="field" column="continuousResults" node="continuousResults"/>
- <property name="endChoiceDate" type="java.util.Date" access="field" column="endChoiceDate" node="endChoiceDate"/>
- <property name="voteCounting" type="text" access="field" column="voteCounting" node="voteCounting"/>
- <property name="pollType" type="text" access="field" column="pollType" node="pollType"/>
- <property name="choiceType" type="text" access="field" column="choiceType" node="choiceType"/>
- <bag name="vote" inverse="true" lazy="true" cascade="all,delete-orphan" node="vote" embed-xml="false">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VoteImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <bag name="choice" inverse="true" lazy="true" cascade="all,delete-orphan" node="choice" embed-xml="false">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.ChoiceImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <bag name="result" inverse="true" lazy="true" cascade="all,delete-orphan" node="result" embed-xml="false">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.ResultImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <many-to-one name="creator" class="org.chorem.pollen.business.persistence.PollAccountImpl" column="creator" node="creator/@topiaId" embed-xml="false"/>
- <bag name="comment" inverse="true" lazy="true" cascade="all,delete-orphan" node="comment" embed-xml="false">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.CommentImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <bag name="preventRule" inverse="true" lazy="true" cascade="all,delete-orphan" node="preventRule" embed-xml="false">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PreventRuleImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <bag name="votingList" inverse="true" lazy="true" cascade="all,delete-orphan" node="votingList" embed-xml="false">
- <key column="poll"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VotingListImpl" node="topiaId" embed-xml="false"/>
- </bag>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PreventRuleImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PreventRuleImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/PreventRuleImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.PreventRuleImpl" table="preventRule" node="org.chorem.pollen.business.persistence.PreventRuleImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.PreventRule" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="scope" type="text" access="field" column="scope" node="scope"/>
- <property name="sensibility" type="java.lang.Integer" access="field" column="sensibility" node="sensibility"/>
- <property name="repeated" type="java.lang.Boolean" access="field" column="repeated" node="repeated"/>
- <property name="active" type="java.lang.Boolean" access="field" column="active" node="active"/>
- <property name="oneTime" type="java.lang.Boolean" access="field" column="oneTime" node="oneTime"/>
- <property name="method" type="text" access="field" column="method" node="method"/>
- <many-to-one name="poll" class="org.chorem.pollen.business.persistence.PollImpl" column="poll" node="poll/@topiaId" embed-xml="false"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/ResultImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/ResultImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/ResultImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.ResultImpl" table="result" node="org.chorem.pollen.business.persistence.ResultImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.Result" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="name" type="text" access="field" column="name" node="name"/>
- <property name="ResultValue" type="text" access="field" column="resultValue" node="ResultValue"/>
- <property name="byGroup" type="java.lang.Boolean" access="field" column="byGroup" node="byGroup"/>
- <property name="voteCounting" type="text" access="field" column="voteCounting" node="voteCounting"/>
- <many-to-one name="poll" class="org.chorem.pollen.business.persistence.PollImpl" column="poll" node="poll/@topiaId" embed-xml="false"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/UserAccountImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/UserAccountImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/UserAccountImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.UserAccountImpl" table="userAccount" node="org.chorem.pollen.business.persistence.UserAccountImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.UserAccount" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="login" type="text" access="field" column="login" node="login"/>
- <property name="password" type="text" access="field" column="password" node="password"/>
- <property name="firstName" type="text" access="field" column="firstName" node="firstName"/>
- <property name="lastName" type="text" access="field" column="lastName" node="lastName"/>
- <property name="administrator" type="java.lang.Boolean" access="field" column="administrator" node="administrator"/>
- <property name="language" type="text" access="field" column="language" node="language"/>
- <property name="email" type="text" access="field" column="email" node="email"/>
- <bag name="favoriteList" inverse="true" lazy="true" node="favoriteList" embed-xml="false">
- <key column="owner"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PersonListImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <bag name="pollAccount" inverse="true" lazy="true" node="pollAccount" embed-xml="false">
- <key column="userAccount"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PollAccountImpl" node="topiaId" embed-xml="false"/>
- </bag>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/VoteImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/VoteImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/VoteImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.VoteImpl" table="vote" node="org.chorem.pollen.business.persistence.VoteImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.Vote" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="weight" type="java.lang.Double" access="field" column="weight" node="weight"/>
- <property name="comment" type="text" access="field" column="comment" node="comment"/>
- <property name="anonymous" type="java.lang.Boolean" access="field" column="anonymous" node="anonymous"/>
- <bag name="choiceVoteToChoice" inverse="true" lazy="true" cascade="all,delete-orphan" node="choiceVoteToChoice" embed-xml="false">
- <key column="vote"/>
- <one-to-many class="org.chorem.pollen.business.persistence.VoteToChoiceImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <many-to-one name="poll" class="org.chorem.pollen.business.persistence.PollImpl" column="poll" node="poll/@topiaId" embed-xml="false"/>
- <many-to-one name="pollAccount" class="org.chorem.pollen.business.persistence.PollAccountImpl" column="pollAccount" node="pollAccount/@topiaId" embed-xml="false"/>
- <many-to-one name="votingList" class="org.chorem.pollen.business.persistence.VotingListImpl" column="votingList" node="votingList/@topiaId" embed-xml="false"/>
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/VoteToChoiceImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/VoteToChoiceImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/VoteToChoiceImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.VoteToChoiceImpl" table="voteToChoice" node="org.chorem.pollen.business.persistence.VoteToChoiceImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.VoteToChoice" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="voteValue" type="java.lang.Integer" access="field" column="voteValue" node="voteValue"/>
- <many-to-one name="vote" class="org.chorem.pollen.business.persistence.VoteImpl" column="vote" node="vote/@topiaId" embed-xml="false" />
- <many-to-one name="choice" class="org.chorem.pollen.business.persistence.ChoiceImpl" column="choice" node="choice/@topiaId" embed-xml="false" />
- </class>
-</hibernate-mapping>
Deleted: trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/VotingListImpl.hbm.xml
===================================================================
--- trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/VotingListImpl.hbm.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/resources/oldmappings/pollen/1.3/org/chorem/pollen/business/persistence/VotingListImpl.hbm.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="org.chorem.pollen.business.persistence">
- <class name="org.chorem.pollen.business.persistence.VotingListImpl" table="votingList" node="org.chorem.pollen.business.persistence.VotingListImpl" abstract="false" proxy="org.chorem.pollen.business.persistence.VotingList" >
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
- <property name="name" type="text" access="field" column="name" node="name"/>
- <property name="weight" type="java.lang.Double" access="field" column="weight" node="weight"/>
- <bag name="pollAccountPersonToList" inverse="true" lazy="true" cascade="all,delete-orphan" node="pollAccountPersonToList" embed-xml="false">
- <key column="votingList"/>
- <one-to-many class="org.chorem.pollen.business.persistence.PersonToListImpl" node="topiaId" embed-xml="false"/>
- </bag>
- <many-to-one name="poll" class="org.chorem.pollen.business.persistence.PollImpl" column="poll" node="poll/@topiaId" embed-xml="false"/>
- <many-to-one name="vote" class="org.chorem.pollen.business.persistence.VoteImpl" column="vote" node="vote/@topiaId" embed-xml="false"/>
- </class>
-</hibernate-mapping>
Modified: trunk/pollen-business/src/main/xmi/pollen.properties
===================================================================
--- trunk/pollen-business/src/main/xmi/pollen.properties 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/xmi/pollen.properties 2010-03-23 15:39:36 UTC (rev 2956)
@@ -2,5 +2,5 @@
model.tagvalue.copyright=/* *##%\n Copyright (C) 2009 Pollen\n *##%*/
#model.tagvalue.dbSchema=Pollen
model.tagvalue.java.lang.String=text
-org.chorem.pollen.business.persistence.PollAccount.attribute.accountId.tagvalue.naturalId=true
-org.chorem.pollen.business.persistence.Poll.attribute.pollId.tagvalue.naturalId=true
\ No newline at end of file
+#org.chorem.pollen.business.persistence.PollAccount.attribute.accountId.tagvalue.naturalId=true
+#org.chorem.pollen.business.persistence.Poll.attribute.pollId.tagvalue.naturalId=true
\ No newline at end of file
Modified: trunk/pollen-business/src/main/xmi/pollen.zargo
===================================================================
--- trunk/pollen-business/src/main/xmi/pollen.zargo 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/main/xmi/pollen.zargo 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,94 +1,154 @@
-PKΕv<pollen.argo}Tˎ�0��W >�LFU�a�tѪUG�v9pW�1�4�����v2$�����uMe/��B1n��e�Tu'Z�a�T[�!�FB��CSW����)�����C�晼|!���ڞ�@���(<Q�0�M�V�5��
-�F�9F����??��@
-�|�sը�D����A/4
-z��z�`�H�-.�-M�{G�S3*<"C}II�(�i��7��rQ#e3eRy�G�$�Rcޑ�R}���y�A��h�+����aT&U`����z�N��j��8���C�qw���;8b�Z7j�J!D{���y�^v`o;(��Z��+����s����vaF87�1ۜ[f3��C�Kʛ���*����eIJ(�Z���&��b�pږ�o����>쿽�E�h8����[�K`[ڹ��Av��PK-��\��筟�� �}���s�A��^z�2�u�RȞ��pF�X������|��b��wc�N���]�>�5������u/tB�L��O�������̎ۖ�<�PKptB�PKΕv<pollen_DC_Pollen.pgml�]k��6���_�-,�SWE|��:�5�W$�F�i`0T����U�;������D^R�Mˌ,�Lْ�xxyux������t�%�/&�����.�l��&�����?}�/���������?>>^������ۧ���W���_�0J���u�[:_��q��e��&�x�\-��r2��b9_
-��yr��\���Ow�x��__���^^��%�//��/< ��"�<� ���·���yo����c�
-��,~I�_����c:�&�������t�����d�m���O�ߒ���D�go�7��_���k�|�<YL����x�H~X,�y�.��&�'�����k2��_��^ȿ=�!^.���2����{������}q����oz�L�|�+?�i:��y�Lv�a��Iʗ���\�8����>��?~�:�|�����+?�ߛ'�e<O�҄\�����8�������n�:-��^�}�9�����=�oF��v\^�
-qX������FtU bhHk��mg��e_)�P��7ۛry�5�M����%��`c*#@�H� �d%s���A��Y5�]��,�?��q q�0��4�d�A��ß<�3�Wp�<M�Ż�e<��_侭x�1���7��^L�7���j��<M��z��%3�(�_�e��!���;Y~�˘���y�}�][ǒ���"��_8�P�L��l�5�� ������g��p��f�
-���#�y���nw��k<_��߾qs>
-7n�N�9Oz�Xn�Թ9�����-����e��:��ok`#n۔�㿳�b��M:?hLF��zwͻ��K�L�i�����3�̶�F������\����~K�fG�%G�,9�\��e�y�-9��K��ɒ˦�钫�S^rE�W�� ���!S4ϺA8@�~J�������������7�xf�2��&5p�wԣ���%]r���Mk��d��6F�v�O� ��7����-��n灪o(T��D�QL�
-M��7�8�@~�="�&V�
-�41$hb���c+Z�O$k����UhbȢ&&��UM�L:�������'��dnhb�����J�&�\C�&Vu&�L��I�5����@C�5������䔛kk��MLps#37G$���uO+O�0�
-zH
-�1�ĐmM,g��e�\ל,�����T ��w�m.�Ωb�E��G�EW�G��!@�,B��A��4�WMff
-1��k�,D�}�_���k:7T����h����^��4�/��p4����pdܴ�;�{7E�ՠ
-)����ЎG/�ل����C~���$��b�`N �=���g�U<n`�a
-�T��>�����$��<�4���,���������Pܩx��38�%[��hK�P����Q������Z8C0 �ь�͢��,E3Jf d
-n3�̠e>�C�e`d����2r�5�\�e�$C�#�z(#K���0��F��BJ����rnm�X�a�cd��ʉ�m˩�k1��4ӡPS+1u�-�l7��&��Yp���������8��\p�_�\6
-\�m�K�����d���+���X�^�H�HV�@�9G�9�*_X
-\H@c@�E���#]��x�z�) ��އ�x?&����9��{��g��E���>TTF� ցk ��P�P'�Q�C=�P��@u�g��K��ډ�����q�L�ɼ�H8�}4|8M��0���V��.0#��ֽ;7���f:M�6�]�ء�s��g�dzt��%]->��d��;Kğ�-�
-}���K�S'���x������,V�e#��[M%D7�|��d��F���-'� [97�p"��3� g�o�r�����]V$5���E��w�g�Ze�ӷ��!�o>i��#?�l�5=W�]�2�+)s6���˘+8��sa�P�����_(r6c��<p*c�T2�8�e[*"�rv��]��jKGϘ#�2�D��1w��4��Dʘ+��h5��'̘#R�\F�0��?��Ϙ��d̑JƜ�H�-�ڑt=c�s�a��B[�O�����'t��v�õ��C��9��q��<\yS�v�Z�\e��P$�De����8k��͚[�0�,7��ho��Is��><�r����[�r�T�-���˭z�6g�H9s�5���ϙ�_�3�"]"e�I9O�
-����s�d��c���t�Wn#=�T�{������gI�aY�r�I��cJY�N�1T��0I�+%�u�jKG�c�]=�d@6�S9M�m=���1P�8_�z��cP�hؿ��cr�5z��1L�`I�����|����z=������������ �Z=���ÝR����d��� �3G���1�z˪�{���1(btp�����5�����ki��k�Q'P�1�*ը����S
-���%/�p�����P�{���C6���t5&������Q|���G%ﹾ���K:J�gZdw�?�M�vn�z��M>I/|���W�������T�G��?���ȇ�d>N���7�}'��>qϷ��K�Β����^�J��&���1�xzZ$��J��u� �����.'�ܑ�ߑ���� ��&��k9�{�i=�F7�Y��z�S��>@/g'��E��P�s�u�}Gq?�������P��aw$l$�ʣ�3��?��n������tg�����l���7��df�]A��Ŏ@��
-�o���]�U���Y{�{�_^�1y�1���D��Ї���p�N���ʲ�[��S,����W�أǁ��N��ф���lǃ@hcY٤S���P�� c@L�b)4��\��ч�����IJ�B���+���G��U}���������x�ר����Z[Z4:XV<��K�C��� �f]��P�_o&Cu���-Ɓf�}eV�lVZp�+Mn]Y}�R �
-���+�cA�J�&��J�ޢ��0�o�`}
-��)�hZY����}+�
-[)2�ue��[Z�c$���Ѻ��E�6�Ʉ"���b/}��hf�س�l�$�w�c;��ձL��e��]�v��v!j%�c���'Vz-�t/����Zح�1�n�1�π�(fн(fC��5��X1̠�1L�3�H��0����y�~�/+-��ˍ��ߏ��K;��p��ɝ�&wDG�*w�?�=�~�,�k���g,X'����$�~l��Y�ז�?h,p�%��h_C��*�;���Ac�Q?�����82����i7�!�]'w��AZyw ��N�`�r#vW$�4`w9�)�?�dͰ��5��k1���i%�s*=-���e��`Rh�� �Ԅ�HZJP��%�Id/E��p�NQ��������Ij�����A�qͣ���7��U��DW�,C�J����nU�)�kV�MW[{9J���!/�VM$%�I^� �y�r���i����U�A�U*
-R����c����Z�Њ(�,8����dZY�����)\�2ה.����z�6y-���d��<�lx�iU�Ά Ԥj�
-vg�S��g�)N}�ͩ�*9UV6��eU�ll���ɟ.W�D���#�������؉ND��a��kg���
-���gɲ���ٕ����{3X~6H�-73E�$$C��z���1d�X�~� ���Ғ?��w��.:�U�=�H��5�P4��v��M��2a�@�K� �dnȄ�8�0$�:`�(��� s�52!ǿ�
-�$�O���I�eB�_���:���hU"�]\���������$��B�ŝR#���)͢2
-�t($��+��b,rL�j������UBi�yPa`���]qS �+�S�*W�g\���k�A&�em�5�L���h���@1�3�5],M�ϡ�z���c�k�9��j������ˡ/+�6�����#t�mB'
-�ޭWӮ�
-�P�`w�mW�6+ag� iػ��J����r�]-�8�mi�3���p�]-��ط��$خA�s�j1D��_�*�z�+����$X.yE���'���7C��V�e����<�l!晥��A�ʏ�b��E|���u+�I��JGV�8`9���]�����`@��"��z����N!��d�)8�$r�S(����}�s�x'��;��$�Np�]I�������/�n�3sr�'g�*�k-�B䈧��r_C��;iēt.�H�ΦC��>Vn1�x��l�1�o�[d�(�ϵޤx�����
-���E�8�b�e��p�Uo��;���8űo5���C�i5x9�)"M����5�Ɍ��'S9�?r�6N���S=��@���'G|�=b�,B����p�k}y��x��|Q4Q��fz�!m���}��Y�i���@�vX6��1��%Y>��=(H5��bEa��~��2�`��9�Ax�l#��GF��1fC�z"aҧ�l���\��iEN/5��f��s1�,;3�B�����Ԛ�. �6ٮK�T��+�ǪFPә�R:��t��8���� ����J�"�n�(�R���K�Y�����@<D�j鹇#�l<��p��zT��E��1�pT����z�k::��r7
-]�p�C�s�����k�;�&j��Z��k�c�r�y�ך�Zk+5t� v���������*�u�z��V4��5��)��vs��^g�[��(���n��6v����]��$H�DY�_�� _N¦y����i�>iv\.�
-���u���cƸ%�눽O��2���M�{��XE����q���;w�v�aք*рj�>��p��*&�UT8��S�eSpD�b�XE)���Q@��r�ub��U�+��vز+9�J+R1�"U��H@6ޭ>�E����IB���Hl�!�v҄O�5��*N�ϦC�y��T{�b.T1�B�z��h��t-n���D�JZo�6���6�a]���
-)�`+�2n������ev�gi�FM�s��jDk�>I+�z�nCh�^ˤdO l�p�t�"l<Kg�^��bϖ���kC�hQ�-ܪ��`���MYs�XV��"��>ٮH}���F7��N�3�7�o>Z����&7��8�ֻ��v�i���k��_%p��M�_��~��:��ot���+0ܖ���`;�DL��<��M����>��A�
-����䰰�K8���\M"Ɉ�(�ˇ���mڇu�OM�p��CH_�,�k����i�^�kl:��`
-@�=��ez�h�U����Y��?���L;t��o���_NƦ�/t��Ѩ�/oN�
-n��y�=xqHif{n#/{���e�t�ӉxJ>���l�G��s{O��:���F��^/cاsQ��}��২ ��s�0�*R����|�:���RG��9��t�T'�R"=�������z�$!\oDK�.�W?`�{3ȏUC$�k�EG3�-�v��{�^9���d��.��P�[*}�����({t�=ێ�=dX�e�^��oBk|�ܨ{��!4��0�������=p�+M:�~D�{��H��~M���*8�v�sd�-��s����Vvh�s��9�r�T�i��8:��]�a:T=0�n1.{����ϑ/6�]l��?G��ԠC\lP���ʛ�,���<(���A���kr������?�7{]g8�%��@=�P��O�͑^�m/S��p������[��6�����ц�/��TϹ�$k�s����n6ޯ0��J�Q{U&�)?Yl��$��x��t�LޮGm�3�Nߞ"ِ#~����$r���9���
-9�g��=A�!ǼN��o98����i*�
-9��1!u��Ŏ�G�m:G�':�5<�
-C
-Y-uʱޱQS1��sHY1ܐ���ѹ}&Vz���N�9s�5O���9�y:g�tw�ΙC4 �O�p��M�m�9�:��t�i��J�;Xi����7윌�}2�ws�RD���� g��nNQl�?k�wcRl����&���|�@r����&����� q���&LU:\9��܌��uZ�]>w[�E>��k�����[�]�}6Gϛ��J�H t�j��\���9z�d�>n��ў�5��6��N2�cEeoB�_�r32�ױzv��]1�mg�lN�mH��3�sw{f�t�?o:w�����9��s
-�N���sw��p�t���\�m�9�O�Ug���7�f�6M�kx�m����)���xH�?E�]!���{f���]$��q�}�Uz���Nr?s�O���s?��_�M&�4���N�?c�N�e��6�M����/��b��\;�Cm�}�4���ڔ��%4
-Q�2kd�c���[W��������=�m_>�ϬJ���9w�e;��f�y}m�}6��al��k6�.�{.[+/=%��9w�bk�������?�
-��m0�$r��5D��5~�^��PK���NIŋPKΕv<pollen.todo�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��q�(��;�D�*���+G���*(�8z)%)J
-@% ���,.2���E���9e�)�E�%��� Y,B3PK4�[-m�PKΕv<pollen_profile.profile�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��qq��e��q��ÙPK7Rp:BPKΕv<
-pollen.xmi�]k��8��>��5�U=S����ҕɖm쭩��R�L�~ κ��'���q�F`��"1�;����+��{ӫw�����=�(��`���N\w38���샿�l�����z���Ͼ?�����]��>����G�I���n���G��w��O����Cv߇�@4���h<(ڃd�֛/3I���?�f��-�A����l��w7t��0H@���:��(I�]F�0���1�^�#Ll�x�����Oo9�o�����/�F=������B2�/گ�>�1tg�3�a�>��}.�sQ� �C�������/�A����G~ۯ��ʿZ�@�㧯/�cz��C�g���9}۟/;淟Ņ����ӓ�EXH� �$}��#ӦΏ�ݬg�2��\T�sQ�溤ێ��Q�����!py���Y|��Q���������:��;�Ke�{`��?�0)}���Ϗ��'p.�=���U6{�In����_�����o���
-�M3{uŖlS��Q
-�v�
-�[K� ߝ�>���7��pAN@Ņ���릇$?�^n���~�������x���ݗ�T��T�?��}�N����J¿�>���_?�?`w٧�����q=I�]#Ğj���A�x9QPV��Y�՜oa�|L/�^`/٤��9���1^"WF{�8o-���=�c�8O�"��`� ���6e�u5�7��]��/�Y���SN�m�'?�OG{�;8����[�%��I�'���Y�A��V��|9���|Cy¼��i�j:��� �����"
-�P�,5��K�2�� 9FuȗI��1AO��&CQ�|h��
-@G�6���q�����;��g'<����T�&
-�w�o �A����}��D;�T�S�ȹ7�����'�-���?�p�ǣ�����D�C��"�^��vD�?���
-p���ڇ�zS����p(�\�g��8/U�ٗ�d�Y3������5���\u��j��^$I� DU7Qz��k���^����K����j��.���?d���X״Ӏ�i���р��#��i��F�l���Ѡ�M,��~j�L^��rp�Ç$����X
-@����w�f1n�
-{�-��_Qx<Pc7�#$�����s��֦N(�`����?N��-����C�\z��o�n��E�+~oO�.[�OS��V�ȅѳ�>�3tQ�v���O a)m\�kY�,���l�][b>P<MS%eQ�7��������Q�Y̮Du�DI��^�'K�Z�H�z�4��8�P-b��ę���Uu|���U�5%U�4O�dU��J���F��1���B�LA���
-��{���X֟,4�C��@7���/�t��2r�).n����2��Ck�����a��
-�0D:�%��i�'�[����f�9��V�̈�K�3Gqv��=2����mV]�Q33��
-M3W��ơ0�����Y\��UZ_��(rr�0R���-CHt3�F��r��!iZ*:���b������Y���7:��R�4�;��-�L)�o�ܿUjСyk"쓦�̼E�e4C�����t5�ԑ�-Rż)��M;����@�J'�ƫ#S�:�ێA{�� a�'7��Y�'��k��_i�ް���UT�ݲ��x�r�B9G���+7�}�rgke��Vq&1�����0<{{*���R.i�1��Q\\5�!Ռt� }�\;��CfP�!ӹvVn�j��[��n�I2~�f��Z:Nx��'j����Ò"9��ʙwX�0����"���O8��T�C!��k���\,S*����"욪�S&�Z�lol��(.Na-'*H>?] �鐱AR���K��2A��DH6k�X�_s-�W�`���ki�ks�0%���d�!h����Eg��R�o��Y�� �ō��A���Ό���8��[t�1fŬ�v��o��>�� ҉X\���C�N�N�L��ȷ�R�5bڝb��a��Pp8���Pj�ڒѱ�ؼ�� 3�.�t�-_����R��_�e[�EGIq˒�kЊ:�휍�����O��;�# $w$��r�����Um�F<��r{��DҤ(z}��ɟ��'O�3�e�'�ŗ��G�рLf,f�!��a4��5<��('d�bqq`���DS}ɞ���Ig! u����#��`�$и�%�
-�|��~(��7���&�,�j�g/���~�IV���e�1��Rʉ�Rr+"�`�&�@�F��ˮ-��c��j���#�q]G�#2��� ���&5���Y��f#���ُZ'����>�$�䪒�TpƟ0N{��������v�7��s�:��)�̗�A\����e��'N����ȑ�#G�7I0E�K�h���ښ�*�.I:�N���E���G�C�%�g0Rx���O��8?A�UQ� ���y�d밦���q�Av��:K����YS��l��o;(5`M��z�]�R�Aʟ"�����ob��{�j�+*Pm�h�0EA3LAE��E���I���t�b�Y��$�|Rj���т0��R�$��\��8#�JV�����\ �����`�sL�+�e:n�D��C�
-IB�X�c)��/���$b��q�.H���J
-n��Dz�BcN�M4N�B21�#ON*5�T�>
-���0�_�)瞐Ju<��5FV�|�\�V3A7]�Iqж0���$���G�|���/��^��P��9��{���]Ύq�'ZcO$lFc���7?�
-S�#��o��J
-X[+�f�ƺɉ���L�F��� ��\j0uhܼ��؉�C6�9
-`���=L��TjpC4�:�O��,I0 �MG��V���뼃��`�-�h��t��!��X����� ��G��i�-����p3��b�@�7���u��ؤy��R�Jc�l��H�:d�lR��Xv��
-qA�t9��f��d)|���$R��.����^\���cg����c:�0�r^:�D�*�� ��YjpC�g$���� N�,]w��F>܌ϐH�#���S J
-n�^ᖀ$��32������̍���W�� �<'�x�b�<ˠ�����h�@:����o�v�U��8 0Leܲ�)2�w3���Pq��B��Qv����~��:a* �d@��A��
-�Aɕ���j64���Fb���f���R@J7c( w�H&@J(5�92�kh�@5TGTR�J�1*����
-͍U�`�!��f4"�Y� �xUjp�y�t��WQ&��H<� �R�ڐ@4ӎ���_~L�*.�L�L9&��K
-����Ƨ���R2٘ �4.5`�h*gc��}��r60���?��q�PԦu��B�%��8��iRf��jBq�����\6dG����@�#����Y0�:|���/�.E�ϵ�˵��MIr��?DC����o]� �N�緲`�t��6�Ar�c�kG��$��sڪ��@�Liz��i��1N��$�xGq���w3��dR7L�Ve3�Ay����q��9a��|����@lj=���C���]��8�4i�p=V�]_�&��`ϒ�n�X�C�j7"����\8a@'�c��ܼ �N�Ҙ��s$���<��� s�-:�3@#F~���9�߲=h`������ h���kg`Y�#����3@02R{�'Q�Q�68� !�`��+���q�Z��%'<�F~I�:��,�w�r�*��(�m?.�dι#�: �T��Y*w���HJ��*a���ޤ�
-���:r'W|[��!~��:��!���
-�-Nxre73��c�MOrm��^�.)H�6��ޤ�m%��7"�@���4�S3J6[�yh]k��*�M[E#�g�2�ڙVq2��#�~0�{#�������$n:����x0@��L��'����rj% �N�{O<9�,0H�*/�I��ʭ�v䉺�|&�o��\��9�=��,8ߔv�7����
-�Hq#
-d��ۿ��:X�ĩ�����9�5��ƵN��+�3���:2���i����53K1�
-M3��d�5$ϒ����W�8�t0��i�����t�b������Yj�B����e7I����o�o�M�#�猬"mT����%2��mߗV۾
-�
-����Lr.���֤�B�;���[lX`�R\܌C�q���L����S[~����W�^Zug
-�Gڍ��#R\\-��Z6���R�H������㩪�u��St�8��غb�MF[#CV<(�5�i����7y'K��\���m�<G�I'��S�ˍ�"�RS]C�L�̙F6T�T$�wк��e�W�/py�$kQ����Aqq�؛Hv؊F}�ĆG*�J�A�"f�g3p�O!K������ˮ-��-D�Je=���o^�Ð]\�c);�,]��Ԓ����uK�g/��(.���v��c�*���EV��}>���]���pٽ�+g���1j��U(o)��ӻ��vM�{�B��t(�&8>�(���x�]��������࿀�=?�_)��$R%]L�s�RC��"�/�����`��o��K�p5���ٺm����-[/frn{L�xu[�X;�m��ӷm�q�A���9��O_1Q����t�_��>�@�>��Q�?�����3M���
-�X�����cMOr!;���w+��h>'��=-�4�a���ܱ �l�s�{���)E�I����rgE�<�CJ��
-�?!JF�B?�7�3F[o���7}VԲ���?h��mX�l^�AW���J/.���~ճЬ��i�}�Π@v:Rvu���d�_�M�Az�(ԑ��♛k�.��O�#�j��#A�]��Zj��XK�Z
-Rv���nG��V����#5�bR�d��¼:m)_Z
+PKۄw<pollen.argo�TKn�0��� �AQt!kcwѢA��]��$=�~�'�=z��"mRv�E61�g��ޣ8���D6�T(�u�1�ﲬ��1M�Eb1bt/�@8�U�,R8Av����B}_<|*VUyZ{��j$��Z�y��`,p�Z�@k:��9F�ΐ�ߏ߲U�*��A����iT���*���Aƀ}.��H�
+�����&�^Qqׄ
+��P�F4J�aG�ͅx�G9����0�|�G�(�R��D4J�q\��בW$�&^)���4��d
+\����QK,�zB��T���ݡ+��{��G��1����B�v������3��'(��<�W��Ճ��Ų��)L��>v�$B�l'P$�$��XGx�6nx�I
+�"�~$��z �:������ͯ���S������L�B~�����~��!���ƴ��7�EqRz�K�g��=
+Ǿ�o�8{��������W�p"
+��[�Bv�{�g���P�Uhv�~�F ��¾�k�5/��&B�����
+�w��T�m��.�m���ShA�+�n�C�$�qPZȣ��a�,�i��w�PKZ�949PKۄw<pollen_Modèle.pgml�]�n�F�ߧ���"�3�k�p�dQ�i��E��IZ�
+�r��>оǾ�)���CrFQEٮ$R�|���7��������1X,�x~q�ε�I0�b?��.�>�=��&?^~��o/�~���W�������z39K����F��������������]���(���l�ޟ/7 �.���KV��|�x��u�.�/���gj�өmO�1�"
+O-l�x�t�"��qoo��S[Ӵ�Z��B3Ͼ�d��{\������7
+ξ��/?�-������L�^�����}�?2𓉮�O&� �?���M�>���&
+.n�h<[&�"��/��0�t�=��������B���37I��* �/���n�^����=���0���+Ͻ8�g���$�ߠˎ�
+ʗ�_�\|��_�[����ᣛ�g?T��_[^��gQP�y.���/QH�O�\�Ql��>�~rG/ �����]B_r��%feuۮK���.k2�a�V��Di�7�r]X�#�H^��?K��N��� ����%U�s
+�Q�:%@�p����%u��EׯXr݊s���I��Iu�]a������c�uh"�L���s�鷠�9�gūa�F�wq�ٶ��8���^��NA-��_�eކ���0���n��ۗ�Fɳ�}5L�|;����?���5,�n�<a���`L��zc��;Tےz�!�A��!��|Gѕ�ūyR��p%���p��?n�����H��_ߘ9�3��^�9�{�Pf���9����åU�<f.�5�u����z��bSnSR�����A�6�b�5 ��������c�ļq0�{�p���"�P���A���r�n[�*'����mk�,�s�{No��%��*���o:�D6]*�MW��������6��ɦ q4��NS�=�h?�I.�?����w���ge
+�L�q64��\�)��(��4�چ,� ܻa$��т4�U�1���������B��+�{�
+��5�дQ�S�]�>�S�o�8
+�y+�V�&���u
+�c�/)�h��i��n����� ��<���WK �vZ�vX��=|��p��HWϲ��+��S����O��q��B�c���0^P#a"MO��ړ &�6�q����
+!&L��%m��2�D���FUm:x�)1*�4LT��w�a"�d���)C?�Di�����D�a"Ą��Ƅ�QoL�&��a"�:L��9l�����2s]��&b��H������^k4�0QY�8�<ք��4z�S Y�5�:��)&}\����}�tE?��w�SM)�=}��~�/g�G�2�g8[���Fȿ"��G�X�g� 40�CG���E�jl_*Y�W������:V#L��[�'�/�*s7�c��i��n��w��/��ڱh;�^�hoо
+���)"w,�� ��G�S�#Wm6xǢ
+8j���m���w,���1�"�:�t��$4��߱h�fC��x�ϵh�'!&�� �]<��g�x�;
+�mz^$���p��b�
+'�J8�Tc�������DQ�����IXY4�Q �����{L�\0��Y���_R�~Ē0K"lő��7c:��$�P���CR8��
+��#I���)��Ն�2�fe~�ԶY�W��+7*�"H�m� /*d۬�}];Q��H���������&pK�s�#N*�S?����?�I�U�e<��F"��T�Y�k���o+���%�"���f9NWl�[a+��E@������K����,6m^��II���˥�hkc�a��I�16l�*��_c���Q�T�c�c����X*I>V�����!m^x��X�=��O1�fa6�dk�U��I�D�1̅�9�1������ǻ�9:��H~�7�,�� �h���� xL(#.��Ռ��k�3B�A�}��f�m�lCf������k#��
+E;�J�`;�`�`����d`{Q�|a�=�4���6[#�ހ�����_EQ�Iv6��Nx�c�����=�6�}�����
+0����|�4M������������[�\E����Lӂ��C�0����+��;��|�4@��x��p��\����O���6!E?Ab���N �|&��Q�����6u'��CE�<�H7�8-�+���atzH�i9�uk�4�dO�Hx�.y� Z�'O[(mDmᴛJ�t�'O�)���\��g �.�|m�߫�iRI��PY��"_,?dج.��
+t�<M�%O�
+Ԛ<���{�<M��i�\���W�~$O.y�B�Y�ha!�5&Og�7$O�J�4cH���zC2�����>M�hʟ&j�3�f��Ƽ�j�Լu��C��iּY&PR ��c�i C˟�H��FM��M�[��4� r���f������8n��:�v3����W�ݨ4d�[���8¥����sKkt7���K�4"���q8c`0
+s�3��57��.I�C[�*�<�lww��ŋ����K���;�W!j��\�^���߾/�(6�>&zm�Zx��x��/�z����[�*��}��_b��
+�w���%�݈����9TH�Tl��g�yx��p}i�o���D?�-]z�ڄ��Y�3�7{OU<�9�\�i,ԉ�{d;)m.����-no�Aj�*��u�Y��7�( �)�/`J�"���Nz�{�h���W�y�T-رd�+�G�"�P���mV���S���2@DR̡�9�_z�������_ѧ�q�k�j�kM�y7����JV.�syq�m�x�Z*�5��O&F����O�������h7����L����g��WJ=�UpӨ��]ƌ�l���Z~Z0�Go��3¨OCpswq�<�i�CF��/vU
+ E�Gh��g���h�Ш�1��!��4�#F�f�D�zh��"x��[U�@�M턑�����1pM���
+\W��/�8ӄj�\��E[��7+R`�Qm�܌�z�pp�P<�"c���lN��o6n��&L(�l6��獡�6�6[*
+��V��1�i��,8mu�����r���-)~��
+$��-)N0���?�(�x�Di�,X��7��&4֬d�/�9�?(i����,��f�R8$8���v�$|$�6����HhT������^l�l�k�j�b��}���ps��$ �:]A�۳�$�b{*I�����z"���V�Ϧ����g����WE0Eu~�Ϗ0��#p������{�1lf$?bO�r���F��I�� d�`�4 ��q �UgD��Ɉ��
+`*�f2ā�W�a�=h���s,8[PD�r�<���+�q(��w�[��)}Ͷ�}�+#��0~�8m'��#��AѸ���=F㬡�8I�_��8MȪb,���i�r�U�8kh4N�
+V��a]��8��+�qV�y��j�:��y_�z!"W����I�u���z�n����$��.�E�Jh���z
+_n���p���y�[]�F}�%�����V���S�XU�R�~$��|��rP��'Z�o��jW{�T�H�;SoF��кn�ٔ�j+nՓuY�**�eU`ۺJ���F=�m3�^ٶc��C�e�H��F]琺�<T�^ט�j+nԓ �l6[S��o6�MK$L(��l�l�c-��n��Ґ�l�[sYm�M�
+<��&�`.k
+�X*�ͷ�aq��B�q��h��j6ߨ�����zlR��{�&�v�S�WEwIh�TکG�L0���6|�C.������F/�3����B�y�+�,8É_�
+�H��]<�f�p"P�t���t�@�P&F�2�y8(�e:_i,S��egb�r�Pfi��ђ�^��i�Ii�))�rW���� mz�
+���)V�q��4��`h�N�p:�=)��t�_5�������+eyiR����\i}'sk=�u�&3
+��hH���8�+�\VN����.TN���ӥr�1��c�ŧD�����"~�T���5G�+��G.'.�):�T�~�N��!�~jD��9K���I@G�f��ϡ��9�3�Y�ӺJvږ���j�"�}�������"����ӡ���(�E��ı��7X����.�+*Ccpo�c�]@�]R��,��o94E�T�bpo�c�J�.i���}e���Y��x8�4O.أ��F�{�XSnZҵyK�SH�0��.#r,��ö� !� ��'�8uO��Ue*"��T��Ř�vI��o�4�%6����+SQV���T�����u]j�%SOb���V�R�~�f�@�:��
+[P��X�*]�J�/��2f��%QoF�^��1NS)�J+Sצ�q6�
+�ƴuU)��f��h4mx?ӶW�\��A��U�����V��Tx�C���b�Hܨ��
+1��N��;����͗���
+-�r.zb��</^͓�����xc�0���"�ݳ�����o��a��Y|����D8[�i�=ː�{�{��[%�+��mЇ��|t�UZH�ǫfN^[-%E�\L��p�]-e�vYj�͂�+�V��r��9#�Co�}����6z��$��Hf�i�ʼ~�&�_��6#F*�2뺝RJѺib����ܱ��Vg2�z�.�m[N������j���t���oG!?�Y-p�T�z�G!?�Y�f@���Q����:���#v.�z;2tG�o�r%��B��3�FLcc�T��7n���q̬q������7�Y��$6�92e]�-�=����͆�f�AM���X���J5B���-����1�n6��7[�f�?����Y��ղ��͗���a�I3��֪�sk3��n����]
+�[o�[�{��n����Z����aѡ�� �T%Ea%��\��P��U��aXUw,�8\ӓ��T��=�� ��5�Y\h�3U�@y�����JB�
+��w=�TU����z�����61!fM;*���\Dz��Ê���@�cX��P��q�Ō� Ob-�{����(Vd���
+�Q�2�+g�=��mճ�q����_���?3j�|9q�&:G_��G���PK����PKۄw<pollen_Services.pgml�\�o�8�����ԤB ]�i��Ӥ}��!M��D�!���������K�d�.tJZcx��_���/|e
+��`�=�����.
+�q���ku�7���/�L��}=W��������'��
+=���"���� ђĽ���١�W�����B{ы�M��WDCV!�P���ǩoG���Ϳ�A�۵�.0�]�j]S3o}`�g�9�g3�k��z�ީ�Α���;�0\#F�� �y!^-�K�S7���洗���v��Z�Dac��?����M�7(B�>�l?��#�b�7ލ��x C�=7�4��Ú��}�!�Q�4��v��8V����l`�3��T���!ߧ}���q8����F
+�?`�iR�6��m��4�/��!Z����R1��C���a��^F�����7��b��d>�Px75s��9�m�YuVm�R�U��45��;�������e���˲����B����'ZB���zh&i�2��)�uă��
+��E���^��,�7X`o���/PK�'e#@��l�!0B��VF�M�P���+3з�Ӱ����GθOay�-�]�����B�^E͐c'#d
+ٜ��<y���63�+�V���u']���W[�=JB���i<饅*�ٓ���aɄ����i�B����;I_��墈��(�%[L�bi�dA����,@t�����W,��Ĵ��
+����<��ebي�Ӟ��.ug�V,�įl�cg��V65
+����h�א�* e2r�
>
-��B�賨�E�����A~����[��X9�Q�];�)�� �%�k�zmQ!�5��ϢAsY����gm�F�A|�*'r�
-�Ɍ��
-���^*֎�2��ۊ4�o˪��ه�BcU|}D7�Q�]V��
-�m˪ն�Boޢ�6\V�x��Q����%b�/?�&����h�?K`��b�T?���'�T�Obs��D7Kd�p�D�Kd��gI�۲*>|��Ī�Ԓ�KL�A1vb9r*�z���!����/���O�BwVк�ˇBC��R����3�:dD��P�7P��Mi%?*L�U��B���R��M��J�ҫ2��4*4g�U��F�i��]���h��2����[<L*�~�u���"�a�j��TL^��dkI��]�:y�4��ZK��{�1U�S|T�\�׳t).�%��j֊�p�
-�bO?����:V�Zk*��kV��k*V�5�<,��P�u���Bq��+/��P!��������="#3 �N�2�08Ҥ.jD��( �V��ê��@�M�[�_.J��5����p1P���¦��斒
-A�U���V`Tt��%D��z�る��T\�}$Z�b�$�v/�ݸ��NM BlZ[��.JrB1a�}��q1P�ƅ�GN
-.t�e�EG�2���L�,%�v9�N+˓����
-\�/%~;|���ࠠ*x�pP�'�X{�0��T�^���ۋ����$��R�qPP������U �8���#�AAU��2ypP����%>/��i�I!{�a����\sI~�Ֆr�Z2��@�2`A��#+ �]2��H�����OM~Xk�R�Z��]���3Sbofv�#�}���N}q$�Ϟ�ѩ��������`���A��c� $����߿�gP'3����9���6�nVD���m"y�i����L��� rz���k�@�0k��)��J/�{C��G�^�ҡg**�DI�TOV�QO:=ɒ���]�0�3=1P��h���S��no������N$0H������O�PK�F&$��PKΕv<ptB�pollen.argoPKΕv<���NIŋGpollen_DC_Pollen.pgmlPKΕv<4�[-m��pollen.todoPKΕv<7Rp:Bypollen_profile.profilePKΕv<�F&$��
-�pollen.xmiPK1�4
\ No newline at end of file
+�������ؠWcC���'u�{ԝ;��
+�dz�|�wl�:�M9S�s�l]��_�`�8�K��������Gg��V@��F�k��G�7��6-``��3�WKw�R�u��������nJa7D�����Bn������[�s�sL7b�N������?��o�~��-�1�I���g�L�1݅D8H�����U@��;0�K��?@"�q�P�O@'��dth@0.�v\�t�?C���؈I���R�/I����H���&�����v��}�ror?����Pv�BCE=Fz0 �<�X�GҔ�VX��#C��Æ�?VA@��^���5�-}�Q�� ��y�p��xE�(5��B��!S�͵f
+2��e*ej���7*���!���֠����-�v܌B�6��4�P�̂8H
+�Zm���y�L�0��1�}�Z,��}�\Q��(�5Ŗ{�nD>��u���E7Y�
+�/P�s�BU>���H�(��o�E&�F�,���e>`g2����H�s�un�g�|��)�_'�(����N�3(�-fXъN���T�N�SE����M�JR��Pɬ}Z��i}�n�>q<��x/%��,���>Հ"�JI���>����)�Pf�F���X�-R���>�3�
+\��+=�i`���(Ȏ�O�v��|0]8�y$fWEAUF�|�Pt���g�3�Gs5��q4�����c��ٶrD�=y� � a�7��i���j�8b~dC��<Lb>�;�H&mL9� ,��H�^1�>�zF
+p�"�K�6�Ӑ��m J �TAXhU� t����8D OH?%<��R�!b�VN��ӵ�����Sb���V���%�[��"��N���D<�����9��
+�N��O09�PKF;�!��@PKۄw<pollen_Diagrammedeclasses.pgml�Zko�H��_�VU*��c0� PuIZEj���T�V�ʘ���a��G��w��/HC[Ԅ����9w�̽a��n�K7���.G2ꨲ�����7����(�,��8�0��tq&��tyu�^��Mg�g2�f8t x4e^�f]A'q͈�1{� �͉�o����+�;+ҹ~�n��ax���M���4�+
+R5�Ќ�������5,�úb��:P�Ծ| E����#yB��q�`���*�[�OM�~���,�����G�I��jꑄt�s`��G���G���$�����$�v���3[<7L:�������a��EU�)�5u5��ɜ�ڷp
+>i(��%�s��S6�o�g���ﺶĝ���|M�y0rcs�n�6�n/=��d܍d=e�>sKf|>���2�ěsx5�HL%���J�R����*i�.�u�q�L9~:$[��:d.�(ߊ)K�c|�M���d��]Gx� �e�+���7��2�KP
+�� ȅ���*7;\�o��i,�'BX�N��F� ��2k���N�qB�� I/_��d�dPb�z��p�'�H�d,3O�?���!�*�2����8�z�L��ͤy���'�"�������XL��I��2���
+bt7+���މ�0mº�Z�kP�ø���}�����Q�f�=D�>�[ք.��<?R6KO�mo�M��~��uۥ�ʭ�Vi{��m%����Kы��g3h8��B�O��(X({�O[��8�3\��i��"0�'�x@��7������nGk���MN5j"�,��[���S}j�@�\��s�Dw�@z~<h��%o(��E���n�
+F��
+�$B�n�s�g������q���0�0����3�g�&2n~�_���)i<\rF��F&��L�$3���,s;�)�>���0Z�0j�V��=A*`Qwܗu��F�V��Z@�U�zO��cpb>�\#�_|i·kӏ������m[V���*�ѡ9���44[�����,HDM���{GRk��I:�^�fQ�6۳�Qd��(x�Q���Y���l1rvT��q���YT)��������j�GuU��=�X�5�gԯ; ?�g��<�
+�٢�dL4�ȓ�Ϟ/�Zem�Z��Rm$tY��i��t?�V�*�ڲ�8�I�����w+�X(��P����CZ뵨R��D�V���5��S�^�aխU�������R�ǟ>^
+�!��5�/a���k���ӝ�
+���2oY��A�o���c=l�Y)���
+�dE�0
+�2�����[8�>��5Ѻk�0�9�{�G�m�����|
+fx���WGM��[`y�V>������*�w���P���ai�,�*Z��b4s�1v<�v�C�1
+^� �?j���ݺU�V{y���WoS�l�H:���?>�PK9ܜ='PKۄw<pollen.todo�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��q�(��;�D�*���+G���*(�8z)%)J
+@% ���,.2���E���9e�)�E�%��� Y,B3PK4�[-m�PKۄw<pollen_profile.profile�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��qq��e��q��ÙPK7Rp:BPKۄw<
+pollen.xmi�]�㶕��M���H�S�ؙ�Z�k��wo�� R3�H-I���V��HQMJ��(AI��x?�?���Α��؞+�EzP��]ӳlw����q5�<H}��O����eg3������?�����Co��.��`L8D?>H����n��}<@�W�K�&)���䵡K��GI����7��_7|����I:�my�a�������������[���!�Cx�5n a��۷Q��x�`��U�7鑿����Cu2T�� ����%�g�iB��-��1PTI����+��������?K��_�ר�ҟ��[�D/�"4�i=:R��|�F�mzb��2Կ}�&~ґ� GM�
+�s��D]_�zz�m����`2(�`���`��צ6�n��l6�׃�,˯���Q=ه���s�>Hv�aM{c��x�O��������@�y���D;����f��i�N�X:3m��Z���F�f_~!y:ţ���z�n��LFk@&X]�����R� ߤ�1�@bBա�ӫ���~�g�4Y����=�p}�a�|�|x����,)����U�I�F��"�gZ��g��0����**H�e7���&h�n��T77���cz:�5��|�|���<Do�ï4�:�J��peW�����A@Xو�`���%+�H���ԲL�$����!��v̟<�Dd#�����֎m2��2[�fh?C2�NL�,�,�.%���éAVD^�`�6���
+��Ԉ�Ȇ�����O��"B�� <�y���зׇ���#Lt}-��>�d0&�=��OGz�����7^����Gϰ]���Ŵ���-/O�p�cB�oax��K��f�?��g�Yż�Nh����nɢI5���S"}�W
+}<ؼ��q�k ��&"�8�g�$�G?H��>����}"�͠.[���d����:�Q��A�H5EJ��S��)I R�ɜ̨��ӫ�|7-��E�o����=�oTl���7
+^��#��"�Ǔ��Z�AR�e���)~����\�ZGJu��dṟ0gӜ�
+�"�����q��?���V��+cZl4?��aύ�����Yx�
+R��k���5��U�R�i4���B3�6�o�t�F�$�
+�ܿ���z?�-��7�Z�ׁ�և��CMo��;,�K
+w�\��2��]FV9�ed���L�f�us]�S��I�y��Ԣ���<R��cA\!W�d��:Z��{�@1�(j��-Rл�[ĉ�6�J�EK
+%�,/�t�rf���
+��RE��̳��Ȩ�j��a���`�Ρ|^���ֺ_�+Gیr��(�7��B/�"��?"����E7���=�G����C�m�����"+O�4(Yi$Hw�!$`p1�s�rH`�3��O��G'|{���r�p��a�������/{A6����M!qC8%7�w�=+Z�ʰ�Uy]�v��z�Q�kg�}~%Cǜ�ނ��J>���?�M��������!>�$�����7(jO��}4|����0����u�TL�=�S ��w���.P��烎���Ө�����/�o2��>s�pʟ�/2g8ϜyY�eM�`db���d�o,2����i���gD��n����m7��ѭb�T"�{ĚϞljs,,}��)R�G@��Qh-nl?߉�9Z��o2R(L�L�{���y���<�D�!2�3n4��MÌ��Z�t˜�$��Ia�X$�P3t�~蘒@:�t�߸��� � 0�k�k�Z]b���P��L?,]v#�����p����PX!��ΰ�Ҁ���3z*�Css^̊Ac!����Z�g����%}���d@������0��\����5�o�?\�8�ae�a*�u��#|϶���=�SR�z����rNr�&��CDSa��?l�J�,D���rj\��<���J��Z�09D}9=9q�U�+���:�L=�-�F܄J��.'�k3���0��[&�7>#�zpD�}n�h��}���#|u�"�&S� �S���U�7��U�����,f"�1�L��*�5֡Љ�',�n�h9k�_�B'��G��x0%�Ej
+�t+&ԦЌ��B�C_OT5�0Y �p��w�i���Uw�Ae"Ѣx��P�~�q�ֲ���v�hh�ڦϝ�F�w�tP@�F�t9�?���{������4.�Z��p�X0O-̵���z
+��WPbRF;>y�H��j�w�0� 4Hw����ܫ�:0�+D���K"��0�t�0������hS�C�6��şhE$��!K��]��;��%�D�A\�~-[u�a��=����@#�7�j�D$y�F��f����ß
+�pk��M�L�� ��������f!Pf"E1�L��̚�TX�-B������6k���(�e:4�k�A�X���6˾��(J�e:�0ޕ�_bK���~�����_�JG��25ӡ��/3�҃TX��t���S�Y8�Uѧ���/�7X��z�Ya���3˚9x]�#����x�QAuEA��� ��
+�UF��`DZi(�9�� Nw��������m�0)�2n�� �Y�(xSg�+���G@@o! �'h㑮ET+����P��W��@,��a�X�@���6���D�7�Ȑ4�b���>Z#�Z60=7��RX��fL&�=�$��'!ڮ�����C,��}W`}��kR{?�AZ{V�ҋp�� �%��*����#�u����fM>�]X�����7� 11�ͺ^L��^�7�=1�dž2�om��z�q9��l x�B8Ǘ%��V�_;�
+�t��
+��P�Z���F O��B��@�S��p�P�N�P��j7�hS(r�3z��ܞ�(�.Q�┉&���[s.��_Г[s%���-ݚ��9�����9�Rz���+���&Cܛ��FMP�@GP8� �� x�2!�U��larr��<�6��a�uܹ�/~��F�b�v�.7�E@bI�&'�Xm>���»f��h�0��؞���M�}�қf ��]�1��6�Lhj�G��Md�0���վy�����`��|��|���&:��L�.Cr��ea�I�0���D��y�Ž��D�ܓL��-��t��k��L
+bRQ����;�}g��r������(��g:�dN�x2�ֆ6�r6Ӎ9�Mr�ra28�O��0���n2Ѫ�'�2���aG�3�s��5y��$�Ac0����34=ׅf�K2�x�Z���(R��;�lo1�E��@�[з�-�&�wh���[nOOt=�=17W��l�/�O�t�1֑Sk���e�*�*��~�4*�U��
+N�*��u� �RN%i���Q�=pC6leqY�_� �ԣ=� ƪ�ĊD�J�������{���wdZ���el�(Ӎj����D�^�Y�Ȟ�X�:�.�l:.��$-+�jL�y.���Z�Љ�c��^5*j���£$�'w���ZOcA�G���\�(1Zq��jek�9�p��:�M���a0�PKz��Q�(\�jd=��� l�Q'([��j���B�U�&D�H��؍��o����� $��I>D��~����j�K[ܯ:�hB8{���%�ՒE����m(�B!k�l�w��P�\}��@��(1����{��J
+$G��]�k�0�cЭ�w�s�Lфvv�Ihg��0�!���B�.���'�4�Ѣ1-��H9�:�/�'�
+[Kq���Q��T��ܚ]��s�
+P��b��#t�>�2����֭��g�ղnP���-�'O�SF�e-x�:�r������v�P;C眣��[�������
+���[A-�ia���!7,�W�0�挨YҲ��ɭ"�EV��n�E�{�
+��ɻ �D�R�"M��/�qʵ�K~�I5���;��"����&c�:}"a�&���%=����D
+{4y"��k�n����Xk2��?��a/�T,��`,�D'V��G��C3�M��XDk���B8�n��B�T|��ʤ ��ܫ@ޮ��
+DT�f��=�9Q�L�~E5�*�� w�&b9���K�$8a���H��؍�] ���e��*��e���
+� �1ˢ&�F���C��aw��Ty�y�3���خ}o�����z�n�ZU&��
+"���jI��3��rP -�Y�1,��"���YYi"�e�
+����D�_�L��٢;b@~-���LI����*�e����s����U=���*.���H͇BE����N��sE4��H�����l{��/0��}f�@�w���;bȔ�ޜ0��-d�I�M�TS9_Z^��'��ɹE����$�'yc���ic0�V�������G���'χ���s�c�e����&v�~�
+����f7_����k�x�ԉ�Ce~
+�/b� ��|<�X}�<$�S��8���Ac���Vcr�F���M���T�@��E݀�i�ˎ�ό�;+�|-9UH��l8���C� W=�Q �~��|k:�.�<ۭ1��di/����\~�{)ϭ:D��
+!��8w�r^-�� ���e]0
+I�Y'^��B��Ό4�
+{8�G�P��s���\�Yj��٥I���gۤ_f8,�w�X�#���J^䦏�G��;��7�0Nè�pQU� ������c'�#����6���;�t�rsp���s{���>p]���-ؑ.rM!��-[�����
+��������d,5�>"�Q�p�2�~Xశ����X8ϽS`�M`!���)�)�L&��=q�=`'���e��{�I`�
+`�"�5��@���ʹ�j��larJ]� {���0�قZa�Za���KZ��-̽H@`�-`��hY���'/��4lC�(8��9-[�b�1=9�QV��Ún4�}6xG�E���N��π�����Ȑtbo�ea+s����V��O���ݥ=�+�@D�aN�����J��#��E�4�(��^�M�R�봅!v�<?�م��
+*<g< XT�J�Oo��q��n��Ũ�Lᝌg���1:{+��|#c�qy�GB�"Fw���?���n��Oh$LsR��+�Բ��W��{4 �ǯ�"��vď�ߞ�_�3C�=���C$&}�F�)#�z~�hG���WD�~z�ubNhzf����(
+�#��÷���2'�_�������k��豦Px�p�_� -I����]M���{���$O�QzrD� �濔&�5�e5��^�S�ó3�]yޤ�"�_VC��8�>.{+��V��V<�����[����Ԏ��;�N�6���(���#}�|��S��*
+�Ow��p{r�sp���3�+�eDT�
+�P�2���L����-��Xx�X�VB���������
+JM�29�qE��#���e������RU!z����{9�'N�&jga���_�I�_�iRD�~m��i�D��7[@ �q~��b��PI�7����KS���Q�R��
+<{��8��R`�T��2�x��]�D_�����BVBi�CRZ�/���W#�D��QQ�"5
+[4�Ԟ�j�
+
+���
+��wpCQ�W�2�ޡ�{����u<��.��ئ��<�n�Uɚz���D��$,|u6����:���x�vh>y>�
+��>X�d+3�U&�����u�s%.B� ~�F�xl�� �x�M��yEh�I$�!덺Gc]�<�����C�����m�,RM�y�s�X���p��6����~\?�X!�n��;py�����u���n�l[w����6�x ��ɕ�'(���Ih�g[z?�ߥ��ǽ�ۆ?&_
+��eIx>B�����:>�c������\��B4�0����F_:��mL� ��
+��yu�&����ʒ
+�j��۵Sw���.t�s��]�L��X�8
+K�sc�FuӅ��{�F�A�'���a"���Շ��<���H�@j���Nˀh�W��t���-z%����ҩ9�Q�MFomښ���*�Qe��q�u�r����:U�xB%os�v���z�g�q�5��=�D��ۡ&p�����\��6`�����c�H��� �'̘2ҿ��� ��i_��dW��=�I��,-�ӓN�d��������';���-Yґ�����c�/�le+����?w�J[���Gy��W��vS��>�o��y\�um�����C�f���5��;�����3��[���jB9:x��5�����Յ]W�qJ�&݄&�?3�{e��w��E�ҭ�os�W�����rk�;^��#'�俠�P(q7�ĉ����ķtb�����
+�o�sO�։�?C�K���J��]���oߵ�3��6�����������HG�e"a�r,jߵ����1��~����4�{��ԍq6�oB�+��Z���a�դٙu�7jVgDaM�'��U�"�lt�V�G��Î-��m�� ��$ۍ�"3� ��&͋�+�w�X��<�n�"��e"vf����}��G}�ʹU�f�(�Ѡ��GnU.����ʾ0=�ܨ��(�L�_- �m�־�;�q��DJ�z�b|Ƕ�$!�=
+:e
+�0�m�)-���\ɽ�j�S�P��(�RF�I�z�▗VC"E D�JH+JHn�v�J��h/���x�%\;α��[�(J/��1�"���ԭQ�H��
+QԞC�9����<��Ҕ�bw
+����Z�[���:<�ra�bo'�y���!�k���ꆏ3��ݞ�,�U�4�އ�Ȼ?���N�i�GV�kI���wp�:�x_v�]Q NJ<����y? \1V��֊&�>?��S�ԓ�P�/�Y\������rt����އ��>=�+��~z��(����ʷ|�sU>w��S�*�������� t�����ۋ
+�WT`���
+�����E&r:���k�\�ˈ�k���oN܋yAlsƯ�6g,+*�Z]�u�p�W�`��;<���g�״���s��0O7����g�co^/x�
+�}� �%�3�����.)�Nh�9A�',�_S?_9�ٞM�a�w�g���������u��HDO���~�;!W��~��r�U�B˳�F���
+��T]XY���X�8Wx �$�-#�D+���`X��R��s:H��_�1*����&��������4VT�2b�b~Z��L#�� ��Ix��m����4|ĴS����h�i�%��V��zb��:�c�M-�$�-/�u.6V��-�Y��݄ޕ/�vx�ˢ��f*@S#�!T�
+��ըN�e���)�M�*0𮇯���H���Dk
+�]u�\�^bF��Љ�Sy��j�9�V���&K{ �b>k�h����-��kBK���c����Z-
+v*xQ�诐���E?���������yO��9��7���1�/�`��o���2��%�N8�o��)��*������r��i=�;�c.�7��r�w丗�g�J�}���ͫ&�}�T��ʾ&��T�]V=`V۪�Vۊ�yE��z�j�[OO�������w����x����S��B�b�)�]~����~���m���p[(<(/��N��*s��U_�ǃ�t���g�P�KL�����4vʹ�<��\^��C��B-�|9�΅u?������B/�?N�7�}����΅�@/w��
+~\�z_�.:nӅ^�6�}[��ӈ�bą�<��e�����v��/_Lz/_L��I_�xL�p�M˽V�����Ǵ�F���4�e1�Bxg}�i��y�MLU�d.�Yy�.�����2�i��p�#9Ş�{���x��1��[?~���;���ł�P����K�s��,�;oط�}�g�ߣ� {Lt�x,4ך��D@W�Zg@��T'� �*QMX�4pbSЖ�kGK'nx�_M�s�4p��ђ�A!�'�h��uϺ��S�qP�/��k�-
+��Z�D�-
+��YP��Hr7-
+�ĺZM F�iM��&B<�4p�JI��Dh��N۴d7��BK��2���`�0��Ml#N� �r��V�g��5�zs�4Tpⷣ'��\*���!���]4T�����S�\H��W�mDg������&��R�i���#EM����g4Tp�OCxsyd4Tp�GFCxs�<4Tt|��%>�Y�t
+F&"y�M&}c��Y�s�eyǻ-�uj�,��X?f!���;V0��ԉh,��8+���fĪ������$�ujm,���%�K��?ɬ�/����i���X��?-�V��������\�׃��]� d���s,�/�3��Qg��;�~` yԱn�DM����:^e�����l�q��dL���*�zL�h3���^��Z��&%]_�: 4���n��kEm��f�k�A=E��&K&:.��Ds3�IA7N��4�z�"�؛
+XSD��<��ղ2��z⍉�>2�!L�N?��
+J�L����@&����>�ڲ/����(
+��Ϯ�<e�Y��9�P~�3w;��PȎ��,��Dk̈́�)�&�^��Z/�`"���]u����O��&EAs��������Jb�SҜv?�Az�{m;x*������A��{h�������
+p�y�y�����/l2�f� �f�4C��|�*5��?L�
+��>�h}��.p2��7�Ә��>�d����DW��(@�@���Rӂ�������sk$���ܓ,���I��&����F���o�?�|��PK���"��PKۄw<Z�949pollen.argoPKۄw<����mpollen_Modèle.pgmlPKۄw<F;�!��@�pollen_Services.pgmlPKۄw<9ܜ='�pollen_Diagrammedeclasses.pgmlPKۄw<4�[-m�h#pollen.todoPKۄw<7Rp:B$pollen_profile.profilePKۄw<���"��
+�$pollen.xmiPK��G
\ No newline at end of file
Modified: trunk/pollen-business/src/test/java/org/chorem/pollen/business/TestData.java
===================================================================
--- trunk/pollen-business/src/test/java/org/chorem/pollen/business/TestData.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/TestData.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,6 +1,5 @@
package org.chorem.pollen.business;
-import org.chorem.pollen.business.utils.ContextUtil;
import org.nuiton.topia.TopiaContext;
/**
@@ -21,8 +20,7 @@
public void execute() throws Exception {
transaction = null;
try {
- transaction = TestManager.getContext().
- getRootContext().beginTransaction();
+ transaction = TestManager.beginTransaction();
test();
Modified: trunk/pollen-business/src/test/java/org/chorem/pollen/business/TestManager.java
===================================================================
--- trunk/pollen-business/src/test/java/org/chorem/pollen/business/TestManager.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/TestManager.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,6 +1,8 @@
package org.chorem.pollen.business;
+import org.chorem.pollen.PollenContextImplementor;
+import org.chorem.pollen.PollenContextImpl;
import java.io.IOException;
import java.io.InputStream;
import java.util.Calendar;
@@ -67,7 +69,7 @@
}
public static TopiaContext beginTransaction() throws TopiaException {
- return getContext().getRootContext().beginTransaction();
+ return getContext().getTopiaRootContext().beginTransaction();
}
}
Deleted: trunk/pollen-business/src/test/java/org/chorem/pollen/business/business/PreventRuleManagerTest.java
===================================================================
--- trunk/pollen-business/src/test/java/org/chorem/pollen/business/business/PreventRuleManagerTest.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/business/PreventRuleManagerTest.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,115 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.business;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.chorem.pollen.business.dto.PreventRuleDTO;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests de la gestion des règles de notification.
- *
- * @author rannou
- * @version $Id$
- */
-public class PreventRuleManagerTest {
- private PreventRuleManager manager;
-
- public PreventRuleManagerTest() {
- }
-
- @BeforeClass
- public static void setUpClass() throws Exception {
- }
-
- @AfterClass
- public static void tearDownClass() throws Exception {
- }
-
- @Before
- public void setUp() {
- }
-
- @After
- public void tearDown() {
- }
-
- /**
- * Test of execute method, of class PreventRuleManager. Using PRINT_ACTION
- * not repeatable.
- */
- @Test
- public void testPrintAction() {
- PreventRuleDTO preventRule = new PreventRuleDTO("test", 2, false,
- PreventRuleManager.NULL_ACTION);
- manager = new PreventRuleManager(preventRule);
-
- assertTrue(manager.execute());
- assertTrue(manager.execute("test"));
- assertTrue(manager.execute(2));
- assertTrue(manager.execute("test", 2, "testPrintAction"));
-
- assertFalse(manager.execute("scope"));
- assertFalse(manager.execute(1));
- assertFalse(manager.execute("scope", 1, "testPrintAction"));
- assertFalse(manager.execute(4));
- }
-
- /**
- * Test of execute method, of class PreventRuleManager. Using PRINT_ACTION
- * repeatable.
- */
- @Test
- public void testPrintActionRepeat() {
- PreventRuleDTO preventRule = new PreventRuleDTO("test", 2, true,
- PreventRuleManager.NULL_ACTION);
- manager = new PreventRuleManager(preventRule);
-
- assertTrue(manager.execute());
- assertTrue(manager.execute(2));
- assertTrue(manager.execute(4));
-
- assertFalse(manager.execute(1));
- assertFalse(manager.execute(5));
- }
-
- /**
- * Test of execute method, of class PreventRuleManager. Using PRINT_ACTION
- * oneTime execution.
- */
- @Test
- public void testPrintActionOneTime() {
- PreventRuleDTO preventRule = new PreventRuleDTO("test", 2, false,
- PreventRuleManager.NULL_ACTION);
- preventRule.setOneTime(true);
- manager = new PreventRuleManager(preventRule);
-
- assertTrue(manager.execute(2));
- assertFalse(manager.execute(2));
-
- preventRule.setActive(true);
-
- assertTrue(manager.execute(2));
- assertFalse(manager.execute(2));
- }
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/test/java/org/chorem/pollen/business/scaling/ScalingVote.java
===================================================================
--- trunk/pollen-business/src/test/java/org/chorem/pollen/business/scaling/ScalingVote.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/scaling/ScalingVote.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,223 +0,0 @@
-/* *##% 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.business.scaling;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.TestManager;
-import org.chorem.pollen.business.persistence.Choice;
-import org.chorem.pollen.business.persistence.PersonToList;
-import org.chorem.pollen.business.persistence.Poll;
-import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.business.persistence.PollAccountDAO;
-import org.chorem.pollen.business.persistence.PollDAO;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.business.persistence.Vote;
-import org.chorem.pollen.business.persistence.VoteDAO;
-import org.chorem.pollen.business.persistence.VoteToChoice;
-import org.chorem.pollen.business.persistence.VoteToChoiceDAO;
-import org.chorem.pollen.business.persistence.VotingList;
-import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.TopiaContextFactory;
-import org.nuiton.topia.TopiaException;
-
-/**
- * TODO add comment here.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-public class ScalingVote {
-
- /** log. */
- private static final Log log = LogFactory.getLog(ScalingVote.class);
-
- /** Adresse de la base de données (surchage l'adresse dans src/test/resources) */
-// public static final String DB_URL = "jdbc:h2:" + System.getProperty("user.home") +
-// File.separator + ".pollen" + File.separator + "pollendb";
-
- /** La config en cours. */
- protected static Properties config;
-
- /**
- * Main.
- *
- * @param args
- */
- public static void main(String args[]) throws IOException {
-// System.out.println("Using database at : " + DB_URL);
-
-// ContextUtil contextUtil = ContextUtil.getInstance();
-// config = contextUtil.getConf();
- TestManager.start("ScalingVote");
-
-// config.setProperty("hibernate.connection.url", DB_URL);
-// config.remove("hibernate.hbm2ddl.auto");
-
- try {
- new ScalingVote().doInsertFixedNumber();
- }
- catch(Exception e) {
- if (log.isErrorEnabled()) {
- log.error("Can't insert mass mail", e);
- }
- }
- }
-
- /**
- * Insert a lot of vote into poll.
- *
- * This version find a poll with his name and add a vote
- * for each votant in voting list.
- *
- * @throws TopiaException
- */
- public void doInsertWithVotingList() throws TopiaException, IOException {
- TopiaContext context = TestManager.beginTransaction();
-
- PollDAO pollDAO = PollenModelDAOHelper.getPollDAO(context);
- VoteDAO voteDAO = PollenModelDAOHelper.getVoteDAO(context);
- VoteToChoiceDAO voteToChoiceDAO = PollenModelDAOHelper.getVoteToChoiceDAO(context);
-
- // find a poll with his name
- Poll poll = pollDAO.findByTitle("Test condorcet 3000 v2");
- VotingList votingLists = poll.getVotingList().get(0);
-
- for (PersonToList personList : votingLists.getPollAccountPersonToList()) {
-
- PollAccount pollAccount = personList.getPollAccount();
-
- // ne traite pas les email qui contienent 20
- // pour qu'il reste des choix de login ensuite
- if (pollAccount.getEmail().contains("20@")) {
- continue;
- }
- else {
- if (log.isInfoEnabled()) {
- log.info("Create vote for " + pollAccount.getEmail());
- }
- }
-
- Vote myNewVote = voteDAO.create();
- myNewVote.setVotingList(votingLists);
- myNewVote.setPollAccount(pollAccount);
- myNewVote.setPoll(poll);
- myNewVote.setWeight(new Double(1));
- myNewVote.setAnonymous(Boolean.FALSE);
-
- List<Choice> choices = new ArrayList<Choice>();
- choices.add(poll.getChoice().get(0));
-
- List<VoteToChoice> voteToChoices = new ArrayList<VoteToChoice>();
- VoteToChoice voteToChoice = voteToChoiceDAO.create();
- voteToChoice.setChoice(poll.getChoice().get(0));
- voteToChoice.setVoteValue(1);
- voteToChoice.setVote(myNewVote);
- voteToChoices.add(voteToChoice);
-
- VoteToChoice voteToChoice2 = voteToChoiceDAO.create();
- voteToChoice2.setChoice(poll.getChoice().get(1));
- voteToChoice2.setVoteValue(2);
- voteToChoice2.setVote(myNewVote);
- voteToChoices.add(voteToChoice2);
-
- myNewVote.setChoiceVoteToChoice(voteToChoices);
- myNewVote.update();
- poll.getVote().add(myNewVote);
- }
-
- poll.update();
- context.commitTransaction();
- context.closeContext();
-
- TestManager.stop();
- }
-
- /**
- * Insert a lot of vote into poll.
- *
- * This version find a poll with his name and add a vote
- * for each votant in voting list.
- *
- * @throws TopiaException
- */
- public void doInsertFixedNumber() throws TopiaException, IOException {
- TopiaContext context = TestManager.beginTransaction();
-
- PollDAO pollDAO = PollenModelDAOHelper.getPollDAO(context);
- VoteDAO voteDAO = PollenModelDAOHelper.getVoteDAO(context);
- PollAccountDAO pollAccountDAO = PollenModelDAOHelper.getPollAccountDAO(context);
- VoteToChoiceDAO voteToChoiceDAO = PollenModelDAOHelper.getVoteToChoiceDAO(context);
-
- // find a poll with his name
- Poll poll = pollDAO.findByTitle("test pagination 3000");
-
- for (int i = 1 ; i <= 4200 ; ++i) {
-
- PollAccount pollAccount = pollAccountDAO.create();
- pollAccount.setVotingId("Test " + i);
-
- if (log.isInfoEnabled()) {
- log.info("Create vote for " + pollAccount.getVotingId());
- }
-
- Vote myNewVote = voteDAO.create();
- myNewVote.setPollAccount(pollAccount);
- myNewVote.setPoll(poll);
- myNewVote.setWeight(new Double(1));
- myNewVote.setAnonymous(Boolean.FALSE);
-
- List<Choice> choices = new ArrayList<Choice>();
- choices.add(poll.getChoice().get(0));
-
- List<VoteToChoice> voteToChoices = new ArrayList<VoteToChoice>();
-
- if (i % 2 == 0) {
- VoteToChoice voteToChoice = voteToChoiceDAO.create();
- voteToChoice.setChoice(poll.getChoice().get(0));
- voteToChoice.setVoteValue(1);
- voteToChoice.setVote(myNewVote);
- voteToChoices.add(voteToChoice);
- }
- else {
- VoteToChoice voteToChoice2 = voteToChoiceDAO.create();
- voteToChoice2.setChoice(poll.getChoice().get(1));
- voteToChoice2.setVoteValue(2);
- voteToChoice2.setVote(myNewVote);
- voteToChoices.add(voteToChoice2);
- }
-
- myNewVote.setChoiceVoteToChoice(voteToChoices);
- myNewVote.update();
- poll.getVote().add(myNewVote);
-
- }
- poll.update();
- context.commitTransaction();
- context.closeContext();
-
- TestManager.stop();
- }
-}
Deleted: trunk/pollen-business/src/test/java/org/chorem/pollen/business/scaling/package-info.java
===================================================================
--- trunk/pollen-business/src/test/java/org/chorem/pollen/business/scaling/package-info.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/scaling/package-info.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,20 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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/>. ##%*/
-
-/**
- * Ensemble de classes pour injecter des données et faire de la montée en charge.
- */
-package org.chorem.pollen.business.scaling;
Deleted: trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/SendMailTest.java
===================================================================
--- trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/SendMailTest.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/SendMailTest.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,105 +0,0 @@
-/* *##% 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.business.services;
-
-import org.chorem.pollen.business.services.SendMail;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.chorem.pollen.business.PollenContextImpl;
-import org.chorem.pollen.business.PollenProperty;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.nuiton.util.ApplicationConfig;
-
-/**
- * Class for send mail storage class.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-@Ignore
-public class SendMailTest {
-
- protected static SendMail sendMail;
-
- protected static PollenContextImpl context;
-
- @BeforeClass
- public static void init() throws InterruptedException {
-
- ApplicationConfig config = new ApplicationConfig();
- config.setOption(PollenProperty.EMAIL_DIR.getKey(), "target" + File.separator + "massmail");
- config.setOption(PollenProperty.EMAIL_HOST.getKey(), "smtp");
- config.setOption(PollenProperty.EMAIL_PORT.getKey(), "25");
- config.setOption(PollenProperty.EMAIL_FROM.getKey(), "pollenreminder(a)codelutin.com");
-
- context.loadConfiguration(config);
-
- sendMail = new SendMail(context);
- sendMail.start();
- Thread.sleep(3000);
- }
-
- /**
- * Test to add mail and send mail.
- *
- * WARNING : This test really send mail, don't set it automatic.
- *
- * @throws IOException
- * @throws InterruptedException
- */
- @Test
- public void testAddMail() throws IOException, InterruptedException {
- List<Map<String, String>> mailList = new ArrayList<Map<String,String>>();
-
- Map<String, String> mailMap = new HashMap<String, String>();
- mailMap.put("receiver", "chatellier+test(a)codelutin.com");
- mailMap.put("subject", "Test 18:00");
- mailMap.put("body", "Test body");
-
- Map<String, String> mailMap2 = new HashMap<String, String>();
- mailMap2.put("receiver", "chorlet+test(a)codelutin.com");
- mailMap2.put("subject", "CR, CR CR !!! 18:00");
- mailMap2.put("body", "Des cr, encore des \"CRs\" !!!");
-
- mailList.add(mailMap);
- mailList.add(mailMap2);
-
- sendMail.prepareMails("test", mailList);
-
- String emailDir = context.getProperty(PollenProperty.EMAIL_DIR);
-
- Assert.assertTrue(new File(emailDir, "test.mail").exists());
- Assert.assertTrue(new File(emailDir, "test.index").exists());
- sendMail.wakeUp();
-
- // TODO , en 5 secondes, il aura le temps d'envoyer 2 mails ?
- Thread.sleep(5000);
- Assert.assertFalse(new File(emailDir, "test.mail").exists());
- Assert.assertFalse(new File(emailDir, "test.index").exists());
- }
-}
Deleted: trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceAuthImplTest.java
===================================================================
--- trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceAuthImplTest.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceAuthImplTest.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,97 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import org.chorem.pollen.business.PollenBusinessException;
-import org.chorem.pollen.business.TestManager;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.utils.ContextUtil;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests du service d'authentification.
- *
- * @author rannou
- * @version $Id$
- */
-public class ServiceAuthImplTest {
- private ServiceAuthImpl instance;
-
- @BeforeClass
- public static void setUpClass() throws Exception {
- TestManager.start("ServiceAuthImplTest");
- }
-
- @AfterClass
- public static void tearDownClass() throws Exception {
- TestManager.stop();
- }
-
- @Before
- public void setUp() {
- instance = new ServiceAuthImpl(TestManager.getContext());
- }
-
- @After
- public void tearDown() {
- }
-
- /**
- * Test of isLoginRight method, of class ServiceAuthImpl.
- */
- @Test
- public void testIsLoginRight() {
- String login = "login_isLoginRight";
- String password = "password_isLoginRight";
- boolean result1 = instance.isLoginRight(login, password);
- assertFalse(result1);
-
- UserDTO dto = new UserDTO();
- dto.setLogin(login);
- ServiceUser smu = new ServiceUserImpl(TestManager.getContext());
- smu.createUser(dto, password);
- boolean result2 = instance.isLoginRight(login, password);
- assertTrue(result2);
- }
-
- /**
- * Test of getUser method, of class ServiceAuthImpl.
- */
- @Test
- public void testGetUser() {
- String login = "login_getUser";
- String password = "password_getUser";
- UserDTO result1 = instance.getUser(login, password);
- assertNull(result1);
-
- UserDTO dto = new UserDTO();
- dto.setLogin(login);
- ServiceUser smu = new ServiceUserImpl(TestManager.getContext());
- smu.createUser(dto, password);
- UserDTO result2 = instance.getUser(login, password);
- assertEquals(login, result2.getLogin());
- }
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceListImplTest.java
===================================================================
--- trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceListImplTest.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceListImplTest.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,243 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.TestData;
-import org.chorem.pollen.business.TestManager;
-import org.chorem.pollen.business.dto.PersonListDTO;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.VotingListDTO;
-import org.chorem.pollen.business.persistence.PersonList;
-import org.chorem.pollen.business.persistence.PersonListDAO;
-import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.business.persistence.PollAccountDAO;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests du service de gestion des listes.
- *
- * @author enema
- * @author rannou
- * @version $Id$
- */
-public class ServiceListImplTest {
- private ServiceListImpl instance;
-
- /** log. */
- private static final Log log = LogFactory.getLog(ServiceListImplTest.class);
-
- public ServiceListImplTest() {
- }
-
- @BeforeClass
- public static void setUpClass() throws Exception {
- TestManager.start("ServiceListImplTest");
- }
-
- @AfterClass
- public static void tearDownClass() throws Exception {
- TestManager.stop();
- }
-
- @Before
- public void setUp() {
- instance = new ServiceListImpl(TestManager.getContext());
- }
-
- @After
- public void tearDown() {
- }
-
- /**
- * Test of createVotingList method, of class ServiceListImpl.
- */
- @Test
- public void testCreateVotingList() {
- VotingListDTO votingList = new VotingListDTO();
- votingList.setName("test_createVotingList");
- String result = instance.createVotingList(votingList);
- if (log.isDebugEnabled()) {
- log.debug("result: " + result);
- }
- assertTrue(result.length() > 0);
- }
-
- /**
- * Test of updateVotingList method, of class ServiceListImpl.
- */
- @Test
- public void testUpdateVotingList() {
- String votingListId = "";
- VotingListDTO dto = new VotingListDTO();
- dto.setName("test_UpdateVotingList");
- votingListId = instance.createVotingList(dto);
- dto.setId(votingListId);
- dto.setName("new name");
- boolean result = instance.updateVotingList(dto);
- assertTrue(result);
- }
-
- /**
- * Test of createPersonList method, of class ServiceListImpl.
- */
- @Test
- public void testCreatePersonList() {
- PersonListDTO dto = new PersonListDTO();
- dto.setName("test_createPersonList");
- String result = instance.createPersonList(dto);
- assertTrue(result.length() > 0);
- }
-
- /**
- * Test of updatePersonList method, of class ServiceListImpl.
- * @throws Exception
- */
- @Test
- public void testCreateAccountInPersonList() throws Exception {
- // temp stop, must refactor all tests from this class
- TestManager.stop();
- TestManager.start("createAccountInPersonList");
- instance = new ServiceListImpl(TestManager.getContext());
-
- /** PREPARE DATA **/
- PersonListDTO dto = new PersonListDTO();
- dto.setName("list");
- final String personListId = instance.createPersonList(dto);
- dto.setId(personListId);
-
- final PollAccountDTO account = new PollAccountDTO();
- account.setVotingId("Jack Pot");
- account.setEmail("jackpot(a)pompedup.fr");
-
- /** EXEC METHOD **/
- instance.createAccountInPersonList(dto, account);
- Assert.assertNotNull(account.getAccountUId());
- Assert.assertNotNull(account.getId());
- Assert.assertEquals(1, dto.getPollAccounts().size());
-
- TestData test = new TestData() {
-
- @Override
- protected void test() throws Exception {
- PollAccountDAO dao =
- PollenModelDAOHelper.getPollAccountDAO(transaction);
-
- PollAccount eAccount = dao.findByTopiaId(account.getId());
- Assert.assertNotNull(eAccount);
- Assert.assertNotNull(eAccount.getPersonList());
- Assert.assertEquals(personListId,
- eAccount.getPersonList().getTopiaId());
- }
-
- };
-
- test.execute();
-
- // temp stop, must refactor all tests from this class
- TestManager.stop();
- }
-
-
- /**
- * Test of updatePersonList method, of class ServiceListImpl.
- */
- @Test
- public void testDeleteAccountFromPersonList() throws Exception {
- // temp stop, must refactor all tests from this class
- TestManager.stop();
- TestManager.start("deleteAccountFromPersonList");
- instance = new ServiceListImpl(TestManager.getContext());
-
- /** PREPARE DATA **/
- PersonListDTO dto = new PersonListDTO();
- dto.setName("list");
- final String personListId = instance.createPersonList(dto);
- dto.setId(personListId);
-
- final PollAccountDTO account = new PollAccountDTO();
- account.setVotingId("Jack Pot");
- account.setEmail("jackpot(a)pompedup.fr");
-
- instance.createAccountInPersonList(dto, account);
-
- /** EXEC METHOD **/
- instance.deleteAccountFromPersonList(dto, account.getId());
-
- TestData test = new TestData() {
-
- @Override
- protected void test() throws Exception {
- PollAccountDAO dao =
- PollenModelDAOHelper.getPollAccountDAO(transaction);
-
- PollAccount eAccount = dao.findByTopiaId(account.getId());
- Assert.assertNull(eAccount);
-
- PersonListDAO listDAO =
- PollenModelDAOHelper.getPersonListDAO(transaction);
-
- PersonList ePersonList = listDAO.findByTopiaId(personListId);
- Assert.assertEquals(0, ePersonList.getPollAccount().size());
- }
-
- };
-
- test.execute();
-
- // temp stop, must refactor all tests from this class
- TestManager.stop();
- }
-
- /**
- * Test of deletePersonList method, of class ServiceListImpl.
- */
- @Test
- public void testDeletePersonList() {
- PersonListDTO dto = new PersonListDTO();
- dto.setName("Test_DeletePersonList");
- String personListId = instance.createPersonList(dto);
- dto.setId(personListId);
- boolean result = instance.deletePersonList(personListId);
- assertTrue(result);
- }
-
- /**
- * Test of findPersonListById method, of class ServiceListImpl.
- */
- @Test
- public void testFindPersonListById() {
- PersonListDTO dto = new PersonListDTO();
- dto.setName("test_findPersonListById");
- String personListId = instance.createPersonList(dto);
- PersonListDTO result = instance.findPersonListById(personListId);
- String resultId = result.getId();
- assertEquals(personListId, resultId);
- }
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServicePollImplTest.java
===================================================================
--- trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServicePollImplTest.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServicePollImplTest.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,618 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import org.chorem.pollen.business.dto.CommentDTO;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Date;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.TestData;
-import org.chorem.pollen.business.TestManager;
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.dto.PollAccountDTO;
-import org.chorem.pollen.business.dto.PollDTO;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.dto.VoteDTO;
-import org.chorem.pollen.business.persistence.Choice;
-import org.chorem.pollen.business.persistence.ChoiceDAO;
-import org.chorem.pollen.business.persistence.Comment;
-import org.chorem.pollen.business.persistence.CommentDAO;
-import org.chorem.pollen.business.persistence.Poll;
-import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
-import org.chorem.pollen.common.ChoiceType;
-import org.chorem.pollen.common.PollType;
-import org.chorem.pollen.common.VoteCountingType;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests du service de gestion des sondages.
- *
- * @author enema
- * @version $Id$
- */
-public class ServicePollImplTest {
-
- private ServicePollImpl instance;
- /** log. */
- private static final Log log = LogFactory.getLog(ServicePollImplTest.class);
-
- public ServicePollImplTest() {
- }
-
- @BeforeClass
- public static void setUpClass() throws Exception {
- }
-
- @AfterClass
- public static void tearDownClass() throws Exception {
- }
-
- @Before
- public void setUp() {
- }
-
- @After
- public void tearDown() throws IOException {
- TestManager.stop();
- //BinderProvider.clear();
- }
-
- /**
- * Test of createPoll method, of class ServicePollImpl.
- * @throws Exception
- */
- @Test
- public void testCreatePoll() throws Exception {
- TestManager.start("testCreatePoll");
- instance = new ServicePollImpl(TestManager.getContext());
-
- PollDTO dto = instance.getNewPoll();
- dto.setBeginChoiceDate(new Date());
- dto.setBeginDate(new Date());
- dto.setChoiceType(ChoiceType.TEXT);
- dto.setCreatorName("erwan");
- dto.setDescription("Test_createPoll");
- dto.setEndDate(new Date());
- dto.setAnonymous(false);
- dto.setAnonymousVoteAllowed(false);
- dto.setChoiceAddAllowed(false);
- dto.setClosed(false);
- dto.setMaxChoiceNb(3);
- dto.setPollType(PollType.RESTRICTED);
- dto.setVoteCounting(VoteCountingType.NORMAL);
- dto.setTitle("Test_createPoll");
-
- List<ChoiceDTO> choices = new ArrayList<ChoiceDTO>();
- ChoiceDTO choice1 = new ChoiceDTO();
- choice1.setName("choice1");
- choices.add(choice1);
- ChoiceDTO choice2 = new ChoiceDTO();
- choice2.setName("choice2");
- choices.add(choice2);
- ChoiceDTO choice3 = new ChoiceDTO();
- choice3.setName("choice3");
- choices.add(choice3);
-
- dto.setChoices(choices);
-
- instance.createPoll(dto);
- final String result = dto.getId();
- if (log.isDebugEnabled()) {
- log.debug("result: " + result);
- }
- Assert.assertNotNull(result);
-
- TestData test = new TestData() {
-
- @Override
- protected void test() throws Exception {
- Poll entity = PollenModelDAOHelper.getPollDAO(transaction).
- findByTopiaId(result);
- Assert.assertNotNull(entity);
-
- Assert.assertEquals(3, entity.getChoice().size());
- Assert.assertNotNull(entity.getCreator());
- Assert.assertEquals("erwan", entity.getCreator().getVotingId());
- Assert.assertNotNull(entity.getCreator().getAccountId());
- }
- };
-
- test.execute();
- }
-
- /**
- * Test of updatePoll method, of class ServicePollImpl.
- */
- @Test
- public void testUpdatePoll() throws Exception {
- TestManager.start("testUpdatePoll");
- instance = new ServicePollImpl(TestManager.getContext());
-
- String pollId = "";
- PollDTO dto = instance.getNewPoll();
- dto.setDescription("Test_updatePoll");
- dto.setTitle("Test_updatePoll");
- dto.setCreatorId("erwan");
- dto.setAnonymous(false);
- dto.setPollType(PollType.FREE);
- dto.setChoiceType(ChoiceType.TEXT);
- dto.setVoteCounting(VoteCountingType.NORMAL);
- pollId = instance.createPoll(dto);
- dto.setId(pollId);
- dto.setDescription("new description");
- boolean result = instance.updatePoll(dto);
- assertTrue(result);
- }
-
- /**
- * Test of deletePoll method, of class ServicePollImpl.
- */
- @Test
- public void testDeletePoll() throws Exception {
- TestManager.start("testDeletePoll");
- instance = new ServicePollImpl(TestManager.getContext());
-
- PollDTO dto = instance.getNewPoll();
- dto.setDescription("Test_deletePoll");
- dto.setCreatorId("erwan");
- dto.setAnonymous(false);
- dto.setPollType(PollType.FREE);
- dto.setChoiceType(ChoiceType.TEXT);
- dto.setVoteCounting(VoteCountingType.NORMAL);
- String pollId = instance.createPoll(dto);
- boolean result = instance.deletePoll(pollId);
- assertTrue(result);
- }
-
- /**
- * Test of findPollByPollId method, of class ServicePollImpl.
- */
- @Test
- public void testFindPollByPollId() throws Exception {
- TestManager.start("testFindPollByPollId");
- instance = new ServicePollImpl(TestManager.getContext());
-
- String pollId = "";
- PollDTO dto = instance.getNewPoll();
- dto.setDescription("Test_findPollByPollId");
- dto.setTitle("Test_findPollByPollId");
- dto.setAnonymous(false);
- dto.setPollType(PollType.FREE);
- dto.setChoiceType(ChoiceType.TEXT);
- dto.setVoteCounting(VoteCountingType.NORMAL);
- pollId = instance.createPoll(dto);
- String pollUID = dto.getPollUId();
- log.debug("pollUID : " + pollUID);
- PollDTO result = instance.getPoll(pollUID);
- log.debug("title : " + result.getTitle());
- assertEquals(pollId, result.getId());
- assertEquals(VoteCountingType.NORMAL, result.getVoteCounting());
- }
-
- /**
- * Test of findPollsByName method, of class ServicePollImpl.
- */
-// @Test
-// public void testFindPollsByName() throws Exception {
-// TestManager.start("testFindPollsByName");
-// instance = new ServicePollImpl();
-//
-// PollDTO dto = instance.getNewPoll();
-// dto.setDescription("Test_findPollsByName");
-// dto.setCreatorId("erwan");
-// dto.setAnonymous(false);
-// dto.setPollType(PollType.FREE);
-// dto.setChoiceType(ChoiceType.TEXT);
-// dto.setVoteCounting(VoteCountingType.NORMAL);
-// dto.setTitle("Test_findPollsByName");
-// String pollId = instance.createPoll(dto);
-// List<PollDTO> result = instance.findPollsByName("Test_findPollsByName");
-// assertEquals(result.size(), 1);
-// }
-
- /**
- * Test of findPollsByUser method, of class ServicePollImpl.
- */
- @Test
- public void testFindPollsByUser() throws Exception {
- TestManager.start("testFindPollsByUser");
- instance = new ServicePollImpl(TestManager.getContext());
-
- // création de l'utilisateur
- UserDTO user = new UserDTO();
- user.setLogin("login_findPollsByUser");
- user.setEmail("email_findPollsByUser");
- ServiceUser su = new ServiceUserImpl(TestManager.getContext());
- String userId = su.createUser(user, "password");
-
- // création du sondage
- PollDTO poll = instance.getNewPoll();
- poll.setTitle("Test_findPollsByUser");
- poll.setUserId(userId);
- poll.setPollType(PollType.FREE);
- poll.setChoiceType(ChoiceType.TEXT);
- poll.setVoteCounting(VoteCountingType.NORMAL);
- String pollId = instance.createPoll(poll);
-
- // recherche des sondages de l'utilisateur
- List<PollDTO> result = instance.findPollsByUser(userId);
- assertEquals(result.size(), 1);
- }
-
- /**
- * Test of findParticipatedPolls method, of class ServicePollImpl.
- */
- @Test
- public void testFindParticipatedPolls() throws Exception {
- TestManager.start("testFindParticipatedPolls");
- instance = new ServicePollImpl(TestManager.getContext());
-
- // création de l'utilisateur
- UserDTO user = new UserDTO();
- user.setLogin("login_findParticipatedPolls");
- user.setEmail("email_findParticipatedPolls");
- ServiceUser su = new ServiceUserImpl(TestManager.getContext());
- String userId = su.createUser(user, "password");
-
- // création du compte associé à l'utilisateur
- PollAccountDTO account = new PollAccountDTO();
- account.setUserId(userId);
- ServicePollAccount spa = new ServicePollAccountImpl(TestManager.getContext());
- String accountId = spa.createPollAccount(account);
-
- // création du sondage
- PollDTO poll = instance.getNewPoll();
- poll.setTitle("Test_findParticipatedPolls");
- poll.setPollType(PollType.FREE);
- poll.setChoiceType(ChoiceType.TEXT);
- poll.setVoteCounting(VoteCountingType.NORMAL);
- String pollId = instance.createPoll(poll);
-
- // création du vote
- VoteDTO vote = new VoteDTO(accountId, pollId, null);
- ServiceVote sv = new ServiceVoteImpl(TestManager.getContext());
- sv.createVote(vote, account);
-
- // recherche des sondages de l'utilisateur
- List<PollDTO> result = instance.findParticipatedPolls(userId);
- assertEquals(result.size(), 1);
- }
-
- /**
- * Test of findRunningPolls method, of class ServicePollImpl.
- */
- @Test
- public void testFindRunningPolls() throws Exception {
- TestManager.start("testFindRunningPolls");
- instance = new ServicePollImpl(TestManager.getContext());
-
- Date now = TestManager.getContext().getCurrentDate();
-
- // sondage en cours sans date de fin
- PollDTO poll1 = instance.getNewPoll();
- poll1.setTitle("Test_findRunningPolls1");
- poll1.setPollType(PollType.FREE);
- poll1.setChoiceType(ChoiceType.TEXT);
- poll1.setVoteCounting(VoteCountingType.NORMAL);
- instance.createPoll(poll1);
-
- // sondage en cours
- PollDTO poll2 = instance.getNewPoll();
- poll2.setTitle("Test_findRunningPolls2");
- poll2.setEndDate(new Date(now.getTime() + 100000));
- poll2.setPollType(PollType.FREE);
- poll2.setChoiceType(ChoiceType.TEXT);
- poll2.setVoteCounting(VoteCountingType.NORMAL);
- instance.createPoll(poll2);
-
- // sondage terminé
- PollDTO poll3 = instance.getNewPoll();
- poll3.setTitle("Test_findRunningPolls3");
- poll3.setEndDate(new Date(now.getTime() - 100000));
- poll3.setPollType(PollType.FREE);
- poll3.setChoiceType(ChoiceType.TEXT);
- poll3.setVoteCounting(VoteCountingType.NORMAL);
- instance.createPoll(poll3);
-
- // sondage pas commencé
- PollDTO poll4 = instance.getNewPoll();
- poll4.setTitle("Test_findRunningPolls4");
- poll4.setBeginDate(new Date(now.getTime() + 100000));
- poll4.setPollType(PollType.FREE);
- poll4.setChoiceType(ChoiceType.TEXT);
- poll4.setVoteCounting(VoteCountingType.NORMAL);
- instance.createPoll(poll4);
-
- List<PollDTO> result1 = instance.findRunningPolls(true);
- List<PollDTO> result2 = instance.findRunningPolls(false);
- assertTrue(result2.size() > result1.size());
- assertTrue(result1.size() > 0);
- }
-
- /**
- * Test of selectPolls method, of class ServicePollImpl.
- */
- @Test
- public void testSelectPolls() throws Exception {
- TestManager.start("testSelectPolls");
- instance = new ServicePollImpl(TestManager.getContext());
-
- PollDTO dto = instance.getNewPoll();
- dto.setDescription("test selectPolls");
- dto.setTitle("selectPolls");
- dto.setAnonymous(false);
- dto.setPollType(PollType.FREE);
- dto.setChoiceType(ChoiceType.TEXT);
- dto.setVoteCounting(VoteCountingType.NORMAL);
- instance.createPoll(dto);
- List<PollDTO> result = instance.selectPolls(null);
- assertTrue(result.size() > 0);
- }
-
- /**
- * Test of findInvitedPolls method, of class ServicePollImpl.
- */
- //@Test
- public void testFindInvitedPolls() {
- System.out.println("findInvitedPolls");
- }
-
- /**
- * Test of addVoteToPoll method, of class ServicePollImpl.
- */
- //@Test
- public void testAddVoteToPoll() {
- System.out.println("addVoteToPoll");
- }
-
- /**
- * Test of createComment method, of class ServicePollImpl.
- */
- @Test
- public void testCreateComment() throws Exception {
- TestManager.start("testCreateComment");
- instance = new ServicePollImpl(TestManager.getContext());
-
- /** PREPARE DATA **/
- PollDTO poll = instance.getNewPoll();
- poll.setTitle("createComment");
- poll.setPollType(PollType.FREE);
- poll.setChoiceType(ChoiceType.TEXT);
- poll.setVoteCounting(VoteCountingType.NORMAL);
- instance.createPoll(poll);
- final String pollId = poll.getId();
-
- /** EXEC METHOD **/
- final CommentDTO comment = new CommentDTO();
- comment.setAuthor("Jack Pot");
- comment.setText("Un petit commentaire");
- comment.setPostDate(new Date());
-
- instance.createComment(poll, comment);
-
- Assert.assertEquals(1, poll.getComments().size());
- Assert.assertNotNull(comment.getId());
-
- // Test if the comment entity exist in database
- TestData test = new TestData() {
-
- @Override
- protected void test() throws Exception {
- CommentDAO dao = PollenModelDAOHelper.getCommentDAO(transaction);
- Comment result = dao.findByTopiaId(comment.getId());
- Assert.assertNotNull(result);
- Assert.assertNotNull(result.getPoll());
- Assert.assertEquals(pollId, result.getPoll().getTopiaId());
- }
- };
-
- test.execute();
-
- }
-
- /**
- * Test of deleteComment method, of class ServicePollImpl.
- */
- @Test
- public void testDeleteComment() throws Exception {
- TestManager.start("testDeleteComment");
- instance = new ServicePollImpl(TestManager.getContext());
-
- /** PREPARE DATA **/
- PollDTO poll = instance.getNewPoll();
- poll.setTitle("deleteComment");
- poll.setPollType(PollType.FREE);
- poll.setChoiceType(ChoiceType.TEXT);
- poll.setVoteCounting(VoteCountingType.NORMAL);
- instance.createPoll(poll);
-
- final CommentDTO comment = new CommentDTO();
- comment.setAuthor("Jack Pot");
- comment.setText("Un petit commentaire");
- comment.setPostDate(new Date());
- instance.createComment(poll, comment);
-
- /** EXEC METHOD **/
-
- instance.deleteComment(poll, comment.getId());
-
- Assert.assertEquals(0, poll.getComments().size());
-
- // Test if the comment entity not exist anymore in database
- TestData test = new TestData() {
-
- @Override
- protected void test() throws Exception {
- CommentDAO dao = PollenModelDAOHelper.getCommentDAO(transaction);
- Comment result = dao.findByTopiaId(comment.getId());
- Assert.assertNull(result);
- }
- };
-
- test.execute();
- }
-
- /**
- * Test of getRestrictedAccount method, of class ServicePollImpl.
- */
- //@Test
- public void testGetRestrictedAccount() throws IOException {
- TestManager.start("testGetRestrictedAccount");
- instance = new ServicePollImpl(TestManager.getContext());
-
- /** PREPARE DATA **/
- PollDTO poll = instance.getNewPoll();
- poll.setTitle("restrictedAccount");
- poll.setPollType(PollType.RESTRICTED);
- poll.setChoiceType(ChoiceType.TEXT);
- poll.setVoteCounting(VoteCountingType.NORMAL);
- instance.createPoll(poll);
-
- PollAccountDTO account = new PollAccountDTO();
- account.setVotingId("toto");
-
- // TODO
-
- }
-
- /**
- * Test of getNewPoll method, of class ServicePollImpl.
- */
- //@Test
- public void testGetNewPoll_0args() {
- System.out.println("getNewPoll");
- }
-
- /**
- * Test of getNewPoll method, of class ServicePollImpl.
- */
- //@Test
- public void testGetNewPoll_PollDTO() {
- System.out.println("getNewPoll");
- }
-
- /**
- * Test of getPoll method, of class ServicePollImpl.
- */
- //@Test
- public void testGetPoll() {
- System.out.println("getPoll");
- }
-
- /**
- * Test of getComments method, of class ServicePollImpl.
- */
- //@Test
- public void testGetComments() {
- System.out.println("getComments");
- }
-
- /**
- * Test of getNewHiddenChoice method, of class ServicePollImpl.
- */
- //@Test
- public void testGetNewHiddenChoice() throws IOException {
- TestManager.start("testGetNewHiddenChoice");
- instance = new ServicePollImpl(TestManager.getContext());
-
- // TODO
-
- //ChoiceDTO choice = instance.getNewHiddenChoice(null, null)
- }
-
- /**
- * Test of createChoice method, of class ServicePollImpl.
- * @throws IOException
- */
- @Test
- public void testCreateChoice() throws IOException {
- TestManager.start("testCreateChoice");
- instance = new ServicePollImpl(TestManager.getContext());
-
- /** PREPARE DATA **/
- PollDTO poll = instance.getNewPoll();
- poll.setTitle("createChoice");
- poll.setPollType(PollType.FREE);
- poll.setChoiceType(ChoiceType.TEXT);
- poll.setVoteCounting(VoteCountingType.NORMAL);
- instance.createPoll(poll);
-
- /** EXEC METHOD **/
- ChoiceDTO choice = new ChoiceDTO();
- choice.setName("CHOICE1");
- choice.setDescription("description");
-
- // No constraint for creation
- instance.createChoice(poll, choice);
-
- Assert.assertNotNull(choice.getId());
- Assert.assertEquals(1, poll.getChoices().size());
- Assert.assertEquals("CHOICE1", poll.getChoices().get(0).getName());
- }
-
- /**
- * Test of deleteChoice method, of class ServicePollImpl.
- * @throws Exception
- */
- @Test
- public void testDeleteChoice() throws Exception {
- TestManager.start("testDeleteChoice");
- instance = new ServicePollImpl(TestManager.getContext());
-
- /** PREPARE DATA **/
- PollDTO poll = instance.getNewPoll();
- poll.setTitle("createChoice");
- poll.setPollType(PollType.FREE);
- poll.setChoiceType(ChoiceType.TEXT);
- poll.setVoteCounting(VoteCountingType.NORMAL);
- instance.createPoll(poll);
-
- final ChoiceDTO choice = new ChoiceDTO();
- choice.setName("CHOICE1");
- choice.setDescription("description");
- instance.createChoice(poll, choice);
-
- /** EXEC METHOD **/
- instance.deleteChoice(poll, choice.getId());
-
- Assert.assertEquals(0, poll.getChoices().size());
-
- // Test if the choice entity not exist anymore in database
- TestData test = new TestData() {
-
- @Override
- protected void test() throws Exception {
- ChoiceDAO dao = PollenModelDAOHelper.getChoiceDAO(transaction);
- Choice result = dao.findByTopiaId(choice.getId());
- Assert.assertNull(result);
- }
- };
-
- test.execute();
- }
-}
Deleted: trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServicePreventRuleImplTest.java
===================================================================
--- trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServicePreventRuleImplTest.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServicePreventRuleImplTest.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,149 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import java.io.IOException;
-import org.chorem.pollen.business.PollenBusinessException;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.TestManager;
-import org.chorem.pollen.business.dto.PreventRuleDTO;
-import org.chorem.pollen.business.utils.ContextUtil;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests de la gestion des règles de notification.
- *
- * @author rannou
- * @version $Id: ServicePreventRuleImplTest.java 2649 2009-07-15 16:30:23Z
- * nrannou $
- */
-public class ServicePreventRuleImplTest {
- private ServicePreventRuleImpl instance;
-
- /** log. */
- private static final Log log = LogFactory
- .getLog(ServicePreventRuleImplTest.class);
-
- public ServicePreventRuleImplTest() {
- }
-
- @BeforeClass
- public static void setUpClass() throws Exception {
- TestManager.start("ServicePreventRuleImplTest");
- }
-
- @AfterClass
- public static void tearDownClass() throws Exception {
- TestManager.stop();
- }
-
- @Before
- public void setUp() throws Exception {
- instance = new ServicePreventRuleImpl(TestManager.getContext());
- }
-
- @After
- public void tearDown() {
- }
-
- /**
- * Test of createPreventRule method, of class PreventRuleImpl.
- */
- @Test
- public void testCreatePreventRule() {
- PreventRuleDTO dto = new PreventRuleDTO();
- dto.setScope("test");
- dto.setSensibility(2);
- dto.setRepeated(false);
- dto.setMethod("test_CreatePreventRule");
- String result = instance.createPreventRule(dto);
- if (log.isDebugEnabled()) {
- log.debug("result: " + result);
- }
- assertTrue(result.length() > 0);
- }
-
- /**
- * Test of updatePreventRule method, of class PreventRuleImpl.
- */
- @Test
- public void testUpdatePreventRule() {
- PreventRuleDTO dto = new PreventRuleDTO();
- dto.setScope("test");
- dto.setSensibility(2);
- dto.setMethod("test_UpdatePreventRule");
- String preventRuleId = instance.createPreventRule(dto);
- dto.setId(preventRuleId);
- dto.setSensibility(3);
- boolean result = instance.updatePreventRule(dto);
- assertTrue(result);
- }
-
- /**
- * Test of deletePreventRule method, of class PreventRuleImpl.
- */
- @Test
- public void testDeletePreventRule() {
- PreventRuleDTO dto = new PreventRuleDTO();
- dto.setScope("test");
- dto.setSensibility(2);
- dto.setMethod("test_DeletePreventRule");
- String preventRuleId = instance.createPreventRule(dto);
- dto.setId(preventRuleId);
- boolean result = instance.deletePreventRule(preventRuleId);
- assertTrue(result);
- }
-
- /**
- * Test of findPreventRuleById method, of class PreventRuleImpl.
- */
- @Test
- public void testFindPreventRuleById() {
- PreventRuleDTO dto = new PreventRuleDTO();
- dto.setScope("test");
- dto.setSensibility(2);
- dto.setMethod("test_findPreventRuleById");
- String preventRuleId = instance.createPreventRule(dto);
- PreventRuleDTO result = instance.findPreventRuleById(preventRuleId);
- String resultId = result.getId();
- assertEquals(preventRuleId, resultId);
- }
-
- /**
- * Test of selectPreventRules method, of class PreventRuleImpl.
- */
- @Test
- public void testSelectPreventRules() {
- PreventRuleDTO dto = new PreventRuleDTO();
- dto.setScope("test");
- dto.setSensibility(2);
- dto.setMethod("test_selectPreventRules");
- String preventRuleId = instance.createPreventRule(dto);
- List<PreventRuleDTO> result = instance.selectPreventRules(null);
- assertTrue(result.size() > 1);
- }
-}
\ No newline at end of file
Deleted: trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceUserImplTest.java
===================================================================
--- trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceUserImplTest.java 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceUserImplTest.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -1,183 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import org.chorem.pollen.business.PollenBusinessException;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-
-import org.chorem.pollen.business.TestManager;
-import org.chorem.pollen.business.dto.UserDTO;
-import org.chorem.pollen.business.utils.ContextUtil;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests du service de gestion des utilisateurs.
- *
- * @author rannou
- * @version $Id$
- */
-public class ServiceUserImplTest {
- private ServiceUserImpl instance;
-
- @BeforeClass
- public static void setUpClass() throws Exception {
- TestManager.start("ServiceUserImplTest");
- }
-
- @AfterClass
- public static void tearDownClass() throws Exception {
- TestManager.stop();
- }
-
- @Before
- public void setUp() {
- instance = new ServiceUserImpl(TestManager.getContext());
- }
-
- @After
- public void tearDown() {
- }
-
- /**
- * Test of createUser method, of class ServiceUserImpl.
- */
- @Test
- public void testCreateUser() {
- UserDTO user = new UserDTO();
- user.setLogin("login_CreateUser");
- String result = instance.createUser(user, "password");
- assertTrue(result.length() > 0);
- }
-
- /**
- * Test of updateUser method, of class ServiceUserImpl.
- */
- @Test
- public void testUpdateUser() {
- UserDTO user = new UserDTO();
- user.setLogin("login_UpdateUser");
- String userId = instance.createUser(user, "password");
- user.setId(userId);
- user.setFirstName("firstName_UpdateUser");
- boolean result = instance.updateUser(user);
- assertTrue(result);
- }
-
- /**
- * Test of deleteUser method, of class ServiceUserImpl.
- */
- @Test
- public void testDeleteUser() {
-
- // delete with dto
- UserDTO user = new UserDTO();
- user.setLogin("login_DeleteUser");
- user.setId(instance.createUser(user, "password"));
- boolean result = instance.deleteUser(user);
- assertTrue(result);
-
- // delete with login
- UserDTO user2 = new UserDTO();
- user2.setLogin("login_DeleteUser");
- String userId2 = instance.createUser(user2, "password");
- boolean result2 = instance.deleteUser("login_DeleteUser");
- assertTrue(result2);
- }
-
- /**
- * Test of findUserById method, of class ServiceUserImpl.
- */
- @Test
- public void testFindUserById() {
- UserDTO user = new UserDTO();
- user.setLogin("login_FindUserById");
- String userId = instance.createUser(user, "password");
- UserDTO result = instance.findUserById(userId);
- String resultId = result.getId();
- assertEquals(userId, resultId);
- }
-
- /**
- * Test of selectUsers method, of class ServiceUserImpl.
- */
- @Test
- public void testSelectUsers() {
- UserDTO user = new UserDTO();
- user.setLogin("login_SelectUsers");
- String userId = instance.createUser(user, "password");
- List<UserDTO> result = instance.selectUsers(null);
- assertTrue(result.size() > 1);
- }
-
- /**
- * Test of updatePasswordUser method, of class ServiceUserImpl.
- */
- @Test
- public void testUpdatePasswordUser() {
- UserDTO user = new UserDTO();
- user.setLogin("login_UpdatePasswordUser");
- user.setId(instance.createUser(user, "password"));
- instance.updatePasswordUser(user, "newPassword");
-
- ServiceAuth sa = new ServiceAuthImpl(TestManager.getContext());
- UserDTO result = sa.getUser(user.getLogin(), "newPassword");
- assertNotNull(result);
- }
-
- /**
- * Test of isUserLoginExisting method, of class ServiceUserImpl.
- */
- @Test
- public void testIsUserLoginExisting() {
- UserDTO user = new UserDTO();
- user.setLogin("login_IsUserLoginExisting");
- user.setEmail("email_IsUserLoginExisting");
- String userId = instance.createUser(user, "password");
-
- boolean result = instance
- .isUserLoginExisting("login_IsUserLoginExisting");
- boolean result2 = instance.isUserLoginExisting("login_False");
- assertTrue(result);
- assertFalse(result2);
- }
-
- /**
- * Test of isUserEmailExisting method, of class ServiceUserImpl.
- */
- @Test
- public void testIsUserEmailExisting() {
- UserDTO user = new UserDTO();
- user.setLogin("login_IsUserEmailExisting");
- user.setEmail("email_IsUserEmailExisting");
- String userId = instance.createUser(user, "password");
-
- boolean result = instance
- .isUserEmailExisting("email_IsUserEmailExisting");
- boolean result2 = instance.isUserEmailExisting("email_False");
- assertTrue(result);
- assertFalse(result2);
- }
-}
\ No newline at end of file
Property changes on: trunk/pollen-topia-template
___________________________________________________________________
Added: svn:ignore
+ target
Added: trunk/pollen-topia-template/LICENSE.txt
===================================================================
--- trunk/pollen-topia-template/LICENSE.txt (rev 0)
+++ trunk/pollen-topia-template/LICENSE.txt 2010-03-23 15:39:36 UTC (rev 2956)
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
Added: trunk/pollen-topia-template/README.txt
===================================================================
--- trunk/pollen-topia-template/README.txt (rev 0)
+++ trunk/pollen-topia-template/README.txt 2010-03-23 15:39:36 UTC (rev 2956)
@@ -0,0 +1 @@
+TODO
Added: trunk/pollen-topia-template/changelog.txt
===================================================================
--- trunk/pollen-topia-template/changelog.txt (rev 0)
+++ trunk/pollen-topia-template/changelog.txt 2010-03-23 15:39:36 UTC (rev 2956)
@@ -0,0 +1 @@
+See changelog in pollen parent project.
Added: trunk/pollen-topia-template/pom.xml
===================================================================
--- trunk/pollen-topia-template/pom.xml (rev 0)
+++ trunk/pollen-topia-template/pom.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+
+ <parent>
+ <groupId>org.chorem</groupId>
+ <artifactId>pollen</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.chorem.pollen</groupId>
+ <artifactId>pollen-template</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.nuiton.eugene</groupId>
+ <artifactId>eugene</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.nuiton.topia</groupId>
+ <artifactId>topia-persistence</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>
+ </dependencies>
+
+ <!-- ************************************************************* -->
+ <!-- *** Project Information ************************************* -->
+ <!-- ************************************************************* -->
+
+ <name>Pollen :: Template</name>
+ <description>Templates de génération pour Pollen</description>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Settings ****************************************** -->
+ <!-- ************************************************************* -->
+
+ <packaging>jar</packaging>
+
+<build>
+
+<plugins>
+
+ <plugin>
+ <groupId>org.nuiton.processor</groupId>
+ <artifactId>maven-processor-plugin</artifactId>
+ </plugin>
+</plugins>
+</build>
+
+</project>
+
Copied: trunk/pollen-topia-template/src/main/java/org/chorem/pollen/template/PollenContextImplementor.java (from rev 2953, trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenContextImplementor.java)
===================================================================
--- trunk/pollen-topia-template/src/main/java/org/chorem/pollen/template/PollenContextImplementor.java (rev 0)
+++ trunk/pollen-topia-template/src/main/java/org/chorem/pollen/template/PollenContextImplementor.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -0,0 +1,70 @@
+
+package org.chorem.pollen.template;
+
+import org.nuiton.topia.TopiaContext;
+
+/**
+ * PollenContextImplementor
+ *
+ * Created: 20 mars 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public interface PollenContextImplementor /*extends PollenContext*/ {
+
+ /**
+ * Topia main context used to open new transaction.
+ *
+ * @return the topia root context
+ */
+ TopiaContext getRootContext();
+
+ /**
+ * Pollen converter used to convert entities to DTO.
+ *
+ * @return the current pollen converter
+ */
+// PollenConverter getConverter();
+
+ /**
+ * Manage exceptions. The {@code exception} will be embedded in a
+ * PollenException with the {@code message} provided.
+ * Used in catch statement in services.
+ *
+ * @param eee the exception to manage
+ * @param message the message to add to the new PollenException
+ * @param args for message
+ * @throws PollenException which contains the exception as the cause
+ */
+// void doCatch(Exception eee, String message, Object... args)
+// throws PollenException;
+
+ /**
+ * Manage exceptions. The {@code exception} will be embedded in a
+ * PollenException with the {@code message} provided. Also, the current
+ * {@code transaction} will be rollback.
+ * Used in catch statement in services.
+ *
+ * @param transaction the current TopiaContext
+ * @param eee the exception to manage
+ * @param message the message to add to the new PollenException
+ * @param args for message
+ * @throws PollenException
+ */
+// void doCatch(TopiaContext transaction, Exception eee, String message,
+// Object... args) throws PollenException;
+
+ /**
+ * Close current TopiaContext.
+ * Used in finally statement in services.
+ *
+ * @param transaction current TopiaContext
+ */
+// void doFinally(TopiaContext transaction);
+
+
+}
Property changes on: trunk/pollen-topia-template/src/main/java/org/chorem/pollen/template/PollenContextImplementor.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Added: svn:mergeinfo
+
Added: trunk/pollen-topia-template/src/main/java/org/chorem/pollen/template/PollenServiceTransformer.java
===================================================================
--- trunk/pollen-topia-template/src/main/java/org/chorem/pollen/template/PollenServiceTransformer.java (rev 0)
+++ trunk/pollen-topia-template/src/main/java/org/chorem/pollen/template/PollenServiceTransformer.java 2010-03-23 15:39:36 UTC (rev 2956)
@@ -0,0 +1,330 @@
+
+package org.chorem.pollen.template;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.eugene.GeneratorUtil;
+import org.nuiton.eugene.Template;
+import org.nuiton.eugene.java.ObjectModelTransformerToJava;
+import org.nuiton.eugene.models.object.ObjectModel;
+import org.nuiton.eugene.models.object.ObjectModelClass;
+import org.nuiton.eugene.models.object.ObjectModelInterface;
+import org.nuiton.eugene.models.object.ObjectModelModifier;
+import org.nuiton.eugene.models.object.ObjectModelOperation;
+import org.nuiton.eugene.models.object.ObjectModelParameter;
+import org.nuiton.i18n.I18n;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.generator.TopiaGeneratorUtil;
+
+/*{generator option: parentheses = false}*/
+
+/*{generator option: writeString = +}*/
+
+/**
+ * PollenServiceTransformer
+ *
+ * Created: 23 mars 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class PollenServiceTransformer extends ObjectModelTransformerToJava {
+
+ protected String modelName;
+
+ protected String defaultPackageName;
+
+ protected String getContextInterfaceName() {
+ return modelName + "Context";
+ }
+
+ protected String getContextImplementorInterfaceName() {
+ return getContextInterfaceName() + "Implementor";
+ }
+
+ protected String getExceptionClassName() {
+ return modelName + "Exception";
+ }
+
+ protected String getServiceAbstractClassName(String serviceName) {
+ return serviceName + "Abstract";
+ }
+
+ @Override
+ public void transformFromModel(ObjectModel model) {
+ modelName = model.getName();
+ defaultPackageName = getOutputProperties().
+ getProperty(Template.PROP_DEFAULT_PACKAGE);
+
+ ObjectModelInterface contextImplementor =
+ model.getInterface(defaultPackageName + "." +
+ getContextImplementorInterfaceName());
+
+ ObjectModelInterface context =
+ model.getInterface(defaultPackageName + "." +
+ getContextInterfaceName());
+
+ ObjectModelClass exception = createExceptionClass();
+
+ ObjectModelInterface newContextImplementor =
+ this.createInterface(getContextImplementorInterfaceName(),
+ defaultPackageName);
+ ObjectModelInterface newContext =
+ this.createInterface(getContextInterfaceName(),
+ defaultPackageName);
+
+ this.addInterface(newContextImplementor,
+ newContext.getQualifiedName());
+
+ if (contextImplementor != null) {
+ // Copy of defined operations
+ // interfaces of contextImplementor are not copied
+ copyInterfaceOperations(contextImplementor, newContextImplementor);
+ }
+
+ if (context != null) {
+ // Copy of defined operations
+ // interfaces of context are not copied
+ copyInterfaceOperations(context, newContext);
+ }
+
+ this.addOperation(newContextImplementor,
+ "getTopiaRootContext", TopiaContext.class);
+
+ ObjectModelOperation doCatch1 =
+ this.addOperation(newContextImplementor, "doCatch", "void");
+ this.addParameter(doCatch1, Exception.class, "eee");
+ this.addParameter(doCatch1, String.class, "message");
+ this.addParameter(doCatch1, "Object...", "args");
+ this.addException(doCatch1, exception.getQualifiedName());
+
+ ObjectModelOperation doCatch2 =
+ this.addOperation(newContextImplementor, "doCatch", "void");
+ this.addParameter(doCatch2, TopiaContext.class, "transaction");
+ this.addParameter(doCatch2, Exception.class, "eee");
+ this.addParameter(doCatch2, String.class, "message");
+ this.addParameter(doCatch2, "Object...", "args");
+ this.addException(doCatch2, exception.getQualifiedName());
+
+ ObjectModelOperation doFinally =
+ this.addOperation(newContextImplementor, "doFinally", "void");
+ this.addParameter(doFinally, TopiaContext.class, "transaction");
+ }
+
+ protected ObjectModelClass createExceptionClass() {
+
+ ObjectModelClass exception =
+ this.createClass(getExceptionClassName(), defaultPackageName);
+
+ this.setSuperClass(exception, RuntimeException.class);
+ this.addAttribute(exception, "args", "Object[]", null,
+ ObjectModelModifier.PROTECTED);
+
+ ObjectModelOperation constructor =
+ this.addConstructor(exception, ObjectModelModifier.PUBLIC);
+
+ this.addParameter(constructor, Throwable.class, "eee");
+ this.addParameter(constructor, String.class, "message");
+ this.addParameter(constructor, "Object...", "args");
+
+ setOperationBody(constructor, ""
+ /*{
+ super(message, eee);
+ this.args = args;
+ }*/
+ );
+
+ ObjectModelOperation getArgs =
+ this.addOperation(exception, "getArgs", "Object[]",
+ ObjectModelModifier.PUBLIC);
+
+ setOperationBody(getArgs, ""
+ /*{
+ return args;
+ }*/
+ );
+
+ return exception;
+ }
+
+ protected void copyInterfaceOperations(ObjectModelInterface source,
+ ObjectModelInterface dest) {
+ for (ObjectModelOperation op : source.getOperations()) {
+ ObjectModelOperation newOp =
+ this.addOperation(dest,
+ op.getName(), op.getReturnType(),
+ ObjectModelModifier.PUBLIC);
+ setDocumentation(newOp.getReturnParameter(),
+ op.getReturnParameter().getDocumentation());
+ for (ObjectModelParameter param : op.getParameters()) {
+ ObjectModelParameter newParam =
+ this.addParameter(newOp, param.getType(),
+ param.getName());
+ setDocumentation(newParam, param.getDocumentation());
+ }
+ for (String ex : op.getExceptions()) {
+ this.addException(newOp, ex);
+ }
+ setDocumentation(newOp, op.getDocumentation());
+ }
+ }
+
+ @Override
+ public void transformFromInterface(ObjectModelInterface interfacez) {
+ // skip ContextImplementor and Context interfaces
+ if (!interfacez.hasStereotype(TopiaGeneratorUtil.STEREOTYPE_SERVICE)) {
+ return;
+ }
+
+ // Create INTERFACE
+ ObjectModelInterface serviceInterface =
+ this.createInterface(interfacez.getName(),
+ interfacez.getPackageName());
+
+ copyInterfaceOperations(interfacez, serviceInterface);
+
+
+ // Create ABSTRACT CLASS
+ ObjectModelClass service = this.createAbstractClass(
+ getServiceAbstractClassName(interfacez.getName()),
+ interfacez.getPackageName());
+
+ this.addInterface(service, serviceInterface.getQualifiedName());
+
+ // Add Logger
+// this.addAttribute(service, "log",
+// Log.class,
+// "LogFactory.getLog(" + interfacez.getName() + ".class)",
+// ObjectModelModifier.PRIVATE,
+// ObjectModelModifier.STATIC,
+// ObjectModelModifier.FINAL);
+ this.addAttribute(service, "log",
+ Log.class, null,
+ ObjectModelModifier.PRIVATE,
+ ObjectModelModifier.FINAL);
+
+ this.addImport(service, Log.class);
+ this.addImport(service, LogFactory.class);
+
+ String contextFqn = defaultPackageName + "." +
+ getContextImplementorInterfaceName();
+
+ // Add Context Attribute + constructor
+ this.addAttribute(service, "context", contextFqn, null,
+ ObjectModelModifier.PROTECTED);
+
+ // Constructor
+ ObjectModelOperation constructor =
+ this.addConstructor(service, ObjectModelModifier.PUBLIC);
+ this.addParameter(constructor, contextFqn, "context");
+ setOperationBody(constructor, ""
+ /*{
+ this.context = context;
+ this.log = LogFactory.getLog(<%=interfacez.getName()%>.class);
+ }*/
+ );
+
+ // Prepare operation generations
+ String first = modelName.substring(0, 1);
+ String serviceName =
+ GeneratorUtil.toLowerCaseFirstLetter(interfacez.getName());
+
+ this.addImport(service, TopiaContext.class);
+ this.addImport(service, I18n.class);
+
+ for (ObjectModelOperation op : interfacez.getOperations()) {
+
+ // Implementation of interface operation
+ ObjectModelOperation implOp =
+ this.addOperation(service,
+ op.getName(), op.getReturnType(),
+ ObjectModelModifier.PUBLIC);
+ this.addAnnotation(service, implOp, Override.class.getSimpleName());
+
+ String opName = StringUtils.capitalize(op.getName());
+
+ // Abstract operation to execute method content
+ ObjectModelOperation abstOp =
+ this.addOperation(service, "execute" + opName,
+ op.getReturnType(),
+ ObjectModelModifier.ABSTRACT,
+ ObjectModelModifier.PROTECTED);
+ this.addParameter(abstOp, TopiaContext.class, "transaction");
+ this.addException(abstOp, TopiaException.class);
+
+ // Copy exceptions
+ for (String ex : op.getExceptions()) {
+ this.addException(implOp, ex);
+ this.addException(abstOp, ex);
+ }
+
+ String toStringAppend = "";
+ String separatorLog = " : ";
+ String opParams = "";
+ // Copy operation parameters
+ for (ObjectModelParameter param : op.getParameters()) {
+ String paramName = param.getName();
+ this.addParameter(implOp, param.getType(), param.getName());
+ this.addParameter(abstOp, param.getType(), param.getName());
+
+ // Prepare Log
+ toStringAppend +=
+ "\n\t\t.append(\"" + separatorLog + paramName + " = \")" +
+ ".append(" + paramName + ")";
+ separatorLog = " _ ";
+
+ // Prepare Abstract method params
+ opParams += ", " + param.getName();
+ }
+
+ // Error key for i18n
+ String errorKey = StringUtils.lowerCase(modelName) + ".error." +
+ serviceName + "." + op.getName();
+
+ String opReturn = !op.getReturnType().equals("void") ?
+ "return " : "";
+ String finalReturn = !op.getReturnType().equals("void") ?
+ "return null;" : "";
+
+ setOperationBody(implOp, ""
+ /*{
+ TopiaContext transaction = null;
+ try {
+ transaction = context.getTopiaRootContext().beginTransaction();
+ if (log.isInfoEnabled()) {
+ String message = new StringBuilder("<%=first%>:[ <%=opName%> ]")<%=toStringAppend%>.
+ toString();
+ log.info(message);
+ }
+
+ <%=opReturn%>execute<%=opName%>(transaction<%=opParams%>);
+
+ } catch (Exception eee) {
+ context.doCatch(transaction, eee, I18n.n_("<%=errorKey%>"));
+ } finally {
+ context.doFinally(transaction);
+ }
+ <%=finalReturn%>
+ }*/
+ );
+
+ }
+
+ }
+
+// @Override
+// public void transformFromClass(ObjectModelClass clazz) {
+// if (!clazz.getName().equals(getContextClassName())) {
+// return;
+// }
+//
+//
+// }
+
+
+}
Property changes on: trunk/pollen-topia-template/src/main/java/org/chorem/pollen/template/PollenServiceTransformer.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Modified: trunk/pollen-votecounting/pom.xml
===================================================================
--- trunk/pollen-votecounting/pom.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pollen-votecounting/pom.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.chorem</groupId>
<artifactId>pollen</artifactId>
- <version>1.3.0-SNAPSHOT</version>
+ <version>2.0-SNAPSHOT</version>
</parent>
<groupId>org.chorem.pollen</groupId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-03-23 11:15:12 UTC (rev 2955)
+++ trunk/pom.xml 2010-03-23 15:39:36 UTC (rev 2956)
@@ -15,10 +15,11 @@
<groupId>org.chorem</groupId>
<artifactId>pollen</artifactId>
- <version>1.3.0-SNAPSHOT</version>
+ <version>2.0-SNAPSHOT</version>
<modules>
- <module>pollen-ui</module>
+<!-- <module>pollen-ui</module>-->
+ <module>pollen-template</module>
<module>pollen-business</module>
<module>pollen-votecounting</module>
</modules>
@@ -57,6 +58,11 @@
<version>${nuiton-utils.version}</version>
</dependency>
<dependency>
+ <groupId>org.nuiton.eugene</groupId>
+ <artifactId>eugene</artifactId>
+ <version>${eugene.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.nuiton.topia</groupId>
<artifactId>topia-persistence</artifactId>
<version>${topia.version}</version>
@@ -304,11 +310,12 @@
<!-- customized versions -->
<!--javadoc.version>2.4</javadoc.version-->
- <topia.version>2.3</topia.version>
+ <topia.version>2.3.1-SNAPSHOT</topia.version>
<eugene.version>2.0</eugene.version>
<i18n.version>1.1.1-SNAPSHOT</i18n.version>
<tapestry.version>5.1.0.5</tapestry.version>
<nuiton-utils.version>1.2</nuiton-utils.version>
+ <processor.version>1.0.2</processor.version>
<!-- <chorem-commons.version>1.0.0-alpha-2-SNAPSHOT</chorem-commons.version>-->
<!--Multilanguage maven-site -->
@@ -362,6 +369,26 @@
<artifactId>maven-i18n-plugin</artifactId>
<version>${i18n.version}</version>
</plugin>
+ <plugin>
+ <groupId>org.nuiton.processor</groupId>
+ <artifactId>maven-processor-plugin</artifactId>
+ <version>${processor.version}</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>process</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <includes>**/*.java</includes>
+ <filters>
+ org.nuiton.processor.filters.GeneratorTemplatesFilter,
+ org.nuiton.processor.filters.ActiveLogsCodeFilter
+ </filters>
+ </configuration>
+ </plugin>
</plugins>
</pluginManagement>
1
0
Author: fdesbois
Date: 2010-03-23 12:15:12 +0100 (Tue, 23 Mar 2010)
New Revision: 2955
Log:
Last commit for 1.3 snapshot : very unstable version...
Added:
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/AbstractUploadPage.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/ErrorPage.java
trunk/pollen-ui/src/main/webapp/ErrorPage.tml
Removed:
trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceChoiceImplTest.java
Modified:
trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenConverter.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollAccountConverter.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollConverter.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVoteConverter.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PollAccountDTO.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/VoteDTO.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceAuthImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceChoice.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceListImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePoll.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccount.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccountImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePreventRuleImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceResultsImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceUserImpl.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVote.java
trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVoteImpl.java
trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties
trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties
trunk/pollen-business/src/main/xmi/pollen.zargo
trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceListImplTest.java
trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServicePollImplTest.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/Polls.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Border.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FeedBack.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ChoiceField.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CloseValidation.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CreationValidation.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ModificationValidation.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollCreation.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollModification.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsParticipated.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/BackgroundWorkerImpl.java
trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/ServiceImageImpl.java
trunk/pollen-ui/src/main/resources/i18n/pollen-ui-en_GB.properties
trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties
trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/Border.tml
trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/poll/VoteForPoll_en.properties
trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/poll/VoteForPoll_fr.properties
trunk/pollen-ui/src/main/webapp/poll/VoteForPoll.tml
trunk/pollen-ui/src/main/webapp/user/UserPollsCreated.tml
trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/ChoiceType.java
trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/PollType.java
trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/VoteCountingType.java
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenConverter.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenConverter.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/PollenConverter.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -224,7 +224,7 @@
BinderProvider.getBinder(
PollAccount.class, PollAccountDTO.class).copy(entity, dto);
dto.setId(entity.getTopiaId());
- dto.setAccountId(entity.getAccountId());
+ dto.setAccountUId(entity.getAccountId());
return dto;
}
@@ -275,7 +275,7 @@
dto.setVotingListId(list.getTopiaId());
// vote for a person (pollAccount)
} else {/*if (account != null) { must have a pollaccount */
- dto.setPollAccountId(account.getTopiaId());
+ //dto.setPollAccountId(account.getTopiaId());
dto.setName(account.getVotingId());
// if (account.getUserAccount() != null) {
// dto.setUserId(account.getUserAccount().getTopiaId());
@@ -285,10 +285,12 @@
// Choices for voteValues
for (VoteToChoice choice : entity.getChoiceVoteToChoice()) {
- ChoiceDTO choiceDTO =
- convert(choice.getChoice(), new ChoiceDTO());
- choiceDTO.setValue(choice.getVoteValue());
- dto.addChoice(choiceDTO);
+// ChoiceDTO choiceDTO =
+// convert(choice.getChoice(), new ChoiceDTO());
+// choiceDTO.setValue(choice.getVoteValue());
+// dto.addChoice(choiceDTO);
+ dto.setChoiceValue(choice.getChoice().getTopiaId(),
+ choice.getVoteValue());
}
return dto;
}
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollAccountConverter.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollAccountConverter.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollAccountConverter.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -108,7 +108,7 @@
public PollAccountDTO createPollAccountDTO(PollAccount ePollAccount) {
PollAccountDTO dto = new PollAccountDTO();
dto.setId(ePollAccount.getTopiaId());
- dto.setAccountId(ePollAccount.getAccountId());
+ dto.setAccountUId(ePollAccount.getAccountId());
dto.setEmail(ePollAccount.getEmail());
dto.setVotingId(ePollAccount.getVotingId());
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollConverter.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollConverter.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataPollConverter.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -33,8 +33,6 @@
import org.chorem.pollen.business.persistence.Comment;
import org.chorem.pollen.business.persistence.Poll;
import org.chorem.pollen.business.persistence.PreventRule;
-import org.chorem.pollen.business.services.ServiceChoice;
-import org.chorem.pollen.business.services.ServiceChoiceImpl;
import org.chorem.pollen.business.services.ServicePreventRule;
import org.chorem.pollen.business.services.ServicePreventRuleImpl;
import org.nuiton.topia.TopiaException;
@@ -134,50 +132,50 @@
}
return results;
}
+
+// /**
+// * Persistance des choix d'une entité sondage à partir d'un DTO.
+// *
+// * @param pollDTO le dto sondage
+// * @param ePoll l'entité sondage
+// * @deprecated use dao managment instead
+// */
+// @Deprecated
+// public void persistChoices(PollDTO pollDTO, Poll ePoll, PollenContextImplementor context)
+// throws TopiaException, PollenBusinessException {
+//
+// // mise à jour ou création des choix
+// ServiceChoice sChoice = new ServiceChoiceImpl(context);
+// for (ChoiceDTO choiceDTO : pollDTO.getChoices()) {
+// boolean updated = sChoice.updateChoice(choiceDTO);
+// if (!updated) {
+// choiceDTO.setId(sChoice.createChoice(choiceDTO));
+// }
+//
+// if (log.isDebugEnabled()) {
+// log.debug("Choice " + choiceDTO.getName() + " ("
+// + choiceDTO.getId() + ") updated: " + updated);
+// }
+// }
+//
+// // suppression des choix
+// boolean validChoice = false;
+// Iterator<Choice> itChoice = ePoll.getChoice().iterator();
+// while (itChoice.hasNext()) {
+// Choice currentChoice = itChoice.next();
+// for (ChoiceDTO choiceDTO : pollDTO.getChoices()) {
+// if (currentChoice.getTopiaId().equals(choiceDTO.getId())) {
+// validChoice = true;
+// }
+// }
+// if (!validChoice) {
+// sChoice.deleteChoice(currentChoice.getTopiaId());
+// }
+// validChoice = false;
+// }
+// }
/**
- * Persistance des choix d'une entité sondage à partir d'un DTO.
- *
- * @param pollDTO le dto sondage
- * @param ePoll l'entité sondage
- * @deprecated use dao managment instead
- */
- @Deprecated
- public void persistChoices(PollDTO pollDTO, Poll ePoll, PollenContextImplementor context)
- throws TopiaException, PollenBusinessException {
-
- // mise à jour ou création des choix
- ServiceChoice sChoice = new ServiceChoiceImpl(context);
- for (ChoiceDTO choiceDTO : pollDTO.getChoices()) {
- boolean updated = sChoice.updateChoice(choiceDTO);
- if (!updated) {
- choiceDTO.setId(sChoice.createChoice(choiceDTO));
- }
-
- if (log.isDebugEnabled()) {
- log.debug("Choice " + choiceDTO.getName() + " ("
- + choiceDTO.getId() + ") updated: " + updated);
- }
- }
-
- // suppression des choix
- boolean validChoice = false;
- Iterator<Choice> itChoice = ePoll.getChoice().iterator();
- while (itChoice.hasNext()) {
- Choice currentChoice = itChoice.next();
- for (ChoiceDTO choiceDTO : pollDTO.getChoices()) {
- if (currentChoice.getTopiaId().equals(choiceDTO.getId())) {
- validChoice = true;
- }
- }
- if (!validChoice) {
- sChoice.deleteChoice(currentChoice.getTopiaId());
- }
- validChoice = false;
- }
- }
-
- /**
* Persistance des règles de notification d'une entité sondage à partir d'un
* DTO.
*
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVoteConverter.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVoteConverter.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/converters/DataVoteConverter.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -20,6 +20,7 @@
import java.util.Collection;
import java.util.List;
+import java.util.Map;
import org.chorem.pollen.business.dto.ChoiceDTO;
import org.chorem.pollen.business.dto.VoteDTO;
import org.chorem.pollen.business.persistence.Choice;
@@ -113,11 +114,14 @@
if (eVote.getChoiceVoteToChoice() != null) {
DataChoiceConverter choiceConverter = new DataChoiceConverter();
for (VoteToChoice voteToChoice : eVote.getChoiceVoteToChoice()) {
- if (voteToChoice.getChoice() != null) {
- ChoiceDTO choiceDTO = choiceConverter
- .createChoiceDTO(voteToChoice.getChoice());
- choiceDTO.setValue(voteToChoice.getVoteValue());
- voteDTO.getChoiceDTOs().add(choiceDTO);
+ Choice choice = voteToChoice.getChoice();
+ if (choice != null) {
+// ChoiceDTO choiceDTO = choiceConverter
+// .createChoiceDTO(voteToChoice.getChoice());
+// choiceDTO.setValue(voteToChoice.getVoteValue());
+// voteDTO.getChoiceDTOs().add(choiceDTO);
+ voteDTO.setChoiceValue(choice.getTopiaId(),
+ voteToChoice.getVoteValue());
}
}
}
@@ -148,16 +152,46 @@
*
* @param voteDTO Le dto vote.
* @param eVote L'entité vote.
+ * @throws TopiaException
+ * @deprecated must copy this code in serviceVote
*/
+ @Deprecated
public void populateChoiceVote(VoteDTO voteDTO, Vote eVote)
throws TopiaException {
+//
+// for (ChoiceDTO choiceDTO : voteDTO.getChoiceDTOs()) {
+// choiceDTO.setVoteId(eVote.getTopiaId());
+// }
+//
+// eVote.setChoiceVoteToChoice(this.getVoteToChoices(voteDTO
+// .getChoiceDTOs()));
- for (ChoiceDTO choiceDTO : voteDTO.getChoiceDTOs()) {
- choiceDTO.setVoteId(eVote.getTopiaId());
+ VoteToChoiceDAO dao =
+ PollenModelDAOHelper.getVoteToChoiceDAO(super.transaction);
+
+ ChoiceDAO choiceDAO = PollenModelDAOHelper.getChoiceDAO(super.transaction);
+
+ for (Map.Entry<String, Integer> choiceValue :
+ voteDTO.getChoiceValues().entrySet()) {
+
+ // Find existing choice
+ Choice choice = choiceDAO.findByTopiaId(choiceValue.getKey());
+
+ // Find existing vote
+ VoteToChoice voteToChoice = dao.findByProperties(
+ VoteToChoice.CHOICE, choice,
+ VoteToChoice.VOTE, eVote);
+
+ // Create new vote if needed
+ if (voteToChoice == null) {
+ voteToChoice = dao.create(
+ VoteToChoice.CHOICE, choice,
+ VoteToChoice.VOTE, eVote);
+ }
+ // Update vote value
+ voteToChoice.setVoteValue(choiceValue.getValue());
}
- eVote.setChoiceVoteToChoice(this.getVoteToChoices(voteDTO
- .getChoiceDTOs()));
}
/**
@@ -166,6 +200,7 @@
* @param choiceDTOs La liste des dtos choix
* @return la liste d'entités VoteToChoice
*/
+ @Deprecated
private List<VoteToChoice> getVoteToChoices(List<ChoiceDTO> choiceDTOs)
throws TopiaException {
List<VoteToChoice> liste = new ArrayList<VoteToChoice>();
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PollAccountDTO.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PollAccountDTO.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/PollAccountDTO.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -29,20 +29,32 @@
*/
public class PollAccountDTO implements Serializable {
- private String id = "";
+ private String id;
- private String accountId = "";
+ /** UId of the account used in urls **/
+ private String accountUId;
- private String votingId = "";
+ /** Name of the account **/
+ private String votingId;
- private String userId = "";
+ /** TopiaId of the user linked with the account **/
+ private String userId;
- private String email = "";
+ /** Email of the account **/
+ private String email;
- private Double weight = 1.;
+ /** Weight of the account (already defined in the vote) **/
+ private Double weight;
- private Boolean hasVoted = false;
+ /**
+ * Determine if the account has already voted (used for vote page)
+ * Seems not necessary to manage vote, no constraint define on changing
+ * existing vote if it's the correct user or account.
+ **/
+ private Boolean hasVoted;
+
+
private String votingListId = "";
private String personListId = "";
@@ -53,10 +65,12 @@
}
+ @Deprecated
public PollAccountDTO(String id) {
this.id = id;
}
+ @Deprecated
public PollAccountDTO(String votingId, String email, String personListId,
String votingListId, String userId) {
super();
@@ -75,12 +89,12 @@
this.id = id;
}
- public String getAccountId() {
- return accountId;
+ public String getAccountUId() {
+ return accountUId;
}
- public void setAccountId(String accountId) {
- this.accountId = accountId;
+ public void setAccountUId(String accountUId) {
+ this.accountUId = accountUId;
}
public String getVotingId() {
@@ -107,10 +121,12 @@
this.email = email;
}
+ @Deprecated
public Double getWeight() {
return weight;
}
+ @Deprecated
public void setWeight(Double weight) {
this.weight = weight;
}
@@ -127,26 +143,32 @@
this.hasVoted = hasVoted;
}
+ @Deprecated
public String getVotingListId() {
return votingListId;
}
+ @Deprecated
public void setVotingListId(String votingListId) {
this.votingListId = votingListId;
}
+ @Deprecated
public String getPersonListId() {
return personListId;
}
+ @Deprecated
public void setPersonListId(String personListId) {
this.personListId = personListId;
}
+ @Deprecated
public List<VoteDTO> getVoteDTOs() {
return voteDTOs;
}
+ @Deprecated
public void setVoteDTOs(List<VoteDTO> voteDTOs) {
this.voteDTOs = voteDTOs;
}
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/VoteDTO.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/VoteDTO.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/dto/VoteDTO.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -17,8 +17,8 @@
package org.chorem.pollen.business.dto;
import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.HashMap;
+import java.util.Map;
/**
* Classe DTO représentant un vote.
@@ -43,8 +43,8 @@
/** the vote is anonymous or not **/
private Boolean anonymous = false;
- /** topiaId of the account who has voted**/
- private String pollAccountId = "";
+ /** account who has voted : only defined if anonymous = false **/
+ private String pollAccountId;
/** QUICK FIX to have pollAccount votingId **/
private String name;
@@ -62,17 +62,20 @@
private String votingListId = "";
/** choices made by this vote **/
- private List<ChoiceDTO> choiceDTOs = new ArrayList<ChoiceDTO>();
+// private List<ChoiceDTO> choiceDTOs = new ArrayList<ChoiceDTO>();
+ private Map<String, Integer> choiceValues;
public VoteDTO() {
}
+ @Deprecated
public VoteDTO(String id) {
this.id = id;
}
- public VoteDTO(String pollAccountId, String pollId, String votingListId) {
- this.pollAccountId = pollAccountId;
+ @Deprecated
+ public VoteDTO(String accountUId, String pollId, String votingListId) {
+// this.accountUId = accountUId;
this.pollId = pollId;
this.votingListId = votingListId;
}
@@ -93,10 +96,12 @@
this.weight = weight;
}
+ @Deprecated
public String getComment() {
return comment;
}
+ @Deprecated
public void setComment(String comment) {
this.comment = comment;
}
@@ -121,26 +126,32 @@
this.pollAccountId = pollAccountId;
}
+ @Deprecated
public String getName() {
return name;
}
+ @Deprecated
public void setName(String name) {
this.name = name;
}
+ @Deprecated
public String getUserId() {
return userId;
}
+ @Deprecated
public void setUserId(String userId) {
this.userId = userId;
}
+ @Deprecated
public String getPollId() {
return pollId;
}
+ @Deprecated
public void setPollId(String pollId) {
this.pollId = pollId;
}
@@ -153,19 +164,34 @@
this.votingListId = votingListId;
}
- public List<ChoiceDTO> getChoiceDTOs() {
- return choiceDTOs;
+ public void setChoiceValue(String choiceId, Integer value) {
+ getChoiceValues().put(choiceId, value);
}
- public void setChoiceDTOs(List<ChoiceDTO> choiceDTOs) {
- this.choiceDTOs = choiceDTOs;
+ public Integer getChoiceValue(String choiceId) {
+ return getChoiceValues().get(choiceId);
}
- public void addChoice(ChoiceDTO choice) {
- if (choiceDTOs == null) {
- choiceDTOs = new ArrayList<ChoiceDTO>();
+ public Map<String, Integer> getChoiceValues() {
+ if (choiceValues == null) {
+ choiceValues = new HashMap<String, Integer>();
}
- choiceDTOs.add(choice);
+ return choiceValues;
}
+// public List<ChoiceDTO> getChoiceDTOs() {
+// return choiceDTOs;
+// }
+//
+// public void setChoiceDTOs(List<ChoiceDTO> choiceDTOs) {
+// this.choiceDTOs = choiceDTOs;
+// }
+//
+// public void addChoice(ChoiceDTO choice) {
+// if (choiceDTOs == null) {
+// choiceDTOs = new ArrayList<ChoiceDTO>();
+// }
+// choiceDTOs.add(choice);
+// }
+
}
\ No newline at end of file
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceAuthImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceAuthImpl.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceAuthImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -18,7 +18,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.PollenContextImpl;
+import org.chorem.pollen.business.PollenContext;
import org.chorem.pollen.business.PollenContextImplementor;
import org.chorem.pollen.business.converters.DataUserConverter;
import org.chorem.pollen.business.dto.UserDTO;
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceChoice.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceChoice.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceChoice.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -36,7 +36,9 @@
*
* @param choice le dto choix
* @return l'identifiant du choix
+ * @deprecated only used for tests or internal
*/
+ @Deprecated
public String createChoice(ChoiceDTO choice);
/**
@@ -44,7 +46,9 @@
*
* @param choiceDTO
* @return true si le choix a été mise à jours
+ * @deprecated only used for tests or internal
*/
+ @Deprecated
public boolean updateChoice(ChoiceDTO choiceDTO);
/**
@@ -62,7 +66,9 @@
*
* @param choiceId l'identifiant du choix
* @return le choix
+ * @deprecated only used for tests or internal
*/
+ @Deprecated
public ChoiceDTO findChoiceById(String choiceId);
/**
@@ -71,7 +77,9 @@
* @param choiceName le nom du choix
* @param pollId l'identifiant du sondage
* @return les choix
+ * @deprecated never used
*/
+ @Deprecated
public List<ChoiceDTO> findChoicesByName(String choiceName, String pollId);
/**
@@ -79,6 +87,8 @@
*
* @param properties filtre sur les champs de la table choix
* @return les choix du sondage
+ * @deprecated only used for tests
*/
+ @Deprecated
public List<ChoiceDTO> selectChoices(Map<String, Object> properties);
}
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceListImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceListImpl.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceListImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -21,6 +21,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.pollen.business.PollenContext;
import org.chorem.pollen.business.PollenContextImplementor;
import org.chorem.pollen.business.converters.DataPersonListConverter;
import org.chorem.pollen.business.converters.DataVotingListConverter;
@@ -61,8 +62,8 @@
public ServiceListImpl(PollenContextImplementor context) {
this.context = context;
- context.getConverter().preparePollAccountConverters();
- context.getConverter().prepareVotingListConverters();
+ this.context.getConverter().preparePollAccountConverters();
+ this.context.getConverter().prepareVotingListConverters();
}
@Override
@@ -204,7 +205,7 @@
// Update change in dtos
account.setId(eAccount.getTopiaId());
- account.setAccountId(eAccount.getAccountId());
+ account.setAccountUId(eAccount.getAccountId());
personList.addPollAccount(account);
} catch (Exception eee) {
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePoll.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePoll.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePoll.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -158,5 +158,7 @@
public ChoiceDTO getNewHiddenChoice(ChoiceDTO choice, String votingId);
+ public void createChoice(PollDTO poll, ChoiceDTO choice);
+
public void deleteChoice(PollDTO poll, String choiceId);
}
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccount.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccount.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccount.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -58,7 +58,9 @@
*
* @param pollAccountId le compte a creer
* @return true si le compte a été supprimer
+ * @deprecated never used
*/
+ @Deprecated
public boolean deletePollAccount(String pollAccountId);
/**
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccountImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccountImpl.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollAccountImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -22,7 +22,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.PollenContextImpl;
+import org.chorem.pollen.business.PollenContext;
import org.chorem.pollen.business.PollenContextImplementor;
import org.chorem.pollen.business.converters.DataPollAccountConverter;
import org.chorem.pollen.business.dto.PollAccountDTO;
@@ -105,7 +105,7 @@
// Identifiants du compte
String id = UUID.randomUUID().toString();
- pollAccount.setAccountId(id.replaceAll("-", ""));
+ pollAccount.setAccountUId(id.replaceAll("-", ""));
pollAccount.setId(entity.getTopiaId());
converter.populatePollAccountEntity(pollAccount, entity);
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollImpl.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePollImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -25,6 +25,7 @@
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.pollen.business.PollenContext;
import org.chorem.pollen.business.converters.DataPollConverter;
import org.chorem.pollen.business.converters.DataVotingListConverter;
import org.chorem.pollen.business.dto.ChoiceDTO;
@@ -51,7 +52,6 @@
import org.chorem.pollen.business.persistence.VotingList;
import org.chorem.pollen.business.persistence.VotingListDAO;
import org.chorem.pollen.business.utils.ContextUtil;
-import org.chorem.pollen.business.PollenContextImpl;
import org.chorem.pollen.business.PollenContextImplementor;
import org.chorem.pollen.business.persistence.PersonToListDAO;
import org.chorem.pollen.common.PollType;
@@ -82,13 +82,13 @@
public ServicePollImpl(PollenContextImplementor context) {
this.context = context;
- context.getConverter().preparePollConverters();
- context.getConverter().prepareChoiceConverters();
- context.getConverter().prepareVotingListConverters();
- context.getConverter().preparePollAccountConverters();
- context.getConverter().preparePreventRuleConverters();
- context.getConverter().prepareVoteConverters();
- context.getConverter().prepareCommentConverters();
+ this.context.getConverter().preparePollConverters();
+ this.context.getConverter().prepareChoiceConverters();
+ this.context.getConverter().prepareVotingListConverters();
+ this.context.getConverter().preparePollAccountConverters();
+ this.context.getConverter().preparePreventRuleConverters();
+ this.context.getConverter().prepareVoteConverters();
+ this.context.getConverter().prepareCommentConverters();
}
@Override
@@ -803,13 +803,51 @@
choice.getName() + "#" + votingId);
hiddenChoice.setHidden(true);
hiddenChoice.setValue(choice.getValue()); // ??
- hiddenChoice.setPollUId(choice.getPollUId());
- hiddenChoice.setVoteId(choice.getVoteId()); // ??
+// hiddenChoice.setPollUId(choice.getPollUId());
+// hiddenChoice.setVoteId(choice.getVoteId()); // ??
hiddenChoice.setValidate(false);
return hiddenChoice;
}
@Override
+ public void createChoice(PollDTO poll, ChoiceDTO choice) {
+ TopiaContext transaction = null;
+ try {
+ if (log.isInfoEnabled()) {
+ log.info("P:[ createChoice ] : pollUId = " + poll.getPollUId() +
+ " _ choiceName = " + choice.getName() +
+ " _ choiceDescription = " + choice.getDescription());
+ }
+ transaction = context.getRootContext().beginTransaction();
+
+ // Get the poll entity corresponding
+ Poll ePoll = PollenModelDAOHelper.getPollDAO(transaction).
+ findByTopiaId(poll.getId());
+
+ // Create the new choice entity
+ ChoiceDAO dao = PollenModelDAOHelper.getChoiceDAO(transaction);
+ Choice eChoice = context.getConverter().convert(choice,
+ dao.create());
+
+ // Add the choice in the Poll
+ ePoll.addChoice(eChoice);
+
+ transaction.commitTransaction();
+
+ // Update changes in dtos
+ choice.setId(eChoice.getTopiaId());
+ poll.addChoice(choice);
+
+ } catch (Exception eee) {
+ context.doCatch(transaction, eee,
+ n_("pollen.error.servicePoll.createChoice"),
+ poll.getTitle(), poll.getId());
+ } finally {
+ context.doFinally(transaction);
+ }
+ }
+
+ @Override
public void deleteChoice(PollDTO poll, String choiceId) {
TopiaContext transaction = null;
try {
@@ -819,7 +857,7 @@
}
transaction = context.getRootContext().beginTransaction();
- // Find the comment
+ // Find the choice
ChoiceDAO dao = PollenModelDAOHelper.getChoiceDAO(transaction);
Choice eChoice = dao.findByTopiaId(choiceId);
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePreventRuleImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePreventRuleImpl.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServicePreventRuleImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -22,7 +22,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.PollenContextImpl;
+import org.chorem.pollen.business.PollenContext;
import org.chorem.pollen.business.PollenContextImplementor;
import org.chorem.pollen.business.converters.DataPreventRuleConverter;
import org.chorem.pollen.business.dto.PreventRuleDTO;
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceResultsImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceResultsImpl.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceResultsImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -23,7 +23,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.PollenContextImpl;
+import org.chorem.pollen.business.PollenContext;
import org.chorem.pollen.business.PollenContextImplementor;
import org.chorem.pollen.business.converters.DataResultConverter;
import org.chorem.pollen.business.converters.DataVoteCountingConverter;
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceUserImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceUserImpl.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceUserImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -21,6 +21,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.pollen.business.PollenContext;
import org.chorem.pollen.business.PollenContextImplementor;
import org.chorem.pollen.business.converters.DataUserConverter;
import org.chorem.pollen.business.dto.UserDTO;
@@ -30,7 +31,6 @@
import org.chorem.pollen.business.utils.ContextUtil;
import org.chorem.pollen.business.utils.MD5;
import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.framework.TopiaQuery;
import static org.nuiton.i18n.I18n.n_;
/**
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVote.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVote.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVote.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -90,4 +90,6 @@
*/
public List<VoteDTO> selectVotes(Map<String, Object> properties);
+ public VoteDTO getNewVote(PollAccountDTO account);
+
}
Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVoteImpl.java
===================================================================
--- trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVoteImpl.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/java/org/chorem/pollen/business/services/ServiceVoteImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -29,14 +29,25 @@
import org.chorem.pollen.business.dto.PollDTO;
import org.chorem.pollen.business.dto.UserDTO;
import org.chorem.pollen.business.dto.VoteDTO;
+import org.chorem.pollen.business.persistence.Choice;
+import org.chorem.pollen.business.persistence.ChoiceDAO;
+import org.chorem.pollen.business.persistence.PersonToList;
+import org.chorem.pollen.business.persistence.PersonToListDAO;
import org.chorem.pollen.business.persistence.Poll;
import org.chorem.pollen.business.persistence.PollAccount;
import org.chorem.pollen.business.persistence.PollAccountDAO;
import org.chorem.pollen.business.persistence.PollenModelDAOHelper;
+import org.chorem.pollen.business.persistence.UserAccount;
import org.chorem.pollen.business.persistence.Vote;
import org.chorem.pollen.business.persistence.VoteDAO;
+import org.chorem.pollen.business.persistence.VoteToChoice;
+import org.chorem.pollen.business.persistence.VoteToChoiceDAO;
+import org.chorem.pollen.business.persistence.VotingList;
+import org.chorem.pollen.business.persistence.VotingListDAO;
import org.chorem.pollen.business.utils.ContextUtil;
+import org.chorem.pollen.common.PollType;
import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaException;
import org.nuiton.topia.framework.TopiaQuery;
import org.nuiton.topia.persistence.TopiaEntity;
import static org.nuiton.i18n.I18n.n_;
@@ -58,7 +69,7 @@
public ServiceVoteImpl(PollenContextImplementor context) {
this.context = context;
- context.getConverter().prepareVoteConverters();
+ this.context.getConverter().prepareVoteConverters();
}
@Override
@@ -257,6 +268,7 @@
if (user == null) {
return result;
}
+ // Initialize the default account for user
if (user.getFirstName() != null && user.getLastName() != null) {
result.setVotingId(
user.getFirstName() + " " + user.getLastName());
@@ -267,6 +279,8 @@
} else if (user.getLastName() != null) {
result.setVotingId(user.getLastName());
}
+ // Link the new account with the user
+ result.setUserId(user.getId());
return result;
}
@@ -349,4 +363,162 @@
ContextUtil.doFinally(transaction);
}
}
+
+ @Override
+ public VoteDTO getNewVote(PollAccountDTO account) {
+ VoteDTO result = new VoteDTO();
+ result.setWeight(1.);
+ result.setPollAccountId(account.getId());
+ return result;
+ }
+
+ private void updateChoiceValues(TopiaContext transaction,
+ VoteDTO vote, Vote eVote) throws TopiaException {
+
+ VoteToChoiceDAO voteToChoiceDAO =
+ PollenModelDAOHelper.getVoteToChoiceDAO(transaction);
+
+ ChoiceDAO choiceDAO = PollenModelDAOHelper.getChoiceDAO(transaction);
+
+ for (Map.Entry<String, Integer> choiceValue :
+ vote.getChoiceValues().entrySet()) {
+
+ // Find existing choice
+ Choice choice = choiceDAO.findByTopiaId(choiceValue.getKey());
+
+ // Find existing vote
+ VoteToChoice voteToChoice = voteToChoiceDAO.findByProperties(
+ VoteToChoice.CHOICE, choice,
+ VoteToChoice.VOTE, eVote);
+
+ // Create new vote if needed
+ if (voteToChoice == null) {
+ voteToChoice = voteToChoiceDAO.create(
+ VoteToChoice.CHOICE, choice,
+ VoteToChoice.VOTE, eVote);
+ }
+ // Update vote value
+ voteToChoice.setVoteValue(choiceValue.getValue());
+ }
+ }
+
+ private PersonToList validateForRestrictedPoll(TopiaContext transaction,
+ VoteDTO vote, PollAccount eAccount, Poll ePoll)
+ throws TopiaException {
+ PersonToList person = null;
+ if (eAccount == null) {
+ //throw exception : not allowed
+ return person;
+ } else {
+ PersonToListDAO personDAO =
+ PollenModelDAOHelper.getPersonToListDAO(transaction);
+
+ String pPoll =
+ PersonToList.VOTING_LIST + "." + VotingList.POLL;
+
+ TopiaQuery query = personDAO.createQuery().
+ add(PersonToList.POLL_ACCOUNT, eAccount).
+ add(PersonToList.HAS_VOTED, Boolean.FALSE).
+ add(pPoll, ePoll);
+
+ person = personDAO.findByQuery(query);
+ if (person == null && !ePoll.getAnonymous()) {
+ // throw exception : not allowed
+ return person;
+ }
+ }
+ return person;
+ }
+
+// @Override
+// public void createOrUpdateVote(VoteDTO vote, PollDTO poll) {
+// TopiaContext transaction = null;
+// try {
+// PollType pollType = poll.getPollType();
+//
+// //PollAccountDTO account = vote.getAccount();
+//
+// if (log.isInfoEnabled()) {
+// log.info("P:[ getNewVote ] : " +
+// "accountName = " + account.getVotingId() +
+// " _ accountUId = " + account.getAccountUId() +
+// " _ pollUId = " + poll.getPollUId() +
+// " _ pollType = " + pollType);
+// }
+//
+// transaction = context.getRootContext().beginTransaction();
+//
+// VoteDAO dao = PollenModelDAOHelper.getVoteDAO(transaction);
+//
+// Vote eVote = dao.findByTopiaId(vote.getId());
+//
+// if (eVote != null) {
+//
+// updateChoiceValues(transaction, vote, eVote);
+//
+// // Don't touch to pollAccount for existing vote
+// } else {
+//
+// Poll ePoll = PollenModelDAOHelper.getPollDAO(transaction).
+// findByTopiaId(poll.getId());
+//
+// // Retrieve existing account
+// PollAccountDAO accountDAO =
+// PollenModelDAOHelper.getPollAccountDAO(transaction);
+// PollAccount eAccount =
+// accountDAO.findByTopiaId(account.getId());
+//
+// PersonToList person = null;
+// if (pollType.isRestrictedOrGroup()) {
+// person = validateForRestrictedPoll(transaction, vote,
+// eAccount, ePoll);
+// } else {
+// if (eAccount == null) {
+// // Create new Account
+// eAccount =
+// accountDAO.create(context.createPollenUrlId());
+// context.getConverter().convert(account, eAccount);
+// }
+//
+// VotingListDAO listDAO =
+// PollenModelDAOHelper.getVotingListDAO(transaction);
+//
+// VotingList list = null;
+// if (ePoll.sizeVotingList() == 0) {
+// list = listDAO.create();
+// } else {
+// list = ePoll.getVotingList().get(0);
+//
+// }
+// }
+//
+// // Link with existing connected user
+// if (account.getUserId() != null) {
+// UserAccount user =
+// PollenModelDAOHelper.getUserAccountDAO(transaction).
+// findByTopiaId(account.getUserId());
+//
+// user.addPollAccount(eAccount);
+// }
+//
+// eVote = context.getConverter().convert(vote, dao.create());
+// if (!eVote.getAnonymous()) {
+// eVote.setPollAccount(eAccount);
+// }
+//
+// ePoll.addVote(eVote);
+//
+//
+// }
+//
+//
+//
+// } catch (Exception eee) {
+// context.doCatch(transaction, eee,
+// n_("pollen.error.serviceVote.getVote"),
+// poll.getTitle(), poll.getId());
+// } finally {
+// context.doFinally(transaction);
+// }
+// }
}
\ No newline at end of file
Modified: trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties
===================================================================
--- trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/resources/i18n/pollen-business-en_GB.properties 2010-03-23 11:15:12 UTC (rev 2955)
@@ -7,6 +7,7 @@
pollen.error.serviceList.createAccountForPersonList=
pollen.error.serviceList.deleteAccountFromPersonList=
pollen.error.servicePoll.addComment=
+pollen.error.servicePoll.createChoice=
pollen.error.servicePoll.createPoll=
pollen.error.servicePoll.delete=
pollen.error.servicePoll.deleteChoice=
@@ -19,6 +20,7 @@
pollen.error.servicePoll.updatePoll=
pollen.error.serviceResults.importPoll=
pollen.error.serviceUser.createDefaultAdmin=
+pollen.error.serviceVote.getVote=
pollen.error.serviceVote.getVotesByPoll=Unable to load votes from poll with uid \= %1$s
pollen.error.serviceVote.hasAlreadyVoted=Unable test vote existing for account with votingId \= %1$s and poll with uid \= %2$s
pollen.exception.load_configuration=
Modified: trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties
===================================================================
--- trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/resources/i18n/pollen-business-fr_FR.properties 2010-03-23 11:15:12 UTC (rev 2955)
@@ -7,6 +7,7 @@
pollen.error.serviceList.createAccountForPersonList=
pollen.error.serviceList.deleteAccountFromPersonList=
pollen.error.servicePoll.addComment=Impossible d'ajouter un nouveau commentaire cr\u00E9\u00E9 par %1$s pour le sondage %2$s (%3$s)
+pollen.error.servicePoll.createChoice=
pollen.error.servicePoll.createPoll=Impossible d'enregistrer le sondage %1$s cr\u00E9\u00E9 par %2$s
pollen.error.servicePoll.deleteChoice=
pollen.error.servicePoll.deleteComment=Impossible de supprimer le commentaire ayant pour identifiant "%1$s", appartenenant au sondage %2$s (%3$s)
@@ -18,6 +19,7 @@
pollen.error.servicePoll.updatePoll=Impossible de mettre \u00E0 jour le sondage %1$s (%2$s)
pollen.error.serviceResults.importPoll=
pollen.error.serviceUser.createDefaultAdmin=Impossible de cr\u00E9er l'administrateur par d\u00E9faut \: %1$s (%2$s)
+pollen.error.serviceVote.getVote=
pollen.error.serviceVote.getVotesByPoll=
pollen.error.serviceVote.hasAlreadyVoted=
pollen.exception.load_configuration=La configuration n'a pas \u00E9t\u00E9 charg\u00E9e correctement \! Veuillez v\u00E9rifier le d\u00E9marrage de l'application.
Modified: trunk/pollen-business/src/main/xmi/pollen.zargo
===================================================================
--- trunk/pollen-business/src/main/xmi/pollen.zargo 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/main/xmi/pollen.zargo 2010-03-23 11:15:12 UTC (rev 2955)
@@ -1,90 +1,94 @@
-PKO�X<pollen.argo}Tˎ�0��W >�LFU�a�tѪUG�v9pW�1�4�����v2$�����uMe/��B1n��e�Tu'Z�a�T[�!�FB��CSW����)�����C�晼|!���ڞ�@���(<Q�0�M�V�5��
+PKΕv<pollen.argo}Tˎ�0��W >�LFU�a�tѪUG�v9pW�1�4�����v2$�����uMe/��B1n��e�Tu'Z�a�T[�!�FB��CSW����)�����C�晼|!���ڞ�@���(<Q�0�M�V�5��
�F�9F����??��@
�|�sը�D����A/4
-z��z�`�H�-.�-M�{G�S3*<"C}II�(�i��7��rQ#e3eRy�G�$�Rcޑ�R}���y�A��h�+����aT&U`����z�N��j��8���C�qw���;8b�Z7j�J!D{���y�^v`o;(��Z��+����s����vaF87�1ۜ[f3��C�Kʛ���*����eIJ(�Z���&��b�pږ�o����>쿽�E�h8����[�K`[ڹ��Av��PK-��\��筟�� �}���s�A��^z�2�u�RȞ��pF�X������|��b��wc�N���]�>�5������u/tB�L��O�������̎ۖ�<�PKptB�PKO�X<pollen_DC_Pollen.pgml�]k��6���_�۸�O��!J����_��d�d��b�P�j�ﺭ�3����/%�z�E��i���E�m[r7�J����w��e>�-W�x��]9�h1�'������>\���^����~��F�S~�o�����ϣ�䇫�zr��H?�D��r��N�-^N���4����&�p�_�V�p=�{�^n���2��̮~����y�Z�o���KF//}��������DŽ�o����OO��K�q��N�u밋�F�k�D�/����1�ϣ��w���w�e�y�}�a6u�W���oI��"�7#��r|�/���5\?��f����S8_E?���2���^�ϳ��{��5Z�ɯ]�/��������f������e����P��ni�MO����}��q<���/�>��Q�v���x����ŏ�p������w��ٗp�~������e4^���<*L�U6%���!������v����d��/p��;��l��N�ɾA�j`�q9�7�a�F���"�U���!m���VK�R6!�_�o67��WL;4�j��w���_2�� ���f �h
-�1���ߓ�30dՈ3���YG���@�8<a.0��=j��8F���?y�����yO�wg�p>��Hc[��c<�Ho&߽��o*�����j={��í��E�����2_����ߝ���e�����>��}`I�q������`B3��g_`:�����qP�0�@�:y6ތ��f�.�*E8rX��{�p��_^������]�s��sص*�9�{�
-s�.�q���n!<�a.�5�q~[�x�p��ܦ`��<��l��Qc�
-���5�^�/�:��A��~�|���CѸ���
-]����\�&#���QFv.����h-�(�c�˹gu9��K���˕�)�@��3]���9�
-���S����2ܒ�'����x�YL�<������A0����%^s���Mk�d���vq�����p6�.?���L�l0�b�~�Zy��
-�0�y�A܄&F�C�{ 7��X�}�*M ��k�؊��ɚ���c�2�� &dT+��51hb��ʦ��41B�qx�80�Ak��!A+�|&������h���!ӚX�<o��*̵�@G�&&�9��^�#B4hs������A��ݧ�hkbȴ&�2��3�W��E1�Z�@�
-���N�9UL�t�|4u��=��T1�"�(�C��2
-�U���F�ALD�C��9�u�k�Z}����1m`�ڻE�i�\��h���V��9�qC�=�{6E�ՠ
-)�ЖV��G;���3��&|�mϣpQ��W�9�,�,|�Z�b� �
-,ܯA��dHh�`��@BBÀ�^B#����u�7#��R`���0{��[����|G�`K�m �j�ޖ8�e[:y:Kgd4��X�:���lF�DC�L��d����g�aȹ������h����\�H<1����2��ު6��Hc�O�>�9�U��-=K91�q�4��#-
-ړSq�r�i�C���r��[�3�lcK&w�p�������&9:��ױ�����h�p�[*�X�^����$���_9gЭ0�R�BD�E�����iNy�����vAJ�C��To�o
-Ⱥx�PJ�����s<G���1O�S�8�FP�Œ�"�k�k �P�PG�I��j��t3���=D�%�cD~y�h��XG�hYxP 8�C
-4|<�W�D3���V��]`E:�{vj�7���|m�(:�C)gp]a���K�Y}����W�,�Fx��2�M�^_2�:L=��u�ȿ��h���a^��dP>��iu�1���ņ��W/9Y����Lq笼��U�8="�W졦�?>�MR��T_TA��NC�2�"�(����6�Q���#��a���\�wm�.�̙�rj�b.�\�W����fDi�����ڊ�{diR���m)�X�3�((���+戱�9рV�ݣ?��"U��@4��g�+�T1���0����@7T̥�WT̑RŜH�%�:�t�b�s�a�٪r�?1[7�F8��]�#ت�V�����!ҋp�Eq�E<�kUs�YfCQ�c����9b�jnK(|o�n�.Bў��Es���><����ő�ֱ�9��%����ʷT���fN��^�C%W�^ho�%RŜ��s����-7��>�_ӱ'�n���H�!%=���==&w3CzK6�!'e��^=�P�m�C+�&i{�"�|_-����jV�)�I�T,ӷ[���z�!�W<�Ck��`�e�A�i���
-=�I;�@�u=�c�\ŋ:=��@��1k��1�G����V��p��ch_��d6T�b��m=��@�a�.�~�[�ÀM��[O���èr7������1��Ck7�zL�J@+T��Vv��yth�W�x<KA�n?6��f�t�b�_o���c�\�?T<
-��q]��=����~�'Q�L����d��p����7�$��i��_���ye{i����ȿ�#z��8��߬���/��M<]���.�����Vz������c�_������Ba
-�@\+P�y3_�^y �K�W<A��Mp�ײ�B�zXLn�x]�`�j|
-�^�VLA����>�`㸻��~&ӯ�D�9�(�au$,$�ң�3��?��n������<3E��+3����;^^0�⪠��|EP��r�o���ݞU���Y{�;�_^�џ8�1��������.�V%���ʲ�Z���S���V�)[���@�`'˒�T���l˓@hcYZ�S����V�3怘��Rhb�%�:�cH5N1��e1�`�"W!]�mw�Ue��.�oF.ƻ�F+�n=���E3��e)"���Uq���lֵ���n2T�1`�(ݢ��a��W&{���y��4�ue��K�+�i�Y=�cI��%����ʷT�|зR�����\4�,���
-ܡ���ƭк���[Z�������ɶ��E�6�ɄM����A�D{���ߌf3�2���{L�2�:�ɪr��xW�L�;b���u,�y��J��e2��e2���P��<���<��0������l�}E�=U��v�� �p���� L�t��c?����Z�˜����̥rw��B���Q�;RE�Jw?�aZ��[K�Z���Ɖ�o-�;Kĭ��D÷��e���Q���!
-p������5�1ը�[���d�>Oj��4��yG�����;�]� ���UU��d�p���E���҉���fX�I�F�{1���i���<-(��%�`�k�r�#��B�F{���X��d@�J�J���@*Q+��h5��3�R��4��Z�}|d�ZP*SC��Y�:�t�Pm۪�S\ 0[���r���(��EQ��2�@*X��%@�Y��y{�4A�J��� L����Z���ѮZ�V��hE���t8�nM�P5�����:V��t�d:�:\����@*^�#�#�L��a����lBMj�F@��a�Ú��0=�Mq�[mMUP��2��n���p`c�X7��t)��$*������*~�ݵ��*}9���\���*�_��6RgW����Λ��ҳA����o��)�$>����ԣ�8!S����k�H�PI%����θ�#;��
-��"!B�TBфjۙ6�˄ ��/�h
-�1�!��@�8�0�����0��B&��uB!��� 3R0�L��Z�J!� ���3�qU
-�B\[�E�jM���Ω���fQ�a:�E!�Tܢ-rL�j�[�s��ǹ��8Q%�<Z���:�*=�QnpUz����5��L2��V�5�L�=�)Фh3��{�k�Z�#�BM��2��p�r
-u�Y?���z�r�J� �E!6��z�Љ�8�w�h�vA����f�����*ak�AӰ��ٕ^'���a�u#đmK� ��' o|
-��
-�����{P�غ�E�o�l|�+��=g2��I0��a۳���7])vE�b.�\/�Ge9Ϥ����\UzD�u[��G_�2����,UppdŅ�+8X��"1���ض��۞�$r�S��*d
-��;����E��f�!�y@�����PH'8ʡ���Ώ�����ͼ��/�l�3 r�� gnW�� �Z���O!�q���Y3��sOE�v2��K�8��t�~Ɠ�x&�Ɛ���ئ�?��I�N��T�
-�[p�M�8z�o�t4���-��N"�;%{Nq�j�z�jv5�V̈́'��"���U����_���s���m-��ՈS`��
-?)�KC�&n�n�xm�^�E;�g_M�a�Y56��N��>��"�4{i��W�v�g�},�x������
-R.�0���X@�O�ѭ����E�D,خ`N3Y����$x٘/������i�!�0[�tZ�������\�%KfFXh3z9���E����&�v)�JRz��X�j:�SJ����]O��z8o��R:-I�B�7q��Hץ�d�����@<D�j�i�#��"u,�p��zT�����ыpT����z�k::��2���G<x�C�}���ѷ�����D
-]�5���k�Е��4�5G�k+5t� v (�}lv�s���|��n�F@K���]�A�v�9.�g�[��~l����n��vvRY���^�I����5������M�>Y3������q�8�X���n��m�3�-��f�]M�n��k�P�JB-������L�̒�g�tÌ U���}2ᶋUL��p).��˦`�X�$��R$�Hxc��� V��W�U�$V �$��aˡ�bU�H�̊Tit#�E�����[k�g& Ubt#�x���Y>Yׄ*�8Q>����e��#�}����������U��鲿�b��o�6��Yܰ��UJC�.�JC�M�Sq�=`�]UZ�Q�jR
-5��`���m5�k�T�)��j���(�x��%ެl9��/��&��E�<��;��.����5'Y�e��J�k���#�{x�6�i�t�Q��z�x�6�9���i�7�eų��M+_����*���mZ7�z����[L�Y�#~��^��6|�/��&b�5� M�Hh�4`����9=�o������&���\2�á��j�&��}88��}����I.�t��%}ͺ9���t�
-}k9����g�پ�L��0��q��[���1���8c�i��R��M��K� �X�����?4�s����\��
-�9'�'�)
-�d-�ma℞b-�7�l��9U"���e��y}�):w�J��ѹ�kt�!��2�y:t�Ι�_~����1>�shG���y>t����tS��v6w���$^J����S�Q\O�"���b������qތ�c�I��Zj��̼os������r��XA��
-���U�
-rK[��l�G�`=�϶��,�m�N��oBk|������Ch�� aоh�ư����IG9����8��}�F+�c�v>pͶ�H�������-���2�К����n�
-Rm�a���Tvi��P��@�_�E{���l������<e�;�ԠCt6h��l�����c{�Φ��t6�=)����=>�y��u� �zE�)Фhh��(|���}/]�i5�Ю�����o��[�p��[�6�~$q=l�4���7|U�����@�Տ���]&�mEg�Mߞ�����{��a`�����9�
-9��Nߞ�ؐc>d���7]l���ur��ņ�!9�����4F�'���*�T܇�DŽ�]��;�}����������&t2�)d
-��)�x�ƊÕt)w7�s�{t�^��s��tN�'����<�3��q:�;I��!
- ���s��t�$�����ιL:�4�q��,5W?�z�vN�y�>��9�VD���^� =�7��l��5����l�뀎�&�P�@�ox{��&���� ��M�j�p�,^�r=>w�i�f��m>���at�!��=fs��l�l�����J�H t�j�\���9�s2W�7O��@��o���?'�s�bg��C�_�r=2wбzf��]>�m&g+ٜ:9ېι=�swkf�t��7�������9w�s
-�7N��~ӹ��|�y:�t�������*��TqJ��]�?J���5<Զ�s'��Aj<�w�������K��+�h�#
-�X���!�*�N��X'��>�g��Y繟I�/ �:@d�Y'�6��HͲ��?�����v�u��r�v���.mZkw�mJB�"�(d�5L<2yď!l
-����y��0���=��P>wȬJ���9{�e;����y���l����=�L�o\ȳ�\�V^zJ��'r���ֺ���o���6��`HI���k�k�2����PK�ʜ5RŋPKO�X<pollen.todo�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��q�(��;�D�*���+G���*(�8z)%)J
-@% ���,.2���E���9e�)�E�%��� Y,B3PK4�[-m�PKO�X<pollen_profile.profile�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��qq��e��q��ÙPK7Rp:BPKO�X<
-pollen.xmi�]k��8��>��5�U=S����ҕɖ��[S5I�&��~ κ��'��p�6F`��"1�;����+��{ӫw�����=�(��`���N\w38���샿�l�����z���Ͼ?�����]��.����G�Im��v���'��w��O����}v߿�;�@{&)3Q{P�Y���_f�
-w��Ͳ�[|���������n��`��$��u�~߇Q���a��C���G���,C���Oo9�o�����/�F=������B2�/گ�>�q��3�a�>��}.�sQ� �C�������/�A����G~ۯ��ʿZ�@��ǯ/�cz��C�f���9}۟�;淟Ņ�����^DXH� �$}��#ӦN��ݬg�2��\T�sQ�溤ێ��Q�����!p~=
-��2\٣>��������=t|�w�ʾ��.��7�aR����^��K;N"���{�ӫ�w0��"�-t���7������{�f��-٦��$��@���,A�;=}V����n��pA�@Ņ���릇$?��^o���~�������x�Y�ݗ�T��T�?��}�N����J¿��~ѯ���_�=�SQJge��8��$خ�bO�M�� D��((���Y�՜oa��|L/�^`/�٤��9���1^"WF{�8o-�Ӎ��c�8O�"��`� ���6e�u5��]�ٯ�Y}���SN�m�'?�O�{�;8����Ē}�$�3DK�$�� K{+�au����|��<a^��ܴU5S�x��qd�dU(O��q_�S�h�A��:��$�|���'�\��(f>
-4�t��a��ew��x�_����i�� ��3� ��I�����>��`�>&�&��T%r����2��Qv���.��)���fŠ9����4���?������������\�:��v�ߩޔ=�nv��?WF� �=�KU�F��=Yg��?58gM�r9W��j�I�jQ�M�^$��
--���!�����{�?6��N����iK�+�i��4p���h@L��]״��d�A6C�\�h��&x;?5M&� ��t98��Cqqx<@ǯ��gw�f1n�
-{�-��_Qx�Sc7�#$�����s��ֺN(�`����?N��-�g���C�{��o^n��A�+~o��6[�OS��V�ȅы�>�3tQ���nOO a)m\�kY�,���l�][b>P<MS%eQ����������Q�Y̮Du�DI�`.ݓ�F
--n$b��4��8�P-b����Uu|���U�5%U�4O�dU��J���F��1���B�LA���
-��{���X֟,4�C��@7���/�t��2r�).n����0��Ck�����a��
-�0D:�%��i�'�[��]z��^�K��fD�%�#�8�H��P������gtWv3����Dӓ\�TP�]b�Ar��E���?5�"w W ��b�b��b���������S�\�*��:�+���Ʃwx���TK�sѹɋ#S�}^:�y�th����(3yѡ��%�z�1�]M1udT1y
-"y��AP�҉�����%�s
-�����i�~r���"���1�\�A��Nr�HtZ}�QɅ�.n���l����+7�}��rgk��WVq51�����0�{�j��7#�.nF2�R\\I�!%�t� f��u�53(���\;+7b5�vV�/�$i�F3��-'<|c�UF�V��H��r�1֡�����8����9$��GH1�#�7Wl�ÔJ���:Ŧj┉�D��8� [�C�#���@X3@F�v+H>7] ��[I1��.9P�}�!��YcI~͵^a�Cr�����eÔ$��K����)D��f��R�o��qcl�2_;���v�3#e�)�����]�ud�bV�?���7HTnjl�D,.�oa�!v��_�'Q�^w�[U��1�N���0�łT�8D�p(5`m��Xil��O�M��D:�60L�|X��
-ٍ�E�m�QRܲd��"��t;e#a��)<��%b����=H�H*5��ZH}!V��A��b�t6��I�RjH����]��'Z�<)ψ����_.�IF2�����T4������D�H9 3����wv���K��(N>N:�H������ɥS'���,�l8�˔��sU�����69�u`�@�=:y��'?�3�LF���|�,zE�] N�z�[��5AZ6\]vm���Y��@�=�-�pD�����Pjp��@�р���w��s���$��9���G�Ğ|�d&��'�Ӟ�ac���x��B����k��T(w���ʗ J�����7:2>?�_��G�,9*5�IЀ)]�G�l��$T1tIґ�p
-��+
-{�8��.>��»,�*���i���Y5<ͳ%[�2j�(l�dGQ���a?�N�0�:��"�|�A�kz@���[�j�j\��g$v|;�ޣ�a��@����'��a
-j�9K�%O⌯��fuȪ'� y�R�֎d��(�&�u�,�W�*�e-�JP\�����m�^9(��q�%"�mH��Kܧx�7&�u���pA���TjpC>&�Cs�@n�q2�ꐉI�yrR���i����O9��T����1�r�#炷� ��B��N�[��
-� e�'Im?=��[ȍ|��y�vk�<Uj�����W�����G{�5�D��f4Ɲ�i��0%:R���y��Ԁ���kh���� I��� `�����ɥS'���K.����g���Xi��d�=L�7D��F�x��f�H���h:����]�p��o��@���xt
-APN��G�7���>*.No��5�����X;g">���T�CV�&��+d�p6P�d���\@"�!e�b�ŲK
-n�J����p�6��GK�=]. ��Ew�|�����;;�ȇ�X�م���I$:V���y}�R�J<#���lL pr`��]62��f|�D�)��=@�JPjpC\p�[������ǎ�zPj�37���_�&p�@,�!3�A�,�R�����H��2�M�K��V���$�0 �q˺�� �ͬJ�kB�E�
-��F�u�7�g��^ꄩ�P�C�!DN�7D%W��
-��p�tWS4�Y�CN��J<�J)!܌�@$��# �y(����� ��)�PQI1+�ƨغg�747V������Û��;d�+"���U��M�`�m$^E�X�#�@{��J
-nhC�phL;ζ&�1媸D22� �7.5�:4&�8`Ku�dc"�<ӸԀ5����eV������(�?����BQ��QG��ď�$��Iy��B� ����^�sِ�R�^@( ���*vg���)�;�XкX}>��.��.7%��r�
-AS���nt9&�;A��ʂA,�1����]���-��t�/i��"�3U��Z��^�8�v�T����#��Pjp�qH�0][���噞c��ާ��C�-��K$'��=���taD.�8t�����X�w}����m<KB��b)Vɪ݈����s�A��u��z�:p;�Kc�gΑ$F�G��o3�̭����\��6��������6���3�0h��Fr���e9���3����H�9̞D��DI�`�������?jM$��b8�h,9��0�H���f ���cT��G�n��pF%s�%1���rO��R����GR
-�v*h�MJ��jѫ#wru��5
-��.� ��a�'l�nq+���oz�k����ڐu�HA�ȵ�����&�m#Ѥ��r�W�ў2�QҰ�b�C�Z�lWIl�*�<�)h�δ���7A�@��þ7"� Ϗ>�Q����s���W�d�0ȴYy�J��X�-�V��贼�ēs�����"p+�ċ�ܚnG��[��a��F��ȕ����Ӯʂ�Mi�|���7��@f^p��k����O��HMz��Z�o`o\���r�0��ѫ#�����mv�<K��;.5p��`:I�Rѩǃ�T�4U�qCX/��{��f�Qղ�$��W�·�7�&��sFV��6*z�z����k��m_��h��HMz&9��pgk�xD�;���[�Y`�R\܌C�q���L����S[~���Gd�����^TO瘢B/�5UOV���zH�%؎j�b6Q�l�H7��M�!M8"���f�UȰ�y����U%[Ul�ɨd+d؊&:L��Q����7{'K��^���o�<G��������ˍ�"�RS]C�L�̙F6�T���B�悗�_���%C$�aO��G�����[ר�X�xe�@�%�I$k�¯���b<�,cTLCZ�4�.��d���+�W�ڿye/Cvq]�k��h>X��-7��z�$4�<J��b��HG����Q\<B9AU����T]��������r@��}ǻ>��{sV�m��1m;�U(p)��ӻ��vM��x��
-bx<�!�������O0�_�ͣ.��������]N(U�E��<7�'54ہ*R��j�F��Fq�����z W��m����,��2kͼ����1!�dm�c�8��[�߶�ĝ����۟�b�����g0�l�F}}�ym��]ڵ�T�l#���u�b�i��x�A�G��Bv�)b}�V"���|N2E{Zi<b�
-�d��X��� �[����H;���Ί�yj��\�i"=$�nB����~�oD�26��`]o���e�P�|�B �ۼ�>K�����Vzq1������f-�N��Cv�ӑ����';��nZ��G��,�3לf�P=��<����:�ܥ���F�����g�� e'�.��ft�m��l��0tV����yu�R*�>�|h=���gQ!>�5?XC��V���o���ʁ�b��ڱJi��-�\;V+�
-�}
-�˪f�`@|T�>kͨ�ζ5�(��ޅѝ,8�*�'3�v�u*�g�:{�X;j���o#� �
-�z�g>
-�U����G�vY1 >*��
-�Vۆ
-�y���pY���G��;�_��9����x��,�Q��%R1�Df��(S!?����i0�,�Q��iP^,�Q��% T�oê�h�Z�>SK�/1
-�؉i�ȩX<��.�ʏ�lK���R*?�
-�YA�~�/
-
-!#K�N��ϤB|����B��@��6����0=V�.
-
-nSK��6�S|*K��h��ҨМ5V�.ܧ��v1h��[��rˠb��n�0�p��V������ɪ�kR1yMF�]�%�w���]Ґfj-�+���T�N�Q�rY^�ҥT|T�\��f�Y�T���)��s�#V�#�VNJ
-o��Uo����w��ˢ"Tn]��C���P\,��ˀ��T�o�m�$�{�.i��ȌG��Ӽ"�4�ˀQ�*J�A�U���*p1PbS����×���7<n��>�9\�hs��)(����BnU��E�E�jv �.�^���b�$�v��(I����Kr7.6��SS����F�#ă����PL�j�m\��qa�����]m�z�Q�L�l.*˄F�2�]�����((q`W���AA��x�8(����_�.��;��)�*�Weu����࣠Dk�?���d�x�����m=�AAU<����pPP�G���L#��~��ˮk�@sRȞl��胼�.�\��y�%�ܥ�L��#��$��X�����
-�b��F��#g%�@�'A���S���ԥ�F��cW�$�<�̔؛����H~�=-�S_�ﳧet�#���=o$���z����eI0w��������L�2���G�~ ������Qϧ�@��Fe��ld2�F.�|��������:3̚�i���DA����0�Q�g;�t虊
-�Q�<ՓU�Fm��NO�$0ry"��LO�85�c���E"�ۛ������� ��?�}���PK��t���PKO�X<ptB�pollen.argoPKO�X<�ʜ5RŋGpollen_DC_Pollen.pgmlPKO�X<4�[-m��pollen.todoPKO�X<7Rp:B�pollen_profile.profilePKO�X<��t���
-pollen.xmiPK1�4
\ No newline at end of file
+z��z�`�H�-.�-M�{G�S3*<"C}II�(�i��7��rQ#e3eRy�G�$�Rcޑ�R}���y�A��h�+����aT&U`����z�N��j��8���C�qw���;8b�Z7j�J!D{���y�^v`o;(��Z��+����s����vaF87�1ۜ[f3��C�Kʛ���*����eIJ(�Z���&��b�pږ�o����>쿽�E�h8����[�K`[ڹ��Av��PK-��\��筟�� �}���s�A��^z�2�u�RȞ��pF�X������|��b��wc�N���]�>�5������u/tB�L��O�������̎ۖ�<�PKptB�PKΕv<pollen_DC_Pollen.pgml�]k��6���_�-,�SWE|��:�5�W$�F�i`0T����U�;������D^R�Mˌ,�Lْ�xxyux������t�%�/&�����.�l��&�����?}�/���������?>>^������ۧ���W���_�0J���u�[:_��q��e��&�x�\-��r2��b9_
+��yr��\���Ow�x��__���^^��%�//��/< ��"�<� ���·���yo����c�
+��,~I�_����c:�&�������t�����d�m���O�ߒ���D�go�7��_���k�|�<YL����x�H~X,�y�.��&�'�����k2��_��^ȿ=�!^.���2����{������}q����oz�L�|�+?�i:��y�Lv�a��Iʗ���\�8����>��?~�:�|�����+?�ߛ'�e<O�҄\�����8�������n�:-��^�}�9�����=�oF��v\^�
+qX������FtU bhHk��mg��e_)�P��7ۛry�5�M����%��`c*#@�H� �d%s���A��Y5�]��,�?��q q�0��4�d�A��ß<�3�Wp�<M�Ż�e<��_侭x�1���7��^L�7���j��<M��z��%3�(�_�e��!���;Y~�˘���y�}�][ǒ���"��_8�P�L��l�5�� ������g��p��f�
+���#�y���nw��k<_��߾qs>
+7n�N�9Oz�Xn�Թ9�����-����e��:��ok`#n۔�㿳�b��M:?hLF��zwͻ��K�L�i�����3�̶�F������\����~K�fG�%G�,9�\��e�y�-9��K��ɒ˦�钫�S^rE�W�� ���!S4ϺA8@�~J�������������7�xf�2��&5p�wԣ���%]r���Mk��d��6F�v�O� ��7����-��n灪o(T��D�QL�
+M��7�8�@~�="�&V�
+�41$hb���c+Z�O$k����UhbȢ&&��UM�L:�������'��dnhb�����J�&�\C�&Vu&�L��I�5����@C�5������䔛kk��MLps#37G$���uO+O�0�
+zH
+�1�ĐmM,g��e�\ל,�����T ��w�m.�Ωb�E��G�EW�G��!@�,B��A��4�WMff
+1��k�,D�}�_���k:7T����h����^��4�/��p4����pdܴ�;�{7E�ՠ
+)����ЎG/�ل����C~���$��b�`N �=���g�U<n`�a
+�T��>�����$��<�4���,���������Pܩx��38�%[��hK�P����Q������Z8C0 �ь�͢��,E3Jf d
+n3�̠e>�C�e`d����2r�5�\�e�$C�#�z(#K���0��F��BJ����rnm�X�a�cd��ʉ�m˩�k1��4ӡPS+1u�-�l7��&��Yp���������8��\p�_�\6
+\�m�K�����d���+���X�^�H�HV�@�9G�9�*_X
+\H@c@�E���#]��x�z�) ��އ�x?&����9��{��g��E���>TTF� ցk ��P�P'�Q�C=�P��@u�g��K��ډ�����q�L�ɼ�H8�}4|8M��0���V��.0#��ֽ;7���f:M�6�]�ء�s��g�dzt��%]->��d��;Kğ�-�
+}���K�S'���x������,V�e#��[M%D7�|��d��F���-'� [97�p"��3� g�o�r�����]V$5���E��w�g�Ze�ӷ��!�o>i��#?�l�5=W�]�2�+)s6���˘+8��sa�P�����_(r6c��<p*c�T2�8�e[*"�rv��]��jKGϘ#�2�D��1w��4��Dʘ+��h5��'̘#R�\F�0��?��Ϙ��d̑JƜ�H�-�ڑt=c�s�a��B[�O�����'t��v�õ��C��9��q��<\yS�v�Z�\e��P$�De����8k��͚[�0�,7��ho��Is��><�r����[�r�T�-���˭z�6g�H9s�5���ϙ�_�3�"]"e�I9O�
+����s�d��c���t�Wn#=�T�{������gI�aY�r�I��cJY�N�1T��0I�+%�u�jKG�c�]=�d@6�S9M�m=���1P�8_�z��cP�hؿ��cr�5z��1L�`I�����|����z=������������ �Z=���ÝR����d��� �3G���1�z˪�{���1(btp�����5�����ki��k�Q'P�1�*ը����S
+���%/�p�����P�{���C6���t5&������Q|���G%ﹾ���K:J�gZdw�?�M�vn�z��M>I/|���W�������T�G��?���ȇ�d>N���7�}'��>qϷ��K�Β����^�J��&���1�xzZ$��J��u� �����.'�ܑ�ߑ���� ��&��k9�{�i=�F7�Y��z�S��>@/g'��E��P�s�u�}Gq?�������P��aw$l$�ʣ�3��?��n������tg�����l���7��df�]A��Ŏ@��
+�o���]�U���Y{�{�_^�1y�1���D��Ї���p�N���ʲ�[��S,����W�أǁ��N��ф���lǃ@hcY٤S���P�� c@L�b)4��\��ч�����IJ�B���+���G��U}���������x�ר����Z[Z4:XV<��K�C��� �f]��P�_o&Cu���-Ɓf�}eV�lVZp�+Mn]Y}�R �
+���+�cA�J�&��J�ޢ��0�o�`}
+��)�hZY����}+�
+[)2�ue��[Z�c$���Ѻ��E�6�Ʉ"���b/}��hf�س�l�$�w�c;��ձL��e��]�v��v!j%�c���'Vz-�t/����Zح�1�n�1�π�(fн(fC��5��X1̠�1L�3�H��0����y�~�/+-��ˍ��ߏ��K;��p��ɝ�&wDG�*w�?�=�~�,�k���g,X'����$�~l��Y�ז�?h,p�%��h_C��*�;���Ac�Q?�����82����i7�!�]'w��AZyw ��N�`�r#vW$�4`w9�)�?�dͰ��5��k1���i%�s*=-���e��`Rh�� �Ԅ�HZJP��%�Id/E��p�NQ��������Ij�����A�qͣ���7��U��DW�,C�J����nU�)�kV�MW[{9J���!/�VM$%�I^� �y�r���i����U�A�U*
+R����c����Z�Њ(�,8����dZY�����)\�2ה.����z�6y-���d��<�lx�iU�Ά Ԥj�
+vg�S��g�)N}�ͩ�*9UV6��eU�ll���ɟ.W�D���#�������؉ND��a��kg���
+���gɲ���ٕ����{3X~6H�-73E�$$C��z���1d�X�~� ���Ғ?��w��.:�U�=�H��5�P4��v��M��2a�@�K� �dnȄ�8�0$�:`�(��� s�52!ǿ�
+�$�O���I�eB�_���:���hU"�]\���������$��B�ŝR#���)͢2
+�t($��+��b,rL�j������UBi�yPa`���]qS �+�S�*W�g\���k�A&�em�5�L���h���@1�3�5],M�ϡ�z���c�k�9��j������ˡ/+�6�����#t�mB'
+�ޭWӮ�
+�P�`w�mW�6+ag� iػ��J����r�]-�8�mi�3���p�]-��ط��$خA�s�j1D��_�*�z�+����$X.yE���'���7C��V�e����<�l!晥��A�ʏ�b��E|���u+�I��JGV�8`9���]�����`@��"��z����N!��d�)8�$r�S(����}�s�x'��;��$�Np�]I�������/�n�3sr�'g�*�k-�B䈧��r_C��;iēt.�H�ΦC��>Vn1�x��l�1�o�[d�(�ϵޤx�����
+���E�8�b�e��p�Uo��;���8űo5���C�i5x9�)"M����5�Ɍ��'S9�?r�6N���S=��@���'G|�=b�,B����p�k}y��x��|Q4Q��fz�!m���}��Y�i���@�vX6��1��%Y>��=(H5��bEa��~��2�`��9�Ax�l#��GF��1fC�z"aҧ�l���\��iEN/5��f��s1�,;3�B�����Ԛ�. �6ٮK�T��+�ǪFPә�R:��t��8���� ����J�"�n�(�R���K�Y�����@<D�j鹇#�l<��p��zT��E��1�pT����z�k::��r7
+]�p�C�s�����k�;�&j��Z��k�c�r�y�ך�Zk+5t� v���������*�u�z��V4��5��)��vs��^g�[��(���n��6v����]��$H�DY�_�� _N¦y����i�>iv\.�
+���u���cƸ%�눽O��2���M�{��XE����q���;w�v�aք*рj�>��p��*&�UT8��S�eSpD�b�XE)���Q@��r�ub��U�+��vز+9�J+R1�"U��H@6ޭ>�E����IB���Hl�!�v҄O�5��*N�ϦC�y��T{�b.T1�B�z��h��t-n���D�JZo�6���6�a]���
+)�`+�2n������ev�gi�FM�s��jDk�>I+�z�nCh�^ˤdO l�p�t�"l<Kg�^��bϖ���kC�hQ�-ܪ��`���MYs�XV��"��>ٮH}���F7��N�3�7�o>Z����&7��8�ֻ��v�i���k��_%p��M�_��~��:��ot���+0ܖ���`;�DL��<��M����>��A�
+����䰰�K8���\M"Ɉ�(�ˇ���mڇu�OM�p��CH_�,�k����i�^�kl:��`
+@�=��ez�h�U����Y��?���L;t��o���_NƦ�/t��Ѩ�/oN�
+n��y�=xqHif{n#/{���e�t�ӉxJ>���l�G��s{O��:���F��^/cاsQ��}��২ ��s�0�*R����|�:���RG��9��t�T'�R"=�������z�$!\oDK�.�W?`�{3ȏUC$�k�EG3�-�v��{�^9���d��.��P�[*}�����({t�=ێ�=dX�e�^��oBk|�ܨ{��!4��0�������=p�+M:�~D�{��H��~M���*8�v�sd�-��s����Vvh�s��9�r�T�i��8:��]�a:T=0�n1.{����ϑ/6�]l��?G��ԠC\lP���ʛ�,���<(���A���kr������?�7{]g8�%��@=�P��O�͑^�m/S��p������[��6�����ц�/��TϹ�$k�s����n6ޯ0��J�Q{U&�)?Yl��$��x��t�LޮGm�3�Nߞ"ِ#~����$r���9���
+9�g��=A�!ǼN��o98����i*�
+9��1!u��Ŏ�G�m:G�':�5<�
+C
+Y-uʱޱQS1��sHY1ܐ���ѹ}&Vz���N�9s�5O���9�y:g�tw�ΙC4 �O�p��M�m�9�:��t�i��J�;Xi����7윌�}2�ws�RD���� g��nNQl�?k�wcRl����&���|�@r����&����� q���&LU:\9��܌��uZ�]>w[�E>��k�����[�]�}6Gϛ��J�H t�j��\���9z�d�>n��ў�5��6��N2�cEeoB�_�r32�ױzv��]1�mg�lN�mH��3�sw{f�t�?o:w�����9��s
+�N���sw��p�t���\�m�9�O�Ug���7�f�6M�kx�m����)���xH�?E�]!���{f���]$��q�}�Uz���Nr?s�O���s?��_�M&�4���N�?c�N�e��6�M����/��b��\;�Cm�}�4���ڔ��%4
+Q�2kd�c���[W��������=�m_>�ϬJ���9w�e;��f�y}m�}6��al��k6�.�{.[+/=%��9w�bk�������?�
+��m0�$r��5D��5~�^��PK���NIŋPKΕv<pollen.todo�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��q�(��;�D�*���+G���*(�8z)%)J
+@% ���,.2���E���9e�)�E�%��� Y,B3PK4�[-m�PKΕv<pollen_profile.profile�����Q(K-*���S�UP2�3PRH�K�O��K ����Z()��qq��e��q��ÙPK7Rp:BPKΕv<
+pollen.xmi�]k��8��>��5�U=S����ҕɖm쭩��R�L�~ κ��'���q�F`��"1�;����+��{ӫw�����=�(��`���N\w38���샿�l�����z���Ͼ?�����]��>����G�I���n���G��w��O����Cv߇�@4���h<(ڃd�֛/3I���?�f��-�A����l��w7t��0H@���:��(I�]F�0���1�^�#Ll�x�����Oo9�o�����/�F=������B2�/گ�>�1tg�3�a�>��}.�sQ� �C�������/�A����G~ۯ��ʿZ�@�㧯/�cz��C�g���9}۟/;淟Ņ����ӓ�EXH� �$}��#ӦΏ�ݬg�2��\T�sQ�溤ێ��Q�����!py���Y|��Q���������:��;�Ke�{`��?�0)}���Ϗ��'p.�=���U6{�In����_�����o���
+�M3{uŖlS��Q
+�v�
+�[K� ߝ�>���7��pAN@Ņ���릇$?�^n���~�������x���ݗ�T��T�?��}�N����J¿�>���_?�?`w٧�����q=I�]#Ğj���A�x9QPV��Y�՜oa�|L/�^`/٤��9���1^"WF{�8o-���=�c�8O�"��`� ���6e�u5�7��]��/�Y���SN�m�'?�OG{�;8����[�%��I�'���Y�A��V��|9���|Cy¼��i�j:��� �����"
+�P�,5��K�2�� 9FuȗI��1AO��&CQ�|h��
+@G�6���q�����;��g'<����T�&
+�w�o �A����}��D;�T�S�ȹ7�����'�-���?�p�ǣ�����D�C��"�^��vD�?���
+p���ڇ�zS����p(�\�g��8/U�ٗ�d�Y3������5���\u��j��^$I� DU7Qz��k���^����K����j��.���?d���X״Ӏ�i���р��#��i��F�l���Ѡ�M,��~j�L^��rp�Ç$����X
+@����w�f1n�
+{�-��_Qx<Pc7�#$�����s��֦N(�`����?N��-����C�\z��o�n��E�+~oO�.[�OS��V�ȅѳ�>�3tQ�v���O a)m\�kY�,���l�][b>P<MS%eQ�7��������Q�Y̮Du�DI��^�'K�Z�H�z�4��8�P-b��ę���Uu|���U�5%U�4O�dU��J���F��1���B�LA���
+��{���X֟,4�C��@7���/�t��2r�).n����2��Ck�����a��
+�0D:�%��i�'�[����f�9��V�̈�K�3Gqv��=2����mV]�Q33��
+M3W��ơ0�����Y\��UZ_��(rr�0R���-CHt3�F��r��!iZ*:���b������Y���7:��R�4�;��-�L)�o�ܿUjСyk"쓦�̼E�e4C�����t5�ԑ�-Rż)��M;����@�J'�ƫ#S�:�ێA{�� a�'7��Y�'��k��_i�ް���UT�ݲ��x�r�B9G���+7�}�rgke��Vq&1�����0<{{*���R.i�1��Q\\5�!Ռt� }�\;��CfP�!ӹvVn�j��[��n�I2~�f��Z:Nx��'j����Ò"9��ʙwX�0����"���O8��T�C!��k���\,S*����"욪�S&�Z�lol��(.Na-'*H>?] �鐱AR���K��2A��DH6k�X�_s-�W�`���ki�ks�0%���d�!h����Eg��R�o��Y�� �ō��A���Ό���8��[t�1fŬ�v��o��>�� ҉X\���C�N�N�L��ȷ�R�5bڝb��a��Pp8���Pj�ڒѱ�ؼ�� 3�.�t�-_����R��_�e[�EGIq˒�kЊ:�휍�����O��;�# $w$��r�����Um�F<��r{��DҤ(z}��ɟ��'O�3�e�'�ŗ��G�рLf,f�!��a4��5<��('d�bqq`���DS}ɞ���Ig! u����#��`�$и�%�
+�|��~(��7���&�,�j�g/���~�IV���e�1��Rʉ�Rr+"�`�&�@�F��ˮ-��c��j���#�q]G�#2��� ���&5���Y��f#���ُZ'����>�$�䪒�TpƟ0N{��������v�7��s�:��)�̗�A\����e��'N����ȑ�#G�7I0E�K�h���ښ�*�.I:�N���E���G�C�%�g0Rx���O��8?A�UQ� ���y�d밦���q�Av��:K����YS��l��o;(5`M��z�]�R�Aʟ"�����ob��{�j�+*Pm�h�0EA3LAE��E���I���t�b�Y��$�|Rj���т0��R�$��\��8#�JV�����\ �����`�sL�+�e:n�D��C�
+IB�X�c)��/���$b��q�.H���J
+n��Dz�BcN�M4N�B21�#ON*5�T�>
+���0�_�)瞐Ju<��5FV�|�\�V3A7]�Iqж0���$���G�|���/��^��P��9��{���]Ύq�'ZcO$lFc���7?�
+S�#��o��J
+X[+�f�ƺɉ���L�F��� ��\j0uhܼ��؉�C6�9
+`���=L��TjpC4�:�O��,I0 �MG��V���뼃��`�-�h��t��!��X����� ��G��i�-����p3��b�@�7���u��ؤy��R�Jc�l��H�:d�lR��Xv��
+qA�t9��f��d)|���$R��.����^\���cg����c:�0�r^:�D�*�� ��YjpC�g$���� N�,]w��F>܌ϐH�#���S J
+n�^ᖀ$��32������̍���W�� �<'�x�b�<ˠ�����h�@:����o�v�U��8 0Leܲ�)2�w3���Pq��B��Qv����~��:a* �d@��A��
+�Aɕ���j64���Fb���f���R@J7c( w�H&@J(5�92�kh�@5TGTR�J�1*����
+͍U�`�!��f4"�Y� �xUjp�y�t��WQ&��H<� �R�ڐ@4ӎ���_~L�*.�L�L9&��K
+����Ƨ���R2٘ �4.5`�h*gc��}��r60���?��q�PԦu��B�%��8��iRf��jBq�����\6dG����@�#����Y0�:|���/�.E�ϵ�˵��MIr��?DC����o]� �N�緲`�t��6�Ar�c�kG��$��sڪ��@�Liz��i��1N��$�xGq���w3��dR7L�Ve3�Ay����q��9a��|����@lj=���C���]��8�4i�p=V�]_�&��`ϒ�n�X�C�j7"����\8a@'�c��ܼ �N�Ҙ��s$���<��� s�-:�3@#F~���9�߲=h`������ h���kg`Y�#����3@02R{�'Q�Q�68� !�`��+���q�Z��%'<�F~I�:��,�w�r�*��(�m?.�dι#�: �T��Y*w���HJ��*a���ޤ�
+���:r'W|[��!~��:��!���
+�-Nxre73��c�MOrm��^�.)H�6��ޤ�m%��7"�@���4�S3J6[�yh]k��*�M[E#�g�2�ڙVq2��#�~0�{#�������$n:����x0@��L��'����rj% �N�{O<9�,0H�*/�I��ʭ�v䉺�|&�o��\��9�=��,8ߔv�7����
+�Hq#
+d��ۿ��:X�ĩ�����9�5��ƵN��+�3���:2���i����53K1�
+M3��d�5$ϒ����W�8�t0��i�����t�b������Yj�B����e7I����o�o�M�#�猬"mT����%2��mߗV۾
+�
+����Lr.���֤�B�;���[lX`�R\܌C�q���L����S[~����W�^Zug
+�Gڍ��#R\\-��Z6���R�H������㩪�u��St�8��غb�MF[#CV<(�5�i����7y'K��\���m�<G�I'��S�ˍ�"�RS]C�L�̙F6T�T$�wк��e�W�/py�$kQ����Aqq�؛Hv؊F}�ĆG*�J�A�"f�g3p�O!K������ˮ-��-D�Je=���o^�Ð]\�c);�,]��Ԓ����uK�g/��(.���v��c�*���EV��}>���]���pٽ�+g���1j��U(o)��ӻ��vM�{�B��t(�&8>�(���x�]��������࿀�=?�_)��$R%]L�s�RC��"�/�����`��o��K�p5���ٺm����-[/frn{L�xu[�X;�m��ӷm�q�A���9��O_1Q����t�_��>�@�>��Q�?�����3M���
+�X�����cMOr!;���w+��h>'��=-�4�a���ܱ �l�s�{���)E�I����rgE�<�CJ��
+�?!JF�B?�7�3F[o���7}VԲ���?h��mX�l^�AW���J/.���~ճЬ��i�}�Π@v:Rvu���d�_�M�Az�(ԑ��♛k�.��O�#�j��#A�]��Zj��XK�Z
+Rv���nG��V����#5�bR�d��¼:m)_Z
+>
+��B�賨�E�����A~����[��X9�Q�];�)�� �%�k�zmQ!�5��ϢAsY����gm�F�A|�*'r�
+�Ɍ��
+���^*֎�2��ۊ4�o˪��ه�BcU|}D7�Q�]V��
+�m˪ն�Boޢ�6\V�x��Q����%b�/?�&����h�?K`��b�T?���'�T�Obs��D7Kd�p�D�Kd��gI�۲*>|��Ī�Ԓ�KL�A1vb9r*�z���!����/���O�BwVк�ˇBC��R����3�:dD��P�7P��Mi%?*L�U��B���R��M��J�ҫ2��4*4g�U��F�i��]���h��2����[<L*�~�u���"�a�j��TL^��dkI��]�:y�4��ZK��{�1U�S|T�\�׳t).�%��j֊�p�
+�bO?����:V�Zk*��kV��k*V�5�<,��P�u���Bq��+/��P!��������="#3 �N�2�08Ҥ.jD��( �V��ê��@�M�[�_.J��5����p1P���¦��斒
+A�U���V`Tt��%D��z�る��T\�}$Z�b�$�v/�ݸ��NM BlZ[��.JrB1a�}��q1P�ƅ�GN
+.t�e�EG�2���L�,%�v9�N+˓����
+\�/%~;|���ࠠ*x�pP�'�X{�0��T�^���ۋ����$��R�qPP������U �8���#�AAU��2ypP����%>/��i�I!{�a����\sI~�Ֆr�Z2��@�2`A��#+ �]2��H�����OM~Xk�R�Z��]���3Sbofv�#�}���N}q$�Ϟ�ѩ��������`���A��c� $����߿�gP'3����9���6�nVD���m"y�i����L��� rz���k�@�0k��)��J/�{C��G�^�ҡg**�DI�TOV�QO:=ɒ���]�0�3=1P��h���S��no������N$0H������O�PK�F&$��PKΕv<ptB�pollen.argoPKΕv<���NIŋGpollen_DC_Pollen.pgmlPKΕv<4�[-m��pollen.todoPKΕv<7Rp:Bypollen_profile.profilePKΕv<�F&$��
+�pollen.xmiPK1�4
\ No newline at end of file
Deleted: trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceChoiceImplTest.java
===================================================================
--- trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceChoiceImplTest.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceChoiceImplTest.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -1,163 +0,0 @@
-/* *##% Pollen
- * Copyright (C) 2009 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.business.services;
-
-import org.chorem.pollen.business.PollenBusinessException;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.TestManager;
-import org.chorem.pollen.business.dto.ChoiceDTO;
-import org.chorem.pollen.business.utils.ContextUtil;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests de la gestion des choix.
- *
- * @author enema
- * @version $Id$
- */
-public class ServiceChoiceImplTest {
- private ServiceChoiceImpl instance;
-
- /** log. */
- private static final Log log = LogFactory
- .getLog(ServiceChoiceImplTest.class);
-
- public ServiceChoiceImplTest() {
- }
-
- @BeforeClass
- public static void setUpClass() throws Exception {
- TestManager.start("ServiceChoiceImplTest");
- }
-
- @AfterClass
- public static void tearDownClass() throws Exception {
- TestManager.stop();
- }
-
- @Before
- public void setUp() {
- instance = new ServiceChoiceImpl(TestManager.getContext());
- }
-
- @After
- public void tearDown() {
- }
-
- /**
- * Test of createChoice method, of class ServiceChoiceImpl.
- */
- @Test
- public void testCreateChoice() {
- ChoiceDTO choice = new ChoiceDTO();
- choice.setDescription("Test_CreateChoice");
- choice.setValidate(false);
- choice.setName("Test_CreateChoice");
- choice.setValue(3);
- String result = instance.createChoice(choice);
- if (log.isDebugEnabled()) {
- log.debug("result: " + result);
- }
- assertTrue(result.length() > 0);
- }
-
- /**
- * Test of createChoices method, of class ServiceChoiceImpl.
- */
- @Test
- public void testCreateChoices() {
- /* Couvert par le test unitaire sur Poll
- List<ChoiceDTO> choices = null;
- String pollId = "";
- TopiaContext trans = null;
- ChoiceImpl instance = new ChoiceImpl();
- boolean expResult = false;
- boolean result = instance.createChoices(choices, pollId, trans);
- assertEquals(expResult, result);
- */
- }
-
- /**
- * Test of updateChoice method, of class ServiceChoiceImpl.
- */
- @Test
- public void testUpdateChoice() {
- ChoiceDTO dto = new ChoiceDTO();
- dto.setDescription("test_UpdateChoice");
- dto.setName("test_UpdateChoice");
- dto.setValidate(false);
- String choiceId = instance.createChoice(dto);
- dto.setId(choiceId);
- dto.setDescription("update description");
- boolean result = instance.updateChoice(dto);
- assertTrue(result);
- }
-
- /**
- * Test of deleteChoice method, of class ServiceChoiceImpl.
- */
- @Test
- public void testDeleteChoice() {
- ChoiceDTO dto = new ChoiceDTO();
- dto.setDescription("Test_DeletePoll");
- dto.setName("Test_DeletePoll");
- dto.setValidate(false);
- String choiceId = instance.createChoice(dto);
- dto.setId(choiceId);
- boolean result = instance.deleteChoice(choiceId);
- assertTrue(result);
- }
-
- /**
- * Test of findChoiceById method, of class ServiceChoiceImpl.
- */
- @Test
- public void testFindChoiceById() {
- ChoiceDTO dto = new ChoiceDTO();
- dto.setDescription("test findChoiceById");
- dto.setName("test findChoiceById");
- dto.setValidate(false);
- String choiceId = instance.createChoice(dto);
- ChoiceDTO result = instance.findChoiceById(choiceId);
- String resultId = result.getId();
- assertEquals(choiceId, resultId);
- }
-
- /**
- * Test of selectChoices method, of class ServiceChoiceImpl.
- */
- @Test
- public void testSelectChoices() {
- ChoiceDTO dto = new ChoiceDTO();
- dto.setDescription("test selectChoices");
- dto.setName("test selectChoices");
- dto.setValidate(false);
- String choiceId = instance.createChoice(dto);
- List<ChoiceDTO> result = instance.selectChoices(null);
- assertTrue(result.size() > 1);
- }
-}
\ No newline at end of file
Modified: trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceListImplTest.java
===================================================================
--- trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceListImplTest.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServiceListImplTest.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -138,7 +138,7 @@
/** EXEC METHOD **/
instance.createAccountInPersonList(dto, account);
- Assert.assertNotNull(account.getAccountId());
+ Assert.assertNotNull(account.getAccountUId());
Assert.assertNotNull(account.getId());
Assert.assertEquals(1, dto.getPollAccounts().size());
Modified: trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServicePollImplTest.java
===================================================================
--- trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServicePollImplTest.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-business/src/test/java/org/chorem/pollen/business/services/ServicePollImplTest.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -26,7 +26,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.pollen.business.PollenContextImpl;
import org.chorem.pollen.business.TestData;
import org.chorem.pollen.business.TestManager;
import org.chorem.pollen.business.dto.ChoiceDTO;
@@ -34,6 +33,8 @@
import org.chorem.pollen.business.dto.PollDTO;
import org.chorem.pollen.business.dto.UserDTO;
import org.chorem.pollen.business.dto.VoteDTO;
+import org.chorem.pollen.business.persistence.Choice;
+import org.chorem.pollen.business.persistence.ChoiceDAO;
import org.chorem.pollen.business.persistence.Comment;
import org.chorem.pollen.business.persistence.CommentDAO;
import org.chorem.pollen.business.persistence.Poll;
@@ -47,7 +48,6 @@
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.nuiton.util.beans.BinderProvider;
/**
* Tests du service de gestion des sondages.
@@ -120,7 +120,8 @@
dto.setChoices(choices);
- final String result = instance.createPoll(dto);
+ instance.createPoll(dto);
+ final String result = dto.getId();
if (log.isDebugEnabled()) {
log.debug("result: " + result);
}
@@ -368,7 +369,7 @@
dto.setPollType(PollType.FREE);
dto.setChoiceType(ChoiceType.TEXT);
dto.setVoteCounting(VoteCountingType.NORMAL);
- String pollId = instance.createPoll(dto);
+ instance.createPoll(dto);
List<PollDTO> result = instance.selectPolls(null);
assertTrue(result.size() > 0);
}
@@ -403,8 +404,8 @@
poll.setPollType(PollType.FREE);
poll.setChoiceType(ChoiceType.TEXT);
poll.setVoteCounting(VoteCountingType.NORMAL);
- final String id = instance.createPoll(poll);
- poll.setId(id);
+ instance.createPoll(poll);
+ final String pollId = poll.getId();
/** EXEC METHOD **/
final CommentDTO comment = new CommentDTO();
@@ -426,7 +427,7 @@
Comment result = dao.findByTopiaId(comment.getId());
Assert.assertNotNull(result);
Assert.assertNotNull(result.getPoll());
- Assert.assertEquals(id, result.getPoll().getTopiaId());
+ Assert.assertEquals(pollId, result.getPoll().getTopiaId());
}
};
@@ -448,8 +449,7 @@
poll.setPollType(PollType.FREE);
poll.setChoiceType(ChoiceType.TEXT);
poll.setVoteCounting(VoteCountingType.NORMAL);
- String id = instance.createPoll(poll);
- poll.setId(id);
+ instance.createPoll(poll);
final CommentDTO comment = new CommentDTO();
comment.setAuthor("Jack Pot");
@@ -491,8 +491,7 @@
poll.setPollType(PollType.RESTRICTED);
poll.setChoiceType(ChoiceType.TEXT);
poll.setVoteCounting(VoteCountingType.NORMAL);
- String id = instance.createPoll(poll);
- poll.setId(id);
+ instance.createPoll(poll);
PollAccountDTO account = new PollAccountDTO();
account.setVotingId("toto");
@@ -500,4 +499,120 @@
// TODO
}
+
+ /**
+ * Test of getNewPoll method, of class ServicePollImpl.
+ */
+ //@Test
+ public void testGetNewPoll_0args() {
+ System.out.println("getNewPoll");
+ }
+
+ /**
+ * Test of getNewPoll method, of class ServicePollImpl.
+ */
+ //@Test
+ public void testGetNewPoll_PollDTO() {
+ System.out.println("getNewPoll");
+ }
+
+ /**
+ * Test of getPoll method, of class ServicePollImpl.
+ */
+ //@Test
+ public void testGetPoll() {
+ System.out.println("getPoll");
+ }
+
+ /**
+ * Test of getComments method, of class ServicePollImpl.
+ */
+ //@Test
+ public void testGetComments() {
+ System.out.println("getComments");
+ }
+
+ /**
+ * Test of getNewHiddenChoice method, of class ServicePollImpl.
+ */
+ //@Test
+ public void testGetNewHiddenChoice() throws IOException {
+ TestManager.start("testGetNewHiddenChoice");
+ instance = new ServicePollImpl(TestManager.getContext());
+
+ // TODO
+
+ //ChoiceDTO choice = instance.getNewHiddenChoice(null, null)
+ }
+
+ /**
+ * Test of createChoice method, of class ServicePollImpl.
+ * @throws IOException
+ */
+ @Test
+ public void testCreateChoice() throws IOException {
+ TestManager.start("testCreateChoice");
+ instance = new ServicePollImpl(TestManager.getContext());
+
+ /** PREPARE DATA **/
+ PollDTO poll = instance.getNewPoll();
+ poll.setTitle("createChoice");
+ poll.setPollType(PollType.FREE);
+ poll.setChoiceType(ChoiceType.TEXT);
+ poll.setVoteCounting(VoteCountingType.NORMAL);
+ instance.createPoll(poll);
+
+ /** EXEC METHOD **/
+ ChoiceDTO choice = new ChoiceDTO();
+ choice.setName("CHOICE1");
+ choice.setDescription("description");
+
+ // No constraint for creation
+ instance.createChoice(poll, choice);
+
+ Assert.assertNotNull(choice.getId());
+ Assert.assertEquals(1, poll.getChoices().size());
+ Assert.assertEquals("CHOICE1", poll.getChoices().get(0).getName());
+ }
+
+ /**
+ * Test of deleteChoice method, of class ServicePollImpl.
+ * @throws Exception
+ */
+ @Test
+ public void testDeleteChoice() throws Exception {
+ TestManager.start("testDeleteChoice");
+ instance = new ServicePollImpl(TestManager.getContext());
+
+ /** PREPARE DATA **/
+ PollDTO poll = instance.getNewPoll();
+ poll.setTitle("createChoice");
+ poll.setPollType(PollType.FREE);
+ poll.setChoiceType(ChoiceType.TEXT);
+ poll.setVoteCounting(VoteCountingType.NORMAL);
+ instance.createPoll(poll);
+
+ final ChoiceDTO choice = new ChoiceDTO();
+ choice.setName("CHOICE1");
+ choice.setDescription("description");
+ instance.createChoice(poll, choice);
+
+ /** EXEC METHOD **/
+ instance.deleteChoice(poll, choice.getId());
+
+ Assert.assertEquals(0, poll.getChoices().size());
+
+ // Test if the choice entity not exist anymore in database
+ TestData test = new TestData() {
+
+ @Override
+ protected void test() throws Exception {
+ ChoiceDAO dao = PollenModelDAOHelper.getChoiceDAO(transaction);
+ Choice result = dao.findByTopiaId(choice.getId());
+ Assert.assertNull(result);
+ }
+ };
+
+ test.execute();
+ }
}
Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/AbstractUploadPage.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/AbstractUploadPage.java (rev 0)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/AbstractUploadPage.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -0,0 +1,49 @@
+
+package org.chorem.pollen.ui.base;
+
+import org.apache.commons.fileupload.FileUploadException;
+import org.apache.tapestry5.annotations.InjectPage;
+import org.apache.tapestry5.ioc.Messages;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.apache.tapestry5.ioc.annotations.Symbol;
+import org.apache.tapestry5.upload.services.UploadSymbols;
+import org.chorem.pollen.ui.pages.ErrorPage;
+import org.chorem.pollen.ui.utils.UnitConverter;
+
+/**
+ * AbstractUploadPage
+ *
+ * Created: 22 mars 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class AbstractUploadPage {
+
+ @InjectPage
+ private ErrorPage errorPage;
+
+ @Inject
+ private Messages messages;
+
+ /** Tailles maximales des fichiers uploadés */
+ @Inject
+ @Symbol(UploadSymbols.FILESIZE_MAX)
+ private int fileSizeMax;
+
+ @Inject
+ @Symbol(UploadSymbols.REQUESTSIZE_MAX)
+ private int requestSizeMax;
+
+ Object onUploadException(FileUploadException eee) {
+ String fSize = UnitConverter.getFormattedFileSize(fileSizeMax);
+ String rSize = UnitConverter.getFormattedFileSize(requestSizeMax);
+ errorPage.addError(
+ messages.format("pollen.ui.error.upload", fSize, rSize));
+ return errorPage;
+ }
+
+}
Property changes on: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/AbstractUploadPage.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/Polls.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/Polls.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/base/Polls.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -135,7 +135,7 @@
public String getAdminId() {
PollAccountDTO creator = servicePollAccount.findPollAccountById(poll
.getCreatorId());
- return poll.getPollUId() + ":" + creator.getAccountId();
+ return poll.getPollUId() + ":" + creator.getAccountUId();
}
/**
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Border.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Border.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/Border.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -24,6 +24,7 @@
import java.util.Locale;
import org.apache.tapestry5.BindingConstants;
+import org.apache.tapestry5.Block;
import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.IncludeStylesheet;
import org.apache.tapestry5.annotations.InjectComponent;
@@ -178,6 +179,10 @@
return feedContext;
}
+ public FeedBack getFeedBack() {
+ return feedback;
+ }
+
/**
* Methode appelée lorsque l'utilisateur s'identifie. L'utilisateur est
* retrouvé grâce au service d'authentification.
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FeedBack.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FeedBack.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/FeedBack.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -114,4 +114,8 @@
errorMessages.add(message);
}
}
+
+ public boolean getHasErrors() {
+ return !errorMessages.isEmpty();
+ }
}
\ No newline at end of file
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ChoiceField.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ChoiceField.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ChoiceField.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -1,19 +1,15 @@
package org.chorem.pollen.ui.data;
-import java.io.File;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.commons.fileupload.FileUploadException;
-import org.apache.tapestry5.StreamResponse;
+import org.apache.commons.lang.StringUtils;
+import org.apache.tapestry5.Block;
import org.apache.tapestry5.upload.services.UploadedFile;
-import org.chorem.pollen.business.PollenProperty;
import org.chorem.pollen.business.dto.ChoiceDTO;
+import org.chorem.pollen.business.dto.PollDTO;
import org.chorem.pollen.common.ChoiceType;
-import org.chorem.pollen.ui.utils.ImageUtil;
-import org.nuiton.util.DateUtils;
+import org.chorem.pollen.ui.services.ServiceImage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -60,29 +56,41 @@
}
- public ChoiceField(ChoiceDTO dto, ChoiceType type) {
+ public ChoiceField(PollDTO poll) {
+ switch (poll.getChoiceType()) {
+ case DATE:
+ setDateType();
+ break;
+ case TEXT:
+ setTextType();
+ break;
+ case IMAGE:
+ setImageType(poll.getPollUId());
+ }
+ }
+
+ public ChoiceField(PollDTO poll, ChoiceDTO dto) {
+ this(poll);
if (log.isDebugEnabled()) {
- log.debug("Instanciate ChoiceField : type = " + type +
+ log.debug("Instanciate ChoiceField : " +
+ "type = " + poll.getChoiceType() +
" _ name = " + dto.getName());
}
- switch (type) {
+ switch (poll.getChoiceType()) {
case DATE:
- setDateType();
setDate(new Date(Long.parseLong(dto.getName())));
break;
case TEXT:
- setTextType();
setText(dto.getName());
break;
case IMAGE:
- setImageType(dto.getPollUId());
setImageFileName(dto.getName());
}
setDescription(dto.getDescription());
setHidden(dto.getHidden());
setId(dto.getId());
setValidate(dto.getValidate());
- setPollUId(dto.getPollUId());
+// setPollUId(dto.getPollUId());
setName(dto.getName());
//setValue(dto.getValue());
//setVoteId(dto.getVoteId());
@@ -159,6 +167,10 @@
image = null;
}
+ public ChoiceType getType() {
+ return type;
+ }
+
public void setDate(Date date) {
this.date = date;
}
@@ -170,14 +182,16 @@
public void setImage(UploadedFile image) throws FileUploadException {
if (image != null) {
this.image = image;
- if (!image.getContentType().equals("image") ||
- !image.getContentType().equals("IMAGE")) {
- throw new FileUploadException("wrong type for image upload");
+ String contentType = StringUtils.lowerCase(image.getContentType());
+ if (!contentType.contains("image")) {
+ throw new FileUploadException("wrong type " +
+ image.getContentType() + " for image upload " +
+ image.getFileName());
}
}
}
- public UploadedFile getImage() throws ParseException {
+ public UploadedFile getImage() {
return image;
}
@@ -212,12 +226,13 @@
* correspond to the image file name ;
* - TEXT : the text becomes the choice name.
* </pre>
+ * @param serviceImage used to save the image
*/
- public void saveName() {
+ public void saveName(ServiceImage serviceImage) {
String name = "";
switch (type) {
case DATE:
- name = String.valueOf(date.getTime());
+ name = String.valueOf(getDate().getTime());
break;
case IMAGE:
// // Get directory to save the image using the context from
@@ -238,7 +253,7 @@
// if (log.isDebugEnabled()) {
// log.debug("save name for image : " + file.getName());
// }
- //name = serviceImage.saveImage(getImage(), getImageDir());
+ name = serviceImage.saveImage(getImage(), getImageDir());
break;
case TEXT:
name = getText();
Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/ErrorPage.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/ErrorPage.java (rev 0)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/ErrorPage.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -0,0 +1,33 @@
+
+package org.chorem.pollen.ui.pages;
+
+import org.apache.tapestry5.annotations.InjectComponent;
+import org.chorem.pollen.ui.components.Border;
+import org.chorem.pollen.ui.data.AddressBar;
+import org.chorem.pollen.ui.data.AddressBarItem;
+
+/**
+ * Error
+ *
+ * Created: 22 mars 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class ErrorPage {
+
+ @InjectComponent
+ private Border border;
+
+ public void addError(String message) {
+ border.getFeedBack().addError(message);
+ }
+
+ public AddressBarItem[] getAddress() {
+ return new AddressBar().getItems();
+ }
+
+}
Property changes on: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/ErrorPage.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CloseValidation.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CloseValidation.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CloseValidation.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -103,7 +103,7 @@
* @return l'identifiant.
*/
public String getAdminId() {
- return poll.getPollUId() + ":" + creator.getAccountId();
+ return poll.getPollUId() + ":" + creator.getAccountUId();
}
void onActivate() {
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CreationValidation.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CreationValidation.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/CreationValidation.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -103,7 +103,7 @@
* @return l'identifiant.
*/
public String getAdminId() {
- return poll.getPollUId() + ":" + creator.getAccountId();
+ return poll.getPollUId() + ":" + creator.getAccountUId();
}
void onActivate() {
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ModificationValidation.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ModificationValidation.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/ModificationValidation.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -103,7 +103,7 @@
* @return l'identifiant.
*/
public String getAdminId() {
- return poll.getPollUId() + ":" + creator.getAccountId();
+ return poll.getPollUId() + ":" + creator.getAccountUId();
}
void onActivate() {
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollCreation.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollCreation.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollCreation.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -824,7 +824,7 @@
PollDTO poll, Messages messages) {
PollAccountDTO creator = servicePollAccount.findPollAccountById(poll.getCreatorId());
String voteURL = siteURL + "poll/VoteFor/" + poll.getPollUId();
- String modifURL = siteURL + "poll/Modification/" + poll.getPollUId() + ":" + creator.getAccountId();
+ String modifURL = siteURL + "poll/Modification/" + poll.getPollUId() + ":" + creator.getAccountUId();
Map<String, String> data = new HashMap<String, String>();
data.put("host", pollen.getProperty(PollenProperty.EMAIL_HOST));
data.put("port", pollen.getProperty(PollenProperty.EMAIL_PORT));
@@ -848,7 +848,7 @@
List<Map<String, String>> mailList = new ArrayList<Map<String, String>>();
for (PollAccountDTO account : list.getPollAccountDTOs()) {
if (account.getEmail() != null) {
- String accountVoteURL = voteURL + ":" + account.getAccountId();
+ String accountVoteURL = voteURL + ":" + account.getAccountUId();
/*data.put("to", account.getEmail());
data.put("title", messages.format("votingEmail_subject",
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollModification.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollModification.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollModification.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -543,7 +543,7 @@
// Mails aux votants
for (PollAccountDTO account : modifiedAccounts) {
if (account.getEmail() != null) {
- String accountVoteURL = voteURL + ":" + account.getAccountId();
+ String accountVoteURL = voteURL + ":" + account.getAccountUId();
data.put("to", account.getEmail());
data.put("title", messages.format("votingEmail_subject", poll
@@ -609,7 +609,7 @@
}
if (id.split(":", 2).length == 2) {
String creatorId = id.split(":", 2)[1];
- if (creatorId.equals(creator.getAccountId())) {
+ if (creatorId.equals(creator.getAccountUId())) {
userAllowed = true;
}
}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/Results.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -482,7 +482,7 @@
userAllowed = true;
} else if (id.split(":", 2).length == 2) {
String creatorId = id.split(":", 2)[1];
- if (creatorId.equals(creator.getAccountId())) {
+ if (creatorId.equals(creator.getAccountUId())) {
userAllowed = true;
}
}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -26,6 +26,7 @@
import java.util.Locale;
import java.util.Map;
+import org.apache.commons.fileupload.FileUploadException;
import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.Block;
import org.apache.tapestry5.ComponentResources;
@@ -37,6 +38,7 @@
import org.apache.tapestry5.annotations.IncludeJavaScriptLibrary;
import org.apache.tapestry5.annotations.IncludeStylesheet;
import org.apache.tapestry5.annotations.InjectComponent;
+import org.apache.tapestry5.annotations.InjectPage;
import org.apache.tapestry5.annotations.Log;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Persist;
@@ -49,7 +51,6 @@
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.upload.services.UploadedFile;
-import org.chenillekit.tapestry.core.components.DateTimeField;
import org.chorem.pollen.business.PollenBusinessException;
import org.chorem.pollen.business.PollenBusinessException.PollenExceptionType;
import org.chorem.pollen.business.PollenProperty;
@@ -64,7 +65,6 @@
import org.chorem.pollen.business.dto.ResultListDTO;
import org.chorem.pollen.business.dto.UserDTO;
import org.chorem.pollen.business.dto.VoteDTO;
-import org.chorem.pollen.business.services.ServiceChoice;
import org.chorem.pollen.business.services.ServicePoll;
import org.chorem.pollen.business.services.ServicePollAccount;
import org.chorem.pollen.business.services.ServiceResults;
@@ -73,10 +73,10 @@
import org.chorem.pollen.common.ChoiceType;
import org.chorem.pollen.common.PollType;
import org.chorem.pollen.common.VoteCountingType;
+import org.chorem.pollen.ui.base.AbstractUploadPage;
import org.chorem.pollen.ui.base.ContextLink;
import org.chorem.pollen.ui.components.Border;
import org.chorem.pollen.ui.components.FeedBack;
-import org.chorem.pollen.ui.components.ImageContextLink;
import org.chorem.pollen.ui.components.Pager;
import org.chorem.pollen.ui.data.AddressBar;
import org.chorem.pollen.ui.data.ChoiceField;
@@ -87,7 +87,6 @@
import org.chorem.pollen.ui.data.uio.ImageChoiceUIO;
import org.chorem.pollen.ui.services.ServiceImage;
import org.chorem.pollen.ui.utils.FeedUtil;
-import org.chorem.pollen.ui.utils.ImageUtil;
import org.slf4j.Logger;
/**
@@ -99,7 +98,7 @@
*/
@IncludeStylesheet({"context:css/vote.css", "context:css/lightbox.css"})
@IncludeJavaScriptLibrary({"${tapestry.scriptaculous}/builder.js","context:js/lightbox.js"})
-public class VoteForPoll {
+public class VoteForPoll extends AbstractUploadPage {
@Inject
private Logger log;
@@ -129,10 +128,10 @@
// @Component(id = "pollAccountName")
// private TextField nameField;
- /** Composant DateTimeField pour les choix du sondage */
- @SuppressWarnings("unused")
- @Component(parameters = { "timePicker=true", "timePickerAdjacent=true" })
- private DateTimeField dateDTF;
+// /** Composant DateTimeField pour les choix du sondage */
+// @SuppressWarnings("unused")
+// @Component(parameters = { "timePicker=true", "timePickerAdjacent=true" })
+// private DateTimeField dateDTF;
/** Locale courante */
@Inject
@@ -203,10 +202,10 @@
// @Property
// private PollAccountDTO pollAccount;
- /** Nouveau choix de type texte */
- @Property
- @Persist
- private ChoiceDTO newChoice;
+// /** Nouveau choix de type texte */
+// @Property
+// @Persist
+// private ChoiceDTO newChoice;
/** Nouveau choix de type date */
@Property
@@ -228,8 +227,6 @@
private ServicePollAccount servicePollAccount;
@Inject
private ServiceResults serviceResults;
- @Inject
- private ServiceChoice serviceChoice;
/**
* Composant pour la gestion des flux RSS
@@ -245,20 +242,20 @@
return feedContext;
}
- /**
- * Composant pour la gestion des upload d'images
- */
- @InjectComponent
- private ImageContextLink imgContext;
+// /**
+// * Composant pour la gestion des upload d'images
+// */
+// @InjectComponent
+// private ImageContextLink imgContext;
+//
+// /**
+// * Context to get images for choices.
+// * @return an ImageContextLink defined in .tml file
+// */
+// public ImageContextLink getImgContext() {
+// return imgContext;
+// }
- /**
- * Context to get images for choices.
- * @return an ImageContextLink defined in .tml file
- */
- public ImageContextLink getImgContext() {
- return imgContext;
- }
-
@InjectComponent
private FeedBack voteFeedback;
@@ -662,13 +659,13 @@
private ChoiceDTO currentVoteChoice;
public char setCurrentVoteChoice() {
- currentVoteChoice = null;
- for (ChoiceDTO choice : vote.getChoiceDTOs()) {
- if (choice.getId().equals(choiceOfPoll.getId())) {
- currentVoteChoice = choice;
- break;
- }
- }
+// currentVoteChoice = null;
+// for (ChoiceDTO choice : vote.getChoiceDTOs()) {
+// if (choice.getId().equals(choiceOfPoll.getId())) {
+// currentVoteChoice = choice;
+// break;
+// }
+// }
return 0;
}
@@ -827,8 +824,8 @@
.replace(' ', '_'));
getPoll().getChoices().add(newImageChoice);
//File imgFile = getImgContext().getImageDir(); // dir set in getImgContext()
- File imgFile = getImgContext().getImageDir(); // dir set in getImgContext()
- ImageUtil.saveImage(newImageChoice, imgFile);
+// File imgFile = getImgContext().getImageDir(); // dir set in getImgContext()
+// ImageUtil.saveImage(newImageChoice, imgFile);
choiceName = newImageChoice.getName();
choiceDesc = newImageChoice.getDescription();
}
@@ -848,33 +845,16 @@
// return poll == null;
// }
- public boolean isPollStarted() throws PollenBusinessException {
- Date now = new Date();
- return getPoll().getBeginDate() == null || getPoll().getBeginDate().before(now);
- }
- public boolean isPollFinished() throws PollenBusinessException {
- Date now = new Date();
- return getPoll().getEndDate() != null && getPoll().getEndDate().before(now);
- }
-
public boolean isPollChoiceOrVoteStarted() throws PollenBusinessException {
return isPollChoiceStarted() || isPollStarted();
}
- public boolean isPollRunning() throws PollenBusinessException {
- return isPollStarted() && !isPollFinished() && !getPoll().isClosed();
- }
-
// public boolean isDescNull() {
// return choiceOfPoll.getDescription() == null
// || "".equals(choiceOfPoll.getDescription());
// }
- /** Retourne vrai si le champs pollAccount doit apparaître. */
- public boolean isAccountFieldDisplayed() throws PollenBusinessException {
- return !getPoll().isAnonymous() || isRestrictedPoll() || isGroupPoll();
- }
public boolean isFreePoll() throws PollenBusinessException {
return getPoll().getPollType() == PollType.FREE;
@@ -1085,7 +1065,7 @@
if (poll != null) {
// Initialisations pour les formulaires
- newChoice = new ChoiceDTO();
+// newChoice = new ChoiceDTO();
newDateChoice = new DateChoiceUIO();
newImageChoice = new ImageChoiceUIO();
} else {
@@ -1096,6 +1076,22 @@
return poll;
}
+ public boolean isPollStarted() throws PollenBusinessException {
+ Date now = new Date();
+ return getPoll().getBeginDate() == null ||
+ getPoll().getBeginDate().before(now);
+ }
+
+ public boolean isPollFinished() throws PollenBusinessException {
+ Date now = new Date();
+ return getPoll().getEndDate() != null &&
+ getPoll().getEndDate().before(now);
+ }
+
+ public boolean isPollRunning() throws PollenBusinessException {
+ return isPollStarted() && !isPollFinished() && !getPoll().isClosed();
+ }
+
/**
* Use a PollAccount to represent the current session user.
* The existing account is used if accountUId is present in the uri.
@@ -1142,6 +1138,57 @@
return userExists && user.getId().equals(getPoll().getUserId());
}
+ /************** PAGER *****************************************************/
+
+ @InjectComponent
+ private Pager pager;
+
+ private Integer page;
+
+ @Persist
+ private Integer nbVotesPerPage;
+
+ public int getPage() {
+ if (page == null) {
+ page = pager.getFirstPage();
+ }
+ return page;
+ }
+
+ @Log
+ public void setPage(int page) {
+ this.page = page;
+ }
+
+ /**
+ * Get the number of votes to display per page from configuration.
+ *
+ * @return the number of votes to display per page
+ */
+ public int getNbVotesPerPage() {
+ if (nbVotesPerPage == null) {
+ nbVotesPerPage = getPagerRange();
+ }
+ return nbVotesPerPage;
+ }
+
+ public void setNbVotesPerPage(int nbVotesPerPage) {
+ this.nbVotesPerPage = nbVotesPerPage;
+ }
+
+ public int getPagerRange() {
+ return Integer.parseInt(
+ pollen.getProperty(PollenProperty.NB_VOTES_PER_PAGE));
+ }
+
+ public String getNoPagerText() throws PollenBusinessException {
+ if (getPoll().getNbVotes() == 0) {
+ return messages.get("pollen.ui.vote.noVote");
+ }
+ return messages.format("pollen.ui.vote.noPager",
+ getPoll().getNbVotes());
+ }
+
/************** CHOICES ***************************************************/
private List<ChoiceField> choices;
@@ -1158,7 +1205,18 @@
@Inject
private Block choiceDate;
+ private ChoiceField newChoice;
+
@Inject
+ private Block newChoiceText;
+
+ @Inject
+ private Block newChoiceImage;
+
+ @Inject
+ private Block newChoiceDate;
+
+ @Inject
private ComponentResources resources;
@Inject
@@ -1179,8 +1237,7 @@
}
choices = new ArrayList<ChoiceField>();
for (ChoiceDTO curr : getPoll().getChoices()) {
- ChoiceField field = new ChoiceField(curr,
- getPoll().getChoiceType());
+ ChoiceField field = new ChoiceField(getPoll(), curr);
choices.add(field);
}
}
@@ -1245,7 +1302,54 @@
boolean thumb) {
return serviceImage.createImageStream(src, imageDir, thumb);
}
+
+ /**
+ * Delegator : Retrieve the newChoice to create a choice in the poll
+ * using the addChoice form.
+ *
+ * @return a ChoiceField to manage different choice type
+ * @throws PollenBusinessException
+ */
+ public ChoiceField getNewChoice() throws PollenBusinessException {
+ if (newChoice == null) {
+ newChoice = new ChoiceField(getPoll());
+// switch (getPoll().getChoiceType()) {
+// case DATE:
+// newChoice = ChoiceField.getChoiceDate();
+// break;
+// case IMAGE:
+// newChoice = ChoiceField.getChoiceImage(
+// getPoll().getPollUId());
+// break;
+// case TEXT:
+// default:
+// newChoice = ChoiceField.getChoiceText();
+// }
+ // Don't know what validate is
+ newChoice.setValidate(true);
+ }
+ return newChoice;
+ }
+ /**
+ * Retrieve the block to display for input choiceName depends on
+ * choice type.
+ *
+ * @return the block to display
+ * @throws PollenBusinessException
+ */
+// public Block getNewChoiceBlock() throws PollenBusinessException {
+// switch(getPoll().getChoiceType()) {
+// case IMAGE:
+// return newChoiceImage;
+// case DATE:
+// return newChoiceDate;
+// case TEXT:
+// default:
+// return newChoiceText;
+// }
+// }
+
public boolean isPollChoiceRunning() throws PollenBusinessException {
return getPoll().isChoiceAddAllowed() && isPollChoiceStarted();
}
@@ -1265,7 +1369,7 @@
return started && !ended;
}
- public boolean canDeleteChoice() throws PollenBusinessException {
+ public boolean getCanDeleteChoice() throws PollenBusinessException {
return isPollChoiceRunning() && isCreatorUser();
}
@@ -1274,7 +1378,7 @@
*/
void onActionFromDeleteChoice(String choiceId)
throws PollenBusinessException {
- if (canDeleteChoice()) {
+ if (getCanDeleteChoice()) {
servicePoll.deleteChoice(getPoll(), choiceId);
// Reset choices (ChoiceField list) to retrieve the updated one
// from poll
@@ -1282,57 +1386,24 @@
}
}
- /************** PAGER *****************************************************/
-
- @InjectComponent
- private Pager pager;
-
- private Integer page;
-
- @Persist
- private Integer nbVotesPerPage;
-
- public int getPage() {
- if (page == null) {
- page = pager.getFirstPage();
- }
- return page;
+ public boolean getCanAddChoice() throws PollenBusinessException {
+ return isPollChoiceRunning();
}
- @Log
- public void setPage(int page) {
- this.page = page;
- }
-
/**
- * Get the number of votes to display per page from configuration.
- *
- * @return the number of votes to display per page
+ * SUCCESS EVENT :: add a new choice from addChoice form.
+ *
+ * @throws PollenBusinessException
*/
- public int getNbVotesPerPage() {
- if (nbVotesPerPage == null) {
- nbVotesPerPage = getPagerRange();
+ void onSuccessFromAddChoice() throws PollenBusinessException {
+ if (getCanAddChoice()) {
+ // No validation done on choice with existing name
+ // Save name depends on choice type
+ newChoice.saveName(serviceImage);
+ servicePoll.createChoice(getPoll(), newChoice);
}
- return nbVotesPerPage;
}
- public void setNbVotesPerPage(int nbVotesPerPage) {
- this.nbVotesPerPage = nbVotesPerPage;
- }
-
- public int getPagerRange() {
- return Integer.parseInt(
- pollen.getProperty(PollenProperty.NB_VOTES_PER_PAGE));
- }
-
- public String getNoPagerText() throws PollenBusinessException {
- if (getPoll().getNbVotes() == 0) {
- return messages.get("pollen.ui.vote.noVotes");
- }
- return messages.format("pollen.ui.vote.noPager",
- getPoll().getNbVotes());
- }
-
/************** VOTES *****************************************************/
private List<VoteDTO> votes;
@@ -1340,6 +1411,8 @@
@Property
private int voteIndex;
+ private VoteDTO currentVote;
+
/**
* Retrieve votes of the current poll from business module.
* The votes are ordered by creation date, only the ones to display are
@@ -1356,10 +1429,47 @@
return votes;
}
+ public VoteDTO getCurrentVote() {
+ if (currentVote == null) {
+ currentVote = serviceVote.getNewVote(getPollAccount());
+ }
+ return currentVote;
+ }
+
+ /**
+ * Retourne vrai si le champs pollAccount doit apparaître.
+ *
+ * FD-20100322 ::
+ * Strange behavior ? why testing pollType (restricted or group) to
+ * display accountField ?!? Even it's anonymous, the field appears for
+ * restricted poll ?!?
+ *
+ * @return
+ * @throws PollenBusinessException
+ * @deprecated strange method
+ */
+ @Deprecated
+ public boolean isAccountFieldDisplayed() throws PollenBusinessException {
+ return !getPoll().isAnonymous() || isRestrictedPoll() || isGroupPoll();
+ }
+
+ public void setChoiceValue(Integer value) {
+ getCurrentVote().setChoiceValue(choice.getId(), value);
+ }
+
+ public Integer getChoiceValue() {
+ return getCurrentVote().getChoiceValue(choice.getId());
+ }
+
+ public boolean getCanVote() throws PollenBusinessException {
+ return isPollRunning();
+ }
+
public boolean canEditVote() throws PollenBusinessException {
// If the current account exist from uri and equals to the current vote
String newAccountId = getPollAccount().getId();
- if (newAccountId != null && newAccountId.equals(vote.getPollAccountId())) {
+ if (newAccountId != null &&
+ newAccountId.equals(vote.getPollAccountId())) {
return true;
// If the connected user is an admin
} else if (userExists && user.isAdministrator()) {
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsParticipated.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsParticipated.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/user/UserPollsParticipated.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -74,7 +74,7 @@
for (VotingListDTO list : poll.getVotingListDTOs()) {
for (PollAccountDTO account : list.getPollAccountDTOs()) {
if (account.getEmail().equals(user.getEmail())) {
- return poll.getPollUId() + ":" + account.getAccountId();
+ return poll.getPollUId() + ":" + account.getAccountUId();
}
}
}
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/AppModule.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -34,8 +34,6 @@
import org.chorem.pollen.business.PollenContextImplementor;
import org.chorem.pollen.business.services.ServiceAuth;
import org.chorem.pollen.business.services.ServiceAuthImpl;
-import org.chorem.pollen.business.services.ServiceChoice;
-import org.chorem.pollen.business.services.ServiceChoiceImpl;
import org.chorem.pollen.business.services.ServiceList;
import org.chorem.pollen.business.services.ServiceListImpl;
import org.chorem.pollen.business.services.ServicePoll;
@@ -123,12 +121,6 @@
return new ServiceVoteImpl(context);
}
- /** Will be divided between serviceVote and servicePoll **/
- public static ServiceChoice buildServiceChoice(
- @InjectService("PollenContext") PollenContextImplementor context) {
- return new ServiceChoiceImpl(context);
- }
-
public static ServiceImage buildServiceImage(
@InjectService("PollenContext") PollenContextImplementor context) {
return new ServiceImageImpl(context);
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/BackgroundWorkerImpl.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/BackgroundWorkerImpl.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/BackgroundWorkerImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -146,7 +146,7 @@
for (PollAccountDTO account : list.getPollAccountDTOs()) {
if (account.getEmail() != null) {
String accountVoteURL = voteURL + ":"
- + account.getAccountId();
+ + account.getAccountUId();
data.put("to", account.getEmail());
data.put("title", messages.format(
Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/ServiceImageImpl.java
===================================================================
--- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/ServiceImageImpl.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/services/ServiceImageImpl.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -117,7 +117,7 @@
}
dir.mkdirs();
}
- String filename = tmpfile.getFileName();
+ String filename = tmpfile.getFileName().replace(' ', '_');
File image = new File(dir, filename);
tmpfile.write(image);
Modified: trunk/pollen-ui/src/main/resources/i18n/pollen-ui-en_GB.properties
===================================================================
--- trunk/pollen-ui/src/main/resources/i18n/pollen-ui-en_GB.properties 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/resources/i18n/pollen-ui-en_GB.properties 2010-03-23 11:15:12 UTC (rev 2955)
@@ -43,5 +43,23 @@
pollen.ui.choice.delete.confirm=Are you sure you want to delete this choice ?
pollen.ui.choice.delete.title=Delete this choice
-pollen.ui.vote.noVotes=Aucune personne n'a encore particip\u00E9 au sondage
-pollen.ui.vote.noPager=%d existing votes
\ No newline at end of file
+pollen.ui.vote.noVote=Aucune personne n'a encore particip\u00E9 au sondage
+pollen.ui.vote.noPager=%$1d existing votes
+pollen.ui.choice.datePattern=MM/dd/yyyy h:mm a
+pollen.ui.choice.add.title=Adding a choice
+pollen.ui.choice.add.submit=Add
+pollen.ui.error.upload=An error occurred while uploading files. Maximum size allowed is %$1s per file, and %$2s total.
+
+# Tapestry messages for VoteForPoll.tml
+# FORM:: addChoice
+choiceDescription-label=Description
+choiceText-label=Choice
+addChoice-choiceText-required-message=You must provide a choice.
+choiceDate-label=Date and time
+addChoice-choiceDate-regexp=\\d{2}\/\\d{2}\/\\d{4}( \\d{2}\\:\\d{2})?
+addChoice-choiceDate-regexp-message=Date does not match pattern 12/31/2000 12:59 AM.
+addChoice-choiceDate-required-message=You must provide a choice.
+choiceImage-label=Image
+addChoice-choiceImage-regexp=\\.(jpe?g|gif|png|JPE?G|GIF|PNG)$
+addChoice-choiceImage-regexp-message=The image must be a JPG, GIF or PNG file.
+addChoice-choiceImage-required-message=You must provide a choice.
\ No newline at end of file
Modified: trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties
===================================================================
--- trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties 2010-03-23 11:15:12 UTC (rev 2955)
@@ -43,5 +43,23 @@
pollen.ui.choice.delete.confirm=Etes-vous s\u00FBr de vouloir d\u00E9finitivement supprimer ce choix ?
pollen.ui.choice.delete.title=Supprimer ce choix
-pollen.ui.vote.noVotes=Aucune personne n'a encore particip\u00E9 au sondage
-pollen.ui.vote.noPager=%d votes existants
+pollen.ui.vote.noVote=Aucune personne n'a encore particip\u00E9 au sondage
+pollen.ui.vote.noPager=%1$d votes existants
+pollen.ui.choice.datePattern=dd/MM/yyyy HH:mm
+pollen.ui.choice.add.title=Ajout d'un choix
+pollen.ui.choice.add.submit=Ajouter
+pollen.ui.error.upload=Une erreur s'est produite lors du transfert des fichiers. La taille maximale autoris\u00E9e est de %1$s par fichier et %2$s au total.
+
+# Tapestry messages for VoteForPoll.tml
+# FORM:: addChoice
+choiceDescription-label=Description
+choiceText-label=Choix
+addChoice-choiceText-required-message=Vous devez saisir un choix.
+choiceDate-label=Date et heure
+addChoice-choiceDate-regexp=\\d{2}\/\\d{2}\/\\d{4}( \\d{2}\\:\\d{2})?
+addChoice-choiceDate-regexp-message=La date de d\u00E9but doit-\u00EAtre au format 31/12/2000 23:59.
+addChoice-choiceDate-required-message=Vous devez saisir un choix.
+choiceImage-label=Image
+addChoice-choiceImage-regexp=\\.(jpe?g|gif|png|JPE?G|GIF|PNG)$
+addChoice-choiceImage-regexp-message=L'image doit-\u00EAtre au format JPG, GIF ou PNG.
+addChoice-choiceImage-required-message=Vous devez saisir un choix.
Modified: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/Border.tml
===================================================================
--- trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/Border.tml 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/Border.tml 2010-03-23 11:15:12 UTC (rev 2955)
@@ -161,8 +161,10 @@
<noscript>
<t:feedback t:id="errorJs" />
</noscript>
- <t:feedback t:id="borderFeedback" />
- <t:body />
+ <t:feedback t:id="borderFeedback" />
+ <t:unless t:test="feedBack.hasErrors">
+ <t:body />
+ </t:unless>
</div>
</div>
Modified: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/poll/VoteForPoll_en.properties
===================================================================
--- trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/poll/VoteForPoll_en.properties 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/poll/VoteForPoll_en.properties 2010-03-23 11:15:12 UTC (rev 2955)
@@ -23,22 +23,22 @@
#vote-noPagerText=%d existing votes
#choices
-addChoice=Adding a choice
-textName-label=Choice *
-textName-required-message=You must provide a choice.
-textDesc-label=Description
-imgFile-label=Image *
-imgFile-regexp=\\.(jpe?g|gif|png|JPE?G|GIF|PNG)$
-imgFile-regexp-message=The image must be a JPG, GIF or PNG file.
-imgFile-required-message=You must provide a choice.
-imgDesc-label=Description
-dateDTF-label=Date and time *
-dateDTF-regexp=\\d{2}\/\\d{2}\/\\d{4}( \\d{2}\\:\\d{2})?
-dateDTF-regexp-message=Date does not match pattern 12/31/2000 12:59 AM.
-dateDTF-required-message=You must provide a choice.
-dateDesc-label=Description
-DTF-pattern=MM/dd/yyyy h:mm a
-submitChoice=Add
+#addChoice=Adding a choice
+#textName-label=Choice *
+#textName-required-message=You must provide a choice.
+#textDesc-label=Description
+#imgFile-label=Image *
+#imgFile-regexp=\\.(jpe?g|gif|png|JPE?G|GIF|PNG)$
+#imgFile-regexp-message=The image must be a JPG, GIF or PNG file.
+#imgFile-required-message=You must provide a choice.
+#imgDesc-label=Description
+#dateDTF-label=Date and time *
+#dateDTF-regexp=\\d{2}\/\\d{2}\/\\d{4}( \\d{2}\\:\\d{2})?
+#dateDTF-regexp-message=Date does not match pattern 12/31/2000 12:59 AM.
+#dateDTF-required-message=You must provide a choice.
+#dateDesc-label=Description
+#DTF-pattern=MM/dd/yyyy h:mm a
+#submitChoice=Add
#comments
comments=Comments about the poll
Modified: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/poll/VoteForPoll_fr.properties
===================================================================
--- trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/poll/VoteForPoll_fr.properties 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/pages/poll/VoteForPoll_fr.properties 2010-03-23 11:15:12 UTC (rev 2955)
@@ -24,21 +24,21 @@
#choices
addChoice=Ajout d'un choix
-textName-label=Choix *
-textName-required-message=Vous devez saisir un choix.
-textDesc-label=Description
-imgFile-label=Image *
-imgFile-regexp=\\.(jpe?g|gif|png|JPE?G|GIF|PNG)$
-imgFile-regexp-message=L'image doit-\u00EAtre au format JPG, GIF ou PNG.
-imgFile-required-message=Vous devez saisir un choix.
-imgDesc-label=Description
-dateDTF-label=Date et heure *
-dateDTF-regexp=\\d{2}\/\\d{2}\/\\d{4}( \\d{2}\\:\\d{2})?
-dateDTF-regexp-message=La date de d\u00E9but doit-\u00EAtre au format 31/12/2000 23:59.
-dateDTF-required-message=Vous devez saisir un choix.
-dateDesc-label=Description
-DTF-pattern=dd/MM/yyyy HH:mm
-submitChoice=Ajouter
+#textName-label=Choix *
+#textName-required-message=Vous devez saisir un choix.
+#textDesc-label=Description
+#imgFile-label=Image *
+#imgFile-regexp=\\.(jpe?g|gif|png|JPE?G|GIF|PNG)$
+#imgFile-regexp-message=L'image doit-\u00EAtre au format JPG, GIF ou PNG.
+#imgFile-required-message=Vous devez saisir un choix.
+#imgDesc-label=Description
+#dateDTF-label=Date et heure *
+#dateDTF-regexp=\\d{2}\/\\d{2}\/\\d{4}( \\d{2}\\:\\d{2})?
+#dateDTF-regexp-message=La date de d\u00E9but doit-\u00EAtre au format 31/12/2000 23:59.
+#dateDTF-required-message=Vous devez saisir un choix.
+#dateDesc-label=Description
+#DTF-pattern=dd/MM/yyyy HH:mm
+#submitChoice=Ajouter
#comments
comments=Commentaires \u00E0 propos du sondage
Added: trunk/pollen-ui/src/main/webapp/ErrorPage.tml
===================================================================
--- trunk/pollen-ui/src/main/webapp/ErrorPage.tml (rev 0)
+++ trunk/pollen-ui/src/main/webapp/ErrorPage.tml 2010-03-23 11:15:12 UTC (rev 2955)
@@ -0,0 +1,4 @@
+<t:border t:address="address" t:pageLogo="literal:Index"
+ xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter">
+
+</t:border>
Modified: trunk/pollen-ui/src/main/webapp/poll/VoteForPoll.tml
===================================================================
--- trunk/pollen-ui/src/main/webapp/poll/VoteForPoll.tml 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/webapp/poll/VoteForPoll.tml 2010-03-23 11:15:12 UTC (rev 2955)
@@ -64,7 +64,8 @@
</p:else>
</t:if>
<th t:type="loop" t:source="choices" t:value="choice" t:volatile="true">
- <t:unless test="choice.hidden">
+ <t:unless test="choice.hidden">
+ <!-- Blocks for each choice type -->
<t:block t:id="choiceText">
<span class="desc">${choice.text}</span>
</t:block>
@@ -76,6 +77,7 @@
<t:block t:id="choiceDate">
<t:output value="choice.date" format="dateFormat"/>
</t:block>
+ <!-- Display choice with or whithout description -->
<t:if t:test="choice.description">
<span t:type="ck/Tooltip" t:value="choice.description" t:effect="blind">
<t:delegate to="choiceBlock" />
@@ -84,7 +86,8 @@
<t:delegate to="choiceBlock" />
</p:else>
</t:if>
- <t:if test="canDeleteChoice()">
+ <t:if test="canDeleteChoice">
+ <!-- Action to delete the choice -->
<t:actionlink t:id="deleteChoice" context="choice.id"
t:mixins="confirm" t:message="message:pollen.ui.choice.delete.confirm">
<img src="${asset:context:img/delete.png}" title="message:pollen.ui.choice.delete.title"
@@ -94,39 +97,39 @@
</t:unless>
</th>
</tr>
- </thead><!--
- <t:if test="pollRunning">-->
-<!-- <tfoot>
+ </thead>
+ <t:if test="canVote">
+ <tfoot>
<tr>
<t:if test="accountFieldDisplayed">
<th id="voterName">
- <t:textField t:value="pollAccount.votingId" t:id="pollAccountName" t:validate="required"/>
+ <input t:type="textfield" t:id="pollAccountName" value="pollAccount.votingId" t:validate="required"/>
</th>
<p:else>
<th></th>
</p:else>
</t:if>
<t:loop t:source="choices" t:value="choice" volatile="true">
- <t:if test="!choiceOfVote.hidden">
+ <t:if test="!choice.hidden">
<th>
- <t:if test="isNormalVoteCounting()">
- <t:checkbox t:value="addChoice" />
+ <t:if test="poll.voteCounting.normal">
+ <input t:type="checkbox" value="addChoice" />
</t:if>
- <t:if test="isPercentageVoteCounting()">
- <t:textField t:value="choiceOfVote.value" size="3" t:validate="required, min=0, max=100"/>%
+ <t:if test="poll.voteCounting.percentage">
+ <t:textField t:value="currentVote.getChoiceValues(choice.id)" size="3" t:validate="required, min=0, max=100"/>%
</t:if>
- <t:if test="isCondorcetVoteCounting()">
+ <t:if test="poll.voteCounting.condorcet">
<t:textField t:id="condorcetInput" t:value="choiceOfVote.value" size="3" t:nulls="zero" t:validate="min=0, max=99"/>
</t:if>
- <t:if test="isNumberVoteCounting()">
+ <t:if test="poll.voteCounting.number">
<t:textField t:value="addNumberVote" size="3" />
</t:if>
</th>
</t:if>
</t:loop>
</tr>
- </tfoot>-->
- <!--</t:if>-->
+ </tfoot>
+ </t:if>
<tbody>
<t:unless t:test="poll.anonymous">
<t:loop t:source="votes" t:value="vote" t:rowIndex="voteIndex" volatile="true">
@@ -229,47 +232,50 @@
<!--</t:zone>-->
- <!-- Ajout de choix -->
- <t:ImageContextLink t:id="imgContext" t:thumb="true" t:dir="poll.pollUId"/>
- <t:if test="${pollChoiceRunning}">
- <h4>${message:addChoice}</h4>
+ <!-- Ajout de choix -->
+ <!--<t:ImageContextLink t:id="imgContext" t:thumb="true" t:dir="poll.pollUId"/>-->
+ <t:if test="canAddChoice">
+ <h4>${message:pollen.ui.choice.add.title}</h4>
<div id="choiceFormDiv">
- <t:form t:id="choiceForm">
- <t:formfragment t:id="textChoiceFragment" visible="textType">
- <t:label for="textName" />
- <br/>
- <t:textfield t:id="textName" t:value="newChoice.name" t:validate="required"/>
- <br/>
- <t:label for="textDesc" />
- <br/>
- <t:textfield t:id="textDesc" t:value="newChoice.description" />
- </t:formfragment>
- <t:formfragment t:id="dateChoiceFragment" visible="dateType">
- <t:label for="dateDTF" />
- <br/>
- <input t:id="dateDTF" t:value="newDateChoice.date" t:validate="required, regexp" datePattern="${message:DTF-pattern}"/>
- <br/>
- <t:label for="dateDesc" />
- <br/>
- <t:textfield t:id="dateDesc" t:value="newDateChoice.description" />
- </t:formfragment>
- <t:formfragment t:id="imgChoiceFragment" visible="imageType">
- <t:label for="imgFile" />
- <br/>
- <input t:type="upload" t:id="imgFile" t:value="newImageChoice.img" t:validate="required, regexp" />
- <br/>
- <t:label for="imgDesc" />
- <br/>
- <t:textfield t:id="imgDesc" t:value="newImageChoice.description" />
- </t:formfragment>
- <t:submit t:id="submitChoiceForm" t:value="${message:submitChoice}" />
+ <t:form t:id="addChoice">
+ <t:if t:test="newChoice.type.date">
+ <label t:type="label" for="choiceDate" />*<br />
+ <input t:type="ck/dateTimeField" t:id="choiceDate" value="newChoice.date"
+ t:timePicker="true" t:timePickerAdjacent="true" t:validate="required, regexp"
+ t:datePattern="message:pollen.ui.choice.datePattern"/>
+ </t:if>
+ <t:if t:test="newChoice.type.image">
+ <label t:type="label" for="choiceImage" />*<br />
+ <input t:type="upload" t:id="choiceImage" t:value="newChoice.image" t:validate="required, regexp" />
+ </t:if>
+ <t:if t:test="newChoice.type.text">
+ <label t:type="label" for="choiceText" />*<br />
+ <input t:type="textfield" t:id="choiceText" value="newChoice.text" t:validate="required"/>
+ </t:if>
+<!-- <t:delegate t:to="newChoiceBlock" /><br />
+ <t:block t:id="newChoiceDate">
+ <label t:type="label" for="choiceDate" />*<br />
+ <input t:type="ck/dateTimeField" t:id="choiceDate" value="newChoice.date"
+ t:timePicker="true" t:timePickerAdjacent="true" t:validate="required, regexp"
+ t:datePattern="message:pollen.ui.choice.datePattern"/>
+ </t:block>
+ <t:block t:id="newChoiceImage">
+ <label t:type="label" for="choiceImage" />*<br />
+ <input t:type="upload" t:id="choiceImage" t:value="newChoice.image" t:validate="required, regexp" />
+ </t:block>
+ <t:block t:id="newChoiceText">
+ <label t:type="label" for="choiceText" />*<br />
+ <input t:type="textfield" t:id="choiceText" value="newChoice.text" t:validate="required"/>
+ </t:block>-->
+ <label t:type="label" for="choiceDescription" /><br />
+ <input t:type="textfield" t:id="choiceDescription" value="newChoice.description" />
+ <input t:type="submit" value="message:pollen.ui.choice.add.submit" />
</t:form>
</div>
</t:if>
- <!-- Ajout de commentaires -->
-
+ <!-- Ajout de commentaires -->
<h3>${message:comments}</h3>
<t:zone t:id="commentZone" show="show" update="show">
<div id="commentsDiv">
Modified: trunk/pollen-ui/src/main/webapp/user/UserPollsCreated.tml
===================================================================
--- trunk/pollen-ui/src/main/webapp/user/UserPollsCreated.tml 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-ui/src/main/webapp/user/UserPollsCreated.tml 2010-03-23 11:15:12 UTC (rev 2955)
@@ -10,7 +10,7 @@
<t:grid t:id="pollsGrid" t:source="polls" t:row="poll" model="pollsModel" t:inPlace="true"
t:rowsPerPage="10" t:pagerPosition="bottom" t:rowClass="prop:evenodd.next">
<p:functionsCell>
- <t:PageLink t:page="poll/VoteForPoll" t:context="poll.pollId">
+ <t:PageLink t:page="poll/VoteForPoll" t:context="poll.pollUId">
<img src="${asset:context:img/vote.png}" title="${message:vote-help}" alt="${message:vote}" />
</t:PageLink>
<t:PageLink t:page="poll/results" t:context="adminId">
@@ -21,18 +21,18 @@
<t:PageLink t:page="poll/modification" t:context="adminId">
<img src="${asset:context:img/edit.png}" title="${message:edit-help}" alt="${message:edit}" />
</t:PageLink>
- <t:ActionLink t:id="close" t:context="poll.pollId">
+ <t:ActionLink t:id="close" t:context="poll.pollUId">
<img src="${asset:context:img/close.png}" title="${message:close-help}" alt="${message:close}" />
</t:ActionLink>
</t:unless>
- <t:ActionLink t:id="export" t:context="poll.pollId">
+ <t:ActionLink t:id="export" t:context="poll.pollUId">
<img src="${asset:context:img/export.png}" title="${message:export-help}" alt="${message:export}" />
</t:ActionLink>
- <t:PageLink t:page="poll/creation" t:context="poll.pollId">
+ <t:PageLink t:page="poll/creation" t:context="poll.pollUId">
<img src="${asset:context:img/copy.png}" title="${message:copy-help}" alt="${message:copy}" />
</t:PageLink>
- <t:ActionLink t:id="deletePoll" t:context="poll.pollId">
+ <t:ActionLink t:id="deletePoll" t:context="poll.pollUId">
<img src="${asset:context:img/delete.png}" title="${message:delete-help}" alt="${message:delete}" />
</t:ActionLink>
</p:functionsCell>
Modified: trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/ChoiceType.java
===================================================================
--- trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/ChoiceType.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/ChoiceType.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -18,4 +18,16 @@
public enum ChoiceType {
TEXT, DATE, IMAGE;
+
+ public boolean isText() {
+ return this.equals(TEXT);
+ }
+
+ public boolean isDate() {
+ return this.equals(DATE);
+ }
+
+ public boolean isImage() {
+ return this.equals(IMAGE);
+ }
}
Modified: trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/PollType.java
===================================================================
--- trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/PollType.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/PollType.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -19,6 +19,22 @@
public enum PollType {
FREE, RESTRICTED, GROUP;
+ public boolean isFree() {
+ return this.equals(FREE);
+ }
+
+ public boolean isRestricted() {
+ return this.equals(RESTRICTED);
+ }
+
+ public boolean isGroup() {
+ return this.equals(GROUP);
+ }
+
+ public boolean isRestrictedOrGroup() {
+ return isRestricted() || isGroup();
+ }
+
public static boolean isGroupType(String value) {
return GROUP.name().equals(value);
}
Modified: trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/VoteCountingType.java
===================================================================
--- trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/VoteCountingType.java 2010-03-23 10:38:12 UTC (rev 2954)
+++ trunk/pollen-votecounting/src/main/java/org/chorem/pollen/common/VoteCountingType.java 2010-03-23 11:15:12 UTC (rev 2955)
@@ -18,4 +18,20 @@
public enum VoteCountingType {
NORMAL, PERCENTAGE, CONDORCET, NUMBER;
+
+ public boolean isNormal() {
+ return this.equals(NORMAL);
+ }
+
+ public boolean isPercentage() {
+ return this.equals(PERCENTAGE);
+ }
+
+ public boolean isCondorcet() {
+ return this.equals(CONDORCET);
+ }
+
+ public boolean isNumber() {
+ return this.equals(NUMBER);
+ }
}
1
0
r2954 - branches/pollen-1.2.5-1.2.x/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll
by echatellier@users.chorem.org 23 Mar '10
by echatellier@users.chorem.org 23 Mar '10
23 Mar '10
Author: echatellier
Date: 2010-03-23 11:38:12 +0100 (Tue, 23 Mar 2010)
New Revision: 2954
Log:
Fix vote count in mail notification
Modified:
branches/pollen-1.2.5-1.2.x/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java
Modified: branches/pollen-1.2.5-1.2.x/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java
===================================================================
--- branches/pollen-1.2.5-1.2.x/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java 2010-03-20 18:42:04 UTC (rev 2953)
+++ branches/pollen-1.2.5-1.2.x/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java 2010-03-23 10:38:12 UTC (rev 2954)
@@ -642,8 +642,8 @@
// Mail au créateur
data.put("to", poll.getCreatorEmail());
data.put("title", messages.format("voteEmail_subject", poll.getTitle()));
- data.put("msg", messages.format("voteEmail_msg", poll.getTitle(), poll
- .getVoteDTOs().size(), voteURL, modifURL));
+ data.put("msg", messages.format("voteEmail_msg", poll.getTitle(),
+ poll.getNbVotes(), voteURL, modifURL));
for (PreventRuleDTO rule : poll.getPreventRuleDTOs()) {
PreventRuleManager manager = new PreventRuleManager(rule);
1
0