# Using the standard File and Image types for attachments is problematic,
# because they gain their own workflows and become searchable as standard.
# Instead, provide simple custom versions here

from Products.ATContentTypes.content.file import ATFile
from Products.ATContentTypes.content.image import ATImage

try:
  from Products.LinguaPlone.public import *
except ImportError:
  # No multilingual support
  from Products.Archetypes.public import *

class FileAttachment(ATFile):
    """A file attachment"""
    portal_type = meta_type = 'FileAttachment'
    archetype_name = 'File attachment'
    content_icon = 'file_icon.gif'
    typeDescription= 'A file attached to a document'
    typeDescMsgId  = 'FileAttachment_description_edit'
    global_allow = 0

    default_view = 'fileattachment_view'
    immediate_view = 'fileattachment_view'
    suppl_views = ()

    __implements__ = ATFile.__implements__
    actions = ATFile.actions

registerType(FileAttachment)

class ImageAttachment(ATImage):
    """An image attachment"""
    portal_type = meta_type = 'ImageAttachment'
    archetype_name = 'Image attachment'
    content_icon = 'image_icon.gif'
    typeDescription= 'An image attached to a document'
    typeDescMsgId  = 'ImageAttachment_description_edit'
    global_allow = 0

    default_view = 'imageattachment_view'
    immediate_view = 'imageattachment_view'
    suppl_views = ()

    __implements__ = ATImage.__implements__
    actions = ATImage.actions

registerType(ImageAttachment)