2009年11月8日 星期日

Re: [fw-gdata] Zend_Gdata_YouTube insertEntry check if the entry is uploaded

<p>Is it right to manage error in the catch scope
like this </p>
<p>catch (Zend_Gdata_App_HttpException $httpException) {
/* Manage Error */
echo $httpException->getRawResponseBody();
}
catch (Zend_Gdata_App_Exception $e) {
/* Manage Error */
echo $e->getMessage();
}
</p>
<p>I also need to retrieve the video entry like in Browser-based upload</p>
<p>and I don't find the way :( </p>
<p>Help me, please ;)</p>
Bye.

whisher wrote:
>
> <p>Hi.</p>
> <p>I should upload multiple flv files into youtube service </p>
> <p>in the script the moderator can decide if a video can be upload</p>
> <p>if no movie with flag no_put</p>
> <p>if yes a xhr request mark the video (to_put)</p>
> <p>than with a cron
> (the script retrieve video with flag to_put onsuccess flag put )</p>
> <p>on error log_put and log the error</p>
> <p>so I started with a snippet like this</p>
> <pre>
> $yt = new Zend_Gdata_YouTube(getAuthSubHttpClient());
> $myVideoEntry = new Zend_Gdata_YouTube_VideoEntry();
>
> $filesource = $yt->newMediaFileSource('intro.flv');
>
> $filesource->setContentType('video/x-flv');
> $filesource->setSlug('intro.flv');
>
>
> $myVideoEntry->setMediaSource($filesource);
>
> $myVideoEntry->setVideoTitle('My Test Movie');
> $myVideoEntry->setVideoDescription('My Test Movie');
> // Note that category must be a valid YouTube category !
> $myVideoEntry->setVideoCategory('Comedy');
>
> // Set keywords, note that this must be a comma separated string
> // and that each keyword cannot contain whitespace
> $myVideoEntry->SetVideoTags('cars, funny');
>
> // Optionally set some developer tags
> $myVideoEntry->setVideoDeveloperTags(array('mydevelopertag',
> 'anotherdevelopertag'));
>
> // Optionally set the video's location
> $yt->registerPackage('Zend_Gdata_Geo');
> $yt->registerPackage('Zend_Gdata_Geo_Extension');
> $where = $yt->newGeoRssWhere();
> $position = $yt->newGmlPos('37.0 -122.0');
> $where->point = $yt->newGmlPoint($position);
> $myVideoEntry->setWhere($where);
>
> // Upload URI for the currently authenticated user
> $uploadUrl =
> 'http://uploads.gdata.youtube.com/feeds/users/default/uploads';
>
> // Try to upload the video, catching a Zend_Gdata_App_HttpException
> // if availableor just a regular Zend_Gdata_App_Exception
>
> try {
> $newEntry = $yt->insertEntry($myVideoEntry,
> $uploadUrl,
> 'Zend_Gdata_YouTube_VideoEntry');
> echo "<pre>";
> print_r($newEntry);
> }
>
> catch (Zend_Gdata_App_HttpException $httpException) {
> echo $httpException->getRawResponseBody();
> }
> catch (Zend_Gdata_App_Exception $e) {
> echo $e->getMessage();
> }
> <p>put it in a loop with a checking on $newEntry
> but I retrieve only NULL so</p>
>
>
> <p>What's the way to check an upload ?</p>
>
> <p>Is there a better way to set up the task ?</p>
>
> <p>Thanks in advance</p>
> <p>Bye</p>
>
>
> <p>Thanks in advance</p>
>

--
View this message in context: http://old.nabble.com/Zend_Gdata_YouTube-insertEntry-check-if-the-entry-is-uploaded-tp26249722p26252611.html
Sent from the Zend gdata mailing list archive at Nabble.com.

2009年11月7日 星期六

[fw-gdata] Zend_Gdata_YouTube insertEntry check if the entry is uploaded

Hi.

I should upload multiple flv files into youtube service

in the script the moderator can decide if a video can be upload

if no movie with flag no_put

if yes a xhr request mark the video (to_put)

than with a cron (the script retrieve video with flag to_put onsuccess flag put )

