Commit 1f8301a5 authored by Arnaud Fontaine's avatar Arnaud Fontaine

WIP: erp5_certificate_authority: Certificate Authority Tool: All ERP5 objects...

WIP: erp5_certificate_authority: Certificate Authority Tool: All ERP5 objects *must* have have a Portal Type in Types Tool.

And remove hack in erp5_promise which was creating a non-Portal Type class of
portal_certificate_authority. Instead, add a depend on erp5_certificate_authority.
`providesI*` accessors are now in BaseAccessorHolder rather than Base due to ZODB
Components, this breaks reindexing (`AttributeError: providesIPredicate`).

This gets rid of:
  WARNING ERP5Type.dynamic Cannot find a portal type definition for 'Certificate Authority Tool', trying to guess...

TODO: Add commit IDs of:
  * ZODB Components: providesIFoo() getters were only created for FS Interfaces.
  * Portal Type as Classes: ERP5Form: Instances of Documents should never be created directly.
parent b30d9285
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Base Type" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_property_domain_dict</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>acquire_local_roles</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>content_icon</string> </key>
<value> <string>folder_icon.gif</string> </value>
</item>
<item>
<key> <string>content_meta_type</string> </key>
<value> <string>ERP5 Folder</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>factory</string> </key>
<value> <string>addFolder</string> </value>
</item>
<item>
<key> <string>filter_content_types</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Certificate Authority Tool</string> </value>
</item>
<item>
<key> <string>init_script</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>permission</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Contribution Tool</string> </value>
</item>
<item>
<key> <string>type_class</string> </key>
<value> <string>CertificateAuthorityTool</string> </value>
</item>
<item>
<key> <string>type_interface</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>type_mixin</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>description</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>short_title</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>title</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Certificate Authority Tool
\ No newline at end of file
portal = context.getPortalObject()
portal_certificate_authority = getattr(portal, 'portal_certificate_authority', None)
portal_certificate_authority = portal.portal_certificate_authority
promise_ca_path = portal.getPromiseParameter('portal_certificate_authority', 'certificate_authority_path')
if portal_certificate_authority is None:
portal.manage_addProduct['ERP5'].manage_addTool('ERP5 Certificate Authority Tool', None)
portal_certificate_authority = getattr(portal, 'portal_certificate_authority')
portal_certificate_authority.manage_editCertificateAuthorityTool(
certificate_authority_path=promise_ca_path)
erp5_core
\ No newline at end of file
erp5_core
erp5_certificate_authority
\ No newline at end of file
......@@ -289,12 +289,4 @@ class CertificateAuthorityTool(BaseTool):
serial = self._getValidSerial(common_name)
self.revokeCertificate(serial)
# XXX: This class lacks a corresponding portal type, so its instances are not
# actual documents. A portal type should be created from it, and backward
# compatibility added to keep existing instances working.
# Until then, hardcode some methods expected to exist on all document
# classes so that they can be removed from Base.
def _getAcquireLocalRoles(self):
return True
InitializeClass(CertificateAuthorityTool)
......@@ -38,7 +38,7 @@ class TestERP5Promise(ERP5TypeTestCase):
"""
Return the list of business templates.
"""
return ("erp5_promise", "erp5_base")
return ("erp5_base", "erp5_certificate_authority", "erp5_promise")
def _test_promise_alarm(self, alarm_id):
alarm = self.portal.portal_alarms[alarm_id]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment