[fw-general] Http Client and Rest Client.

2010-07-16 Thread Paweł Chuchmała
Hi.

I have some problem. I need to do Rest POST request with xml data,
enctype set to text/xml.
It is impossible.

In _performPost() we have:
[...]
$client-setRawData($data);
[...]

which set enctype to null, beacouse of Zend_Http_Client:

public function setRawData($data, $enctype = null)
{
$this-raw_post_data = $data;
$this-setEncType($enctype);
[...]
}

and:

public function setEncType($enctype = self::ENC_URLENCODED)
{
$this-enctype = $enctype;
return $this;
}

So we always have enctype set to: application/x-www-form-urlencoded
I think bug is in Http_Client, it should check
Zend_Http_Client::enctype in setRawData if null was given.

In issue tracker I find related issue, but i think it's bug not
improvement, and in Http Client, not Rest Client.
http://www.framework.zend.com/issues/browse/ZF-6306?page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel

Kind regards,

-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


[fw-general] Zend Cache Front Page problem.

2010-01-05 Thread Paweł Chuchmała
Hi.

Scenario: two (or more) version of application on one machine:
http://app1.example.com/
http://app2.example.com/

Using Zend_Cache with frontend Page and Backend Apc cause problem
becouse Apc is shared space,
and cache id is the same for all application.

Is there some clever method to solve this?

regards,

-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] Zend Cache Front Page problem.

2010-01-05 Thread Paweł Chuchmała
I understan than I must use something to change cache id. In my case
it may by $_SERVER['name'] (it doesen't matter), but in Page frontend
Id is calculated automaticaly.
The only way is subclassing or decorate this class?

2010/1/5 Hector Virgen djvir...@gmail.com:
 You'll need to prefix your cache IDs based on the application. I'd place the
 prefix in application.ini in order to make it accessible and configurable
 between applications.
 --
 Hector


 2010/1/5 Paweł Chuchmała pawel.chuchm...@gmail.com

 Hi.

 Scenario: two (or more) version of application on one machine:
 http://app1.example.com/
 http://app2.example.com/

 Using Zend_Cache with frontend Page and Backend Apc cause problem
 becouse Apc is shared space,
 and cache id is the same for all application.

 Is there some clever method to solve this?

 regards,

 --
 Paweł Chuchmała
 pawel.chuchmala at gmail dot com





-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


[fw-general] Zend_Navigation and big menu.

2009-09-14 Thread Paweł Chuchmała
Hi.
I have for example shop, with 2 or more level categories of products.
- category
-- subcategory1
-- subcategory 2
- category 2
-- subcategory 3
--- subsubcategory 1
etc.

I have thousands of products.
I want to display in menu only categories (diffrent depth).
I want to have breadcrub like this:

category  subcategory1  product page.

How do this with Zend_Navigation?

regards,

-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


[fw-general] Zend Form, JQuery, File_Element and ViewScript decorator.

2009-06-16 Thread Paweł Chuchmała
Hi.

Performance of Zend Form with 300 fileds it's very low, so I think to
use viewscript decorator.
How use it with jquery elements and File element?
If i create view scripts like in documentation and apply to alle
elements I have warnings:

Warning: Cannot render jQuery form element without at least one
decorator implementing the
'ZendX_JQuery_Form_Decorator_UiWidgetElementMarker' interface. Default
decorator for this marker interface is the
'ZendX_JQuery_Form_Decorator_UiWidgetElement'. Hint: The ViewHelper
decorator does not render jQuery elements correctly. in
/home/users/styx/www/lib/ZendFramework-1.8.1/library/Zend/Form/Element.php

And for file element:
Warning: No file decorator found... unable to render file element in
/home/users/styx/www/lib/ZendFramework-1.8.1/library/Zend/Form/Element.php
on line 1929

How create viewScripts for that elements?

Kind regards,
-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] Survey: Development environment for PHP/ZFW

2009-05-05 Thread Paweł Chuchmała
1. Windows (local), Linux PLD (remote)
2. Local 90%, remote 10%
3. Netbeans, vim
4. svn.
5. PHPUnit.

On Sat, May 2, 2009 at 19:14, howard chen howac...@gmail.com wrote:
 Please feel free to answer:

 1. What OS you are using during development? Windows? Mac? Linux?
 2. Do you edit source code on localhost or remote? i.e. is your
 testing environment reside on localhost or remote?
 3. What tool or IDE you are using? Ultraedit? Apanta? Eclipse PDT?
 4. Which versioning system your are using? svn? git?
 5. Do you use PHPUnit or other testing tools?

 p.s. have a good day.




-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] Zend_Config_Ini and

