> -----Message d'origine-----
> De : Julien Anguenot [mailto:[EMAIL PROTECTED]]
> Envoyé : lundi 27 février 2006 15:43
> À : RIBOUX Jonathan
> Cc : [email protected]
> Objet : Re: [CPS-devel] Searching on attached file title
>
> [EMAIL PROTECTED] wrote:
> > Hello,
> >
> > I use CPS 3.2.0 and need to implement searching on attached file
> > titles of "file" documents (and Flexible too, ...).
> > The problem is that the attached file title is part of the
> file field
> > of the "file" document, so it isn't just indexable by
> modifying the "file"
> > field in the "file" schema.
> >
> >
> > I tried to add the following computed field to the "file" schema :
> > 'file_name': {
> > 'type': 'CPS String Field',
> > 'data': {
> > 'default_expr': 'string:',
> > 'is_searchabletext': 1,
> > 'acl_write_roles': 'Nobody',
> > 'read_ignore_storage': 1,
> > 'read_process_expr':
> "python:getattr(file,'title',None)",
> > 'read_process_dependent_fields': ('file',),
> > 'write_ignore_storage': 1,
> > },
> > But it works only when I log in as manager.
> >
> > Does anybody have any clue ?
> >
>
> What appends if you don't ignore storage ? (change the
> write_roles as well for testing)
>
> J.
>
> --
> Julien Anguenot | Nuxeo R&D (Paris, France) CPS Platform :
> http://www.cps-project.org
> Zope3 / ECM : http://www.z3lab.org
> mail: anguenot at nuxeo.com; tel: +33 (0) 6 72 57 57 66
>
>
Unfortunately this doesn't change anything.
Here is the traceback I get when I create a new "File" document :
Traceback (innermost last):
Module ZPublisher.Publish, line 101, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 39, in call_object
Module Shared.DC.Scripts.Bindings, line 306, in __call__
Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
Module Products.CMFCore.FSPageTemplate, line 191, in _exec
Module Products.CMFCore.FSPageTemplate, line 124, in pt_render
Module Products.PageTemplates.PageTemplate, line 96, in pt_render
- <FSPageTemplate at /crih/cpsdocument_create_form used for /crih/workspaces/members/ribouxj>
Module TAL.TALInterpreter, line 189, in __call__
Module TAL.TALInterpreter, line 233, in interpret
Module TAL.TALInterpreter, line 459, in do_setLocal_tal
Module Products.PageTemplates.TALES, line 221, in evaluate
- Line 1, Column 0
- _expression_: <PythonExpr here.createCPSDocument(REQUEST=request)>
- Names:
{'container': <CPSDefaultSite instance at b3b79770>,
'context': <ProxyFolder at /crih/workspaces/members/ribouxj>,
'default': <Products.PageTemplates.TALES.Default instance at 0xb77076ec>,
'here': <ProxyFolder at /crih/workspaces/members/ribouxj>,
'loop': <SafeMapping instance at b6c57560>,
'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0xb77070cc>,
'nothing': None,
'options': {'args': ()},
'repeat': <SafeMapping instance at b6c57560>,
'request': <HTTPRequest, URL="" href="http://gedoctest:8880/crih/workspaces/members/ribouxj/cpsdocument_create_form" TARGET="_blank">http://gedoctest:8880/crih/workspaces/members/ribouxj/cpsdocument_create_form>,
'root': <Application instance at b3b79740>,
'template': <FSPageTemplate at /crih/cpsdocument_create_form used for /crih/workspaces/members/ribouxj>,
'traverse_subpath': [],
'user': ribouxj}
Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__
- __traceback_info__: here.createCPSDocument(REQUEST=request)
Module Python _expression_ "here.createCPSDocument(REQUEST=request)", line 1, in <_expression_>
Module Products.CMFCore.FSPythonScript, line 104, in __call__
Module Shared.DC.Scripts.Bindings, line 306, in __call__
Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
Module Products.CMFCore.FSPythonScript, line 160, in _exec
Module None, line 12, in createCPSDocument
- <FSPythonScript at /crih/createCPSDocument used for /crih/workspaces/members/ribouxj>
- Line 12
Module Products.CPSDocument.FlexibleTypeInformation, line 883, in renderCreateObjectDetailed
Module Products.CMFCore.FSPythonScript, line 104, in __call__
Module Shared.DC.Scripts.Bindings, line 306, in __call__
Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
Module Products.CMFCore.FSPythonScript, line 160, in _exec
Module None, line 26, in createCPSDocument_cb
- <FSPythonScript at /crih/createCPSDocument_cb used for /crih/workspaces/members/ribouxj>
- Line 26
Module Products.CPSCore.CPSTypes, line 60, in invokeFactory
Module Products.CPSCore.CPSWorkflowTool, line 247, in invokeFactoryFor
Module Products.CPSCore.CPSWorkflowTool, line 366, in _createObject
Module Products.CPSCore.ProxyTool, line 146, in createRevision
Module Products.Ezida, line 144, in myProxyChanged
Module Products.CPSCore.ProxyBase, line 395, in reindexObject
Module Products.CMFCore.CMFCatalogAware, line 69, in reindexObject
Module Products.CMFCore.CatalogTool, line 262, in reindexObject
Module Products.CMFCore.CatalogTool, line 235, in catalog_object
Module Products.ZCatalog.ZCatalog, line 528, in catalog_object
Module Products.ZCatalog.Catalog, line 381, in catalogObject
Module Products.ZCTextIndex.ZCTextIndex, line 163, in index_object
Module Products.ZCTextIndex.ZCTextIndex, line 169, in _index_object
Module Products.CPSCore.utils, line 244, in __cps_wrapper_getattr__
Module Products.CPSDocument.CPSDocument, line 140, in SearchableText
Module Products.CPSDocument.FlexibleTypeInformation, line 546, in getDataModel
Module Products.CPSSchemas.DataModel, line 222, in _fetch
Module Products.CPSSchemas.StorageAdapter, line 132, in getData
Module Products.CPSSchemas.StorageAdapter, line 150, in _getData
Module Products.CPSSchemas.StorageAdapter, line 158, in _getDataDoProcess
Module Products.CPSSchemas.Field, line 263, in processValueAfterRead
Module Products.CMFCore._expression_, line 44, in __call__
Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__
- __traceback_info__: getattr(file,'title',None)
Module Python _expression_ "getattr(file,'title',None)", line 1, in <_expression_>
Unauthorized: You are not allowed to access 'title' in this context
_______________________________________________ cps-devel mailing list http://lists.nuxeo.com/mailman/listinfo/cps-devel
