Examples of JetspeedPrincipal


Examples of org.apache.jetspeed.security.JetspeedPrincipal

            statusForm.add(new Button("submit", new ResourceModel(
                    principalParam + ".update.button")){
                @Override
                public void onSubmit()
                {
                    JetspeedPrincipal principal = getManager().getPrincipal(
                            getName());
                    try
                    {
                        principal.setEnabled(isPrincipalEnabled());
                        getManager().updatePrincipal(principal);
                        setPrincipal(principal);
                        principalDataProvider.refresh(getManager(),getSearchString());
                    } catch (SecurityException jSx)
                    {
                        error(jSx.getMessage());
                    }
                }
            });
            statusForm.add(new Button("remove", new ResourceModel(principalParam + ".remove.button")){
                @Override
                public void onSubmit()
                {
                    try
                    {
                        getManager().removePrincipal(principal.getName());
                        setPrincipal(null);
                        controlPannels(false);
                        principalDataProvider.refresh(getManager(),getSearchString());
                    }
                    catch (SecurityException e)
View Full Code Here

Examples of org.apache.jetspeed.security.JetspeedPrincipal

                    new PropertyModel(this, "associations"))
            {

                public void populateItem(final ListItem listItem)
                {
                    final JetspeedPrincipal principal = (JetspeedPrincipal) listItem
                            .getModelObject();
                    listItem.add(new Label("Name", principal.getName()));
                    Link deleteLink = new Link("delete")
                    {

                        @Override
                        public void onClick()
                        {
                            try
                            {
                                if (!associationsFrom)
                                {
                                    getManager().removeAssociation(principal,
                                            getPrincipal(), assoctionName);
                                } else
                                {
                                    getManager().removeAssociation(
                                            getPrincipal(), principal,
                                            assoctionName);
                                }
                                refreshList();
                            } catch (Exception e)
                            {
                                // TODO: handle exception
                            }
                        }
                    };
                    deleteLink.add(new Label("deleteLabel", new ResourceModel(
                            "common.delete")));
                    listItem.add(deleteLink);
                }
            };
            if(assoicationType.getFromPrincipalType().equals(principalType))
            {
                add(new Label("principalReleation",new ResourceModel(assoicationType.getToPrincipalType().getName())));   
            }else{
                add(new Label("principalReleation",new ResourceModel(assoicationType.getFromPrincipalType().getName())));
            }
            add(commentListView);
            add(new FeedbackPanel("feedback"));
            Form assocationsForm = new Form("assocationsForm");
            add(assocationsForm);
            DropDownChoice dropDown = new DropDownChoice(
                    "associationPrincipal", new PropertyModel(this,
                            "associationPrincipal"), getNames(),
                    new ChoiceRenderer("name", "name"));
            dropDown.setRequired(true);
            assocationsForm.add(dropDown);
            Button addRelations = new Button("addRelations", new ResourceModel(
                    "common.association.add"))
            {

                @Override
                public void onSubmit()
                {
                    try
                    {
                        JetspeedPrincipal toPrincipal = getPrincipal();
                        // JetspeedPrincipal fromPrincipal =
                        // getJetspeedPrincipalManagerProvider().getManager(type).getPrincipal(getAssociationPrincipal());
                        JetspeedPrincipal fromPrincipal = getAssociationPrincipal();
                        if (!associationsFrom)
                        {
                            getManager().addAssociation(fromPrincipal,
                                    toPrincipal, associationName);
                        } else
View Full Code Here

Examples of org.apache.jetspeed.security.JetspeedPrincipal

                }
                associationsFrom = true;
            }
            for (int count = 0; count < associations.size(); count++)
            {
                JetspeedPrincipal tmpPrincipal = (JetspeedPrincipal) associations
                        .get(count);
                JetspeedPrincipal listPrincipal;
                for (int index = 0; index < names.size(); index++)
                {
                    listPrincipal = (JetspeedPrincipal) names.get(index);
                    if (listPrincipal.getName().equals(tmpPrincipal.getName()))
                    {
                        names.remove(index);
                    }
                }
            }
View Full Code Here

Examples of org.apache.jetspeed.security.JetspeedPrincipal

            userName.add(new PrincipalNameValidator());
            userForm.add(userName);
            Button newUser = new Button("addUser",new ResourceModel(principalParam +".add.button")){
        @Override
        public void onSubmit() {
          JetspeedPrincipal principal =  getManager().newPrincipal(getUserName(),false);
          try{
            getManager().addPrincipal(principal, null);
            setPrincipal(principal);
            controlPannels(true);
            principalDataProvider.refresh(getManager(),getSearchString());
View Full Code Here

Examples of org.apache.jetspeed.security.JetspeedPrincipal

            profileForm.add(new Button("submit", new ResourceModel(
                    principalParam + ".update.button")){
                @Override
                public void onSubmit()
                {
                    JetspeedPrincipal principal = getManager().getPrincipal(
                            getName());
                    try
                    {
                        principal.setEnabled(isUserEnabled());
                        getManager().updatePrincipal(principal);
                        setPrincipal(principal);
                        principalDataProvider.refresh(getManager(),getSearchString());
                    } catch (SecurityException jSx)
                    {
                        error(jSx.getMessage());
                    }
                }
            });
            profileForm.add(new Button("remove", new ResourceModel(principalParam + ".remove.button")){
                @Override
                public void onSubmit()
                {
                    try
                    {
                        getManager().removePrincipal(principal.getName());
                        setPrincipal(null);
                        controlPannels(false);
                        principalDataProvider.refresh(getManager(),getSearchString());
                    }
                    catch (SecurityException e)
View Full Code Here

Examples of org.apache.jetspeed.security.JetspeedPrincipal

        final DataView<JetspeedPrincipal> principalView = new DataView<JetspeedPrincipal>("entries", principalDataProvider)
        {
            @Override
            protected void populateItem(Item<JetspeedPrincipal> item)
            {
                final JetspeedPrincipal user = (JetspeedPrincipal) item.getModelObject();
                Link editLink = new Link("link", item.getModel())
                {
                    @Override
                    public void onClick()
                    {
                        JetspeedPrincipal user = (JetspeedPrincipal) getModelObject();
                        setPrincipal(user);
                        controlPannels(true);
                    }
                };
                editLink.add(new Label("name", user.getName()));
                item.add(editLink);
            }
        };
        principalView.setItemsPerPage(10);
        group.add(principalView);
View Full Code Here

Examples of org.apache.jetspeed.security.JetspeedPrincipal

        for (String s : SSO_TYPES)
            ssoTypesList.add(s);
    }
   
    protected JetspeedPrincipal getLocalPrincipal(String localUserName){
        JetspeedPrincipal localPrincipal = null;
       
        try{
            localPrincipal = userManager.getUser(localUserName);
        } catch (SecurityException secex){
           
View Full Code Here

Examples of org.apache.jetspeed.security.JetspeedPrincipal

   
    protected void processFound(List<JetspeedPrincipal> found, User user, Set<Long> resolvedIds, Set<Principal> principals, Map<String, UserSubjectPrincipalsResolver> resolvers)
    {
        for (int i = found.size() -1; i > -1; i--)
        {
            JetspeedPrincipal p = found.get(i);
            if (!p.isEnabled() || !resolvers.containsKey(p.getType().getName()) || !resolvedIds.add(p.getId()))
            {
                found.remove(i);
            }
        }
        for (JetspeedPrincipal p : found)
        {
            resolvers.get(p.getType().getName()).processPrincipal(p, user, resolvedIds, principals, resolvers);
        }
    }
View Full Code Here

Examples of org.apache.jetspeed.security.JetspeedPrincipal

    }

    public void removeUser(String userName, Long domainId)
            throws SecurityException
    {
        JetspeedPrincipal user;       
        user = getUser(userName, domainId);
        super.removePrincipal(user);
    }
View Full Code Here

Examples of org.apache.jetspeed.security.JetspeedPrincipal

        }
    }

    protected JetspeedPrincipal recursiveSynchronizeEntity(Entity entity, InternalSynchronizationState syncState, boolean recursive)
    {
        JetspeedPrincipal updatedPrincipal = null;
        if (entity != null && !syncState.isProcessed(entity))
        {
            // mark as processed, to avoid nasty loops
            syncState.setProcessed(entity);
            // update / create corresponding JetspeedPrincipal first
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.