Package org.opencustomer.db.vo.system

Examples of org.opencustomer.db.vo.system.UserVO


    private final static Logger log = Logger.getLogger(EditLoadAction.class);
   
    @Override
    public final ActionForward execute(ActionMapping mapping, E form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
    {
        UserVO user = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
       
        ActionMessages errors = new ActionMessages();
        Hashtable<String, Object> attributes = new Hashtable<String, Object>();
       
        preOperation(errors, form, attributes, request, response);
View Full Code Here


    public abstract EditPanel createPanel(ActionMessages errors, E form, Hashtable<String, Object> attributes, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException;
   
    protected boolean validateAccess(HttpServletRequest request, EditPanel panel) {
        if(panel.getEntity() instanceof EntityAccess) {
            UserVO user = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
           
            if(!user.getProfile().getRole().isAdmin()
                    && panel.getEntity() instanceof AdminAccess
                    && ((AdminAccess)panel.getEntity()).isAdmin()) {
                return false;
            }
               
View Full Code Here

    }
   
    @Override
    public void createEntity(ActionMessages errors, EditLoadForm form, Hashtable<String, Object> attributes, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
    {
        UserVO activeUser = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);
       
        ContactVO contact = new ContactVO();
        contact.setContactTimestamp(new Date());
       
        contact.setAccessUser(EntityAccess.Access.WRITE_SYSTEM);
        contact.setOwnerUser(activeUser.getId());
        contact.setAccessGroup(EntityAccess.Access.NONE);
        contact.setOwnerGroup(activeUser.getProfile().getDefaultUsergroup().getId());
        contact.setAccessGlobal(EntityAccess.Access.WRITE_SYSTEM);
       
        EditPanel lastPanel = (EditPanel)Panel.getPanelStack(request).peek();
       
        if(lastPanel.getEntity() instanceof CompanyVO)
        {
            if (log.isDebugEnabled())
                log.debug("contact for company");

            CompanyVO company = (CompanyVO) lastPanel.getEntity();
            contact.setCompany(company);
        }
        else if(lastPanel.getEntity() instanceof PersonVO)
        {
            if (log.isDebugEnabled())
                log.debug("contact for person");

            PersonVO person = (PersonVO)lastPanel.getEntity();
            contact.getPersonContacts().add(new PersonContactVO(person, contact));
        }
        else
        {
            log.error("unknown entity foundin panel: "+lastPanel);
        }   
       
        // add own user by default
        if(activeUser.getPerson() != null) {
            PersonVO person = activeUser.getPerson();
            boolean containsPerson = false;
            for(PersonContactVO personContact : contact.getPersonContacts()) {
                if(person.equals(personContact.getPerson())) {
                    containsPerson = true;
                }
View Full Code Here

    private static Logger log = Logger.getLogger(DeleteAction.class);

    @Override
    protected void deleteEntity(DeletePanel panel, HttpServletRequest request, HttpServletResponse response, ActionMessages errors)
    {
        UserVO user = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
       
        try
        {
            new PersonDAO().delete((PersonVO)panel.getEntity());
        }
View Full Code Here

    private static Logger log = Logger.getLogger(PageStandardAction.class);

    @Override
    public void readForm(PageStandardForm form, ActionMessages errors, HttpServletRequest request)
    {
        UserVO user                           = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
        ListConfigurationVO listConfiguration = (ListConfigurationVO) getPanel().getEntity();

        listConfiguration.setName(form.getName());
        listConfiguration.setDescription(form.getDescription());
        if(AuthenticatorUtility.getInstance().authenticate(request, Right.ADMINISTRATION_LIST_GLOBALLIST)) {
View Full Code Here

public class SaveAction extends EditSaveAction {
    private static Logger log = Logger.getLogger(SaveAction.class);

    @Override
    protected void saveEntity(EditPanel panel, ActionMessages errors, HttpServletRequest request) {
        UserVO user = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);
       
        try {
            PersonVO person = (PersonVO)panel.getEntity();
           
            if (person.getId() == null) {
View Full Code Here

    private static Logger log = Logger.getLogger(PageContactAction.class);

    @Override
    protected void search(PageContactForm form, ActionMessages errors, HttpServletRequest request)
    {
        UserVO user     = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
        PersonVO person = (PersonVO)getPanel().getEntity();
        UserConfiguration conf = (UserConfiguration)request.getSession().getAttribute(Globals.CONFIGURATION_KEY);

        List list = null;
        long count = 0;
View Full Code Here

    protected Serializable performSaveOrUpdate(SaveOrUpdateEvent event)
    {
        if(event.getEntity() instanceof InsertOrUpdate) {
            InsertOrUpdate entity = (InsertOrUpdate)event.getEntity();
           
            UserVO user = (UserVO)HibernateContext.getAttribute("user");
           
            entity.onInsertOrUpdate(user);
        }
       
        return super.performSaveOrUpdate(event);
View Full Code Here

            return orderField + " ASC";
    }

    public UserVO getByUserName(String userName)
    {
        UserVO user = null;

        try
        {
            StringBuilder hql = new StringBuilder();
            hql.append(" FROM ").append(getEntityClass().getName()).append(" e ");
View Full Code Here

       
        return checkEditable(request, panel, entityAccess);
    }
   
    public static boolean checkEditable(HttpServletRequest request, EditPanel panel, EntityAccess entityAccess) {
        UserVO user = (UserVO)request.getSession().getAttribute(org.opencustomer.webapp.Globals.USER_KEY);
       
        return checkEditable(request, panel, entityAccess, user);
    }
View Full Code Here

TOP

Related Classes of org.opencustomer.db.vo.system.UserVO

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.