Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
c21cf665
Commit
c21cf665
authored
Apr 14, 2015
by
John Eskew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only include published items in course export.
parent
270ac747
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
common/lib/xmodule/xmodule/modulestore/xml_exporter.py
+10
-9
No files found.
common/lib/xmodule/xmodule/modulestore/xml_exporter.py
View file @
c21cf665
...
...
@@ -153,20 +153,15 @@ class ExportManager(object):
Perform the export given the parameters handed to this class at init.
"""
with
self
.
modulestore
.
bulk_operations
(
self
.
courselike_key
):
# depth = None: Traverses down the entire course structure.
# lazy = False: Loads and caches all block definitions during traversal for fast access later
# -and- to eliminate many round-trips to read individual definitions.
# Why these parameters? Because a course export needs to access all the course block information
# eventually. Accessing it all now at the beginning increases performance of the export.
fsm
=
OSFS
(
self
.
root_dir
)
courselike
=
self
.
get_courselike
()
export_fs
=
courselike
.
runtime
.
export_fs
=
fsm
.
makeopendir
(
self
.
target_dir
)
root_courselike_dir
=
self
.
root_dir
+
'/'
+
self
.
target_dir
fsm
=
OSFS
(
self
.
root_dir
)
root
=
lxml
.
etree
.
Element
(
'unknown'
)
# pylint: disable=no-member
# export only the published content
with
self
.
modulestore
.
branch_setting
(
ModuleStoreEnum
.
Branch
.
published_only
,
self
.
courselike_key
):
courselike
=
self
.
get_courselike
()
export_fs
=
courselike
.
runtime
.
export_fs
=
fsm
.
makeopendir
(
self
.
target_dir
)
# change all of the references inside the course to use the xml expected key type w/o version & branch
xml_centric_courselike_key
=
self
.
get_key
()
adapt_references
(
courselike
,
xml_centric_courselike_key
,
export_fs
)
...
...
@@ -176,6 +171,7 @@ class ExportManager(object):
self
.
process_root
(
root
,
export_fs
)
# Process extra items-- drafts, assets, etc
root_courselike_dir
=
self
.
root_dir
+
'/'
+
self
.
target_dir
self
.
process_extra
(
root
,
courselike
,
root_courselike_dir
,
xml_centric_courselike_key
,
export_fs
)
# Any last pass adjustments
...
...
@@ -192,6 +188,11 @@ class CourseExportManager(ExportManager):
)
def
get_courselike
(
self
):
# depth = None: Traverses down the entire course structure.
# lazy = False: Loads and caches all block definitions during traversal for fast access later
# -and- to eliminate many round-trips to read individual definitions.
# Why these parameters? Because a course export needs to access all the course block information
# eventually. Accessing it all now at the beginning increases performance of the export.
return
self
.
modulestore
.
get_course
(
self
.
courselike_key
,
depth
=
None
,
lazy
=
False
)
def
process_root
(
self
,
root
,
export_fs
):
...
...
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