Ignore:
Timestamp:
28 Sep 2016, 07:04:12 (8 years ago)
Author:
Henrik Bettermann
Message:

Add components for customer JPG documents.

Location:
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/batching.py

    r14184 r14197  
    2424from ikobacustom.uniben.customers.interfaces import (
    2525    IUnibenCustomer,
    26     IUnibenCustomerDocument, IRIAAContract)
     26    IUnibenCustomerPDFDocument, IUnibenCustomerJPGDocument,
     27    IRIAAContract)
    2728from ikobacustom.uniben.interfaces import MessageFactory as _
    2829
     
    4344    grok.name(util_name)
    4445    name = _('Uniben Customer PDF Document Processor')
    45     iface = IUnibenCustomerDocument
     46    iface = IUnibenCustomerPDFDocument
    4647    factory_name = 'waeup.UnibenCustomerPDFDocument'
     48
     49
     50class UnibenCustomerJPGDocumentProcessor(CustomerDocumentProcessorBase):
     51    """A batch processor for IUnibenCustomerDocument objects.
     52    """
     53    util_name = 'unibencustomerjpgdocumentprocessor'
     54    grok.name(util_name)
     55    name = _('Uniben Customer JPG Document Processor')
     56    iface = IUnibenCustomerJPGDocument
     57    factory_name = 'waeup.UnibenCustomerJPGDocument'
    4758
    4859
  • main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/documents.py

    r14184 r14197  
    2727from ikobacustom.uniben.interfaces import MessageFactory as _
    2828from ikobacustom.uniben.customers.interfaces import (
    29     IUnibenCustomerDocument, IUnibenCustomerPDFDocument)
     29    IUnibenCustomerPDFDocument,
     30    IUnibenCustomerJPGDocument)
    3031
    31 
    32 class UnibenCustomerDocument(CustomerDocumentBase):
    33     """This is a sample customer document.
     32class UnibenCustomerJPGDocument(CustomerDocumentBase):
     33    """This is a customer jpg document.
    3434    """
    3535
    36     grok.implements(IUnibenCustomerDocument, ICustomerNavigation)
    37     grok.provides(IUnibenCustomerDocument)
     36    grok.implements(IUnibenCustomerJPGDocument, ICustomerNavigation)
     37    grok.provides(IUnibenCustomerJPGDocument)
    3838
    3939    # Ikoba can store any number of files per Document object.
     
    4141    # only one file per Document object. Thus the following
    4242    # tuple should contain only a single filename string.
    43     filenames = ('scan',)
     43    filenames = ('scan.jpg',)
    4444
    45     form_fields_interface = IUnibenCustomerDocument
     45    form_fields_interface = IUnibenCustomerJPGDocument
    4646
    47 UnibenCustomerDocument = attrs_to_fields(UnibenCustomerDocument)
     47UnibenCustomerJPGDocument = attrs_to_fields(UnibenCustomerJPGDocument)
    4848
    4949
    50 # Customer documents must be importable. So we need a factory.
    51 class UnibenCustomerDocumentFactory(grok.GlobalUtility):
    52     """A factory for customer documents.
     50class UnibenCustomerJPGDocumentFactory(grok.GlobalUtility):
     51    """A factory for customer jpg documents.
    5352    """
    5453    grok.implements(IFactory)
    55     grok.name(u'waeup.UnibenCustomerDocument')
     54    grok.name(u'waeup.UnibenCustomerJPGDocument')
    5655    title = u"Create a new document.",
    57     description = u"This factory instantiates new sample document instances."
     56    description = u"This factory instantiates new document instances."
    5857
    5958    def __call__(self, *args, **kw):
    60         return UnibenCustomerDocument(*args, **kw)
     59        return UnibenCustomerJPGDocument(*args, **kw)
    6160
    6261    def getInterfaces(self):
    63         return implementedBy(UnibenCustomerDocument)
     62        return implementedBy(UnibenCustomerJPGDocument)
     63
    6464
    6565class UnibenCustomerPDFDocument(CustomerDocumentBase):
  • main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/export.py

    r14184 r14197  
    2222    CustomerExporter, CustomerDocumentExporterBase, ContractExporterBase)
    2323from ikobacustom.uniben.customers.interfaces import (
    24     IUnibenCustomer, IUnibenCustomerDocument, IRIAAContractProcess,
     24    IUnibenCustomer, IUnibenCustomerJPGDocument, IRIAAContractProcess,
    2525    IUnibenCustomerPDFDocument)
    2626from ikobacustom.uniben.interfaces import MessageFactory as _
     
    4242
    4343
     44class UnibenCustomerJPGDocumentExporter(CustomerDocumentExporterBase):
     45    """Exporter for documents.
     46    """
     47    grok.name('unibencustomerjpgdocuments')
     48    iface = IUnibenCustomerJPGDocument
     49    title = _(u'Uniben Customer JPG Documents')
     50    class_name = 'UnibenCustomerJPGDocument'
     51
     52
    4453class RIAAContractExporter(ContractExporterBase):
    4554    """Exporter for Contract instances.
  • main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/fileviewlets.py

    r14184 r14197  
    2424
    2525from ikobacustom.uniben.customers.documents import (
    26     UnibenCustomerDocument, UnibenCustomerPDFDocument)
     26    UnibenCustomerPDFDocument,
     27    UnibenCustomerJPGDocument)
    2728
    2829from waeup.ikoba.customers.browser import (
     
    3637# File viewlets for customer documents
    3738
    38 class SampleScanManageUpload(FileUpload):
     39class JPGScanManageUpload(FileUpload):
    3940    """Scan upload viewlet for officers.
    4041    """
    4142    grok.order(1)
    42     grok.context(UnibenCustomerDocument)
     43    grok.context(UnibenCustomerJPGDocument)
    4344    grok.view(DocumentManageFormPage)
    4445    grok.require('waeup.manageCustomer')
    45     label = _(u'Sample Scan')
    46     title = _(u'Sample Scan')
     46    label = _(u'JPG File')
     47    title = _(u'JPG File')
    4748    mus = 1024 * 200
    48     download_name = u'sample'
    49     download_filename = download_name
     49    download_name = u'scan.jpg'
    5050    tab_redirect = '#tab2'
    5151
     52    @property
     53    def download_filename(self):
     54        return u"%s.jpg" % self.context.document_id[:9]
    5255
    53 class SampleScanEditUpload(SampleScanManageUpload):
     56
     57class JPGScanEditUpload(JPGScanManageUpload):
    5458    """Scan upload viewlet for customer.
    5559    """
     
    5862
    5963
    60 class SampleScanDisplay(FileDisplay):
     64class JPGScanDisplay(FileDisplay):
    6165    """Scan display viewlet.
    6266    """
    6367    grok.order(1)
    64     grok.context(UnibenCustomerDocument)
     68    grok.context(UnibenCustomerJPGDocument)
    6569    grok.require('waeup.viewCustomer')
    6670    grok.view(DocumentDisplayFormPage)
    67     label = _(u'Sample Scan')
    68     title = _(u'Sample Scan')
    69     download_name = u'sample'
    70     download_filename = download_name
     71    label = _(u'JPG File')
     72    title = _(u'JPG File')
     73    download_name = u'scan.jpg'
     74
     75    @property
     76    def download_filename(self):
     77        return u"%s.jpg" % self.context.document_id[:9]
    7178
    7279
    73 class SampleScanImage(Image):
     80class JPGScanImage(Image):
    7481    """Scan document.
    7582    """
    76     grok.name('sample')
    77     grok.context(UnibenCustomerDocument)
     83    grok.name('scan.jpg')
     84    grok.context(UnibenCustomerJPGDocument)
    7885    grok.require('waeup.viewCustomer')
    79     download_name = u'sample'
    80     download_filename = download_name
     86    download_name = u'scan.jpg'
    8187
     88    @property
     89    def download_filename(self):
     90        return u"%s.jpg" % self.context.document_id[:9]
    8291
    83 class SampleScanPDFSlip(SampleScanDisplay):
     92class JPGScanPDFSlip(JPGScanDisplay):
    8493    grok.view(PDFDocumentSlip)
     94
    8595
    8696class PDFScanManageUpload(FileUpload):
     
    115125    grok.require('waeup.viewCustomer')
    116126    grok.view(DocumentDisplayFormPage)
    117     label = _(u'PDF Scan')
    118     title = _(u'PDF Scan')
     127    label = _(u'PDF File')
     128    title = _(u'PDF File')
    119129    download_name = u'scan.pdf'
    120130
  • main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/interfaces.py

    r14191 r14197  
    1717##
    1818
     19import re
    1920from zope import schema
    2021from waeup.ikoba.interfaces import IIkobaObject
    21 from waeup.ikoba.schema import FormattedDate
     22from waeup.ikoba.schema import FormattedDate, PhoneNumber
    2223from waeup.ikoba.customers.interfaces import (
    2324    ICustomer, ICustomerDocument, ICustomerPDFDocument, IContract)
     
    2728from ikobacustom.uniben.interfaces import MessageFactory as _
    2829
     30class NotUnibenEmailAddress(schema.ValidationError):
     31    __doc__ = u"Invalid Uniben email address"
     32
     33check_email = re.compile(
     34    r"^[^@\s,]+@[^@\.\s,]+(\.[^@\.\s,]+)*$").match
     35
     36def validate_uniben_email(value):
     37    if not check_email(value):
     38        raise NotUnibenEmailAddress(value)
     39    if not value.endswith('uniben.edu'):
     40        raise NotUnibenEmailAddress(value)
     41    return True
    2942
    3043class IUnibenCustomer(ICustomer):
     
    3649
    3750
    38 class IUnibenCustomerDocument(ICustomerDocument):
     51class IUnibenCustomerJPGDocument(ICustomerDocument):
    3952    """A customer document.
    4053
     
    5366    """
    5467
    55     title_rank = schema.TextLine(
     68    nominator_title_rank = schema.TextLine(
    5669        title = _(u'Title/Rank'),
    5770        required = False,
    5871        )
    5972
    60     department = schema.TextLine(
    61         title = _(u'Department/Faculty/Institute'),
    62         required = False,
    63         )
    64 
    65     date_of_birth = FormattedDate(
    66         title = _(u'Date of Birth'),
    67         required = False,
    68         show_year = True,
    69         )
    70 
    71     nationality = schema.Choice(
     73    nominator_nationality = schema.Choice(
    7274        vocabulary = nats_vocab,
    7375        title = _(u'Current Nationality'),
     
    7577        )
    7678
    77     address = schema.Text(
     79    nominator_address = schema.Text(
    7880        title = _(u'Affiliation/Address'),
     81        required = False,
     82        )
     83
     84    nominee_fullname = schema.TextLine(
     85        title = _(u'Name'),
     86        description = u'Surname last and in capital letters',
     87        required = False,
     88        )
     89
     90    nominee_title_rank = schema.TextLine(
     91        title = _(u'Title/Rank'),
     92        required = False,
     93        )
     94
     95    nominee_department = schema.TextLine(
     96        title = _(u'Department/Faculty/Institute'),
     97        required = False,
     98        )
     99
     100    nominee_date_of_birth = FormattedDate(
     101        title = _(u'Date of Birth'),
     102        required = False,
     103        show_year = True,
     104        )
     105
     106    nominee_nationality = schema.Choice(
     107        vocabulary = nats_vocab,
     108        title = _(u'Current Nationality'),
     109        required = False,
     110        )
     111
     112    nominee_email = schema.ASCIILine(
     113        title = _(u'Uniben Email Address'),
     114        required = True,
     115        constraint=validate_uniben_email,
     116        )
     117
     118    nominee_phone = PhoneNumber(
     119        title = _(u'Phone'),
     120        description = u'',
    79121        required = False,
    80122        )
     
    131173        )
    132174
    133     vitae = schema.Text(
    134         title = _(u'Curriculum Vitae'),
    135         description = u'A curriculum vitae including a full list of scholarly '
    136                        'publications',
    137         required = False,
    138         )
    139 
    140175    prev_aw = schema.Text(
    141176        title = _(u'Previous Awards'),
     
    155190
    156191    h_index = schema.Text(
    157         title = _(u'State of H-Index'),
     192        title = _(u'State H-Index'),
    158193        description = u'State the full H-index of author, i.e. nominee',
    159194        required = False,
     
    161196
    162197    doc1 = schema.Choice(
     198        title = _(u'Curriculum Vitae'),
     199        source = CustomerDocumentSource(),
     200        description = u'A curriculum vitae including a full list of scholarly '
     201                       'publications',
     202        required = False,
     203        )
     204
     205    doc2 = schema.Choice(
    163206        title = _(u'Reference Letters'),
    164207        source = CustomerDocumentSource(),
     
    168211        )
    169212
    170     doc2 = schema.Choice(
    171         title = _(u'Photos and Illustrations'),
    172         source = CustomerDocumentSource(),
    173         description = u'Maximum of 3 photos or illustrations '
    174                        'added together in a pdf document',
    175         required = False,
    176         )
    177 
     213    doc3 = schema.Choice(
     214        title = _(u'Photo or Illustration 1'),
     215        source = CustomerDocumentSource(),
     216        description = u'(optional)',
     217        required = False,
     218        )
     219
     220
     221    doc4 = schema.Choice(
     222        title = _(u'Photo or Illustration 2'),
     223        source = CustomerDocumentSource(),
     224        description = u'(optional)',
     225        required = False,
     226        )
     227
     228    doc5 = schema.Choice(
     229        title = _(u'Photo or Illustration 3'),
     230        source = CustomerDocumentSource(),
     231        description = u'(optional)',
     232        required = False,
     233        )
    178234class IRIAAContract(IUnibenContract):
    179235    """A Retention of Name contract.
     
    209265    """
    210266
    211     title_rank = schema.TextLine(
    212         title = _(u'Title/Rank'),
    213         required = True,
    214         )
    215 
    216     department = schema.TextLine(
    217         title = _(u'Department/Faculty/Institute'),
    218         required = True,
    219         )
    220 
    221     date_of_birth = FormattedDate(
    222         title = _(u'Date of Birth'),
    223         required = True,
    224         show_year = True,
    225         )
    226 
    227     nationality = schema.Choice(
    228         vocabulary = nats_vocab,
    229         title = _(u'Current Nationality'),
    230         required = True,
    231         )
    232 
    233     address = schema.Text(
    234         title = _(u'Affiliation/Address'),
    235         required = True,
    236         )
    237 
    238     app_dates = schema.Text(
    239         title = _(u'Date of Appointment as Uniben staff'),
    240         description = u'State periods nominee had a break in service from '
    241                        'UNIBEN service (including leave of absence), '
    242                        'but excluding training/study/sabbatical leave',
    243         required = True,
    244         )
    245 
    246     bib_cit = schema.Text(
    247         title = _(u'Biographical Citation'),
    248         description = u'Suggested biographical citation of '
    249                        'nominee (max. 200 words) in the event that the '
    250                        'nominee is selected for the award.',
    251         required = True,
    252         )
    253 
    254     sup_stat = schema.Text(
    255         title = _(u'Supporting Statement'),
    256         description = u'Supporting statement (max. 200 words) summarizing '
    257                        'the research and innovative achievement of the '
    258                        'candidate. It should preferably focus on one major '
    259                        'achievement/innovation/accomplishment.',
    260         required = True,
    261         )
    262 
    263     nar_wu = schema.Text(
    264         title = _(u'Narrative Write-Up'),
    265         description = u'A narrative write-up (max. 1,000 words) of the '
    266                        'candidate highlighting his/her scientific/creative '
    267                        'achievement and/or innovation; restrict to one major '
    268                        'innovation/achievement/accomplishment. '
    269                        'The national/international impact of the '
    270                        'achievement/innovation should be emphasized.',
    271         required = True,
    272         )
    273 
    274     item_stat = schema.Text(
    275         title = _(u'Itemized Statement'),
    276         description = u'Itemized statement of research leadership and '
    277                         'collaboration (max. 100 words)',
    278         required = True,
    279         )
    280 
    281     sign_pub = schema.Text(
    282         title = _(u'Significant Publications'),
    283         description = u'A list of his/her most significant publications '
    284                        '(max. 10) pertaining to the achievement/innovation '
    285                        'along with each publication\'s H-index',
    286         required = True,
    287         )
    288 
    289     vitae = schema.Text(
    290         title = _(u'Curriculum Vitae'),
    291         description = u'A curriculum vitae including a full list of scholarly '
    292                        'publications',
    293         required = True,
    294         )
    295 
    296     prev_aw = schema.Text(
    297         title = _(u'Previous Awards'),
    298         description = u'List of previous awards, honours and recognition '
    299                        '(max. 10) received by nominee, including awarding '
    300                        'body, purpose of award, date of award, and nature '
    301                        'of award (cash, certificate, plaque, etc)',
    302         required = True,
    303         )
    304 
    305     lead_rol = schema.Text(
    306         title = _(u'Leadership Roles'),
    307         description = u'List of leadership roles in academic/professional '
    308                        'societies/organizations (max. no. of 3)',
    309         required = True,
    310         )
    311 
    312     h_index = schema.Text(
    313         title = _(u'State of H-Index'),
    314         description = u'State the full H-index of author, i.e. nominee',
    315         required = True,
    316         )
    317 
    318     doc1 = schema.Choice(
    319         title = _(u'Reference Letters'),
    320         source = CustomerDocumentSource(),
    321         description = u'Reference letters from three referees '
    322                        'added together in a pdf document',
    323         required = True,
    324         )
    325 
    326     doc2 = schema.Choice(
    327         title = _(u'Photos and Illustrations'),
    328         source = CustomerDocumentSource(),
    329         description = u'Maximum of 3 photos or illustrations '
    330                        'added together in a pdf document',
    331         required = False,
    332         )
  • main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/tests/test_browser.py

    r14190 r14197  
    222222    def setup_customizable_params(self):
    223223        self._contract_category = u'riaa'
    224         self._document_factory = 'waeup.UnibenCustomerDocument'
     224        self._document_factory = 'waeup.UnibenCustomerPDFDocument'
    225225        self._contract_factory = 'waeup.RIAAContract'
    226226        return
    227227
    228     def test_manage_upload_sample_file(self):
     228    def test_manage_upload_pdf_file(self):
    229229        # Managers can upload a file via the DocumentManageFormPage
    230230        # The image is stored even if form has errors
     
    232232        self.browser.open(self.customer_path + '/documents/DOC1/manage')
    233233        # Create a pseudo image file and select it to be uploaded
    234         image = open(SAMPLE_IMAGE, 'rb')
    235         ctrl = self.browser.getControl(name='samplescanmanageupload')
     234        image = open(SAMPLE_PDF, 'rb')
     235        ctrl = self.browser.getControl(name='pdfscanmanageupload')
    236236        file_ctrl = ctrl.mech_control
    237         file_ctrl.add_file(image, filename='my_sample_scan.jpg')
     237        file_ctrl.add_file(image, filename='my_sample_scan.pdf')
    238238        # The Save action does not upload files
    239239        self.browser.getControl("Save").click() # submit form
    240240        self.assertFalse(
    241             'href="http://localhost/app/customers/B1000000/documents/DOC1/sample"'
     241            'href="http://localhost/app/customers/B1000000/documents/DOC1/scan.pdf"'
    242242            in self.browser.contents)
    243243        # ... but the correct upload submit button does
    244         image = open(SAMPLE_IMAGE)
    245         ctrl = self.browser.getControl(name='samplescanmanageupload')
     244        image = open(SAMPLE_PDF)
     245        ctrl = self.browser.getControl(name='pdfscanmanageupload')
    246246        file_ctrl = ctrl.mech_control
    247         file_ctrl.add_file(image, filename='my_sample_scan.jpg')
     247        file_ctrl.add_file(image, filename='my_sample_scan.pdf')
    248248        self.browser.getControl(
    249             name='upload_samplescanmanageupload').click()
     249            name='upload_pdfscanmanageupload').click()
    250250        self.assertTrue(
    251             'href="http://localhost/app/customers/B1000000/documents/DOC1/sample"'
     251            'href="http://localhost/app/customers/B1000000/documents/DOC1/scan.pdf"'
    252252            in self.browser.contents)
    253         # Browsing the link shows a real image
    254         self.browser.open('sample')
     253        # Browsing the link shows a real pdf file
     254        self.browser.open('scan.pdf')
    255255        self.assertEqual(
    256             self.browser.headers['content-type'], 'image/jpeg')
    257         self.assertEqual(len(self.browser.contents), 2787)
     256            self.browser.headers['content-type'], 'application/pdf')
     257        self.assertEqual(len(self.browser.contents), 24241)
    258258        # We can't reupload a file. The existing file must be deleted first.
    259259        self.browser.open(self.customer_path + '/documents/DOC1/manage')
    260260        self.assertFalse(
    261             'upload_samplescanmanageupload' in self.browser.contents)
     261            'upload_pdfscanmanageupload' in self.browser.contents)
    262262        # File must be deleted first
    263         self.browser.getControl(name='delete_samplescanmanageupload').click()
     263        self.browser.getControl(name='delete_pdfscanmanageupload').click()
    264264        self.assertTrue(
    265             'sample deleted' in self.browser.contents)
    266         # Uploading a file which is bigger than 150k will raise an error
    267         big_image = StringIO(open(SAMPLE_IMAGE, 'rb').read() * 75)
    268         ctrl = self.browser.getControl(name='samplescanmanageupload')
    269         file_ctrl = ctrl.mech_control
    270         file_ctrl.add_file(big_image, filename='my_sample_scan.jpg')
    271         self.browser.getControl(
    272             name='upload_samplescanmanageupload').click()
    273         self.assertTrue(
    274             'Uploaded file is too big' in self.browser.contents)
    275         # We do not rely on filename extensions given by uploaders
    276         image = open(SAMPLE_IMAGE, 'rb') # a jpg-file
    277         ctrl = self.browser.getControl(name='samplescanmanageupload')
    278         file_ctrl = ctrl.mech_control
    279         # Tell uploaded file is bmp
    280         file_ctrl.add_file(image, filename='my_sample_scan.bmp')
    281         self.browser.getControl(
    282             name='upload_samplescanmanageupload').click()
    283         self.assertTrue(
    284             # jpg file was recognized
    285             'File sample.jpg uploaded.' in self.browser.contents)
    286         # Delete file again
    287         self.browser.getControl(name='delete_samplescanmanageupload').click()
    288         self.assertTrue(
    289             'sample deleted' in self.browser.contents)
    290         # File names must meet several conditions
    291         bmp_image = open(SAMPLE_IMAGE_BMP, 'rb')
    292         ctrl = self.browser.getControl(name='samplescanmanageupload')
    293         file_ctrl = ctrl.mech_control
    294         file_ctrl.add_file(bmp_image, filename='my_sample_scan.bmp')
    295         self.browser.getControl(
    296             name='upload_samplescanmanageupload').click()
    297         self.assertTrue('Only the following extensions are allowed'
    298             in self.browser.contents)
     265            'scan.pdf deleted' in self.browser.contents)
     266
    299267
    300268class ContractUITests(CustomersFullSetup):
     
    305273    def setup_customizable_params(self):
    306274        self._contract_category = u'riaa'
    307         self._document_factory = 'waeup.UnibenCustomerDocument'
     275        self._document_factory = 'waeup.UnibenCustomerPDFDocument'
    308276        self._contract_factory = 'waeup.RIAAContract'
    309277        return
  • main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/tests/test_document.py

    r14181 r14197  
    2929
    3030from ikobacustom.uniben.testing import (FunctionalLayer, FunctionalTestCase)
    31 from ikobacustom.uniben.customers.documents import UnibenCustomerDocument
    32 from ikobacustom.uniben.customers.interfaces import IUnibenCustomerDocument
     31from ikobacustom.uniben.customers.documents import (
     32    UnibenCustomerPDFDocument, UnibenCustomerJPGDocument)
     33from ikobacustom.uniben.customers.interfaces import (
     34    IUnibenCustomerPDFDocument, IUnibenCustomerJPGDocument)
    3335
    3436
     
    3840
    3941    def test_interfaces(self):
    40         verify.verifyClass(IUnibenCustomerDocument, UnibenCustomerDocument)
    41         verify.verifyClass(ICustomerNavigation, UnibenCustomerDocument)
    42         verify.verifyObject(IUnibenCustomerDocument, UnibenCustomerDocument())
    43         verify.verifyObject(ICustomerNavigation, UnibenCustomerDocument())
     42        verify.verifyClass(IUnibenCustomerPDFDocument, UnibenCustomerPDFDocument)
     43        verify.verifyClass(ICustomerNavigation, UnibenCustomerPDFDocument)
     44        verify.verifyObject(IUnibenCustomerPDFDocument, UnibenCustomerPDFDocument())
     45        verify.verifyObject(ICustomerNavigation, UnibenCustomerPDFDocument())
     46        verify.verifyClass(IUnibenCustomerJPGDocument, UnibenCustomerJPGDocument)
     47        verify.verifyClass(ICustomerNavigation, UnibenCustomerJPGDocument)
     48        verify.verifyObject(IUnibenCustomerJPGDocument, UnibenCustomerJPGDocument())
     49        verify.verifyObject(ICustomerNavigation, UnibenCustomerJPGDocument())
    4450        return
    4551
    4652    def test_addDocument(self):
    4753        container = CustomerDocumentsContainer()
    48         document = createObject(u'waeup.UnibenCustomerDocument')
     54        document = createObject(u'waeup.UnibenCustomerPDFDocument')
    4955        id = document.document_id
    5056        container.addDocument(document)
    5157        self.assertEqual(container[id], document)
    5258        self.assertRaises(TypeError, container.addDocument, object())
    53         self.assertEqual(document.class_name, 'UnibenCustomerDocument')
     59        self.assertEqual(document.class_name, 'UnibenCustomerPDFDocument')
     60        document2 = createObject(u'waeup.UnibenCustomerJPGDocument')
     61        id = document2.document_id
     62        container.addDocument(document2)
     63        self.assertEqual(container[id], document2)
     64        self.assertRaises(TypeError, container.addDocument, object())
     65        self.assertEqual(document2.class_name, 'UnibenCustomerJPGDocument')
    5466        return
  • main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/utils.py

    r14184 r14197  
    4545    DOCTYPES_DICT = {
    4646        #'UnibenCustomerDocument': _('Uniben Document'),
    47         'UnibenCustomerPDFDocument': _('Uniben PDF Document'),
     47        'UnibenCustomerPDFDocument': _('PDF Document'),
     48        'UnibenCustomerJPGDocument': _('JPG Document'),
    4849        }
    4950
     
    6061        'unibencustomerpdfdocuments',
    6162        'riaacontracts')
     63
     64    SEPARATORS_DICT = {
     65      'form.nominator_title_rank': _(u'Additional Registrant Data'),
     66      'form.nominee_fullname': _(u'Basic Nominee Data'),
     67      'form.bib_cit': _(u'Supporting Information'),
     68      }
  • main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/utils/utils.py

    r14184 r14197  
    6767        'customers',
    6868        'unibencustomerpdfdocuments',
     69        'unibencustomerjpgdocuments',
    6970        'riaacontracts')
    7071
     
    7273        'unibencustomerprocessor',
    7374        'unibencustomerpdfdocumentprocessor',
     75        'unibencustomerjpgdocumentprocessor',
    7476        'riaacontractprocessor',
    7577        'unibenproductprocessor',
Note: See TracChangeset for help on using the changeset viewer.