[CMF-checkins] CVS: CMF - INSTALLATION.txt:1.1 MsExcelFile.py:1.1 MsPowerPointFile.py:1.1 MsWordFile.py:1.1 __init__.py:1.1 wvHtml.xml:1.1 wvText.xml:1.1

jack@digicool.com jack@digicool.com
Wed, 30 May 2001 09:58:00 -0400 (EDT)


Update of /cvs-repository/Packages/Products/DCProject/CMF_MS_Files
In directory korak.digicool.com:/tmp/cvs-serv12009

Added Files:
	INSTALLATION.txt MsExcelFile.py MsPowerPointFile.py 
	MsWordFile.py __init__.py wvHtml.xml wvText.xml 
Log Message:
Adding CMF_MS_Files Product



--- Added File INSTALLATION.txt in package Packages/Products/DCProject ---
Follow these steps to install the CMF_MS_Files Product;

	1: Untar the package.

	2: cd CMF_MS_Files/src/libole

	3: python setup.py build

	4: In the 'build' directory will be two temporary directories.
            and in one of them will be a file called 'libole.so'.
            Move the 'libole.so' file to the 'CMF_MS_Files' directory.

	5: Load and install the latest version of wv from 
		http://sourceforge.net/projects/wvware/

	6: Set up the following two Environment Variables:

		WV_WARE_LOCATION - this should be the directory that 'wvWare' is found, 'wvWare' is an executable.
		WV_WARE_XML_FILES - this should be the directory that 'wvHtml.xml' and 'wvText.xml' are located.

You can restart Zope now.


--- Added File MsExcelFile.py in package Packages/Products/DCProject ---
# MsExcelFile.py
# John Platten
# 03.06.01
  
"""
"""

ADD_CONTENT_PERMISSION = 'Add portal content'

OLE_DEBUG = 1

from Globals import HTMLFile, HTML
from Products.CMFCore.PortalContent import PortalContent
from Products.CMFDefault.Discussions import Discussable
import Globals
from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl

from Products.CMFCore import CMFCorePermissions
from Products.CMFCore.WorkflowCore import WorkflowAction, afterCreate


import OFS.Image

import os
import tempfile

def addMsExcelFile( self
           , id
           , title=''
           , file=''
           , content_type=''
           , precondition=''
           , subject=()
           , description=''
           , contributors=()
           , effective_date=None
           , expiration_date=None
           , format='text/html'
           , language='en-US'
           , rights=''
           ):
    """
    Add a Microsoft Word Document
    """

    # cookId sets the id and title if they are not explicity specified
    id, title = OFS.Image.cookId(id, title, file)

    self=self.this()  # Why?

    # Instantiate the object and set it's description.
    # The description is not set by the constructor because I didn't
    # want to extend File's constructor.  Perhaps I should.
    fobj = MsExcelFile( id, title, '', content_type, precondition, subject
               , description, contributors, effective_date, expiration_date
               , format, language, rights
               )
    
    # Add the File instance to self
    self._setObject(id, fobj)

    # 'Upload' the file.  This is done now rather than in the
    # constructor because it's faster.  Why is it faster?
    self._getOb(id).manage_upload(file)

    afterCreate(self._getOb(id))

    """
    if RESPONSE is not None:
        RESPONSE.redirect(self.absolute_url()+'/folder_contents')
    """
        
class MsExcelFile( OFS.Image.File
          , PortalContent
          , DefaultDublinCoreImpl
          ):
    """
        A Portal-managed File
    """

    # The order of base classes is very significant in this case.
    # Image.File does not store it's id in it's 'id' attribute.
    # Rather, it has an 'id' method which returns the contents of the
    # instnace's __name__ attribute.  Inheriting in the other order
    # obscures this method, resulting in much pulling of hair and
    # gnashing of teeth and fraying of nerves.  Don't do it.
    #
    # Really.
    
    meta_type='MsExcelFile'
    effective_date = expiration_date = None
    _isDiscussable = 1
    icon = PortalContent.icon

    __ac_permissions__ = (
        (CMFCorePermissions.View, ('',)),
        (CMFCorePermissions.ModifyPortalContent, ('edit',)),
        )    
                             
    def __init__( self
                , id
                , title=''
                , file=''
                , content_type=''
                , precondition=''
                , subject=()
                , description=''
                , contributors=()
                , effective_date=None
                , expiration_date=None
                , format='text/html'
                , language='en-US'
                , rights=''
                ):
        OFS.Image.File.__init__( self, id, title, file
                               , content_type, precondition )
        DefaultDublinCoreImpl.__init__( self, title, subject, description
                               , contributors, effective_date, expiration_date
                               , format, language, rights )
    
    def SearchableText(self):
        """
        SeachableText is used for full text seraches of a portal.  It
        should return a concatanation of all useful text.
        """
        if OLE_DEBUG: print ":MsExcelFile:SearchableText:"
        val = ""
        #try:
        #    fnameDoc = tempfile.mktemp()
        #    if OLE_DEBUG: print ":MsExcelFile:SearchableText:fnameDoc:", fnameDoc

        #    fnameTxt = tempfile.mktemp()
        #    if OLE_DEBUG: print ":MsExcelFile:SearchableText:fnameTxt:", fnameTxt

        #    f = open(fnameDoc,"wb")
        #    f.write(str(self.data))
        #    f.close()

        #    command = "./lib/python/Products/CMF_MS_Files/wvWare -x ./lib/python/Products/CMF_MS_Files/wvText.xml " + fnameDoc + " > " + fnameTxt
        #    if OLE_DEBUG: print ":MsExcelFile:SearchableText:command:", command
            
        #    err = os.system(command)
        #    if OLE_DEBUG: print ":MsExcelFile:SearchableText:err:", err

        #    f = open(fnameTxt,"rb")
        #    val = f.read()
        #    f.close()

        #    os.remove(fnameDoc)
        #    os.remove(fnameTxt)

        #except:
        #    val = ""
        #    if OLE_DEBUG: print ":MsExcelFile:SearchableText:ExceptionHandler:val:", val
        #    pass

        return "%s %s %s" % (self.title, self.description, val)

    #--------------------------------------------------------------------------#
    def listActions(self, info):
    #--------------------------------------------------------------------------#

        content_url = info.content_url
        return ( 
                   { 'name'         : 'Edit'
                   , 'url'          :  content_url + '/editForm'
                   , 'permissions'  : ( 'Modify portal content', )
                   , 'category'     : 'object'
                   },
                   { 'name'         : 'Metadata'
                   , 'url'          :  content_url + '/metadata_edit_form'
                   , 'permissions'  : ( 'Modify portal content', )
                   , 'category'     : 'object'
                   },
                   { 'name'         : 'Download'
                   , 'url'          :  content_url + '/download'
                   , 'permissions'  : ( 'View', )
                   , 'category'     : 'object'
                   },
                   { 'name'         : 'View statistics'
                   , 'url'          :  content_url + '/view'
                   , 'permissions'  : ( 'View', )
                   , 'category'     : 'object'
                   },
               )

    def manage_afterAdd(self, item, container):
        """Both of my parents have an afterAdd method"""
        OFS.Image.File.manage_afterAdd(self, item, container)
        PortalContent.manage_afterAdd(self, item, container)

    def manage_beforeDelete(self, item, container):
        """Both of my parents have a beforeDelete method"""
        PortalContent.manage_beforeDelete(self, item, container)
        OFS.Image.File.manage_beforeDelete(self, item, container)

    def edit(self, precondition='', file=''):
        """
        Perform changes for user
        """
        if precondition: self.precondition = precondition
        elif self.precondition: del self.precondition

        if file.filename != '' and file.read() != '':
            self.manage_upload(file)

        self.setFormat(self.content_type)
        #self.reindexObject()

    edit = WorkflowAction(edit)

    def download(self, REQUEST, RESPONSE):
        """
        Download this item.  Calls OFS.Image.File.index_html to perform the
        actual transfer after first setting Content-Disposition to suggest
        a filename.
        """

        RESPONSE.setHeader('Content-Disposition',
                           'attachment; filename="%s"' % self.id())
        return OFS.Image.File.index_html(self, REQUEST, RESPONSE)

    editForm = HTMLFile('dtml/msOfficeFileEdit', globals())
    #viewHTMLForm = HTMLFile('dtml/msOfficeFileViewHTML', globals())
    view = HTMLFile('dtml/msOfficeFileView', globals())

    index_html = view
    #index_html = download

    #--------------------------------------------------------------------------#
    #def viewHTML(self):
    #--------------------------------------------------------------------------#
    #    fnameDoc = tempfile.mktemp()
    #    fnameHtml = tempfile.mktemp()
    #    f = open(fnameDoc,"wb")
    #    f.write(str(self.data))
    #    f.close()
    #    os.system("./lib/python/Products/CMF_MS_Files/wvWare -x ./lib/python/Products/CMF_MS_Files/wvHtml.xml " + fnameDoc + " > " + fnameHtml)
    #    f = open(fnameHtml,"rb")
    #    val = f.read()
    #    f.close()
    #    os.remove(fnameDoc)
    #    os.remove(fnameHtml)
    #    return val

##    def __call__(self, REQUEST, **kw):
##        return apply(self.view, (self, REQUEST), kw)

    #--------------------------------------------------------------------------#
    def PUT(self, REQUEST, RESPONSE):
    #--------------------------------------------------------------------------#
        """Handle HTTP(and presumably FTP?)PUT requests"""
        
        try:
            self.dav__init(REQUEST, RESPONSE)

            headers = {}
            for k, v in self.getMetadataHeaders():
                headers[k] = v

            if OLE_DEBUG: print "\n"
            if OLE_DEBUG: print "\n:BEFORE:\n"

            keys = headers.keys()
            keys.sort()
            for i in keys:
                if OLE_DEBUG: print "headers[", i, "]:", headers[i]
                continue
            
            body = REQUEST.get('BODY', '')

            import string
            if OLE_DEBUG: print "self.__name__:", self.__name__
            found = string.find(self.__name__, '~')

            sniffFmt, enc = OFS.content_types.guess_content_type(self.__name__, body)
            format = REQUEST.get_header('content-type', sniffFmt)
            if OLE_DEBUG: print "format:", format
            headers['Format'] = format
            
            if headers['Format'] in ( 'application/vnd.ms-excel',):
                try:
                    from Products.CMF_MS_Files.pylibole2 import getHeaders
                                        
                    headers = getHeaders(body, headers)

                    if OLE_DEBUG: print "\n"
                    if OLE_DEBUG: print "\n:AFTER:\n"

                    keys = headers.keys()
                    keys.sort()
                    for i in keys:
                        if OLE_DEBUG: print "headers[", i, "]:", headers[i]
                        continue
                    
                except:
                    if OLE_DEBUG: print "\n:ERROR:pylibole2.getHeaders(body):FAILED:\n"
                    pass

            #import pdb; pdb.set_trace()
            
            self.editMetadata( contributors = headers['Contributors']
                             , description = headers['Description']
                             , effective_date = headers['Effective_date']
                             , expiration_date = headers['Expiration_date']
                             , format = headers['Format']
                             , language = headers['Language']
                             , rights = headers['Rights']
                             , subject = headers['Subject']
                             , title = headers['Title']
                             )
            
            self.manage_upload(body)
            self.reindexObject()

            RESPONSE.setStatus(204)
            return RESPONSE
            
        except:
            import traceback
            traceback.print_exc()
            raise

Globals.default__class_init__(MsExcelFile)

from Products.CMFCore.register import registerPortalContent
registerPortalContent(MsExcelFile,                    # The class to be registered
                      constructors=(addMsExcelFile,), # It's factory (constructor)
                      action='Wizards/MsExcelFile',   # The URL of it's add interface
                      icon="MsExcelFile.gif",         # Filename to take icon from
                      productGlobals=globals())

--- Added File MsPowerPointFile.py in package Packages/Products/DCProject ---
# MsPowerPointFile.py
# John Platten
# 03.06.01
  
"""
"""

ADD_CONTENT_PERMISSION = 'Add portal content'

OLE_DEBUG = 1

from Globals import HTMLFile, HTML
from Products.CMFCore.PortalContent import PortalContent
from Products.CMFDefault.Discussions import Discussable
import Globals
from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl

from Products.CMFCore import CMFCorePermissions
from Products.CMFCore.WorkflowCore import WorkflowAction, afterCreate


import OFS.Image

import os
import tempfile

def addMsPowerPointFile( self
           , id
           , title=''
           , file=''
           , content_type=''
           , precondition=''
           , subject=()
           , description=''
           , contributors=()
           , effective_date=None
           , expiration_date=None
           , format='text/html'
           , language='en-US'
           , rights=''
           ):
    """
    Add a Microsoft Word Document
    """

    # cookId sets the id and title if they are not explicity specified
    id, title = OFS.Image.cookId(id, title, file)

    self=self.this()  # Why?

    # Instantiate the object and set it's description.
    # The description is not set by the constructor because I didn't
    # want to extend File's constructor.  Perhaps I should.
    fobj = MsPowerPointFile( id, title, '', content_type, precondition, subject
               , description, contributors, effective_date, expiration_date
               , format, language, rights
               )
    
    # Add the File instance to self
    self._setObject(id, fobj)

    # 'Upload' the file.  This is done now rather than in the
    # constructor because it's faster.  Why is it faster?
    self._getOb(id).manage_upload(file)

    afterCreate(self._getOb(id))

    """
    if RESPONSE is not None:
        RESPONSE.redirect(self.absolute_url()+'/folder_contents')
    """
        
class MsPowerPointFile( OFS.Image.File
          , PortalContent
          , DefaultDublinCoreImpl
          ):
    """
        A Portal-managed File
    """

    # The order of base classes is very significant in this case.
    # Image.File does not store it's id in it's 'id' attribute.
    # Rather, it has an 'id' method which returns the contents of the
    # instnace's __name__ attribute.  Inheriting in the other order
    # obscures this method, resulting in much pulling of hair and
    # gnashing of teeth and fraying of nerves.  Don't do it.
    #
    # Really.
    
    meta_type='MsPowerPointFile'
    effective_date = expiration_date = None
    _isDiscussable = 1
    icon = PortalContent.icon

    __ac_permissions__ = (
        (CMFCorePermissions.View, ('',)),
        (CMFCorePermissions.ModifyPortalContent, ('edit',)),
        )    
                             
    def __init__( self
                , id
                , title=''
                , file=''
                , content_type=''
                , precondition=''
                , subject=()
                , description=''
                , contributors=()
                , effective_date=None
                , expiration_date=None
                , format='text/html'
                , language='en-US'
                , rights=''
                ):
        OFS.Image.File.__init__( self, id, title, file
                               , content_type, precondition )
        DefaultDublinCoreImpl.__init__( self, title, subject, description
                               , contributors, effective_date, expiration_date
                               , format, language, rights )
    
    def SearchableText(self):
        """
        SeachableText is used for full text seraches of a portal.  It
        should return a concatanation of all useful text.
        """
        if OLE_DEBUG: print ":MsPowerPointFile:SearchableText:"
        val = ""
        #try:
        #    fnameDoc = tempfile.mktemp()
        #    if OLE_DEBUG: print ":MsPowerPointFile:SearchableText:fnameDoc:", fnameDoc

        #    fnameTxt = tempfile.mktemp()
        #    if OLE_DEBUG: print ":MsPowerPointFile:SearchableText:fnameTxt:", fnameTxt

        #    f = open(fnameDoc,"wb")
        #    f.write(str(self.data))
        #    f.close()

        #    command = "./lib/python/Products/CMF_MS_Files/wvWare -x ./lib/python/Products/CMF_MS_Files/wvText.xml " + fnameDoc + " > " + fnameTxt
        #    if OLE_DEBUG: print ":MsPowerPointFile:SearchableText:command:", command
            
        #    err = os.system(command)
        #    if OLE_DEBUG: print ":MsPowerPointFile:SearchableText:err:", err

        #    f = open(fnameTxt,"rb")
        #    val = f.read()
        #    f.close()

        #    os.remove(fnameDoc)
        #    os.remove(fnameTxt)

        #except:
        #    val = ""
        #    if OLE_DEBUG: print ":MsPowerPointFile:SearchableText:ExceptionHandler:val:", val
        #    pass

        return "%s %s %s" % (self.title, self.description, val)

    #--------------------------------------------------------------------------#
    def listActions(self, info):
    #--------------------------------------------------------------------------#

        content_url = info.content_url
        return ( 
                   { 'name'         : 'Edit'
                   , 'url'          :  content_url + '/editForm'
                   , 'permissions'  : ( 'Modify portal content', )
                   , 'category'     : 'object'
                   },
                   { 'name'         : 'Metadata'
                   , 'url'          :  content_url + '/metadata_edit_form'
                   , 'permissions'  : ( 'Modify portal content', )
                   , 'category'     : 'object'
                   },
                   { 'name'         : 'Download'
                   , 'url'          :  content_url + '/download'
                   , 'permissions'  : ( 'View', )
                   , 'category'     : 'object'
                   },
                   { 'name'         : 'View statistics'
                   , 'url'          :  content_url + '/view'
                   , 'permissions'  : ( 'View', )
                   , 'category'     : 'object'
                   },
               )

    def manage_afterAdd(self, item, container):
        """Both of my parents have an afterAdd method"""
        OFS.Image.File.manage_afterAdd(self, item, container)
        PortalContent.manage_afterAdd(self, item, container)

    def manage_beforeDelete(self, item, container):
        """Both of my parents have a beforeDelete method"""
        PortalContent.manage_beforeDelete(self, item, container)
        OFS.Image.File.manage_beforeDelete(self, item, container)

    def edit(self, precondition='', file=''):
        """
        Perform changes for user
        """
        if precondition: self.precondition = precondition
        elif self.precondition: del self.precondition

        if file.filename != '' and file.read() != '':
            self.manage_upload(file)

        self.setFormat(self.content_type)
        #self.reindexObject()

    edit = WorkflowAction(edit)

    def download(self, REQUEST, RESPONSE):
        """
        Download this item.  Calls OFS.Image.File.index_html to perform the
        actual transfer after first setting Content-Disposition to suggest
        a filename.
        """

        RESPONSE.setHeader('Content-Disposition',
                           'attachment; filename="%s"' % self.id())
        return OFS.Image.File.index_html(self, REQUEST, RESPONSE)

    editForm = HTMLFile('dtml/msOfficeFileEdit', globals())
    #viewHTMLForm = HTMLFile('dtml/msOfficeFileViewHTML', globals())
    view = HTMLFile('dtml/msOfficeFileView', globals())

    index_html = view
    #index_html = download

    #--------------------------------------------------------------------------#
    #def viewHTML(self):
    #--------------------------------------------------------------------------#
    #    fnameDoc = tempfile.mktemp()
    #    fnameHtml = tempfile.mktemp()
    #    f = open(fnameDoc,"wb")
    #    f.write(str(self.data))
    #    f.close()
    #    os.system("./lib/python/Products/CMF_MS_Files/wvWare -x ./lib/python/Products/CMF_MS_Files/wvHtml.xml " + fnameDoc + " > " + fnameHtml)
    #    f = open(fnameHtml,"rb")
    #    val = f.read()
    #    f.close()
    #    os.remove(fnameDoc)
    #    os.remove(fnameHtml)
    #    return val