2009-04-06 Thread Paweł Chuchmała
application.job = /usr/local/bin/php
/home/admin/domains/app/jobs/job.php  /dev/null 2 /dev/null 
Doesn;t work?


On Mon, Apr 6, 2009 at 10:51, PHPScriptor cont...@phpscriptor.com wrote:

 Well, I don't think that's going to work. 'Cause I want to use it for a unix
 command.

 in my config.ini:

 application.job = /usr/local/bin/php /home/admin/domains/app/jobs/job.php 
 /dev/null 2 /dev/null 

 With this command I execute a php job in the background with passthru, so
 that I don't have to wait until the script is finished. But the unix command
 doesn't know amp;


 vince. wrote:

 Hey,

 Use the  HTML Entity which is amp;




 -
 visit my website at  http://www.phpscriptor.com/ http://www.phpscriptor.com/
 --
 View this message in context: 
 http://www.nabble.com/Zend_Config_Ini-and---tp22904165p22904651.html
 Sent from the Zend Framework mailing list archive at Nabble.com.





-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


[fw-general] Zend Progress bar and jsPull adapter.

2009-03-31 Thread Paweł Chuchmała
Hi.

Can someone give me working example with jsPull adapter and persistence options?
I think, I don;t understood how it should work.


-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] Zend Progress bar and jsPull adapter.

2009-03-31 Thread Paweł Chuchmała
Yes. JsPush adapter works prefectly for me, and I know how I can use
it. But I don;t understand JsPull.

2009/3/31 Ben Scholzen 'DASPRiD' m...@dasprids.de:
 Did you take a look at the demo in demos/Zend/ProgressBar/ ?




-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] Re: Using custom router. Where exactly?

2009-03-02 Thread Paweł Chuchmała
On Mon, Mar 2, 2009 at 13:33, vadim gavrilov vadim...@gmail.com wrote:
 Thanks i already looked at those files. Still can i place an instance of the
 addRoute inside a certain controller? or do i need to place it somewhere in
 the bootstarp file? Basically what i would like to do is to make a file that
 will hold all the routes for each module/controller. Did anyone made
 something like that before?

The best file is for me routes.ini. in config directory;-)
The rest in bootstrap initRoutes.

Regards,
pch

-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] Re: Using custom router. Where exactly?

2009-03-02 Thread Paweł Chuchmała
In one of my apps:

routes.ini:

routes.main.type = Zend_Controller_Router_Route_Regex
routes.main.route = (main.php|index.html)
routes.main.defaults.controller = index
routes.main.defaults.action = index
(...)

Initialize.php

class XXX_Plugin_Initialize extends Zend_Controller_Plugin_Abstract
{
(...)

public function routeStartup(Zend_Controller_Request_Abstract $request)
{
$this-initRoutes();
(...)
}

public function initRoutes()
{
$router = $this-_front-getRouter();
$routing_config = new Zend_Config_Ini($this-_appPath .
'/config/routes.ini', 'production');

$router-addConfig($routing_config, 'routes');

}
}

index.php or bootstrap.php or something  like this

(...)
$front-registerPlugin(new XXX_Plugin_Initialize((...)))
  -addControllerDirectory(APPLICATION_PATH . '/controllers');
(...)

regards,
pch

2009/3/2 vadim gavrilov vadim...@gmail.com:
 Any example for this? Since i saw that Matthew didn't use any router.

 2009/3/2 Paweł Chuchmała pawel.chuchm...@gmail.com

 On Mon, Mar 2, 2009 at 13:33, vadim gavrilov vadim...@gmail.com wrote:
  Thanks i already looked at those files. Still can i place an instance of
  the
  addRoute inside a certain controller? or do i need to place it somewhere
  in
  the bootstarp file? Basically what i would like to do is to make a file
  that
  will hold all the routes for each module/controller. Did anyone made
  something like that before?

 The best file is for me routes.ini. in config directory;-)
 The rest in bootstrap initRoutes.

 Regards,
 pch

 --
 Paweł Chuchmała
 pawel.chuchmala at gmail dot com



 --
 Vincent Gabriel.
 Lead Developer, Senior Support.
 Zend Certified Engineer.








-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] Form values and paginator question

2009-02-16 Thread Paweł Chuchmała
In mypaginator.phtml, you have something like that:

a href=?= $this-url(array('page' = $page)); ?
?= $page; ?
/a

You  must cznge parameters for $this-url(). For example:
a href=?= $this-url(array_merge(array('page' = $page),
$this-dataForPaginatorUrl)); ?
?= $page; ?
/a

And in controller:
$this-view-dataForPaginatorUrl = array('searchstr' = $searchstr,
'adlocation' = $adlocation);

