当前位置: 首页>>代码示例>>Java>>正文


Java FenixFramework.getDomainObject方法代码示例

本文整理汇总了Java中pt.ist.fenixframework.FenixFramework.getDomainObject方法的典型用法代码示例。如果您正苦于以下问题:Java FenixFramework.getDomainObject方法的具体用法?Java FenixFramework.getDomainObject怎么用?Java FenixFramework.getDomainObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pt.ist.fenixframework.FenixFramework的用法示例。


在下文中一共展示了FenixFramework.getDomainObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showPhoto

import pt.ist.fenixframework.FenixFramework; //导入方法依赖的package包/类
public ActionForward showPhoto(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
        HttpServletResponse response) throws Exception {

    Party party = FenixFramework.getDomainObject(request.getParameter("personID"));
    if (party.isPerson()) {
        Person person = (Person) party;
        Photograph personalPhoto = person.getPersonalPhoto();
        if (personalPhoto != null) {
            try {
                byte[] avatar = personalPhoto.getDefaultAvatar();
                response.setContentType(ContentType.PNG.getMimeType());
                DataOutputStream dos = new DataOutputStream(response.getOutputStream());
                dos.write(avatar);
                dos.close();
            } catch (java.io.IOException e) {
                throw new FenixActionException(e);
            }
        }
    }
    return null;
}
 
开发者ID:ist-dsi-archive,项目名称:fenix-parking,代码行数:22,代码来源:ParkingManagerDispatchAction.java

示例2: showHistory

import pt.ist.fenixframework.FenixFramework; //导入方法依赖的package包/类
public ActionForward showHistory(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    final String codeString = request.getParameter("externalId");
    String code = null;
    if (codeString == null) {
        code = (String) request.getAttribute("externalId");
    } else {
        code = codeString;
    }
    final ParkingRequest parkingRequest = FenixFramework.getDomainObject(code);
    List<ParkingPartyHistory> parkingPartyHistories =
            new ArrayList<ParkingPartyHistory>(parkingRequest.getParkingParty().getParty().getParkingPartyHistoriesSet());

    Collections.sort(parkingPartyHistories, new BeanComparator("historyDate"));
    request.setAttribute("parkingPartyHistories", parkingPartyHistories);
    request.setAttribute("parkingParty", parkingRequest.getParkingParty());
    return mapping.findForward("showParkingHistories");
}
 
开发者ID:ist-dsi-archive,项目名称:fenix-parking,代码行数:19,代码来源:ParkingManagerDispatchAction.java

示例3: processFileChanges

import pt.ist.fenixframework.FenixFramework; //导入方法依赖的package包/类
private void processFileChanges(Site site, Post post, JsonObject postJson) {
	if(postJson.get("files")!=null && postJson.get("files").isJsonArray()) {
		for (JsonElement fileJsonEl : postJson.get("files").getAsJsonArray()) {
			JsonObject fileJson = fileJsonEl.getAsJsonObject();
			PostFile postFile = FenixFramework.getDomainObject(fileJson.get("id").getAsString());
			if(postFile.getPost() == post) {
				int index = fileJson.get("index").getAsInt();
				boolean isEmbedded = fileJson.get("isEmbedded").getAsBoolean();
				if(postFile.getIndex()!= index) {
					postFile.setIndex(index);
				}
				if(postFile.getIsEmbedded()!=isEmbedded) {
					postFile.setIsEmbedded(isEmbedded);
				}
				Signal.emit(PostFile.SIGNAL_EDITED, new DomainObjectEvent<>(postFile));
			}
		}
	}

}
 
开发者ID:FenixEdu,项目名称:fenixedu-cms,代码行数:21,代码来源:AdminPostsService.java

示例4: showParkingPartyHistory

import pt.ist.fenixframework.FenixFramework; //导入方法依赖的package包/类
public ActionForward showParkingPartyHistory(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    final String codeString = request.getParameter("externalId");
    String code = null;
    if (codeString == null) {
        code = (String) request.getAttribute("externalId");
    } else {
        code = codeString;
    }
    final ParkingParty parkingParty = FenixFramework.getDomainObject(code);
    List<ParkingPartyHistory> parkingPartyHistories =
            new ArrayList<ParkingPartyHistory>(parkingParty.getParty().getParkingPartyHistoriesSet());

    Collections.sort(parkingPartyHistories, new BeanComparator("historyDate"));
    request.setAttribute("parkingPartyHistories", parkingPartyHistories);
    request.setAttribute("parkingParty", parkingParty);
    return mapping.findForward("showParkingHistories");
}
 