##    def __call__(self, REQUEST, **kw):
##        return apply(self.view, (self, REQUEST), kw)

    #--------------------------------------------------------------------------#
    def PUT(self, REQUEST, RESPONSE):
    #--------------------------------------------------------------------------#
        """Handle HTTP(and presumably FTP?)PUT requests"""
        
        try:
            self.dav__init(REQUEST, RESPONSE)

            headers = {}
            for k, v in self.getMetadataHeaders():
                headers[k] = v

            if OLE_DEBUG: print "\n"
            if OLE_DEBUG: print "\n:BEFORE:\n"

            keys = headers.keys()
            keys.sort()
            for i in keys:
                if OLE_DEBUG: print "headers[", i, "]:", headers[i]
                continue
            
            body = REQUEST.get('BODY', '')

            import string
            if OLE_DEBUG: print "self.__name__:", self.__name__
            found = string.find(self.__name__, '~')

            sniffFmt, enc = OFS.content_types.guess_content_type(self.__name__, body)
            format = REQUEST.get_header('content-type', sniffFmt)
            if OLE_DEBUG: print "format:", format
            headers['Format'] = format
            
            if headers['Format'] in ( 'application/vnd.ms-powerpoint',):
                try:
                    from Products.CMF_MS_Files.pylibole2 import getHeaders
                                        
                    headers = getHeaders(body, headers)

                    if OLE_DEBUG: print "\n"
                    if OLE_DEBUG: print "\n:AFTER:\n"

                    keys = headers.keys()
                    keys.sort()
                    for i in keys:
                        if OLE_DEBUG: print "headers[", i, "]:", headers[i]
                        continue
                    
                except:
                    if OLE_DEBUG: print "\n:ERROR:pylibole2.getHeaders(body):FAILED:\n"
                    pass

            #import pdb; pdb.set_trace()
            
            self.editMetadata( contributors = headers['Contributors']
                             , description = headers['Description']
                             , effective_date = headers['Effective_date']
                             , expiration_date = headers['Expiration_date']
                             , format = headers['Format']
                             , language = headers['Language']
                             , rights = headers['Rights']
                             , subject = headers['Subject']
                             , title = headers['Title']
                             )
            
            self.manage_upload(body)
            self.reindexObject()

            RESPONSE.setStatus(204)
            return RESPONSE
            
        except:
            import traceback
            traceback.print_exc()
            raise

Globals.default__class_init__(MsPowerPointFile)

from Products.CMFCore.register import registerPortalContent
registerPortalContent(MsPowerPointFile,                    # The class to be registered
                      constructors=(addMsPowerPointFile,), # It's factory (constructor)
                      action='Wizards/MsPowerPointFile',   # The URL of it's add interface
                      icon="MsPowerPointFile.gif",         # Filename to take icon from
                      productGlobals=globals())

--- Added File MsWordFile.py in package Packages/Products/DCProject ---
# MsWordFile.py
# John Platten
# 03.06.01
  
"""
"""

ADD_CONTENT_PERMISSION = 'Add portal content'

OLE_DEBUG = 1

command_str = None
command2_str = None

from Globals import HTMLFile, HTML
from Products.CMFCore.PortalContent import PortalContent
from Products.CMFDefault.Discussions import Discussable
import Globals
from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl

from Products.CMFCore import CMFCorePermissions
from Products.CMFCore.WorkflowCore import WorkflowAction, afterCreate


import OFS.Image

import os
import tempfile

def addMsWordFile( self
           , id
           , title=''
           , file=''
           , content_type=''
           , precondition=''
           , subject=()
           , description=''
           , contributors=()
           , effective_date=None
           , expiration_date=None
           , format='text/html'
           , language='en-US'
           , rights=''
           ):
    """
    Add a Microsoft Word Document
    """

    # cookId sets the id and title if they are not explicity specified
    id, title = OFS.Image.cookId(id, title, file)

    self=self.this()  # Why?

    # Instantiate the object and set it's description.
    # The description is not set by the constructor because I didn't
    # want to extend File's constructor.  Perhaps I should.
    fobj = MsWordFile( id, title, '', content_type, precondition, subject
               , description, contributors, effective_date, expiration_date
               , format, language, rights
               )
    
    # Add the File instance to self
    self._setObject(id, fobj)

    # 'Upload' the file.  This is done now rather than in the
    # constructor because it's faster.  Why is it faster?
    self._getOb(id).manage_upload(file)

    afterCreate(self._getOb(id))

    """
    if RESPONSE is not None:
        RESPONSE.redirect(self.absolute_url()+'/folder_contents')
    """
        
class MsWordFile( OFS.Image.File
          , PortalContent
          , DefaultDublinCoreImpl
          ):
    """
        A Portal-managed File
    """

    # The order of base classes is very significant in this case.
    # Image.File does not store it's id in it's 'id' attribute.
    # Rather, it has an 'id' method which returns the contents of the
    # instnace's __name__ attribute.  Inheriting in the other order
    # obscures this method, resulting in much pulling of hair and
    # gnashing of teeth and fraying of nerves.  Don't do it.
    #
    # Really.
    
    meta_type='MsWordFile'
    effective_date = expiration_date = None
    _isDiscussable = 1
    icon = PortalContent.icon

    __ac_permissions__ = (
        (CMFCorePermissions.View, ('',)),
        (CMFCorePermissions.ModifyPortalContent, ('edit',)),
        )    
                             
    def __init__( self
                , id
                , title=''
                , file=''
                , content_type=''
                , precondition=''
                , subject=()
                , description=''
                , contributors=()
                , effective_date=None
                , expiration_date=None
                , format='text/html'
                , language='en-US'
                , rights=''
                ):
        OFS.Image.File.__init__( self, id, title, file
                               , content_type, precondition )
        DefaultDublinCoreImpl.__init__( self, title, subject, description
                               , contributors, effective_date, expiration_date
                               , format, language, rights )
    
    def SearchableText(self):
        """
        SeachableText is used for full text seraches of a portal.  It
        should return a concatanation of all useful text.
        """
        if OLE_DEBUG: print ":MsWordFile:SearchableText:"

        try:
            fnameDoc = tempfile.mktemp()
            if OLE_DEBUG: print ":MsWordFile:SearchableText:fnameDoc:", fnameDoc

            fnameTxt = tempfile.mktemp()
            if OLE_DEBUG: print ":MsWordFile:SearchableText:fnameTxt:", fnameTxt

            f = open(fnameDoc,"wb")
            f.write(str(self.data))
            f.close()

            global command_str
            if command_str == None:
                if os.environ.has_key('WV_WARE_LOCATION'):
                    command_str = os.environ['WV_WARE_LOCATION'] + "/wvWare -x "
                else:
                    command_str = "./Products/CMF_MS_Files/wvWare -x "
                if os.environ.has_key('WV_WARE_XML_FILES'):
                    command_str = command_str + os.environ['WV_WARE_XML_FILES'] + "/wvText.xml %s > %s"
                else:
                    command_str = command_str + "./Products/CMF_MS_Files/wvText.xml %s > %s"
            command = command_str % (fnameDoc, fnameTxt)
            if OLE_DEBUG: print ":MsWordFile:SearchableText:command:", command
            
            err = os.system(command)
            if OLE_DEBUG: print ":MsWordFile:SearchableText:err:", err

            f = open(fnameTxt,"rb")
            val = f.read()
            f.close()

            os.remove(fnameDoc)
            os.remove(fnameTxt)

        except:
            val = ""
            if OLE_DEBUG: print ":MsWordFile:SearchableText:ExceptionHandler:val:", val
            pass

        return "%s %s %s" % (self.title, self.description, val)

    #--------------------------------------------------------------------------#
    def listActions(self, info):
    #--------------------------------------------------------------------------#

        content_url = info.content_url
        return ( 
                   { 'name'         : 'View HTML'
                   , 'url'          :  content_url + '/viewHTMLForm'
                   , 'permissions'  : ( 'View', )
                   , 'category'     : 'object'
                   }
                 , { 'name'         : 'Edit'
                   , 'url'          :  content_url + '/editForm'
                   , 'permissions'  : ( 'Modify portal content', )
                   , 'category'     : 'object'
                   }
                 , { 'name'         : 'Metadata'
                   , 'url'          :  content_url + '/metadata_edit_form'
                   , 'permissions'  : ( 'Modify portal content', )
                   , 'category'     : 'object'
                   }
                 , { 'name'         : 'Download'
                   , 'url'          :  content_url + '/download'
                   , 'permissions'  : ( 'View', )
                   , 'category'     : 'object'
                   }
                 , { 'name'         : 'View statistics'
                   , 'url'          :  content_url + '/view'
                   , 'permissions'  : ( 'View', )
                   , 'category'     : 'object'
                   }
               )

    def manage_afterAdd(self, item, container):
        """Both of my parents have an afterAdd method"""
        OFS.Image.File.manage_afterAdd(self, item, container)
        PortalContent.manage_afterAdd(self, item, container)

    def manage_beforeDelete(self, item, container):
        """Both of my parents have a beforeDelete method"""
        PortalContent.manage_beforeDelete(self, item, container)
        OFS.Image.File.manage_beforeDelete(self, item, container)

    def edit(self, precondition='', file=''):
        """
        Perform changes for user
        """
        if precondition: self.precondition = precondition
        elif self.precondition: del self.precondition

        if file.filename != '' and file.read() != '':
            self.manage_upload(file)

        self.setFormat(self.content_type)
        #self.reindexObject()

    edit = WorkflowAction(edit)

    def download(self, REQUEST, RESPONSE):
        """
        Download this item.  Calls OFS.Image.File.index_html to perform the
        actual transfer after first setting Content-Disposition to suggest
        a filename.
        """

        RESPONSE.setHeader('Content-Disposition',
                           'attachment; filename="%s"' % self.id())
        return OFS.Image.File.index_html(self, REQUEST, RESPONSE)

    editForm = HTMLFile('dtml/msOfficeFileEdit', globals())
    viewHTMLForm = HTMLFile('dtml/msOfficeFileViewHTML', globals())
    view = HTMLFile('dtml/msOfficeFileView', globals())

    index_html = view
    #index_html = download

    #--------------------------------------------------------------------------#
    def viewHTML(self):
    #--------------------------------------------------------------------------#
        fnameDoc = tempfile.mktemp()
        fnameHtml = tempfile.mktemp()
        f = open(fnameDoc,"wb")
        f.write(str(self.data))
        f.close()
        global command2_str
        if command2_str == None:
            if os.environ.has_key('WV_WARE_LOCATION'):
                command2_str = os.environ['WV_WARE_LOCATION'] + "/wvWare -x "
            else:
                command2_str = "./Products/CMF_MS_Files/wvWare -x "
            if os.environ.has_key('WV_WARE_XML_FILES'):
                command2_str = command2_str + os.environ['WV_WARE_XML_FILES'] + "/wvHtml.xml %s > %s"
            else:
                command2_str = command2_str + "./Products/CMF_MS_Files/wvHtml.xml %s > %s"
        command = command2_str % (fnameDoc, fnameHtml)
        os.system(command)
        f = open(fnameHtml,"rb")
        val = f.read()
        f.close()
        os.remove(fnameDoc)
        os.remove(fnameHtml)
        return val

##    def __call__(self, REQUEST, **kw):
##        return apply(self.view, (self, REQUEST), kw)

    #--------------------------------------------------------------------------#
    def PUT(self, REQUEST, RESPONSE):
    #--------------------------------------------------------------------------#
        """Handle HTTP(and presumably FTP?)PUT requests"""
        
        try:
            self.dav__init(REQUEST, RESPONSE)

            headers = {}
            for k, v in self.getMetadataHeaders():
                headers[k] = v

            if OLE_DEBUG: print "\n"
            if OLE_DEBUG: print "\n:BEFORE:\n"

            keys = headers.keys()
            keys.sort()
            for i in keys:
                if OLE_DEBUG: print "headers[", i, "]:", headers[i]
                continue
            
            body = REQUEST.get('BODY', '')

            import string
            if OLE_DEBUG: print "self.__name__:", self.__name__
            found = string.find(self.__name__, '~')

            sniffFmt, enc = OFS.content_types.guess_content_type(self.__name__, body)
            format = REQUEST.get_header('content-type', sniffFmt)
            if OLE_DEBUG: print "format:", format
            headers['Format'] = format
            
            if headers['Format'] in ( 'application/msword', 'application/octet-stream', ):
                try:
                    from Products.CMF_MS_Files.pylibole2 import getHeaders
                                        
                    headers = getHeaders(body, headers)

                    if OLE_DEBUG: print "\n"
                    if OLE_DEBUG: print "\n:AFTER:\n"

                    keys = headers.keys()
                    keys.sort()
                    for i in keys:
                        if OLE_DEBUG: print "headers[", i, "]:", headers[i]
                        continue
                    
                except:
                    if OLE_DEBUG: print "\n:ERROR:pylibole2.getHeaders(body):FAILED:\n"
                    pass

            
            self.editMetadata( contributors = headers['Contributors']
                             , description = headers['Description']
                             , effective_date = headers['Effective_date']
                             , expiration_date = headers['Expiration_date']
                             , format = headers['Format']
                             , language = headers['Language']
                             , rights = headers['Rights']
                             , subject = headers['Subject']
                             , title = headers['Title']
                             )
            
            self.manage_upload(body)
            self.reindexObject()

            RESPONSE.setStatus(204)
            return RESPONSE
            
        except:
            import traceback
            traceback.print_exc()
            raise

Globals.default__class_init__(MsWordFile)

from Products.CMFCore.register import registerPortalContent
registerPortalContent(MsWordFile,                    # The class to be registered
                      constructors=(addMsWordFile,), # It's factory (constructor)
                      action='Wizards/MsWordFile',   # The URL of it's add interface
                      icon="MsWordFile.gif",         # Filename to take icon from
                      productGlobals=globals())

--- Added File __init__.py in package Packages/Products/DCProject ---
#------------------------------------------------------------------------------#
# __init__.py
# John Platten
# 03.06.01
#------------------------------------------------------------------------------#

ADD_CONTENT_PERMISSION = 'Add portal content'

import MsWordFile
import MsExcelFile
import MsPowerPointFile
from Products.CMFCore import utils
import Products.CMFCore

#------------------------------------------------------------------------------#