or something else.

regards,
pch

On Mon, Feb 16, 2009 at 08:03, Deepak Shrestha d88...@gmail.com wrote:
 2. put your form values in the url

but anyway I got the answer already.

 Not really

 My question is how to modify the view partial script of paginator
 control (mypaginator.phtml) so that it will send the form data along
 with requested page number

 Initially my url is

 http://myweb/search/?searchstr=adlocation=Anysubmit=Search

 but when next is clicked, url get changed to
 http://myweb/search/index/page/2

 probably I need the url like this when clicked
 http://myweb/search/index/page/2/?searchstr=adlocation=Anysubmit=Search

  I took a look at the properties available for view partial
 http://framework.zend.com/manual/en/zend.paginator.usage.html#zend.paginator.usage.rendering.properties
 but no clue on how to set this.

 Need some hints.

 Thanks


 --
 ===
 Registered Linux User #460714
 Currently Using Fedora 8, 10
 ===




-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


[fw-general] Zend_Form_Element_Checkbox and Firefox.

2009-02-05 Thread Paweł Chuchmała
Hi.

As everbody know checkbox element has hidden element for submit value
when uchecked.
 In current version Firefox (3.0.6) it dosen't work. If checkbox is
checked, in _POST i have '0'.
It's Firefox bug?
When I set form method to 'GET' I see, that hidden field is last
parameter in url.

What should I do?

regards,

-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


[fw-general] Zend_JQuery and form select element.

2009-01-23 Thread Paweł Chuchmała
HI.

I use ZF 1.7.0.

If I try to create JQuery_Form, element select isn't properly
rendered. In JQUery_Form_Decorator_UiWidgetElement in method render
is:

$elementContent = $view-$helper($name, $value, $jQueryParams, $attribs);

where:
$attribs   = $this-getElementAttribs();

so, helper for render FormSelect is called with paramters:
array
  0 = string 'name' (length=20)
  1 = string 'value' (length=2)
  2 =
array
  empty /* our attribs*/
  3 =
array
  'options' =
array
  empty /* our empty values, or array if set */
  'listsep' = string 'br /' (length=6)
  'id' = string 'name' (length=20)

In html:

select name=name id=name
optgroup label=options
/optgroup
option value=listsep label=lt;br /gt;lt;br /gt;/option
option value=id label=namename/option
/select

It's a bug, or I doing something wrong?

regards,
pch

-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] Zend_JQuery and form select element.

2009-01-23 Thread Paweł Chuchmała
Ok. Thanks for answer.

regards,
pch

2009/1/23 Benjamin Eberlei kont...@beberlei.de:
 The UiWidgetElement decorator is only for jQuery UI elements, not for other
 elements such as Zend_Form_Element_Select. You need to use the default
 Zend_Form_Decorator_ViewHelper for such elements.

 On Friday 23 January 2009 15:42:35 Paweł Chuchmała wrote:
 HI.

 I use ZF 1.7.0.

 If I try to create JQuery_Form, element select isn't properly
 rendered. In JQUery_Form_Decorator_UiWidgetElement in method render
 is:

 $elementContent = $view-$helper($name, $value, $jQueryParams, $attribs);

 where:
 $attribs   = $this-getElementAttribs();

 so, helper for render FormSelect is called with paramters:
 array
   0 = string 'name' (length=20)
   1 = string 'value' (length=2)
   2 =
 array
   empty /* our attribs*/
   3 =
 array
   'options' =
 array
   empty /* our empty values, or array if set */
   'listsep' = string 'br /' (length=6)
   'id' = string 'name' (length=20)

 In html:

 select name=name id=name
 optgroup label=options
 /optgroup
 option value=listsep label=lt;br /gt;lt;br /gt;/option
 option value=id label=namename/option
 /select

 It's a bug, or I doing something wrong?

 regards,
 pch

 --
 Benjamin Eberlei
 http://www.beberlei.de




-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


[fw-general] Zend_JQuery and Autocomplete.

2009-01-14 Thread Paweł Chuchmała
Hi.

I try use ZF 1.72 with jquery 1.2.6 and autocomplete 1.1pre.
Autocomplete dosen't work.

My application generate code like this:

in head:
script type=text/javascript src=/js/jquery.js/script
script type=text/javascript src=/js/jquery/ui/jquery.ui.all.js/script
script type=text/javascript src=/js/jquery/jquery.autocomplete.js/script

script type=text/javascript
//![CDATA[
$(document).ready(function() {
$(#location).autocomplete({data:[New York,Mexico
City,Sydney,Ruegen,Baden Baden],multiple:true});
$(#ac1).autocomplete({data:[New York,Berlin,Bern,Boston]});
});
//]]

