Example usage for com.google.gwt.http.client URL decodeQueryString

List of usage examples for com.google.gwt.http.client URL decodeQueryString

Introduction

In this page you can find the example usage for com.google.gwt.http.client URL decodeQueryString.

Prototype

public static String decodeQueryString(String encodedURLComponent) 

Source Link

Document

Returns a string where all URL component escape sequences have been converted back to their original character representations.

Usage

From source file:org.client.Xholon.java

License:Open Source License

/**
 * Test Xholon./*  w ww.j av  a  2  s  .c  om*/
 */
private void testXholon(TextArea resultField) {

    // get HTTP parameters
    appName = Location.getParameter("app");
    if (appName != null) {
        // convert "+" back to " ", etc.
        appName = URL.decodeQueryString(appName);
    }
    src = Location.getParameter("src");
    String withGuiParam = Location.getParameter("gui");
    System.out.println(appName);
    if (appName == null) {
        appName = "HelloWorld";
    } else if (src != null) {
        // ex: "gist" + "1234567"
        // ex: "lstr" + "1234567"
        appName = src + appName;
    }
    //boolean withGui = true; // default
    String withGui = GUI_CLASSIC;
    if (withGuiParam != null) {
        //withGui = Boolean.parseBoolean(withGuiParam);
        withGui = withGuiParam;
    }

    // run Xholon app
    if ("Chameleon".equals(appName)) {
        Chameleon(withGui);
    } else if ("Furcifer".equals(appName)) {
        Furcifer(withGui);
    } else if ("Bestiary".equals(appName)) {
        Bestiary(withGui);
    } else if ("HelloWorld".equals(appName)) {
        HelloWorld(withGui);
    } else if ("PingPong".equals(appName)) {
        PingPong(withGui);
    } else if ("Cell".equals(appName)) {
        Cell(withGui);
    } else if ("Life".equals(appName)) {
        Life(withGui);
    } else if ("Life_3d".equals(appName)) {
        Life_3d(withGui);
    } else if ("CellAutop".equals(appName)) {
        CellAutop(withGui);
    } else if ("GameOfLife".equals(appName)) {
        GameOfLife(withGui);
    } else if ("GameOfLife_Big".equals(appName)) {
        GameOfLife_Big(withGui);
    } else if ("GameOfLife_Huge".equals(appName)) {
        GameOfLife_Huge(withGui);
    } else if ("HelloWorld_TestTime".equals(appName)) {
        HelloWorld_TestTime(withGui);
    } else if ("_1dSimple".equals(appName)) {
        _1dSimple(withGui);
    } else if ("Generic".equals(appName)) {
        Generic(withGui);
    } else if ("model04".equals(appName)) {
        model04(withGui);
    } else if ("carboncycle03".equals(appName)) {
        carboncycle03(withGui);
    } else if ("SpringIdol".equals(appName)) {
        SpringIdol(withGui);
    } else if ("TurtleExample1".equals(appName)) {
        TurtleExample1(withGui);
    } else if ("WolfSheepGrass".equals(appName)) {
        WolfSheepGrass(withGui);
    } else if ("mdcs_m2_1mp".equals(appName)) {
        mdcs_m2_1mp(withGui);
    } else if ("mdcs_m2_2mp".equals(appName)) {
        mdcs_m2_2mp(withGui);
    } else if ("igm".equals(appName)) {
        igm(withGui);
    } else if ("AdapSysLab".equals(appName)) {
        AdapSysLab(withGui);
    } else if ("MeTTTa".equals(appName)) {
        MeTTTa(withGui);
    } else if ("solarsystemtest".equals(appName)) {
        solarsystemtest(withGui);
    } else if ("Collisions".equals(appName)) {
        Collisions(withGui);
    } else if ("Hex".equals(appName)) {
        Hex(withGui);
    } else if ("_09SpatialGames".equals(appName)) {
        _09SpatialGames(withGui);
    }

    // RCS manually-created
    else if ("Rcs1".equals(appName)) {
        Rcs1(withGui);
    } else if ("Rcs2".equals(appName)) {
        Rcs2(withGui);
    }
    // RCS from UML MagicDraw
    else if ("Rcs_GP_FSM".equals(appName)) {
        Rcs_GP_FSM(withGui);
    } else if ("Rcs_GP_FSM_Grid".equals(appName)) {
        Rcs_GP_FSM_Grid(withGui);
    } else if ("Rcs_GP_MM".equals(appName)) {
        Rcs_GP_MM(withGui);
    } else if ("Rcs_GP_MM_NoSymbols".equals(appName)) {
        Rcs_GP_MM_NoSymbols(withGui);
    }

    else if ("roomsghosts".equals(appName)) {
        roomsghosts(withGui);
    }
    //else if ("Risk".equals(appName)) {Risk(withGui);}
    else if ("English2French".equals(appName)) {
        English2French(withGui);
    } else if ("XBar_ex1".equals(appName)) {
        XBar_ex1(withGui);
    } else if ("RavaszHnm".equals(appName)) {
        RavaszHnm(withGui);
    } else if ("Red".equals(appName)) {
        Red(withGui);
    } else if ("TweenTrees".equals(appName)) {
        TweenTrees(withGui);
    } else if ("WaterLogic".equals(appName)) {
        WaterLogic(withGui);
    } else if ("TestFsmKW".equals(appName)) {
        TestFsmKW(withGui);
    } else if ("Turnstile".equals(appName)) {
        Turnstile(withGui);
    } else if ("testNodePorts".equals(appName)) {
        testNodePorts(withGui);
    } else if ("MathmlTest1".equals(appName)) {
        MathmlTest1(withGui);
    } else if ("OrNodeSample".equals(appName)) {
        OrNodeSample(withGui);
    }

    // Ealontro (non-Genetic Programming versions)
    else if ("AntForaging".equals(appName)) {
        AntForaging(withGui);
    } else if ("CartCentering".equals(appName)) {
        CartCentering(withGui);
    } else if ("AntTrail".equals(appName)) {
        AntTrail(withGui);
    } else if ("Tutorial4".equals(appName)) {
        Tutorial4(withGui);
    }

    // Agent Base Modeling (ABM) - Stupid Models
    else if ("StupidModel1".equals(appName)) {
        StupidModel1(withGui);
    } else if ("StupidModel2".equals(appName)) {
        StupidModel2(withGui);
    } else if ("StupidModel3".equals(appName)) {
        StupidModel3(withGui);
    } else if ("StupidModel4".equals(appName)) {
        StupidModel4(withGui);
    } else if ("StupidModel5".equals(appName)) {
        StupidModel5(withGui);
    } else if ("StupidModel5tg".equals(appName)) {
        StupidModel5tg(withGui);
    } else if ("StupidModel6".equals(appName)) {
        StupidModel6(withGui);
    } else if ("StupidModel7".equals(appName)) {
        StupidModel7(withGui);
    } else if ("StupidModel8".equals(appName)) {
        StupidModel8(withGui);
    } else if ("StupidModel9".equals(appName)) {
        StupidModel9(withGui);
    } else if ("StupidModel10".equals(appName)) {
        StupidModel10(withGui);
    } else if ("StupidModel11".equals(appName)) {
        StupidModel11(withGui);
    } else if ("StupidModel12".equals(appName)) {
        StupidModel12(withGui);
    } else if ("StupidModel13".equals(appName)) {
        StupidModel13(withGui);
    } else if ("StupidModel14".equals(appName)) {
        StupidModel14(withGui);
    } else if ("StupidModel15".equals(appName)) {
        StupidModel15(withGui);
    } else if ("StupidModel16".equals(appName)) {
        StupidModel16(withGui);
    } else if ("StupidModel16nl".equals(appName)) {
        StupidModel16nl(withGui);
    }

    // FSM UML MagicDraw
    else if ("TestFsm".equals(appName)) {
        TestFsm(withGui);
    } else if ("TestFsmForkJoin".equals(appName)) {
        TestFsmForkJoin(withGui);
    } else if ("TestFsmHistory".equals(appName)) {
        TestFsmHistory(withGui);
    } else if ("TestFsmJunction".equals(appName)) {
        TestFsmJunction(withGui);
    } else if ("TestFsmOrthogonal".equals(appName)) {
        TestFsmOrthogonal(withGui);
    } else if ("Elevator".equals(appName)) {
        Elevator(withGui);
    } else if ("Elevator_ShowStates".equals(appName)) {
        Elevator_ShowStates(withGui);
    } else if ("Beard2005_UML_Xholon_Step4_v1".equals(appName)) {
        Beard2005_UML_Xholon_Step4_v1(withGui);
    } else if ("Fsm06ex1_FsmXmi".equals(appName)) {
        Fsm06ex1_FsmXmi(withGui);
    } else if ("HelloWorldTutorial".equals(appName)) {
        HelloWorldTutorial(withGui);
    } else if ("HelloWorldTutorial_multiWorld".equals(appName)) {
        HelloWorldTutorial_multiWorld(withGui);
    } else if ("HelloWorldTutorial_plus".equals(appName)) {
        HelloWorldTutorial_plus(withGui);
    } else if ("HelloWorldTutorial_universe".equals(appName)) {
        HelloWorldTutorial_universe(withGui);
    } else if ("ProvidedRequiredTest".equals(appName)) {
        ProvidedRequiredTest(withGui);
    } else if ("StopWatch".equals(appName)) {
        StopWatch(withGui);
    } else if ("StopWatch_Xhym".equals(appName)) {
        StopWatch_Xhym(withGui);
    }

    // other UML/SysML (ArgoUML Poseidon Topcased)
    else if ("HelloWorldTutorialArgoUML".equals(appName)) {
        HelloWorldTutorialArgoUML(withGui);
    } else if ("Watch".equals(appName)) {
        Watch(withGui);
    } else if ("HelloWorldTutorialSysML".equals(appName)) {
        HelloWorldTutorialSysML(withGui);
    } else if ("HelloWorldTutorialTc".equals(appName)) {
        HelloWorldTutorialTc(withGui);
    } else if ("StateMachineOnly".equals(appName)) {
        StateMachineOnly(withGui);
    }

    // Petri Net
    else if ("feinberg1".equals(appName)) {
        feinberg1(withGui);
    } else if ("pn".equals(appName)) {
        pn(withGui);
    }

    // dynsys
    else if ("Fibonacci".equals(appName)) {
        Fibonacci(withGui);
    } else if ("Gravity1".equals(appName)) {
        Gravity1(withGui);
    } else if ("Interest".equals(appName)) {
        Interest(withGui);
    } else if ("ScheffranNActor".equals(appName)) {
        ScheffranNActor(withGui);
    } else if ("ScheffranTwoActor".equals(appName)) {
        ScheffranTwoActor(withGui);
    } else if ("Train".equals(appName)) {
        Train(withGui);
    } else if ("leakybucket".equals(appName)) {
        leakybucket(withGui);
    } else if ("stability".equals(appName)) {
        stability(withGui);
    }

    // Membrane Computing (PSystems)
    else if ("BraneCalc1".equals(appName)) {
        BraneCalc1(withGui);
    } else if ("CoopPSys00ex0".equals(appName)) {
        CoopPSys00ex0(withGui);
    } else if ("CoopSys02ex32_1".equals(appName)) {
        CoopSys02ex32_1(withGui);
    } else if ("CoopSys02ex343_1".equals(appName)) {
        CoopSys02ex343_1(withGui);
    } else if ("CoopSys02ex343_2".equals(appName)) {
        CoopSys02ex343_2(withGui);
    } else if ("Fsm06ex1".equals(appName)) {
        Fsm06ex1(withGui);
    } else if ("Fsm06ex1_Fsm".equals(appName)) {
        Fsm06ex1_Fsm(withGui);
    } else if ("SymAnti02ex41".equals(appName)) {
        SymAnti02ex41(withGui);
    }

    // SBML
    else if ("Brusselator".equals(appName)) {
        Brusselator(withGui);
    } else if ("CellModel".equals(appName)) {
        CellModel(withGui);
    } else if ("CircadianClock".equals(appName)) {
        CircadianClock(withGui);
    } else if ("DimericMWCstiff".equals(appName)) {
        DimericMWCstiff(withGui);
    } else if ("Glycolysis".equals(appName)) {
        Glycolysis(withGui);
    } else if ("YeastGlyPritchardKel".equals(appName)) {
        YeastGlyPritchardKel(withGui);
    }

    // HtmlApplication
    else if ("HtmlApplication".equals(appName)) {
        HtmlApplication();
    }

    // gist (ex: "gist3377945")
    else if ((appName.startsWith("gist")) && (appName.length() > 4)) {
        gist(withGui, appName);
    }

    // lstr (ex: "lstr3377945")
    else if ((appName.startsWith("lstr")) && (appName.length() > 4)) {
        lstr(withGui, appName);
    }

    else {
        resultField.setText("unable to load " + appName);
    }

}