bases = (MsWordFile.MsWordFile,MsExcelFile.MsExcelFile,MsPowerPointFile.MsPowerPointFile)
contentClasses = (MsWordFile.MsWordFile,MsExcelFile.MsExcelFile,MsPowerPointFile.MsPowerPointFile)
contentConstructors = (MsWordFile.addMsWordFile,MsExcelFile.addMsExcelFile,MsPowerPointFile.addMsPowerPointFile)

import sys
this_module = sys.modules[ __name__ ]

z_bases = utils.initializeBasesPhase1(bases, this_module)

#------------------------------------------------------------------------------#
def initialize(context):
#------------------------------------------------------------------------------#

    factory_type_information = (
                                {'id': 'MS Word File', 'meta_type': 'MsWordFile', 'description':
                                 'File objects of Microsoft Word format.',
                                 'product':'CMF_MS_Files', 'factory':'addMsWordFile', 'icon': 'MsWordFile.gif',
                                 'immediate_view':'metadata_edit_form', 'actions':
                                 ({'name': 'View statistics',
                                   'action': 'view',
                                   'permissions': ('View',)},
                                  {'name': 'Download',
                                   'action': 'download',
                                   'permissions': ('View',)},
                                  {'name': 'Edit',
                                   'action': 'file_edit_form',
                                   'permissions': ('Modify portal content',)},
                                  {'name': 'Metadata',
                                   'action': 'metadata_edit_form',
                                   'permissions': ('Modify portal content',)},
                                  ),
                                 },
                                {'id': 'MS Excel File', 'meta_type': 'MsExcelFile', 'description':
                                 'File objects of Microsoft Excel format.',
                                 'product':'CMF_MS_Files', 'factory':'addMsExcelFile', 'icon': 'MsExcelFile.gif',
                                 'immediate_view':'metadata_edit_form', 'actions':
                                 ({'name': 'View statistics',
                                   'action': 'view',
                                   'permissions': ('View',)},
                                  {'name': 'Download',
                                   'action': 'download',
                                   'permissions': ('View',)},
                                  {'name': 'Edit',
                                   'action': 'file_edit_form',
                                   'permissions': ('Modify portal content',)},
                                  {'name': 'Metadata',
                                   'action': 'metadata_edit_form',
                                   'permissions': ('Modify portal content',)},
                                  ),
                                 },
                                {'id': 'MS Power Point File', 'meta_type': 'MsPowerPointFile', 'description':
                                 'File objects of Microsoft Power Point format.',
                                 'product':'CMF_MS_Files', 'factory':'addMsPowerPointFile', 'icon': 'MsPowerPointFile.gif',
                                 'immediate_view':'metadata_edit_form', 'actions':
                                 ({'name': 'View statistics',
                                   'action': 'view',
                                   'permissions': ('View',)},
                                  {'name': 'Download',
                                   'action': 'download',
                                   'permissions': ('View',)},
                                  {'name': 'Edit',
                                   'action': 'file_edit_form',
                                   'permissions': ('Modify portal content',)},
                                  {'name': 'Metadata',
                                   'action': 'metadata_edit_form',
                                   'permissions': ('Modify portal content',)},
                                  ),
                                 },
                               )
    utils.initializeBasesPhase2(z_bases, context)

    context.registerHelp()
    utils.ContentInit( 'CMF Microsoft Content'
                     , content_types=contentClasses
                     , permission=ADD_CONTENT_PERMISSION
                     , extra_constructors=contentConstructors
                     , fti=factory_type_information
                     ).initialize( context )

    utils.registerIcon(MsWordFile.MsWordFile,
                       'images/MsWordFile.gif', globals())
    utils.registerIcon(MsExcelFile.MsExcelFile,
                       'images/MsExcelFile.gif', globals())
    utils.registerIcon(MsPowerPointFile.MsPowerPointFile,
                       'images/MsPowerPointFile.gif', globals())



    Products.CMFCore.PortalFolder.addPortalTypeHandler('application/msword', MsWordFile.MsWordFile)
    Products.CMFCore.PortalFolder.addPortalTypeHandler('application/octet-stream', MsWordFile.MsWordFile)
    Products.CMFCore.PortalFolder.addPortalTypeHandler('application/vnd.ms-excel', MsExcelFile.MsExcelFile)
    Products.CMFCore.PortalFolder.addPortalTypeHandler('application/vnd.ms-powerpoint', MsPowerPointFile.MsPowerPointFile)
    #Products.CMFCore.PortalFolder.addPortalTypeHandler('application/vnd.ms-project', MsOfficeFile.MsOfficeFile)

#------------------------------------------------------------------------------#

--- Added File wvHtml.xml in package Packages/Products/DCProject ---
<main>
<charentity>
<begin>HTML</begin>
</charentity>

<document>
<begin>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/REC-html40/loose.dtd&quot;&gt;
&lt;html&gt; 
&lt;head&gt; 
&lt;META HTTP-EQUIV=&quot;Content-Type&quot; CONTENT=&quot;text/html; charset=<charset/>&quot;&gt;
&lt;META NAME=&quot;GENERATOR&quot; CONTENT=&quot;wvWare/<version/>&quot;&gt;
&lt;title&gt; 
<title/>
&lt;/title&gt; 
&lt;/head&gt; 
&lt;body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot; link=&quot;#0000ee&quot; vlink=&quot;#551a8b&quot;&gt;
</begin>
<end>
&lt;!--
&lt;hr&gt;
&lt;address&gt;
&lt;a href=&quot;http://wvware.sourceforge.net/&quot;&gt;&lt;img
src=&quot;wvSmall.gif&quot; height=31 width=47
align=left border=0 alt=&quot;wvWare&quot;&gt;&lt;/a&gt;
&lt;a href=&quot;http://validator.w3.org/check/referer&quot;&gt;&lt;img
src=&quot;vh40.gif&quot; height=31 width=88
align=right border=0 alt=&quot;Valid HTML 4.0!&quot;&gt;&lt;/a&gt;
Document created with &lt;a href=&quot;http://wvware.sourceforge.net/&quot;&gt;wvWare/<version/>&lt;/a&gt;&lt;br&gt;
&lt;/address&gt;
--&gt;
&lt;/body&gt;
&lt;/html&gt;
</end>
</document>

<section>
<begin>
&lt;!--Section Begins--&gt;&lt;br&gt;
</begin>
<end>
&lt;!--Section Ends--&gt;
</end>
</section>

<justification>
<left>left</left>
<right>right</right>
<center>center</center>
<block>justify</block>
<asian>&lt;!--Could Someone who sees this tag tell me what was is this type of justification, asian languages only i thing--&gt;</asian>
</justification>

<numbering>
<Arabic>type=&quot;1&quot;</Arabic>
<UpperRoman>type=&quot;I&quot;</UpperRoman>
<LowerRoman>type=&quot;i&quot;</LowerRoman>
<UpperCaseN>type=&quot;A&quot;</UpperCaseN>
<LowerCaseN>type=&quot;a&quot;</LowerCaseN>
</numbering>

<border>
<noned>none</noned>
<singled>solid</singled>
<thickd>solid</thickd>
<doubled>double</doubled>
<number4d>double</number4d>
<hairlined>solid</hairlined>
<dotd>dotted</dotd>
<dashlargegapd>dashed</dashlargegapd>
<dotdashd>dotted</dotdashd>
<dotdotdashd>dotted</dotdotdashd>
<tripled>double</tripled>
<thin-thicksmallgapd>dashed</thin-thicksmallgapd>
<thick-thinsmallgapd>dashed</thick-thinsmallgapd>
<thin-thick-thinsmallgapd>dashed</thin-thick-thinsmallgapd>
<thin-thickmediumgapd>dashed</thin-thickmediumgapd>
<thick-thinmediumgapd>dashed</thick-thinmediumgapd>
<thin-thick-thinmediumgapd>dashed</thin-thick-thinmediumgapd>
<thin-thicklargegapd>dashed</thin-thicklargegapd>
<thick-thinlargegapd>dashed</thick-thinlargegapd>
<thin-thick-thinlargegapd>dashed</thin-thick-thinlargegapd>
<waved>solid</waved>
<doublewaved>double</doublewaved>
<dashsmallgapd>sashed</dashsmallgapd>
<dashdotstrokedd>dashed</dashdotstrokedd>
<emboss3Dd>ridge</emboss3Dd>
<engrave3Dd>groove</engrave3Dd>
<defaultd>ridge</defaultd>
</border>

<olist>
<begin>&lt;ol <nfc/> start=&quot;<start/>&quot;&gt;
</begin>
<end>&lt;/ol&gt;</end>
</olist>

<ulist>
<begin>&lt;ul&gt;
</begin>
<end>&lt;/ul&gt;</end>
</ulist>

<entry>
<begin>&lt;li&gt;</begin>
<end>&lt;/li&gt;</end>
</entry>


<!-- 
this tableoverride option can be used to turn off handling of
these tags in tables, which I find is necessary for at least netscape
-->
<tableoverrides>
<ParaBefore>0</ParaBefore>
<ParaRight>0</ParaRight>
<ParaAfter>0</ParaAfter>
<ParaLeft>0</ParaLeft>
<ParaLeft1>0</ParaLeft1>
<VertMergedCells>0</VertMergedCells>
</tableoverrides>

<table>
<begin>&lt;table width=&quot;<tablerelwidth/>%&quot; border=&quot;1&quot; cols=&quot;<no_cols/>&quot; rows=&quot;<no_rows/>&quot;&gt;</begin>
<end>&lt;/table&gt;</end>
</table>

<row>
<begin>&lt;tr&gt;</begin>
<end>&lt;/tr&gt;</end>
</row>

<cell>
<begin>&lt;td bgcolor=&quot;<cellbgcolor/>&quot; width=&quot;<cellrelwidth/>%&quot; rowspan=&quot;<rowspan/>&quot; colspan=&quot;<colspan/>&quot;&gt;</begin>
<end>&lt;/td&gt;</end>
</cell>

<paragraph>
<begin>
<table.end/>
<table.begin/>
<row.begin/><cell.begin/><olist.end/><olist.begin/><ulist.end/><ulist.begin/><entry.begin/><text.begin/>
</begin>
<end>
<text.end/><entry.end/><olist.end/><ulist.end/><cell.end/><row.end/>
</end>
</paragraph>

<!-- these are all the character properties that can show up in word -->
<bold><begin>&lt;b&gt;</begin><end>&lt;/b&gt;</end></bold>
<italic><begin>&lt;i&gt;</begin><end>&lt;/i&gt;</end></italic>

<!--
text that has been deleted and will be displayed with strikethrough when
revision marked text is to be displayed

use either this line...
--> 
<RMarkDel><begin>&lt;s&gt;</begin><end>&lt;/s&gt;&lt;a href=&quot;#author<ibstRMarkDel/>&quot;&gt;[Author ID<ibstRMarkDel/>: at <dttmRMarkDel/> ]&lt;/a&gt;</end></RMarkDel>

<!--
or uncomment below to make deleted text dissappear (well, become commented out)
-->
<!--
<RMarkDel><begin>&lt;!-&#45;</begin><end>-&#45;&gt;</end></RMarkDel>
-->

<!-- I don't even know what outline means -->
<outline><begin></begin><end></end></outline>
<smallcaps><begin></begin><end></end></smallcaps>
<caps><begin></begin><end></end></caps>
<vanish><begin></begin><end></end></vanish>

<!--If you uncomment this then the annotation text links will become commented out by html tags-->
<!--
<vanish><begin>&lt;!-&#45;</begin><end>-&#45;&gt;</end></vanish>
-->

<!--
text that has been newly typed since the last time revision marks have been accepted
and will be displayed with underline when revision marked text is to be displayed

use either this line...
-->
<RMark><begin>&lt;u&gt;</begin><end>&lt;/u&gt;&lt;a href=&quot;#author<ibstRMark/>&quot;&gt;[Author ID<ibstRMark/>: at <dttmRMark/>]&lt;/a&gt;</end></RMark>

<!--
or uncomment below to make the underline dissappear
-->
<!--
<RMark><begin></begin><end></end></RMark>
-->


<strike><begin>&lt;s&gt;</begin><end>&lt;/s&gt;</end></strike>
<shadow><begin></begin><end></end></shadow>
<lowercase><begin></begin><end></end></lowercase>
<emboss><begin></begin><end></end></emboss>
<imprint><begin></begin><end></end></imprint>
<!--double strike-->
<dstrike><begin>&lt;s&gt;</begin><end>&lt;/s&gt;</end></dstrike>

<!--
ftc's
&
hps

keep them for font face and do that later.
-->

<super><begin>&lt;sup&gt;</begin><end>&lt;/sup&gt;</end></super>
<sub><begin>&lt;sub&gt;</begin><end>&lt;/sub&gt;</end></sub>

<singleu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></singleu>
<wordu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></wordu>
<doubleu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></doubleu>
<dottedu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dottedu>
<hiddenu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></hiddenu>
<thicku><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></thicku>
<dashu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dashu>
<dotu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dotu>
<dotdashu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dotdashu>
<dotdotdashu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dotdotdashu>
<waveu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></waveu>

<!--
text whose properties have been changed since the last time revision marks have been accepted
and will be displayed with a note showing the change points.

use either this line (which admit it a bit scary looking, but harmless)...
--> 
<PropRMark><begin>&lt;a href=&quot;#author<ibstPropRMark/>&quot;&gt;-&#45;&amp;gt;&lt;/a&gt;</begin><end>&lt;a href=&quot;#author<ibstPropRMark/>&quot;&gt;[Author ID<ibstPropRMark/>: at <dttmPropRMark/>]&lt;/a&gt;</end></PropRMark>

<!--
or uncomment below to make the notes dissappear
-->
<!--
<PropRMark><begin></begin><end></end></PropRMark>
-->

<!--
<color>
-->
<Black><begin>Black</begin><end></end></Black>
<Blue><begin>Blue</begin><end></end></Blue>
<Cyan><begin>Cyan</begin><end></end></Cyan>
<Green><begin>Green</begin><end></end></Green>
<Magenta><begin>Magenta</begin><end></end></Magenta>
<Red><begin>Red</begin><end></end></Red>
<Yellow><begin>Yellow</begin><end></end></Yellow>
<White><begin>White</begin><end></end></White>
<DkBlue><begin>DarkBlue</begin><end></end></DkBlue>
<DkCyan><begin>DarkCyan</begin><end></end></DkCyan>
<DkGreen><begin>DarkGreen</begin><end></end></DkGreen>
<DkMagenta><begin>DarkMagenta</begin><end></end></DkMagenta>
<DkRed><begin>DarkRed</begin><end></end></DkRed>
<DkYellow><begin>#8b8b00</begin><end></end></DkYellow>
<DkGray><begin>DarkGray</begin><end></end></DkGray>
<LtGray><begin>LightGrey</begin><end></end></LtGray>
<!--
</color>
-->

<!--
<animation>
-->
<LasVegas><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></LasVegas>
<BackgroundBlink><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></BackgroundBlink>
<SparkleText><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></SparkleText>
<MarchingAnts><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></MarchingAnts>
<MarchingRedAnts><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></MarchingRedAnts>
<Shimmer><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></Shimmer>
<!--
</animation>
-->

<!--
I dont understand what this one is, and ive never come across it

use this sample line (which admit it a bit scary looking, but harmless)...
-->
<DispFldRMark><begin>&lt;a href=&quot;#author<ibstDispFldRMark/>&quot;&gt;--&amp;gt;&lt;/a&gt;</begin><end>&lt;a href=&quot;#author<ibstDispFldRMark/>&quot;&gt;[Author ID<ibstDispFldRMark/>: at <dttmDispFldRMark/> (<xstDispFldRMark/>)]&lt;/a&gt;</end></DispFldRMark>

<!--
or uncomment below to ignore it, the previous might even crash wv ?
-->
<!--
<DispFldRMark><begin></begin><end></end></DispFldRMark>
-->

<animation>
<begin><LasVegas.begin/><BackgroundBlink.begin/><SparkleText.begin/><MarchingAnts.begin/><MarchingRedAnts.begin/><Shimmer.begin/></begin>
<end><Shimmer.end/><MarchingRedAnts.end/><MarchingAnts.end/><SparkleText.end/><BackgroundBlink.end/><LasVegas.end/></end>
</animation>

<fontstr>
<begin>&lt;font color=&quot;<black.begin/><blue.begin/><cyan.begin/><green.begin/><magenta.begin/><red.begin/><yellow.begin/><white.begin/><dkblue.begin/><dkcyan.begin/><dkgreen.begin/><dkmagenta.begin/><dkred.begin/><dkyellow.begin/><dkgray.begin/><ltgray.begin/>&quot;&gt;</begin>
<end><ltgray.end/><dkgray.end/><dkyellow.end/><dkred.end/><dkmagenta.end/><dkgreen.end/><dkcyan.end/><dkblue.end/><white.end/><yellow.end/><red.end/><magenta.end/><green.end/><cyan.end/><blue.end/><black.end/>&lt;/font&gt;</end>
</fontstr>

