Package com.adito.properties.forms

Examples of com.adito.properties.forms.ProfilePropertiesForm


    public int getNavigationContext(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
        return SessionInfo.USER_CONSOLE_CONTEXT | SessionInfo.MANAGEMENT_CONSOLE_CONTEXT;
    }

    public AbstractPropertyKey createKey(PropertyDefinition definition, AbstractPropertiesForm form, SessionInfo sessionInfo) {
        ProfilePropertiesForm f = (ProfilePropertiesForm)form;
        return new ProfilePropertyKey(f.getSelectedPropertyProfile(), null, definition.getName(), sessionInfo.getUser().getRealm().getResourceId());
    }
View Full Code Here


        return super.unspecified(mapping, form, request, response);
   

    @Override
    public ActionForward commit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        ProfilePropertiesForm f = (ProfilePropertiesForm) form;    
        PropertyProfile profile = ProfilesFactory.getInstance().getPropertyProfile(f.getSelectedPropertyProfile());
        ResourceUtil.checkResourceManagementRights(profile, getSessionInfo(request), new Permission[] {PolicyConstants.PERM_CHANGE});
        return super.commit(mapping, form, request, response);
    }
View Full Code Here

    public int getNavigationContext(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
        return SessionInfo.USER_CONSOLE_CONTEXT;
    }

    public AbstractPropertyKey createKey(PropertyDefinition definition, AbstractPropertiesForm form, SessionInfo sessionInfo) {
        ProfilePropertiesForm f = (ProfilePropertiesForm)form;
        return new ProfilePropertyKey(f.getSelectedPropertyProfile(), sessionInfo.getUser().getPrincipalName(), definition.getName(), sessionInfo.getUser().getRealm().getResourceId());
    }
View Full Code Here

     * @see com.adito.properties.actions.AbstractPropertiesAction#unspecified(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
     */
    public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                    HttpServletResponse response) throws Exception {
        super.unspecified(mapping, form, request, response);
        ProfilePropertiesForm pf = (ProfilePropertiesForm)form;
       
        if (pf.getSelectedPropertyProfile() == -1) {
            if (request.getSession().getAttribute(Constants.SELECTED_PROFILE) != null) {
                pf.setSelectedPropertyProfile(((PropertyProfile) request.getSession().getAttribute(Constants.SELECTED_PROFILE)).getResourceId());
            } else {
                pf.setSelectedPropertyProfile(0);
            }
        }
        PropertyProfile selectedPropertyProfile = ProfilesFactory.getInstance().getPropertyProfile(pf.getSelectedPropertyProfile());
        if (selectedPropertyProfile == null) {
            selectedPropertyProfile = ProfilesFactory.getInstance().getPropertyProfile(getSessionInfo(request).getUser().getPrincipalName(),
                "Default", getSessionInfo(request).getUser().getRealm().getResourceId());
            if (selectedPropertyProfile == null) {
                selectedPropertyProfile = ProfilesFactory.getInstance().getPropertyProfile(null, "Default",
                                UserDatabaseManager.getInstance().getDefaultUserDatabase().getRealm().getResourceId());
            }
        }
        ResourceStack.pushToEditingStack(request.getSession(), selectedPropertyProfile);
       
        // Get the property profiles
        List propertyProfiles = (List)request.getSession().getAttribute(Constants.PROFILES);
        if (selectedPropertyProfile == null) {
            for (Iterator i = propertyProfiles.iterator(); i.hasNext();) {
                selectedPropertyProfile = (PropertyProfile) i.next();
                if (selectedPropertyProfile.getResourceName().equals("Default")) {
                    break;
                }
            }
        }
        pf.setPropertyProfiles(propertyProfiles);
        pf.setSelectedPropertyProfile(selectedPropertyProfile.getResourceId());
       
        // Build an display
        return rebuildItems(mapping, pf.getParentCategory(), pf, request, getSessionInfo(request).getUser());
    }
View Full Code Here

TOP

Related Classes of com.adito.properties.forms.ProfilePropertiesForm

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.