From source file:org.datacleaner.monitor.dashboard.widgets.DashboardGroupSelectionPanel.java

License:Open Source License

private void initializeNewTimelineIfNeeded(final String historyToken) {
    final String prefix = "new_timeline_";
    if (historyToken != null && historyToken.startsWith(prefix)) {
        String jobName = historyToken.substring(prefix.length());
        jobName = URL.decodeQueryString(jobName);

        GWT.log("Showing new timeline popup for job: " + jobName);

        final CreateTimelineHandler handler = new CreateTimelineHandler(_service, _tenant, _defaultGroupPanel);
        final DCPopupPanel popup = handler.createPopup();
        handler.setJob(popup, new JobIdentifier(jobName));
        popup.show();//from w w w . j  a  va 2 s  .  c om
    }
}

From source file:org.ednovo.gooru.application.client.gin.AppPlaceManager.java

License:Open Source License

public String modifyNameToken(String historyToken) {
    String unescapedHistoryToken = URL.decodeQueryString(historyToken);
    if (unescapedHistoryToken.startsWith("!")) {
        unescapedHistoryToken = unescapedHistoryToken.substring(1);
    }//from   w  w  w  .  j  ava  2  s  . c  o m
    return unescapedHistoryToken;
}

From source file:org.ednovo.gooru.application.client.gin.AppPlaceManager.java

