Commit 389e4dbd authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Cédric Le Ninivin

erp5_api_style: Move JIO API revision to depend on the web section

parent db7185fb
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>jio_api_revision_configuration</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>3.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>JIO API Revisions</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/JIOWebSection_viewJIOAPIRevisionConfiguration</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -38,22 +38,28 @@ class JIOAPIRevisionMixin:
security.declareProtected(Permissions.AccessContentsInformation,
'getJIOAPIRevision')
def getJIOAPIRevision(self):
def getJIOAPIRevision(self, web_section):
"""
Return Object Revision
"""
return self._getJIOAPIRevisionTuple()[0]
return self._getJIOAPIRevisionTuple(web_section)[0]
def _unindexJIOAPIRevision(self):
def _unindexJIOAPIRevision(self, web_section):
try:
self.Base_zUnindexFromjIOAPIRevisionTable(uid=self.getUid())
self.Base_zUnindexFromjIOAPIRevisionTable(
uid=self.getUid(),
web_section=web_section
)
except ProgrammingError:
# jio_api_revision table is not created
pass
def _getJIOAPIRevisionTuple(self):
def _getJIOAPIRevisionTuple(self, web_section):
try:
result = self.Base_zGetFromIOAPIRevisionTable(uid=self.getUid())
result = self.Base_zGetFromIOAPIRevisionTable(
uid=self.getUid(),
web_section=web_section,
)
except ProgrammingError:
# jio_api_revision table is not created
return None, None, None
......@@ -61,54 +67,65 @@ class JIOAPIRevisionMixin:
return result[0].revision, result[0].hash, result[0].indexation_timestamp
return None, None, None
def _calculateHash(self):
hash_method = self.getTypeBasedMethod("calculatejIOAPIRevisionHash")
def _calculateHash(self, web_section, hash_method):
if not hash_method:
return None
return hash_method()
hash_method = getattr(self, hash_method)
return hash_method(web_section=web_section)
security.declareProtected(Permissions.ManagePortal, 'updateJIOAPIRevision')
def updateJIOAPIRevision(self):
def updateJIOAPIRevision(self, web_section_url, hash_method):
"""
Update jIO API Revision
"""
calculated_hash = self._calculateHash(web_section_url, hash_method)
if not calculated_hash:
self._unindexJIOAPIRevision(web_section_url)
return
indexation_timestamp = int(DateTime(self.getPortalObject().portal_catalog(
uid=self.getUid(), select_list=('indexation_timestamp',)
)[0].indexation_timestamp))
calculated_hash = self._calculateHash()
if not calculated_hash:
self._unindexJIOAPIRevision()
return
stored_hash = None
_, stored_hash, stored_timestamp = self._getJIOAPIRevisionTuple()
_, stored_hash, stored_timestamp = self._getJIOAPIRevisionTuple(web_section_url)
stored_timestamp = int(DateTime(stored_timestamp))
if stored_hash == calculated_hash:
if stored_timestamp != indexation_timestamp:
self.Base_zUpdateTimeStampjIOAPIRevisionTable(
uid=self.getUid(),
indexation_timestamp=indexation_timestamp,
web_section=web_section_url
)
return
new_revision = self.Base_getNewjIOAPIRevision()
new_revision = self.Base_getNewjIOAPIRevision(web_section_url)
self.Base_zUpdatejIOAPIRevisionTable(
uid=self.getUid(),
revision=new_revision,
hash=calculated_hash,
indexation_timestamp=indexation_timestamp,
web_section=web_section_url
)
return
def _getHashMethodFromWebSection(self, web_section_url):
hash_method_list = [[
y.strip() for y in x.split('|')] for x in \
self.getPortalObject().restrictedTraverse(web_section_url).getRevisionHashCalculationMethodPerTypeList()]
hash_method_dict = {x[0]: x[1] for x in hash_method_list}
return hash_method_dict.get(self.getPortalType(), None)
security.declareProtected(Permissions.ManagePortal, 'markUnmatchingJIOAPIrevisionHash')
def markUnmatchingJIOAPIrevisionHash(self):
def markUnmatchingJIOAPIrevisionHash(self, web_section_url, hash_method=None):
"""
Check if the calculated hash match the stored one.
If not set jio_api_revision timestamp to 0 to triger reprocessing by alarm
"""
calculated_hash = self._calculateHash()
_, stored_hash, _ = self._getJIOAPIRevisionTuple()
if not hash_method:
hash_method = self._getHashMethodFromWebSection(web_section_url)
calculated_hash = self._calculateHash(web_section_url, hash_method)
_, stored_hash, _ = self._getJIOAPIRevisionTuple(web_section_url)
if calculated_hash != stored_hash:
# Marking jIO API revision timestamp to zero will trigger reprocessing
self.Base_zUpdateTimeStampjIOAPIRevisionTable(
......@@ -119,13 +136,15 @@ class JIOAPIRevisionMixin:
security.declareProtected(Permissions.AccessContentsInformation,
'checkJIOAPIRevisionConstraint')
def checkJIOAPIRevisionConstraint(self, **kw):
def checkJIOAPIRevisionConstraint(self, web_section_url, hash_method=None):
"""
Check is calculated Hash equals to the stored one
Fixing is not offered as it needs to be centralised to avoid missing a new revision for an object
"""
calculated_hash = self._calculateHash()
_, stored_hash, _ = self._getJIOAPIRevisionTuple()
if not hash_method:
hash_method = self._getHashMethodFromWebSection(web_section_url)
calculated_hash = self._calculateHash(web_section_url, hash_method)
_, stored_hash, _ = self._getJIOAPIRevisionTuple(web_section_url)
if calculated_hash != stored_hash:
return [self.Base_translateString(
"Stored Hash ${stored_hash} difer from calculated hash ${calculated_hash}",
......
......@@ -3,6 +3,7 @@
<item>TextDocument</item>
</portal_type>
<portal_type id="jIO Web Section">
<item>JIOAPIRevisionConfiguration</item>
<item>SortIndex</item>
<item>WebSectionUpgradeConstraint</item>
</portal_type>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Sheet" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>JIOAPIRevisionConfiguration</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Sheet</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/lines</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>revision_hash_calculation_method_per_type_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>property_default</string> </key>
<value> <string>python: ()</string> </value>
</item>
<item>
<key> <string>read_permission</string> </key>
<value> <string>Modify portal content</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/string</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>select_missing_revision_object_list_method_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>read_permission</string> </key>
<value> <string>Modify portal content</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/string</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>select_updatable_revision_object_list_method_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>read_permission</string> </key>
<value> <string>Modify portal content</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
if not context.Base_zCheckjIOAPIRevisionTableExists():
context.Base_zCreatejIOAPIRevisionTable()
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery
context.getPortalObject().portal_catalog.searchAndActivate(
method_id='markUnmatchingJIOAPIrevisionHash',
method_id='JIOWebSection_checkAndFixUnmatchingJIOAPIRevisionHash',
method_kw={'tag': tag},
activate_kw={'tag':tag, 'priority': 8},
query=SimpleQuery(comparison_operator="!=", **{"jio_api_revision.revision": None}),
portal_type="jIO Web Section",
validation_state="!=expired",
)
......
......@@ -3,14 +3,11 @@ if not context.Base_zCheckjIOAPIRevisionTableExists():
portal = context.getPortalObject()
# Get the list of objects that should have a jio api revision but do not have
potentially_missing_object_list = portal.Base_zSelectMissingJIOAPIRevisionObjectList()
for element in potentially_missing_object_list:
portal.unrestrictedTraverse(element.relative_url).updateJIOAPIRevision()
# Get the list of objects that have a jio api revision and where indexation timestamp has changed since last check
updatable_object_list = context.Base_zSelectUpdatableJIOAPIRevisionObjectList()
for element in updatable_object_list:
portal.unrestrictedTraverse(element.relative_url).updateJIOAPIRevision()
portal.portal_catalog.searchAndActivate(
method_id="JIOWebSection_updateJIOAPIRevision",
portal_type="jIO Web Section",
validation_state="!=expired",
activate_kw={'tag':tag},
)
context.activate(after_tag=tag).getId()
return context.getPortalObject().portal_ids.generateNewId(id_group=repr(('revision', "jio_api_reference")), default=1)
return context.getPortalObject().portal_ids.generateNewId(id_group=repr(('revision', "jio_api_reference", web_section_url)), default=1)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>web_section_url</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
CREATE TABLE `jio_api_revision` (
`uid` BIGINT UNSIGNED NOT NULL,
`revision` varchar(255) NOT NULL UNIQUE,
`revision` varchar(255) NOT NULL,
`hash` varchar(255),
`indexation_timestamp` TIMESTAMP(6),
PRIMARY KEY (`uid`)
`web_section` varchar(255) NOT NULL,
PRIMARY KEY (`uid`, `web_section`),
CONSTRAINT UC_Revision UNIQUE (`revision`, `web_section`)
) ENGINE=InnoDB
\ No newline at end of file
......@@ -3,4 +3,4 @@ SELECT
FROM
jio_api_revision
WHERE
uid=<dtml-sqlvar expr="uid" type="int">
uid=<dtml-sqlvar expr="uid" type="int"> AND web_section=<dtml-sqlvar expr="web_section" type="string">
......@@ -6,9 +6,71 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_col</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>name</string> </key>
<value> <string>revision</string> </value>
</item>
<item>
<key> <string>null</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>t</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>name</string> </key>
<value> <string>hash</string> </value>
</item>
<item>
<key> <string>null</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>t</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>9</int> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>name</string> </key>
<value> <string>indexation_timestamp</string> </value>
</item>
<item>
<key> <string>null</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>d</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>26</int> </value>
</item>
</dictionary>
</list>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string encoding="base64">dWlkCg==</string> </value>
<value> <string>uid\n
web_section</string> </value>
</item>
<item>
<key> <string>connection_id</string> </key>
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>web_section</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
select catalog.uid, catalog.relative_url from catalog join jio_api_revision on CAST(catalog.indexation_timestamp AS INT) != CAST(jio_api_revision.indexation_timestamp AS INT) AND catalog.uid = jio_api_revision.uid
select
catalog.uid,
catalog.relative_url,
catalog.portal_type
from
catalog
join
jio_api_revision on CAST(catalog.indexation_timestamp AS INT) != CAST(jio_api_revision.indexation_timestamp AS INT) AND catalog.uid = jio_api_revision.uid
where
jio_api_revision.web_section=<dtml-sqlvar expr="web_section" type="string">
\ No newline at end of file
......@@ -25,7 +25,7 @@
</item>
<item>
<key> <string>width</string> </key>
<value> <int>0</int> </value>
<value> <int>6</int> </value>
</item>
</dictionary>
<dictionary>
......@@ -43,7 +43,25 @@
</item>
<item>
<key> <string>width</string> </key>
<value> <int>0</int> </value>
<value> <int>39</int> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>name</string> </key>
<value> <string>portal_type</string> </value>
</item>
<item>
<key> <string>null</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>t</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>17</int> </value>
</item>
</dictionary>
</list>
......@@ -51,7 +69,7 @@
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string></string> </value>
<value> <string>web_section</string> </value>
</item>
<item>
<key> <string>connection_id</string> </key>
......
DELETE FROM jio_api_revision WHERE <dtml-sqltest uid op=eq type=int>
DELETE FROM jio_api_revision WHERE <dtml-sqltest uid op=eq type=int> AND <dtml-sqltest web_section op=eq type=string>
......@@ -6,9 +6,16 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_col</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string>uid</string> </value>
<value> <string>uid\n
web_section</string> </value>
</item>
<item>
<key> <string>connection_id</string> </key>
......
DELETE FROM
jio_api_revision
WHERE
uid=<dtml-sqlvar expr="uid" type="int">
uid=<dtml-sqlvar expr="uid" type="int"> AND web_section=<dtml-sqlvar expr="web_section" type="string">
;
<dtml-var "'\0'">
......@@ -14,6 +14,7 @@ VALUES
<dtml-sqlvar expr="uid" type="int">,
<dtml-sqlvar expr="revision" type="string" optional>,
<dtml-sqlvar expr="hash" type="string" optional>,
<dtml-sqlvar expr="indexation_timestamp" type="datetime" optional>
<dtml-sqlvar expr="indexation_timestamp" type="datetime" optional>,
<dtml-sqlvar expr="web_section" type="string" optional>
)
......@@ -6,12 +6,19 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_col</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string>uid\n
revision\n
hash\n
indexation_timestamp</string> </value>
indexation_timestamp\n
web_section</string> </value>
</item>
<item>
<key> <string>connection_id</string> </key>
......
context.getPortalObject().portal_catalog.searchAndActivate(
method_id='markUnmatchingJIOAPIrevisionHash',
method_kw={"web_section_url": context.getRelativeUrl()},
activate_kw={'tag':tag, 'priority': 8},
**{"jio_api_revision.web_section": context.getRelativeUrl()}
)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>tag</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>JIOWebSection_checkAndFixUnmatchingJIOAPIRevisionHash</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
select_missing_method = context.getSelectMissingRevisionObjectListMethod()
select_updatable_method = context.getSelectUpdatableRevisionObjectListMethod()
hash_method_list = [[y.strip() for y in x.split('|')] for x in \
context.getRevisionHashCalculationMethodPerTypeList()]
hash_method_dict = {x[0]: x[1] for x in hash_method_list}
if not select_missing_method or not select_updatable_method or not hash_method_dict:
# Revisions are not configured
return
portal = context.getPortalObject()
web_section_relative_url = context.getRelativeUrl()
# Get the list of objects that should have a jio api revision but do not have
potentially_missing_object_list = getattr(portal, select_missing_method)(web_section=web_section_relative_url)
# Get the list of objects that have a jio api revision and where indexation timestamp has changed since last check
updatable_object_list = getattr(portal, select_updatable_method)(web_section=web_section_relative_url)
for result_list in (updatable_object_list, potentially_missing_object_list):
for element in result_list:
portal.restrictedTraverse(element.relative_url).updateJIOAPIRevision(
web_section_relative_url,
hash_method_dict.get(element.portal_type, None)
)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>JIOWebSection_updateJIOAPIRevision</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
</item>
<item>
<key> <string>action_title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list>
<string>my_revision_hash_calculation_method_per_type_list</string>
</list>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_select_missing_revision_object_list_method</string>
<string>my_select_updatable_revision_object_list_method</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>JIOWebSection_viewJIOAPIRevisionConfiguration</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>JIOWebSection_viewJIOAPIRevisionConfiguration</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>ERP5 Form</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>JIO API Revision Configuration</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>height</string>
<string>title</string>
<string>width</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_revision_hash_calculation_method_per_type_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_lines_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>10</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Revision Hash Calculation Method per Type</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>100</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_select_missing_revision_object_list_method</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Select Missing Revision Method</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_select_updatable_revision_object_list_method</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Select Updatable Revision Method</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -2,6 +2,11 @@
mode = mode or context.REQUEST.form.get("mode", "get")
text_content = text_content or context.REQUEST.form.get("text_content", "")
document_id = document_id or context.REQUEST.form.get("document_id", "")
web_section_value = context.getWebSectionValue()
if web_section_value:
context.REQUEST.set("web_section_relative_url", web_section_value.getRelativeUrl())
import json
portal = context.getPortalObject()
......
Error Record Module | view
Error Record | view
jIO Web Section | jio_api_revision_configuration
jIO Web Section | layout_configuration
jIO Web Section | local_permission
jIO Web Section | predicate
......
Error Record | TextDocument
jIO Web Section | JIOAPIRevisionConfiguration
jIO Web Section | SortIndex
jIO Web Section | WebSectionUpgradeConstraint
\ No newline at end of file
JIOAPIRevisionConstraint
\ No newline at end of file
JIOAPIRevisionConstraint
JIOAPIRevisionConfiguration
\ No newline at end of file
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