Changeset 12960 for main/waeup.kofa/trunk/src/waeup/kofa/browser
- Timestamp:
- 17 May 2015, 20:02:59 (9 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/browser
- Files:
-
- 3 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r12958 r12960 55 55 from waeup.kofa.interfaces import( 56 56 IKofaObject, IUsersContainer, IUserAccount, IDataCenter, 57 I KofaXMLImporter, IKofaXMLExporter, IBatchProcessor,57 IBatchProcessor, 58 58 ILocalRolesAssignable, DuplicationError, IConfigurationContainer, 59 59 ISessionConfiguration, ISessionConfigurationAdd, IJobManager, … … 1781 1781 return result 1782 1782 1783 class ExportXMLPage(grok.View):1784 """Deliver an XML representation of the context.1785 """1786 grok.name('export.xml')1787 grok.require('waeup.managePortal')1788 1789 def render(self):1790 exporter = IKofaXMLExporter(self.context)1791 xml = exporter.export().read()1792 self.response.setHeader(1793 'Content-Type', 'text/xml; charset=UTF-8')1794 return xml1795 1796 class ImportXMLPage(KofaPage):1797 """Replace the context object by an object created from an XML1798 representation.1799 1800 XXX: This does not work for ISite objects, i.e. for instance1801 for complete University objects.1802 """1803 grok.name('importxml')1804 grok.require('waeup.managePortal')1805 1806 def update(self, xmlfile=None, CANCEL=None, SUBMIT=None):1807 if CANCEL is not None:1808 self.redirect(self.url(self.context))1809 return1810 if not xmlfile:1811 return1812 importer = IKofaXMLImporter(self.context)1813 obj = importer.doImport(xmlfile)1814 if type(obj) != type(self.context):1815 return1816 parent = self.context.__parent__1817 name = self.context.__name__1818 self.context = obj1819 if hasattr(parent, name):1820 setattr(parent, name, obj)1821 else:1822 del parent[name]1823 parent[name] = obj1824 pass1825 return1826 1827 1828 1783 # 1829 1784 # FacultiesContainer pages...
Note: See TracChangeset for help on using the changeset viewer.