License:Open Source License

public String replaceNameToken(String historyToken) {
    String unescapedHistoryToken = URL.decodeQueryString(historyToken);
    unescapedHistoryToken = unescapedHistoryToken.replaceAll(PlaceTokens.PREVIEW_PLAY,
            PlaceTokens.COLLECTION_PLAY);
    return unescapedHistoryToken;
}

From source file:org.ednovo.gooru.client.mvp.assessments.play.resource.question.HotTextAnswersQuestionView.java

License:Open Source License

private void renderQuestionAnswerOptions() {

    if (collectionItemDo != null && collectionItemDo.getResource() != null
            && collectionItemDo.getResource().getAnswers() != null) {
        final TreeSet<QuestionAnswerDo> answersSet = collectionItemDo.getResource().getAnswers();
        List<QuestionAnswerDo> answerListSet = new ArrayList<QuestionAnswerDo>(answersSet);

        if (collectionItemDo.getResource().getType() == 8) {

            if (attemptedAnswerDo != null) {
                String ansWithStyle = URL.decodeQueryString(attemptedAnswerDo.getAnswersText());
                if (ansWithStyle.contains(STYLE_CORRECT)) {
                    ansWithStyle = ansWithStyle.replace(STYLE_CORRECT, "");
                }/*from  w w w .j  a  v  a 2  s  .com*/
                if (ansWithStyle.contains(STYLE_INCORRECT)) {
                    ansWithStyle = ansWithStyle.replace(STYLE_INCORRECT, "");
                }

                HTML ansHtml = new HTML(ansWithStyle);
                ansHtml.addClickHandler(new ClickHandler() {

                    @Override
                    public void onClick(ClickEvent event) {
                        optionsContainerFpnl.clear();
                        setRenderAnswers(answersSet);
                        enableCheckAnswerButton();
                    }
                });

                optionsContainerFpnl.add(ansHtml);

            } else {
                setRenderAnswers(answersSet);
            }

        } else {
            correctAnsSequence = RandomIterator.getRandomStringArray(answerListSet.size());
            attemptAnsSequence = new String[answerListSet.size()];

            if (attemptedAnswerDo != null) {
                Map<Integer, Boolean> answerOptionCount = attemptedAnswerDo.getAnswerOptionResult();
                int k = 0;

                for (Map.Entry<Integer, Boolean> entry : answerOptionCount.entrySet()) {

                    QuestionAnswerDo questionAnswerDo = answerListSet.get(entry.getKey());
                    HTAnswerChoiceOptionView htAnswerOptionView = new HTAnswerChoiceOptionView(
                            questionAnswerDo.getAnswerText(), ("(" + (char) (65 + k) + ") "));
                    htAnswerOptionView.getElement().setId(String.valueOf(entry.getKey()));
                    int beforeIndex = k + 1;
                    optionsContainer.addDraggable(htAnswerOptionView, beforeIndex, entry.getKey());
                    k++;
                }

            } else {
                for (int i = 0; i < answerListSet.size(); i++) {
                    int randomSeq = (Integer) randomSequenceList.get(i);
                    QuestionAnswerDo questionAnswerDo = answerListSet.get(randomSeq);
                    HTAnswerChoiceOptionView htAnswerOptionView = new HTAnswerChoiceOptionView(
                            questionAnswerDo.getAnswerText(), ("(" + (char) (65 + i) + ") "));
                    htAnswerOptionView.getElement().setId(String.valueOf(randomSeq));
                    int beforeIndex = i + 1;
                    optionsContainer.addDraggable(htAnswerOptionView, beforeIndex, randomSeq);
                    enableCheckAnswerButton();

                }
            }
        }
    }

}

