Package org.brixcms.plugin.site

Examples of org.brixcms.plugin.site.SiteNodePlugin


      IRequestHandler handler = null;
      try {
        while (handler == null) {
          final BrixNode node = getNodeForUriPath(path);
          if (node != null) {
            SiteNodePlugin plugin = SitePlugin.get().getNodePluginForNode(node);
            if (plugin instanceof AbstractSitePagePlugin) {
              handler = SitePlugin.get().getNodePluginForNode(node)
                  .respond(new BrixNodeModel(node), createBrixPageParams(request.getUrl(), path));
            } else {
              handler = SitePlugin.get().getNodePluginForNode(node)
View Full Code Here


            protected void populateItem(final ListItem<SiteNodePluginEntry> item) {
                Link<Void> link;
                item.add(link = new Link<Void>("link") {
                    @Override
                    public void onClick() {
                        SiteNodePlugin plugin = item.getModelObject().getPlugin();
                        final Component currentEditor = getEditor();

                        // remember the last editor that is not a create node
                        // panel
                        if (lastEditor == null ||
                                currentEditor.getMetaData(EDITOR_NODE_TYPE) == null) {
                            lastEditor = currentEditor;
                        }
                        SimpleCallback goBack = new SimpleCallback() {
                            public void execute() {
                                setupEditor(lastEditor);
                            }
                        };
                        Panel panel = plugin.newCreateNodePanel(EDITOR_ID, getNewNodeParent(),
                                goBack);
                        panel.setMetaData(EDITOR_NODE_TYPE, plugin.getNodeType());
                        setupEditor(panel);
                    }

                    @Override
                    protected void onComponentTag(ComponentTag tag) {
                        super.onComponentTag(tag);
                        SiteNodePlugin plugin = item.getModelObject().getPlugin();
                        String editorNodeType = getEditor().getMetaData(EDITOR_NODE_TYPE);
                        if (plugin.getNodeType().equals(editorNodeType)) {
                            CharSequence klass = tag.getString("class");
                            if (klass == null) {
                                klass = "selected";
                            } else {
                                klass = klass + " selected";
                            }
                            tag.put("class", klass);
                        }
                    }
                });
                item.add(new WebMarkupContainer("separator") {
                    @Override
                    public boolean isVisible() {
                        return item.getIndex() != createNodesModel.getObject().size() - 1;
                    }
                });
                IModel<BrixNode> parent = getNewNodeParent();
                SiteNodePlugin plugin = item.getModelObject().getPlugin();
                link.add(new Label("label", plugin.newCreateNodeCaptionModel(parent)));
            }

        }.setReuseItems(false));
    }
View Full Code Here

TOP

Related Classes of org.brixcms.plugin.site.SiteNodePlugin

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.