Changeset 886


Ignore:
Timestamp:
05/15/12 12:55:56 (3 years ago)
Author:
brent
Message:

Updated page templates to be more informatvie.

Location:
Products.ecmigration/trunk/Products/ecmigration
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Products.ecmigration/trunk/Products/ecmigration/MigrationTool.py

    r862 r886  
    1 # -*- coding: us-ascii -*- 
     1 # -*- coding: us-ascii -*- 
    22# _______________________________________________________________________ 
    33#              __________                      .__         
     
    3838from Products.PageTemplates.PageTemplateFile import PageTemplateFile 
    3939from Globals import InitializeClass 
    40 from migrate import ECMigration 
     40from migrate import ECMigration, getBaseDirectory, getLogDirectory 
    4141import os 
    4242 
     
    6262    security.declareProtected(ManagePortal, 'manage_import') 
    6363    manage_import = PageTemplateFile(os.path.join('www','ecmigration_import'), globals()) 
     64 
    6465    security.declareProtected(ManagePortal, 'manage_export') 
    6566    manage_export = PageTemplateFile(os.path.join('www','ecmigration_export'), globals()) 
     67 
     68    def getBaseDir(self): 
     69        return '%s' %getBaseDirectory(create=False) 
     70 
     71    def getLogDir(self): 
     72        return '%s' %getLogDir() 
    6673 
    6774    security.declareProtected(ManagePortal, 'importFilenames') 
     
    8592        """ Export content from eduCommons """ 
    8693        mig = ECMigration(self.portal_url.getPortalObject()) 
    87         mig.exportContent() 
     94        results = mig.exportContent() 
     95        if REQUEST: 
     96            REQUEST['export_results'] = results 
    8897        if REQUEST: 
    8998            REQUEST.response.redirect('manage_overview') 
  • Products.ecmigration/trunk/Products/ecmigration/migrate.py

    r862 r886  
    9696# Migration logging 
    9797 
    98 def getBaseDirectory(): 
     98def getBaseDirectory(create=True): 
    9999    """ Get the base directory for migration files """ 
    100100    try: 
     
    103103        cwd = os.getcwd()    # needed for eduCommons 4.0.0 
    104104    basedir = os.path.join(cwd, 'migration') 
    105     if not os.path.exists(basedir): 
    106         os.mkdir(basedir) 
     105    if create: 
     106        if not os.path.exists(basedir): 
     107            os.mkdir(basedir) 
    107108    return basedir 
     109 
     110def getLogDirectory(): 
     111    getBaseDirectory(create=False) 
     112    base = getBaseDirectory() 
     113    return os.path.join(base, 'ecmigration.log') 
    108114 
    109115def setupLogging(logger): 
    110116    """ Set up logging for the migration """ 
    111     base = getBaseDirectory() 
    112     logfn = os.path.join(base, 'ecmigration.log') 
     117    logfn = getLogDirectory() 
    113118    handler = logging.FileHandler(logfn) 
    114119    logfmt = logging.Formatter('%(asctime)s %(levelname)s %(message)s') 
  • Products.ecmigration/trunk/Products/ecmigration/www/ecmigration_export.zpt

    r824 r886  
    33    tal:replace="structure context/manage_tabs">Tabs</h2> 
    44 
    5 <p>Export content to be migated to a newer version of eduCommons.</p> 
     5<p>Export content from this site to be migated to a newer version of eduCommons.</p> 
     6<p>Content will be exported to following directory:</p>  
    67 
     8<blockquote tal:content="context/getBaseDir">/some/path/migrate</blockquote> 
     9 
     10<p>This may take a long time, depending on the amount of content in the site. Please ensure that there is adequate disk space in the above location for your site's content before exporting.</p> 
    711 
    812<form action="exportContent" method="POST"> 
  • Products.ecmigration/trunk/Products/ecmigration/www/ecmigration_import.zpt

    r862 r886  
    55<p>Import migrated content from a previous version of eduCommons.</p> 
    66 
     7<p style="color:red">WARNING: This action will alter the current contents of your site!! If you are importing into a current production site, be sure that you have backed it up before continuing.</p> 
     8 
     9<p>Content will be imported from the following directory:</p> 
     10 
     11<blockquote tal:content="context/getBaseDir">/some/path/migrate</blockquote> 
     12 
     13<p>Please be sure that exported content is copied to the above directory before proceeding.</p> 
     14 
    715<form action="importContent" method="POST"> 
    816  <input type="submit" value="Import Site"/> 
    917</form> 
    10  
     18<!-- 
    1119<form action="importFilenames" method="POST"> 
    1220  <input type="submit" value="Import Filenames Only" /> 
    1321</form> 
    14  
     22--> 
    1523<h1 tal:replace="structure context/manage_page_footer">Footer</h1> 
  • Products.ecmigration/trunk/Products/ecmigration/www/ecmigration_overview.zpt

    r792 r886  
    55<p>This tool is used to migrate older versions of eduCommons to the latest current version. The tool creates a directory structure under the <em>var</em> directory in your eduCommons instance.</p> 
    66 
     7<h3>Exporting</h3> 
     8 
     9<p>Use the "Export" tab to export the content in this version of eduCommons for use in a future version of eduCommons.</p> 
     10 
     11<p>The path where migrated content will be written will be listed on the export page.</p> 
     12 
     13<p>Once the export is complete, create an archive of the exported files by using the following: 
     14 
     15<blockquote> 
     16cd <em>(path to migrated content)</em><br /> 
     17tar -zcvf migrated_content.tgz . 
     18</blockquote> 
     19 
    720<h3>Importing</h3> 
    821 
    9 <p>Use the import tab to import content from a previous version of eduCommons into this instance.</p> 
     22<p>Use the "Import" tab to import content from a previous version of eduCommons into this instance.</p> 
    1023 
    11 <h3>Exporting</h3> 
     24<p>Before importing be sure that the exported content is located in the correct directory on the server. This directory is listed on the import tab. Also, if you have copied the exported content as a file archive, you will need to unarchive the content before importing.</P> 
    1225 
    13 <p>Export the content in this version of eduCommons for use in a future version of eduCommons.</p> 
     26<blockquote> 
     27cd <em>(path to import directory)</em><br /> 
     28tar -zxvf migrated_content.tgz 
     29</blockquote> 
    1430 
     31<p>Also make sure that your current eduCommons instance has permission to read the files once they are unarchived. 
     32 
     33<blockquote> 
     34cd <em>(path to import directory)</em><br /> 
     35chown -R zope * 
     36</blockquote> 
    1537 
    1638<h1 tal:replace="structure context/manage_page_footer">Footer</h1> 
Note: See TracChangeset for help on using the changeset viewer.