From source file:org.ednovo.gooru.client.mvp.gsearch.SearchAbstractPresenter.java

License:Open Source License

/**
 * Assign query and filters for search// w  w  w  .  j  av  a 2 s  . c o m
 */
private void initParam() {
    getSearchDo().setSearchResults(null);
    String queryVal = "";
    if (getPlaceManager().getRequestParameter(QUERY) != null) {
        queryVal = getPlaceManager().getRequestParameter(QUERY);
        /* queryVal = queryVal.replaceAll("%5C1", "&"); */
    }
    try {
        queryVal = URL.decodeQueryString(queryVal);
    } catch (Exception ex) {
        AppClientFactory.printSevereLogger(ex.getMessage());
    }
    getSearchDo().setQuery(queryVal);
    getSearchDo().setFilters(getSearchFilters());
}

From source file:org.ednovo.gooru.client.mvp.home.LogoutPopupVc.java

License:Open Source License

/**
 * Logout from signed user and makes as a anonymous user 
 * @param clickEvent instance of {@link ClickEvent}
 *//*from  w  ww . j  a v  a  2 s .c om*/
@UiHandler("okBtnUc")
public void userLogout(ClickEvent clickEvent) {
    AppClientFactory.getInjector().getAppService().v2Signout(new SimpleAsyncCallback<UserDo>() {

        @Override
        public void onSuccess(UserDo result) {

            String premiumAccountUserName = AppClientFactory.getLoggedInUser().getUsername();

            AppClientFactory.fireEvent(new ClearClasspageListEvent());

            Window.enableScrolling(true);
            AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, true));
            AppClientFactory.setLoggedInUser(result);
            AppClientFactory.getInjector().getWrapPresenter().get().setLoginData(result);
            //AppClientFactory.resetPlace();
            if (premiumAccountUserName.equalsIgnoreCase("TexasTeacher")) {
                AppClientFactory.fireEvent(new SetTexasAccountEvent("failure"));
                AppClientFactory.fireEvent(new SetTexasPlaceHolderEvent(false));
            } else {
                AppClientFactory.fireEvent(new SetTexasAccountEvent("success"));
                AppClientFactory.fireEvent(new SetTexasPlaceHolderEvent(true));
            }
            AppClientFactory.fireEvent(new StandardPreferenceSettingEvent(null));

            if (AppClientFactory.getPlaceManager().getCurrentPlaceRequest().getNameToken()
                    .equalsIgnoreCase(PlaceTokens.HOME)
                    || AppClientFactory.getPlaceManager().getCurrentPlaceRequest().getNameToken()
                            .equalsIgnoreCase(PlaceTokens.RESOURCE_SEARCH)
                    || AppClientFactory.getPlaceManager().getCurrentPlaceRequest().getNameToken()
                            .equalsIgnoreCase(PlaceTokens.COLLECTION_SEARCH)) {
                Map<String, String> map = StringUtil.splitQuery(Window.Location.getHref());
                if (map.containsKey("query")) {
                    String queryVal = map.get("query");
                    queryVal = queryVal.replaceAll("%5C1", "&");
                    try {
                        queryVal = URL.decodeQueryString(queryVal);
                    } catch (Exception ex) {

                    }
                    map.put("query", queryVal);
                }
                if (map.containsKey("flt.subjectName")) {
                    String subjectNameVal = map.get("flt.subjectName");
                    subjectNameVal = subjectNameVal.replaceAll("%5C1", "&");
                    try {
                        subjectNameVal = URL.decodeQueryString(subjectNameVal);
                    } catch (Exception ex) {

                    }
                    subjectNameVal = subjectNameVal.replace("+", " ");
                    map.put("flt.subjectName", subjectNameVal);
                }
                map.remove("callback");
                map.remove("type");
                map.remove("userName");
                map.remove("account");
                AppClientFactory.getPlaceManager().revealPlace(AppClientFactory.getCurrentPlaceToken(), map);
            } else {
                AppClientFactory.getPlaceManager().revealPlace(PlaceTokens.HOME);
            }
            appPopUp.hide();
        }

    });

}