开发者ID:ist-dsi-archive,项目名称:fenix-parking,代码行数:19,代码来源:ParkingManagerDispatchAction.java

示例5: importEnrolmentByCompetenceCourseTables

import pt.ist.fenixframework.FenixFramework; //导入方法依赖的package包/类
@Atomic
private void importEnrolmentByCompetenceCourseTables(AcademicInterval executionInterval, String file) {
    ExecutionSemester querySemester = ExecutionYear.readByAcademicInterval(executionInterval).getFirstExecutionPeriod();
    for (String line : file.split("\n")) {
        if (!line.startsWith(BundleUtil.getString(Bundle.GEP, "label.externalId"))) {
            String[] parts = fillArray(line.split(SEPARATOR), 17);
            CompetenceCourse competence = FenixFramework.getDomainObject(parts[0]);
            // if
            // (!competence.getDepartmentUnit().getName().equals(parts[1]))
            // {
            // throw new
            // DomainException("error.ects.invalidLine.nonMatchingCourse",
            // parts[0], parts[1], competence
            // .getDepartmentUnit().getName());
            // }
            // if (!competence.getName(querySemester).equals(parts[2])) {
            // throw new
            // DomainException("error.ects.invalidLine.nonMatchingCourse",
            // parts[0], parts[2],
            // competence.getName(querySemester));
            // }
            EctsCompetenceCourseConversionTable.createConversionTable(competence, executionInterval,
                    Arrays.copyOfRange(parts, 6, 17));
        }
    }
}
 
开发者ID:FenixEdu,项目名称:fenixedu-academic,代码行数:27,代码来源:ManageEctsComparabilityTablesDispatchAction.java

示例6: prepareInit

import pt.ist.fenixframework.FenixFramework; //导入方法依赖的package包/类
public ActionForward prepareInit(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) {

    final String degreeCurricularPlanOID = newFindDegreeCurricularPlanID(request);
    request.setAttribute("degreeCurricularPlanID", degreeCurricularPlanOID);

    final DegreeCurricularPlan degreeCurricularPlan = FenixFramework.getDomainObject(degreeCurricularPlanOID);

    final ExecutionDegree executionDegree = degreeCurricularPlan.getMostRecentExecutionDegree();

    Degree degree = executionDegree.getDegree();

    // Degree degree = getDomainObject(request, "degreeCurricularPlanID");
    SearchDegreeLogBean sdlb = new SearchDegreeLogBean(degree);
    sdlb.setDegreeLogTypes(new ArrayList<DegreeLogTypes>());

    request.setAttribute("searchBean", sdlb);
    request.setAttribute("degree", sdlb.getDegree());
    // final InfoExecutionDegree infoExecutionDegree =
    // InfoExecutionDegree.newInfoFromDomain(executionDegree);
    // request.setAttribute(PresentationConstants.MASTER_DEGREE, degree);

    return mapping.findForward("search");
}
 
开发者ID:FenixEdu,项目名称:fenixedu-academic,代码行数:25,代码来源:SearchDegreeLogAction.java

示例7: run

import pt.ist.fenixframework.FenixFramework; //导入方法依赖的package包/类
@Atomic
public static Object run(InfoClass infoClass) {
    check(RolePredicates.RESOURCE_ALLOCATION_MANAGER_PREDICATE);
    SchoolClass schoolClass = FenixFramework.getDomainObject(infoClass.getExternalId());

    Collection<Shift> shifts = schoolClass.getAssociatedShiftsSet();

    return CollectionUtils.collect(shifts, new Transformer() {
        @Override
        public Object transform(Object arg0) {
            Shift shift = (Shift) arg0;
            InfoShift infoShift = InfoShift.newInfoFromDomain(shift);
            return infoShift;
        }
    });
}
 
开发者ID:FenixEdu,项目名称:fenixedu-academic,代码行数:17,代码来源:ReadShiftsByClass.java

示例8: run