/script


In body:
 input type=text name=location id=location value= /

input type=text name=ac1 id=ac1 value= /


So for me it looks ok. Date picker on this same page work perfectly.

Regards,
pch
-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] Zend_Form: more DisplayGroup inside a div

2009-01-14 Thread Paweł Chuchmała
Try use subform.

On Wed, Jan 14, 2009 at 10:30, Michel Morelli mic...@ziobuddalabs.it wrote:
 Hi all. I have 3 DisplayGroup Elements. I need to enclose these elements in
 a div class=foo/div.

 I have tryed to create a DisplayGroup of these 3 DisplayGroup but does not
 work (Zend Framework error).

 Tnx.

 --
 Michel 'ZioBudda' Morelli   mic...@ziobuddalabs.it
 Consulenza sistemistica in ambito OpenSource.
 Sviluppo applicazioni web dinamiche (LAMP+Ajax)
 Telefono: 0200619074
 Telefono Cell: +39-3939890025 --  Fax: +39-0291390660

 http://www.ziobudda.net ICQ: 58351764
  http://www.ziobuddalabs.it  Skype: zio_budda
 http://www.ajaxblog.it  MSN: mic...@ziobuddalabs.it
  JABBER:
 mic...@gmail.com





-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


[fw-general] Zend_Form

2008-12-19 Thread Paweł Chuchmała
Hi.

I want to do form, which one I can edit multiple rows from table.

Example:
I have table customer (fields:id, name, address), and table orders
('order_id, customer_id, order_detail).

I want one form where i can edit customer data, and all his orders. I don't
know how i can do that.

All my forms i do this way:

My_Form_Customer extends Zend_Form
{
  public function init()
  {
$id = $this-addElement('hidden', 'id');
$name = $this-addElement('text', 'name');
$addresss = $this-addElement('text, 'address');
  }
}

How and where i can add fields for orders? I't must work with populate(),
validate() etc.

regards,
pch

-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] Zend_Form

2008-12-19 Thread Paweł Chuchmała
I can't find solution on this blog post. I know how to do form like there.
;-)

regards,
pch