From source file:org.ednovo.gooru.client.mvp.play.resource.question.HotTextAnswersQuestionView.java

License:Open Source License

private void renderQuestionAnswerOptions() {

    if (collectionItemDo != null && collectionItemDo.getResource() != null
            && collectionItemDo.getResource().getAnswers() != null) {
        final TreeSet<QuestionAnswerDo> answersSet = collectionItemDo.getResource().getAnswers();
        List<QuestionAnswerDo> answerListSet = new ArrayList<QuestionAnswerDo>(answersSet);

        if (collectionItemDo.getResource().getType() == 8) {

            if (attemptedAnswerDo != null) {
                HTML ansHtml = new HTML(URL.decodeQueryString(attemptedAnswerDo.getAnswersText()));
                ansHtml.addClickHandler(new ClickHandler() {

                    @Override/* w  w w .  j a  v a  2s . c om*/
                    public void onClick(ClickEvent event) {
                        optionsContainerFpnl.clear();
                        setRenderAnswers(answersSet);
                        enableCheckAnswerButton();
                    }
                });

                optionsContainerFpnl.add(ansHtml);

                /*String text=removeHtmlTags(attemptedAnswerDo.getAnswersText());
                String[] temp;
                String delimiter;
                if(collectionItemDo.getResource().getHlType().equalsIgnoreCase(i18n.GL3219_1())){
                   temp = text.split(SPACE);
                   delimiter=SPACE;
                }else {
                   temp = text.split("\\.");
                   delimiter=DOT;
                }
                for(int k=0;k<temp.length;k++){
                   final InlineLabel lbl=new InlineLabel(temp[k]+delimiter);
                   if(lbl.getText().startsWith(START_CORRECT_DELIMITER) && (lbl.getText().endsWith(END_CORRECT_DELIMITER+SPACE)|| lbl.getText().trim().endsWith(DOT+END_CORRECT_DELIMITER+SPACE) || lbl.getText().trim().endsWith(END_CORRECT_DELIMITER+DOT))){
                      String lblText=lbl.getText().replaceAll("[${}\\[\\]]", "");
                      lbl.setText(lblText);
                      lbl.getElement().setId(STYLE_CORRECT);
                      lbl.addStyleName(STYLE_HIGHLIGHT);
                   }
                   else if(lbl.getText().startsWith(START_DELIMITER) && (lbl.getText().endsWith(END_DELIMITER+SPACE)|| lbl.getText().trim().endsWith(END_DELIMITER+DOT))){
                      String lblText=lbl.getText().replaceAll("[${}\\[\\]]", "");
                      lbl.setText(lblText);
                      lbl.getElement().setId(STYLE_INCORRECT);
                      lbl.addStyleName(STYLE_HIGHLIGHT);
                   }
                        
                   lbl.addStyleName("htPlayerAns");
                   lbl.addClickHandler(new ClickHandler() {
                      @Override
                      public void onClick(ClickEvent event) {
                optionsContainerFpnl.clear();
                setRenderAnswers(answersSet);
                enableCheckAnswerButton();
                      }
                   });
                   optionsContainerFpnl.add(lbl);
                }*/

                showPreviousResult();

            } else {
                setRenderAnswers(answersSet);
            }

        } else {
            correctAnsSequence = RandomIterator.getRandomStringArray(answerListSet.size());
            attemptAnsSequence = new String[answerListSet.size()];

            if (attemptedAnswerDo != null) {
                Map<Integer, Boolean> answerOptionCount = attemptedAnswerDo.getAnswerOptionResult();
                int k = 0;

                for (Map.Entry<Integer, Boolean> entry : answerOptionCount.entrySet()) {

                    QuestionAnswerDo questionAnswerDo = answerListSet.get(entry.getKey());
                    HTAnswerChoiceOptionView htAnswerOptionView = new HTAnswerChoiceOptionView(
                            questionAnswerDo.getAnswerText(), ("(" + (char) (65 + k) + ") "));
                    htAnswerOptionView.getElement().setId(String.valueOf(entry.getKey()));
                    int beforeIndex = k + 1;
                    optionsContainer.addDraggable(htAnswerOptionView, beforeIndex, entry.getKey());
                    showPreviousResult(entry.getKey(), htAnswerOptionView, entry.getValue());
                    k++;
                }

            } else {
                for (int i = 0; i < answerListSet.size(); i++) {
                    int randomSeq = (Integer) randomSequenceList.get(i);
                    QuestionAnswerDo questionAnswerDo = answerListSet.get(randomSeq);
                    HTAnswerChoiceOptionView htAnswerOptionView = new HTAnswerChoiceOptionView(
                            questionAnswerDo.getAnswerText(), ("(" + (char) (65 + i) + ") "));
                    htAnswerOptionView.getElement().setId(String.valueOf(randomSeq));
                    int beforeIndex = i + 1;
                    optionsContainer.addDraggable(htAnswerOptionView, beforeIndex, randomSeq);
                    enableCheckAnswerButton();

                }
            }
        }
    }

}

