Fabian,
Your advice was correct on the placement of the
replace built-in. The problem was that
screens.render("component://xyz/widget/MyScreen#abc)
returns "" instead of the output.
I got it working with the following bsh script and
then the variable
${writer?replace("string1","string2"}
[code]
import org.ofbiz.widget.screen.ModelScreen;
import org.ofbiz.widget.screen.ScreenFactory;
import org.ofbiz.widget.html.HtmlFormRenderer;
import org.ofbiz.widget.html.HtmlScreenRenderer;
context.put("pubStylesheet", pubStylesheet);
ModelScreen modelScreen =
ScreenFactory.getScreenFromLocation("component://nhmEcom/widget/OrderScreens.xml",
"ind");
writer = new StringWriter();
htmlScreenRenderer = new HtmlScreenRenderer();
modelScreen.renderScreenString(writer, context,
htmlScreenRenderer);
context.put("writer", writer);
[/code]
As soon as I figure out how to not have to mirror a
definition for each page in the controller.xml file
I'll put a write up on this on the docs site.
Quick question for the community though. The obvious
benefit of this is to mimick the old school upload via
FTP for those needing WYSIWYG and not wanting to
venture to far out but still benefit from OFBiz. Does
changing the upload protocol from FTP to SFTP make
this kind of implementation secure enough to actually
use? It's basically giving carte blanche access to
anyone who can upload to the designated folder. Aside
from strict user management on the SFTP server what
else should I be looking out for?
--- Chris Howe <[EMAIL PROTECTED]> wrote:
> I gave the wrong path...
>
> example should have been
>
${screen.render("component://xyz/widget/MyScreen#abc")}
>
>
${screen.render("component://xyz/widget/MyScreen#abc")?replace("string1",
> "string2"} will replace string1 with string2 inside
> the string "component://xyz/widget/MyScreen#abc"
>
> so if
> string1 = xyz
> string2 =def
>
> result =
>
>
${screen.render("component://def/widget/MyScreen#abc")}
>
> I'm wanting it to replace string1 with string2
> inside
> of the screen output...
>
>
>
> --- Fabian Gorsler <[EMAIL PROTECTED]> wrote:
>
> > Hi Chris,
> >
> > Chris Howe wrote:
> > >
> >
>
${${screens.render("component://xyz/webapp/xyz/publisher.abc.ftl")}?replace("string1",
> > "string2")}
> >
> > I think this should work:
> >
> >
>
${screens.render("component://xyz/webapp/xyz/publisher.abc.ftl")?replace("string1",
> >
> > "string2"}
> >
> > Once you have quoted with ${} you don't need any
> > more quoting.
> >
> > HTH
> >
> > Best regards,
> > Fabian.
> >
>
>