Commit eda07473 authored by Papa Tamsir Kane's avatar Papa Tamsir Kane

erp5_curation_request: Remove no longer necessary scripts and comments

parent d59ec232
<?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/date</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>preparation_date_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
decision_lines = []
#decision_list.extend(context.getCausalityRelatedValueList())
for decision in context.getCausalityRelatedValueList():
decision_lines.extend(decision.contentValues(filter={'portal_type': 'Decision Line'}))
#raise MyException(decision.contentValues(filter={'portal_type': 'Decision Line'}))
return decision_lines
......@@ -4,7 +4,6 @@
result = context.portal_catalog(portal_type = "Business Process",
sort_on = (('int_index', 'ASC',),))
# validation_state = 'validated')
bps = [r for r in result if r.getReference().startswith('curation_request')]
return bps
#portal = context.getPortalObject()
#url = portal.restrictedTraverse(url_relative_url)
if context.getAggregateRelatedValue() is None:
curation_request = context.curation_request_module.newContent(portal_type='Curation Request')
curation_record_line = curation_request.newContent(portal_type='Curation Request Line',
......
result = context.portal_catalog(portal_type='Alarm', id='create_curation_request_for_new_url')
class MyException(Exception):
pass
raise MyException([r for r in result])
<?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>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ptk_customScript</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""
publish/cancell all related Curation Records / Urls according to curation request state
cancell all related Curation Records / Urls
"""
curation_request = state_change['object']
curation_request_lines = curation_request.contentValues(filter = {'portal_type': 'Curation Request Line'})
# we set curations request lines state according to previous state of curation request
'''
class MyException(Exception):
pass
raise MyException('ptk: fix url/curation record workflow then fix this script')
'''
for curation_request_line in curation_request_lines:
curated_object = curation_request_line.getAggregateValue()
curated_object.cancel()
"""
When a Curation Request is set to Pending state,
a Decision is created with its causality set to the Curation Request
"""
portal = context.getPortalObject()
translate = portal.Base_translateString
curation_request = state_change['object']
new_decision_title = translate('decision_for_{}'.format(curation_request.getTitle()))
new_decision = context.decision_module.newContent(portal_type='Decision',
title=new_decision_title,
reference=new_decision_title,
causality_value=curation_request)
new_decision.post()
<?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>state_change</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>CurationRequest_createDecision</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
curation_request = state_change['object']
'''
class MyException(Exception):
pass
raise MyException(curation_request.getMovementList())
'''
curation_request.localBuild()
"""
publish/cancell all related Curation Records / Urls according to curation request state
publish all related Curation Records / Urls
"""
curation_request = state_change['object']
curation_request_lines = curation_request.contentValues(filter = {'portal_type': 'Curation Request Line'})
# we set curations request lines state according to previous state of curation request
'''
class MyException(Exception):
pass
raise MyException('ptk: fix url/curation record workflow then fix this script')
'''
for curation_request_line in curation_request_lines:
curated_object = curation_request_line.getAggregateValue()
if curated_object is not None:
......
"""
Post all contained Curation Request Line List.
"""
curation_request = state_change['object']
translate = curation_request.Base_translateString
for curation_request_line in curation_request.contentValues(filter = {'portal_type': 'Curation Request Line'}):
curation_request_line.submit()
<?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>state_change</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>CurationRequest_submitCurationRequestLineList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
document = state_change['object']
if document.getPreparationDate() is None:
# Store the first preparation date.
document.setPreparationDate(DateTime())
......@@ -62,7 +62,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>CurationRequest_setPreparationDate</string> </value>
<value> <string>CurationRequest_updateSimulation</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -24,7 +24,7 @@
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string>CurationRequest_setPreparationDate</string> </value>
<value> <string>CurationRequest_updateSimulation</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......
trade_phase/curation_request
trade_phase/curation_request/approve
trade_phase/curation_request/approve/legal
trade_state/curation_request
trade_state/curation_request/submitted
\ No newline at end of file
portal_rules/curation_request*
portal_rules/curation_request*/**
portal_rules/decision_simulation_rule
portal_rules/decision_simulation_rule/**
\ 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