[silva-dev] Problems accessing Metadata

Korosec, Wolfgang wolfgang.korosec at id.ethz.ch
Tue Jul 8 16:47:28 CEST 2003


Hi,
I just tried out some simple things on a fresh 0.9.2.1 installation and
ran into troubles:

Idea: lets get the title from a Silva document.

Advanced Metadata Tool -> silva-content  -> maintitle ...
Information exists, initialized

Set up a code element:
<p
tal:content="python:here.get_metadata_element('silva-content','maintitle
')">test</p>

Im am running Windows XP, Zope 2.6.1, Python 2.1.3 (products from
0.9.2all)

Should work - I think ?! 
Did I miss something, a silly typo I have not seen ???


But I get this strange error message: 
**********************
System problem
Something went wrong. If you're testing, the information below is
important. 
Please note what you were doing when this error occured.

In any case, you can use your back button to return to the previous
page.

Sorry for the irritation.


------------------------------------------------------------------------
--------

Error Type: KeyError
Error Value: silva-content
Error info:
Path: /silva/index 
URL: http://localhost:9080/silva/index 

Client:
Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR
1.0.3705)
Remote address: 127.0.0.1
Remote identity: 

Linked from:
**********************

>From the errorlog:
**********************
Exception traceback
Time 2003/07/08 16:37:05.927 GMT+2 
User Name (User Id) admin (admin) 
Request URL http://localhost:9080/silva/index/index_html 
Exception Type KeyError 
Exception Value silva-content 

Traceback (innermost last): 

Module ZPublisher.Publish, line 98, in publish 
Module ZPublisher.mapply, line 88, in mapply 
Module ZPublisher.Publish, line 39, in call_object 
Module Shared.DC.Scripts.Bindings, line 252, in __call__ 
Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec 
Module Products.PythonScripts.PythonScript, line 315, in _exec 
Module Script (Python), line 17, in index_html
<PythonScript at /silva/index_html used for /silva/index>
Line 17 
Module Shared.DC.Scripts.Bindings, line 252, in __call__ 
Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec 
Module Products.PageTemplates.ZopePageTemplate, line 228, in _exec 
Module Products.PageTemplates.PageTemplate, line 95, in pt_render
<ZopePageTemplate at /silva/content.html used for /silva/index> 
Module TAL.TALInterpreter, line 200, in __call__ 
Module TAL.TALInterpreter, line 244, in interpret 
Module TAL.TALInterpreter, line 703, in do_useMacro 
Module TAL.TALInterpreter, line 244, in interpret 
Module TAL.TALInterpreter, line 734, in do_defineSlot 
Module TAL.TALInterpreter, line 244, in interpret 
Module TAL.TALInterpreter, line 682, in do_defineMacro 
Module TAL.TALInterpreter, line 244, in interpret 
Module TAL.TALInterpreter, line 414, in do_optTag_tal 
Module TAL.TALInterpreter, line 399, in do_optTag 
Module TAL.TALInterpreter, line 394, in no_tag 
Module TAL.TALInterpreter, line 244, in interpret 
Module TAL.TALInterpreter, line 726, in do_defineSlot 
Module TAL.TALInterpreter, line 244, in interpret 
Module TAL.TALInterpreter, line 412, in do_optTag_tal 
Module TAL.TALInterpreter, line 394, in no_tag 
Module TAL.TALInterpreter, line 244, in interpret 
Module TAL.TALInterpreter, line 592, in do_insertStructure_tal 
Module Products.PageTemplates.TALES, line 217, in evaluate
URL: /silva/content.html
Line 76, Column 6
Expression: <PythonExpr getattr(here, view_method)()>
Names:
{'container': <Silva Root instance silva>,
 'default': <Products.PageTemplates.TALES.Default instance at 01421DDC>,
 'here': <Silva Document instance index>,
 'loop': <SafeMapping instance at 0209DDA8>,
 'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter
instance at 01421E6C>,
 'nothing': None,
 'options': {'args': (), 'view_method': 'view'},
 'repeat': <SafeMapping instance at 0209DDA8>,
 'request': <HTTPRequest,
URL=http://localhost:9080/silva/index/index_html>,
 'root': <Application instance at 01D65950>,
 'template': <ZopePageTemplate at /silva/content.html used for
/silva/index>,
 'traverse_subpath': [],
 'user': admin}Module Products.PageTemplates.ZRPythonExpr, line 48, in
