Changeset 1244

Show
Ignore:
Timestamp:
03/26/08 18:02:15 (8 months ago)
Author:
sgillies
Message:

Avoid stylesheet and javascript failures, reduce number of tests, give our UML model a name so that it works with archgenxml 2

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • PleiadesEntity/trunk/Extensions/Install.py

    r706 r1244  
    141141    factory_tool.manage_setPortalFactoryTypes(listOfTypeIds=factory_types) 
    142142 
    143     from Products.PleiadesEntity.config import STYLESHEETS 
    144     try: 
     143    try: 
     144        from Products.PleiadesEntity.config import STYLESHEETS 
    145145        portal_css = getToolByName(portal, 'portal_css') 
    146146        for stylesheet in STYLESHEETS: 
     
    157157        # No portal_css registry 
    158158        pass 
    159     from Products.PleiadesEntity.config import JAVASCRIPTS 
    160     try: 
     159     
     160    try: 
     161        from Products.PleiadesEntity.config import JAVASCRIPTS 
    161162        portal_javascripts = getToolByName(portal, 'portal_javascripts') 
    162163        for javascript in JAVASCRIPTS: 
  • PleiadesEntity/trunk/Extensions/loader.py

    r1124 r1244  
    4141from Products.PleiadesEntity.Extensions.xmlutil import * 
    4242from Products.PleiadesEntity.Extensions.ws_validation import validate_name 
    43  
     43from Products.PleiadesEntity.AppConfig import * 
    4444from Products.PleiadesEntity.config import * 
    4545 
  • PleiadesEntity/trunk/__init__.py

    r746 r1244  
    33# File: PleiadesEntity.py 
    44# 
    5 # Copyright (c) 2007 by Ancient World Mapping Center, University of North 
     5# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 1.5.0 
     7# Generator: ArchGenXML Version 2.0 
    88#            http://plone.org/products/archgenxml 
    99# 
     
    3737#   - To perform custom initialisation after types have been registered, 
    3838#       use the protected code section at the bottom of initialize(). 
    39 #   - To register a customisation policy, create a file CustomizationPolicy.py 
    40 #       with a method register(context) to register the policy. 
    4139 
    42 from zLOG import LOG, INFO, DEBUG 
     40import logging 
     41logger = logging.getLogger('PleiadesEntity') 
     42logger.debug('Installing Product') 
    4343 
    44 LOG('PleiadesEntity', DEBUG, 'Installing Product') 
    45  
    46 try: 
    47     import CustomizationPolicy 
    48 except ImportError: 
    49     CustomizationPolicy = None 
    50  
     44import os 
     45import os.path 
    5146from Globals import package_home 
     47import Products.CMFPlone.interfaces 
     48from Products.Archetypes import listTypes 
     49from Products.Archetypes.atapi import * 
     50from Products.Archetypes.utils import capitalize 
     51from Products.CMFCore import DirectoryView 
     52from Products.CMFCore import permissions as cmfpermissions 
    5253from Products.CMFCore import utils as cmfutils 
    53 from Products.CMFCore import CMFCorePermissions 
    54 from Products.CMFCore import DirectoryView 
    5554from Products.CMFPlone.utils import ToolInit 
    56 from Products.Archetypes.atapi import * 
    57 from Products.Archetypes import listTypes 
    58 from Products.Archetypes.utils import capitalize 
    59  
    60 import os, os.path 
    61  
    62 from Products.PleiadesEntity.config import * 
     55from config import * 
    6356 
    6457DirectoryView.registerDirectory('skins', product_globals) 
    65 DirectoryView.registerDirectory('skins/PleiadesEntity', 
    66                                     product_globals) 
     58 
    6759 
    6860##code-section custom-init-head #fill in your manual code here 
     
    7163 
    7264def initialize(context): 
     65    """initialize product (called by zope)""" 
    7366    ##code-section custom-init-top #fill in your manual code here 
    7467    ##/code-section custom-init-top 
     
    9184        ).initialize(context) 
    9285 
    93     # Apply customization-policy, if theres any 
    94     if CustomizationPolicy and hasattr(CustomizationPolicy, 'register'): 
    95         CustomizationPolicy.register(context) 
    96         print 'Customization policy for PleiadesEntity installed' 
    97  
    9886    ##code-section custom-init-bottom #fill in your manual code here 
    9987    profile_registry.registerProfile('default', 
  • PleiadesEntity/trunk/config.py

    r746 r1244  
    33# File: PleiadesEntity.py 
    44# 
    5 # Copyright (c) 2007 by Ancient World Mapping Center, University of North 
     5# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 1.5.0 
     7# Generator: ArchGenXML Version 2.0 
    88#            http://plone.org/products/archgenxml 
    99# 
    1010# GNU General Public License (GPL) 
    11 # 
    12 # This program is free software; you can redistribute it and/or 
    13 # modify it under the terms of the GNU General Public License 
    14 # as published by the Free Software Foundation; either version 2 
    15 # of the License, or (at your option) any later version. 
    16 # 
    17 # This program is distributed in the hope that it will be useful, 
    18 # but WITHOUT ANY WARRANTY; without even the implied warranty of 
    19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
    20 # GNU General Public License for more details. 
    21 # 
    22 # You should have received a copy of the GNU General Public License 
    23 # along with this program; if not, write to the Free Software 
    24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
    25 # 02110-1301, USA. 
    2611# 
    2712 
     
    3621# 
    3722# If you wish to perform custom configuration, you may put a file 
    38 # AppConfig.py in your product's root directory. This will be included 
    39 # in this file if found. 
     23# AppConfig.py in your product's root directory. The items in there 
     24# will be included (by importing) in this file if found. 
    4025 
    41 from Products.CMFCore.CMFCorePermissions import setDefaultRoles 
     26from Products.CMFCore.permissions import setDefaultRoles 
    4227##code-section config-head #fill in your manual code here 
    4328##/code-section config-head 
     
    4530 
    4631PROJECTNAME = "PleiadesEntity" 
    47  
    48 # Check for Plone 2.1 
    49 try: 
    50     from Products.CMFPlone.migrations import v2_1 
    51 except ImportError: 
    52     HAS_PLONE21 = False 
    53 else: 
    54     HAS_PLONE21 = True 
    5532 
    5633# Permissions 
     
    6845PRODUCT_DEPENDENCIES = [] 
    6946 
    70 # You can overwrite these two in an AppConfig.py: 
    71 # STYLESHEETS = [{'id': 'my_global_stylesheet.css'}, 
    72 #                {'id': 'my_contenttype.css', 
    73 #                 'expression': 'python:object.getTypeInfo().getId() == "MyType"'}] 
    74 # You can do the same with JAVASCRIPTS. 
    75 STYLESHEETS = [] 
    76 JAVASCRIPTS = [] 
    77  
    7847##code-section config-bottom #fill in your manual code here 
    7948##/code-section config-bottom 
    8049 
    8150 
    82 # Load custom configuration not managed by ArchGenXML 
     51# Load custom configuration not managed by archgenxml 
    8352try: 
    8453    from Products.PleiadesEntity.AppConfig import * 
  • PleiadesEntity/trunk/configure.zcml

    r1186 r1244  
    1 <configure 
    2   xmlns="http://namespaces.zope.org/zope
    3   xmlns:five="http://namespaces.zope.org/five" 
    4   xmlns:browser="http://namespaces.zope.org/browser" 
    5  
     1<configure xmlns="http://namespaces.zope.org/zope" 
     2           xmlns:browser="http://namespaces.zope.org/browser
     3           xmlns:five="http://namespaces.zope.org/five"> 
     4   
     5  <include file="profiles.zcml" /
    66 
    7   <adapter 
    8     for=".interfaces.IGeoEntity" 
    9     provides="Products.PleiadesGeocoder.interfaces.IGeoItemSimple" 
    10     factory=".geo.createGeoItem" 
    11     /> 
    12  
    13   <adapter 
    14     for=".interfaces.IGeoEntity" 
    15     provides="Products.PleiadesGeocoder.interfaces.IGeoCollectionSimple" 
    16     factory=".geo.GeoCollectionSimple" 
    17     /> 
    18  
    19   <five:implements 
    20     class=".content.PlaceContainer.PlaceContainer" 
    21     interface="zope.app.annotation.interfaces.IAttributeAnnotatable" 
    22     /> 
    23  
    24   <five:implements 
    25     class=".content.PlacefulAssociation.PlacefulAssociation" 
    26     interface=".interfaces.IGeoEntity" 
    27     /> 
    28  
    29   <five:implements 
    30     class=".content.Place.Place" 
    31     interface=".interfaces.IGeoEntity" 
    32     /> 
    33  
    34   <five:implements 
    35     class=".content.Place.Place" 
    36     interface=".interfaces.IPlacefulContainer" 
    37     /> 
    38  
    39   <five:implements 
    40     class=".content.Place.Place" 
    41     interface="Products.PleiadesOpenLayers.interfaces.feature.IMapFeature" 
    42     /> 
    43  
    44   <five:implements 
    45     class=".content.PlaceContainer.PlaceContainer" 
    46     interface=".interfaces.IGeoEntity" 
    47     /> 
    48  
    49   <five:implements 
    50     class=".content.PlaceContainer.PlaceContainer" 
    51     interface=".interfaces.IPlaceContainer" 
    52     /> 
    53  
    54   <five:implements 
    55     class=".content.PlaceContainer.PlaceContainer" 
    56     interface="Products.CMFCore.interfaces.IFolderish" 
    57     /> 
    58  
    59   <five:implements 
    60     class=".content.LocationContainer.LocationContainer" 
    61     interface="Products.CMFCore.interfaces.IFolderish" 
    62     /> 
    63  
    64   <five:deprecatedManageAddDelete 
    65     class=".content.Name.Name" 
    66     /> 
    67  
    68   <five:deprecatedManageAddDelete 
    69     class=".content.Location.Location" 
    70     /> 
    71  
    72   <five:deprecatedManageAddDelete 
    73     class=".content.Place.Place" 
    74     /> 
    75  
    76   <five:deprecatedManageAddDelete 
    77     class=".content.PlacefulAssociation.PlacefulAssociation" 
    78     /> 
    79  
    80   <five:deprecatedManageAddDelete 
    81     class=".content.LocationContainer.LocationContainer" 
    82     /> 
    83  
    84   <five:deprecatedManageAddDelete 
    85     class=".content.PlaceContainer.PlaceContainer" 
    86     /> 
    87  
    88   <five:deprecatedManageAddDelete 
    89     class=".content.TemporalAttestation.TemporalAttestation" 
    90     /> 
    91  
    92   <five:deprecatedManageAddDelete 
    93     class=".content.SecondaryReference.SecondaryReference" 
    94     /> 
    95  
    96   <browser:page   
    97     for=".interfaces.IGeoEntity" 
    98     name="geo" 
    99     class="Products.PleiadesGeocoder.browser.info.GeoInfosetView" 
    100     permission="zope.Public" 
    101     allowed_interface="Products.PleiadesGeocoder.browser.info.IGeoInfosetView" 
    102     /> 
     7  <!-- ##code-section configure.zcml --> 
     8  <!-- ##/code-section configure.zcml --> 
    1039 
    10410</configure> 
    105  
  • PleiadesEntity/trunk/content/Location.py

    r734 r1244  
    33# File: Location.py 
    44# 
    5 # Copyright (c) 2007 by Ancient World Mapping Center, University of North 
     5# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 1.5.0 
     7# Generator: ArchGenXML Version 2.0 
    88#            http://plone.org/products/archgenxml 
    99# 
    1010# GNU General Public License (GPL) 
    11 # 
    12 # This program is free software; you can redistribute it and/or 
    13 # modify it under the terms of the GNU General Public License 
    14 # as published by the Free Software Foundation; either version 2 
    15 # of the License, or (at your option) any later version. 
    16 # 
    17 # This program is distributed in the hope that it will be useful, 
    18 # but WITHOUT ANY WARRANTY; without even the implied warranty of 
    19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
    20 # GNU General Public License for more details. 
    21 # 
    22 # You should have received a copy of the GNU General Public License 
    23 # along with this program; if not, write to the Free Software 
    24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
    25 # 02110-1301, USA. 
    2611# 
    2712 
     
    3116from AccessControl import ClassSecurityInfo 
    3217from Products.Archetypes.atapi import * 
     18from zope.interface import implements 
     19import interfaces 
     20 
     21from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin 
     22 
    3323from Products.PleiadesEntity.config import * 
    3424 
     
    3828schema = Schema(( 
    3929 
    40     #Geometry type of the object represented by the spatial 
    41     #coordinates string. Must be one of ['Point', 'Line', 'Polygon', 
    42     #'Box']. 
    4330    StringField( 
    4431        name='geometryType', 
    4532        default="Point", 
    46         index="FieldIndex", 
    4733        widget=SelectionWidget( 
    4834            label="Geometry Type", 
     
    5137        ), 
    5238        enforceVocabulary=1, 
    53         vocabulary=['Point'] 
     39        vocabulary=['Point'], 
    5440    ), 
    55  
    56     #Geometry coordinates using GeoRSS-Simple representation. 
    5741    StringField( 
    5842        name='spatialCoordinates', 
    59         widget=StringWidget
     43        widget=StringField._properties['widget']
    6044            label="Spatial Coordinates", 
    6145            description="Use GeoRSS-Simple representation.", 
     
    6347            description_msgid='PleiadesEntity_help_spatialCoordinates', 
    6448            i18n_domain='PleiadesEntity', 
    65         ) 
     49        ), 
    6650    ), 
    67  
    6851), 
    6952) 
     
    7962##/code-section after-schema 
    8063 
    81 class Location(BaseFolder): 
     64class Location(BaseFolder, BrowserDefaultMixin): 
    8265    """ 
    8366    """ 
    8467    security = ClassSecurityInfo() 
    85     __implements__ = (getattr(BaseFolder,'__implements__',()),) 
    86  
    87     # This name appears in the 'add' box 
    88     archetype_name = 'Ancient Location' 
     68    implements(interfaces.ILocation) 
    8969 
    9070    meta_type = 'Location' 
    91     portal_type = 'Location' 
    92     allowed_content_types = ['TemporalAttestation', 'SecondaryReference'] 
    93     filter_content_types = 1 
    94     global_allow = 0 
    95     content_icon = 'link_icon.gif' 
    96     immediate_view = 'base_view' 
    97     default_view = 'base_view' 
    98     suppl_views = () 
    99     typeDescription = "An ancient location or region" 
    100     typeDescMsgId = 'description_edit_location' 
    101  
    10271    _at_rename_after_creation = False 
    10372 
  • PleiadesEntity/trunk/content/LocationContainer.py

    r615 r1244  
    33# File: LocationContainer.py 
    44# 
    5 # Copyright (c) 2007 by Ancient World Mapping Center, University of North 
     5# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 1.5.0 
     7# Generator: ArchGenXML Version 2.0 
    88#            http://plone.org/products/archgenxml 
    99# 
    1010# GNU General Public License (GPL) 
    11 # 
    12 # This program is free software; you can redistribute it and/or 
    13 # modify it under the terms of the GNU General Public License 
    14 # as published by the Free Software Foundation; either version 2 
    15 # of the License, or (at your option) any later version. 
    16 # 
    17 # This program is distributed in the hope that it will be useful, 
    18 # but WITHOUT ANY WARRANTY; without even the implied warranty of 
    19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
    20 # GNU General Public License for more details. 
    21 # 
    22 # You should have received a copy of the GNU General Public License 
    23 # along with this program; if not, write to the Free Software 
    24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
    25 # 02110-1301, USA. 
    2611# 
    2712 
     
    3116from AccessControl import ClassSecurityInfo 
    3217from Products.Archetypes.atapi import * 
     18from zope.interface import implements 
     19import interfaces 
     20 
     21from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin 
     22 
    3323from Products.PleiadesEntity.config import * 
    3424 
     
    5343##/code-section after-schema 
    5444 
    55 class LocationContainer(BaseBTreeFolder): 
     45class LocationContainer(BaseBTreeFolder, BrowserDefaultMixin): 
    5646    """Folder-ish container of Locations that also implements PCL 
    5747    s IFeatureStore. 
    5848    """ 
    5949    security = ClassSecurityInfo() 
    60     __implements__ = (getattr(BaseBTreeFolder,'__implements__',()),) 
    61  
    62     # This name appears in the 'add' box 
    63     archetype_name = 'Container for Locations' 
     50    implements(interfaces.ILocationContainer) 
    6451 
    6552    meta_type = 'LocationContainer' 
    66     portal_type = 'LocationContainer' 
    67     allowed_content_types = ['Location'] 
    68     filter_content_types = 1 
    69     global_allow = 1 
    70     #content_icon = 'LocationContainer.gif' 
    71     immediate_view = 'base_view' 
    72     default_view = 'base_view' 
    73     suppl_views = () 
    74     typeDescription = "Container for Locations" 
    75     typeDescMsgId = 'description_edit_locationcontainer' 
    76  
    7753    _at_rename_after_creation = True 
    7854 
  • PleiadesEntity/trunk/content/Name.py

    r747 r1244  
    33# File: Name.py 
    44# 
    5 # Copyright (c) 2007 by Ancient World Mapping Center, University of North 
     5# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 1.5.0 
     7# Generator: ArchGenXML Version 2.0 
    88#            http://plone.org/products/archgenxml 
    99# 
    1010# GNU General Public License (GPL) 
    11 # 
    12 # This program is free software; you can redistribute it and/or 
    13 # modify it under the terms of the GNU General Public License 
    14 # as published by the Free Software Foundation; either version 2 
    15 # of the License, or (at your option) any later version. 
    16 # 
    17 # This program is distributed in the hope that it will be useful, 
    18 # but WITHOUT ANY WARRANTY; without even the implied warranty of 
    19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
    20 # GNU General Public License for more details. 
    21 # 
    22 # You should have received a copy of the GNU General Public License 
    23 # along with this program; if not, write to the Free Software 
    24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
    25 # 02110-1301, USA. 
    2611# 
    2712 
     
    3116from AccessControl import ClassSecurityInfo 
    3217from Products.Archetypes.atapi import * 
     18from zope.interface import implements 
     19import interfaces 
     20 
     21from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin 
     22 
    3323from Products.ATVocabularyManager.namedvocabulary import NamedVocabulary 
    3424from Products.PleiadesEntity.config import * 
     
    4434    StringField( 
    4535        name='nameAttested', 
    46         index="ZCTextIndex", 
    47         widget=StringWidget( 
     36        widget=StringField._properties['widget']( 
    4837            label="Name as Attested", 
    4938            description="A transcription of the attested form of the name, in its original language and script.", 
     
    5241            description_msgid='PleiadesEntity_help_nameAttested', 
    5342            i18n_domain='PleiadesEntity', 
    54         ) 
     43        ), 
    5544    ), 
    56  
    5745    StringField( 
    5846        name='nameLanguage', 
    59         index="FieldIndex", 
    6047        widget=SelectionWidget( 
    6148            label="Language and Writing System", 
     
    6653        ), 
    6754        vocabulary=NamedVocabulary("""ancient-name-languages"""), 
    68         enforceVocabulary=1 
     55        enforceVocabulary=1, 
    6956    ), 
    70  
    7157    StringField( 
    7258        name='nameTransliterated', 
    73         widget=StringWidget
     59        widget=StringField._properties['widget']
    7460            label="Transliterated name", 
    7561            label_msgid='PleiadesEntity_label_nameTransliterated', 
    7662            i18n_domain='PleiadesEntity', 
    77         ) 
     63        ), 
    7864    ), 
    79  
    8065    StringField( 
    8166        name='nameType', 
     
    8772        vocabulary=NamedVocabulary("""name-types"""), 
    8873        default="geographic", 
    89         enforceVocabulary=1 
     74        enforceVocabulary=1, 
    9075    ), 
    91  
    9276    StringField( 
    9377        name='accuracy', 
    94         index="FieldIndex", 
    95         vocabulary=NamedVocabulary("""name-accuracy"""), 
    96         default="accurate", 
    97         enforceVocabulary=1, 
    9878        widget=SelectionWidget( 
    9979            label="Accuracy of Attestation", 
    10080            label_msgid='PleiadesEntity_label_accuracy', 
    10181            i18n_domain='PleiadesEntity', 
    102         ) 
     82        ), 
     83        vocabulary=NamedVocabulary("""name-accuracy"""), 
     84        default="accurate", 
     85        enforceVocabulary=1, 
    10386    ), 
    104  
    10587    StringField( 
    10688        name='completeness', 
    107         index="FieldIndex", 
    108         vocabulary=NamedVocabulary("""name-completeness"""), 
    109         default="complete", 
    110         enforceVocabulary=1, 
    11189        widget=SelectionWidget( 
    11290            label="Completeness of Attestation", 
    11391            label_msgid='PleiadesEntity_label_completeness', 
    11492            i18n_domain='PleiadesEntity', 
    115         ) 
     93        ), 
     94        vocabulary=NamedVocabulary("""name-completeness"""), 
     95        default="complete", 
     96        enforceVocabulary=1, 
    11697    ), 
    117  
    11898), 
    11999) 
     
    128108##/code-section after-schema 
    129109 
    130 class Name(BaseFolder): 
     110class Name(BaseFolder, BrowserDefaultMixin): 
    131111    """ 
    132112    """ 
    133113    security = ClassSecurityInfo() 
    134     __implements__ = (getattr(BaseFolder,'__implements__',()),) 
    135  
    136     # This name appears in the 'add' box 
    137     archetype_name = 'Ancient Name' 
     114    implements(interfaces.IName) 
    138115 
    139116    meta_type = 'Name' 
    140     portal_type = 'Name' 
    141     allowed_content_types = ['TemporalAttestation', 'SecondaryReference', 'PrimaryReference'] 
    142     filter_content_types = 1 
    143     global_allow = 0 
    144     content_icon = 'document_icon.gif' 
    145     immediate_view = 'base_view' 
    146     default_view = 'base_view' 
    147     suppl_views = () 
    148     typeDescription = "Any sort of name that can be applied to a geographic place." 
    149     typeDescMsgId = 'description_edit_name' 
    150  
    151117    _at_rename_after_creation = True 
    152118 
  • PleiadesEntity/trunk/content/Place.py

    r750 r1244  
    33# File: Place.py 
    44# 
    5 # Copyright (c) 2007 by Ancient World Mapping Center, University of North 
     5# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 1.5.0 
     7# Generator: ArchGenXML Version 2.0 
    88#            http://plone.org/products/archgenxml 
    99# 
    1010# GNU General Public License (GPL) 
    11 # 
    12 # This program is free software; you can redistribute it and/or 
    13 # modify it under the terms of the GNU General Public License 
    14 # as published by the Free Software Foundation; either version 2 
    15 # of the License, or (at your option) any later version. 
    16 # 
    17 # This program is distributed in the hope that it will be useful, 
    18 # but WITHOUT ANY WARRANTY; without even the implied warranty of 
    19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
    20 # GNU General Public License for more details. 
    21 # 
    22 # You should have received a copy of the GNU General Public License 
    23 # along with this program; if not, write to the Free Software 
    24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
    25 # 02110-1301, USA. 
    2611# 
    2712 
     
    3116from AccessControl import ClassSecurityInfo 
    3217from Products.Archetypes.atapi import * 
     18from zope.interface import implements 
     19import interfaces 
     20 
     21from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin 
     22 
    3323from Products.PleiadesEntity.config import * 
    3424 
     
    4030    StringField( 
    4131        name='modernLocation', 
    42         index="ZCTextIndex", 
    43         widget=StringWidget( 
     32        widget=StringField._properties['widget']( 
    4433            label="Modern Location", 
    4534            description="The modern location or vicinity of the ancient place", 
     
    4736            description_msgid='PleiadesEntity_help_modernLocation', 
    4837            i18n_domain='PleiadesEntity', 
    49         ) 
     38        ), 
    5039    ), 
    51  
    5240), 
    5341) 
     
    6250##/code-section after-schema 
    6351 
    64 class Place(BaseFolder): 
     52class Place(BaseFolder, BrowserDefaultMixin): 
    6553    """ 
    6654    """ 
    6755    security = ClassSecurityInfo() 
    68     __implements__ = (getattr(BaseFolder,'__implements__',()),) 
    69  
    70     # This name appears in the 'add' box 
    71     archetype_name = 'Ancient Place' 
     56    implements(interfaces.IPlace) 
    7257 
    7358    meta_type = 'Place' 
    74     portal_type = 'Place' 
    75     allowed_content_types = ['PlacefulAssociation'] 
    76     filter_content_types = 1 
    77     global_allow = 0 
    78     content_icon = 'place_icon.gif' 
    79     immediate_view = 'base_view' 
    80     default_view = 'base_view' 
    81     suppl_views = () 
    82     typeDescription = "Ancient Place" 
    83     typeDescMsgId = 'description_edit_place' 
    84  
    8559    _at_rename_after_creation = False 
    8660 
  • PleiadesEntity/trunk/content/PlaceContainer.py

    r632 r1244  
    33# File: PlaceContainer.py 
    44# 
    5 # Copyright (c) 2007 by Ancient World Mapping Center, University of North 
     5# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 1.5.0 
     7# Generator: ArchGenXML Version 2.0 
    88#            http://plone.org/products/archgenxml 
    99# 
    1010# GNU General Public License (GPL) 
    11 # 
    12 # This program is free software; you can redistribute it and/or 
    13 # modify it under the terms of the GNU General Public License 
    14 # as published by the Free Software Foundation; either version 2 
    15 # of the License, or (at your option) any later version. 
    16 # 
    17 # This program is distributed in the hope that it will be useful, 
    18 # but WITHOUT ANY WARRANTY; without even the implied warranty of 
    19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
    20 # GNU General Public License for more details. 
    21 # 
    22 # You should have received a copy of the GNU General Public License 
    23 # along with this program; if not, write to the Free Software 
    24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
    25 # 02110-1301, USA. 
    2611# 
    2712 
     
    3116from AccessControl import ClassSecurityInfo 
    3217from Products.Archetypes.atapi import * 
     18from zope.interface import implements 
     19import interfaces 
     20 
     21from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin 
     22 
    3323from Products.PleiadesEntity.config import * 
    3424 
     
    5343##/code-section after-schema 
    5444 
    55 class PlaceContainer(BaseBTreeFolder): 
     45class PlaceContainer(BaseBTreeFolder, BrowserDefaultMixin): 
    5646    """ 
    5747    """ 
    5848    security = ClassSecurityInfo() 
    59     __implements__ = (getattr(BaseBTreeFolder,'__implements__',()),) 
    60  
    61     # This name appears in the 'add' box 
    62     archetype_name = 'Container for Places.' 
     49    implements(interfaces.IPlaceContainer) 
    6350 
    6451    meta_type = 'PlaceContainer' 
    65     portal_type = 'PlaceContainer' 
    66     allowed_content_types = ['Place'] 
    67     filter_content_types = 1 
    68     global_allow = 1 
    69     #content_icon = 'PlaceContainer.gif' 
    70     immediate_view = 'base_view' 
    71     default_view = 'base_view' 
    72     suppl_views = () 
    73     typeDescription = "Container for Places." 
    74     typeDescMsgId = 'description_edit_placecontainer' 
    75  
    7652    _at_rename_after_creation = True 
    7753 
  • PleiadesEntity/trunk/content/PlacefulAssociation.py

    r706 r1244  
    33# File: PlacefulAssociation.py 
    44# 
    5 # Copyright (c) 2007 by Ancient World Mapping Center, University of North 
     5# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 1.5.0 
     7# Generator: ArchGenXML Version 2.0 
    88#            http://plone.org/products/archgenxml 
    99# 
    1010# GNU General Public License (GPL) 
    11 # 
    12 # This program is free software; you can redistribute it and/or 
    13 # modify it under the terms of the GNU General Public License 
    14 # as published by the Free Software Foundation; either version 2 
    15 # of the License, or (at your option) any later version. 
    16 # 
    17 # This program is distributed in the hope that it will be useful, 
    18 # but WITHOUT ANY WARRANTY; without even the implied warranty of 
    19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
    20 # GNU General Public License for more details. 
    21 # 
    22 # You should have received a copy of the GNU General Public License 
    23 # along with this program; if not, write to the Free Software 
    24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
    25 # 02110-1301, USA. 
    2611# 
    2712 
     
    3116from AccessControl import ClassSecurityInfo 
    3217from Products.Archetypes.atapi import * 
     18from zope.interface import implements 
     19import interfaces 
     20 
     21from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin 
     22 
     23from Products.ATReferenceBrowserWidget.ATReferenceBrowserWidget import \ 
     24    ReferenceBrowserWidget 
    3325from Products.ATVocabularyManager.namedvocabulary import NamedVocabulary 
    3426from Products.PleiadesEntity.config import * 
     
    4133    StringField( 
    4234        name='placeType', 
    43         index="KeywordIndex", 
    44         vocabulary=NamedVocabulary("""place-types"""), 
    45         default="unknown", 
    46         enforceVocabulary=1, 
    4735        widget=SelectionWidget( 
    4836            label="Place Type", 
    4937            label_msgid='PleiadesEntity_label_placeType', 
    5038            i18n_domain='PleiadesEntity', 
    51         ) 
     39        ), 
     40        vocabulary=NamedVocabulary("""place-types"""), 
     41        default="unknown", 
     42        enforceVocabulary=1, 
    5243    ), 
    53  
    5444    StringField( 
    5545        name='associationCertainty', 
     
    6252        ), 
    6353        vocabulary=NamedVocabulary("""association-certainty"""), 
    64         enforceVocabulary=1 
     54        enforceVocabulary=1, 
    6555    ), 
    66  
    6756    ReferenceField( 
    6857        name='locations', 
    69         widget=ReferenceWidget( 
     58        widget=ReferenceBrowserWidget( 
    7059            label='Locations', 
    7160            label_msgid='PleiadesEntity_label_locations', 
     
    7463        allowed_types=('Location',), 
    7564        multiValued=1, 
    76         relationship='hasLocation' 
     65        relationship='hasLocation', 
    7766    ), 
    78  
    7967    ReferenceField( 
    8068        name='names', 
    81         widget=ReferenceWidget( 
     69        widget=ReferenceBrowserWidget( 
    8270            label='Names', 
    8371            label_msgid='PleiadesEntity_label_names', 
     
    8674        allowed_types=('Name',), 
    8775        multiValued=1, 
    88         relationship='hasName' 
     76        relationship='hasName', 
    8977    ), 
    90  
    9178), 
    9279) 
     
    10188##/code-section after-schema 
    10289 
    103 class PlacefulAssociation(BaseFolder): 
     90class PlacefulAssociation(BaseFolder, BrowserDefaultMixin): 
    10491    """Associates Names and Locations 
    10592    """ 
    10693    security = ClassSecurityInfo() 
    107     __implements__ = (getattr(BaseFolder,'__implements__',()),) 
    108  
    109     # This name appears in the 'add' box 
    110     archetype_name = 'PlacefulAssociation' 
     94    implements(interfaces.IPlacefulAssociation) 
    11195 
    11296    meta_type = 'PlacefulAssociation' 
    113     portal_type = 'PlacefulAssociation' 
    114     allowed_content_types = ['SecondaryReference'] 
    115     filter_content_types = 1 
    116     global_allow = 0 
    117     content_icon = 'place_icon.gif' 
    118     immediate_view = 'base_view' 
    119     default_view = 'base_view' 
    120     suppl_views = () 
    121     typeDescription = "PlacefulAssociation" 
    122     typeDescMsgId = 'description_edit_placefulassociation' 
    123  
    12497    _at_rename_after_creation = False 
    12598 
  • PleiadesEntity/trunk/content/PrimaryReference.py

    r602 r1244  
    33# File: PrimaryReference.py 
    44# 
    5 # Copyright (c) 2007 by Ancient World Mapping Center, University of North 
     5# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 1.5.0 
     7# Generator: ArchGenXML Version 2.0 
    88#            http://plone.org/products/archgenxml 
    99# 
    1010# GNU General Public License (GPL) 
    11 # 
    12 # This program is free software; you can redistribute it and/or 
    13 # modify it under the terms of the GNU General Public License 
    14 # as published by the Free Software Foundation; either version 2 
    15 # of the License, or (at your option) any later version. 
    16 # 
    17 # This program is distributed in the hope that it will be useful, 
    18 # but WITHOUT ANY WARRANTY; without even the implied warranty of 
    19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
    20 # GNU General Public License for more details. 
    21 # 
    22 # You should have received a copy of the GNU General Public License 
    23 # along with this program; if not, write to the Free Software 
    24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
    25 # 02110-1301, USA. 
    2611# 
    2712 
     
    3116from AccessControl import ClassSecurityInfo 
    3217from Products.Archetypes.atapi import * 
     18from zope.interface import implements 
     19import interfaces 
    3320from Products.PleiadesEntity.content.Reference import Reference 
     21from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin 
     22 
    3423from Products.PleiadesEntity.config import * 
    3524 
     
    5241##/code-section after-schema 
    5342 
    54 class PrimaryReference(Reference, BaseContent): 
     43class PrimaryReference(BaseContent, Reference, BrowserDefaultMixin): 
    5544    """ 
    5645    """ 
    5746    security = ClassSecurityInfo() 
    58     __implements__ = (getattr(Reference,'__implements__',()),) + (getattr(BaseContent,'__implements__',()),) 
    59  
    60     # This name appears in the 'add' box 
    61     archetype_name = 'Primary Source Citation' 
     47    implements(interfaces.IPrimaryReference) 
    6248 
    6349    meta_type = 'PrimaryReference' 
    64     portal_type = 'PrimaryReference' 
    65     allowed_content_types = [] + list(getattr(Reference, 'allowed_content_types', [])) 
    66     filter_content_types = 0 
    67     global_allow = 0 
    68     #content_icon = 'PrimaryReference.gif' 
    69     immediate_view = 'base_view' 
    70     default_view = 'base_view' 
    71     suppl_views = () 
    72     typeDescription = "Primary Source Citation" 
    73     typeDescMsgId = 'description_edit_primaryreference' 
    74  
    7550    _at_rename_after_creation = True 
    7651 
  • PleiadesEntity/trunk/content/Reference.py