org.chorem.pollen.votecounting.services
Class ImportExportService
java.lang.Object
org.chorem.pollen.votecounting.services.ImportExportService
public class ImportExportService
- extends Object
Service to import / export a poll to or from his xml representation.
- Since:
- 1.3
- Author:
- tchemit
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
POLL
public static final String POLL
- See Also:
- Constant Field Values
TITLE1
public static final String TITLE1
- See Also:
- Constant Field Values
TITLE
public static final String TITLE
- See Also:
- Constant Field Values
CHOICE
public static final String CHOICE
- See Also:
- Constant Field Values
ID_CHOICE
public static final String ID_CHOICE
- See Also:
- Constant Field Values
VALUE
public static final String VALUE
- See Also:
- Constant Field Values
PERCENTAGE
public static final String PERCENTAGE
- See Also:
- Constant Field Values
NB_VOTES
public static final String NB_VOTES
- See Also:
- Constant Field Values
IS_BY_GROUP
public static final String IS_BY_GROUP
- See Also:
- Constant Field Values
CHOICES
public static final String CHOICES
- See Also:
- Constant Field Values
CHOICE_RESULT
public static final String CHOICE_RESULT
- See Also:
- Constant Field Values
ID_POLL
public static final String ID_POLL
- See Also:
- Constant Field Values
VOTE_COUNTING_RESULT
public static final String VOTE_COUNTING_RESULT
- See Also:
- Constant Field Values
DESCRIPTION
public static final String DESCRIPTION
- See Also:
- Constant Field Values
NAME
public static final String NAME
- See Also:
- Constant Field Values
POLL_CHOICE
public static final String POLL_CHOICE
- See Also:
- Constant Field Values
VOTING_PERSON
public static final String VOTING_PERSON
- See Also:
- Constant Field Values
VOTING_ID
public static final String VOTING_ID
- See Also:
- Constant Field Values
WEIGHT
public static final String WEIGHT
- See Also:
- Constant Field Values
EMAIL
public static final String EMAIL
- See Also:
- Constant Field Values
COMMENT
public static final String COMMENT
- See Also:
- Constant Field Values
VOTING_PERSONS
public static final String VOTING_PERSONS
- See Also:
- Constant Field Values
ID_GROUP
public static final String ID_GROUP
- See Also:
- Constant Field Values
GROUP
public static final String GROUP
- See Also:
- Constant Field Values
POLL_CHOICES
public static final String POLL_CHOICES
- See Also:
- Constant Field Values
VOTE_COUNTING_RESULTS
public static final String VOTE_COUNTING_RESULTS
- See Also:
- Constant Field Values
GROUPS
public static final String GROUPS
- See Also:
- Constant Field Values
COMMENTS
public static final String COMMENTS
- See Also:
- Constant Field Values
CREATOR_ID
public static final String CREATOR_ID
- See Also:
- Constant Field Values
CREATOR_EMAIL
public static final String CREATOR_EMAIL
- See Also:
- Constant Field Values
MAX_CHOICE_NB
public static final String MAX_CHOICE_NB
- See Also:
- Constant Field Values
POLL_EXPORT
public static final String POLL_EXPORT
- See Also:
- Constant Field Values
POLL_ID
public static final String POLL_ID
- See Also:
- Constant Field Values
POLL_TYPE
public static final String POLL_TYPE
- See Also:
- Constant Field Values
CHOICE_TYPE
public static final String CHOICE_TYPE
- See Also:
- Constant Field Values
VOTE_COUNTING
public static final String VOTE_COUNTING
- See Also:
- Constant Field Values
CLOSED
public static final String CLOSED
- See Also:
- Constant Field Values
CHOICE_ADD_ALLOWED
public static final String CHOICE_ADD_ALLOWED
- See Also:
- Constant Field Values
ANONYMOUS_VOTE_ALLOWED
public static final String ANONYMOUS_VOTE_ALLOWED
- See Also:
- Constant Field Values
ANONYMOUS
public static final String ANONYMOUS
- See Also:
- Constant Field Values
PUBLIC_RESULTS
public static final String PUBLIC_RESULTS
- See Also:
- Constant Field Values
CONTINUOUS_RESULTS
public static final String CONTINUOUS_RESULTS
- See Also:
- Constant Field Values
VALUE_TRUE
public static final String VALUE_TRUE
- See Also:
- Constant Field Values
VALUE_FALSE
public static final String VALUE_FALSE
- See Also:
- Constant Field Values
ImportExportService
public ImportExportService()
exportToXml
public String exportToXml(PollExportDTO exportPoll)
- Export the given poll to an xml representation.
- Parameters:
exportPoll - the poll to export
- Returns:
- the xml representation of the given poll
importFromXml
public PollExportDTO importFromXml(File file)
throws org.jdom.JDOMException,
IOException
- Import into a
PollExportDTO his xml representation from the
given file.
- Parameters:
file - file to load
- Returns:
- the loaded dto from the xml representation.
- Throws:
org.jdom.JDOMException - if could not load xml from file
IOException - if could not load the file
toDTO
protected PollExportDTO toDTO(org.jdom.Element racine)
toComments
protected List<CommentDTO> toComments(List<org.jdom.Element> listComments)
toVotingGroups
protected List<VotingGroupDTO> toVotingGroups(List<org.jdom.Element> listGroups)
toVotingPersons
protected List<VotingPersonDTO> toVotingPersons(List<org.jdom.Element> listVotingPersons)
toVoteToChoices
protected List<VoteToChoiceDTO> toVoteToChoices(List<org.jdom.Element> listVoteToChoices)
toPollChoices
protected List<PollChoiceDTO> toPollChoices(List<org.jdom.Element> listPollChoices)
toVoteCountingResults
protected List<VoteCountingResultDTO> toVoteCountingResults(List<org.jdom.Element> listVoteCountingResults)
toChoices
protected List<ChoiceDTO> toChoices(List<org.jdom.Element> listChoices)
toDOM
protected org.jdom.Document toDOM(PollExportDTO exportPoll)
toDOM
protected org.jdom.Element toDOM(CommentDTO comment)
toDOM
protected org.jdom.Element toDOM(VotingGroupDTO group)
toDOM
protected org.jdom.Element toDOM(VotingPersonDTO votingPerson)
toDOM
protected org.jdom.Element toDOM(PollChoiceDTO pollChoice)
toDOM
protected org.jdom.Element toDOM(VoteCountingResultDTO voteCountingResults)
toDOM
protected org.jdom.Element toDOM(ChoiceDTO choice)
Copyright © 2009-2012 CodeLutin. All Rights Reserved.