On Fri, Dec 19, 2008 at 14:44, Thomas VEQUAUD thomas.vequ...@gmail.comwrote:

 I had the same needs a couple of weeks ago...
 Read the following article by Rob Allen : it's really simple.
 http://akrabat.com/2008/02/21/simple-zend_form-example/

 Have fun!

 2008/12/19 Paweł Chuchmała pawel.chuchm...@gmail.com:
  Hi.
 
  I want to do form, which one I can edit multiple rows from table.
 
  Example:
  I have table customer (fields:id, name, address), and table orders
  ('order_id, customer_id, order_detail).
 
  I want one form where i can edit customer data, and all his orders. I
 don't
  know how i can do that.
 
  All my forms i do this way:
 
  My_Form_Customer extends Zend_Form
  {
public function init()
{
  $id = $this-addElement('hidden', 'id');
  $name = $this-addElement('text', 'name');
  $addresss = $this-addElement('text, 'address');
}
  }
 
  How and where i can add fields for orders? I't must work with populate(),
  validate() etc.
 
  regards,
  pch
 
  --
  Paweł Chuchmała
  pawel.chuchmala at gmail dot com
 



 --
 Thomas VEQUAUD   http://thomas.vequaud.free.fr/
 Ingénieur Systèmes pour le compte d' ITS GROUP
 Bénévole et secouriste à la Croix-Rouge Française




-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


[fw-general] Zend_File_Transfer proposal, send and receive

2008-12-09 Thread Paweł Chuchmała
Hi.

I don't understand when I should use send() and receive() methods.
I think that send() should send file(s) from place where our application is
to another place.
And receive() should receive file to place where application is.
For example, if I want store at ftp server file from user uploaded by http
post, I do it like that:

$form-file-receive();

$files = new Zend_File_Transfer('FTP', array('user' = 'adam', 'pwd' =
'sandler', 'server' = 'ftp.myserver.com/public'));
$files-addFiles($form-file-getFileName)
  -send();

But in examples from proposal we have:
FTP Download:
The API can also be used for downloads. It will work as wrapper so the user
does not see where the original files is located and ZF will send the file
to the user.
and it use send(). I think it should use receive() to receive file from ftp,
and then send it to user by echoing content or something else, but nod
send() method from FTP adapter.

Kind, regards,
pch

-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] Zend_File_Transfer proposal, send and receive

2008-12-09 Thread Paweł Chuchmała
I have questions ho implement some methods.

I want to send file to MogileFs system. I write adapter for it. Scnario is:

1. receive file via user form (http_adapter::receive())
2. add file to my adapter: $file-addFile($form-file-getFileName());
3. add filters: $file-addFilter('Rename', '/something\c:\veryStrange/');
4. send it to MogileFs: $file-send().

I write send() method and first question: should I apply filters before
send?
Another problem. File in MogileFS are stored in flat structure. There are'nt
directories, filenames, etc. I can't use
method Zend_File_Transfer_Adapter_Abstract::_filter(), because it use
dirname() and filename() to choose destination and name.
I cant use Zend_Filter_File_Rename, cause it work on files in system. If I
receive file it's ok. But if I want send it somewhere,
I want to change only array that describe my file.

Filenames (for true I should say 'virtual filenames') in MogileFs nad Amazon
S3 can be like point 3. above, so if I want send file to them, shouldn't be
validated as file for store in 'traditional' file systems.

How I can do this, in Zend Framework convention?

regards,
pch



2008/12/9 Thomas Weidner [EMAIL PROTECTED]

 There are always 2 directions.
 Upload and Download.

 Upload means that the server receives a file from a foreign destination.
 Therefor the method is called receive.
 Download means that the server sends a file to a foreign destination.
 Therefor the method is called send.

 When you don't want to send a file to the client you can still echo it
 (display), but this is no download.
 Zend_File_Transfer does only handle file transfer and not file displaying
 needs.

 Beside that the FTP adapter is not coded for now so there is no need to
 hassle about it. :-)

 Greetings
 Thomas Weidner, I18N Team Leader, Zend Framework
 http://www.thomasweidner.com

 - Original Message - From: Paweł Chuchmała 
 [EMAIL PROTECTED]
 To: fw-general@lists.zend.com
 Sent: Tuesday, December 09, 2008 10:43 AM
 Subject: [fw-general] Zend_File_Transfer proposal, send and receive



  Hi.

 I don't understand when I should use send() and receive() methods.
 I think that send() should send file(s) from place where our application
 is
 to another place.
 And receive() should receive file to place where application is.
 For example, if I want store at ftp server file from user uploaded by http
 post, I do it like that:

 $form-file-receive();

 $files = new Zend_File_Transfer('FTP', array('user' = 'adam', 'pwd' =
 'sandler', 'server' = 
 'ftp.myserver.com/public')http://ftp.myserver.com/public%27%29
 );
 $files-addFiles($form-file-getFileName)
  -send();

 But in examples from proposal we have:
 FTP Download:
 The API can also be used for downloads. It will work as wrapper so the
 user
 does not see where the original files is located and ZF will send the file
 to the user.
 and it use send(). I think it should use receive() to receive file from
 ftp,
 and then send it to user by echoing content or something else, but nod
 send() method from FTP adapter.

 Kind, regards,
 pch

 --
 Paweł Chuchmała
 pawel.chuchmala at gmail dot com





-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] Zend_File_Transfer proposal, send and receive

2008-12-09 Thread Paweł Chuchmała
On Tue, Dec 9, 2008 at 16:19, Thomas Weidner [EMAIL PROTECTED] wrote:

 Pawel,

 I don't get the point.

 You said that the user uploads the file via HTTP to the server.
 So it's stored on the server as real file.

Then you said that you can not filter because the file is not stored on the
 server ?


Yes, it's stored, but I want to send it to Mogile storage and delete form
server.


 I don't know any extension which stored a uploaded file directly on Mogile
 or any other filesystem beside that where PHP resists. I think you completly
 misunderstood how the file transfer generally works.


I don't know too, that's why I want first receive file via http adapter, and
then send it to Mogile via my adapter. Two diffrent adapters.


 Related to filtering itself the order is fixed:
 validation - filter - send
 or
 validation-receive-filter
 or
 validation - receive - filter - send


Ok, how I can do:
validation - receive - filter - send
when I want receive and send via different adapters?
I think, I must break it:
1 adapter:
validation - receive (filter is unnecessary, cause I send file and delete
from server)
2 adapter
filter - send

I don't understand how filters from release 1.7.0 can work with send().
Forget about Mogile, take ftp, where filesystem have directories etc. What
is misiing or behave dofferent, what I must to write or rewrite to receive
file via one adapter and send it by another?


 All other handlings would not work when using different adapters.
 But you should be aware of one thing... the download handling is not
 integrated for now so it is possible that it changes due to other needs of
 integrated adapters. (Not the method itself but probably how things work
 internally).


