Examples of Brix


Examples of org.brixcms.Brix

                    public void respond(IRequestCycle requestCycle) {
                        WebResponse resp = (WebResponse) requestCycle.getResponse();
                        resp.setAttachmentHeader("workspace.xml");
                        String id = ManageSnapshotsPanel.this.getModelObject().getId();
                        Brix brix = getBrix();
                        JcrSession session = brix.getCurrentSession(id);
                        HttpServletResponse containerResponse = (HttpServletResponse) resp.getContainerResponse();
                        ServletOutputStream containerResponseOutputStream = null;
                        try {
                            containerResponseOutputStream = containerResponse.getOutputStream();
                        }
                        catch (IOException e) {
                            throw new RuntimeException(e);
                        }
                        session.exportSystemView(brix.getRootPath(), containerResponseOutputStream, false, false);
                    }
                });
            }
        });

        /**
         * Form to create a new Snapshot and put any comment to it
         */
        Form<Object> commentForm = new Form<Object>("commentForm") {
            @Override
            public boolean isVisible() {
                Workspace target = ManageSnapshotsPanel.this.getModelObject();
                Action action = new CreateSnapshotAction(Context.ADMINISTRATION, target);
                return getBrix().getAuthorizationStrategy().isActionAuthorized(action);
            }
        };

        final TextArea<String> area = new TextArea<String>("area", new Model<String>());
        commentForm.add(area);

        commentForm.add(new SubmitLink("createSnapshot") {
            /**
             * @see org.apache.wicket.markup.html.form.IFormSubmittingComponent#onSubmit()
             */
            @Override
            public void onSubmit() {
                String comment = area.getModelObject();
                SnapshotPlugin.get().createSnapshot(ManageSnapshotsPanel.this.getModelObject(), comment);
                area.setModelObject("");
            }
        });
        add(commentForm);


        Form<Object> uploadForm = new Form<Object>("uploadForm") {
            @Override
            public boolean isVisible() {
                Workspace target = ManageSnapshotsPanel.this.getModelObject();
                Action action = new RestoreSnapshotAction(Context.ADMINISTRATION, target);
                return getBrix().getAuthorizationStrategy().isActionAuthorized(action);
            }
        };

        final FileUploadField upload = new FileUploadField("upload", new Model());
        uploadForm.add(upload);

        uploadForm.add(new SubmitLink("submit") {
            @Override
            public void onSubmit() {
                List<FileUpload> uploadList = upload.getModelObject();
                if (uploadList != null) {
                    for (FileUpload u : uploadList) {
                        try {
                            InputStream s = u.getInputStream();
                            String id = ManageSnapshotsPanel.this.getModelObject().getId();
                            Brix brix = getBrix();
                            JcrSession session = brix.getCurrentSession(id);

                            if (session.itemExists(brix.getRootPath())) {
                                session.getItem(brix.getRootPath()).remove();
                            }
                            session.importXML("/", s,
                                    ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);
                            session.save();

                            brix.initWorkspace(ManageSnapshotsPanel.this.getModelObject(), session);

                            getSession().info(ManageSnapshotsPanel.this.getString("restoreSuccessful"));
                        } catch (IOException e) {
                            throw new BrixException(e);
                        }
View Full Code Here

Examples of org.brixcms.Brix

        }
        return workspaces;
    }

    private List<WorkspaceEntry> loadWorkspaces() {
        Brix brix = Brix.get();
        List<WorkspaceEntry> workspaces = new ArrayList<WorkspaceEntry>();
        Workspace currentWorkspace = getCurrentWorkspaceId() != null ? brix.getWorkspaceManager()
                .getWorkspace(getCurrentWorkspaceId()) : null;

        for (Plugin p : brix.getPlugins()) {
            List<Workspace> filtered = brix.filterVisibleWorkspaces(p.getWorkspaces(
                    currentWorkspace, true), Context.PRESENTATION);
            for (Workspace w : filtered) {
                WorkspaceEntry we = new WorkspaceEntry();
                we.id = w.getId();
                we.visibleName = p.getUserVisibleName(w, true);
View Full Code Here

Examples of org.brixcms.Brix

        final Form<Void> form = new Form<Void>("form");
        add(form);

        form.add(new FeedbackPanel("feedback", filterFeedback ? new ContainerFeedbackMessageFilter(form) : null));

        Brix brix = nodeModel.getObject().getBrix();
        final String tileClassName = getTileContainerNode().tiles().getTileClassName(tileId);
        final Tile tile = Tile.Helper.getTileOfType(tileClassName, brix);

        final TileEditorPanel editor;
View Full Code Here

Examples of org.brixcms.Brix

            }
        });
    }

    private List<Workspace> getWorkspaces() {
        Brix brix = getBrix();
        List<Workspace> workspaces = new ArrayList<Workspace>();

        Workspace current = getModelObject();

        for (Plugin p : brix.getPlugins()) {
            List<Workspace> filtered = brix.filterVisibleWorkspaces(
                    p.getWorkspaces(current, false), Context.ADMINISTRATION);
            for (Workspace w : filtered) {
                workspaces.add(w);
            }
        }
View Full Code Here

Examples of org.brixcms.Brix

    public void renderHead(IHeaderResponse response) {
        response.renderCSSReference(CSS);
    }

    private List<Workspace> getAvailableWorkspaces() {
        Brix brix = Brix.get();
        List<Workspace> workspaces = new ArrayList<Workspace>();

        Workspace current = getModelObject();

        for (Plugin p : brix.getPlugins()) {
            List<Workspace> filtered = brix.filterVisibleWorkspaces(
                    p.getWorkspaces(current, false), Context.ADMINISTRATION);
            for (Workspace w : filtered) {
                workspaces.add(w);
            }
        }
View Full Code Here

Examples of org.brixcms.Brix

            tabbedPanel.remove();
        }

        List<IBrixTab> tabs = new ArrayList<IBrixTab>();

        Brix brix = Brix.get();
        for (Plugin p : brix.getPlugins()) {
            List<IBrixTab> pluginTabs = p.newTabs(getModel());
            if (pluginTabs != null) {
                tabs.addAll(pluginTabs);
            }
        }
View Full Code Here

Examples of org.brixcms.Brix

                if (tileTypeName == null) {
                    EmptyPanel ep = new EmptyPanel(newTileEditor.getId());
                    newTileEditor.replaceWith(ep);
                    newTileEditor = ep;
                } else {
                    final Brix brix = NewTileFragment.this.getModelObject().getBrix();
                    final Tile tile = Tile.Helper.getTileOfType(tileTypeName, brix);
                    TileEditorPanel ed = tile.newEditor(newTileEditor.getId(), nodeModel);
                    newTileEditor.replaceWith(ed);
                    newTileEditor = ed;
                }
View Full Code Here

Examples of org.brixcms.Brix

        add(new AjaxLink<Void>("restore") {
            @Override
            public void onClick(AjaxRequestTarget target) {
                List<JcrNode> nodes = getSelectedNodes();
                if (!nodes.isEmpty()) {
                    Brix brix = ((BrixNode) nodes.iterator().next()).getBrix();
                    JcrWorkspace targetWorkspace = brix.getCurrentSession(targetWorkspaceId).getWorkspace();
                    Map<JcrNode, List<JcrNode>> dependencies = JcrUtil.getUnsatisfiedDependencies(
                            nodes, targetWorkspace);
                    ;
                    if (!dependencies.isEmpty()) {
                        message.setDefaultModelObject(getDependenciesMessage(dependencies));
View Full Code Here

Examples of org.brixcms.Brix

            });
        }

        @Override
        public boolean isVisible() {
            final Brix brix = Brix.get();
            final Workspace workspace = getWorkspaceModel().getObject();
            final Action action = new AccessWebDavUrlPluginAction(workspace);
            final boolean granted = brix.getAuthorizationStrategy().isActionAuthorized(action);
            return granted;
        }
View Full Code Here

Examples of org.brixcms.Brix

        choice.setNullValid(false);
        add(choice);
    }

    private List<Workspace> getWorkspaces() {
        Brix brix = getBrix();
        List<Workspace> workspaces = new ArrayList<Workspace>();

        Workspace current = getModelObject();

        for (Plugin p : brix.getPlugins()) {
            List<Workspace> filtered = brix.filterVisibleWorkspaces(p.getWorkspaces(current, false),
                    Context.ADMINISTRATION);
            for (Workspace w : filtered) {
                if (workspaceNameCache == null) {
                    workspaceNameCache = new HashMap<String, String>();
                }
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.