RE: P4a subtyper / P4a Audio Broken with Blob Storage -2

12 views
Skip to first unread message

Eric Tyrer

unread,
Nov 13, 2009, 5:39:10 PM11/13/09
to p4a-...@googlegroups.com
I've found that in p4a.ploneaudio.atct line 193 has

@property def audio_type(self): mime_type = self.context.get_content_type() accessor = component.getAdapter(self.context, interfaces.IAudioDataAccessor, unicode(mime_type))

does this need to have/use ATblob? mime type or interface?


Uploading an audio or video file the subtyper fails with the following error.

Error Message is:
Traceback (innermost last):
  Module plone.postpublicationhook.hook, line 74, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 42, in call_object
  Module zope.formlib.form, line 769, in __call__
  Module p4a.audio.browser.media, line 57, in update
  Module zope.formlib.form, line 732, in update
  Module zope.formlib.form, line 835, in setUpWidgets
  Module zope.formlib.form, line 403, in setUpEditWidgets
  Module zope.schema._bootstrapfields, line 171, in get
  Module p4a.ploneaudio.atct, line 193, in audio_type
  Module zope.component._api, line 90, in getAdapter
ComponentLookupError: (<ATFile at /yc/Members/Aetyrer/02 These Are Days.mp3>, <InterfaceClass p4a.audio.interfaces.IAudioDataAccessor>, u'audio/mpeg')
My site is using:
  • Plone 3.3.1
  • CMF 2.1.2
  • Zope (Zope 2.10.9-final, python 2.4.6, linux2)
  • Python 2.4.6 (#1, Oct 13 2009, 00:39:40) [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]
  • PIL 1.1.6
  • plone.app.blob = 1.0b7
  • ZODB 3.8.3


--------- 
Eric S. Tyrer II 
Web Systems Manager
Macintosh Systems Manager

York College - The City University of New York 
94-20 Guy R. Brewer Blvd. 
Academic Core - STE 1H14 
Jamaica, NY 11451 



The secret to happiness is low expectations. - Barry Schwartz on the Paradox of Choice

Nate Aune

unread,
Nov 15, 2009, 2:20:25 AM11/15/09
to p4a-...@googlegroups.com
Hi Eric,

I had hoped to merge all the plone.tv code back into p4a during the
Plone video sprint, but didn't get time to do it. Here are the things
you need to do:

Make a directory called /blob with these files:
/blob
__init__.py
atct.py with the content of this: http://pastie.org/699381
configure.zcml with the content of this: http://pastie.org/699383
interfaces.py with the content of this: http://pastie.org/699384

and then in the top level configure.zcml, add this line:

<include package=".blob" />

Let me know if that works for you.

Nate
--
Nate Aune - na...@jazkarta.com
http://www.jazkarta.com
http://card.ly/natea
+1 (617) 517-4953

** Learn best practices for deploying your Plone sites at our upcoming
Plone Deployment Training in Budapest **
http://plonedeployment-natesig.eventbrite.com

Allen

unread,
Nov 17, 2009, 3:37:50 PM11/17/09
to Plone4Artists users
Hi Nate,
I don't know how that worked for Eric, but I now get another error.
The file appears to upload properly and the entry appears in the
folder view, but the metadata is missing. There is no album art or
time displayed, however the file does play properly. When I try to
view the audio file I get the following traceback:
2009-11-17 15:14:38 ERROR Zope.SiteErrorLog
1258488877.790.958406717547 http://localhost:8499/ayb/test/moto.mp3/file_view
Traceback (innermost last):
Module ZPublisher.Publish, line 119, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 42, in call_object
Module zope.formlib.form, line 770, in __call__
Module zope.formlib.form, line 764, in render
Module Shared.DC.Scripts.Bindings, line 313, in __call__
Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
Module Products.PageTemplates.PageTemplateFile, line 129, in _exec
Module Products.CacheSetup.patch_cmf, line 77, in PT_pt_render
Module Products.CacheSetup.patch_utils, line 9, in call_pattern
Module Products.PageTemplates.PageTemplate, line 98, in pt_render
Module zope.pagetemplate.pagetemplate, line 117, in pt_render
- Warning: Macro expansion failed
- Warning: exceptions.AttributeError: @@tag_macros
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 891, in do_useMacro
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 536, in do_optTag_tal
Module zope.tal.talinterpreter, line 521, in do_optTag
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 957, in do_defineSlot
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 536, in do_optTag_tal
Module zope.tal.talinterpreter, line 521, in do_optTag
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 861, in do_defineMacro
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 957, in do_defineSlot
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 536, in do_optTag_tal
Module zope.tal.talinterpreter, line 521, in do_optTag
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 949, in do_defineSlot
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 861, in do_defineMacro
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 536, in do_optTag_tal
Module zope.tal.talinterpreter, line 521, in do_optTag
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 623, in do_insertText_tal
Module Products.PageTemplates.Expressions, line 230, in evaluateText
Module zope.tales.tales, line 696, in evaluate
- URL: index
- Line 70, Column 20
- Expression: <PathExpr standard:'audio_info/bit_rate'>
- Names:
{'container': <ATFile at /ayb/test/moto.mp3>,
'context': <ATFile at /ayb/test/moto.mp3>,
'default': <object object at 0xb7dbb528>,
'here': <ATFile at /ayb/test/moto.mp3>,
'loop': {},
'nothing': None,
'options': {'args': ()},
'repeat': <Products.PageTemplates.Expressions.SafeMapping
object at 0x100b21ec>,
'request': <HTTPRequest, URL=http://localhost:8499/ayb/test/
moto.mp3/file_view>,
'root': <Application at >,
'template': <ImplicitAcquirerWrapper object at 0xfd0f34c>,
'traverse_subpath': [],
'user': <PropertiedUser 'admin'>,
'view': <Products.Five.metaclass.SimpleViewClass from /var/ayb/
eggs/p4a.audio-1.1rc1-py2.4.egg/p4a/audio/browser/audio.pt object at
0x1001124c>,
'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper
object at 0x1009e94c>}
Module zope.tales.expressions, line 217, in __call__
Module Products.PageTemplates.Expressions, line 163, in _eval
Module Products.PageTemplates.Expressions, line 125, in render
Module p4a.audio.browser.audio, line 271, in bit_rate
TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'


Any suggestions?
Thanks,
Allen
> Nate Aune - na...@jazkarta.comhttp://www.jazkarta.comhttp://card.ly/natea

Eric Tyrer

unread,
Nov 17, 2009, 5:49:57 PM11/17/09
to p4a-...@googlegroups.com, Plone4Artists users
First I moved p4a.ploneaudio to my src/ folder so that my buildout
would not overwrite my changes.

I made the mentioned files and directory but I am getting a zcml
error. I will post the trace later.

Sent from my iPhone
> --
> You received this message because you are subscribed to the Google
> Groups "Plone4Artists users" group.
> To post to this group, send email to p4a-...@googlegroups.com
> To unsubscribe from this group, send email to p4a-user-u...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/p4a-user?hl=en
> Visit the Plone4Artists site at http://plone4artists.org

Allen

unread,
Nov 18, 2009, 1:17:17 PM11/18/09
to Plone4Artists users
Hi Nate,
For some reason the adapter factories are not being called. Is the
interface more specific for the original adapter factory?

Thanks,
Allen

On Nov 17, 3:37 pm, Allen <athomer...@sympatico.ca> wrote:
> Hi Nate,
> I don't know how that worked for Eric, but I now get another error.
> The file appears to upload properly and the entry appears in the
> folder view, but the metadata is missing.  There is no album art or
> time displayed, however the file does play properly.  When I try to
> view the audio file I get the following traceback:
> 2009-11-17 15:14:38 ERROR Zope.SiteErrorLog
> 1258488877.790.958406717547http://localhost:8499/ayb/test/moto.mp3/file_view

Allen

unread,
Nov 24, 2009, 4:40:02 PM11/24/09
to Plone4Artists users
Well I got it to work. Sort of.
I put the files that Nate posted in my own product, but the adapter
factories were not being called. I did get it to work by deleting the
line:
<adapter factory=".atct.ATCTFileAudio" />
from configure.zcml in p4a.ploneaudio and the line:
<adapter factory=".atct.ATCTFileVideo" />
from configure.zcml in p4a.plonevideo
Since these files are in the downloaded eggs, they are going to be
overwritten every time I run buildout, so this is just a temporary
solution.

Allen

Eric Tyrer

unread,
Nov 25, 2009, 12:57:39 PM11/25/09
to p4a-...@googlegroups.com
Allen

I am using mr.developer to check in/out the p4a stack into my testing buildout (which is just a copy of my production vm). Its pretty cool and moves those eggs to /src so i can muck around with them without overwriting them when i run buildout.

Question, which files did you modify? (based on Nate's post). p4a.subtyper or ploneaudio to get blob storage to work?

I am having a ridiculous time getting audio to show up in the subtyper menu. I am attaching my buildout.


> [instance-settings]
> eggs =
> Plone
> ZODB3
> collective.xdv
> plone.app.blob
> plone.app.ldap
> Products.CacheSetup
> Products.PloneFormGen
> Products.Ploneboard
> Products.basesyndication
> Products.fatsyndication
> collective.indexing
> Products.ImageEditor
> collective.contentrules.mailtolocalrole
> Products.RedirectionTool
> Products.LDAPMultiPlugins
> Products.LDAPUserFolder
> Products.csvreplicata
> collective.fancyzoomview
> collective.captcha
> Products.Quills
> Products.contentmigration
> Products.TinyMCE
> Products.PloneKeywordManager
> collective.keywordwidgetreplacer
> Products.ECQuiz
> Products.PloneSurvey
> iw.memberreplace
> collective.lineage
> Products.ContentWellPortlets
> Products.ifSearchMonitor
> Products.PloneboardNotify
> plone.app.jquerytools
> dateable.kalends
> dateable.chronos
> hachoir-parser
> hachoir-core
> hachoir-metadata
> p4a.audio
> p4a.calendar
> p4a.common
> p4a.fileimage
> p4a.image
> p4a.plonecalendar
> p4a.ploneevent
> p4a.ploneimage
> p4a.plonevideoembed
> p4a.subtyper
> p4a.video
> p4a.videoembed
> p4a.z2utils
>
> zcml =
>
> collective.xdv
> collective.lineage
> p4a.audio
> p4a.calendar
> p4a.common
> p4a.fileimage
> p4a.image
> p4a.plonecalendar
> p4a.ploneevent
> p4a.ploneimage
> p4a.plonevideoembed
> p4a.subtyper
> p4a.video
> p4a.videoembed
> p4a.z2utils


in /src i've got

p4a.content
p4a.datetimewidgets
p4a.ploneaudio
p4a.plonevideo


Eric
On Nov 24, 2009, at 4:40 PM, Allen wrote:

> Well I got it to work. Sort of.
> I put the files that Nate posted in my own product, but the adapter
> factories were not being called. I did get it to work by deleting the
> line:
> <adapter factory=".atct.ATCTFileAudio" />
> from configure.zcml in p4a.ploneaudio and the line:
> <adapter factory=".atct.ATCTFileVideo" />
> from configure.zcml in p4a.plonevideo
> Since these files are in the downloaded eggs, they are going to be
> overwritten every time I run buildout, so this is just a temporary
> solution.
>
> Allen

---------
Eric S. Tyrer II
Web Systems Manager
Linux/Macintosh Systems Manager

York College - The City University of New York
http://www.york.cuny.edu

Allen

unread,
Nov 25, 2009, 3:12:51 PM11/25/09
to Plone4Artists users
Eric,
I haven't tried mr.developer yet but It sounds great.
I didn't touch p4a.subtyper, just p4a.plonevideo and p4a.ploneaudio.
In those two products I deleted the lines in my above post.
My buildout is somewhat different since I'm using some different
products and I'm also using a modified version of Martin's
Uberbuildout. I think the relevent parts are:
eggs =
plone.app.blob
ZODB3
hachoir-core
hachoir-metadata
hachoir-parser
p4a.plonecalendar
p4a.ploneevent
p4a.ploneaudio
p4a.plonevideo
p4a.plonevideoembed
Products.basesyndication
Products.fatsyndication

zcml =
plone.app.blob
p4a.plonecalendar
p4a.plonecalendar-meta
p4a.ploneevent
p4a.ploneaudio
p4a.plonevideo
p4a.plonevideoembed

I've also got the versions of hachoir-core, hachoir-metadata and
hachoir-parser pined at version 1.2. and ZODB3 pined at version
3.8.3. If that doesn't work I can send you a copy of my complete
buildout.

Allen
> York College - The City University of New Yorkhttp://www.york.cuny.edu

Patrick Gerken

unread,
Nov 26, 2009, 10:12:06 AM11/26/09
to p4a-...@googlegroups.com
Hi,

I've started a branch in collective with your changes and a buildout config.
I have made some changes and suddenly I remembered that I shouldn't
try until it works in my plone but get the tests working with plone.app.blob.
Thats what I am trying to get working right now.

Best regards,

Patrick
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "Plone4Artists users" group.
> To post to this group, send email to p4a-...@googlegroups.com
> To unsubscribe from this group, send email to p4a-user-u...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/p4a-user?hl=en
> Visit the Plone4Artists site at http://plone4artists.org
> -~----------~----~----~----~------~----~------~--~---
>
>

Eric Tyrer

unread,
Dec 1, 2009, 3:45:10 PM12/1/09
to p4a-...@googlegroups.com, Allen
Allen, Nate & et al.

I moved my p4a.ploneaudio & p4a.ploneaudio to src with mr.developer.

I then created a blob directory within p4a/ploneaudio & p4a/plonevideo with the files created from Nate's pastie links.

I then added <include package=".blob" /> to each of the configure.zcml

Testing by imbedding a youtube video works fine..

However adding either a video or audio file proceeds somewhat normally.

The blobfile is created fine.. looking at the upload in the ZMI shows..

ATBlob at /1/audio-test/test/test

The object is created, however it doesn't automatically identify the object as a video. Changing the subtype to video causes the following error

Traceback (innermost last):
Module ZPublisherEventsBackport.patch, line 79, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 42, in call_object
Module zope.formlib.form, line 769, in __call__
Module p4a.video.browser.video, line 262, in update
Module p4a.video.browser.media, line 59, in update
Module zope.formlib.form, line 732, in update
Module zope.formlib.form, line 835, in setUpWidgets
Module zope.formlib.form, line 374, in setUpEditWidgets
TypeError: ('Could not adapt', <ATFile at /1/audio-test/test>, <InterfaceClass p4a.video.interfaces.IVideo>)

This 'Could Not Adapt' error occurs with audio too.


Please help. I seem to be stuck in a circular error.

SIte is:

• Plone 3.3.2
• CMF 2.1.2
• Zope (Zope 2.10.9-final, python 2.4.6, linux2)
• Python 2.4.6 (#1, Nov 17 2009, 11:54:07) [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)]
• PIL 1.1.6

eggs /

dateable.kalends
dateable.chronos
hachoir-parser
hachoir-core
hachoir-metadata
p4a.video
p4a.audio
p4a.common
p4a.plonevideo
p4a.ploneimage
p4a.fileimage
p4a.ploneaudio
p4a.plonecalendar
p4a.ploneevent
p4a.videoembed
p4a.plonevideoembed
collective.remove.kupu
collective.idashboard

zcml =
plone.app.blob
collective.xdv
p4a.plonecalendar
p4a.plonecalendar-meta
p4a.ploneevent
p4a.videoembed
p4a.plonevideoembed
p4a.common
p4a.video
p4a.audio
p4a.z2utils
p4a.ploneimage
p4a.fileimage
p4a.plonevideo
p4a.ploneaudio
p4a.subtyper


On Nov 24, 2009, at 4:40 PM, Allen wrote:

> Well I got it to work. Sort of.
> I put the files that Nate posted in my own product, but the adapter
> factories were not being called. I did get it to work by deleting the
> line:
> <adapter factory=".atct.ATCTFileAudio" />
> from configure.zcml in p4a.ploneaudio and the line:
> <adapter factory=".atct.ATCTFileVideo" />
> from configure.zcml in p4a.plonevideo
> Since these files are in the downloaded eggs, they are going to be
> overwritten every time I run buildout, so this is just a temporary
> solution.
>
> Allen

---------
Eric S. Tyrer II
Web Systems Manager
Linux/Macintosh Systems Manager

York College - The City University of New York
http://www.york.cuny.edu

Patrick Gerken

unread,
Dec 8, 2009, 5:15:06 AM12/8/09
to p4a-...@googlegroups.com, Allen
Hi,

I got p4a.ploneaudio working with blob support.
The branch is here:

http://svn.plone.org/svn/collective/p4a/p4a.ploneaudio/branches/blob_support/

Please try it and give some feedback. One thing I did not try are
Images in music files.
If you test that, please be aware that images are NOT made blob aware
per default,
you have to add a zcml statement for that.

Best regards,

Patrick
> --
Reply all
Reply to author
Forward
0 new messages