<comment>
<begin>
&lt;a href=&quot;#comment<ibstAnno/> &quot;&gt;-&#45;&amp;gt;&lt;/a&gt;
</begin>
<end>&lt;a href=&quot;#comment<ibstAnno/> &quot;&gt;[Author:<xstUsrInitl/>]&lt;/a&gt;
</end>
</comment>

<style name="Normal">
<character>
<begin><PropRMark.begin/><DispFldRMark.begin/><animation.begin/><fontstr.begin/><bold.begin/><italic.begin/><strike.begin/><RMarkDel.begin/><outline.begin/><smallcaps.begin/><caps.begin/><vanish.begin/><RMark.begin/><shadow.begin/><lowercase.begin/><emboss.begin/><imprint.begin/><dstrike.begin/><super.begin/><sub.begin/><singleu.begin/><wordu.begin/><doubleu.begin/><dottedu.begin/><hiddenu.begin/><thicku.begin/><dashu.begin/><dotu.begin/><dotdashu.begin/><dotdotdashu.begin/><waveu.begin/></begin>
<end><waveu.end/><dotdotdashu.end/><dotdashu.end/><dotu.end/><dashu.end/><thicku.end/><hiddenu.end/><dottedu.end/><doubleu.end/><wordu.end/><singleu.end/><sub.end/><super.end/><dstrike.end/><imprint.end/><emboss.end/><lowercase.end/><shadow.end/><RMark.end/><vanish.end/><caps.end/><smallcaps.end/><outline.end/><RMarkDel.end/><strike.end/><italic.end/><bold.end/><fontstr.end/><animation.end/><DispFldRMark.end/><PropRMark.end/></end>
</character>

<!-- Netscape does handle this correctly yet, here is how each different side of the border should work.
border-top: thin <bordertopstyle/> <bordertopcolor/>;
border-left: thin <borderleftstyle/> <borderleftcolor/>;
border-right: thin <borderrightstyle/> <borderrightcolor/>;
border-bottom: thin <borderbottomstyle/> <borderbottomcolor/>
-->


<pmargin>
<begin>margin: <mmParaBefore/> <mmParaRight/> <mmParaAfter/> <mmParaLeft/>;</begin>
</pmargin>

<pborder>
<begin>
border: thin <borderleftstyle/> <borderleftcolor/>;
<!--
border-top: thin <bordertopstyle/> <bordertopcolor/>;
border-left: thin <borderleftstyle/> <borderleftcolor/>;
border-right: thin <borderrightstyle/> <borderrightcolor/>;
border-bottom: thin <borderbottomstyle/> <borderbottomcolor/>
-->
</begin>
</pborder>

<text>	
<begin>&lt;p&gt;&lt;div align=&quot;<just/>&quot; style=&quot;<paramargin/> <paraborder/> padding: <mmPadTop/> <mmPadRight/> <mmPadBottom/> <mmPadLeft/>; &quot;&gt; &lt;p style=&quot;text-indent: <mmParaLeft1/>; text-align: <just/>; line-height: <mmLineHeight/>; color: <parafgcolor/>; background-color: <parabgcolor/>; &quot;&gt;</begin>
<end>&lt;/p&gt;&lt;/div&gt;</end>
</text>

<picture>
<begin>
&lt;img <htmlAlignGuess/> width=&quot;<pixPicWidth/>&quot; height=&quot;<pixPicHeight/>&quot; alt=&quot;0x01 graphic&quot; src=&quot;placeholder.png&quot;&gt;<htmlNextLineGuess/>
</begin>
</picture>

</style>

<!--we need to be override the character properties-->
<!--
<style name="Normal">
<character>
<begin><PropRMark.begin/><DispFldRMark.begin/><animation.begin/><fontstr.begin/><bold.begin/><italic.begin/><strike.begin/><RMarkDel.begin/><outline.begin/><smallcaps.begin/><caps.begin/><vanish.begin/><RMark.begin/><shadow.begin/><lowercase.begin/><emboss.begin/><imprint.begin/><dstrike.begin/><super.begin/><sub.begin/><singleu.begin/><wordu.begin/><doubleu.begin/><dottedu.begin/><hiddenu.begin/><thicku.begin/><dashu.begin/><dotu.begin/><dotdashu.begin/><dotdotdashu.begin/><waveu.begin/></begin>
<end><waveu.end/><dotdotdashu.end/><dotdashu.end/><dotu.end/><dashu.end/><thicku.end/><hiddenu.end/><dottedu.end/><doubleu.end/><wordu.end/><singleu.end/><sub.end/><super.end/><dstrike.end/><imprint.end/><emboss.end/><lowercase.end/><shadow.end/><RMark.end/><vanish.end/><caps.end/><smallcaps.end/><outline.end/><RMarkDel.end/><strike.end/><italic.end/><bold.end/><fontstr.end/><animation.end/><DispFldRMark.end/><PropRMark.end/></end>
</character>

<text>	
<begin>&lt;div align=&quot;<just/>&quot;&gt;&lt;p&gt;</begin>
<end>&lt;/p&gt;&lt;/div&gt;</end>
</text>

</style>

<style name="Heading 1">

<character>
<begin></begin>
<end></end>
</character>

<text>	
<begin>&lt;div align=&quot;<just/>&quot;&gt;&lt;H1&gt;</begin>
<end>&lt;/H1&gt;&lt;/div&gt;</end>
</text>



</style>
-->

</main>

--- Added File wvText.xml in package Packages/Products/DCProject ---
<main>
<charentity>
<begin>ABW</begin>
</charentity>

<document>
<begin>
</begin>
<end>
</end>
</document>

<section>
<begin>
</begin>
<end>
</end>
</section>

<justification>
<left></left>
<right></right>
<center></center>
<block></block>
<asian></asian>
</justification>

<numbering>
<Arabic>type=&quot;1&quot;</Arabic>
<UpperRoman>type=&quot;I&quot;</UpperRoman>
<LowerRoman>type=&quot;i&quot;</LowerRoman>
<UpperCaseN>type=&quot;A&quot;</UpperCaseN>
<LowerCaseN>type=&quot;a&quot;</LowerCaseN>
</numbering>

<border>
<noned></noned>
<singled></singled>
<thickd></thickd>
<doubled></doubled>
<number4d></number4d>
<hairlined></hairlined>
<dotd></dotd>
<dashlargegapd></dashlargegapd>
<dotdashd></dotdashd>
<dotdotdashd></dotdotdashd>
<tripled></tripled>
<thin-thicksmallgapd></thin-thicksmallgapd>
<thick-thinsmallgapd></thick-thinsmallgapd>
<thin-thick-thinsmallgapd></thin-thick-thinsmallgapd>
<thin-thickmediumgapd></thin-thickmediumgapd>
<thick-thinmediumgapd></thick-thinmediumgapd>
<thin-thick-thinmediumgapd></thin-thick-thinmediumgapd>
<thin-thicklargegapd></thin-thicklargegapd>
<thick-thinlargegapd></thick-thinlargegapd>
<thin-thick-thinlargegapd></thin-thick-thinlargegapd>
<waved></waved>
<doublewaved></doublewaved>
<dashsmallgapd></dashsmallgapd>
<dashdotstrokedd></dashdotstrokedd>
<emboss3Dd></emboss3Dd>
<engrave3Dd></engrave3Dd>
<defaultd></defaultd>
</border>

<olist>
<begin></begin>
<end></end>
</olist>

<ulist>
<begin></begin>
<end></end>
</ulist>

<entry>
<begin></begin>
<end></end>
</entry>

<!-- the only thing of significance -->
<text>	
<begin></begin>
<end>
</end>
</text>

<!-- 
this tableoverride option can be used to turn off handling of
these tags in tables, which I find is necessary for at least netscape
-->
<tableoverrides>
<ParaBefore>0</ParaBefore>
<ParaRight>0</ParaRight>
<ParaAfter>0</ParaAfter>
<ParaLeft>0</ParaLeft>
<ParaLeft1>0</ParaLeft1>
<VertMergedCells>0</VertMergedCells>
</tableoverrides>

<table>
<begin></begin>
<end></end>
</table>

<row>
<begin></begin>
<end></end>
</row>

<cell>
<begin></begin>
<end></end>
</cell>

<paragraph>
<begin><text.begin/></begin>
<end><text.end/></end>
</paragraph>

<!-- these are all the character properties that can show up in word -->
<bold><begin></begin><end></end></bold>
<italic><begin></begin><end></end></italic>

<!--
text that has been deleted and will be displayed with strikethrough when
revision marked text is to be displayed

use either this line...
--> 
<RMarkDel><begin></begin>
<end></end>
</RMarkDel>

<!--
or uncomment below to make deleted text dissappear (well, become commented out)
-->
<!--
<RMarkDel><begin>&lt;!-&#45;</begin><end>-&#45;&gt;</end></RMarkDel>
-->

<!-- I don't even know what outline means -->
<outline><begin></begin><end></end></outline>
<smallcaps><begin></begin><end></end></smallcaps>
<caps><begin></begin><end></end></caps>
<vanish><begin></begin><end></end></vanish>

<!--If you uncomment this then the annotation text links will become commented out by html tags-->
<!--
<vanish><begin>&lt;!-&#45;</begin><end>-&#45;&gt;</end></vanish>
-->

<!--
text that has been newly typed since the last time revision marks have been accepted
and will be displayed with underline when revision marked text is to be displayed

use either this line...
-->
<RMark><begin></begin><end></end></RMark>

<!--
or uncomment below to make the underline dissappear
-->
<!--
<RMark><begin></begin><end></end></RMark>
-->


<strike><begin></begin><end></end></strike>
<shadow><begin></begin><end></end></shadow>
<lowercase><begin></begin><end></end></lowercase>
<emboss><begin></begin><end></end></emboss>
<imprint><begin></begin><end></end></imprint>
<!--double strike-->
<dstrike><begin></begin><end></end></dstrike>

<!--
ftc's
&
hps

keep them for font face and do that later.
-->

<super><begin></begin><end></end></super>
<sub><begin></begin><end></end></sub>

<singleu><begin></begin><end></end></singleu>
<wordu><begin></begin><end></end></wordu>
<doubleu><begin></begin><end></end></doubleu>
<dottedu><begin></begin><end></end></dottedu>
<hiddenu><begin></begin><end></end></hiddenu>
<thicku><begin></begin><end></end></thicku>
<dashu><begin></begin><end></end></dashu>
<dotu><begin></begin><end></end></dotu>
<dotdashu><begin></begin><end></end></dotdashu>
<dotdotdashu><begin></begin><end></end></dotdotdashu>
<waveu><begin></begin><end></end></waveu>

<!--
text whose properties have been changed since the last time revision marks have been accepted
and will be displayed with a note showing the change points.

use either this line (which admit it a bit scary looking, but harmless)...
--> 
<PropRMark><begin><ibstPropRMark/></begin><end></end></PropRMark>

<!--
or uncomment below to make the notes dissappear
-->
<!--
<PropRMark><begin></begin><end></end></PropRMark>
-->

<!--
<color>
-->
<Black><begin></begin><end></end></Black>
<Blue><begin></begin><end></end></Blue>
<Cyan><begin></begin><end></end></Cyan>
<Green><begin></begin><end></end></Green>
<Magenta><begin></begin><end></end></Magenta>
<Red><begin></begin><end></end></Red>
<Yellow><begin></begin><end></end></Yellow>
<White><begin></begin><end></end></White>
<DkBlue><begin></begin><end></end></DkBlue>
<DkCyan><begin></begin><end></end></DkCyan>
<DkGreen><begin></begin><end></end></DkGreen>
<DkMagenta><begin></begin><end></end></DkMagenta>
<DkRed><begin></begin><end></end></DkRed>
<DkYellow><begin></begin><end></end></DkYellow>
<DkGray><begin></begin><end></end></DkGray>
<LtGray><begin></begin><end></end></LtGray>
<!--
</color>
-->

<!--
<animation>
-->
<LasVegas><begin></begin><end></end></LasVegas>
<BackgroundBlink><begin></begin><end></end></BackgroundBlink>
<SparkleText><begin></begin><end></end></SparkleText>
<MarchingAnts><begin></begin><end></end></MarchingAnts>
<MarchingRedAnts><begin></begin><end></end></MarchingRedAnts>
<Shimmer><begin></begin><end></end></Shimmer>
<!--
</animation>
-->

<!--
I dont understand what this one is, and ive never come across it

use this sample line (which admit it a bit scary looking, but harmless)...
-->
<DispFldRMark><begin></begin><end></end></DispFldRMark>

<!--
or uncomment below to ignore it, the previous might even crash wv ?
-->
<!--
<DispFldRMark><begin></begin><end></end></DispFldRMark>
-->

<animation>
<begin><LasVegas.begin/><BackgroundBlink.begin/><SparkleText.begin/><MarchingAnts.begin/><MarchingRedAnts.begin/><Shimmer.begin/></begin>
<end><Shimmer.end/><MarchingRedAnts.end/><MarchingAnts.end/><SparkleText.end/><BackgroundBlink.end/><LasVegas.end/></end>
</animation>

<fontstr>
<begin></begin>
<end></end>
</fontstr>

<comment>
<begin>
</begin>
<end>
</end>
</comment>

<style name="Normal">
<character>
<begin><PropRMark.begin/><DispFldRMark.begin/><animation.begin/><fontstr.begin/><bold.begin/><italic.begin/><strike.begin/><RMarkDel.begin/><outline.begin/><smallcaps.begin/><caps.begin/><vanish.begin/><RMark.begin/><shadow.begin/><lowercase.begin/><emboss.begin/><imprint.begin/><dstrike.begin/><super.begin/><sub.begin/><singleu.begin/><wordu.begin/><doubleu.begin/><dottedu.begin/><hiddenu.begin/><thicku.begin/><dashu.begin/><dotu.begin/><dotdashu.begin/><dotdotdashu.begin/><waveu.begin/></begin>
<end><waveu.end/><dotdotdashu.end/><dotdashu.end/><dotu.end/><dashu.end/><thicku.end/><hiddenu.end/><dottedu.end/><doubleu.end/><wordu.end/><singleu.end/><sub.end/><super.end/><dstrike.end/><imprint.end/><emboss.end/><lowercase.end/><shadow.end/><RMark.end/><vanish.end/><caps.end/><smallcaps.end/><outline.end/><RMarkDel.end/><strike.end/><italic.end/><bold.end/><fontstr.end/><animation.end/><DispFldRMark.end/><PropRMark.end/></end>
</character>

<!-- Netscape does handle this correctly yet, here is how each different side of the border should work.
border-top: thin <bordertopstyle/> <bordertopcolor/>;
border-left: thin <borderleftstyle/> <borderleftcolor/>;
border-right: thin <borderrightstyle/> <borderrightcolor/>;
border-bottom: thin <borderbottomstyle/> <borderbottomcolor/>
-->


<pmargin>
<begin><!-- <mmParaBefore/> <mmParaRight/> <mmParaAfter/> <mmParaLeft/>;--></begin>
</pmargin>

<pborder>
<begin>
<!--
border: thin <borderleftstyle/> <borderleftcolor/>;
border-top: thin <bordertopstyle/> <bordertopcolor/>;
border-left: thin <borderleftstyle/> <borderleftcolor/>;
border-right: thin <borderrightstyle/> <borderrightcolor/>;
border-bottom: thin <borderbottomstyle/> <borderbottomcolor/>
-->
</begin>
</pborder>

<picture>
<begin>
</begin>
<!-- images are lacking for now -->

</picture>

</style>

<!--we need to be override the character properties-->
<!--
<style name="Normal">
<character>
<begin><PropRMark.begin/><DispFldRMark.begin/><animation.begin/><fontstr.begin/><bold.begin/><italic.begin/><strike.begin/><RMarkDel.begin/><outline.begin/><smallcaps.begin/><caps.begin/><vanish.begin/><RMark.begin/><shadow.begin/><lowercase.begin/><emboss.begin/><imprint.begin/><dstrike.begin/><super.begin/><sub.begin/><singleu.begin/><wordu.begin/><doubleu.begin/><dottedu.begin/><hiddenu.begin/><thicku.begin/><dashu.begin/><dotu.begin/><dotdashu.begin/><dotdotdashu.begin/><waveu.begin/></begin>
<end><waveu.end/><dotdotdashu.end/><dotdashu.end/><dotu.end/><dashu.end/><thicku.end/><hiddenu.end/><dottedu.end/><doubleu.end/><wordu.end/><singleu.end/><sub.end/><super.end/><dstrike.end/><imprint.end/><emboss.end/><lowercase.end/><shadow.end/><RMark.end/><vanish.end/><caps.end/><smallcaps.end/><outline.end/><RMarkDel.end/><strike.end/><italic.end/><bold.end/><fontstr.end/><animation.end/><DispFldRMark.end/><PropRMark.end/></end>
</character>