on error log_put and log the error

so I started with a snippet like this

 $yt = new Zend_Gdata_YouTube(getAuthSubHttpClient()); $myVideoEntry = new Zend_Gdata_YouTube_VideoEntry();  $filesource = $yt->newMediaFileSource('intro.flv');  $filesource->setContentType('video/x-flv'); $filesource->setSlug('intro.flv');   $myVideoEntry->setMediaSource($filesource);  $myVideoEntry->setVideoTitle('My Test Movie'); $myVideoEntry->setVideoDescription('My Test Movie'); // Note that category must be a valid YouTube category ! $myVideoEntry->setVideoCategory('Comedy');  // Set keywords, note that this must be a comma separated string // and that each keyword cannot contain whitespace $myVideoEntry->SetVideoTags('cars, funny');  // Optionally set some developer tags $myVideoEntry->setVideoDeveloperTags(array('mydevelopertag',                                            'anotherdevelopertag'));  // Optionally set the video's location $yt->registerPackage('Zend_Gdata_Geo'); $yt->registerPackage('Zend_Gdata_Geo_Extension'); $where = $yt->newGeoRssWhere(); $position = $yt->newGmlPos('37.0 -122.0'); $where->point = $yt->newGmlPoint($position); $myVideoEntry->setWhere($where);  // Upload URI for the currently authenticated user $uploadUrl =     'http://uploads.gdata.youtube.com/feeds/users/default/uploads';  // Try to upload the video, catching a Zend_Gdata_App_HttpException // if availableor just a regular Zend_Gdata_App_Exception  try {     $newEntry = $yt->insertEntry($myVideoEntry,                                  $uploadUrl,                                  'Zend_Gdata_YouTube_VideoEntry');    echo "
";    print_r($newEntry); }   catch (Zend_Gdata_App_HttpException $httpException) {     echo $httpException->getRawResponseBody(); }  catch (Zend_Gdata_App_Exception $e) {     echo $e->getMessage(); } 

put it in a loop with a checking on $newEntry but I retrieve only NULL so

What's the way to check an upload ?

Is there a better way to set up the task ?

Thanks in advance

Bye

Thanks in advance



View this message in context: Zend_Gdata_YouTube insertEntry check if the entry is uploaded
Sent from the Zend gdata mailing list archive at Nabble.com.

[fw-auth] What is the Session object member in Zend_Auth_Storage_Session?

Hi
I am just looking into the code of Zend_Auth_Storage_Session for ideas on
how i can extend it to customise my own class.

I see there is a property called $_member :

/**
* Session object member
*
* @var mixed
*/
protected $_member;

The Doc description is a little bit vague.

Is this referring to a member in the sense of a 'user' who is a member of
the site?
OR
Is this referring to a member in the sense of the class member/property name
of the variable that holds the session object?

I will probably discover the answer soon enough through more research.

However, it might be nice to explicitly have the answer to this question
available 'on the web' somewhere to make code analysis quicker for those who
are following my path.

Any way - i hope to reply to this when i find out more about this.


--
View this message in context: http://old.nabble.com/What-is-the-Session-object-member-in-Zend_Auth_Storage_Session--tp26243400p26243400.html
Sent from the Zend Auth mailing list archive at Nabble.com.

2009年11月6日 星期五

[fw-webservices] New to ZF and SOAP services.

Hi.

I've been asked to build a SOAP service to allow our clients access
our data. I've also been asked to build a SOAP client to extract data
from our clients into our system.

I'm looking to use Zend Framework's Zend_Soap_Server and
Zend_Soap_Client for this.

Currently the services need to build are ...

Service : Authentication
Login() -> PreAuthToken
Authenticate(Username, md5(Password + ' : ' + PreAuthToken)) -> AuthToken
Logout(PreAuthToken, AuthToken) -> Nothing

Service : SupplyData
Brands()
Customers()
Products()
RemovalReasons()
Vehicles()
WheelPositions()


One of the features that I need to incorporate is the ability to have
versioning of the services.

So, say we build V1 today and agree on the interface, but tomorrow a
customer has a grand idea and V2 is created.

