You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Andreas Hartmann <an...@apache.org> on 2007/06/28 16:07:04 UTC
Re: svn commit: r551554 - in /lenya/trunk/src/modules: fckeditor/usecases/insertAsset.jx
tinymce/usecases/insertAsset.jx
Hi Richard,
rfrovarp@apache.org schrieb:
> Author: rfrovarp
> Date: Thu Jun 28 06:44:26 2007
> New Revision: 551554
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=551554
> Log:
> Apply Proxy fixes for TinyMCE and FCKeditor insertAsset functionality - updates from r551545
thanks for this!
Maybe we can find a way to use the same code for BXE and FCKeditor,
maybe by extracting some parts of the file to a separate JX template?
-- Andreas
>
> Modified:
> lenya/trunk/src/modules/fckeditor/usecases/insertAsset.jx
> lenya/trunk/src/modules/tinymce/usecases/insertAsset.jx
>
> Modified: lenya/trunk/src/modules/fckeditor/usecases/insertAsset.jx
> URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/fckeditor/usecases/insertAsset.jx?view=diff&rev=551554&r1=551553&r2=551554
> ==============================================================================
> --- lenya/trunk/src/modules/fckeditor/usecases/insertAsset.jx (original)
> +++ lenya/trunk/src/modules/fckeditor/usecases/insertAsset.jx Thu Jun 28 06:44:26 2007
> @@ -48,15 +48,13 @@
> <th style="background: none;"><i18n:text>Dimension (w x h)</i18n:text></th>
> <th style="background: none;"><i18n:text>Creation Date</i18n:text></th>
> </tr>
> + <jx:set var="asset2proxyUrl" value="${usecase.getParameter('asset2proxyUrl')}"/>
> <jx:forEach var="asset" items="${usecase.getParameter('assets')}">
> - <jx:set var="originalUrl" value="${asset.getCanonicalWebappURL()}"/>
> - <jx:set var="lastDotIndex" value="${originalUrl.lastIndexOf('.')}"/>
> - <jx:set var="extension" value="${asset.getMetaData('http://apache.org/lenya/metadata/document/1.0').getFirstValue('extension')}"/>
> - <jx:set var="url" value="${originalUrl.substring(0, lastDotIndex).concat('.').concat(extension)}"/>
> + <jx:set var="url" value="${asset2proxyUrl.get(asset)}"/>
> <tr>
> <td>
> <input type="radio" name="asset" value="${asset.getPath()}"
> - onClick="javascript:insertData('${url}', '${asset.getMetaData('http://purl.org/dc/elements/1.1/').getFirstValue('title')}', '${asset.getMimeType()}', '${asset.getContentLength() / 1000}', '${asset.getMetaData('http://apache.org/lenya/metadata/media/1.0').getFirstValue('height')}', '${asset.getMetaData('http://apache.org/lenya/metadata/media/1.0').getFirstValue('width')}')"/>
> + onClick="insertData('${url}', '${asset.getMetaData('http://purl.org/dc/elements/1.1/').getFirstValue('title')}', '${asset.getMimeType()}', '${asset.getContentLength() / 1000}', '${asset.getMetaData('http://apache.org/lenya/metadata/media/1.0').getFirstValue('height')}', '${asset.getMetaData('http://apache.org/lenya/metadata/media/1.0').getFirstValue('width')}')"/>
> </td>
> <td><jx:out value="${asset.getPath()}"/></td>
> <td>
>
> Modified: lenya/trunk/src/modules/tinymce/usecases/insertAsset.jx
> URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/tinymce/usecases/insertAsset.jx?view=diff&rev=551554&r1=551553&r2=551554
> ==============================================================================
> --- lenya/trunk/src/modules/tinymce/usecases/insertAsset.jx (original)
> +++ lenya/trunk/src/modules/tinymce/usecases/insertAsset.jx Thu Jun 28 06:44:26 2007
> @@ -48,15 +48,13 @@
> <th style="background: none;"><i18n:text>Dimension (w x h)</i18n:text></th>
> <th style="background: none;"><i18n:text>Creation Date</i18n:text></th>
> </tr>
> + <jx:set var="asset2proxyUrl" value="${usecase.getParameter('asset2proxyUrl')}"/>
> <jx:forEach var="asset" items="${usecase.getParameter('assets')}">
> - <jx:set var="originalUrl" value="${asset.getCanonicalWebappURL()}"/>
> - <jx:set var="lastDotIndex" value="${originalUrl.lastIndexOf('.')}"/>
> - <jx:set var="extension" value="${asset.getMetaData('http://apache.org/lenya/metadata/document/1.0').getFirstValue('extension')}"/>
> - <jx:set var="url" value="${originalUrl.substring(0, lastDotIndex).concat('.').concat(extension)}"/>
> + <jx:set var="url" value="${asset2proxyUrl.get(asset)}"/>
> <tr>
> <td>
> <input type="radio" name="asset" value="${asset.getPath()}"
> - onClick="javascript:insertData('${url}', '${asset.getMetaData('http://purl.org/dc/elements/1.1/').getFirstValue('title')}', '${asset.getMimeType()}', '${asset.getContentLength() / 1000}', '${asset.getMetaData('http://apache.org/lenya/metadata/media/1.0').getFirstValue('height')}', '${asset.getMetaData('http://apache.org/lenya/metadata/media/1.0').getFirstValue('width')}')"/>
> + onClick="insertData('${url}', '${asset.getMetaData('http://purl.org/dc/elements/1.1/').getFirstValue('title')}', '${asset.getMimeType()}', '${asset.getContentLength() / 1000}', '${asset.getMetaData('http://apache.org/lenya/metadata/media/1.0').getFirstValue('height')}', '${asset.getMetaData('http://apache.org/lenya/metadata/media/1.0').getFirstValue('width')}')"/>
> </td>
> <td><jx:out value="${asset.getPath()}"/></td>
> <td>
--
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: svn commit: r551554 - in /lenya/trunk/src/modules: fckeditor/usecases/insertAsset.jx
tinymce/usecases/insertAsset.jx
Posted by Richard Frovarp <Ri...@sendit.nodak.edu>.
nobby wrote:
> Richard Frovarp wrote:
>
>>>> Maybe we can find a way to use the same code for BXE and FCKeditor,
>>>> maybe by extracting some parts of the file to a separate JX template?
>>>>
>>>> -- Andreas
>>>>
>>>>
>>> Yeah, this should be done. All three are identical except for three
>>> lines that contain the editor's name. I think I see how it can be done
>>> relatively easily. Is there a way to get the usecase module inside of
>>> a jx template? I could do a substring on usecase.getName. Just looking
>>> to see if there is a shortcut and I don't see anything grepping
>>> through the code or looking at the Usecase interface. Or maybe that is
>>> something to be added to the Usecase interface?
>>>
>>> Richard
>>>
>> I've figured out how to do this. The question is do we want
>> usecase.getModule? Otherwise what is needed is this:
>>
>> usecase.getName().substring(0,usecase.getName().indexOf('.'))
>>
>
> Why don't we just pass a parameter to the usecase?
>
> <component-instance name="bxe.edit">
> ...
> <parameter name="editor" value="bxe"/>
> ...
> </component-instance>
>
>
> <jx:out value="${usecase.getParameter('editor')}"/>
>
>
> -- Andreas
>
>
Didn't think of that. That is what I've done.
Thanks,
Richard
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: svn commit: r551554 - in /lenya/trunk/src/modules:
fckeditor/usecases/insertAsset.jx tinymce/usecases/insertAsset.jx
Posted by nobby <an...@apache.org>.
Richard Frovarp wrote:
>>> Maybe we can find a way to use the same code for BXE and FCKeditor,
>>> maybe by extracting some parts of the file to a separate JX template?
>>>
>>> -- Andreas
>>>
>>
>> Yeah, this should be done. All three are identical except for three
>> lines that contain the editor's name. I think I see how it can be done
>> relatively easily. Is there a way to get the usecase module inside of
>> a jx template? I could do a substring on usecase.getName. Just looking
>> to see if there is a shortcut and I don't see anything grepping
>> through the code or looking at the Usecase interface. Or maybe that is
>> something to be added to the Usecase interface?
>>
>> Richard
>
>I've figured out how to do this. The question is do we want
>usecase.getModule? Otherwise what is needed is this:
>
>usecase.getName().substring(0,usecase.getName().indexOf('.'))
Why don't we just pass a parameter to the usecase?
<component-instance name="bxe.edit">
...
<parameter name="editor" value="bxe"/>
...
</component-instance>
<jx:out value="${usecase.getParameter('editor')}"/>
-- Andreas
--
View this message in context: http://www.nabble.com/Re%3A-svn-commit%3A-r551554---in--lenya-trunk-src-modules%3A---fckeditor-usecases-insertAsset.jx-tinymce-usecases-insertAsset.jx-tf3994822.html#a11356616
Sent from the Lenya - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: svn commit: r551554 - in /lenya/trunk/src/modules:
fckeditor/usecases/insertAsset.jx tinymce/usecases/insertAsset.jx
Posted by Thorsten Scherler <th...@apache.org>.
On Thu, 2007-06-28 at 15:06 -0500, Richard Frovarp wrote:
> Richard Frovarp wrote:
> > Andreas Hartmann wrote:
> >> Hi Richard,
> >>
> >> rfrovarp@apache.org schrieb:
> >>
> >>> Author: rfrovarp
> >>> Date: Thu Jun 28 06:44:26 2007
> >>> New Revision: 551554
> >>>
> >>> URL: http://svn.apache.org/viewvc?view=rev&rev=551554
> >>> Log:
> >>> Apply Proxy fixes for TinyMCE and FCKeditor insertAsset
> >>> functionality - updates from r551545
> >>>
> >>
> >> thanks for this!
> >>
> >> Maybe we can find a way to use the same code for BXE and FCKeditor,
> >> maybe by extracting some parts of the file to a separate JX template?
> >>
> >> -- Andreas
> >>
> >
> > Yeah, this should be done. All three are identical except for three
> > lines that contain the editor's name. I think I see how it can be done
> > relatively easily. Is there a way to get the usecase module inside of
> > a jx template? I could do a substring on usecase.getName. Just looking
> > to see if there is a shortcut and I don't see anything grepping
> > through the code or looking at the Usecase interface. Or maybe that is
> > something to be added to the Usecase interface?
> >
> > Richard
>
> I've figured out how to do this. The question is do we want
> usecase.getModule? Otherwise what is needed is this:
>
> usecase.getName().substring(0,usecase.getName().indexOf('.'))
>
> I can get something committed tomorrow. What do others think?
If I have to choose between usecase.getModule() and the second I vote
for the first. Way more comfortable.
salu2
--
Thorsten Scherler thorsten.at.apache.org
Open Source Java consulting, training and solutions
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: svn commit: r551554 - in /lenya/trunk/src/modules: fckeditor/usecases/insertAsset.jx
tinymce/usecases/insertAsset.jx
Posted by Richard Frovarp <Ri...@sendit.nodak.edu>.
Richard Frovarp wrote:
> Andreas Hartmann wrote:
>> Hi Richard,
>>
>> rfrovarp@apache.org schrieb:
>>
>>> Author: rfrovarp
>>> Date: Thu Jun 28 06:44:26 2007
>>> New Revision: 551554
>>>
>>> URL: http://svn.apache.org/viewvc?view=rev&rev=551554
>>> Log:
>>> Apply Proxy fixes for TinyMCE and FCKeditor insertAsset
>>> functionality - updates from r551545
>>>
>>
>> thanks for this!
>>
>> Maybe we can find a way to use the same code for BXE and FCKeditor,
>> maybe by extracting some parts of the file to a separate JX template?
>>
>> -- Andreas
>>
>
> Yeah, this should be done. All three are identical except for three
> lines that contain the editor's name. I think I see how it can be done
> relatively easily. Is there a way to get the usecase module inside of
> a jx template? I could do a substring on usecase.getName. Just looking
> to see if there is a shortcut and I don't see anything grepping
> through the code or looking at the Usecase interface. Or maybe that is
> something to be added to the Usecase interface?
>
> Richard
I've figured out how to do this. The question is do we want
usecase.getModule? Otherwise what is needed is this:
usecase.getName().substring(0,usecase.getName().indexOf('.'))
I can get something committed tomorrow. What do others think?
Richard
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: svn commit: r551554 - in /lenya/trunk/src/modules: fckeditor/usecases/insertAsset.jx
tinymce/usecases/insertAsset.jx
Posted by Richard Frovarp <Ri...@sendit.nodak.edu>.
Andreas Hartmann wrote:
> Hi Richard,
>
> rfrovarp@apache.org schrieb:
>
>> Author: rfrovarp
>> Date: Thu Jun 28 06:44:26 2007
>> New Revision: 551554
>>
>> URL: http://svn.apache.org/viewvc?view=rev&rev=551554
>> Log:
>> Apply Proxy fixes for TinyMCE and FCKeditor insertAsset functionality - updates from r551545
>>
>
> thanks for this!
>
> Maybe we can find a way to use the same code for BXE and FCKeditor,
> maybe by extracting some parts of the file to a separate JX template?
>
> -- Andreas
>
Yeah, this should be done. All three are identical except for three
lines that contain the editor's name. I think I see how it can be done
relatively easily. Is there a way to get the usecase module inside of a
jx template? I could do a substring on usecase.getName. Just looking to
see if there is a shortcut and I don't see anything grepping through the
code or looking at the Usecase interface. Or maybe that is something to
be added to the Usecase interface?
Richard
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org