Commit 0ce1e644 authored by Ivan Tyagov's avatar Ivan Tyagov

Use permanent URL.

Set same categories as predicate on web section.
parent fb86cd76
......@@ -49,7 +49,7 @@
tal:condition="not:is_author_link_available"/>\n
\n
<a class="listbox-row-discussion-thread-last-post-link"\n
tal:attributes="href python: \'%s/view?list_start=%s&reset=1#%s\' %(here.absolute_url(), last_post.getId(), last_post.getUid())"> \n
tal:attributes="href python: \'%s/view?list_start=%s&reset=1#%s\' %(here.getReference(), last_post.getId(), last_post.getUid())">\n
<img src="document_icon.gif" alt="Link To Post"/>\n
</a>\n
\n
......@@ -71,7 +71,7 @@
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
<value> <string>iso-8859-15</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -70,9 +70,14 @@ if site_list in MARKER:\n
membership_criterion_category_list = context.getMembershipCriterionCategoryList()\n
multimembership_criterion_base_category_list = context.getMultimembershipCriterionBaseCategoryList()\n
\n
# XXX: what if reference duplicates : add some random part ?\n
reference = title.replace(\' \', \'-\')\n
exisiting_document = context.getDocumentValue(reference)\n
if exisiting_document is not None:\n
# if there are other document which reference duplicates just add some random part\n
# so we can distinguish)\n
reference = \'%s-%s\' %(context.Base_generateRandomString(), reference)\n
\n
category_list = []\n
create_kw = dict(title = title,\n
source_value = person,\n
reference = reference,\n
......@@ -83,12 +88,19 @@ create_kw = dict(title = title,\n
classification=classification,\n
group_list=group_list,\n
site_list=site_list)\n
\n
for base_category in multimembership_criterion_base_category_list:\n
create_kw[\'%s_list\' %base_category] = [x for x in membership_criterion_category_list if x.startswith(base_category)]\n
#create_kw[\'%s_list\' %base_category] = [x for x in membership_criterion_category_list if x.startswith(base_category)]\n
category_list.extend([x for x in membership_criterion_category_list if x.startswith(base_category)])\n
\n
discussion_thread = portal.discussion_thread_module.newContent(\n
portal_type = "Discussion Thread",\n
**create_kw)\n
# as we create a thread under a "root" predicate web section copy\n
# all categories from it to create thread, this way thread will be part\n
# of web section (through getDocumentValue API)\n
discussion_thread.setCategoryList(category_list)\n
\n
discussion_post = discussion_thread.newContent(\n
portal_type = "Discussion Post",\n
title = title,\n
......
108
\ No newline at end of file
109
\ 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