def get_comment_form_for_create(self, reference_id, comment_record_types):
        """Gets the comment form for creating new comments.

        A new form should be requested for each create transaction.

        arg:    reference_id (osid.id.Id): the ``Id`` for the reference
                object
        arg:    comment_record_types (osid.type.Type[]): array of
                comment record types
        return: (osid.commenting.CommentForm) - the comment form
        raise:  NullArgument - ``reference_id or comment_record_types``
                is ``null``
        raise:  OperationFailed - unable to complete request
        raise:  PermissionDenied - authorization failure
        raise:  Unsupported - unable to get form for requested record
                types
        *compliance: mandatory -- This method must be implemented.*

        """
        # Implemented from template for
        # osid.relationship.CommentAdminSession.get_comment_form_for_create_template
        # These really need to be in module imports:
        if not isinstance(reference_id, ABCId):
            raise errors.InvalidArgument('argument is not a valid OSID Id')
        for arg in comment_record_types:
            if not isinstance(arg, ABCType):
                raise errors.InvalidArgument('one or more argument array elements is not a valid OSID Type')
        if comment_record_types == []:
            # WHY are we passing book_id = self._catalog_id below, seems redundant:
            # Probably don't need to send effective_agent_id, since the form can get that from proxy.
            obj_form = objects.CommentForm(
                book_id=self._catalog_id,
                reference_id=reference_id,
                effective_agent_id=str(self.get_effective_agent_id()),
                catalog_id=self._catalog_id,
                runtime=self._runtime,
                proxy=self._proxy)
        else:
            obj_form = objects.CommentForm(
                book_id=self._catalog_id,
                record_types=comment_record_types,
                reference_id=reference_id,
                effective_agent_id=self.get_effective_agent_id(),
                catalog_id=self._catalog_id,
                runtime=self._runtime,
                proxy=self._proxy)
        obj_form._for_update = False
        self._forms[obj_form.get_id().get_identifier()] = not CREATED
        return obj_form
def get_comment_form_for_create ( self , reference_id , comment_record_types ) : if not isinstance ( reference_id , ABCId ) : raise errors . InvalidArgument ( 'argument is not a valid OSID Id' ) for arg in comment_record_types : if not isinstance ( arg , ABCType ) : raise errors . InvalidArgument ( 'one or more argument array elements is not a valid OSID Type' ) if comment_record_types == [ ] : obj_form = objects . CommentForm ( book_id = self . _catalog_id , reference_id = reference_id , effective_agent_id = str ( self . get_effective_agent_id ( ) ) , catalog_id = self . _catalog_id , runtime = self . _runtime , proxy = self . _proxy ) else : obj_form = objects . CommentForm ( book_id = self . _catalog_id , record_types = comment_record_types , reference_id = reference_id , effective_agent_id = self . get_effective_agent_id ( ) , catalog_id = self . _catalog_id , runtime = self . _runtime , proxy = self . _proxy ) obj_form . _for_update = False self . _forms [ obj_form . get_id ( ) . get_identifier ( ) ] = not CREATED return obj_form
Gets the comment form for creating new comments.

        A new form should be requested for each create transaction.

        arg:    reference_id (osid.id.Id): the ``Id`` for the reference
                object
        arg:    comment_record_types (osid.type.Type[]): array of
                comment record types
        return: (osid.commenting.CommentForm) - the comment form
        raise:  NullArgument - ``reference_id or comment_record_types``
                is ``null``
        raise:  OperationFailed - unable to complete request
        raise:  PermissionDenied - authorization failure
        raise:  Unsupported - unable to get form for requested record
                types
        *compliance: mandatory -- This method must be implemented.*