I know, that's why I want to do more similary as it will be done in
framework.


 Greetings
 Thomas Weidner, I18N Team Leader, Zend Framework
 http://www.thomasweidner.com

 - Original Message - From: Paweł Chuchmała 
 [EMAIL PROTECTED]
 To: fw-general@lists.zend.com
 Sent: Tuesday, December 09, 2008 4:02 PM
 Subject: Re: [fw-general] Zend_File_Transfer proposal, send and receive


  I have questions ho implement some methods.

 I want to send file to MogileFs system. I write adapter for it. Scnario
 is:

 1. receive file via user form (http_adapter::receive())
 2. add file to my adapter: $file-addFile($form-file-getFileName());
 3. add filters: $file-addFilter('Rename', '/something\c:\veryStrange/');
 4. send it to MogileFs: $file-send().

 I write send() method and first question: should I apply filters before
 send?
 Another problem. File in MogileFS are stored in flat structure. There
 are'nt
 directories, filenames, etc. I can't use
 method Zend_File_Transfer_Adapter_Abstract::_filter(), because it use
 dirname() and filename() to choose destination and name.
 I cant use Zend_Filter_File_Rename, cause it work on files in system. If I
 receive file it's ok. But if I want send it somewhere,
 I want to change only array that describe my file.

 Filenames (for true I should say 'virtual filenames') in MogileFs nad
 Amazon
 S3 can be like point 3. above, so if I want send file to them, shouldn't
 be
 validated as file for store in 'traditional' file systems.

 How I can do this, in Zend Framework convention?

 regards,
 pch



 2008/12/9 Thomas Weidner [EMAIL PROTECTED]

  There are always 2 directions.
 Upload and Download.

 Upload means that the server receives a file from a foreign destination.
 Therefor the method is called receive.
 Download means that the server sends a file to a foreign destination.
 Therefor the method is called send.

 When you don't want to send a file to the client you can still echo it
 (display), but this is no download.
 Zend_File_Transfer does only handle file transfer and not file displaying
 needs.

 Beside that the FTP adapter is not coded for now so there is no need to
 hassle about it. :-)

 Greetings
 Thomas Weidner, I18N Team Leader, Zend Framework
 http://www.thomasweidner.com

 - Original Message - From: Paweł Chuchmała 
 [EMAIL PROTECTED]
 To: fw-general@lists.zend.com
 Sent: Tuesday, December 09, 2008 10:43 AM
 Subject: [fw-general] Zend_File_Transfer proposal, send and receive



  Hi.


 I don't understand when I should use send() and receive() methods.
 I think that send() should send file(s) from place where our application
 is
 to another place.
 And receive() should receive file to place where application is.
 For example, if I want store at ftp server file from user uploaded by
 http
 post, I do it like that:

 $form-file-receive();

 $files = new Zend_File_Transfer('FTP', array('user' = 'adam', 'pwd' =
 'sandler', 'server' = 
 'ftp.myserver.com/public'http://ftp.myserver.com/public%27
 )http://ftp.myserver.com/public%27%29
 );
 $files-addFiles($form-file-getFileName)
  -send();

 But in examples from proposal we have:
 FTP Download:
 The API can also be used for downloads. It will work as wrapper so the
 user
 does not see where the original files

Re: [fw-general] jQuery, jqGrid and ZF - pager doesn't work

2008-11-17 Thread Paweł Chuchmała
On Fri, Nov 14, 2008 at 18:25, Benjamin Eberlei [EMAIL PROTECTED] wrote:

 Hello Pawel,

 To fix this you have to hack your Zend_Json output with preg_replace
 somehow to
 strip the  around the pager: value.


Maybe good idea is do it like in Zend_Db. If it is in parentheses it would
be stripped and in future converted to Zend_Json_Expr.

regards.

-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


[fw-general] jQuery, jqGrid and ZF - pager doesn't work

2008-11-14 Thread Paweł Chuchmała
Hi.

I want to use jqGrid with ZF, so I wrote simple helper based on ZendX_JQuery
helpers.
I have a problem with some params.

As result I must have:
jQuery(#list2).jqGrid({
url: '/artist/list/format/json/',
datatype: 'json',
viewrecords: true,
*pager: jQuery('#pager2'),*
rowNum:20,
rowList:[10,20,30],
imgpath: /css/themes/sand/images,
sortname: 'id',
colNames: ['Id', 'Nazwa'],
colModel: [
   {name: 'artist_id', index:'artist_id', width:55},
   {name: 'artist_name', index:'artist_name', width:300}

],
});


so I make array with this options.
$params = array(
   ...
   'pager' = jquery('#pager2'),
   ...
);
After Zend_Json::encode($myarray) i have:
...
pager: jquery('#pager2')
...

