Package org.nxplanner.domain.repository

Examples of org.nxplanner.domain.repository.ObjectRepository


    private void populateForm(AbstractEditorForm form, ActionMapping actionMapping, HttpServletRequest request)
        throws Exception {
        String oid = form.getOid();
        if (oid != null) {
            Class objectClass = getObjectType(actionMapping, request);
            ObjectRepository objectRepository = getRepository(objectClass);
            DomainObject object = (DomainObject) objectRepository.load(Integer.parseInt(oid));
            populateForm(form, object);
        }
    }
View Full Code Here


public class DeleteObjectAction extends AbstractAction {
    public ActionForward doExecute(ActionMapping actionMapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse reply)
            throws Exception {
        Class objectClass = getObjectType(actionMapping, request);
        ObjectRepository repository = getRepository(objectClass);
        repository.delete(Integer.parseInt(request.getParameter("oid")));
        String returnto = request.getParameter("returnto");
        return returnto != null ?
                new ActionForward(returnto, true)
                : actionMapping.findForward("view/projects");
    }
View Full Code Here

    protected void saveForm(AbstractEditorForm form, ActionMapping actionMapping, HttpServletRequest request)
            throws Exception {
        String oid = form.getOid();
        Class objectClass = getObjectType(actionMapping, request);
        ObjectRepository objectRepository = getRepository(objectClass);
        DomainObject object;
        String action = form.getAction();
        if (action.equals(UPDATE_ACTION)) {
            object = (DomainObject)objectRepository.load(Integer.parseInt(oid));
            populateObject(request, object, form);
            objectRepository.update(object);
        } else if (action.equals(CREATE_ACTION)) {
            object = createObject(objectClass, request, form, objectRepository);
        } else {
            throw new ServletException("Unknown editor action: " + action);
        }
View Full Code Here

        }
        domainContext = new DomainContext();
        domainContext.populate(object);
        String projectIdParam = request.getParameter("projectId");
        if (domainContext.getProjectId() == 0 && StringUtils.isNotEmpty(projectIdParam) && !projectIdParam.equals("0")) {
            ObjectRepository objectRepository = getRepository(Project.class);
            Project project = (Project)objectRepository.load(Integer.parseInt((request.getParameter("projectId"))));
            domainContext.populate(project);
        }
        domainContext.save(request);
        return domainContext;
    }
View Full Code Here

    protected ActionForward doExecute(ActionMapping actionMapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse reply)
            throws Exception {
        Class objectClass = getObjectType(actionMapping, request);
        ObjectRepository objectRepository = getRepository(objectClass);
        String forwardPath = null;
        if (isSecure(actionMapping)) {
            Object object = objectRepository.load(Integer.parseInt(request.getParameter("oid")));
            setDomainContext(request, object);
        }
        forwardPath = actionMapping.findForward("display").getPath();
        String returnto = request.getParameter("returnto");
        if (returnto != null) {
View Full Code Here

TOP

Related Classes of org.nxplanner.domain.repository.ObjectRepository

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.