Version 1 by Guillaume ORIOL
on Mar 11, 2011 09:18.

compared with
Current by Guillaume ORIOL
on Mar 11, 2011 09:37.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (35)

View Page History
{info:title=New Proposal Template}
This page has been created from a template that uses "zones." To proceed:
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFPROP:Proposal Zone Template}

# Edit the page
# Replace sample content within each zone-data tag with your own content
# Remove this notice
# Save the page
# When you are ready for community review, move this page to the [Ready for Review] section on the edit page.

{note:title=No placeholders allowed!}
Please do not create placeholders. Wait until you have sufficient content to replace all sample data in the proposal template before creating your proposal document.
{note}
{info}

{zone-template-instance:ZFPROP:Proposal Zone Template}

{zone-data:component-name}
Zend_Magic Zend_Pdf_Form
{zone-data}

{zone-data:proposer-list}
[My Name|mailto:noreply@zend.com]
[Guillaume ORIOL|mailto:goriol@serquant.com]
{zone-data}

{zone-data}

{zone-data:revision}
1.0 - 1 January 2008: Initial Draft.
1.0 - March, the 11th 2011: Initial Draft.
{zone-data}

{zone-data:overview}
Zend_Magic is a simple component that reads my mind and generates code dynamically to do what I want.
Zend_Pdf_Form is a simple component that builds interactive forms into PDF documents.
{zone-data}