from jqGridDocumentation: pager defines that we want to use a pager bar to
navigate through the records. This must be a valid html element;
In my example it's a string.

What is the best solution for this?

regards,

-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] Custom file transfer adapter.

2008-10-07 Thread Paweł Chuchmała
Thanks for answer. Proposal is very helpful.
Another few questions:
When Zend_File_Transfer will implement api from proposal?
I didn't see current code in svn, is this available to download somewhere
else?

regards,
pch

2008/10/7 Thomas Weidner [EMAIL PROTECTED]

 First:
 Own adapter must not be named Zend_.
 Second:
 Receive is not allowed to download files.
 There is a strict seperation.

 Third:
 Doing upload and download in one step you need to use the transfer class.
 That's why it was created.

 Forth:
 If you want to receive a fly simply look at your window :D :D :D

 Fifth:
 Look at the API, the proposal and the manual... all methods are described,
 even if they are not implemented for now.
 Greetings
 Thomas Weidner, I18N Team Leader, Zend Framework
 http://www.thomasweidner.com

 - Original Message - From: Paweł Chuchmała 
 [EMAIL PROTECTED]
 To: fw-general@lists.zend.com
 Sent: Tuesday, October 07, 2008 4:07 PM
 Subject: [fw-general] Custom file transfer adapter.



  Hi.

 I want to write file transfer adapter for MogileFS.

 I have a little problem. Where I should put file downloading and
 uploading?
 In http adapter files are already uploaded on server, so _FILE is used in
 constructor.

 My Use Cases looks like this:

 $mfs = new Zend_File_Transfer_Adapter_MogileFS($domain, $class,
 $trackers);
 $mfs-receive('file.pdf');
 $mfs-receive(array('file1', 'file2', 'file3'));

 So I think, that in ::receive I must download flie from remote systems and
 then populate it to ::_files.

 Am I right?

 regards,

 --
 Paweł Chuchmała
 pawel.chuchmala at gmail dot com





-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] DojoComboBox and large data set.

2008-09-25 Thread Paweł Chuchmała
On Wed, Sep 24, 2008 at 15:26, Matthew Weier O'Phinney [EMAIL PROTECTED] 
wrote:
 Most likely what's happening is you're getting double-rendering of the
 layout due to an error further down the stack. From what I've seen, most
 of these errors that have been reported have been due to either:

  * missing pdo_sqlite extension

This one is correct. Thanks for help

regards

-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


[fw-general] DojoComboBox and large data set.

2008-09-23 Thread Paweł Chuchmała
Hi.

How is the best method to use DojoComboBox with large data set? For
example i want to do suggest for users.
I have about 10 records. I want for example query server with 3
first letters filled in combobox.
How can i do that? It is possible to use DojoData with this method?

regards,

-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] DojoComboBox and large data set.

2008-09-23 Thread Paweł Chuchmała
On Tue, Sep 23, 2008 at 17:28, Matthew Weier O'Phinney [EMAIL PROTECTED] 
wrote:
 Yes. Use a QueryReadStore for the combo box data store, and do
 pagination on the server side to return smaller data sets. You can see
 an example of this with grids in my pastebin application, which uses the
 technique with a grid -- but it's the same basic idea:

http://weierophinney.net/matthew/uploads/pastebin-1.0.0.tar.gz

QueryReadStore sounds good.

But with your application I have a little problem:

[24-Sep-2008 07:48:27] PHP Fatal error: Uncaught exception
'Zend_Dojo_View_Exception' with message 'Lock already exists for id
layout' in 
D:\www\lib\ZendFramework-1.6.1\library\Zend\Dojo\View\Helper\DijitContainer.php:61
Stack trace:
#0 D:\www\pastebin-1.0.0\application\layouts\scripts\_layout.phtml(1):
Zend_Dojo_View_Helper_DijitContainer-captureStart('layout', Array)
#1 D:\www\lib\ZendFramework-1.6.1\library\Zend\View.php(107):
include('D:\www\pastebin...')
#2 D:\www\lib\ZendFramework-1.6.1\library\Zend\View\Abstract.php(787):
Zend_View-_run('D:\www\pastebin...')
#3 D:\www\pastebin-1.0.0\application\layouts\scripts\layout.phtml(2):
Zend_View_Abstract-render('_layout.phtml')
#4 D:\www\lib\ZendFramework-1.6.1\library\Zend\View.php(107):
include('D:\www\pastebin...')
#5 D:\www\lib\ZendFramework-1.6.1\library\Zend\View\Abstract.php(787):
Zend_View-_run('D:\www\pastebin...')
#6 D:\www\lib\ZendFramework-1.6.1\library\Zend\Layout.php(785):
Zend_View_Abstract-render('layout.phtml')
#7 D:\www\lib\ZendFramework-1.6.1\library\Zend\Layout\Controller\P in
D:\www\lib\ZendFramework-1.6.1\library\Zend\Dojo\View\Helper\DijitContainer.php
on line 61

