Package org.jayasoft.woj.common.model.content

Examples of org.jayasoft.woj.common.model.content.Visibility


                        if(u.getGroup() != null) {
                            groups = Collections.singletonList(new Long(u.getGroup().getId()));
                        }

                        PrincipalRight pr = WOJServer.getInstance().getDataService().getRightsDao().getConsolidatedPrincipalRight(new Long(u.getId()), groups);
                        Visibility publishVisibility = pr == null ? Visibility.DEFAULT_VISIBILITY : pr.getPublishVisibility();
                       
                        UAK uak = new UAK(userName, userPassword, computerIdent, new Long(u.getId()), groups, publishVisibility, pluginId);
                        if (!uak.isAdmin() && !uak.isServer()) {
                            if (!WOJServer.getInstance().getDataService().getLoginTraceDao().login(u, computerIdent)) {
                                LOGGER.info("User : " + u.getLogin() + " has already used a trial on a different computer, login refused");
View Full Code Here


        String pluginVersion = StringCodec.INSTANCE.decodeString(p.get(Parameters.SECURITY.PLUGIN_VERSION));
        String userKey = StringCodec.INSTANCE.decodeString(p.get(Parameters.SECURITY.USER_KEY));
        Long userId = StringCodec.INSTANCE.decodeLong(p.get(Parameters.SECURITY.USER_IDENT));
        List groups = StringCodec.INSTANCE.decodeLongList(p.get(Parameters.SECURITY.ALL_GROUPS_IDENT));
        Integer visibilityId = StringCodec.INSTANCE.decodeInteger(p.get(Parameters.SECURITY.PUBLISH_VISIBILITY_RIGHT));
        Visibility v = null;
        if (visibilityId != null) {
            v = Visibility.fromInt(visibilityId.intValue());
        }
   
        if (userName!=null && userPass!=null && machineIdent!=null && userKey != null && userId != null && groups != null && v != null && pluginVersion != null) {
View Full Code Here

        String machineIdent = null;
        String userKey = null;
        String pluginVersion = null;
        Long userId = null;
        List groups = null;
        Visibility v = null;

        LOGGER.debug("looking for UAK in request");
        UAK uak = null;
        try {
          if ((uak = (UAK) request.getAttribute(UAK_KEY)) != null) {
View Full Code Here

        if (SecurityHelper.isAlreadyLogged(uak)) {
            LOGGER.info("user " + uak.getUserId() + " is already logged, unauthorized access");
            throw new DuplicateLoginException(uak);
        }
        ModuleDescriptor md = null;
        Visibility v = null;
        if (Parameters.SERVLET_NAME.DISPATCH.equals(visibility)) {
            LOGGER.info("no visibility found in url");
            ModuleDescriptorDao dao = WOJServer.getInstance().getDataService().getModuleDescriptorDao();
            md = dao.getModuleDescriptor(org, mod, rev, uak.getUserId(), uak.getGroups());
            if (md == null) {
View Full Code Here

                    r.moveUp();
                }
            }
       
            public void marshal(Object o, HierarchicalStreamWriter w, MarshallingContext ctx) {
                Visibility v = (Visibility)o;
                w.startNode("visibility");
                w.setValue(String.valueOf(v.getId()));
                w.endNode();
            }
       
            public boolean canConvert(Class clazz) {
                return clazz == Visibility.class;
View Full Code Here

   
    public boolean performFinish() {
      String org = _mainWizardPage.getOrganisation();
      String name = _mainWizardPage.getName();
      String rev = _mainWizardPage.getRevision();
      Visibility visibility = _mainWizardPage.getVisibility();
      try {
        WojServicesHelper.getDefault().associate(_jarFile, visibility, org, name, rev);
      return true;
    } catch (Exception e) {
      _mainWizardPage.setErrorMessage(Messages.getString("addreference.error.message")+" "+e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

    final Button searchButton = new Button(parent, SWT.PUSH);
    searchButton.setText(Messages.getString("modulebrowser.composite.search.button"));
    searchButton.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        final String query = queryText.getText();
        final Visibility visibility = getVisibility();
        searchButton.setEnabled(false);
        searchButton.setText("modulebrowser.composite.search.button.searching");
              new Thread(new Runnable() {
          public void run() {
            try {
View Full Code Here

                       
                        if (uak==null) {
                            // not identified on master
                            return "repository.show.error";
                        } else {
                            Visibility v = uak.getPublishVisibilityRight();
                            List visibilities = new ArrayList(Arrays.asList(Visibility.getVisibilitiesUpTo(v)));
                            if (userLogged.getGroup() == null) {
                                visibilities.remove(Visibility.PRIVATE);
                            }
                            request.setAttribute(Params.REPOSITORY.SHOW.REQUEST.VISIBILITIES, visibilities);
                           
                            DynaActionForm f = (DynaActionForm)form;
                            String choosenVisibilityString = f.getString(Params.REPOSITORY.SHOW.FORM.CHOOSEN_VISIBILITY);
                            String compare = f.getString(Params.REPOSITORY.SHOW.FORM.COMPARE);
                            String order = f.getString(Params.REPOSITORY.SHOW.FORM.ORDER);
                            boolean desc = ORDER_DESC.equals(order);
                           
                            if (StringUtils.isBlank(compare)) {
                                compare = NO_COMPARATOR_NAME;
                            }
                           
                            Visibility choosenVisibility;
                            if (StringUtils.isBlank(choosenVisibilityString)) {
                                choosenVisibility = v;
                            } else {
                                choosenVisibility = Visibility.fromString(choosenVisibilityString);
                            }
                            f.set(Params.REPOSITORY.SHOW.FORM.CHOOSEN_VISIBILITY, choosenVisibility.getName());
                            request.setAttribute(Params.REPOSITORY.SHOW.FORM.CHOOSEN_VISIBILITY, choosenVisibility.getName());
                           
                            ServerServicesProvider userSSP = (ServerServicesProvider)request.getSession().getAttribute(Params.GENERAL.REQUEST.USER_SSP);
                           
                            AreaInfo info = new AreaInfoImpl();
                            AreaInfo[] orgInfos = null;
                            List orgs = Collections.EMPTY_LIST;
                            if (userLogged.getGroup() != null) {
                                try {
                                    info = userSSP.getModuleManagementService().getAreaInfo(new Long(userLogged.getGroup().getId()), choosenVisibility);
                                    orgInfos = userSSP.getModuleManagementService().getAllAreaInfo(new Long(userLogged.getGroup().getId()), choosenVisibility, null, null);
                                   
                                    orgs = Arrays.asList(orgInfos);
                                    Collections.sort(orgs, getComparator(compare, desc));
                                } catch (org.jayasoft.woj.common.services.ServiceException e) {
                                    LOGGER.warn("cannot retrieve organisations", e);
                                }
                            }
                           
                            request.setAttribute(Params.REPOSITORY.SHOW.REQUEST.ORGANISATIONS, orgs);
                            request.setAttribute(Params.REPOSITORY.SHOW.REQUEST.AREA_INFO, info);
                            request.setAttribute(Params.REPOSITORY.SHOW.REQUEST.VISIBILITY_NAME, choosenVisibility.getName());
//                            request.setAttribute(Params.REPOSITORY.SHOW.REQUEST.AREA_SPACE, new AreaSpace(300, 74));
                        }
                       
                        return null;
                    }
View Full Code Here

                       
                        if (StringUtils.isBlank(compare)) {
                            compare = NO_COMPARATOR_NAME;
                        }
                       
                        Visibility v = Visibility.fromString(visibility);
                       
                        ServerServicesProvider userSSP = (ServerServicesProvider)request.getSession().getAttribute(Params.GENERAL.REQUEST.USER_SSP);
                       
                        AreaInfo[] modInfos = null;
                        List mods = Collections.EMPTY_LIST;
                        try {
                            modInfos = userSSP.getModuleManagementService().getAllAreaInfo(new Long(userLogged.getGroup().getId()), v, organisation, null);

//                            orgs = Arrays.asList(userSSP.getContentService().getOrganisations(choosenVisibility, null));
                            mods = Arrays.asList(modInfos);
                            Collections.sort(mods, getComparator(compare, desc));
                        } catch (org.jayasoft.woj.common.services.ServiceException e) {
                            LOGGER.warn("cannot retrieve organisations", e);
                        }
                       
                        request.setAttribute(Params.REPOSITORY.SHOW_BY_ORG.REQUEST.ORGANISATION, organisation);
                        request.setAttribute(Params.REPOSITORY.SHOW_BY_ORG.REQUEST.MODULES, mods);
                        request.setAttribute(Params.REPOSITORY.SHOW_BY_ORG.REQUEST.VISIBILITY_NAME, v.getName());
                       
                        return null;
                    }
                }
                , "repository.by.org.show"
View Full Code Here

                       
                        if (StringUtils.isBlank(compare)) {
                            compare = NO_COMPARATOR_NAME;
                        }
                       
                        Visibility v = Visibility.fromString(visibility);
                       
                        ServerServicesProvider userSSP = (ServerServicesProvider)request.getSession().getAttribute(Params.GENERAL.REQUEST.USER_SSP);
                       
                        String action = request.getParameter(Params.REPOSITORY.SHOW_BY_MOD.PARAMS.ACTION);
                        if (!StringUtils.isBlank(action)) {
                            String revision = f.getString(Params.REPOSITORY.SHOW_BY_MOD.FORM.REVISION);
                            f.set(Params.REPOSITORY.SHOW_BY_MOD.FORM.REVISION, "");
                            try {
                                ModuleDescriptor md = userSSP.getModuleManagementService().getModule(v.getId(), organisation, module, revision);
                                userSSP.getModuleManagementService().removeModule(new Long(md.getId()));
                                LOGGER.info(MessageFormat.format("deleted {0}|{1}|{2}", new Object[] {organisation, module, revision}));
                            } catch (org.jayasoft.woj.common.services.ServiceException e) {
                                LOGGER.warn(MessageFormat.format("cannot delete {0}|{1}|{2}", new Object[] {organisation, module, revision}), e);
                            }
                        }
                       
                        AreaInfo[] revInfos = null;
                        List revs = Collections.EMPTY_LIST;
                        try {
                            revInfos = userSSP.getModuleManagementService().getAllAreaInfo(new Long(userLogged.getGroup().getId()), v, organisation, module);

                            revs = Arrays.asList(revInfos);
                            Collections.sort(revs, getComparator(compare, desc));
                        } catch (org.jayasoft.woj.common.services.ServiceException e) {
                            LOGGER.warn("cannot retrieve organisations", e);
                        }
                       
                        request.setAttribute(Params.REPOSITORY.SHOW_BY_MOD.REQUEST.REVISIONS, revs);
                        request.setAttribute(Params.REPOSITORY.SHOW_BY_MOD.REQUEST.VISIBILITY_NAME, v.getName());
                        request.setAttribute(Params.REPOSITORY.SHOW_BY_MOD.REQUEST.ORGANISATION, organisation);
                        request.setAttribute(Params.REPOSITORY.SHOW_BY_MOD.REQUEST.MODULE, module);
                       
                        return null;
                    }
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.common.model.content.Visibility

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.