RE: tempFile & shell component
"Guijarro, Julio" <[email protected]>
| Newsgroups | gmane.comp.java.smartfrog.user |
|---|---|
| Message-ID | <8D5B24B83C6A2E4B9E7EE5FA82627DC9C1A2BE@sdcexcea01.emea.cpqcorp.net> |
Hi Andreas,
The "Concat" has to happen at runtime because the filename does not
exist until then. For that you need to use a component that offers
similar functionality: LazyConcat. Lazy concat will create a runtime
attribute called "concat" that will have the concatenation of all the
attributes contained inside its "string" attribute.
Try
#include "org/smartfrog/services/utils/concat/components.sf"
> testCmd extends BashShellScript {
> processName "test";
string1 extends LazyConcat {
string extends LAZY {
a "dir ";
b LAZY testFile:filename;
}
}
cmd LAZY string1:concat;
}
Julio
> -----Original Message-----
> From: smartfrog-support-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:smartfrog-
> [email protected]] On Behalf Of Andreas Unterkircher
> Sent: 27 June 2005 16:30
> To: smartfrog-support-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> Subject: [Smartfrog-support] tempFile & shell component
>
>
> Hello,
>
> I would like to use the TempFileWithCleanup component in conjunction
with
> a BashShellScript component. E.g. something like:
>
> sfConfig extends Compound {
>
> testFile extends TempFileWithCleanup {
> dir "/tmp";
> prefix "tempFile.txt";
> text "foo";
> }
>
> testCmd extends BashShellScript {
> processName "test";
> string1 LAZY ATTRIB testFile:filename;
> cmd extends concat {
> a "ls -l";
> b string1
> }
> }
>
> The should list the temporary file (wich gets created in the sfDeploy
> phase of the TempFileWithCleanup component). The above example doesn't
> work; I played around a little bit but I could not figure out how to
> access the "filename" field so that I can use with the shell
component.
> How one could do that ?
>
> Thanks,
> Andreas
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> Smartfrog-support mailing list
> Smartfrog-support-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/smartfrog-support
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click