regards,

-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] loading views into variables

2008-09-04 Thread Paweł Chuchmała
On Thu, Sep 4, 2008 at 08:32, Jim Pringle [EMAIL PROTECTED] wrote:
 Been using Code Igniter for years and feeling out ZF. Just trying to figure
 out how i can render a view into a variable so I can echo it out in the
 template.  Any thoughts?  Thanks!


You can use layout as template:

In action:

$this-_helper-viewRenderer-setResponseSegment('menu');

In layout:
echo $this-layout()-menu

You can use action stack to do multiple actions.

-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] Zend_Form_Element_File, file transfer and request.

2008-09-02 Thread Paweł Chuchmała
Hi,

Another question.
Why, if Form_Element_File is submitted with empty,
$form-getValue('element_file') give me string
with path to directory, where file should be write?

In my opinion it should return empty string.

pch

On Mon, Sep 1, 2008 at 18:57, Thomas Weidner [EMAIL PROTECTED] wrote:
 Hy Pawel,

 Simply use multiple Form_Element_File's, one for each file, and assign the
 returned filename to you custom array.
 There is no need to subclass File_Transfer because it supports already
 multiple files.

 Greetings
 Thomas Weidner, I18N Team Leader, Zend Framework
 http://www.thomasweidner.com


 - Original Message - From: Paweł Chuchmała
 [EMAIL PROTECTED]
 To: fw-general@lists.zend.com
 Sent: Monday, September 01, 2008 4:41 PM
 Subject: [fw-general] Zend_Form_Element_File, file transfer and request.


 Hi.

 I have some form. in controller i have:

 $form = new App_Form_UserDetails();
 if ($this-_request-isPost()) {
   if ($form-isValid($values)) {
   $user-setUserBasic($values);
   }
 } else {
   $form-populate($user-toForm($id));
 }

 $this-view-form = $form;


 Where $user is my model. and $values = $this-_request-getPost();
 $values = Array
 (
   [id] = 1
   [name] = Paweł Chuchmała
 )

 I want to add some Zend_Form_Element_File, for example 'photo',
 'pet_photo', 'some_other_photo', and get $vallueas like this:
 $values = Array
 (
   [id] = 1
   [name] = Paweł Chuchmała
   [photo] = myphoto.jpg
   [pet_photo] = mypet.png
   [some_other_photo] = mysailingteam.jpg
 )

 How I can do this? Subclassing Zend_File_Transfer_Adapter_Http?

 regards,

 --
 Paweł Chuchmała
 pawel.chuchmala at gmail dot com






-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] Zend_Form_Element_File, file transfer and request.

2008-09-02 Thread Paweł Chuchmała
On Tue, Sep 2, 2008 at 14:27, Matthew Weier O'Phinney [EMAIL PROTECTED] wrote:
 -- Paweł Chuchmała [EMAIL PROTECTED] wrote
 (on Tuesday, 02 September 2008, 12:47 PM +0200):
 Another question.
 Why, if Form_Element_File is submitted with empty,
 $form-getValue('element_file') give me string
 with path to directory, where file should be write?

 In my opinion it should return empty string.
 There's already an issue in the tracker to change this behavior.

I've  have, that filters are not included in this release.
It would be great to add not only filters to change name of file, but
also to change file content
For example, I uplad photos, and add filters for resize.
Do you think abut that filters?

regards,
-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


[fw-general] Zend_Form_Element_File, file transfer and request.

2008-09-01 Thread Paweł Chuchmała
Hi.

I have some form. in controller i have:

$form = new App_Form_UserDetails();
if ($this-_request-isPost()) {
if ($form-isValid($values)) {
$user-setUserBasic($values);
}
} else {
$form-populate($user-toForm($id));
}

$this-view-form = $form;


Where $user is my model. and $values = $this-_request-getPost();
$values = Array
(
[id] = 1
[name] = Paweł Chuchmała
)

I want to add some Zend_Form_Element_File, for example 'photo',
'pet_photo', 'some_other_photo', and get $vallueas like this:
$values = Array
(
[id] = 1
[name] = Paweł Chuchmała
[photo] = myphoto.jpg
[pet_photo] = mypet.png
[some_other_photo] = mysailingteam.jpg
)

How I can do this? Subclassing Zend_File_Transfer_Adapter_Http?

regards,

-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com