Examples of JahiaContentManagementServiceAsync


Examples of org.jahia.ajax.gwt.client.service.content.JahiaContentManagementServiceAsync


    private void init() {
        setBorders(false);
        removeAll();
        final JahiaContentManagementServiceAsync service = JahiaContentManagementService.App.getInstance();

        // data proxy
        RpcProxy<List<GWTJahiaWorkflowHistoryItem>> proxy = new RpcProxy<List<GWTJahiaWorkflowHistoryItem>>() {
            @Override
            protected void load(Object loadConfig, AsyncCallback<List<GWTJahiaWorkflowHistoryItem>> callback) {
                if (loadConfig == null) {
                    if (dashboard) {
                        service.getWorkflowHistoryForUser(callback);
                    } else {
                        service.getWorkflowHistoryProcesses(nodeId, locale, callback);
                    }
                } else if (loadConfig instanceof GWTJahiaWorkflowHistoryProcess) {
                    final GWTJahiaWorkflowHistoryProcess process = (GWTJahiaWorkflowHistoryProcess) loadConfig;
                    service.getWorkflowHistoryTasks(process.getProvider(), process.getProcessId(), locale, callback);
                } else {
                    callback.onSuccess(new ArrayList<GWTJahiaWorkflowHistoryItem>());
                }
            }
        };
View Full Code Here

Examples of org.jahia.ajax.gwt.client.service.content.JahiaContentManagementServiceAsync

        super.onRender(parent, index);
    }

    private void init() {
        setBorders(false);
        final JahiaContentManagementServiceAsync service = JahiaContentManagementService.App.getInstance();

        // data proxy
        RpcProxy<PagingLoadResult<GWTJahiaContentHistoryEntry>> proxy = new RpcProxy<PagingLoadResult<GWTJahiaContentHistoryEntry>>() {
            @Override
            protected void load(Object loadConfig, AsyncCallback<PagingLoadResult<GWTJahiaContentHistoryEntry>> callback) {
                if (loadConfig == null) {
                    service.getContentHistory(node.getUUID(), 0, Integer.MAX_VALUE, callback);
                } else if (loadConfig instanceof BasePagingLoadConfig) {
                    BasePagingLoadConfig pagingLoadConfig = (BasePagingLoadConfig) loadConfig;
                    int limit = pagingLoadConfig.getLimit();
                    int offset = pagingLoadConfig.getOffset();
                    Style.SortDir sortDir = pagingLoadConfig.getSortDir();
                    String sortField = pagingLoadConfig.getSortField();
                    service.getContentHistory(node.getUUID(), offset, limit, callback);
                } else {
                    callback.onSuccess(new BasePagingLoadResult<GWTJahiaContentHistoryEntry>(new ArrayList<GWTJahiaContentHistoryEntry>()));
                }
            }
        };
View Full Code Here

Examples of org.jahia.ajax.gwt.client.service.content.JahiaContentManagementServiceAsync

    }

    @Override
    public void setNode(final GWTJahiaNode node) {
        super.setNode(node);
        final JahiaContentManagementServiceAsync async = JahiaContentManagementService.App.getInstance();
        async.getProperties(node.getPath(), null, new BaseAsyncCallback<GWTJahiaGetPropertiesResult>() {
            public void onSuccess(GWTJahiaGetPropertiesResult gwtJahiaGetPropertiesResult) {
                if (gwtJahiaGetPropertiesResult.getProperties().containsKey(property)) {
                    final GWTJahiaNodeProperty o = gwtJahiaGetPropertiesResult.getProperties().get(property);
                    if (o.getValues().get(0).getNode().getPath().equals(mainModule.getPath())) {
                        setHeaderText(headerText + " - Linked to: main resource");
View Full Code Here

Examples of org.jahia.ajax.gwt.client.service.content.JahiaContentManagementServiceAsync

//    }

    private void fillStore() {
        contentContainer.mask(Messages.get("label.loading","Loading..."), "x-mask-loading");
        contentStore.removeAll();
        JahiaContentManagementServiceAsync async = JahiaContentManagementService.App.getInstance();
        async.searchSQL(search, limit,
                        JCRClientUtils.CONTENT_NODETYPES, null, null, Arrays.asList(GWTJahiaNode.ICON,"jcr:lastModified"),false, new BaseAsyncCallback<List<GWTJahiaNode>>() {
                    public void onSuccess(List<GWTJahiaNode> gwtJahiaNodes) {
                        contentStore.add(gwtJahiaNodes);
                        contentContainer.layout(true);
                        contentContainer.unmask();
View Full Code Here

Examples of org.jahia.ajax.gwt.client.service.content.JahiaContentManagementServiceAsync

        if (engine.getNode() != null) {
            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

Examples of org.jahia.ajax.gwt.client.service.content.JahiaContentManagementServiceAsync

        final List<String> referenceType = status.getData(TARGET_REFERENCE_TYPE);
        final List<GWTJahiaNode> sourceNodes = status.getData(SOURCE_NODES);
        final GWTJahiaSearchQuery searchQuery = status.getData(SOURCE_QUERY);

        AsyncCallback callback = new DropAsyncCallback();
        final JahiaContentManagementServiceAsync service = JahiaContentManagementService.App.getInstance();
        if (EMPTYAREA_TYPE.equals(targetType)) {
            status.setData(OPERATION_CALLED, "true");
            GWTJahiaNode parent = (GWTJahiaNode) targetNode;
            ((AreaModule) ((ModuleDropTarget)e.getDropTarget()).getModule()).createNode(new BaseAsyncCallback<GWTJahiaNode>() {
                public void onSuccess(GWTJahiaNode result) {
                    e.getStatus().setData(SOURCE_TYPE, sourceType);
                    e.getStatus().setData(TARGET_TYPE, PLACEHOLDER_TYPE);
                    e.getStatus().setData(TARGET_PATH, "*");
                    e.getStatus().setData(SOURCE_NODETYPE, sourceNodeType);
                    e.getStatus().setData(TARGET_NODE, result);
                    e.getStatus().setData(TARGET_REFERENCE_TYPE, referenceType);
                    e.getStatus().setData(SOURCE_NODES, sourceNodes);
                    e.getStatus().setData(SOURCE_QUERY, searchQuery);
                    e.getStatus().setData(OPERATION_CALLED, "false");
                    dragDrop(e);
                }
            });
        } else if (PLACEHOLDER_TYPE.equals(targetType)) {
            int i = targetPath.lastIndexOf('/');
            String name = targetPath.substring(i + 1);
            String parentPath = targetNode.getPath();

            if (referenceType != null) {
                status.setData(OPERATION_CALLED, "true");
                final GWTJahiaNode selectedNode = sourceNodes.get(0);
                JahiaContentManagementService.App.getInstance()
                        .getNodeTypes(referenceType, new BaseAsyncCallback<List<GWTJahiaNodeType>>() {
                            public void onApplicationFailure(Throwable caught) {
                                Window.alert("Cannot retrieve node type. Cause: " + caught.getLocalizedMessage());
                                Log.error("Cannot retrieve node type. Cause: " + caught.getLocalizedMessage(), caught);
                            }

                            public void onSuccess(List<GWTJahiaNodeType> result) {
                                Map<String, GWTJahiaNodeProperty> props = new HashMap<String, GWTJahiaNodeProperty>(2);
                                props.put("jcr:title", new GWTJahiaNodeProperty("jcr:title",
                                        new GWTJahiaNodePropertyValue(selectedNode.getDisplayName(),
                                                GWTJahiaNodePropertyType.STRING)));
                                props.put("j:node", new GWTJahiaNodeProperty("j:node",
                                        new GWTJahiaNodePropertyValue(selectedNode,
                                                GWTJahiaNodePropertyType.WEAKREFERENCE)));
                                if (result.size() == 1) {
                                    EngineLoader.showCreateEngine(editLinker, targetNode, result.get(0), props,
                                            selectedNode.getName(), false);
                                } else {
                                    Map<GWTJahiaNodeType, List<GWTJahiaNodeType>> m =
                                            new HashMap<GWTJahiaNodeType, List<GWTJahiaNodeType>>();
                                    m.put(null, result);
                                    new ContentTypeWindow(editLinker, targetNode, m, props, selectedNode.getName(), false)
                                            .show();
                                }
                            }
                        });
            } else if (SIMPLEMODULE_TYPE.equals(sourceType)) {
                // Item move
                GWTJahiaNode selectedNode = sourceNodes.get(0);

                status.setData(OPERATION_CALLED, "true");
                if ("*".equals(name)) {
                    service.moveAtEnd(selectedNode.getPath(), parentPath, callback);
                } else {
                    service.move(selectedNode.getPath(), targetPath, callback);
                }
            } else if (CREATE_CONTENT_SOURCE_TYPE.equals(sourceType)) {
                // Item creation
                status.setData(OPERATION_CALLED, "true");
                if ((sourceNodeType.getItems() == null || sourceNodeType.getItems().size() == 0) &&
                        (sourceNodeType.getInheritedItems() == null ||
                                sourceNodeType.getInheritedItems().size() == 0)) {
                    service.createNode(parentPath, null, sourceNodeType.getName(), null, null,
                            new ArrayList<GWTJahiaNodeProperty>(), null, new BaseAsyncCallback<GWTJahiaNode>() {
                                public void onApplicationFailure(Throwable throwable) {
                                    Window.alert("Properties save failed\n\n" + throwable.getLocalizedMessage());
                                    Log.error("failed", throwable);
                                }

                                public void onSuccess(GWTJahiaNode o) {
                                    Info.display(Messages.get("label.information", "Information"), Messages.get("message.success", "Node created"));
                                    editLinker.refresh(Linker.REFRESH_MAIN);
                                }
                            });
                } else {
                    EngineLoader.showCreateEngine(editLinker, targetNode, sourceNodeType,
                            new HashMap<String, GWTJahiaNodeProperty>(),
                            targetPath.substring(targetPath.lastIndexOf("/") + 1), false);
                }
            } else if (QUERY_SOURCE_TYPE.equals(sourceType)) {
                // Item creation
                status.setData(OPERATION_CALLED, "true");
                if ("*".equals(name)) {
                    service.saveSearch(searchQuery, parentPath, "jnt_query", false, callback);
                } else {
                    service.saveSearch(searchQuery, parentPath, name, false, callback);
                }
            }
        } else if (SIMPLEMODULE_TYPE.equals(targetType)) {
            if (referenceType != null) {
                status.setData(OPERATION_CALLED, "true");
                final GWTJahiaNode selectedNode = sourceNodes.get(0);
                JahiaContentManagementService.App.getInstance()
                        .getNodeTypes(referenceType, new BaseAsyncCallback<List<GWTJahiaNodeType>>() {
                            public void onApplicationFailure(Throwable caught) {
                                Window.alert("Cannot retrieve node type. Cause: " + caught.getLocalizedMessage());
                                Log.error("Cannot retrieve node type. Cause: " + caught.getLocalizedMessage(), caught);
                            }

                            public void onSuccess(List<GWTJahiaNodeType> result) {
                                Map<String, GWTJahiaNodeProperty> props = new HashMap<String, GWTJahiaNodeProperty>(2);
                                props.put("jcr:title", new GWTJahiaNodeProperty("jcr:title",
                                        new GWTJahiaNodePropertyValue(selectedNode.getDisplayName(),
                                                GWTJahiaNodePropertyType.STRING)));
                                props.put("j:node", new GWTJahiaNodeProperty("j:node",
                                        new GWTJahiaNodePropertyValue(selectedNode,
                                                GWTJahiaNodePropertyType.WEAKREFERENCE)));
                                if (result.size() == 1) {
                                    EngineLoader.showCreateEngine(editLinker, targetNode, result.get(0), props,
                                            selectedNode.getName(), true);
                                } else {
                                    Map<GWTJahiaNodeType, List<GWTJahiaNodeType>> m =
                                            new HashMap<GWTJahiaNodeType, List<GWTJahiaNodeType>>();
                                    m.put(null, result);
                                    new ContentTypeWindow(editLinker, targetNode, m, props, selectedNode.getName(), true)
                                            .show();
                                }
                            }
                        });
                //            } else if (CONTENT_SOURCE_TYPE.equals(sourceType)) {
                //                // Drop into an existing module
                //                List<GWTJahiaNode> nodes = e.getStatus().getData(SOURCE_NODES);
                //
                //                e.getStatus().setData(OPERATION_CALLED, "true");
                //                async.pasteReferencesOnTopOf(JCRClientUtils.getPathesList(nodes), targetPath, null, callback);
            } else if (SIMPLEMODULE_TYPE.equals(sourceType)) {
                // Item move

                status.setData(OPERATION_CALLED, "true");
                service.moveOnTopOf(sourceNodes.get(0).getPath(), targetPath, callback);
            } else if (CREATE_CONTENT_SOURCE_TYPE.equals(sourceType)) {
                // Item creation
                status.setData(OPERATION_CALLED, "true");
                if ((sourceNodeType.getItems() == null || sourceNodeType.getItems().size() == 0) &&
                        (sourceNodeType.getInheritedItems() == null ||
                                sourceNodeType.getInheritedItems().size() == 0)) {
                    service.createNodeAndMoveBefore(targetNode.getPath(), null, sourceNodeType.getName(), null, null,
                            new ArrayList<GWTJahiaNodeProperty>(), new HashMap<String, List<GWTJahiaNodeProperty>>(),
                            new BaseAsyncCallback<GWTJahiaNode>() {
                                public void onApplicationFailure(Throwable throwable) {
                                    Window.alert("Properties save failed\n\n" + throwable.getLocalizedMessage());
                                    Log.error("failed", throwable);
                                }

                                public void onSuccess(GWTJahiaNode o) {
                                    Info.display("", "Node created");
                                    editLinker.refresh(Linker.REFRESH_MAIN);
                                }
                            });
                } else {
                    EngineLoader.showCreateEngine(editLinker, targetNode, sourceNodeType,
                            new HashMap<String, GWTJahiaNodeProperty>(), "*", true);
                }
            } else if (QUERY_SOURCE_TYPE.equals(sourceType)) {
                // Item creation
                status.setData(OPERATION_CALLED, "true");

                service.saveSearch(searchQuery, targetPath, "jnt_query", true, callback);
            }
        } else if (PAGETREE_TYPE.equals(targetType)) {
            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();
                        } else {
                            replacedPath = selectedPath.replace(source.getPath(), parent.getPath() + "/" + source.getName());
                        }
                        if (!replacedPath.equals(selectedPath)) {
                            editLinker.onMainSelection(replacedPath, null, null);
                            editLinker.refresh(Linker.REFRESH_PAGES);
                        } else if (e.getDropTarget() instanceof PagesTabItem.PageTreeGridDropTarget) {
                            ((PagesTabItem.PageTreeGridDropTarget) e.getDropTarget()).getCallback().onSuccess(result);
                        }
                    }
                };

                if (status.<Object>getData("type").equals(-1)) {
                    service.moveAtEnd(source.getPath(), targetPath, callback);
                } else if (status.<Object>getData("type").equals(0)) {
                    service.moveOnTopOf(source.getPath(), targetPath, callback);
                } else if (status.<Object>getData("type").equals(1)) {
                    GWTJahiaNode node = status.getData(TARGET_NEXT_NODE);
                    if (node == null) {
                        service.moveAtEnd(source.getPath(), parent.getPath(), callback);
                    } else {
                        service.moveOnTopOf(source.getPath(), node.getPath(), callback);
                    }
                }
            }
        } else if (BROWSETREE_TYPE.equals(targetType)) {
            if (SIMPLEMODULE_TYPE.equals(sourceType)) {
                // Item move

                status.setData(OPERATION_CALLED, "true");
                service.pasteReferences(JCRClientUtils.getPathesList(sourceNodes), targetPath, null, callback);
            }
        }
        super.dragDrop(e);
    }
View Full Code Here

Examples of org.jahia.ajax.gwt.client.service.content.JahiaContentManagementServiceAsync

                    final List<String> l = new ArrayList<String>();
                    for (GWTJahiaNode node : lh.getMultipleSelection()) {
                        l.add(node.getPath());
                    }

                    final JahiaContentManagementServiceAsync async = JahiaContentManagementService.App.getInstance();

                    if (lh.getSingleSelection() != null && lh.getSingleSelection().isReference()) {
                        async.deletePaths(l, new BaseAsyncCallback<Object>() {
                            public void onApplicationFailure(Throwable throwable) {
                                Log.error(throwable.getMessage(), throwable);
                                MessageBox.alert(Messages.get("label.error", "Error"), throwable.getMessage(), null);
                            }

                            public void onSuccess(Object o) {
                                linker.refresh(EditLinker.REFRESH_ALL);
                                linker.select(null);
                            }
                        });
                    } else {
                        async.getUsages(l, new BaseAsyncCallback<List<GWTJahiaNodeUsage>>() {
                            public void onSuccess(List<GWTJahiaNodeUsage> result) {
                                String icon = MessageBox.WARNING;
                                String message;
                                if (l.size() > 1) {
                                    message = Messages.getWithArgs("message.remove.multiple.confirm",
                                            "Do you really want to remove the {0} selected resources?",
                                            new String[]{String.valueOf(
                                                    l.size())});
                                } else {
                                    if (lh.getMultipleSelection().get(0).getNodeTypes().contains("jnt:page")) {
                                        message = Messages.getWithArgs(
                                                "message.remove.single.page.confirm",
                                                "Do you really want to remove the selected PAGE {0}?",
                                                new String[]{lh.getSingleSelection().getName()});
                                        icon = "ext-mb-delete-page";
                                    } else {
                                        message = Messages.getWithArgs(
                                                "message.remove.single.confirm",
                                                "Do you really want to remove the selected resource {0}?",
                                                new String[]{lh.getSingleSelection().getName()});
                                    }
                                }
                                if (l.size() > 1) {
                                    message += "<br/><br/>";
                                    int i = 0;
                                    for (GWTJahiaNode node : lh.getMultipleSelection()) {
                                        if (i > 4) {
                                            message += "<br/>...";
                                            break;
                                        }
                                        message += "<br/>" + node.getName();
                                        i++;
                                    }
                                }
                                message+="<br/><br/>";
                                String n = "";
                                int size = result.size();
                                if(size>0) {
                                    message +=l.size() > 1 ? Messages.get("message.remove.multiple.usage",
                                            "Those nodes are still used in:") : Messages.get(
                                            "message.remove.single.usage",
                                            "This node is still used by:");
                                }
                                int i = 0;
                                for (int j = 0; j < (size>4?4:size); j++) {
                                    GWTJahiaNodeUsage nodeUsage = result.get(j);
                                    if (!nodeUsage.getNodeName().equals(n)) {
                                        message += "<br/><span style=\"font-style:italic;\">" + nodeUsage.getNodeTitle() + " " + Messages.get(
                                                "label.remove.used", "is using this node in page(s)") + "<br/>" +nodeUsage.getPageTitle()+"</span>";
                                        i++;
                                    } else {
                                        message += "<br/><span style=\"font-style:italic;\">" + nodeUsage.getPageTitle()+"</span>";
                                    }
                                    n = nodeUsage.getNodeName();
                                }
                                if(i>4) {
                                    message+="<br/>.<br/>.<br/>.";
                                }
                                message+=Messages.get("message.remove.warning","<br/><span style=\"font-style:bold;color:red;\">Warning: this will erase the content definitively from the repository<br/>So it will not be displayed anymore anywere</span>");

                                MessageBox box = new MessageBox();
                                box.setTitle(Messages.get("label.information", "Information"));
                                box.setMessage(message);
                                box.setButtons(MessageBox.YESNO);
                                box.setIcon(icon);
                                box.addCallback(new Listener<MessageBoxEvent>() {
                                    public void handleEvent(MessageBoxEvent be) {
                                        if (be.getButtonClicked().getText().equalsIgnoreCase(Dialog.YES)) {
                                            async.deletePaths(l, new BaseAsyncCallback<Object>() {
                                                public void onApplicationFailure(Throwable throwable) {
                                                    Log.error(throwable.getMessage(), throwable);
                                                    MessageBox.alert(Messages.get("label.error", "Error"), throwable.getMessage(), null);
                                                }
View Full Code Here

Examples of org.jahia.ajax.gwt.client.service.content.JahiaContentManagementServiceAsync

                final GWTJahiaNode node = engine.getNode();
                tagLoader = new BaseTreeLoader<GWTJahiaNode>(new RpcProxy<List<GWTJahiaNode>>() {
                    @Override
                    protected void load(Object o, final AsyncCallback<List<GWTJahiaNode>> listAsyncCallback) {
                        if (node != null) {
                            final JahiaContentManagementServiceAsync async = JahiaContentManagementService.App.getInstance();
                            if (newValues.containsKey(TagsTabItem.this.locale)) {
                                final GWTJahiaNodeProperty gwtJahiaNodeProperty = newValues.get(TagsTabItem.this.locale);
                                final List<GWTJahiaNodePropertyValue> propertyValues = gwtJahiaNodeProperty.getValues();
                                List<GWTJahiaNode> nodes = new ArrayList<GWTJahiaNode>(propertyValues.size());
                                for (GWTJahiaNodePropertyValue propertyValue : propertyValues) {
                                    nodes.add(propertyValue.getNode());
                                }
                                listAsyncCallback.onSuccess(nodes);
                            } else {
                                GWTJahiaNodeProperty oldProperty = engine.getProperties().get("j:tags");

                                GWTJahiaNodeProperty newProperty = new GWTJahiaNodeProperty();
                                newProperty.setMultiple(true);
                                newProperty.setValues(new ArrayList<GWTJahiaNodePropertyValue>());
                                newProperty.setName("j:tags");

                                if (oldProperty != null) {
                                    final List<GWTJahiaNodePropertyValue> propertyValues = oldProperty.getValues();
                                    List<GWTJahiaNode> nodes = new ArrayList<GWTJahiaNode>(propertyValues.size());
                                    for (GWTJahiaNodePropertyValue propertyValue : propertyValues) {
                                        nodes.add(propertyValue.getNode());
                                    }
                                    newProperty.getValues().addAll(oldProperty.getValues());
                                    listAsyncCallback.onSuccess(nodes);
                                } else {
                                    listAsyncCallback.onSuccess(new ArrayList<GWTJahiaNode>());
                                }
                                oldValues.put(TagsTabItem.this.locale, oldProperty);
                                newValues.put(TagsTabItem.this.locale, newProperty);
                            }
                        }
                    }
                });

                tagStore = new TreeStore<GWTJahiaNode>(tagLoader);
                tagStore.setStoreSorter(new StoreSorter<GWTJahiaNode>(new Comparator<Object>() {
                    public int compare(Object o1, Object o2) {
                        if (o1 instanceof String && o2 instanceof String) {
                            String s1 = (String) o1;
                            String s2 = (String) o2;
                            return Collator.getInstance().localeCompare(s1, s2);
                        } else if (o1 instanceof Comparable && o2 instanceof Comparable) {
                            return ((Comparable) o1).compareTo(o2);
                        }
                        return 0;
                    }
                }));
                ColumnConfig columnConfig;
                columnConfig = new ColumnConfig("name", Messages.get("label.name"), 500);
                columnConfig.setFixed(true);
                columnConfig.setRenderer(new TreeGridCellRenderer<GWTJahiaNode>());

                ColumnConfig action = new ColumnConfig("action", Messages.get("label.action"), 100);
                action.setAlignment(Style.HorizontalAlignment.RIGHT);
                action.setRenderer(new GridCellRenderer() {
                    public Object render(ModelData modelData, String s, ColumnData columnData, int i, int i1,
                                         ListStore listStore, Grid grid) {
                        Button button = new Button(Messages.get("label.remove"), new SelectionListener<ButtonEvent>() {
                            @Override
                            public void componentSelected(ButtonEvent buttonEvent) {
                                final GWTJahiaNode node1 = (GWTJahiaNode) buttonEvent.getButton().getData("associatedNode");
                                tagStore.remove(node1);
                                newValues.get(TagsTabItem.this.locale).getValues().remove(new GWTJahiaNodePropertyValue(node1,
                                            GWTJahiaNodePropertyType.WEAKREFERENCE));
                            }
                        });
                        button.setData("associatedNode", modelData);
                        button.setIcon(StandardIconsProvider.STANDARD_ICONS.minusRound());
                        return button;
                    }
                });

                // Add a new tag
                final AutoCompleteComboBox autoCompleteComboBox = new AutoCompleteComboBox(JCRClientUtils.TAG_NODETYPES, 15);
                autoCompleteComboBox.setMaxLength(120);
                autoCompleteComboBox.setWidth(200);
                autoCompleteComboBox.setName("tagName");

                //panel.add(name, data);
                Button addTag = new Button(Messages.get("label.add", "Add"), new SelectionListener<ButtonEvent>() {
                    @Override
                    public void componentSelected(ButtonEvent buttonEvent) {
                        final JahiaContentManagementServiceAsync async = JahiaContentManagementService.App.getInstance();
                        async.getTagNode(autoCompleteComboBox.getRawValue(), true, new BaseAsyncCallback<GWTJahiaNode>() {
                            /**
                             * On success
                             * @param result
                             */
                            public void onSuccess(GWTJahiaNode result) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.