SHARE
TWEET

Untitled

a guest Aug 13th, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static DataObject createDataObject() throws CoreException {
  2.         DataObject dataObject = new DataObject(DATANAME, PersonMessage.measure, MeasureBean.class).setFields(
  3.                 new KeyField(ID),
  4.                 new StringField(NAME, SystemMessages.name, 255).setIsName(),
  5.                 new ComboField(TYPE, VVMessage.type, MeasureType.class),
  6.                 new StringField(CODE, VVMessage.code, 100),
  7.                 new MemoFieldBuilder(new StringField(DESC, SystemMessages.desc, 1000)).getDataField(),
  8.                 new DateTimeField(START_DATE, MeasureMessage.begin),
  9.                 new DateTimeField(END_DATE, MeasureMessage.end),
  10.                 new ComboField(STATUS, PersonMessage.status, MeasureStatus.getMeasureStatuses()),
  11.                 new ComboField(FORM, MeasureMessage.form, MeasureForm.class),
  12.                 Service.hasModule(ContentModule.class) ?
  13.                         new LookupField(MeasureBean.CONTENT_ID, MeasureMessage.content, ContentFrame.NAME, LookupField.SET_NULL) : null,
  14.                 new ComboField(CONTENT_TYPE, VVMessage.type, MeasureContentTypeFactory.getInstance().getContentTypesCalcValues()).setDefaultValue(CourseMeasureContentType.CONTENT_TYPE_COURSE),
  15.                 new LookupField(TYPE_ME_ID, MeasureMessage.type_measure, MeasureFrame.TYPE_NAME, LookupField.RESTRICT),
  16.                 new IntegerField(USER_GM_ID, MeasureMessage.group_courses).setIsHidden(),
  17.                 new ComboField(REGISTRATION_TYPE, MeasureMessage.registrationType, StudentMeasureRegistrationType.class).setIsHidden(),
  18.                 new ComboField(FINISH_STATUS, MeasureMessage.finishStatus, StudentMeasureFinishStatus.getComboValues()).setIsHidden(),
  19.                 new DateTimeField(FINISH_DATE, MeasureMessage.finishDate).setIsHidden(),
  20.                 new RSField(KNOWLEDGE_LEVEL_DESC_ID, MeasureMessage.knowledgeLevelDesc, MEKnowledgeLevelDescRubricator.NAME, RSField.SET_NULL),
  21.                 Service.hasModule(TestModule.class) ?
  22.                         new LookupField(TEST_ID, MeasureMessage.elTest, TestFrame.NAME, LookupField.SET_NULL) : null,
  23.                 new RSField(INTERNAL_MEASURE_KIND, NoteAttachmentMessage.kind, InternalMeasureKindRubricator.INTERNAL_MEASURE_KIND, FKField.SET_NULL),
  24.                 new RSField(DIRECTION, MeasureMessage.me_edu_direction, EducationDirectionRubricator.EDUCATION_DIRECTION, LookupField.SET_NULL),
  25.                 new StringField(TEMPLATE_ID, SystemMessages.create_copy).setIsHidden(),
  26.                 new RSField(PLACE_ID, MeasureMessage.meplace, MEPlaceRubImpl.MEASURE_PLACE, FKField.SET_NULL).setIsHidden(),
  27.                 new StringField(VIEW_PASS_SCORE, MeasureMessage.passScore).setIsHidden(),
  28.                 new StringField(REGISRATION_FORM_LINK, VirtualroomMessage.registrationFormLink, -1).setIsHidden(),
  29.                 new StringField(LIGHT_WEIGHT_REGISTRATION_FORM_LINK, VirtualroomMessage.light_weight_reg_form, -1).setIsHidden(),
  30.                 new MultiRSField(REFUSAL_REASONS, CandidateMessage.refusal_reasons, MeasureRefusalReasonRubricator.MEASURE_REFUSAL_REASON),
  31.                 new PhotoFieldBuilder(new FileField(COVER_FILE, MeasureMessage.cover, MeasureModule.SYSFOLDER_COVER)).getDataField(),
  32.                 new FileField(MOBILE_COVER_FILE, MeasureMessage.cover, MeasureModule.SYSFOLDER_COVER),
  33.                 new CheckFieldBuilder(new CheckField(IS_COLOR_INDICATION_MEASURE_END_DATE, MeasureMessage.is_color_indication_measure_end_date))
  34.                         .setScript(CheckExpressionBuilder.createExpressionForShowFields(COUNT_DAYS_BEFORE_MEASURE_END_DATE)).getDataField(),
  35.                 new IntegerField(COUNT_DAYS_BEFORE_MEASURE_END_DATE, MeasureMessage.count_days_before_measure_end_date),
  36.                 new StringField(OWNER_SCHEDULE, SystemMessages.empty).setIsHidden()
  37.         );
  38.  
  39.         //Дополнительные данные о мероприятии
  40.         DataObject attDataObject = new DataObject(ATT_DATANAME, MeasureMessage.attr_me, MeasureBean.class).setFields(
  41.                 new KeyField(ID),
  42.                 new IntegerField(MAX_EDU_LENGTH, MeasureMessage.max_edu_length),
  43.                 new ComboFieldBuilder(new ComboField(REGISTRATION, PersonMessage.registration, MeasureRegistrationType.getValues(true))).setScript(getRegistrationExpression()).getDataField(),
  44.                 new LookupField(REG_SCHEME_ID, MeasureMessage.registration_scheme, RegSchemeFrame.NAME, LookupField.SET_NULL),
  45.                 new IntegerField(CAPACITY, MeasureMessage.me_capacity),
  46.                 new LookupField(CA_ID, MeasureMessage.me_org, CAFrame.NAME, LookupField.SET_NULL),
  47.                 new ComboFieldBuilder(new ComboField(IS_MANUAL_RESULT, MeasureMessage.set_results, MeasureResultCalcType.class))
  48.                         .setScript(ComboBoxExpressionBuilder.createExpressionForShowFields(MeasureResultCalcType.AUTO.getValue(), AUTO_CHOOSING_RESULT_MEASURE)).getDataField(),
  49.                 new CheckField(IS_DEFAULT, VVMessage.is_default),
  50.                 //new SpecifiedTimeDateFieldBuilder(new DateTimeField(START_DATE_REG, MeasureMessage.start_date_reg)).getDataField(),
  51.                 new DateTimeField(START_DATE_REG, MeasureMessage.start_date_reg),
  52.                 //new SpecifiedTimeDateFieldBuilder(new DateTimeField(END_DATE_REG, MeasureMessage.end_date_reg)).getDataField(),
  53.                 new DateTimeField(END_DATE_REG, MeasureMessage.end_date_reg),
  54.                 new CheckFieldBuilder(new CheckField(IS_LIMIT_REG, MeasureMessage.is_limit_reg)).setScript(CheckExpressionBuilder.createExpressionForShowFields(AUTO_REGISTRATION_FROM_QUEUE)).getDataField(),
  55.                 new CheckField(IS_LIMIT_REQUEST, MeasureMessage.limit_request_number),
  56.                 new CheckField(MANAGER_REGISTRATION, MeasureMessage.allowed_registration_manager),
  57.                 new CheckFieldBuilder(new CheckField(ALLOW_MANAGER_EXCLUDE_MM, MeasureMessage.allow_manager_to_exclude_measure_member))
  58.                         .setScript(CheckExpressionBuilder.createExpressionForShowFields(ALLOW_MANAGER_EXCLUDE_MM_CONDITION, DAYS_BEFORE_MM_START_DATE_TO_ALLOW_MANAGER_EXCLUDE)).getDataField(),
  59.                 new ComboFieldBuilder(new ComboField(ALLOW_MANAGER_EXCLUDE_MM_CONDITION, MeasureMessage.allow_to_exclude, AllowManagerToExcludeMeasureMemberCondition.class))
  60.                         .setScript(ComboBoxExpressionBuilder.createExpressionForShowFields(
  61.                                 AllowManagerToExcludeMeasureMemberCondition.NOT_AFTER_N_DAYS_BEFORE_MM_START.getValue(), DAYS_BEFORE_MM_START_DATE_TO_ALLOW_MANAGER_EXCLUDE))
  62.                 .getDataField(),
  63.                 new IntegerField(DAYS_BEFORE_MM_START_DATE_TO_ALLOW_MANAGER_EXCLUDE, MeasureMessage.N_days_before_mm_start_date),
  64.                 new IntegerField(STANDART_EDU_LENGTH, MeasureMessage.standart_edu_length),
  65.                 new DurationFieldBuilder(new DurationField(HOURS, MeasureMessage.measure_volume)).getDataField(),
  66.                 new CheckField(IS_COMMENT, MeasureMessage.is_comment_mark),
  67.                 new CheckField(ALLOW_FINISH_NOT_PASSED, MeasureMessage.allowFinishNotPassed),
  68.                 new CheckField(ALLOW_SELF_FINISH, MeasureMessage.allowSelfFinish),
  69.                 new CheckField(ALLOW_EXECUTE_FINISHED, MeasureMessage.allowExecuteFinished),
  70.                 new CheckField(AUTOFINISH, MeasureMessage.autofinish),
  71.                 new IntegerField(MAX_SCORE, MeasureMessage.maxScore),
  72.                 new IntegerField(PASS_SCORE, MeasureMessage.passScore),
  73.                 new RadioComboFieldBuilder(new ComboField(QUA_APPOINT, MeasureMessage.quaAppoint, MEQuaAppoint.class)).getDataField(),
  74.                 new CheckField(AUTOFINISH_CONDITIONS, MeasureMessage.autofinishConditions),
  75.                 new CheckField(AUTOFINISH_INDIVIDUAL_END_DATE, MeasureMessage.autofinishIndividualEndDate),
  76.                 new CheckField(AUTOFINISH_MEASURE_END_DATE, MeasureMessage.autofinishMeasureEndDate),
  77.                 new CheckField(AUTOFINISH_LAST_ATTEMPT, MeasureMessage.autofinishLastAttempt),
  78.                 new CheckField(FINISH_ALL_COMPONENT, MeasureMessage.finishAllComponent),
  79.                 new CheckField(FINISH_COMPONENTS, MeasureMessage.finishComponents),
  80.                 new CheckField(AUTO_NOT_FINISH_START_DATE, MeasureMessage.autoNotFinishStartDate),
  81.                 new CheckField(AUTO_NOT_FINISH_CONDITIONS, MeasureMessage.autoNotFinishConditions),
  82.                 new CheckField(INCREASE_ATTEMPT_COUNT, MeasureMessage.increaseAttemptCount),
  83.                 new IntegerField(ATTEMPT_LIMIT, MeasureMessage.attemptLimit),
  84.                 new ComboField(SCORE_CALC_TYPE, MeasureMessage.scoreCalcType, SCOContentElementScoreCalcType.class),
  85.                 new IntegerField(TIME_BETWEEN_ATTEMPTS, MeasureMessage.timeBetweenAttempts),
  86.                 new LookupField(SCALE, MeasureMessage.scale, ScaleFrame.NAME, LookupField.SET_NULL),
  87.                 new LookupFieldBuilder(new LookupField(PASS_SCORE_SCALE, MeasureMessage.passScore, ScaleNumberFrame.NAME, LookupField.SET_NULL)).setChoosingParamsStateAttName(ChoosingState.CHOOSINGPARAMS).getDataField(),
  88.                 new ComboField(GROUP_REGISTRATION, PersonMessage.registration, MeasureGroupRegistrationType.class),
  89.                 Service.hasModule(PlanningModule.class) ?
  90.                         new LookupField(PLANNING_CA_ID, PlanningMessage.planning_org, CAFrame.NAME, LookupField.SET_NULL) : null,
  91.                 new CheckField(IS_WISH, MeasureMessage.block_wishes),
  92.                 new CheckField(RESULT_NEED_CHECK, MeasureMessage.resultNeedCheck),
  93.                 new CheckField(DISPLAY_SCHEDULE, MeasureMessage.display_schedule),
  94.                 new CheckField(AUTO_PRESENCE, MeasureMessage.autoPresence),
  95.                 new CheckField(CONSIDER_PASS_SCORE, MeasureMessage.considerPassScore),
  96.                 new CheckField(IS_SHOW_ATTEMPT_ANSWERS, TestMessage.showAttemptAnswers),
  97.                 new StringField(AVAILABLE_PLACES, MeasureMessage.remaining_availability).setIsHidden(),
  98.                 new StringField(CAPACITY_FOR_VIEW, QueryMessage.number_places).setIsHidden(),
  99.                 new RadioComboFieldBuilder(new ComboField(CLOSE_ACCESS_TYPE, MeasureMessage.close_access, CloseAccessType.class, CloseAccessType.MEMBER_DATE)).getDataField(),
  100.                 new CheckField(LAUNCH_ON_SELF_REGISTER, MeasureMessage.autoLaunchOnSelfRegister),
  101.                 new CheckField(ALLOW_REPEAT_SELF_REGISTER, MeasureMessage.allowRepeatSelfRegister),
  102.                 new CheckField(ALLOW_REPEAT_QUERY, MeasureMessage.allowRepeatQuery),
  103.                 Service.hasModule(DevelopmentModule.class) ?
  104.                         new CheckField(AUTO_CREATE_DEVELOPMENT_METHOD, DevelopmentMessage.auto_generate_recommendations) : null,
  105.                 new RadioComboFieldBuilder(new ComboField(LIMIT_REQUEST_BY_MAX, MeasureMessage.limit_number_requests_for_measure, MeasureRequestLimitType.class))
  106.                         .setScript(ComboBoxExpressionBuilder.createExpressionForShowFields(
  107.                                 CollectionUtils.newArrayList(MeasureRequestLimitType.by_organization.getValue(), MeasureRequestLimitType.by_initiator.getValue()), REQUEST_MAX))
  108.                         .getDataField(),
  109.                 new IntegerField(REQUEST_MAX, MeasureMessage.max_number_requests),
  110.                 new RadioComboFieldBuilder(new ComboField(SUBTYPE, MeasureMessage.subtype, MeasureScheduleSubtype.class)).getDataField(),
  111.                 new LookupField(TYPE_SUB_ME, MeasureMessage.type_measure, MeasureFrame.TYPE_NAME, LookupField.SET_NULL),
  112.                 new HTMLFieldBuilder(new StringField(NO_RESULTING_ME_WARN, MeasureMessage.noResultingMeasureLabel)).getDataField().setIsHidden(),
  113.                 new RSField(TARGET_GROUP, MeasureMessage.targetGroup, TargetGroupRubricator.TARGET_GROUP, RSField.SET_NULL),
  114.                 new CheckField(ALLOW_LEAVE_MEASURE, MeasureMessage.allowLeaveMeasure),
  115.                 new CheckField(ALLOW_CHANGE_RESULT_MEASURE, MeasureMessage.allowChangeResultMeasure),
  116.                 new RadioComboFieldBuilder(new ComboField(AUTO_CHOOSING_RESULT_MEASURE, MeasureMessage.autoChoosingResultMeasure, AutoChoosingResultMeasureType.class, AutoChoosingResultMeasureType.best)).getDataField(),
  117.                 new CheckField(USE_SCHEDULE_MEASURES_FILTER, MeasureMessage.use_schedule_measures_filter),
  118.                 new RadioComboFieldBuilder(new ComboField(VIEW_PUBLIC_MEMBER_LIST, MeasureMessage.allowViewPublicMemberList, ViewPublicMemberListType.class)).getDataField(),
  119.                 new CheckField(ALLOW_QUEUE, MeasureMessage.allowQueueWhenNoPlace),
  120.                 new CheckField(AUTO_REGISTRATION_FROM_QUEUE, MeasureMessage.autoRegistrationFromQueue)
  121.         );
  122.  
  123.         dataObject.addChildDataObject(attDataObject);
  124.  
  125.         //Дополнительные данные о программе
  126.         DataObject programmDataObject = new DataObject(PROGRAM_DATANAME, MeasureMessage.attr_program, MeasureBean.class).setFields(
  127.                 new KeyField(ID),
  128.                 new CheckField(IS_DYNAMIC_DATES, MeasureMessage.dinamic_change_dates),
  129.                 new ComboField(PROGRAM_CALC_TYPE, MeasureMessage.programCalcType, ProgramCalcType.class),
  130.                 new IntegerField(PASS_CONDITION_SCORE, MeasureMessage.passCondition),
  131.                 new ComboField(PASS_CONDITION_TYPE, MeasureMessage.passCondition, PassConditionType.class),
  132.                 new IntegerField(PASS_CONDITION_PERCENT, MeasureMessage.programPrcentageCompl)
  133.         );
  134.         attDataObject.addChildDataObject(programmDataObject);
  135.  
  136.  
  137.         //Описание мероприятия
  138.         DataObject descDataObject = new DataObject(DESC_DATANAME, MeasureMessage.me_desc, MeasureBean.class).setFields(
  139.                 new KeyField(ID),
  140.                 new HTMLFieldBuilder(new ClobField(DESCRIPTION, SystemMessages.desc, 100000)).getDataField(),
  141.                 new ComboFieldBuilder(new ComboField(COST_TYPE, MeasureMessage.cost_type, MeasureCostType.class)).setScript(getCostTypeExpression()).getDataField(),
  142.                 getCostField(MeasureMessage.overall_cost, COST_WITH_COINS_COMBINED, COST_WITH_COINS, COST_WITH_COINS_CURR),
  143.                 new RSField(COST_SCHEME, MeasureMessage.appraisement_scheme, MeasureAppraisementSchemeRubricator.MEASURE_APPRAISEMENT, LookupField.SET_NULL),
  144.                 getCostField(MeasureMessage.legal_cost, LEGAL_COST_WITH_COINS_COMBINED, LEGAL_COST_WITH_COINS, LEGAL_COST_WITH_COINS_CURR),
  145.                 getCostField(MeasureMessage.phis_cost, PHIS_COST_WITH_COINS_COMBINED, PHIS_COST_WITH_COINS, PHIS_COST_WITH_COINS_CURR),
  146.                 new LookupField(APPRAISEMENT_SCHEME, MeasureMessage.appraisement_scheme, MeasureAppraisementSchemeRubricator.MEASURE_APPRAISEMENT, LookupField.SET_NULL),
  147.                 new LookupField(SCHEME_ID, MeasureMessage.overall_edu_scheme, SchemeVariantFrame.NAME, LookupField.RESTRICT),
  148.                 new LookupField(LEGAL_SCHEME_ID, MeasureMessage.legal_edu_scheme, SchemeVariantFrame.NAME, LookupField.RESTRICT),
  149.                 new LookupField(PHIS_SCHEME_ID, MeasureMessage.phis_edu_scheme, SchemeVariantFrame.NAME, LookupField.RESTRICT),
  150.                 new CheckField(IS_SHOW_SCHEDULE, MeasureMessage.show_schedule),
  151.                 new LookupField(AS_ID, MeasureMessage.access_scheme, ASchemeFrame.NAME),
  152.                 Service.hasModule(RouteModule.class) ?
  153.                         new LookupField(RO_ID, MeasureMessage.route, RouteFrame.NAME) : null,
  154.                 new HTMLFieldBuilder(new ClobField(EXPLANATION, MeasureMessage.explanation, 100000)).getDataField(),
  155.                 new IntegerField(DAYS_OPEN_ACCESS_REQUEST_CONFIRM, QueryMessage.days_open_request_access),
  156.                 new RadioComboFieldBuilder(new ComboField(REQUEST_CONFIRM_ACCESS, QueryMessage.access_confirmation_request, RequestConfirmationAccess.class)).getDataField(),
  157.                 new CheckField(AUTO_REGISTER_AFTER_CONF_QUERY, MeasureMessage.auto_register_after_conf_query_if_free),
  158.                 new CheckFieldBuilder(new CheckField(IS_PARTICIPATION_CONFIRM, MeasureMessage.ask_confirmation_participation))
  159.                         .setScript(CheckExpressionBuilder.createExpressionForShowFields(DAYS_PARTICIPATION_CONFIRM)).getDataField(),
  160.                 new IntegerField(DAYS_PARTICIPATION_CONFIRM, MeasureMessage.days_participation_confirmation),
  161.                 new RadioComboFieldBuilder(new ComboField(TEST_OPEN_FORMAT, MeasureMessage.format_test_opening, OpenContentFormat.getTestValues(), OpenContentFormat.new_window_without_tree))
  162.                         .getDataField(),
  163.                 new IntegerField(TEST_WIDTH, ContentMessage.width),
  164.                 new IntegerField(TEST_HEIGHT, ContentMessage.height),
  165.                 new CheckFieldBuilder(new CheckField(ALLOW_CHANGE_CONFIRMATION_STATUS, MeasureMessage.allowChangeConfirmationStatus)).setScript(CheckExpressionBuilder.createExpressionForShowFields(DAYS_CHANGE_CONFIRMATION_STATUS)).getDataField(),
  166.                 new IntegerField(DAYS_CHANGE_CONFIRMATION_STATUS, MeasureMessage.daysChangeConfirmationStatus),
  167.                 new CheckFieldBuilder(new CheckField(ASK_REFUSAL_REASON, MeasureMessage.askRefusalReason)).setScript(CheckExpressionBuilder.createExpressionForShowFields(REFUSAL_REASONS)).getDataField()
  168.                 );
  169.         programmDataObject.addChildDataObject(descDataObject);
  170.  
  171.         //Практическое упражнение
  172.         DataObject ptDataObject = new DataObject(PT_DATANAME, MeasureMessage.practice_template, MeasureBean.class).setFields(
  173.                 new KeyField(ID),
  174.                 new IntegerField(CHECK_DAYS, MeasureMessage.check_days),
  175.                 new CheckField(DISTRIBUTE_ON_REG, MeasureMessage.distributeOnReg)
  176.         );
  177.         descDataObject.addChildDataObject(ptDataObject);
  178.         dataObject.addChildDataObject(MEDefaultRegistrationSettingsBean.createDataObject());
  179.         dataObject.addChildDataObject(MeasureScheduleRegBean.createDataObject());
  180.         return dataObject;
  181.     }
RAW Paste Data
Top