<text>	
<begin></begin>
<end>
</end>
</text>

</style>

<style name="Heading 1">

<character>
<begin></begin>
<end></end>
</character>

<text>	
<begin></begin>
<end>
</end>
</text>



</style>
-->

</main>



--- Added File INSTALLATION.txt in package CMF ---
Follow these steps to install the CMF_MS_Files Product;

	1: Untar the package.

	2: cd CMF_MS_Files/src/libole

	3: python setup.py build

	4: In the 'build' directory will be two temporary directories.
            and in one of them will be a file called 'libole.so'.
            Move the 'libole.so' file to the 'CMF_MS_Files' directory.

	5: Load and install the latest version of wv from 
		http://sourceforge.net/projects/wvware/

	6: Set up the following two Environment Variables:

		WV_WARE_LOCATION - this should be the directory that 'wvWare' is found, 'wvWare' is an executable.
		WV_WARE_XML_FILES - this should be the directory that 'wvHtml.xml' and 'wvText.xml' are located.

You can restart Zope now.


--- Added File MsExcelFile.py in package CMF ---
# MsExcelFile.py
# John Platten
# 03.06.01
  
"""
"""

ADD_CONTENT_PERMISSION = 'Add portal content'

OLE_DEBUG = 1

from Globals import HTMLFile, HTML
from Products.CMFCore.PortalContent import PortalContent
from Products.CMFDefault.Discussions import Discussable
import Globals
from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl

from Products.CMFCore import CMFCorePermissions
from Products.CMFCore.WorkflowCore import WorkflowAction, afterCreate


import OFS.Image

import os
import tempfile

def addMsExcelFile( self
           , id
           , title=''
           , file=''
           , content_type=''
           , precondition=''
           , subject=()
           , description=''
           , contributors=()
           , effective_date=None
           , expiration_date=None
           , format='text/html'
           , language='en-US'
           , rights=''
           ):
    """
    Add a Microsoft Word Document
    """

    # cookId sets the id and title if they are not explicity specified
    id, title = OFS.Image.cookId(id, title, file)

    self=self.this()  # Why?

    # Instantiate the object and set it's description.
    # The description is not set by the constructor because I didn't
    # want to extend File's constructor.  Perhaps I should.
    fobj = MsExcelFile( id, title, '', content_type, precondition, subject
               , description, contributors, effective_date, expiration_date
               , format, language, rights
               )
    
    # Add the File instance to self
    self._setObject(id, fobj)

    # 'Upload' the file.  This is done now rather than in the
    # constructor because it's faster.  Why is it faster?
    self._getOb(id).manage_upload(file)

    afterCreate(self._getOb(id))

    """
    if RESPONSE is not None:
        RESPONSE.redirect(self.absolute_url()+'/folder_contents')
    """
        
class MsExcelFile( OFS.Image.File
          , PortalContent
          , DefaultDublinCoreImpl
          ):
    """
        A Portal-managed File
    """

    # The order of base classes is very significant in this case.
    # Image.File does not store it's id in it's 'id' attribute.
    # Rather, it has an 'id' method which returns the contents of the
    # instnace's __name__ attribute.  Inheriting in the other order
    # obscures this method, resulting in much pulling of hair and
    # gnashing of teeth and fraying of nerves.  Don't do it.
    #
    # Really.
    
    meta_type='MsExcelFile'
    effective_date = expiration_date = None
    _isDiscussable = 1
    icon = PortalContent.icon

    __ac_permissions__ = (
        (CMFCorePermissions.View, ('',)),
        (CMFCorePermissions.ModifyPortalContent, ('edit',)),
        )    
                             
    def __init__( self
                , id
                , title=''
                , file=''
                , content_type=''
                , precondition=''
                , subject=()
                , description=''
                , contributors=()
                , effective_date=None
                , expiration_date=None
                , format='text/html'
                , language='en-US'
                , rights=''
                ):
        OFS.Image.File.__init__( self, id, title, file
                               , content_type, precondition )
        DefaultDublinCoreImpl.__init__( self, title, subject, description
                               , contributors, effective_date, expiration_date
                               , format, language, rights )
    
    def SearchableText(self):
        """
        SeachableText is used for full text seraches of a portal.  It
        should return a concatanation of all useful text.
        """
        if OLE_DEBUG: print ":MsExcelFile:SearchableText:"
        val = ""
        #try:
        #    fnameDoc = tempfile.mktemp()
        #    if OLE_DEBUG: print ":MsExcelFile:SearchableText:fnameDoc:", fnameDoc

        #    fnameTxt = tempfile.mktemp()
        #    if OLE_DEBUG: print ":MsExcelFile:SearchableText:fnameTxt:", fnameTxt

        #    f = open(fnameDoc,"wb")
        #    f.write(str(self.data))
        #    f.close()

        #    command = "./lib/python/Products/CMF_MS_Files/wvWare -x ./lib/python/Products/CMF_MS_Files/wvText.xml " + fnameDoc + " > " + fnameTxt
        #    if OLE_DEBUG: print ":MsExcelFile:SearchableText:command:", command
            
        #    err = os.system(command)
        #    if OLE_DEBUG: print ":MsExcelFile:SearchableText:err:", err

        #    f = open(fnameTxt,"rb")
        #    val = f.read()
        #    f.close()

        #    os.remove(fnameDoc)
        #    os.remove(fnameTxt)

        #except:
        #    val = ""
        #    if OLE_DEBUG: print ":MsExcelFile:SearchableText:ExceptionHandler:val:", val
        #    pass

        return "%s %s %s" % (self.title, self.description, val)

    #--------------------------------------------------------------------------#
    def listActions(self, info):
    #--------------------------------------------------------------------------#

        content_url = info.content_url
        return ( 
                   { 'name'         : 'Edit'
                   , 'url'          :  content_url + '/editForm'
                   , 'permissions'  : ( 'Modify portal content', )
                   , 'category'     : 'object'
                   },
                   { 'name'         : 'Metadata'
                   , 'url'          :  content_url + '/metadata_edit_form'
                   , 'permissions'  : ( 'Modify portal content', )
                   , 'category'     : 'object'
                   },
                   { 'name'         : 'Download'
                   , 'url'          :  content_url + '/download'
                   , 'permissions'  : ( 'View', )
                   , 'category'     : 'object'
                   },
                   { 'name'         : 'View statistics'
                   , 'url'          :  content_url + '/view'
                   , 'permissions'  : ( 'View', )
                   , 'category'     : 'object'
                   },
               )

    def manage_afterAdd(self, item, container):
        """Both of my parents have an afterAdd method"""
        OFS.Image.File.manage_afterAdd(self, item, container)
        PortalContent.manage_afterAdd(self, item, container)

    def manage_beforeDelete(self, item, container):
        """Both of my parents have a beforeDelete method"""
        PortalContent.manage_beforeDelete(self, item, container)
        OFS.Image.File.manage_beforeDelete(self, item, container)

    def edit(self, precondition='', file=''):
        """
        Perform changes for user
        """
        if precondition: self.precondition = precondition
        elif self.precondition: del self.precondition

        if file.filename != '' and file.read() != '':
            self.manage_upload(file)

        self.setFormat(self.content_type)
        #self.reindexObject()

    edit = WorkflowAction(edit)

    def download(self, REQUEST, RESPONSE):
        """
        Download this item.  Calls OFS.Image.File.index_html to perform the
        actual transfer after first setting Content-Disposition to suggest
        a filename.
        """

        RESPONSE.setHeader('Content-Disposition',
                           'attachment; filename="%s"' % self.id())
        return OFS.Image.File.index_html(self, REQUEST, RESPONSE)

    editForm = HTMLFile('dtml/msOfficeFileEdit', globals())
    #viewHTMLForm = HTMLFile('dtml/msOfficeFileViewHTML', globals())
    view = HTMLFile('dtml/msOfficeFileView', globals())

    index_html = view
    #index_html = download

    #--------------------------------------------------------------------------#
    #def viewHTML(self):
    #--------------------------------------------------------------------------#
    #    fnameDoc = tempfile.mktemp()
    #    fnameHtml = tempfile.mktemp()
    #    f = open(fnameDoc,"wb")
    #    f.write(str(self.data))
    #    f.close()
    #    os.system("./lib/python/Products/CMF_MS_Files/wvWare -x ./lib/python/Products/CMF_MS_Files/wvHtml.xml " + fnameDoc + " > " + fnameHtml)
    #    f = open(fnameHtml,"rb")
    #    val = f.read()
    #    f.close()
    #    os.remove(fnameDoc)
    #    os.remove(fnameHtml)
    #    return val

##    def __call__(self, REQUEST, **kw):
##        return apply(self.view, (self, REQUEST), kw)

    #--------------------------------------------------------------------------#
    def PUT(self, REQUEST, RESPONSE):
    #--------------------------------------------------------------------------#
        """Handle HTTP(and presumably FTP?)PUT requests"""
        
        try:
            self.dav__init(REQUEST, RESPONSE)

            headers = {}
            for k, v in self.getMetadataHeaders():
                headers[k] = v

            if OLE_DEBUG: print "\n"
            if OLE_DEBUG: print "\n:BEFORE:\n"

            keys = headers.keys()
            keys.sort()
            for i in keys:
                if OLE_DEBUG: print "headers[", i, "]:", headers[i]
                continue
            
            body = REQUEST.get('BODY', '')

            import string
            if OLE_DEBUG: print "self.__name__:", self.__name__
            found = string.find(self.__name__, '~')

            sniffFmt, enc = OFS.content_types.guess_content_type(self.__name__, body)
            format = REQUEST.get_header('content-type', sniffFmt)
            if OLE_DEBUG: print "format:", format
            headers['Format'] = format
            
            if headers['Format'] in ( 'application/vnd.ms-excel',):
                try:
                    from Products.CMF_MS_Files.pylibole2 import getHeaders
                                        
                    headers = getHeaders(body, headers)

                    if OLE_DEBUG: print "\n"
                    if OLE_DEBUG: print "\n:AFTER:\n"

                    keys = headers.keys()
                    keys.sort()
                    for i in keys:
                        if OLE_DEBUG: print "headers[", i, "]:", headers[i]
                        continue
                    
                except:
                    if OLE_DEBUG: print "\n:ERROR:pylibole2.getHeaders(body):FAILED:\n"
                    pass

            #import pdb; pdb.set_trace()
            
            self.editMetadata( contributors = headers['Contributors']
                             , description = headers['Description']
                             , effective_date = headers['Effective_date']
                             , expiration_date = headers['Expiration_date']
                             , format = headers['Format']
                             , language = headers['Language']
                             , rights = headers['Rights']
                             , subject = headers['Subject']
                             , title = headers['Title']
                             )
            
            self.manage_upload(body)
            self.reindexObject()

            RESPONSE.setStatus(204)
            return RESPONSE
            
        except:
            import traceback
            traceback.print_exc()
            raise

Globals.default__class_init__(MsExcelFile)

from Products.CMFCore.register import registerPortalContent
registerPortalContent(MsExcelFile,                    # The class to be registered
                      constructors=(addMsExcelFile,), # It's factory (constructor)
                      action='Wizards/MsExcelFile',   # The URL of it's add interface
                      icon="MsExcelFile.gif",         # Filename to take icon from
                      productGlobals=globals())

--- Added File MsPowerPointFile.py in package CMF ---
# MsPowerPointFile.py
# John Platten
# 03.06.01
  
"""
"""

ADD_CONTENT_PERMISSION = 'Add portal content'

OLE_DEBUG = 1

from Globals import HTMLFile, HTML
from Products.CMFCore.PortalContent import PortalContent
from Products.CMFDefault.Discussions import Discussable
import Globals
from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl

from Products.CMFCore import CMFCorePermissions
from Products.CMFCore.WorkflowCore import WorkflowAction, afterCreate


import OFS.Image

import os
import tempfile

def addMsPowerPointFile( self
           , id
           , title=''
           , file=''
           , content_type=''
           , precondition=''
           , subject=()
           , description=''
           , contributors=()
           , effective_date=None
           , expiration_date=None
           , format='text/html'
           , language='en-US'
           , rights=''
           ):
    """
    Add a Microsoft Word Document
    """

    # cookId sets the id and title if they are not explicity specified
    id, title = OFS.Image.cookId(id, title, file)

    self=self.this()  # Why?

    # Instantiate the object and set it's description.
    # The description is not set by the constructor because I didn't
    # want to extend File's constructor.  Perhaps I should.
    fobj = MsPowerPointFile( id, title, '', content_type, precondition, subject
               , description, contributors, effective_date, expiration_date
               , format, language, rights
               )
    
    # Add the File instance to self
    self._setObject(id, fobj)

    # 'Upload' the file.  This is done now rather than in the
    # constructor because it's faster.  Why is it faster?
    self._getOb(id).manage_upload(file)

    afterCreate(self._getOb(id))

    """
    if RESPONSE is not None:
        RESPONSE.redirect(self.absolute_url()+'/folder_contents')
    """
        
class MsPowerPointFile( OFS.Image.File
          , PortalContent
          , DefaultDublinCoreImpl
          ):
    """
        A Portal-managed File
    """

    # The order of base classes is very significant in this case.
    # Image.File does not store it's id in it's 'id' attribute.
    # Rather, it has an 'id' method which returns the contents of the
    # instnace's __name__ attribute.  Inheriting in the other order
    # obscures this method, resulting in much pulling of hair and
    # gnashing of teeth and fraying of nerves.  Don't do it.
    #
    # Really.
    
    meta_type='MsPowerPointFile'
    effective_date = expiration_date = None
    _isDiscussable = 1
    icon = PortalContent.icon

    __ac_permissions__ = (
        (CMFCorePermissions.View, ('',)),
        (CMFCorePermissions.ModifyPortalContent, ('edit',)),
        )    
                             
    def __init__( self
                , id
                , title=''
                , file=''
                , content_type=''
                , precondition=''
                , subject=()
                , description=''
                , contributors=()
                , effective_date=None
                , expiration_date=None
                , format='text/html'
                , language='en-US'
                , rights=''
                ):
        OFS.Image.File.__init__( self, id, title, file
                               , content_type, precondition )
        DefaultDublinCoreImpl.__init__( self, title, subject, description
                               , contributors, effective_date, expiration_date
                               , format, language, rights )
    
    def SearchableText(self):
        """
        SeachableText is used for full text seraches of a portal.  It
        should return a concatanation of all useful text.
        """
        if OLE_DEBUG: print ":MsPowerPointFile:SearchableText:"
        val = ""
        #try:
        #    fnameDoc = tempfile.mktemp()
        #    if OLE_DEBUG: print ":MsPowerPointFile:SearchableText:fnameDoc:", fnameDoc

        #    fnameTxt = tempfile.mktemp()
        #    if OLE_DEBUG: print ":MsPowerPointFile:SearchableText:fnameTxt:", fnameTxt

        #    f = open(fnameDoc,"wb")
        #    f.write(str(self.data))
        #    f.close()

        #    command = "./lib/python/Products/CMF_MS_Files/wvWare -x ./lib/python/Products/CMF_MS_Files/wvText.xml " + fnameDoc + " > " + fnameTxt
        #    if OLE_DEBUG: print ":MsPowerPointFile:SearchableText:command:", command
            
        #    err = os.system(command)
        #    if OLE_DEBUG: print ":MsPowerPointFile:SearchableText:err:", err

        #    f = open(fnameTxt,"rb")
        #    val = f.read()
        #    f.close()

        #    os.remove(fnameDoc)
        #    os.remove(fnameTxt)

        #except:
        #    val = ""
        #    if OLE_DEBUG: print ":MsPowerPointFile:SearchableText:ExceptionHandler:val:", val
        #    pass

        return "%s %s %s" % (self.title, self.description, val)

    #--------------------------------------------------------------------------#
    def listActions(self, info):
    #--------------------------------------------------------------------------#

        content_url = info.content_url
        return ( 
                   { 'name'         : 'Edit'
                   , 'url'          :  content_url + '/editForm'
                   , 'permissions'  : ( 'Modify portal content', )
                   , 'category'     : 'object'
                   },
                   { 'name'         : 'Metadata'
                   , 'url'          :  content_url + '/metadata_edit_form'
                   , 'permissions'  : ( 'Modify portal content', )
                   , 'category'     : 'object'
                   },
                   { 'name'         : 'Download'
                   , 'url'          :  content_url + '/download'
                   , 'permissions'  : ( 'View', )
                   , 'category'     : 'object'
                   },
                   { 'name'         : 'View statistics'
                   , 'url'          :  content_url + '/view'
                   , 'permissions'  : ( 'View', )
                   , 'category'     : 'object'
                   },
               )

    def manage_afterAdd(self, item, container):
        """Both of my parents have an afterAdd method"""
        OFS.Image.File.manage_afterAdd(self, item, container)
        PortalContent.manage_afterAdd(self, item, container)

    def manage_beforeDelete(self, item, container):
        """Both of my parents have a beforeDelete method"""
        PortalContent.manage_beforeDelete(self, item, container)
        OFS.Image.File.manage_beforeDelete(self, item, container)

    def edit(self, precondition='', file=''):
        """
        Perform changes for user
        """
        if precondition: self.precondition = precondition
        elif self.precondition: del self.precondition

        if file.filename != '' and file.read() != '':
            self.manage_upload(file)

        self.setFormat(self.content_type)
        #self.reindexObject()

    edit = WorkflowAction(edit)

    def download(self, REQUEST, RESPONSE):
        """
        Download this item.  Calls OFS.Image.File.index_html to perform the
        actual transfer after first setting Content-Disposition to suggest
        a filename.
        """

        RESPONSE.setHeader('Content-Disposition',
                           'attachment; filename="%s"' % self.id())
        return OFS.Image.File.index_html(self, REQUEST, RESPONSE)

    editForm = HTMLFile('dtml/msOfficeFileEdit', globals())
    #viewHTMLForm = HTMLFile('dtml/msOfficeFileViewHTML', globals())
    view = HTMLFile('dtml/msOfficeFileView', globals())

    index_html = view
    #index_html = download

    #--------------------------------------------------------------------------#
    #def viewHTML(self):
    #--------------------------------------------------------------------------#
    #    fnameDoc = tempfile.mktemp()
    #    fnameHtml = tempfile.mktemp()
    #    f = open(fnameDoc,"wb")
    #    f.write(str(self.data))
    #    f.close()
    #    os.system("./lib/python/Products/CMF_MS_Files/wvWare -x ./lib/python/Products/CMF_MS_Files/wvHtml.xml " + fnameDoc + " > " + fnameHtml)
    #    f = open(fnameHtml,"rb")
    #    val = f.read()
    #    f.close()
    #    os.remove(fnameDoc)
    #    os.remove(fnameHtml)
    #    return val

