Discussion:
External component integrated in a forrest page
Sjur Moshagen
2016-09-02 07:43:20 UTC
Permalink
Hello all,

We’re trying to make CKEditor [1] work in a forrest page (and as part of it, a speller plugin we have developed to support the languages we work on). CKEditor is all JS and CSS, and I have tried following the descriptions here [2] to make it work, with no success so far.

The main issue is that of getting url’s mapped to the correct directory on disk. I though I had done it correctly, but still no success. The CKEditor code is located in:

$PROJECTROOT/src/documentation/resources/ckeditor/*

and I have the following entry in $PROJECTROOT/src/documentation/content/locationmap.xml:

<match pattern="ckeditor/**.js">
<location src="{properties:resources-dir}ckeditor/{1}.js"/>
</match>
<match pattern="/ckeditor/**.js">
<location src="{properties:resources-dir}ckeditor/{1}.js"/>
</match>

I also added the following to $PROJECTROOT/src/documentation/sitemap.xmap:

<map:match pattern="ckeditor/**.js">
<map:read src="{lm:project.resources-dir.{1}.js}" mime-type="text/javascript" />
</map:match>

But no success.

Any feedback would be most welcome.

Sjur


[1] http://ckeditor.com
[2] https://forrest.apache.org/docs_0_100/project-js-css.html
Brian M Dube
2016-09-02 23:32:35 UTC
Permalink
Post by Sjur Moshagen
Hello all,
We’re trying to make CKEditor [1] work in a forrest page (and as part of it, a speller plugin we have developed to support the languages we work on). CKEditor is all JS and CSS, and I have tried following the descriptions here [2] to make it work, with no success so far.
$PROJECTROOT/src/documentation/resources/ckeditor/*
<match pattern="ckeditor/**.js">
<location src="{properties:resources-dir}ckeditor/{1}.js"/>
</match>
<match pattern="/ckeditor/**.js">
<location src="{properties:resources-dir}ckeditor/{1}.js"/>
</match>
I got it to work using {properties:resources} instead of
{properties:resources-dir}. I tried briefly with the locationmap, but
didn't get that working.

Brian
Post by Sjur Moshagen
[1] http://ckeditor.com
[2] https://forrest.apache.org/docs_0_100/project-js-css.html
Sjur Moshagen
2016-09-03 11:06:55 UTC
Permalink
Post by Brian M Dube
Post by Sjur Moshagen
$PROJECTROOT/src/documentation/resources/ckeditor/*
<match pattern="ckeditor/**.js">
<location src="{properties:resources-dir}ckeditor/{1}.js"/>
</match>
<match pattern="/ckeditor/**.js">
<location src="{properties:resources-dir}ckeditor/{1}.js"/>
</match>
I got it to work using {properties:resources} instead of
{properties:resources-dir}. I tried briefly with the locationmap, but
didn't get that working.
Thanks a lot! Those two tips - removing ‘-dir’ from the location variable, and skipping the locationmap - solved the problem :-)

Sjur
Sjur Moshagen
2016-09-05 14:59:12 UTC
Permalink
Hello all,

As a follow-up on the previous question, here’s another one:

I need to be able to build a static version of the site. This works fine _except_ for this editor thing that I added to $PROJECT_HOME/src/documentation/resources/.

The thing is, that the ant build files are _mimicking_ the xmaps etc, they are not directly using them. And in this case ant is not copying any (?) of the files found in that resources dir except for the one linked to in the html page that contains the editor.

So:

how can I tell ant that _in this project_ I need to copy everything in resources/x/ to site/x/?

Regards,
Sjur
David Crossley
2016-09-07 03:07:12 UTC
Permalink
Post by Sjur Moshagen
Hello all,
I need to be able to build a static version of the site. This works fine _except_ for this editor thing that I added to $PROJECT_HOME/src/documentation/resources/.
The thing is, that the ant build files are _mimicking_ the xmaps etc, they are not directly using them. And in this case ant is not copying any (?) of the files found in that resources dir except for the one linked to in the html page that contains the editor.
Around line 82 of main/targets/site.xml
it copies only certain project resources, explicitly the images directory.

Perhaps the ability was never completed to copy over certain relevant
other project resources.
Post by Sjur Moshagen
how can I tell ant that _in this project_ I need to copy everything in resources/x/ to site/x/?
Perhaps this is indicating that this should be in a plugin.
There is a section at the end of each plugin build.xml file,
that shows how to copy over extra resources.

I only found one that utilises that: the output.htmlArea plugin.
(Not sure about the state of that plugin, but at least useful as an example.)

As a plugin would make it easier to apply to various projects.
I thought I remembered there being a setting to control this. All I'm
https://forrest.apache.org/docs_0_100/howto/howto-asf-mirror.html#link
and
https://forrest.apache.org/docs_0_100/faq.html#cli-xconf
Have you already tried that?
Brian
And if your project uses Forrestbot to deploy, then that might assist
on a per-project level.

http://forrest.apache.org/tools/forrestbot.html#Workstages
discusses using your own "getlocal.get" workstage.

Another way is shown in our "zone" SVN forrest/zone/config/run-forrestbot.sh
which can copy some stuff before invoking forrest.

-David
Sjur Moshagen
2016-09-08 14:01:29 UTC
Permalink
Thanks to both of you for tips and suggestions:-)

Sjur
Post by David Crossley
Post by Sjur Moshagen
Hello all,
I need to be able to build a static version of the site. This works fine _except_ for this editor thing that I added to $PROJECT_HOME/src/documentation/resources/.
The thing is, that the ant build files are _mimicking_ the xmaps etc, they are not directly using them. And in this case ant is not copying any (?) of the files found in that resources dir except for the one linked to in the html page that contains the editor.
Around line 82 of main/targets/site.xml
it copies only certain project resources, explicitly the images directory.
Perhaps the ability was never completed to copy over certain relevant
other project resources.
Post by Sjur Moshagen
how can I tell ant that _in this project_ I need to copy everything in resources/x/ to site/x/?
Perhaps this is indicating that this should be in a plugin.
There is a section at the end of each plugin build.xml file,
that shows how to copy over extra resources.
I only found one that utilises that: the output.htmlArea plugin.
(Not sure about the state of that plugin, but at least useful as an example.)
As a plugin would make it easier to apply to various projects.
I thought I remembered there being a setting to control this. All I'm
https://forrest.apache.org/docs_0_100/howto/howto-asf-mirror.html#link
and
https://forrest.apache.org/docs_0_100/faq.html#cli-xconf
Have you already tried that?
Brian
And if your project uses Forrestbot to deploy, then that might assist
on a per-project level.
http://forrest.apache.org/tools/forrestbot.html#Workstages
discusses using your own "getlocal.get" workstage.
Another way is shown in our "zone" SVN forrest/zone/config/run-forrestbot.sh
which can copy some stuff before invoking forrest.
-David
Loading...