Mercurial > hg > MetaDataProvider
changeset 5:c1dbf78cc036
more MetaDataFolder
author | casties |
---|---|
date | Wed, 27 Jul 2011 14:48:56 +0200 |
parents | 8291255b1868 |
children | 00147a1ab4ac |
files | MetaData.py MetaDataFolder.py MetaDataMapping.py __init__.py zpt/addMetadataFolderForm.zpt zpt/changeMetaDataFolder.zpt |
diffstat | 6 files changed, 42 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/MetaData.py Wed Jul 27 14:13:45 2011 +0200 +++ b/MetaData.py Wed Jul 27 14:48:56 2011 +0200 @@ -81,7 +81,7 @@ meta_type='MetaData' security=ClassSecurityInfo() manage_options = Folder.manage_options+( - {'label':'Main Config','action':'changeMetadataForm'}, + {'label':'Main Config','action':'changeMetaDataForm'}, {'label':'Import XML Schema','action':'importMetaDataExportXML'}, #{'label':'Select Fields for Display','action':'indicateDisplayFieldsForm'}, ) @@ -399,14 +399,14 @@ return self.getFormatted('label_template', path) - security.declarePublic('changeMetadataForm') - def changeMetadataForm(self): + security.declarePublic('changeMetaDataForm') + def changeMetaDataForm(self): """Main configuration""" - pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','changeMetadata.zpt')).__of__(self) + pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','changeMetaData.zpt')).__of__(self) return pt() - security.declarePublic('changeMetadata') - def changeMetadata(self,shortDescription,description,fields,metaDataServerUrl,RESPONSE=None): + security.declarePublic('changeMetaData') + def changeMetaData(self,shortDescription,description,fields,metaDataServerUrl,RESPONSE=None): """Change Metadata""" self.shortDescription=shortDescription self.description=description @@ -418,7 +418,7 @@ def manage_addMetaDataForm(self): """interface for adding the OSAS_add_Metadata""" - pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','addMetadataForm.zpt')).__of__(self) + pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','addMetaDataForm.zpt')).__of__(self) return pt() def manage_addMetaData(self,id,shortDescription,description,fields,RESPONSE=None):
--- a/MetaDataFolder.py Wed Jul 27 14:13:45 2011 +0200 +++ b/MetaDataFolder.py Wed Jul 27 14:48:56 2011 +0200 @@ -35,16 +35,14 @@ meta_type='MetaDataFolder' security=ClassSecurityInfo() manage_options = Folder.manage_options+( - {'label':'Main Config','action':'changeMetadataFolderForm'}, - {'label':'Import XML Schema','action':'importMetaDataExportXML'}, - #{'label':'Select Fields for Display','action':'indicateDisplayFieldsForm'}, + {'label':'Main Config','action':'changeMetaDataFolderForm'}, ) - def __init__(self,id,title=''): + def __init__(self,id,title='',metaDataServerUrl=''): """initialize a new instance""" self.id = id self.title = title - self.metaDataServerUrl="" # muss mit change metadata gesetzt werden + self.metaDataServerUrl = metaDataServerUrl def getMDFromPathOrUrl(self,path):
--- a/MetaDataMapping.py Wed Jul 27 14:13:45 2011 +0200 +++ b/MetaDataMapping.py Wed Jul 27 14:48:56 2011 +0200 @@ -131,7 +131,7 @@ RESPONSE.redirect('manage_main') -manage_addMetaDataMappingForm = PageTemplateFile('zpt/addMetadataMappingForm', globals()) +manage_addMetaDataMappingForm = PageTemplateFile('zpt/addMetaDataMappingForm', globals()) def manage_addMetaDataMapping(self,idOfObject,titleOfObject,RESPONSE=None): """add the MetapdataMapping"""
--- a/__init__.py Wed Jul 27 14:13:45 2011 +0200 +++ b/__init__.py Wed Jul 27 14:48:56 2011 +0200 @@ -1,5 +1,6 @@ import MetaData import MetaDataMapping +import MetaDataFolder def initialize(context): """initialize Metadata""" @@ -18,4 +19,12 @@ MetaDataMapping.manage_addMetaDataMappingForm, MetaDataMapping.manage_addMetaDataMapping ) - ) \ No newline at end of file + ) + + context.registerClass( + MetaDataFolder.MetaDataFolder, + constructors = ( + MetaDataFolder.manage_addMetaDataFolderForm, + MetaDataFolder.manage_addMetaDataFolder + ) + )
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zpt/addMetadataFolderForm.zpt Wed Jul 27 14:48:56 2011 +0200 @@ -0,0 +1,9 @@ +<html> + <body> + <form name="form" action="manage_addMetaDataFolder"> + <b> ID: </b><input type="text" name="id"><br><br> + <b> Title: </b><input type="text" size="100" name="title"><br><br> + <input type="submit" value="Add"><br><br> + </form> + </body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zpt/changeMetaDataFolder.zpt Wed Jul 27 14:48:56 2011 +0200 @@ -0,0 +1,12 @@ +<div tal:replace="structure here/manage_page_header">Header</div> +<!-- ZOPE management tabs --> +<div tal:define="manage_tabs_message options/manage_tabs_message | nothing" + tal:replace="structure here/manage_tabs">Tabs</div> +<!-- end of ZOPE management tabs --> + + <form name="form" action="changeMetaDataFolder"> + <b> Title: </b><input type="text" name="title" size="20" tal:attributes="value python:here.title"><br><br> + <i>Server for XML files (e.g. url of digilib Texter-servlet)</i><br> + <input type="text" size="100" name="metaDataServerUrl" tal:attributes="value python:getattr(here,'metaDataServerUrl','')"><br><br> + <input type="submit" value="Change"><br><br> + </form>