##    def __call__(self, REQUEST, **kw):
##        return apply(self.view, (self, REQUEST), kw)

    #--------------------------------------------------------------------------#
    def PUT(self, REQUEST, RESPONSE):
    #--------------------------------------------------------------------------#
        """Handle HTTP(and presumably FTP?)PUT requests"""
        
        try:
            self.dav__init(REQUEST, RESPONSE)

            headers = {}
            for k, v in self.getMetadataHeaders():
                headers[k] = v

            if OLE_DEBUG: print "\n"
            if OLE_DEBUG: print "\n:BEFORE:\n"

            keys = headers.keys()
            keys.sort()
            for i in keys:
                if OLE_DEBUG: print "headers[", i, "]:", headers[i]
                continue
            
            body = REQUEST.get('BODY', '')

            import string
            if OLE_DEBUG: print "self.__name__:", self.__name__
            found = string.find(self.__name__, '~')

            sniffFmt, enc = OFS.content_types.guess_content_type(self.__name__, body)
            format = REQUEST.get_header('content-type', sniffFmt)
            if OLE_DEBUG: print "format:", format
            headers['Format'] = format
            
            if headers['Format'] in ( 'application/vnd.ms-powerpoint',):
                try:
                    from Products.CMF_MS_Files.pylibole2 import getHeaders
                                        
                    headers = getHeaders(body, headers)

                    if OLE_DEBUG: print "\n"
                    if OLE_DEBUG: print "\n:AFTER:\n"

                    keys = headers.keys()
                    keys.sort()
                    for i in keys:
                        if OLE_DEBUG: print "headers[", i, "]:", headers[i]
                        continue
                    
                except:
                    if OLE_DEBUG: print "\n:ERROR:pylibole2.getHeaders(body):FAILED:\n"
                    pass

            #import pdb; pdb.set_trace()
            
            self.editMetadata( contributors = headers['Contributors']
                             , description = headers['Description']
                             , effective_date = headers['Effective_date']
                             , expiration_date = headers['Expiration_date']
                             , format = headers['Format']
                             , language = headers['Language']
                             , rights = headers['Rights']
                             , subject = headers['Subject']
                             , title = headers['Title']
                             )
            
            self.manage_upload(body)
            self.reindexObject()

            RESPONSE.setStatus(204)
            return RESPONSE
            
        except:
            import traceback
            traceback.print_exc()
            raise

Globals.default__class_init__(MsPowerPointFile)

from Products.CMFCore.register import registerPortalContent
registerPortalContent(MsPowerPointFile,                    # The class to be registered
                      constructors=(addMsPowerPointFile,), # It's factory (constructor)
                      action='Wizards/MsPowerPointFile',   # The URL of it's add interface
                      icon="MsPowerPointFile.gif",         # Filename to take icon from
                      productGlobals=globals())

--- Added File MsWordFile.py in package CMF ---
# MsWordFile.py
# John Platten
# 03.06.01
  
"""
"""

ADD_CONTENT_PERMISSION = 'Add portal content'

OLE_DEBUG = 1

command_str = None
command2_str = None

from Globals import HTMLFile, HTML
from Products.CMFCore.PortalContent import PortalContent
from Products.CMFDefault.Discussions import Discussable
import Globals
from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl

from Products.CMFCore import CMFCorePermissions
from Products.CMFCore.WorkflowCore import WorkflowAction, afterCreate


import OFS.Image

import os
import tempfile

def addMsWordFile( self
           , id
           , title=''
           , file=''
           , content_type=''
           , precondition=''
           , subject=()
           , description=''
           , contributors=()
           , effective_date=None
           , expiration_date=None
           , format='text/html'
           , language='en-US'
           , rights=''
           ):
    """
    Add a Microsoft Word Document
    """

    # cookId sets the id and title if they are not explicity specified
    id, title = OFS.Image.cookId(id, title, file)

    self=self.this()  # Why?

    # Instantiate the object and set it's description.
    # The description is not set by the constructor because I didn't
    # want to extend File's constructor.  Perhaps I should.
    fobj = MsWordFile( id, title, '', content_type, precondition, subject
               , description, contributors, effective_date, expiration_date
               , format, language, rights
               )
    
    # Add the File instance to self
    self._setObject(id, fobj)

    # 'Upload' the file.  This is done now rather than in the
    # constructor because it's faster.  Why is it faster?
    self._getOb(id).manage_upload(file)

    afterCreate(self._getOb(id))

    """
    if RESPONSE is not None:
        RESPONSE.redirect(self.absolute_url()+'/folder_contents')
    """
        
class MsWordFile( OFS.Image.File
          , PortalContent
          , DefaultDublinCoreImpl
          ):
    """
        A Portal-managed File
    """

    # The order of base classes is very significant in this case.
    # Image.File does not store it's id in it's 'id' attribute.
    # Rather, it has an 'id' method which returns the contents of the
    # instnace's __name__ attribute.  Inheriting in the other order
    # obscures this method, resulting in much pulling of hair and
    # gnashing of teeth and fraying of nerves.  Don't do it.
    #
    # Really.
    
    meta_type='MsWordFile'
    effective_date = expiration_date = None
    _isDiscussable = 1
    icon = PortalContent.icon

    __ac_permissions__ = (
        (CMFCorePermissions.View, ('',)),
        (CMFCorePermissions.ModifyPortalContent, ('edit',)),
        )    
                             
    def __init__( self
                , id
                , title=''
                , file=''
                , content_type=''
                , precondition=''
                , subject=()
                , description=''
                , contributors=()
                , effective_date=None
                , expiration_date=None
                , format='text/html'
                , language='en-US'
                , rights=''
                ):
        OFS.Image.File.__init__( self, id, title, file
                               , content_type, precondition )
        DefaultDublinCoreImpl.__init__( self, title, subject, description
                               , contributors, effective_date, expiration_date
                               , format, language, rights )
    
    def SearchableText(self):
        """
        SeachableText is used for full text seraches of a portal.  It
        should return a concatanation of all useful text.
        """
        if OLE_DEBUG: print ":MsWordFile:SearchableText:"

        try:
            fnameDoc = tempfile.mktemp()
            if OLE_DEBUG: print ":MsWordFile:SearchableText:fnameDoc:", fnameDoc

            fnameTxt = tempfile.mktemp()
            if OLE_DEBUG: print ":MsWordFile:SearchableText:fnameTxt:", fnameTxt

            f = open(fnameDoc,"wb")
            f.write(str(self.data))
            f.close()

            global command_str
            if command_str == None:
                if os.environ.has_key('WV_WARE_LOCATION'):
                    command_str = os.environ['WV_WARE_LOCATION'] + "/wvWare -x "
                else:
                    command_str = "./Products/CMF_MS_Files/wvWare -x "
                if os.environ.has_key('WV_WARE_XML_FILES'):
                    command_str = command_str + os.environ['WV_WARE_XML_FILES'] + "/wvText.xml %s > %s"
                else:
                    command_str = command_str + "./Products/CMF_MS_Files/wvText.xml %s > %s"
            command = command_str % (fnameDoc, fnameTxt)
            if OLE_DEBUG: print ":MsWordFile:SearchableText:command:", command
            
            err = os.system(command)
            if OLE_DEBUG: print ":MsWordFile:SearchableText:err:", err

            f = open(fnameTxt,"rb")
            val = f.read()
            f.close()

            os.remove(fnameDoc)
            os.remove(fnameTxt)

        except:
            val = ""
            if OLE_DEBUG: print ":MsWordFile:SearchableText:ExceptionHandler:val:", val
            pass

        return "%s %s %s" % (self.title, self.description, val)

    #--------------------------------------------------------------------------#
    def listActions(self, info):
    #--------------------------------------------------------------------------#

        content_url = info.content_url
        return ( 
                   { 'name'         : 'View HTML'
                   , 'url'          :  content_url + '/viewHTMLForm'
                   , 'permissions'  : ( 'View', )
                   , 'category'     : 'object'
                   }
                 , { 'name'         : 'Edit'
                   , 'url'          :  content_url + '/editForm'
                   , 'permissions'  : ( 'Modify portal content', )
                   , 'category'     : 'object'
                   }
                 , { 'name'         : 'Metadata'
                   , 'url'          :  content_url + '/metadata_edit_form'
                   , 'permissions'  : ( 'Modify portal content', )
                   , 'category'     : 'object'
                   }
                 , { 'name'         : 'Download'
                   , 'url'          :  content_url + '/download'
                   , 'permissions'  : ( 'View', )
                   , 'category'     : 'object'
                   }
                 , { 'name'         : 'View statistics'
                   , 'url'          :  content_url + '/view'
                   , 'permissions'  : ( 'View', )
                   , 'category'     : 'object'
                   }
               )

    def manage_afterAdd(self, item, container):
        """Both of my parents have an afterAdd method"""
        OFS.Image.File.manage_afterAdd(self, item, container)
        PortalContent.manage_afterAdd(self, item, container)

    def manage_beforeDelete(self, item, container):
        """Both of my parents have a beforeDelete method"""
        PortalContent.manage_beforeDelete(self, item, container)
        OFS.Image.File.manage_beforeDelete(self, item, container)

    def edit(self, precondition='', file=''):
        """
        Perform changes for user
        """
        if precondition: self.precondition = precondition
        elif self.precondition: del self.precondition

        if file.filename != '' and file.read() != '':
            self.manage_upload(file)

        self.setFormat(self.content_type)
        #self.reindexObject()

    edit = WorkflowAction(edit)

    def download(self, REQUEST, RESPONSE):
        """
        Download this item.  Calls OFS.Image.File.index_html to perform the
        actual transfer after first setting Content-Disposition to suggest
        a filename.
        """

        RESPONSE.setHeader('Content-Disposition',
                           'attachment; filename="%s"' % self.id())
        return OFS.Image.File.index_html(self, REQUEST, RESPONSE)

    editForm = HTMLFile('dtml/msOfficeFileEdit', globals())
    viewHTMLForm = HTMLFile('dtml/msOfficeFileViewHTML', globals())
    view = HTMLFile('dtml/msOfficeFileView', globals())

    index_html = view
    #index_html = download

    #--------------------------------------------------------------------------#
    def viewHTML(self):
    #--------------------------------------------------------------------------#
        fnameDoc = tempfile.mktemp()
        fnameHtml = tempfile.mktemp()
        f = open(fnameDoc,"wb")
        f.write(str(self.data))
        f.close()
        global command2_str
        if command2_str == None:
            if os.environ.has_key('WV_WARE_LOCATION'):
                command2_str = os.environ['WV_WARE_LOCATION'] + "/wvWare -x "
            else:
                command2_str = "./Products/CMF_MS_Files/wvWare -x "
            if os.environ.has_key('WV_WARE_XML_FILES'):
                command2_str = command2_str + os.environ['WV_WARE_XML_FILES'] + "/wvHtml.xml %s > %s"
            else:
                command2_str = command2_str + "./Products/CMF_MS_Files/wvHtml.xml %s > %s"
        command = command2_str % (fnameDoc, fnameHtml)
        os.system(command)
        f = open(fnameHtml,"rb")
        val = f.read()
        f.close()
        os.remove(fnameDoc)
        os.remove(fnameHtml)
        return val

##    def __call__(self, REQUEST, **kw):
##        return apply(self.view, (self, REQUEST), kw)

    #--------------------------------------------------------------------------#
    def PUT(self, REQUEST, RESPONSE):
    #--------------------------------------------------------------------------#
        """Handle HTTP(and presumably FTP?)PUT requests"""
        
        try:
            self.dav__init(REQUEST, RESPONSE)

            headers = {}
            for k, v in self.getMetadataHeaders():
                headers[k] = v

            if OLE_DEBUG: print "\n"
            if OLE_DEBUG: print "\n:BEFORE:\n"

            keys = headers.keys()
            keys.sort()
            for i in keys:
                if OLE_DEBUG: print "headers[", i, "]:", headers[i]
                continue
            
            body = REQUEST.get('BODY', '')

            import string
            if OLE_DEBUG: print "self.__name__:", self.__name__
            found = string.find(self.__name__, '~')

            sniffFmt, enc = OFS.content_types.guess_content_type(self.__name__, body)
            format = REQUEST.get_header('content-type', sniffFmt)
            if OLE_DEBUG: print "format:", format
            headers['Format'] = format
            
            if headers['Format'] in ( 'application/msword', 'application/octet-stream', ):
                try:
                    from Products.CMF_MS_Files.pylibole2 import getHeaders
                                        
                    headers = getHeaders(body, headers)

                    if OLE_DEBUG: print "\n"
                    if OLE_DEBUG: print "\n:AFTER:\n"

                    keys = headers.keys()
                    keys.sort()
                    for i in keys:
                        if OLE_DEBUG: print "headers[", i, "]:", headers[i]
                        continue
                    
                except:
                    if OLE_DEBUG: print "\n:ERROR:pylibole2.getHeaders(body):FAILED:\n"
                    pass

            
            self.editMetadata( contributors = headers['Contributors']
                             , description = headers['Description']
                             , effective_date = headers['Effective_date']
                             , expiration_date = headers['Expiration_date']
                             , format = headers['Format']
                             , language = headers['Language']
                             , rights = headers['Rights']
                             , subject = headers['Subject']
                             , title = headers['Title']
                             )
            
            self.manage_upload(body)
            self.reindexObject()

            RESPONSE.setStatus(204)
            return RESPONSE
            
        except:
            import traceback
            traceback.print_exc()
            raise

Globals.default__class_init__(MsWordFile)

from Products.CMFCore.register import registerPortalContent
registerPortalContent(MsWordFile,                    # The class to be registered
                      constructors=(addMsWordFile,), # It's factory (constructor)
                      action='Wizards/MsWordFile',   # The URL of it's add interface
                      icon="MsWordFile.gif",         # Filename to take icon from
                      productGlobals=globals())

--- Added File __init__.py in package CMF ---
#------------------------------------------------------------------------------#
# __init__.py
# John Platten
# 03.06.01
#------------------------------------------------------------------------------#

ADD_CONTENT_PERMISSION = 'Add portal content'

import MsWordFile
import MsExcelFile
import MsPowerPointFile
from Products.CMFCore import utils
import Products.CMFCore

#------------------------------------------------------------------------------#

bases = (MsWordFile.MsWordFile,MsExcelFile.MsExcelFile,MsPowerPointFile.MsPowerPointFile)
contentClasses = (MsWordFile.MsWordFile,MsExcelFile.MsExcelFile,MsPowerPointFile.MsPowerPointFile)
contentConstructors = (MsWordFile.addMsWordFile,MsExcelFile.addMsExcelFile,MsPowerPointFile.addMsPowerPointFile)

import sys
this_module = sys.modules[ __name__ ]

z_bases = utils.initializeBasesPhase1(bases, this_module)