import pt.ist.fenixframework.FenixFramework; //导入方法依赖的package包/类
@Atomic
public static Lesson run(InfoLesson aulaAntiga, DiaSemana weekDay, Calendar begin, Calendar end, FrequencyType frequency,
        InfoRoomOccupationEditor infoRoomOccupation, InfoShift infoShift, YearMonthDay newBeginDate, YearMonthDay newEndDate,
        Boolean createLessonInstances) throws FenixServiceException {
    check(RolePredicates.RESOURCE_ALLOCATION_MANAGER_PREDICATE);

    Lesson lesson = FenixFramework.getDomainObject(aulaAntiga.getExternalId());

    if (lesson != null) {

        Space newRoom = null;
        if (infoRoomOccupation != null && infoRoomOccupation.getInfoRoom() != null) {
            newRoom = SpaceUtils.findAllocatableSpaceForEducationByName(infoRoomOccupation.getInfoRoom().getNome());
        }

        lesson.edit(newBeginDate, newEndDate, weekDay, begin, end, frequency, createLessonInstances, newRoom);
    }
    return lesson;
}
 
开发者ID:FenixEdu,项目名称:fenixedu-academic,代码行数:20,代码来源:EditLesson.java

示例9: run

import pt.ist.fenixframework.FenixFramework; //导入方法依赖的package包/类
protected void run(String executionCourseID, String evaluationID, List<String> roomIDs, Boolean distributeOnlyEnroledStudents)
        throws FenixServiceException {

    final WrittenEvaluation writtenEvaluation = (WrittenEvaluation) FenixFramework.getDomainObject(evaluationID);
    if (writtenEvaluation == null) {
        throw new FenixServiceException("error.noWrittenEvaluation");
    }
    List<Registration> studentsToDistribute;
    if (distributeOnlyEnroledStudents) {
        studentsToDistribute = readEnroledStudentsInWrittenEvaluation(writtenEvaluation);
    } else {
        studentsToDistribute = readAllStudentsAttendingExecutionCourses(writtenEvaluation);
    }
    final List<Space> selectedRooms = readRooms(writtenEvaluation, roomIDs);
    if (!selectedRooms.containsAll(writtenEvaluation.getAssociatedRooms())) {
        // if the selected rooms are different of the evaluation rooms
        // then the user probably selected repeated rooms
        throw new FenixServiceException("error.repeated.rooms");
    }
    writtenEvaluation.distributeStudentsByRooms(studentsToDistribute, selectedRooms);
}
 
开发者ID:FenixEdu,项目名称:fenixedu-academic,代码行数:22,代码来源:WrittenEvaluationRoomDistribution.java

示例10: run

import pt.ist.fenixframework.FenixFramework; //导入方法依赖的package包/类
protected InfoExecutionCourseOccupancy run(String executionCourseID) {

        final InfoExecutionCourseOccupancy infoExecutionCourseOccupancy = new InfoExecutionCourseOccupancy();
        infoExecutionCourseOccupancy.setInfoShifts(new ArrayList());

        final ExecutionCourse executionCourse = FenixFramework.getDomainObject(executionCourseID);
        final Set<Shift> shifts = executionCourse.getAssociatedShifts();

        infoExecutionCourseOccupancy.setInfoExecutionCourse(InfoExecutionCourse.newInfoFromDomain(executionCourse));

        for (final Shift shift : shifts) {
            Integer capacity = Integer.valueOf(1);
            if (shift.getLotacao() != null && shift.getLotacao().intValue() != 0) {
                capacity = shift.getLotacao();
            }

            final InfoShift infoShift = InfoShift.newInfoFromDomain(shift);

            infoExecutionCourseOccupancy.getInfoShifts().add(infoShift);
        }

        return infoExecutionCourseOccupancy;
    }
 
开发者ID:FenixEdu,项目名称:fenixedu-academic,代码行数:24,代码来源:ReadShiftsByExecutionCourseID.java

示例11: listSummariesControl

import pt.ist.fenixframework.FenixFramework; //导入方法依赖的package包/类
public ActionForward listSummariesControl(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
        HttpServletResponse response) throws Exception {

    DepartmentSummaryElement departmentSummaryElement = getRenderedObject();
    String executionSemesterID = null;
    if (departmentSummaryElement != null) {
        executionSemesterID = departmentSummaryElement.getExecutionSemester().getExternalId();
    } else {
        executionSemesterID = (String) getFromRequest(request, "executionSemesterID");
        ExecutionSemester executionSemester = FenixFramework.getDomainObject(executionSemesterID);
        departmentSummaryElement = new DepartmentSummaryElement(null, executionSemester);
    }
    request.setAttribute("executionSemesters", departmentSummaryElement);
    setAllDepartmentsSummaryResume(request, executionSemesterID);

    return mapping.findForward("success");
}
 
