Package org.nxplanner.tags

Examples of org.nxplanner.tags.DomainContext.populate()


    private void checkAuthorization(Object object, String permission)
            throws RepositoryException {
        DomainContext context = new DomainContext();
        try {
            context.populate(object);
            int objectIdentifier = ((Integer)PropertyUtils.getProperty(object, "id")).intValue();
            if (!SystemAuthorizer.get().hasPermission(context.getProjectId(),
                    SecurityHelper.getRemoteUserId(ThreadServletRequest.get()), object, permission)) {
                throw new AuthorizationException("not authorized for object "+permission+": "+
                        objectClass+" "+objectIdentifier);
View Full Code Here


    //

    private int getProjectId(Class containerClass, int containerId) throws Exception {
        Object object = ThreadSession.get().load(containerClass, new Integer(containerId));
        DomainContext context = new DomainContext();
        context.populate(object);
        return context.getProjectId();
    }

    private int getProjectId(Object object) throws Exception {
        DomainContext context = new DomainContext();
View Full Code Here

        return context.getProjectId();
    }

    private int getProjectId(Object object) throws Exception {
        DomainContext context = new DomainContext();
        context.populate(object);
        return context.getProjectId();
    }

    private Object[] getObjects(Class dataClass, String where, Object[] values, Type[] types, String orderBy) throws Exception {
        try {
View Full Code Here

        DomainContext domainContext = DomainContext.get(request);
        if (domainContext != null) {
            return domainContext;
        }
        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);
View Full Code Here

        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

        Iteration iteration = newIteration(project);
        UserStory story = newUserStory(iteration);
        Task task = newTask(story);
        commitCloseAndOpenSession();
        DomainContext context = new DomainContext();
        context.populate(task);
        assertEquals(project.getId(), context.getProjectId());
        assertEquals(project.getName(), context.getProjectName());
        assertEquals(iteration.getId(), context.getIterationId());
        assertEquals(iteration.getName(), context.getIterationName());
        assertEquals(story.getId(), context.getStoryId());
View Full Code Here

        Project project = newProject();
        Iteration iteration = newIteration(project);
        UserStory story = newUserStory(iteration);
        commitCloseAndOpenSession();
        DomainContext context = new DomainContext();
        context.populate(story);
        assertEquals(project.getId(), context.getProjectId());
        assertEquals(project.getName(), context.getProjectName());
        assertEquals(iteration.getId(), context.getIterationId());
        assertEquals(iteration.getName(), context.getIterationName());
        assertEquals(story.getId(), context.getStoryId());
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.