__call__
__traceback_info__: getattr(here, view_method)() 
Module Python expression "getattr(here, view_method)()", line 2, in f 
Module Products.Silva.VersionedContent, line 202, in view 
Module Products.Silva.SilvaObject, line 241, in view 
Module Products.Silva.MultiViewRegistry, line 150, in render_view 
Module Products.FileSystemSite.FSPythonScript, line 90, in __call__ 
Module Shared.DC.Scripts.Bindings, line 252, in __call__ 
Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec 
Module Products.FileSystemSite.FSPythonScript, line 124, in _exec
__traceback_info__: ({'script': <FSPythonScript at
/silva/service_views/Silva/public/Document/render_view>, 'context':
<DirectoryViewSurrogate instance at 02125670>, 'container':
<DirectoryViewSurrogate instance at 02125670>, 'traverse_subpath': []},
(), {}, None) 
Module Script (Python), line 7, in render_view 
Module Products.XMLWidgets.EditorService, line 251, in renderView 
Module Shared.DC.Scripts.Bindings, line 252, in __call__ 
Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec 
Module Products.FileSystemSite.FSPageTemplate, line 165, in _exec 
Module Products.PageTemplates.ZopePageTemplate, line 228, in _exec 
Module Products.FileSystemSite.FSPageTemplate, line 139, in pt_render 
Module Products.PageTemplates.PageTemplate, line 95, in pt_render
<FSPageTemplate at /silva/service_widgets/top/doc/mode_view/render> 
Module TAL.TALInterpreter, line 200, in __call__ 
Module TAL.TALInterpreter, line 244, in interpret 
Module TAL.TALInterpreter, line 592, in do_insertStructure_tal 
Module Products.PageTemplates.TALES, line 217, in evaluate
Line 2, Column 0
Expression: <PythonExpr
here.service_editor.renderElementsView(request.node)>
Names:
{'container': <DirectoryViewSurrogate instance at 020B8870>,
 'default': <Products.PageTemplates.TALES.Default instance at 01421DDC>,
 'here': <DirectoryViewSurrogate instance at 020B8870>,
 'loop': <SafeMapping instance at 020D35F0>,
 'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter
instance at 01421E6C>,
 'nothing': None,
 'options': {'args': ()},
 'repeat': <SafeMapping instance at 020D35F0>,
 'request': <HTTPRequest,
URL=http://localhost:9080/silva/index/index_html>,
 'root': <Application instance at 01D65950>,
 'template': <FSPageTemplate at
/silva/service_widgets/top/doc/mode_view/render>,
 'traverse_subpath': [],
 'user': admin}Module Products.PageTemplates.ZRPythonExpr, line 48, in
__call__
__traceback_info__: here.service_editor.renderElementsView(request.node)

Module Python expression
"here.service_editor.renderElementsView(request.node)", line 2, in f 
Module Products.XMLWidgets.EditorService, line 260, in
renderElementsView 
Module Shared.DC.Scripts.Bindings, line 252, in __call__ 
Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec 
Module Products.FileSystemSite.FSPageTemplate, line 165, in _exec 
Module Products.PageTemplates.ZopePageTemplate, line 228, in _exec 
Module Products.FileSystemSite.FSPageTemplate, line 139, in pt_render 
Module Products.PageTemplates.PageTemplate, line 95, in pt_render
<FSPageTemplate at
/silva/service_widgets/element/doc_elements/code/mode_view/render> 
Module TAL.TALInterpreter, line 200, in __call__ 
Module TAL.TALInterpreter, line 244, in interpret 
Module TAL.TALInterpreter, line 592, in do_insertStructure_tal 
Module Products.PageTemplates.TALES, line 217, in evaluate
Line 1, Column 0
Expression: standard:'here/get_rendered_code'
Names:
{'container': <DirectoryViewSurrogate instance at 01E59120>,
 'default': <Products.PageTemplates.TALES.Default instance at 01421DDC>,
 'here': <DirectoryViewSurrogate instance at 01E59120>,
 'loop': <SafeMapping instance at 01E83358>,
 'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter
instance at 01421E6C>,
 'nothing': None,
 'options': {'args': ()},
 'repeat': <SafeMapping instance at 01E83358>,
 'request': <HTTPRequest,
URL=http://localhost:9080/silva/index/index_html>,
 'root': <Application instance at 01D65950>,
 'template': <FSPageTemplate at
/silva/service_widgets/element/doc_elements/code/mode_view/render>,
 'traverse_subpath': [],
 'user': admin}Module Products.PageTemplates.Expressions, line 206, in
