Package org.encuestame.persistence.domain.tweetpoll

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPollFolder


     * @throws ServletException
     * @throws IOException
     */
    @Test
    public void testMoveItemJsonFolder() throws ServletException, IOException{
        final TweetPollFolder tpf = createTweetPollFolder("My third tweetPoll folder", getSpringSecurityLoggedUserAccount());
        assertSuccessResponse(this.moveItemJsonFolder("tweetpoll", tpf.getId(), this.tweetPoll.getTweetPollId()));
        assertSuccessResponse(moveItemJsonFolder("survey"this.surveyFolder.getId(), this.survey.getSid()));
        assertSuccessResponse(moveItemJsonFolder("poll"this.pollFolder.getId(), this.poll.getPollId()));
    }
View Full Code Here


     * Update Tweet Poll Folder.
     * @throws EnMeNoResultsFoundException
     */
    public FolderBean updateTweetPollFolder(final Long folderId, final String folderName, final String username)
           throws EnMeNoResultsFoundException{
        final TweetPollFolder tweetPollFolder = this.getTweetPollFolder(folderId);
        if(tweetPollFolder == null) {
            throw new EnMeNoResultsFoundException("Tweet Poll Folder not found");
        }
        else{
            tweetPollFolder.setFolderName(folderName);
            getTweetPollDao().saveOrUpdate(tweetPollFolder);
        }
         return ConvertDomainBean.convertFolderToBeanFolder(tweetPollFolder);
     }
View Full Code Here

     * Remove TweetPoll Folder.
     * @param TweetPoll folderId
     * @throws EnMeNoResultsFoundException
     */
    public void deleteTweetPollFolder(final Long folderId) throws EnMeNoResultsFoundException{
        final TweetPollFolder tweetPollfolder = this.getTweetPollFolder(folderId);
        if(tweetPollfolder != null) {
            getTweetPollDao().delete(tweetPollfolder);
        } else {
            throw new EnMeNoResultsFoundException("TweetPoll folder not found");
        }
View Full Code Here

     * @param folderId
     * @throws EnMeNoResultsFoundException
     */
    public void addTweetPollToFolder(final Long folderId, final String username, final Long tweetPollId)
           throws EnMeNoResultsFoundException {
        final TweetPollFolder tpfolder = this.getTweetPollFolderByFolderId(folderId);
         if (tpfolder != null) {
             final TweetPoll tpoll = this.getTweetPollById(tweetPollId);
             tpoll.setTweetPollFolder(tpfolder);
             getTweetPollDao().saveOrUpdate(tpoll);
         } else {
View Full Code Here

     * @see org.encuestame.core.service.imp.ITweetPollService#searchTweetPollsByFolder(java.lang.Long, java.lang.String)
     */
    public List<TweetPollBean> searchTweetPollsByFolder(final Long folderId,
            final String username) throws EnMeNoResultsFoundException {
        List<TweetPoll> tweetPollsbyFolder = new ArrayList<TweetPoll>();
        final TweetPollFolder tweetPollFolder = getTweetPollDao()
                .getTweetPollFolderById(folderId);
        if (tweetPollFolder == null) {
            throw new EnMeTweetPollNotFoundException(
                    "Tweetpoll folder not found");

View Full Code Here

     * Get Tweet Poll Folder by User and FolderId.
     * @param id folder id.
     * @throws EnMeNoResultsFoundException if username not exist.
     */
    private TweetPollFolder getTweetPollFolderByFolderId(final Long folderId) throws EnMeNoResultsFoundException{
        final TweetPollFolder folder = this.getTweetPollDao()
                .getTweetPollFolderByIdandUser(folderId,
                        getUserAccount(getUserPrincipalUsername()).getAccount());
        if (folder == null) {
            throw new EnMeNoResultsFoundException("tweetpoll folder not valid");
        }
View Full Code Here

     * @param username
     * @return
     * @throws EnMeNoResultsFoundException
     */
    public FolderBean createTweetPollFolder(final String folderName, final String username) throws EnMeNoResultsFoundException{
        final TweetPollFolder tweetPollFolderDomain = new TweetPollFolder();
        tweetPollFolderDomain.setUsers(getUserAccount(username).getAccount());
        tweetPollFolderDomain.setCreatedAt(new Date());
        tweetPollFolderDomain.setCreatedBy(getUserAccount(getUserPrincipalUsername()));
        tweetPollFolderDomain.setStatus(org.encuestame.utils.enums.Status.ACTIVE);
        tweetPollFolderDomain.setFolderName(folderName);
        this.getTweetPollDao().saveOrUpdate(tweetPollFolderDomain);
        return ConvertDomainBean.convertFolderToBeanFolder(tweetPollFolderDomain);
    }
View Full Code Here

     * @param folderName
     * @param users
     * @return
     */
    public TweetPollFolder createTweetPollFolder(final String folderName, final UserAccount users){
        final TweetPollFolder folder = new TweetPollFolder();
        folder.setCreatedAt(new Date());
        folder.setFolderName(folderName);
        folder.setStatus(Status.ACTIVE);
        folder.setCreatedBy(users);
        folder.setUsers(users.getAccount());
        getTweetPoll().saveOrUpdate(folder);
        return folder;
    }
View Full Code Here

     * @param tweetPollId
     * @return
     * @throws EnMeNoResultsFoundException
     */
    public TweetPoll addTweetPollToFolder(final Long folderId, final Long userId, final Long tweetPollId) throws EnMeNoResultsFoundException{
        final TweetPollFolder tpfolder = getTweetPoll().getTweetPollFolderById(folderId);
        final TweetPoll tpoll = getTweetPoll().getTweetPollByIdandUserId(tweetPollId, userId);
        tpoll.setTweetPollFolder(tpfolder);
        getTweetPoll().saveOrUpdate(tpoll);
        return tpoll;
    }
View Full Code Here

   *
   * @throws EnMeNoResultsFoundException
   */
  @Test
  public void testGetTweetPollFolderbyId() throws EnMeNoResultsFoundException {
    final TweetPollFolder tpollFolder = createTweetPollFolder(
        "My fOlder22", this.userAccount);
    final TweetPollFolder myFolder = this.getTweetPollService()
        .getTweetPollFolderbyId(tpollFolder.getId());
  }
View Full Code Here

TOP

Related Classes of org.encuestame.persistence.domain.tweetpoll.TweetPollFolder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.