Package org.jahia.ajax.gwt.client.data.definition

Examples of org.jahia.ajax.gwt.client.data.definition.GWTJahiaNodePropertyValue


        }

        private void doSchedule(Date date, GWTJahiaNode gwtJahiaNode) {
            List<GWTJahiaNodeProperty> props = new ArrayList<GWTJahiaNodeProperty>();
            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) {
View Full Code Here


                            }

                            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 {
View Full Code Here

            }

            public void onSuccess(List<GWTJahiaNodeType> result) {
                GWTJahiaNode copiedNode = CopyPasteEngine.getInstance().getCopiedPaths().get(0);
                Map<String, GWTJahiaNodeProperty> props = new HashMap<String, GWTJahiaNodeProperty>(2);
                props.put("jcr:title", new GWTJahiaNodeProperty("jcr:title", new GWTJahiaNodePropertyValue(copiedNode.getDisplayName(), GWTJahiaNodePropertyType.STRING)));
                props.put("j:node", new GWTJahiaNodeProperty("j:node", new GWTJahiaNodePropertyValue(copiedNode, GWTJahiaNodePropertyType.WEAKREFERENCE)));
                if (result.size() == 1) {
                    EngineLoader.showCreateEngine(linker, linker.getSelectionContext().getSingleSelection(), result.get(0), props, copiedNode.getName(), false);
                } else {
                    Map<GWTJahiaNodeType, List<GWTJahiaNodeType>> m = new HashMap<GWTJahiaNodeType, List<GWTJahiaNodeType>>();
                    m.put(null, result);
View Full Code Here

                        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) {
                                if (tagStore.findModel(result) == null) {
                                    tagStore.add(result, false);
                                    GWTJahiaNodeProperty gwtJahiaNodeProperty = newValues.get(TagsTabItem.this.locale);
                                    if (gwtJahiaNodeProperty == null) {
                                        gwtJahiaNodeProperty = new GWTJahiaNodeProperty();
                                        gwtJahiaNodeProperty.setMultiple(true);
                                        gwtJahiaNodeProperty.setValues(new ArrayList<GWTJahiaNodePropertyValue>());
                                        gwtJahiaNodeProperty.setName("j:tags");
                                        newValues.put(TagsTabItem.this.locale, gwtJahiaNodeProperty);
                                    }
                                    gwtJahiaNodeProperty.getValues().add(new GWTJahiaNodePropertyValue(result,
                                            GWTJahiaNodePropertyType.WEAKREFERENCE));
                                }
                            }


View Full Code Here

TOP

Related Classes of org.jahia.ajax.gwt.client.data.definition.GWTJahiaNodePropertyValue

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.