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

Examples of org.jahia.ajax.gwt.client.data.node.GWTJahiaNodeVersion


        for (VersionInfo versionInfo : versionInfos) {
            if (!publishedOnly || versionInfo.getLabel().startsWith("live_")) {
                Version v = versionInfo.getVersion();
                GWTJahiaNode n = getGWTJahiaNode(node);
                final String workspace = StringUtils.substringBefore(versionInfo.getLabel(), "_");
                GWTJahiaNodeVersion jahiaNodeVersion =
                        new GWTJahiaNodeVersion(v.getIdentifier(), v.getName(), v.getCreated().getTime(), versionInfo.getLabel(),
                                workspace, n);
                String url = getNodeURL(null, node, versionInfo.getVersion().getCreated().getTime(), versionInfo.getLabel(),
                        workspace, node.getSession().getLocale());
                jahiaNodeVersion.setUrl(url);
                versions.add(jahiaNodeVersion);
            }
        }
        return versions;
    }
View Full Code Here


                    column.setHeader("Name");
                    column.setWidth(100);
                    column.setRenderer(new GridCellRenderer() {
                        public Object render(ModelData model, String property, ColumnData config, int rowIndex,
                                             int colIndex, ListStore listStore, Grid grid) {
                            GWTJahiaNodeVersion version = (GWTJahiaNodeVersion) model;
                            String value = Messages.get("label.version", "Version") + " ";
                            if (version.getLabel() != null && !"".equals(version.getLabel())) {
                                String[] strings = version.getLabel().split("_at_");
                                if (strings.length == 2) {
                                    String s1;
                                    if (strings[0].contains("published")) {
                                        s1 = Messages.get("label.version.published", "published at");
                                    } else if (strings[0].contains("uploaded")) {
                                        s1 = Messages.get("label.version.uploaded", "uploaded at");
                                    } else {
                                        s1 = Messages.get("label.version." + strings[0], strings[0]);
                                    }
                                    Date date = DateTimeFormat.getFormat("yyyy_MM_dd_HH_mm_ss").parse(
                                            strings[1]);
                                    value = value + s1 + " " + DateTimeFormat.getMediumDateTimeFormat()
                                            .format(date);
                                } else {
                                    value = version.getLabel();
                                }
                            }
                            return value;
                        }
                    });
                    configs.add(column);
                    if (PermissionsUtils.isPermitted("jcr:write", engine.getNode()) && !engine.getNode().isLocked()) {
                        column = new ColumnConfig();
                        column.setSortable(false);
                        column.setHeader("Action");
                        column.setWidth(200);
                        column.setRenderer(new GridCellRenderer() {
                            public Object render(ModelData model, String property, ColumnData config, int rowIndex,
                                                 int colIndex, ListStore listStore, Grid grid) {
                                ButtonBar buttonBar = new ButtonBar();
                                Button button = new Button(Messages.get("label.compare.with.staging.engine", "Compare With Staging"));
                                final GWTJahiaNodeVersion version = (GWTJahiaNodeVersion) model;
                                button.addSelectionListener(new SelectionListener<ButtonEvent>() {
                                    @Override
                                    public void componentSelected(ButtonEvent ce) {
                                        // add 30s to the date to be sure to display the right version
                                        new CompareEngine(version.getNode().getUUID(), VersioningTabItem.this.locale, false, version.getNode().getPath(), new Date(version.getDate().getTime() + (30l * 1000l)), engine, version.getWorkspace(), version.getLabel()).show();
                                    }
                                });
                                buttonBar.add(button);
                                return buttonBar;
                            }
View Full Code Here

TOP

Related Classes of org.jahia.ajax.gwt.client.data.node.GWTJahiaNodeVersion

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.