Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
francois
erp5
Commits
0f361067
Commit
0f361067
authored
Oct 06, 2015
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_data_notebook bt5: Add comments in python scripts from portal_skin for this bt5
parent
bb3fe819
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
bt5/erp5_data_notebook/SkinTemplateItem/portal_skins/erp5_data_notebook/DataNotebookModule_addDataNotebook.xml
...erp5_data_notebook/DataNotebookModule_addDataNotebook.xml
+15
-1
bt5/erp5_data_notebook/SkinTemplateItem/portal_skins/erp5_data_notebook/DataNotebook_addDataNotebookMessage.xml
...rp5_data_notebook/DataNotebook_addDataNotebookMessage.xml
+9
-1
No files found.
bt5/erp5_data_notebook/SkinTemplateItem/portal_skins/erp5_data_notebook/DataNotebookModule_addDataNotebook.xml
View file @
0f361067
...
@@ -50,17 +50,28 @@
...
@@ -50,17 +50,28 @@
</item>
</item>
<item>
<item>
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string>
from Products.CMFActivity.ActiveResult import ActiveResult\n
<value>
<string>
"""\n
Python script to add a new notebook to Data Notebook module.\n
This script also concerns for assigning an Active Process for each data notebook\n
created.\n
"""\n
from Products.CMFActivity.ActiveResult import ActiveResult\n
\n
\n
# Comment out person in case addition of person required to Data Notebook object\n
#person = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
#person = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
\n
\n
# Create new ActiveProcess object and getting its id\n
active_process = context.portal_activities.newActiveProcess()\n
active_process = context.portal_activities.newActiveProcess()\n
active_process_id = active_process.getId()\n
active_process_id = active_process.getId()\n
\n
\n
# Creating new dictionary via external method to save results in ZODB\n
new_dict = context.Base_addPersistentMapping()\n
new_dict = context.Base_addPersistentMapping()\n
# Add new ActiveResult object and add it to the activeprocess concerned with ...\n
# Data Notebook in concern\n
result = ActiveResult(summary=new_dict)\n
result = ActiveResult(summary=new_dict)\n
active_process.activateResult(result)\n
active_process.activateResult(result)\n
\n
\n
# Create new notebook\n
notebook = context.newContent(\n
notebook = context.newContent(\n
title=title,\n
title=title,\n
reference=reference,\n
reference=reference,\n
...
@@ -68,14 +79,17 @@ notebook = context.newContent(\n
...
@@ -68,14 +79,17 @@ notebook = context.newContent(\n
portal_type=\'Data Notebook\'\n
portal_type=\'Data Notebook\'\n
)\n
)\n
\n
\n
# Return notebook for batch_mode, used in tests\n
if batch_mode:\n
if batch_mode:\n
return notebook\n
return notebook\n
\n
\n
# Add status message to be displayed after new notebook creation\n
translateString = context.Base_translateString\n
translateString = context.Base_translateString\n
portal_status_message = translateString(\n
portal_status_message = translateString(\n
"New Notebook created"\n
"New Notebook created"\n
)\n
)\n
\n
\n
# Redirect the notebook view with the status message being displayed\n
return notebook.Base_redirect(\'view\',\n
return notebook.Base_redirect(\'view\',\n
keep_items=dict(portal_status_message=portal_status_message), **kw)\n
keep_items=dict(portal_status_message=portal_status_message), **kw)\n
</string>
</value>
</string>
</value>
...
...
bt5/erp5_data_notebook/SkinTemplateItem/portal_skins/erp5_data_notebook/DataNotebook_addDataNotebookMessage.xml
View file @
0f361067
...
@@ -50,20 +50,28 @@
...
@@ -50,20 +50,28 @@
</item>
</item>
<item>
<item>
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string>
notebook_message = context.newContent(\n
<value>
<string>
"""\n
This python script concerns with creation of new notebook message which would\n
have notebook_code from jupyter frontend as well as its executed result\n
"""\n
# Create new Data Notebook Message object\n
notebook_message = context.newContent(\n
notebook_code=notebook_code,\n
notebook_code=notebook_code,\n
notebook_code_result=notebook_code_result,\n
notebook_code_result=notebook_code_result,\n
portal_type="Data Notebook Message"\n
portal_type="Data Notebook Message"\n
)\n
)\n
\n
\n
# Return notebook_message object for batch mode, used in tests\n
if batch_mode:\n
if batch_mode:\n
return notebook_message\n
return notebook_message\n
\n
\n
# Add status message to be displayed after new notebook message creation\n
translateString = context.Base_translateString\n
translateString = context.Base_translateString\n
portal_status_message = translateString(\n
portal_status_message = translateString(\n
"New Notebook message created"\n
"New Notebook message created"\n
)\n
)\n
\n
\n
# Redirect the notebook_message view with the status message being displayed\n
return notebook_message.Base_redirect(\'view\',\n
return notebook_message.Base_redirect(\'view\',\n
keep_items=dict(portal_status_message=portal_status_message), **kw)\n
keep_items=dict(portal_status_message=portal_status_message), **kw)\n
</string>
</value>
</string>
</value>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment