Commit 8158b09e authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

erp5_officejs_appstore_base: Various fixes

parent ddf3d1ea
......@@ -26,7 +26,7 @@ software_release = portal.software_release_module.newContent(
title=context.getTitle() + ' release ' + version_title + '-' + version,
# XXX the follow_up lkink is actually nonsense and redundant
follow_up=context.getRelativeUrl(),
version=version,
version=version_title,
)
# Create Software Publication Line
......@@ -49,7 +49,7 @@ section.edit(
title="%s %s" % (context.getTitle(), version_title),
short_title=context.getTitle(),
description=context.getDescription(),
id=version,
id=version_title,
)
section.setCriterionPropertyList([
......@@ -59,6 +59,7 @@ section.setCriterionPropertyList([
section.setCriterion('version', version)
section.setCriterion('validation_state', 'submitted')
section.setMembershipCriterionCategoryList(['follow_up/' + software_release.getRelativeUrl()])
# Clone all curent Web Document and share them with the correct Version
web_document_list = portal.portal_catalog(
......
......@@ -29,6 +29,10 @@ version_web_section = web_site[software_release.getVersion()]
version_web_section.setCriterion('validation_state', 'published')
version_web_section.publish()
web_site.edit(
configuration_latest_version=software_release.getVersion(),
)
# Is latest Websection what we want?
if "latest" not in web_site.objectIds():
latest_web_section = version_web_section.Base_createCloneDocument(batch_mode=True)
......@@ -42,6 +46,6 @@ else:
latest_web_section.setAggregate(version_web_section.getAggregate())
# Archive former versions
for web_section in web_site.objectValues(portal_type="Web Section"):
if web_section.getId() not in ('latest', 'development', 'hateoas', version_web_section.getId()):
web_section.setCriterion('validation_state', 'archived')
#for web_section in web_site.objectValues(portal_type="Web Section"):
# if web_section.getId() not in ('latest', 'development', 'hateoas', version_web_section.getId()):
# web_section.setCriterion('validation_state', 'archived')
......@@ -42,6 +42,8 @@ path_list = [software_product_rurl]
print " Processing File List \r===============================\r"
for document_brain in document_list:
document = document_brain.getObject()
if document.getFollowUp():
continue
print document.getId()
new_document = document.Base_createCloneDocument(batch_mode=True)
new_id = base_id + new_document.getReference().replace('.', '_')
......
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