Package org.apache.tapestry5.json

Examples of org.apache.tapestry5.json.JSONArray


        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        OutputStreamWriter osw = new OutputStreamWriter(stream, "UTF-8");
        PrintWriter writer = new PrintWriter(osw, true);
        long lastModified = 0;

        JSONArray paths = new JSONArray();

        for (Asset library : libraries)
        {
            String path = library.toClientURL();

            paths.put(path);

            writer.format("\n/* %s */;\n", path);

            Resource resource = library.getResource();

View Full Code Here


        trainForEmptyCoreStack(linker, stackSource, pathConstructor);

        JSONObject spec1 = new JSONObject("clientId", "chuck");
        JSONObject spec2 = new JSONObject("clientId", "fred");

        JSONObject aggregated = new JSONObject().put("setup", new JSONArray(spec1, spec2));

        linker.setInitialization(InitializationPriority.IMMEDIATE, aggregated);

        replay();
View Full Code Here

        DocumentLinker linker = mockDocumentLinker();
        JavaScriptStackSource stackSource = mockJavaScriptStackSource();
        JavaScriptStackPathConstructor pathConstructor = mockJavaScriptStackPathConstructor();
        trainForEmptyCoreStack(linker, stackSource, pathConstructor);

        JSONObject aggregated = new JSONObject().put("setup", new JSONArray("chuck", "charley"));

        linker.setInitialization(InitializationPriority.IMMEDIATE, aggregated);

        replay();
View Full Code Here

        DocumentLinker linker = mockDocumentLinker();
        JavaScriptStackSource stackSource = mockJavaScriptStackSource();
        JavaScriptStackPathConstructor pathConstructor = mockJavaScriptStackPathConstructor();
        trainForEmptyCoreStack(linker, stackSource, pathConstructor);

        JSONArray chuck = new JSONArray("chuck", "yeager");
        JSONArray buzz = new JSONArray("buzz", "aldrin");

        JSONObject aggregated = new JSONObject().put("setup", new JSONArray(chuck, buzz));

        linker.setInitialization(InitializationPriority.IMMEDIATE, aggregated);

        replay();
View Full Code Here

        DocumentLinker linker = mockDocumentLinker();
        JavaScriptStackSource stackSource = mockJavaScriptStackSource();
        JavaScriptStackPathConstructor pathConstructor = mockJavaScriptStackPathConstructor();
        trainForEmptyCoreStack(linker, stackSource, pathConstructor);

        JSONObject aggregated = new JSONObject().put("setup", new JSONArray().put("chuck"));

        linker.setInitialization(InitializationPriority.NORMAL, aggregated);

        replay();
View Full Code Here

        DocumentLinker linker = mockDocumentLinker();
        JavaScriptStackSource stackSource = mockJavaScriptStackSource();
        JavaScriptStackPathConstructor pathConstructor = mockJavaScriptStackPathConstructor();
        trainForEmptyCoreStack(linker, stackSource, pathConstructor);

        JSONArray chuck = new JSONArray("chuck", "yeager");

        JSONObject aggregated = new JSONObject().put("setup", new JSONArray(chuck));

        linker.setInitialization(InitializationPriority.NORMAL, aggregated);

        replay();
View Full Code Here

        javascript.addModuleConfigurationCallback(new ModuleConfigurationCallback() {
            @Override
            public JSONObject configure(JSONObject configuration) {
                // see http://stackoverflow.com/questions/8186027/loading-highcharts-with-require-js
                final JSONArray highchartsShim = new JSONArray();
                highchartsShim.put(new JSONObject("exports", "Highcharts"));
                highchartsShim.put(new JSONObject("deps", new JSONArray().put("jquery")));
                configuration.in("shim").put("highcharts", highchartsShim);
                // this supposes the highstock stack only has one javascript library
                configuration.in("paths").put("highcharts", highchartsStack.getJavaScriptLibraries().get(0).toClientURL());
                return configuration;
            }
View Full Code Here

       
        javascript.addModuleConfigurationCallback(new ModuleConfigurationCallback() {
            @Override
            public JSONObject configure(JSONObject configuration) {
                // see http://stackoverflow.com/questions/8186027/loading-highcharts-with-require-js
                final JSONArray highstockShim = new JSONArray();
                highstockShim.put(new JSONObject("exports", "Highstock"));
                highstockShim.put(new JSONObject("deps", new JSONArray().put("jquery")));
                configuration.in("shim").put("highstock", highstockShim);
                // this supposes the highstock stack only has one javascript library
                configuration.in("paths").put("highstock", highstockStack.getJavaScriptLibraries().get(0).toClientURL());
                return configuration;
            }
View Full Code Here

        expect(response.getPrintWriter("application/json;charset=UTF-8")).andReturn(pw);

        replay();

        JSONArray array = new JSONArray("   [ \"fred\", \"barney\" \n\n]");

        JSONArrayEventResultProcessor p = new JSONArrayEventResultProcessor(response, encoding, false);

        p.processResultValue(array);
View Full Code Here

        JSONObject spec = new JSONObject();

        DateFormatSymbols symbols = new DateFormatSymbols(locale);

        spec.put("months", new JSONArray(symbols.getMonths()));

        StringBuilder days = new StringBuilder();

        String[] weekdays = symbols.getWeekdays();
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.json.JSONArray

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.