__call__ 
Module Products.PageTemplates.Expressions, line 201, in _eval 
Module Products.PageTemplates.Expressions, line 100, in render 
Module Products.PageTemplates.ZRPythonExpr, line 74, in call_with_ns 
Module Products.FileSystemSite.FSPythonScript, line 85, in
__render_with_namespace__ 
Module Shared.DC.Scripts.Bindings, line 266, in
__render_with_namespace__ 
Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec 
Module Products.FileSystemSite.FSPythonScript, line 124, in _exec
__traceback_info__: ({'script': <FSPythonScript at
/silva/service_widgets/element/doc_elements/code/get_rendered_code used
for /silva/service_widgets/element/doc_elements/code/mode_view>,
'context': <DirectoryViewSurrogate instance at 01E59120>, 'container':
<DirectoryViewSurrogate instance at 02118270>, 'traverse_subpath': []},
(), {}, None) 
Module Script (Python), line 6, in get_rendered_code 
Module Shared.DC.Scripts.Bindings, line 252, in __call__ 
Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec 
Module Products.PageTemplates.ZopePageTemplate, line 228, in _exec 
Module Products.PageTemplates.PageTemplate, line 95, in pt_render
<ZopePageTemplate at /silva/code_source/md_zpt> 
Module TAL.TALInterpreter, line 200, in __call__ 
Module TAL.TALInterpreter, line 244, in interpret 
Module TAL.TALInterpreter, line 497, in do_insertText_tal 
Module Products.PageTemplates.TALES, line 223, in evaluateText 
Module Products.PageTemplates.TALES, line 217, in evaluate
URL: /silva/code_source/md_zpt
Line 1, Column 0
Expression: <PythonExpr
here.get_metadata_element('silva-content','maintitle')>
Names:
{'container': <Folder instance at 01D82090>,
 'default': <Products.PageTemplates.TALES.Default instance at 01421DDC>,
 'here': <Folder instance at 01D82090>,
 'loop': <SafeMapping instance at 01F9DCD8>,
 'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter
instance at 01421E6C>,
 'nothing': None,
 'options': {'args': ()},
 'repeat': <SafeMapping instance at 01F9DCD8>,
 'request': <HTTPRequest,
URL=http://localhost:9080/silva/index/index_html>,
 'root': <Application instance at 01D65950>,
 'template': <ZopePageTemplate at /silva/code_source/md_zpt>,
 'traverse_subpath': [],
 'user': admin}Module Products.PageTemplates.ZRPythonExpr, line 48, in
__call__
__traceback_info__:
here.get_metadata_element('silva-content','maintitle') 
Module Python expression
"here.get_metadata_element('silva-content','maintitle')", line 2, in f 
Module Shared.DC.Scripts.Bindings, line 252, in __call__ 
Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec 
Module Products.PythonScripts.PythonScript, line 315, in _exec 
Module Script (Python), line 19, in get_metadata_element
<PythonScript at /silva/get_metadata_element used for
/silva/code_source>
Line 19 
Module Products.SilvaMetadata.Binding, line 274, in get 
Module Products.SilvaMetadata.Binding, line 409, in _getData 
Module Products.SilvaMetadata.Binding, line 359, in _getSet 
KeyError: silva-content 

Display traceback as text

REQUEST
form

cookies
_ZopeId '43794310A04of4lqoe4' 
tree-s 'eJyLjlZ3hAIXR09b9dhYAC2eBNI' 
color 'default' 

lazy items
SESSION <bound method SessionDataManager.getSessionData of
<SessionDataManager instance at 01D68DE8>> 

other
AUTHENTICATION_PATH '' 
model <Silva Document instance index> 
traverse_subpath [] 
SERVER_URL 'http://localhost:9080' 
PUBLISHED <PythonScript at /silva/index_html used for /silva/index> 
URL 'http://localhost:9080/silva/index/index_html' 
AUTHENTICATED_USER admin 
TraversalRequestNameStack [] 
xmlwidgets_viewer 'service_doc_viewer' 
node <ManageableElement instance at 020C97B0> 
URL0 http://localhost:9080/silva/index/index_html 
URL1 http://localhost:9080/silva/index 
URL2 http://localhost:9080/silva 
URL3 http://localhost:9080 
BASE0 http://localhost:9080 
BASE1 http://localhost:9080 
BASE2 http://localhost:9080/silva 
BASE3 http://localhost:9080/silva/index 
BASE4 http://localhost:9080/silva/index/index_html 

environ
HTTP_ACCEPT_ENCODING 'gzip, deflate' 
channel.creation_time 1057675025 
SERVER_PROTOCOL 'HTTP/1.1' 
SERVER_PORT '9080' 
PATH_INFO '/silva/index' 
HTTP_HOST 'localhost:9080' 
REQUEST_METHOD 'GET' 
PATH_TRANSLATED '\\silva\\index' 
SCRIPT_NAME '' 
SERVER_SOFTWARE 'Zope/(Zope 2.6.1 (binary release, python 2.1,
win32-x86), python 2.1.3, win32) ZServer/1.1b1' 
HTTP_ACCEPT_LANGUAGE 'de-ch' 
HTTP_ACCEPT 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/vnd.ms-powerpoint,
application/msword, application/x-shockwave-flash, */*' 
REMOTE_ADDR '127.0.0.1' 
HTTP_COOKIE 'tree-s="eJyLjlZ3hAIXR09b9dhYAC2eBNI"; color="default";
_ZopeId="43794310A04of4lqoe4"' 
SERVER_NAME 'chickenhawk.ethz.ch' 
GATEWAY_INTERFACE 'CGI/1.1' 
HTTP_USER_AGENT 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET
CLR 1.0.3705)' 
CONNECTION_TYPE 'Keep-Alive' 
**********************

Regards
Wolfgang





More information about the silva-dev mailing list