开发者ID:FenixEdu,项目名称:fenixedu-academic,代码行数:18,代码来源:SummariesControlAction.java

示例12: selectSpaces

import pt.ist.fenixframework.FenixFramework; //导入方法依赖的package包/类
private Set<Space> selectSpaces(String selectedSpaces, User user) {
    final Set<Space> selectedSpaceSet = new HashSet<>();
    final JsonArray spacesJson = jsonParser.parse(selectedSpaces).getAsJsonArray();
    for (JsonElement spaceJson : spacesJson) {
        String spaceId = spaceJson.getAsString();
        final Space space = FenixFramework.getDomainObject(spaceId);
        if (FenixFramework.isDomainObjectValid(space)) {
            if (!space.isOccupationMember(user)) {
                throw new SpaceDomainException("unauthorized.selected.space", space.getName());
            }
            selectedSpaceSet.add(space);
        }
    }
    return selectedSpaceSet;
}
 
开发者ID:FenixEdu,项目名称:fenixedu-spaces,代码行数:16,代码来源:OccupationService.java

示例13: setParentClassification

import pt.ist.fenixframework.FenixFramework; //导入方法依赖的package包/类
@Atomic
public void setParentClassification(SpaceClassification classification, String parent) {
    SpaceClassification parentClassification = null;
    if (parent.length() > 0) {
        parentClassification = FenixFramework.getDomainObject(parent);
    } else {
        if (!classification.isRootClassification()) {
            throw new SpaceClassificationException("error", "label.spaceClassification.mustSelectParent", "");
        }
        classification.setParent(parentClassification);
        return;
    }
    // verify that this classification is not in its parent chain
    SpaceClassification loopParents = parentClassification;
    List<SpaceClassification> listParentClassifications = new ArrayList<SpaceClassification>();
    while (loopParents != null) {
        listParentClassifications.add(loopParents);
        if (loopParents.equals(classification)) {
            throw new SpaceClassificationException("error", "label.spaceClassification.isInParentChain", "");
        }
        loopParents = loopParents.getParent();
    }
    // verify that no children of this classification are in its parent chain
    List<SpaceClassification> listChildClassifications = classification.getAllChildren();

    if (Collections.disjoint(listChildClassifications, listParentClassifications) == false) {
        throw new SpaceClassificationException("error", "label.spaceClassification.isInParentChain", "");
    }
    classification.setParent(parentClassification);
}
 
开发者ID:FenixEdu,项目名称:fenixedu-spaces,代码行数:31,代码来源:SpaceClassificationService.java

示例14: create

import pt.ist.fenixframework.FenixFramework; //导入方法依赖的package包/类
@Atomic(mode = TxMode.WRITE)
private SpaceClassification create(SpaceClassificationBean infoBean) {
    SpaceClassification sc = null;
    if (infoBean.getParent().length() > 0) {
        sc = FenixFramework.getDomainObject(infoBean.getParent());
    }
    return new SpaceClassification(infoBean.getCode(), infoBean.getLocalizedName(), sc, infoBean.getMetadataSpec(), infoBean.getIsAllocatable());
}
 
开发者ID:FenixEdu,项目名称:fenixedu-spaces,代码行数:9,代码来源:SpaceClassificationController.java

示例15: delete

import pt.ist.fenixframework.FenixFramework; //导入方法依赖的package包/类
@RequestMapping(value = "{siteSlug}/{postFileId}/delete", method = RequestMethod.POST)
public RedirectView delete(@PathVariable String siteSlug, @PathVariable String postFileId) {
    Site site = Site.fromSlug(siteSlug);
    ensureCanDoThis(site, PermissionsArray.Permission.EDIT_POSTS);
    PostFile postFile = FenixFramework.getDomainObject(postFileId);
    Post post = postFile.getPost();
    if(site.equals(postFile.getSite())) {
        FenixFramework.atomic(()-> {
            postFile.delete();
            post.fixOrder(post.getFilesSorted());
        });
    }
    return mediaLibraryRedirect(site);
}
 
开发者ID:FenixEdu,项目名称:fenixedu-cms,代码行数:15,代码来源:AdminMediaLibrary.java


注:本文中的pt.ist.fenixframework.FenixFramework.getDomainObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。