{zone-data:references}
* [Harry Houdini Wikipedia Entry|http://en.wikipedia.org/wiki/Harry_Houdini]
* [MagicTricks.com|http://www.magictricks.com/]
* [Adobe PDF Specification|http://www.adobe.com/devnet/pdf/pdf_reference.html]
{zone-data}

Most requirements take the form of "foo will do ...." or "foo will not support ...", although different words and sentence structure might be used. Adding functionality to your proposal is requirements creep (bad), unless listed below. Discuss major changes with your team first, and then open a "feature improvement" issue against this component.

* This component *will* correctly reads a developers mind for intent and generate the right configuration file.
* The generated config file *will not* support XML, but will provide an extension point in the API.
* This component *will* use no more memory than twice the size of all data it contains.
* This component *will* allow embedding an interactive form into a PDF document.
* This component *will* support the three form actions (submit-form, reset-form, import-data).
* This component *will* include a factory method. implement the missing Zend_Pdf_Action_JavaScript.
* This component *will not* allow subclassing. (i.e. when reviewed, we expect to see "final" keyword in code)
* This component *will* only generate data exports strictly complying with RFC 12345.
* This component *will* validate input data against formats supported by ZF component Foo.
* This component *will not* save any data using Zend_Cache or the filesystem. All transient data *will be* saved using Zend_Session.
{zone-data}

{zone-data:dependencies}
* Zend_Exception Zend_Pdf
{zone-data}

{zone-data}

{zone-data:milestones}
Describe some intermediate state of this component in terms of design notes, additional material added to this page, and / code. Note any significant dependencies here, such as, "Milestone #3 can not be completed until feature Foo has been added to ZF component XYZ." Milestones will be required for acceptance of future proposals. They are not hard, and many times you will only need to think of the first three below.
* Milestone 1: [design notes will be published here|http://framework.zend.com/wiki/x/sg]
* Milestone 2: Working prototype checked into the incubator supporting use cases #1, #2, ...
* Milestone 3: Working prototype checked into the incubator supporting use cases #3 and #4.
* Milestone 4: Unit tests exist, work, and are checked into SVN.
* Milestone 5: Initial documentation exists.

If a milestone is already done, begin the description with "\[DONE\]", like this:
* Milestone #: \[DONE\] Unit tests ...
{zone-data}

{zone-data:class-list}
* Zend_Magic_Exception Zend_Pdf
* Zend_Magic (factory class)
* Zend_Magic_MindProbe Zend_Pdf_Form
* Zend_Pdf_Form_Field (abstract)
* Zend_Pdf_Form_Field_Button (abstract)
* Zend_Magic_MindProbe_Intent Zend_Pdf_Form_Field_Button_Push
* Zend_Magic_Action Zend_Pdf_Form_Field_Button_Checkbox
* Zend_Magic_CodeGen Zend_Pdf_Form_Field_Button_Radio
* Zend_Pdf_Form_Field_Text
* Zend_Pdf_Form_Field_Choice
* Zend_Pdf_Form_Field_Signature
{zone-data}

{zone-data:skeletons}
{code}
class Zend_Magic_Exception extends Zend_Exception {}
/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Pdf
 * @subpackage Actions
 * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @version    $Id: JavaScript.php 20096 2010-01-06 02:05:09Z bkarwin $
 */

class Zend_Magic {
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
...

/**
 * PDF 'Execute a JavaScript script' action
 * PDF 1.3+ feature
 *
 * @package    Zend_Pdf
 * @subpackage Actions
 * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Pdf_Action_JavaScript extends Zend_Pdf_Action
{
    /**
     * Object constructor
     *
     * @param Zend_Pdf_Element_Dictionary $dictionary
     * @param SplObjectStorage            $processedActions  list of already processed action dictionaries, used to avoid cyclic references
     */
    public function __construct(Zend_Pdf_Element $dictionary, SplObjectStorage $processedActions)
    {
        parent::__construct($dictionary, $processedActions);

        if ($dictionary->JS === null) {
            require_once 'Zend/Pdf/Exception.php';
            throw new Zend_Pdf_Exception('JavaScript action dictionary entry is required');
        }
    }

    /**
     * Create new Zend_Pdf_Action_JavaScript object using specified script
     *
     * @param Zend_Pdf_Element_String|Zend_Pdf_Element_Stream|string $script
     * @return Zend_Pdf_Action_GoTo
     */
    public static function create($script)
    {
        if (is_string($script)) {
            require_once 'Zend/Pdf/Element/String.php';
            $script = new Zend_Pdf_Element_String($script);
        }

        if (!($script instanceof Zend_Pdf_Element_String) &&
            !($script instanceof Zend_Pdf_Element_Stream)
        ) {
            require_once 'Zend/Pdf/Exception.php';
            throw new Zend_Pdf_Exception('$script parameter must be either , ' .
                'a string, a Zend_Pdf_Element_String object or a ' .
                'Zend_Pdf_Element_Stream object.');
        }

        $dictionary = new Zend_Pdf_Element_Dictionary();
        $dictionary->Type = new Zend_Pdf_Element_Name('Action');
        $dictionary->S    = new Zend_Pdf_Element_Name('JavaScript');
        $dictionary->Next = null;
        $dictionary->JS   = $script;

        return new Zend_Pdf_Action_JavaScript($dictionary, new SplObjectStorage());
    }

    /**
     * Set script to execute
     *
     * @param Zend_Pdf_Element_String|Zend_Pdf_Element_Stream|string $script
     * @return Zend_Pdf_Action_JavaScript
     */
    public function setJavaScript($script)
    {
        if (is_string($script)) {
            require_once 'Zend/Pdf/Element/String.php';
            $script = new Zend_Pdf_Element_String($script);
        }

        if (!($script instanceof Zend_Pdf_Element_String) &&
            !($script instanceof Zend_Pdf_Element_Stream)
        ) {
            require_once 'Zend/Pdf/Exception.php';
            throw new Zend_Pdf_Exception('$script parameter must be either , ' .
                'a string, a Zend_Pdf_Element_String object or a ' .
                'Zend_Pdf_Element_Stream object.');
        }

        $this->_actionDictionary->touch();
        $this->_actionDictionary->JS = $script;

        return $this;
    }

    /**
     * Get script to execute
     *
     * @return Zend_Pdf_Element_String|Zend_Pdf_Element_Stream
     */
    public function getJavaScript()
    {
        return $this->_actionDictionary->JS->value;
    }
}
{code}
{zone-data}

{zone-template-instance}
{zone-template-instance}]]></ac:plain-text-body></ac:macro>