Package org.fusesource.restygwt.client

Examples of org.fusesource.restygwt.client.Resource


    }

    @Override
    public void getForms() {
        String url = URLBuilder.getFormsURL(this.contextPath, this.packageName);
        Resource resource = new Resource(url);
        resource.get().send(new SimpleTextCallback(i18n.CouldntFindForms()) {
            @Override
            public void onSuccess(Method method, String response) {
                if (method.getResponse().getStatusCode() == Response.SC_OK) {
                    List<FormRepresentation> list = helper.readForms(response);
                    bus.fireEvent(new LoadServerFormResponseEvent(list));
View Full Code Here


    }

    @Override
    public void populateRepresentationFactory() {
        String url = URLBuilder.getRepresentationMappingsURL(this.contextPath);
        Resource resource = new Resource(url);
        resource.get().send(new SimpleTextCallback(i18n.CouldntReadRepresentationMappings()) {
            @Override
            public void onSuccess(Method method, String response) {
                Map<String, String> repMap = helper.readPropertyMap(response);
                for (Map.Entry<String, String> entry : repMap.entrySet()) {
                    RepresentationFactory.registerItemClassName(entry.getKey(), entry.getValue());
View Full Code Here

    }

    @Override
    public void loadFormTemplate(final FormRepresentation form, String language) {
        final String url = URLBuilder.loadFormTemplateURL(this.contextPath, language);
        Resource resource = new Resource(url);
        try {
            String xml = helper.asXml(form, null);
            resource.post().xml(XMLParser.parse(xml)).send(new SimpleTextCallback(i18n.CouldntExportTemplate()) {
                @Override
                public void onSuccess(Method method, String response) {
                    String fileName = helper.getFileName(response);
                    FormPanel auxiliarForm = new FormPanel();
                    auxiliarForm.setMethod(FormPanel.METHOD_GET);
View Full Code Here

        Defaults.setDateFormat(null);
    }

    public <P extends RestService> P setupProxy(P proxy, String endPoint) {
        Resource resource = new Resource(restUrl + endPoint);
        ((RestServiceProxy) proxy).setResource(resource);

        return proxy;
    }
View Full Code Here

        UrlBuilder urlBuilder = new UrlBuilder().module("rest").path("activities");
        if (!action.getActivity().isTransient())
        {
            urlBuilder = urlBuilder.path(action.getActivity().getId());
        }
        return new Resource(urlBuilder.toUrl());
    }
View Full Code Here


    @Override
    protected Resource resourceFor(GetProjectsAction action)
    {
        return new Resource(new UrlBuilder().module("rest").path("projects").toUrl());
    }
View Full Code Here


    @Override
    protected Resource resourceFor(GetRunningActivityAction action)
    {
        return new Resource(new UrlBuilder().module("rest").path("activities", "running").toUrl());
    }
View Full Code Here


    @Override
    protected Resource resourceFor(GetDurationsAction action)
    {
        return new Resource(new UrlBuilder().module("rest").path("activities", "current", "durations").toUrl());
    }
View Full Code Here


    @Override
    protected Resource resourceFor(GetYearsAction action)
    {
        return new Resource(new UrlBuilder().module("rest").path("activities", "years").toUrl());
    }
View Full Code Here


    @Override
    protected Resource resourceFor(GetSettingsAction action)
    {
        return new Resource(new UrlBuilder().module("rest").path("settings").toUrl());
    }
View Full Code Here

TOP

Related Classes of org.fusesource.restygwt.client.Resource

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.