def add_attachment_viewer_widget(self, attachment_property, custom_title=False, height=None):
        """
        Add a KE-chain Attachment Viewer (e.g. attachment viewer widget) to the customization.

        The widget will be saved to KE-chain.

        :param attachment_property: The Attachment Property to which the Viewer will be connected to.
        :type attachment_property: :class:`Property` or UUID
        :param custom_title: A custom title for the attachment viewer widget
            * False (default): Notebook name
            * String value: Custom title
            * None: No title
        :type custom_title: bool or basestring or None
        :param height: The height of the Notebook in pixels
        :type height: int or None
        :raises IllegalArgumentError: When unknown or illegal arguments are passed.
        """
        # Check whether the attachment property is uuid type or class `Property`
        if isinstance(attachment_property, Property):
            attachment_property_id = attachment_property.id
        elif isinstance(attachment_property, text_type) and is_uuid(attachment_property):
            attachment_property_id = attachment_property
            attachment_property = self._client.property(id=attachment_property_id)
        else:
            raise IllegalArgumentError("When using the add_attachment_viewer_widget, attachment_property must be a "
                                       "Property or Property id. Type is: {}".format(type(attachment_property)))

        # Check whether the `Property` has type `Attachment`
        property_type = attachment_property.type
        if property_type != PropertyType.ATTACHMENT_VALUE:
            raise IllegalArgumentError("When using the add_attachment_viewer_widget, attachment_property must have "
                                       "type {}. Type found: {}".format(PropertyType.ATTACHMENT_VALUE, property_type))

        # Check also whether `Property` has category `Instance`
        property_category = attachment_property._json_data['category']
        if property_category != Category.INSTANCE:
            raise IllegalArgumentError("When using the add_attachment_viewer_widget, attachment_property must have "
                                       "category {}. Category found: {}".format(Category.INSTANCE, property_category))

        # Add custom title
        if custom_title is False:
            show_title_value = "Default"
            title = attachment_property.name
        elif custom_title is None:
            show_title_value = "No title"
            title = ''
        else:
            show_title_value = "Custom title"
            title = str(custom_title)

        # Declare attachment viewer widget config
        config = {
            'propertyId': attachment_property_id,
            'showTitleValue': show_title_value,
            'xtype': ComponentXType.PROPERTYATTACHMENTPREVIEWER,
            'title': title,
            'filter': {
                'activity_id': str(self.activity.id)
            },
            'height': height if height else 500
        }

        # Declare attachment viewer widget meta
        meta = {
            'propertyInstanceId': attachment_property_id,
            'activityId': str(self.activity.id),
            'customHeight': height if height else 500,
            'showTitleValue': show_title_value,
            'customTitle': title
        }

        self._add_widget(dict(config=config, meta=meta, name=WidgetNames.ATTACHMENTVIEWERWIDGET))
def add_attachment_viewer_widget ( self , attachment_property , custom_title = False , height = None ) : if isinstance ( attachment_property , Property ) : attachment_property_id = attachment_property . id elif isinstance ( attachment_property , text_type ) and is_uuid ( attachment_property ) : attachment_property_id = attachment_property attachment_property = self . _client . property ( id = attachment_property_id ) else : raise IllegalArgumentError ( "When using the add_attachment_viewer_widget, attachment_property must be a " "Property or Property id. Type is: {}" . format ( type ( attachment_property ) ) ) property_type = attachment_property . type if property_type != PropertyType . ATTACHMENT_VALUE : raise IllegalArgumentError ( "When using the add_attachment_viewer_widget, attachment_property must have " "type {}. Type found: {}" . format ( PropertyType . ATTACHMENT_VALUE , property_type ) ) property_category = attachment_property . _json_data [ 'category' ] if property_category != Category . INSTANCE : raise IllegalArgumentError ( "When using the add_attachment_viewer_widget, attachment_property must have " "category {}. Category found: {}" . format ( Category . INSTANCE , property_category ) ) if custom_title is False : show_title_value = "Default" title = attachment_property . name elif custom_title is None : show_title_value = "No title" title = '' else : show_title_value = "Custom title" title = str ( custom_title ) config = { 'propertyId' : attachment_property_id , 'showTitleValue' : show_title_value , 'xtype' : ComponentXType . PROPERTYATTACHMENTPREVIEWER , 'title' : title , 'filter' : { 'activity_id' : str ( self . activity . id ) } , 'height' : height if height else 500 } meta = { 'propertyInstanceId' : attachment_property_id , 'activityId' : str ( self . activity . id ) , 'customHeight' : height if height else 500 , 'showTitleValue' : show_title_value , 'customTitle' : title } self . _add_widget ( dict ( config = config , meta = meta , name = WidgetNames . ATTACHMENTVIEWERWIDGET ) )
Add a KE-chain Attachment Viewer (e.g. attachment viewer widget) to the customization.

        The widget will be saved to KE-chain.

        :param attachment_property: The Attachment Property to which the Viewer will be connected to.
        :type attachment_property: :class:`Property` or UUID
        :param custom_title: A custom title for the attachment viewer widget
            * False (default): Notebook name
            * String value: Custom title
            * None: No title
        :type custom_title: bool or basestring or None
        :param height: The height of the Notebook in pixels
        :type height: int or None
        :raises IllegalArgumentError: When unknown or illegal arguments are passed.