We need to be able to support V1 and V2 side-by-side.

I've been asked to implement major and minor versions along with LIVE
and TEST switches.

Add to that some service versions may need to be disabled (killswitch'd).

It has been agreed that all requests _may_ contain the xml ...

<version>
<major>major version integer</major>
<minor>minor version integer</minor>
<release>LIVE or TEST</release>
</version>

So, with that I have a few questions.

1 : How do I read the version before I create the Zend_Soap_Server and
load the required class?
2 : How do I know which service is being requested?
3 : Can I create a dummy soap service which has just the version
content and from there determine which class to load?

I think I want a Zend_Soap_Server_Proxy. Something that all soap
requests will go through. The result of which will either be the
correct soap service called or an exception (no version for service,
version killed/superceeded, etc.).


Is this even possible?

Any assistance would be really nice.

At this stage, I think I can have the spec changed, so if you have any
better way of dealing with this, then I'd appreciate knowing that too!

Thank you.

Richard Quadling.

--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

2009年11月5日 星期四

Re: [fw-db] Memory leak in ZF 1.7 in the adapter

Do you have the profiler turned on (it collects alot of information)?
Also, what adapter are you using, and what database vendor?

-ralph

Mathieu Suen wrote:
> Hi,
>
> IIRC in the mailing list someone advise to upgrade the ZF to the 1.9
> because of a memory leak in ZF 1.7 or 1.8.
>
> The leak was somewhere in the db library (maybe the adapter).
> Dose someone have more detail on it?
> Thanks
>

2009年11月4日 星期三

Re: [fw-auth] Zend_Acl , Ownership - request scope or injection in domain objects

Where are you going to store the ACL - in a file most probably then isnt't going to slow down the application in event of high traffic i.e reading from the disk. I dont think using ACL for high traffic site is a good option. Looking at ZF's slow performance using ACL will act as icing on cake. Correct me if I am wrong and this reply is not to prove that what you're doing is wrong. Just sharing my thoughts.

On Fri, Oct 30, 2009 at 10:23 PM, Abraham Block <atblock@gmail.com> wrote:
A lot of people (me included), like to have their domain entities implement the ACL Role interface, and then have the ACL check directly against the domain entities in question. You can do this in a service layer, or perhaps with some kind of event system.


On Fri, Oct 30, 2009 at 12:37 PM, tomascejka <dis.cejkatomas@gmail.com> wrote:

Hi,

I stand before implementing authorization/ownership in ZF based application.
I am developer but now I ask you as developer and architect in one person. I
would like to know how to design authorization process. After I read some
sources - there are two articles which interest me.

A.
http://devzone.zend.com/article/3510-Zend_Acl-and-MVC-Integration-Part-II-Advanced-Use
B.
http://www.weierophinney.net/matthew/archives/201-Applying-ACLs-to-Models.html

Where is good location to check rights and ownership?




-----
Enviroment
==========

OS:
SUSE Linux Enterprice 10 (i586) - version 2.6.16.60-0.27-smp
Windows XP SP 3

Tomcat v6.0.16, 6.0.18
Java(TM) SE Runtime Enviroment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)
Maven v2.0.9
Apache 2.2.11
MySQL 5.1.30
PHP 5.2.10
qooxdoo-0.8.2
Python 2.5
Zend framework 1.9.3
Dojo 1.3.2

Hudson:
=======
version 1.329
plugins: Maven 1.304, SSH Slaves
running: deployed in Tomcat

front-end developer web-based application
A.S.E.I. [http://www.asei.cz]
--
View this message in context: http://old.nabble.com/Zend_Acl-%2C-Ownership---request-scope-or-injection-in-domain-objects-tp26133244p26133244.html
Sent from the Zend Auth mailing list archive at Nabble.com.



[fw-db] Memory leak in ZF 1.7 in the adapter

Hi,

IIRC in the mailing list someone advise to upgrade the ZF to the 1.9
because of a memory leak in ZF 1.7 or 1.8.

The leak was somewhere in the db library (maybe the adapter).
Dose someone have more detail on it?
Thanks

--
-- Mathieu Suen
--