コード例 #1
0
    def generate_suite(self):
        # Note: the order in which things happen in this function matters

        self._add_sections([
            FormResourceContributor(self.suite, self.app, self.modules,
                                    self.build_profile_id),
            LocaleResourceContributor(self.suite, self.app, self.modules,
                                      self.build_profile_id),
            DetailContributor(self.suite, self.app, self.modules,
                              self.build_profile_id),
        ])

        if self.app.supports_practice_users and self.app.get_practice_user(
                self.build_profile_id):
            self._add_sections([
                PracticeUserRestoreContributor(self.suite, self.app,
                                               self.modules,
                                               self.build_profile_id)
            ])

        # by module
        entries = EntriesContributor(self.suite, self.app, self.modules,
                                     self.build_profile_id)
        menus = MenuContributor(self.suite, self.app, self.modules,
                                self.build_profile_id)
        remote_requests = RemoteRequestContributor(self.suite, self.app,
                                                   self.modules)

        if any(module.is_training_module for module in self.modules):
            training_menu = LocalizedMenu(id='training-root')
            training_menu.text = Text(
                locale_id=id_strings.training_module_locale())
        else:
            training_menu = None

        for module in self.modules:
            self.suite.entries.extend(entries.get_module_contributions(module))

            self.suite.menus.extend(
                menus.get_module_contributions(module, training_menu))

            self.suite.remote_requests.extend(
                remote_requests.get_module_contributions(module))

        if training_menu:
            self.suite.menus.append(training_menu)

        self._add_sections([
            FixtureContributor(self.suite, self.app, self.modules),
            SchedulerFixtureContributor(self.suite, self.app, self.modules),
        ])

        # post process
        if self.app.enable_post_form_workflow:
            WorkflowHelper(self.suite, self.app, self.modules).update_suite()
        if self.app.use_grid_menus:
            GridMenuHelper(self.suite, self.app, self.modules).update_suite()

        EntryInstances(self.suite, self.app, self.modules).update_suite()
        return self.suite.serializeDocument(pretty=True)
コード例 #2
0
    def _make_session_endpoint(self, id_string, module, endpoint_id):
        stack = Stack()
        frame = PushFrame()
        stack.add_frame(frame)
        frame.add_command(XPath.string(id_string))
        arguments = []
        helper = WorkflowHelper(self.suite, self.app, self.modules)
        for child in helper.get_frame_children(id_string, module):
            if isinstance(child, WorkflowDatumMeta):
                arguments.append(Argument(id=child.id))
                frame.add_datum(StackDatum(id=child.id, value=f"${child.id}"))

        return SessionEndpoint(
            id=endpoint_id,
            arguments=arguments,
            stack=stack,
        )
コード例 #3
0
    def generate_suite(self):
        # Note: the order in which things happen in this function matters

        self._add_sections([
            FormResourceContributor(self.suite, self.app, self.modules,
                                    self.build_profile_id),
            LocaleResourceContributor(self.suite, self.app, self.modules,
                                      self.build_profile_id),
            DetailContributor(self.suite, self.app, self.modules,
                              self.build_profile_id),
        ])

        # by module
        entries = EntriesContributor(self.suite, self.app, self.modules)
        menus = MenuContributor(self.suite, self.app, self.modules)
        careplan_menus = CareplanMenuContributor(self.suite, self.app,
                                                 self.modules)
        remote_requests = RemoteRequestContributor(self.suite, self.app,
                                                   self.modules)
        for module in self.modules:
            self.suite.entries.extend(entries.get_module_contributions(module))

            self.suite.menus.extend(
                careplan_menus.get_module_contributions(module))
            self.suite.menus.extend(menus.get_module_contributions(module))

            self.suite.remote_requests.extend(
                remote_requests.get_module_contributions(module))

        self._add_sections([
            FixtureContributor(self.suite, self.app, self.modules),
            SchedulerFixtureContributor(self.suite, self.app, self.modules),
        ])

        # post process
        if self.app.enable_post_form_workflow:
            WorkflowHelper(self.suite, self.app, self.modules).update_suite()
        if self.app.grid_menu_toggle_enabled() and self.app.use_grid_menus:
            GridMenuHelper(self.suite, self.app, self.modules).update_suite()

        EntryInstances(self.suite, self.app, self.modules).update_suite()
        return self.suite.serializeDocument(pretty=True)
コード例 #4
0
 def get_frame_children(self, module, form):
     helper = WorkflowHelper(self.suite, self.app, self.app.get_modules())
     frame_children = helper.get_frame_children(module, form)
     if module.root_module_id:
         frame_children = prepend_parent_frame_children(helper, frame_children, module.root_module)
     return frame_children