Dear Wiki user, You have subscribed to a wiki page or wiki category on "Lenya Wiki" for change notification.
The following page has been changed by JörnNettingsmeier: http://wiki.apache.org/lenya/GenericEditorAPI ------------------------------------------------------------------------------ - Status: DRAFT + Status: '''DRAFT''' This page describes the Lenya editor API as it slowly evolves into shape. - It might eventually contain all the information you need to make an editor of your choice work with Lenya. Currently, it is incomplete. Use the source, Luke. + It might eventually contain all the information you need to make an editor of your choice work with Lenya. Currently, it is incomplete. Use the source, Luke: [http://svn.apache.org/viewvc/lenya/trunk/src/modules/editors/resources/javascript/org.apache.lenya.editors.js?view=markup org.apache.lenya.editors.js] + Note: this currently deals exclusively with client-side javascript. The next step is to create a generic JAVA usecase handler class and try to use that for all editors. + == Quick start: how to make your editor work with Lenya == + + 1. Create a module directory (FIXME: Link to Andreas' presentation). + 1. Steal the java usecase handler code from the editors module. + (FIXME: is this the best one we have?) + + (FIXME: we should define a generic one that does 90% of all cases, and people can subclass that if necessary) + 1. Create a usecase view: either steal it from the One-Form-Editor (JXTemplate-based, for an out-of-context form: [http://svn.apache.org/viewvc/lenya/trunk/src/modules/editors/usecases/forms/oneform.jx?view=markup oneform.jx]), or follow the TinyMCE approach for an in-place WYSIWYG editor (pipeline-based, check out the sitemap and the xslt!). + (FIXME: this needs better documentation!) + 1. Make sure that your view adds the following javascript snippets: + {{{ + <script type="text/javascript" src="/modules/editors/javascript/org.apache.lenya.editors.js"/> + <script type="text/javascript" src="/modules/$YOURMODULE/javascript/youreditor_lenya_glue.js"/> + }}} + The first is the "API" file that defines the interaction between the usecase and your editor window, and it contains some utility functions you can (should) use for your window management (see [http://svn.apache.org/viewvc/lenya/trunk/src/modules/editors/resources/javascript/org.apache.lenya.editors.js?view=markup org.apache.lenya.editors.js]). The second is a file where you place all lenya-specific javascript code. + 1. Create some hooks in your editor: + 1. "Insert Lenya Link", + 1. "Insert Lenya Image", and + 1. "Insert Lenya Asset", + either as new buttons, or hooked up as file browsers to some existing dialog. + They should trigger functions in {{{youreditor_lenya_glue.js}}} where you can put the code that takes preset values from your editor and opens a usecase window pre-filled with those values (example: http://svn.apache.org/viewvc/lenya/trunk/src/modules/editors/resources/javascript/oneform_lenya_glue.js?view=markup oneform_lenya_glue.js) + + == Contract between generic editor usecases (editors.insertImage, editors.insertLink) and editor-specific modules == === Requirements: === --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