From source file:org.ednovo.gooru.client.mvp.search.AbstractSearchPresenter.java

License:Open Source License

/**
 * Assign page number and page size for search
 *///from   ww  w.j a  v a 2s . c  o m
private void initParam() {
    getSearchDo().setSearchResults(null);
    String queryVal = "";
    if (getPlaceManager().getRequestParameter(QUERY) != null) {
        queryVal = getPlaceManager().getRequestParameter(QUERY);
        queryVal = queryVal.replaceAll("%5C1", "&");
    }
    try {
        queryVal = URL.decodeQueryString(queryVal);
    } catch (Exception ex) {

    }
    getSearchDo().setQuery(queryVal);
    getSearchDo().setPageNum(getPlaceManager().getRequestParameterAsInt(PAGE_NUM));
    getSearchDo().setPageSize(getPlaceManager().getRequestParameterAsInt(PAGE_SIZE));
    getSearchDo().setFilters(getSearchFilters());
}

From source file:org.ednovo.gooru.client.mvp.search.AbstractSearchPresenter.java

License:Open Source License

@Override
public void paginateSearch(int pageNum) {
    String queryVal = "";
    if (getPlaceManager().getRequestParameter(QUERY) != null) {
        queryVal = getPlaceManager().getRequestParameter(QUERY);
        queryVal = queryVal.replaceAll("%5C1", "&");
    }//from  w w w.  j a  v  a2 s .c  o m
    try {
        queryVal = URL.decodeQueryString(queryVal);
    } catch (Exception ex) {

    }
    if (getViewToken().equalsIgnoreCase(getCurrentPlaceToken())) {
        getSearchDo().setPageNum(pageNum);
        getSearchDo().setQuery(queryVal);
        onSearchRequest(null);
    }
}