Package org.jahia.ajax.gwt.client.core

Examples of org.jahia.ajax.gwt.client.core.BaseAsyncCallback


                    s.append("\n").append(node.getName());
                }
                Window.alert(s.toString());
            }
            if (!actualSelection.isEmpty()) {
                JahiaContentManagementService.App.getInstance().checkWriteable(JCRClientUtils.getPathesList(actualSelection), new BaseAsyncCallback() {
                    public void onApplicationFailure(Throwable throwable) {
                        Window.alert(Messages.get("failure.cut.label") + "\n" + throwable.getLocalizedMessage());
                    }

                    public void onSuccess(Object o) {
View Full Code Here


                        final GWTJahiaNodeProperty gwtJahiaNodeProperty = new GWTJahiaNodeProperty(property,
                                new GWTJahiaNodePropertyValue((String) null,
                                        GWTJahiaNodePropertyType.WEAKREFERENCE));
                        properties.add(gwtJahiaNodeProperty);
                        JahiaContentManagementService.App.getInstance()
                                .saveProperties(Arrays.asList(node), properties, null, new BaseAsyncCallback() {
                                    public void onSuccess(Object o) {
                                        getMainModule().getEditLinker().refresh(EditLinker.REFRESH_MAIN);
                                    }

                                    public void onApplicationFailure(Throwable throwable) {
                                        Window.alert("Failed : " + throwable);
                                    }
                                });

                    } else {
                        String s = JahiaGWTParameters.getContextPath();
                        if (s.equals("/")) {
                            s = "";
                        }
                        mainModule.setStyleAttribute("cursor",
                                "url('" + s + "/gwt/resources/images/xtheme-jahia-andromeda/panel/link.cur'), pointer");

                        mainModule.getEditLinker().setSelectionListener(new ModuleSelectionListener() {
                            public void onModuleSelection(Module selection) {
                                mainModule.setStyleAttribute("cursor", "");
                                mainModule.getEditLinker().setSelectionListener(null);
                                if (selection.getNode() != node) {
                                    List<GWTJahiaNodeProperty> properties = new ArrayList<GWTJahiaNodeProperty>();
                                    final GWTJahiaNodeProperty gwtJahiaNodeProperty = new GWTJahiaNodeProperty(property,
                                            new GWTJahiaNodePropertyValue(selection.getNode(),
                                                    GWTJahiaNodePropertyType.WEAKREFERENCE));
                                    properties.add(gwtJahiaNodeProperty);
                                    JahiaContentManagementService.App.getInstance()
                                            .saveProperties(Arrays.asList(node), properties, null, new BaseAsyncCallback() {
                                                public void onSuccess(Object o) {
                                                    getMainModule().getEditLinker().refresh(EditLinker.REFRESH_MAIN);
                                                }

                                                public void onApplicationFailure(Throwable throwable) {
View Full Code Here

            String propValueString = String.valueOf(date.getTime());
            props.add(new GWTJahiaNodeProperty("j:scheduled", new GWTJahiaNodePropertyValue(propValueString, GWTJahiaNodePropertyType.DATE)));

            List<GWTJahiaNode> nodes = new ArrayList<GWTJahiaNode>();
            nodes.add(gwtJahiaNode);
            JahiaContentManagementService.App.getInstance().saveProperties(nodes, props, null, new BaseAsyncCallback() {
                public void onSuccess(Object result) {
                    linker.loaded();
                    unmask();
                    hide();
                    linker.refresh(EditLinker.REFRESH_MAIN);
View Full Code Here

            Grid<GWTJahiaNodeUsage> grid = NodeUsagesGrid.createUsageGrid(Arrays.asList(engine.getNode()));
            Button button = new Button(Messages.get("label.usages.clean"), new SelectionListener<ButtonEvent>() {
                @Override
                public void componentSelected(ButtonEvent ce) {
                    final JahiaContentManagementServiceAsync service = JahiaContentManagementService.App.getInstance();
                    service.cleanReferences(engine.getNode().getPath(), new BaseAsyncCallback() {
                        /**
                         * Called when an asynchronous call completes successfully.
                         *
                         * @param result the return value of the remote produced call
                         */
 
View Full Code Here

                final HashMap<String, Object> map = new HashMap<String, Object>();
                map.put("customWorkflowInfo", UnpublicationWorkflow.this);

                JahiaContentManagementService.App.getInstance().startWorkflow(getAllUuids(), wf, nodeProperties,
                        dialog.getComments(), map, new BaseAsyncCallback() {
                            public void onApplicationFailure(Throwable caught) {
                                WorkInProgressActionItem.removeStatus(status);
                                Log.error("Cannot publish", caught);
                                com.google.gwt.user.client.Window.alert("Cannot publish " + caught.getMessage());
                            }
View Full Code Here

                    dialog.getContainer().closeEngine();
                    final String status = Messages.get("label.publication.unpublished.task", "Unpublishing content");
                    Info.display(status, status);
                    WorkInProgressActionItem.setStatus(status);
                    JahiaContentManagementService.App.getInstance().unpublish(getAllUuids(),
                            new BaseAsyncCallback() {
                                public void onApplicationFailure(Throwable caught) {
                                    WorkInProgressActionItem.removeStatus(status);
                                    Info.display("Cannot unpublish", "Cannot unpublish");
                                    com.google.gwt.user.client.Window.alert("Cannot unpublish " + caught.getMessage());
                                }
View Full Code Here

            if (PAGETREE_TYPE.equals(sourceType)) {
                status.setData(OPERATION_CALLED, "true");
                final GWTJahiaNode source = ((List<GWTJahiaNode>) sourceNodes).get(0);
                final GWTJahiaNode parent = status.getData(TARGET_PARENT);
                final int type = (Integer) status.getData(TYPE);
                callback = new BaseAsyncCallback() {
                    public void onSuccess(Object result) {
                        String selectedPath = editLinker.getSelectionContext().getMainNode().getPath();
                        String replacedPath;
                        if (type < 0) {
                            replacedPath = targetPath + "/" + source.getName();
View Full Code Here

        this.doSubNodes = doSubNodes;
    }

    public void onComponentSelection() {
        String selectedPaths = linker.getSelectionContext().getSingleSelection().getPath();
        JahiaContentManagementService.App.getInstance().clearAllLocks(selectedPaths, doSubNodes, new BaseAsyncCallback() {
            public void onApplicationFailure(Throwable throwable) {
                MessageBox.alert(Messages.get("label.error", "Error"), throwable.getLocalizedMessage(), null);
                linker.loaded();
                linker.refresh(Linker.REFRESH_MAIN);
            }
View Full Code Here

    private static void forceZip(final List<GWTJahiaNode> selectedItems, final String archName, final Linker linker) {
        List<String> selectedPaths = new ArrayList<String>(selectedItems.size());
        for (GWTJahiaNode node : selectedItems) {
            selectedPaths.add(node.getPath());
        }
        JahiaContentManagementService.App.getInstance().zip(selectedPaths, archName, new BaseAsyncCallback() {
            public void onApplicationFailure(Throwable throwable) {
                Window.alert(Messages.get("failure.zip.label") + "\n" + throwable.getLocalizedMessage());
                linker.loaded();
            }
View Full Code Here

TOP

Related Classes of org.jahia.ajax.gwt.client.core.BaseAsyncCallback

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.