#------------------------------------------------------------------------------#
def initialize(context):
#------------------------------------------------------------------------------#

    factory_type_information = (
                                {'id': 'MS Word File', 'meta_type': 'MsWordFile', 'description':
                                 'File objects of Microsoft Word format.',
                                 'product':'CMF_MS_Files', 'factory':'addMsWordFile', 'icon': 'MsWordFile.gif',
                                 'immediate_view':'metadata_edit_form', 'actions':
                                 ({'name': 'View statistics',
                                   'action': 'view',
                                   'permissions': ('View',)},
                                  {'name': 'Download',
                                   'action': 'download',
                                   'permissions': ('View',)},
                                  {'name': 'Edit',
                                   'action': 'file_edit_form',
                                   'permissions': ('Modify portal content',)},
                                  {'name': 'Metadata',
                                   'action': 'metadata_edit_form',
                                   'permissions': ('Modify portal content',)},
                                  ),
                                 },
                                {'id': 'MS Excel File', 'meta_type': 'MsExcelFile', 'description':
                                 'File objects of Microsoft Excel format.',
                                 'product':'CMF_MS_Files', 'factory':'addMsExcelFile', 'icon': 'MsExcelFile.gif',
                                 'immediate_view':'metadata_edit_form', 'actions':
                                 ({'name': 'View statistics',
                                   'action': 'view',
                                   'permissions': ('View',)},
                                  {'name': 'Download',
                                   'action': 'download',
                                   'permissions': ('View',)},
                                  {'name': 'Edit',
                                   'action': 'file_edit_form',
                                   'permissions': ('Modify portal content',)},
                                  {'name': 'Metadata',
                                   'action': 'metadata_edit_form',
                                   'permissions': ('Modify portal content',)},
                                  ),
                                 },
                                {'id': 'MS Power Point File', 'meta_type': 'MsPowerPointFile', 'description':
                                 'File objects of Microsoft Power Point format.',
                                 'product':'CMF_MS_Files', 'factory':'addMsPowerPointFile', 'icon': 'MsPowerPointFile.gif',
                                 'immediate_view':'metadata_edit_form', 'actions':
                                 ({'name': 'View statistics',
                                   'action': 'view',
                                   'permissions': ('View',)},
                                  {'name': 'Download',
                                   'action': 'download',
                                   'permissions': ('View',)},
                                  {'name': 'Edit',
                                   'action': 'file_edit_form',
                                   'permissions': ('Modify portal content',)},
                                  {'name': 'Metadata',
                                   'action': 'metadata_edit_form',
                                   'permissions': ('Modify portal content',)},
                                  ),
                                 },
                               )
    utils.initializeBasesPhase2(z_bases, context)

    context.registerHelp()
    utils.ContentInit( 'CMF Microsoft Content'
                     , content_types=contentClasses
                     , permission=ADD_CONTENT_PERMISSION
                     , extra_constructors=contentConstructors
                     , fti=factory_type_information
                     ).initialize( context )

    utils.registerIcon(MsWordFile.MsWordFile,
                       'images/MsWordFile.gif', globals())
    utils.registerIcon(MsExcelFile.MsExcelFile,
                       'images/MsExcelFile.gif', globals())
    utils.registerIcon(MsPowerPointFile.MsPowerPointFile,
                       'images/MsPowerPointFile.gif', globals())



    Products.CMFCore.PortalFolder.addPortalTypeHandler('application/msword', MsWordFile.MsWordFile)
    Products.CMFCore.PortalFolder.addPortalTypeHandler('application/octet-stream', MsWordFile.MsWordFile)
    Products.CMFCore.PortalFolder.addPortalTypeHandler('application/vnd.ms-excel', MsExcelFile.MsExcelFile)
    Products.CMFCore.PortalFolder.addPortalTypeHandler('application/vnd.ms-powerpoint', MsPowerPointFile.MsPowerPointFile)
    #Products.CMFCore.PortalFolder.addPortalTypeHandler('application/vnd.ms-project', MsOfficeFile.MsOfficeFile)

#------------------------------------------------------------------------------#

--- Added File wvHtml.xml in package CMF ---
<main>
<charentity>
<begin>HTML</begin>
</charentity>

<document>
<begin>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/REC-html40/loose.dtd&quot;&gt;
&lt;html&gt; 
&lt;head&gt; 
&lt;META HTTP-EQUIV=&quot;Content-Type&quot; CONTENT=&quot;text/html; charset=<charset/>&quot;&gt;
&lt;META NAME=&quot;GENERATOR&quot; CONTENT=&quot;wvWare/<version/>&quot;&gt;
&lt;title&gt; 
<title/>
&lt;/title&gt; 
&lt;/head&gt; 
&lt;body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot; link=&quot;#0000ee&quot; vlink=&quot;#551a8b&quot;&gt;
</begin>
<end>
&lt;!--
&lt;hr&gt;
&lt;address&gt;
&lt;a href=&quot;http://wvware.sourceforge.net/&quot;&gt;&lt;img
src=&quot;wvSmall.gif&quot; height=31 width=47
align=left border=0 alt=&quot;wvWare&quot;&gt;&lt;/a&gt;
&lt;a href=&quot;http://validator.w3.org/check/referer&quot;&gt;&lt;img
src=&quot;vh40.gif&quot; height=31 width=88
align=right border=0 alt=&quot;Valid HTML 4.0!&quot;&gt;&lt;/a&gt;
Document created with &lt;a href=&quot;http://wvware.sourceforge.net/&quot;&gt;wvWare/<version/>&lt;/a&gt;&lt;br&gt;
&lt;/address&gt;
--&gt;
&lt;/body&gt;
&lt;/html&gt;
</end>
</document>

<section>
<begin>
&lt;!--Section Begins--&gt;&lt;br&gt;
</begin>
<end>
&lt;!--Section Ends--&gt;
</end>
</section>

<justification>
<left>left</left>
<right>right</right>
<center>center</center>
<block>justify</block>
<asian>&lt;!--Could Someone who sees this tag tell me what was is this type of justification, asian languages only i thing--&gt;</asian>
</justification>

<numbering>
<Arabic>type=&quot;1&quot;</Arabic>
<UpperRoman>type=&quot;I&quot;</UpperRoman>
<LowerRoman>type=&quot;i&quot;</LowerRoman>
<UpperCaseN>type=&quot;A&quot;</UpperCaseN>
<LowerCaseN>type=&quot;a&quot;</LowerCaseN>
</numbering>

<border>
<noned>none</noned>
<singled>solid</singled>
<thickd>solid</thickd>
<doubled>double</doubled>
<number4d>double</number4d>
<hairlined>solid</hairlined>
<dotd>dotted</dotd>
<dashlargegapd>dashed</dashlargegapd>
<dotdashd>dotted</dotdashd>
<dotdotdashd>dotted</dotdotdashd>
<tripled>double</tripled>
<thin-thicksmallgapd>dashed</thin-thicksmallgapd>
<thick-thinsmallgapd>dashed</thick-thinsmallgapd>
<thin-thick-thinsmallgapd>dashed</thin-thick-thinsmallgapd>
<thin-thickmediumgapd>dashed</thin-thickmediumgapd>
<thick-thinmediumgapd>dashed</thick-thinmediumgapd>
<thin-thick-thinmediumgapd>dashed</thin-thick-thinmediumgapd>
<thin-thicklargegapd>dashed</thin-thicklargegapd>
<thick-thinlargegapd>dashed</thick-thinlargegapd>
<thin-thick-thinlargegapd>dashed</thin-thick-thinlargegapd>
<waved>solid</waved>
<doublewaved>double</doublewaved>
<dashsmallgapd>sashed</dashsmallgapd>
<dashdotstrokedd>dashed</dashdotstrokedd>
<emboss3Dd>ridge</emboss3Dd>
<engrave3Dd>groove</engrave3Dd>
<defaultd>ridge</defaultd>
</border>

<olist>
<begin>&lt;ol <nfc/> start=&quot;<start/>&quot;&gt;
</begin>
<end>&lt;/ol&gt;</end>
</olist>

<ulist>
<begin>&lt;ul&gt;
</begin>
<end>&lt;/ul&gt;</end>
</ulist>

<entry>
<begin>&lt;li&gt;</begin>
<end>&lt;/li&gt;</end>
</entry>


<!-- 
this tableoverride option can be used to turn off handling of
these tags in tables, which I find is necessary for at least netscape
-->
<tableoverrides>
<ParaBefore>0</ParaBefore>
<ParaRight>0</ParaRight>
<ParaAfter>0</ParaAfter>
<ParaLeft>0</ParaLeft>
<ParaLeft1>0</ParaLeft1>
<VertMergedCells>0</VertMergedCells>
</tableoverrides>

<table>
<begin>&lt;table width=&quot;<tablerelwidth/>%&quot; border=&quot;1&quot; cols=&quot;<no_cols/>&quot; rows=&quot;<no_rows/>&quot;&gt;</begin>
<end>&lt;/table&gt;</end>
</table>

<row>
<begin>&lt;tr&gt;</begin>
<end>&lt;/tr&gt;</end>
</row>

<cell>
<begin>&lt;td bgcolor=&quot;<cellbgcolor/>&quot; width=&quot;<cellrelwidth/>%&quot; rowspan=&quot;<rowspan/>&quot; colspan=&quot;<colspan/>&quot;&gt;</begin>
<end>&lt;/td&gt;</end>
</cell>

<paragraph>
<begin>
<table.end/>
<table.begin/>
<row.begin/><cell.begin/><olist.end/><olist.begin/><ulist.end/><ulist.begin/><entry.begin/><text.begin/>
</begin>
<end>
<text.end/><entry.end/><olist.end/><ulist.end/><cell.end/><row.end/>
</end>
</paragraph>

<!-- these are all the character properties that can show up in word -->
<bold><begin>&lt;b&gt;</begin><end>&lt;/b&gt;</end></bold>
<italic><begin>&lt;i&gt;</begin><end>&lt;/i&gt;</end></italic>

<!--
text that has been deleted and will be displayed with strikethrough when
revision marked text is to be displayed

use either this line...
--> 
<RMarkDel><begin>&lt;s&gt;</begin><end>&lt;/s&gt;&lt;a href=&quot;#author<ibstRMarkDel/>&quot;&gt;[Author ID<ibstRMarkDel/>: at <dttmRMarkDel/> ]&lt;/a&gt;</end></RMarkDel>

<!--
or uncomment below to make deleted text dissappear (well, become commented out)
-->
<!--
<RMarkDel><begin>&lt;!-&#45;</begin><end>-&#45;&gt;</end></RMarkDel>
-->

<!-- I don't even know what outline means -->
<outline><begin></begin><end></end></outline>
<smallcaps><begin></begin><end></end></smallcaps>
<caps><begin></begin><end></end></caps>
<vanish><begin></begin><end></end></vanish>

<!--If you uncomment this then the annotation text links will become commented out by html tags-->
<!--
<vanish><begin>&lt;!-&#45;</begin><end>-&#45;&gt;</end></vanish>
-->

<!--
text that has been newly typed since the last time revision marks have been accepted
and will be displayed with underline when revision marked text is to be displayed

use either this line...
-->
<RMark><begin>&lt;u&gt;</begin><end>&lt;/u&gt;&lt;a href=&quot;#author<ibstRMark/>&quot;&gt;[Author ID<ibstRMark/>: at <dttmRMark/>]&lt;/a&gt;</end></RMark>

<!--
or uncomment below to make the underline dissappear
-->
<!--
<RMark><begin></begin><end></end></RMark>
-->


<strike><begin>&lt;s&gt;</begin><end>&lt;/s&gt;</end></strike>
<shadow><begin></begin><end></end></shadow>
<lowercase><begin></begin><end></end></lowercase>
<emboss><begin></begin><end></end></emboss>
<imprint><begin></begin><end></end></imprint>
<!--double strike-->
<dstrike><begin>&lt;s&gt;</begin><end>&lt;/s&gt;</end></dstrike>

<!--
ftc's
&
hps

keep them for font face and do that later.
-->

<super><begin>&lt;sup&gt;</begin><end>&lt;/sup&gt;</end></super>
<sub><begin>&lt;sub&gt;</begin><end>&lt;/sub&gt;</end></sub>

<singleu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></singleu>
<wordu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></wordu>
<doubleu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></doubleu>
<dottedu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dottedu>
<hiddenu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></hiddenu>
<thicku><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></thicku>
<dashu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dashu>
<dotu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dotu>
<dotdashu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dotdashu>
<dotdotdashu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></dotdotdashu>
<waveu><begin>&lt;u&gt;</begin><end>&lt;/u&gt;</end></waveu>

<!--
text whose properties have been changed since the last time revision marks have been accepted
and will be displayed with a note showing the change points.

use either this line (which admit it a bit scary looking, but harmless)...
--> 
<PropRMark><begin>&lt;a href=&quot;#author<ibstPropRMark/>&quot;&gt;-&#45;&amp;gt;&lt;/a&gt;</begin><end>&lt;a href=&quot;#author<ibstPropRMark/>&quot;&gt;[Author ID<ibstPropRMark/>: at <dttmPropRMark/>]&lt;/a&gt;</end></PropRMark>

<!--
or uncomment below to make the notes dissappear
-->
<!--
<PropRMark><begin></begin><end></end></PropRMark>
-->

<!--
<color>
-->
<Black><begin>Black</begin><end></end></Black>
<Blue><begin>Blue</begin><end></end></Blue>
<Cyan><begin>Cyan</begin><end></end></Cyan>
<Green><begin>Green</begin><end></end></Green>
<Magenta><begin>Magenta</begin><end></end></Magenta>
<Red><begin>Red</begin><end></end></Red>
<Yellow><begin>Yellow</begin><end></end></Yellow>
<White><begin>White</begin><end></end></White>
<DkBlue><begin>DarkBlue</begin><end></end></DkBlue>
<DkCyan><begin>DarkCyan</begin><end></end></DkCyan>
<DkGreen><begin>DarkGreen</begin><end></end></DkGreen>
<DkMagenta><begin>DarkMagenta</begin><end></end></DkMagenta>
<DkRed><begin>DarkRed</begin><end></end></DkRed>
<DkYellow><begin>#8b8b00</begin><end></end></DkYellow>
<DkGray><begin>DarkGray</begin><end></end></DkGray>
<LtGray><begin>LightGrey</begin><end></end></LtGray>
<!--
</color>
-->

<!--
<animation>
-->
<LasVegas><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></LasVegas>
<BackgroundBlink><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></BackgroundBlink>
<SparkleText><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></SparkleText>
<MarchingAnts><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></MarchingAnts>
<MarchingRedAnts><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></MarchingRedAnts>
<Shimmer><begin>&lt;blink&gt;</begin><end>&lt;/blink&gt;</end></Shimmer>
<!--
</animation>
-->

<!--
I dont understand what this one is, and ive never come across it

use this sample line (which admit it a bit scary looking, but harmless)...
-->
<DispFldRMark><begin>&lt;a href=&quot;#author<ibstDispFldRMark/>&quot;&gt;--&amp;gt;&lt;/a&gt;</begin><end>&lt;a href=&quot;#author<ibstDispFldRMark/>&quot;&gt;[Author ID<ibstDispFldRMark/>: at <dttmDispFldRMark/> (<xstDispFldRMark/>)]&lt;/a&gt;</end></DispFldRMark>

<!--
or uncomment below to ignore it, the previous might even crash wv ?
-->
<!--
<DispFldRMark><begin></begin><end></end></DispFldRMark>
-->

<animation>
<begin><LasVegas.begin/><BackgroundBlink.begin/><SparkleText.begin/><MarchingAnts.begin/><MarchingRedAnts.begin/><Shimmer.begin/></begin>
<end><Shimmer.end/><MarchingRedAnts.end/><MarchingAnts.end/><SparkleText.end/><BackgroundBlink.end/><LasVegas.end/></end>
</animation>

<fontstr>
<begin>&lt;font color=&quot;<black.begin/><blue.begin/><cyan.begin/><green.begin/><magenta.begin/><red.begin/><yellow.begin/><white.begin/><dkblue.begin/><dkcyan.begin/><dkgreen.begin/><dkmagenta.begin/><dkred.begin/><dkyellow.begin/><dkgray.begin/><ltgray.begin/>&quot;&gt;</begin>
<end><ltgray.end/><dkgray.end/><dkyellow.end/><dkred.end/><dkmagenta.end/><dkgreen.end/><dkcyan.end/><dkblue.end/><white.end/><yellow.end/><red.end/><magenta.end/><green.end/><cyan.end/><blue.end/><black.end/>&lt;/font&gt;</end>
</fontstr>

<comment>
<begin>
&lt;a href=&quot;#comment<ibstAnno/> &quot;&gt;-&#45;&amp;gt;&lt;/a&gt;
</begin>
<end>&lt;a href=&quot;#comment<ibstAnno/> &quot;&gt;[Author:<xstUsrInitl/>]&lt;/a&gt;
</end>
</comment>

<style name="Normal">
<character>
<begin><PropRMark.begin/><DispFldRMark.begin/><animation.begin/><fontstr.begin/><bold.begin/><italic.begin/><strike.begin/><RMarkDel.begin/><outline.begin/><smallcaps.begin/><caps.begin/><vanish.begin/><RMark.begin/><shadow.begin/><lowercase.begin/><emboss.begin/><imprint.begin/><dstrike.begin/><super.begin/><sub.begin/><singleu.begin/><wordu.begin/><doubleu.begin/><dottedu.begin/><hiddenu.begin/><thicku.begin/><dashu.begin/><dotu.begin/><dotdashu.begin/><dotdotdashu.begin/><waveu.begin/></begin>
<end><waveu.end/><dotdotdashu.end/><dotdashu.end/><dotu.end/><dashu.end/><thicku.end/><hiddenu.end/><dottedu.end/><doubleu.end/><wordu.end/><singleu.end/><sub.end/><super.end/><dstrike.end/><imprint.end/><emboss.end/><lowercase.end/><shadow.end/><RMark.end/><vanish.end/><caps.end/><smallcaps.end/><outline.end/><RMarkDel.end/><strike.end/><italic.end/><bold.end/><fontstr.end/><animation.end/><DispFldRMark.end/><PropRMark.end/></end>
</character>

<!-- Netscape does handle this correctly yet, here is how each different side of the border should work.
border-top: thin <bordertopstyle/> <bordertopcolor/>;
border-left: thin <borderleftstyle/> <borderleftcolor/>;
border-right: thin <borderrightstyle/> <borderrightcolor/>;
border-bottom: thin <borderbottomstyle/> <borderbottomcolor/>
-->


<pmargin>
<begin>margin: <mmParaBefore/> <mmParaRight/> <mmParaAfter/> <mmParaLeft/>;</begin>
</pmargin>

<pborder>
<begin>
border: thin <borderleftstyle/> <borderleftcolor/>;
<!--
border-top: thin <bordertopstyle/> <bordertopcolor/>;
border-left: thin <borderleftstyle/> <borderleftcolor/>;
border-right: thin <borderrightstyle/> <borderrightcolor/>;
border-bottom: thin <borderbottomstyle/> <borderbottomcolor/>
-->
</begin>
</pborder>

<text>	
<begin>&lt;p&gt;&lt;div align=&quot;<just/>&quot; style=&quot;<paramargin/> <paraborder/> padding: <mmPadTop/> <mmPadRight/> <mmPadBottom/> <mmPadLeft/>; &quot;&gt; &lt;p style=&quot;text-indent: <mmParaLeft1/>; text-align: <just/>; line-height: <mmLineHeight/>; color: <parafgcolor/>; background-color: <parabgcolor/>; &quot;&gt;</begin>
<end>&lt;/p&gt;&lt;/div&gt;</end>
</text>

<picture>
<begin>
&lt;img <htmlAlignGuess/> width=&quot;<pixPicWidth/>&quot; height=&quot;<pixPicHeight/>&quot; alt=&quot;0x01 graphic&quot; src=&quot;placeholder.png&quot;&gt;<htmlNextLineGuess/>
</begin>
</picture>

</style>

<!--we need to be override the character properties-->
<!--
<style name="Normal">
<character>
<begin><PropRMark.begin/><DispFldRMark.begin/><animation.begin/><fontstr.begin/><bold.begin/><italic.begin/><strike.begin/><RMarkDel.begin/><outline.begin/><smallcaps.begin/><caps.begin/><vanish.begin/><RMark.begin/><shadow.begin/><lowercase.begin/><emboss.begin/><imprint.begin/><dstrike.begin/><super.begin/><sub.begin/><singleu.begin/><wordu.begin/><doubleu.begin/><dottedu.begin/><hiddenu.begin/><thicku.begin/><dashu.begin/><dotu.begin/><dotdashu.begin/><dotdotdashu.begin/><waveu.begin/></begin>
<end><waveu.end/><dotdotdashu.end/><dotdashu.end/><dotu.end/><dashu.end/><thicku.end/><hiddenu.end/><dottedu.end/><doubleu.end/><wordu.end/><singleu.end/><sub.end/><super.end/><dstrike.end/><imprint.end/><emboss.end/><lowercase.end/><shadow.end/><RMark.end/><vanish.end/><caps.end/><smallcaps.end/><outline.end/><RMarkDel.end/><strike.end/><italic.end/><bold.end/><fontstr.end/><animation.end/><DispFldRMark.end/><PropRMark.end/></end>
</character>

<text>	
<begin>&lt;div align=&quot;<just/>&quot;&gt;&lt;p&gt;</begin>
<end>&lt;/p&gt;&lt;/div&gt;</end>
</text>

</style>

<style name="Heading 1">

<character>
<begin></begin>
<end></end>
</character>

<text>	
<begin>&lt;div align=&quot;<just/>&quot;&gt;&lt;H1&gt;</begin>
<end>&lt;/H1&gt;&lt;/div&gt;</end>
</text>



</style>
-->

</main>

--- Added File wvText.xml in package CMF ---
<main>
<charentity>
<begin>ABW</begin>
</charentity>

<document>
<begin>
</begin>
<end>
</end>
</document>

<section>
<begin>
</begin>
<end>
</end>
</section>

<justification>
<left></left>
<right></right>
<center></center>
<block></block>
<asian></asian>
</justification>

<numbering>
<Arabic>type=&quot;1&quot;</Arabic>
<UpperRoman>type=&quot;I&quot;</UpperRoman>
<LowerRoman>type=&quot;i&quot;</LowerRoman>
<UpperCaseN>type=&quot;A&quot;</UpperCaseN>
<LowerCaseN>type=&quot;a&quot;</LowerCaseN>
</numbering>

<border>
<noned></noned>
<singled></singled>
<thickd></thickd>
<doubled></doubled>
<number4d></number4d>
<hairlined></hairlined>
<dotd></dotd>
<dashlargegapd></dashlargegapd>
<dotdashd></dotdashd>
<dotdotdashd></dotdotdashd>
<tripled></tripled>
<thin-thicksmallgapd></thin-thicksmallgapd>
<thick-thinsmallgapd></thick-thinsmallgapd>
<thin-thick-thinsmallgapd></thin-thick-thinsmallgapd>
<thin-thickmediumgapd></thin-thickmediumgapd>
<thick-thinmediumgapd></thick-thinmediumgapd>
<thin-thick-thinmediumgapd></thin-thick-thinmediumgapd>
<thin-thicklargegapd></thin-thicklargegapd>
<thick-thinlargegapd></thick-thinlargegapd>
<thin-thick-thinlargegapd></thin-thick-thinlargegapd>
<waved></waved>
<doublewaved></doublewaved>
<dashsmallgapd></dashsmallgapd>
<dashdotstrokedd></dashdotstrokedd>
<emboss3Dd></emboss3Dd>
<engrave3Dd></engrave3Dd>
<defaultd></defaultd>
</border>

<olist>
<begin></begin>
<end></end>
</olist>

<ulist>
<begin></begin>
<end></end>
</ulist>

<entry>
<begin></begin>
<end></end>
</entry>

<!-- the only thing of significance -->
<text>	
<begin></begin>
<end>
</end>
</text>

<!-- 
this tableoverride option can be used to turn off handling of
these tags in tables, which I find is necessary for at least netscape
-->
<tableoverrides>
<ParaBefore>0</ParaBefore>
<ParaRight>0</ParaRight>
<ParaAfter>0</ParaAfter>
<ParaLeft>0</ParaLeft>
<ParaLeft1>0</ParaLeft1>
<VertMergedCells>0</VertMergedCells>
</tableoverrides>

<table>
<begin></begin>
<end></end>
</table>

<row>
<begin></begin>
<end></end>
</row>

<cell>
<begin></begin>
<end></end>
</cell>

<paragraph>
<begin><text.begin/></begin>
<end><text.end/></end>
</paragraph>

<!-- these are all the character properties that can show up in word -->
<bold><begin></begin><end></end></bold>
<italic><begin></begin><end></end></italic>

<!--
text that has been deleted and will be displayed with strikethrough when
revision marked text is to be displayed

use either this line...
--> 
<RMarkDel><begin></begin>
<end></end>
</RMarkDel>

<!--
or uncomment below to make deleted text dissappear (well, become commented out)
-->
<!--
<RMarkDel><begin>&lt;!-&#45;</begin><end>-&#45;&gt;</end></RMarkDel>
-->

<!-- I don't even know what outline means -->
<outline><begin></begin><end></end></outline>
<smallcaps><begin></begin><end></end></smallcaps>
<caps><begin></begin><end></end></caps>
<vanish><begin></begin><end></end></vanish>

<!--If you uncomment this then the annotation text links will become commented out by html tags-->
<!--
<vanish><begin>&lt;!-&#45;</begin><end>-&#45;&gt;</end></vanish>
-->

<!--
text that has been newly typed since the last time revision marks have been accepted
and will be displayed with underline when revision marked text is to be displayed

use either this line...
-->
<RMark><begin></begin><end></end></RMark>

<!--
or uncomment below to make the underline dissappear
-->
<!--
<RMark><begin></begin><end></end></RMark>
-->


<strike><begin></begin><end></end></strike>
<shadow><begin></begin><end></end></shadow>
<lowercase><begin></begin><end></end></lowercase>
<emboss><begin></begin><end></end></emboss>
<imprint><begin></begin><end></end></imprint>
<!--double strike-->
<dstrike><begin></begin><end></end></dstrike>

<!--
ftc's
&
hps

keep them for font face and do that later.
-->

<super><begin></begin><end></end></super>
<sub><begin></begin><end></end></sub>

<singleu><begin></begin><end></end></singleu>
<wordu><begin></begin><end></end></wordu>
<doubleu><begin></begin><end></end></doubleu>
<dottedu><begin></begin><end></end></dottedu>
<hiddenu><begin></begin><end></end></hiddenu>
<thicku><begin></begin><end></end></thicku>
<dashu><begin></begin><end></end></dashu>
<dotu><begin></begin><end></end></dotu>
<dotdashu><begin></begin><end></end></dotdashu>
<dotdotdashu><begin></begin><end></end></dotdotdashu>
<waveu><begin></begin><end></end></waveu>

<!--
text whose properties have been changed since the last time revision marks have been accepted
and will be displayed with a note showing the change points.

use either this line (which admit it a bit scary looking, but harmless)...
--> 
<PropRMark><begin><ibstPropRMark/></begin><end></end></PropRMark>

<!--
or uncomment below to make the notes dissappear
-->
<!--
<PropRMark><begin></begin><end></end></PropRMark>
-->

<!--
<color>
-->
<Black><begin></begin><end></end></Black>
<Blue><begin></begin><end></end></Blue>
<Cyan><begin></begin><end></end></Cyan>
<Green><begin></begin><end></end></Green>
<Magenta><begin></begin><end></end></Magenta>
<Red><begin></begin><end></end></Red>
<Yellow><begin></begin><end></end></Yellow>
<White><begin></begin><end></end></White>
<DkBlue><begin></begin><end></end></DkBlue>
<DkCyan><begin></begin><end></end></DkCyan>
<DkGreen><begin></begin><end></end></DkGreen>
<DkMagenta><begin></begin><end></end></DkMagenta>
<DkRed><begin></begin><end></end></DkRed>
<DkYellow><begin></begin><end></end></DkYellow>
<DkGray><begin></begin><end></end></DkGray>
<LtGray><begin></begin><end></end></LtGray>
<!--
</color>
-->

<!--
<animation>
-->
<LasVegas><begin></begin><end></end></LasVegas>
<BackgroundBlink><begin></begin><end></end></BackgroundBlink>
<SparkleText><begin></begin><end></end></SparkleText>
<MarchingAnts><begin></begin><end></end></MarchingAnts>
<MarchingRedAnts><begin></begin><end></end></MarchingRedAnts>
<Shimmer><begin></begin><end></end></Shimmer>
<!--
</animation>
-->

<!--
I dont understand what this one is, and ive never come across it

use this sample line (which admit it a bit scary looking, but harmless)...
-->
<DispFldRMark><begin></begin><end></end></DispFldRMark>

<!--
or uncomment below to ignore it, the previous might even crash wv ?
-->
<!--
<DispFldRMark><begin></begin><end></end></DispFldRMark>
-->

<animation>
<begin><LasVegas.begin/><BackgroundBlink.begin/><SparkleText.begin/><MarchingAnts.begin/><MarchingRedAnts.begin/><Shimmer.begin/></begin>
<end><Shimmer.end/><MarchingRedAnts.end/><MarchingAnts.end/><SparkleText.end/><BackgroundBlink.end/><LasVegas.end/></end>
</animation>

<fontstr>
<begin></begin>
<end></end>
</fontstr>

<comment>
<begin>
</begin>
<end>
</end>
</comment>

<style name="Normal">
<character>
<begin><PropRMark.begin/><DispFldRMark.begin/><animation.begin/><fontstr.begin/><bold.begin/><italic.begin/><strike.begin/><RMarkDel.begin/><outline.begin/><smallcaps.begin/><caps.begin/><vanish.begin/><RMark.begin/><shadow.begin/><lowercase.begin/><emboss.begin/><imprint.begin/><dstrike.begin/><super.begin/><sub.begin/><singleu.begin/><wordu.begin/><doubleu.begin/><dottedu.begin/><hiddenu.begin/><thicku.begin/><dashu.begin/><dotu.begin/><dotdashu.begin/><dotdotdashu.begin/><waveu.begin/></begin>
<end><waveu.end/><dotdotdashu.end/><dotdashu.end/><dotu.end/><dashu.end/><thicku.end/><hiddenu.end/><dottedu.end/><doubleu.end/><wordu.end/><singleu.end/><sub.end/><super.end/><dstrike.end/><imprint.end/><emboss.end/><lowercase.end/><shadow.end/><RMark.end/><vanish.end/><caps.end/><smallcaps.end/><outline.end/><RMarkDel.end/><strike.end/><italic.end/><bold.end/><fontstr.end/><animation.end/><DispFldRMark.end/><PropRMark.end/></end>
</character>

<!-- Netscape does handle this correctly yet, here is how each different side of the border should work.
border-top: thin <bordertopstyle/> <bordertopcolor/>;
border-left: thin <borderleftstyle/> <borderleftcolor/>;
border-right: thin <borderrightstyle/> <borderrightcolor/>;
border-bottom: thin <borderbottomstyle/> <borderbottomcolor/>
-->


<pmargin>
<begin><!-- <mmParaBefore/> <mmParaRight/> <mmParaAfter/> <mmParaLeft/>;--></begin>
</pmargin>

<pborder>
<begin>
<!--
border: thin <borderleftstyle/> <borderleftcolor/>;
border-top: thin <bordertopstyle/> <bordertopcolor/>;
border-left: thin <borderleftstyle/> <borderleftcolor/>;
border-right: thin <borderrightstyle/> <borderrightcolor/>;
border-bottom: thin <borderbottomstyle/> <borderbottomcolor/>
-->
</begin>
</pborder>

<picture>
<begin>
</begin>
<!-- images are lacking for now -->

</picture>

</style>

<!--we need to be override the character properties-->
<!--
<style name="Normal">
<character>
<begin><PropRMark.begin/><DispFldRMark.begin/><animation.begin/><fontstr.begin/><bold.begin/><italic.begin/><strike.begin/><RMarkDel.begin/><outline.begin/><smallcaps.begin/><caps.begin/><vanish.begin/><RMark.begin/><shadow.begin/><lowercase.begin/><emboss.begin/><imprint.begin/><dstrike.begin/><super.begin/><sub.begin/><singleu.begin/><wordu.begin/><doubleu.begin/><dottedu.begin/><hiddenu.begin/><thicku.begin/><dashu.begin/><dotu.begin/><dotdashu.begin/><dotdotdashu.begin/><waveu.begin/></begin>
<end><waveu.end/><dotdotdashu.end/><dotdashu.end/><dotu.end/><dashu.end/><thicku.end/><hiddenu.end/><dottedu.end/><doubleu.end/><wordu.end/><singleu.end/><sub.end/><super.end/><dstrike.end/><imprint.end/><emboss.end/><lowercase.end/><shadow.end/><RMark.end/><vanish.end/><caps.end/><smallcaps.end/><outline.end/><RMarkDel.end/><strike.end/><italic.end/><bold.end/><fontstr.end/><animation.end/><DispFldRMark.end/><PropRMark.end/></end>
</character>

<text>	
<begin></begin>
<end>
</end>
</text>

</style>

<style name="Heading 1">

<character>
<begin></begin>
<end></end>
</character>

<text>	
<begin></begin>
<end>
</end>
</text>



</style>
-->

</main>