You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Bertrand Delacretaz <bd...@apache.org> on 2008/01/08 14:33:38 UTC

SLING-149, porting µsling to sling, questions about modules and bundles

Hi,

I have created two new Maven modules in order to start "porting"
µsling to Sling, under
http://svn.apache.org/repos/asf/incubator/sling/trunk/usling/ :

usling-webapp:
Contains no code, just a pom and a web.xml to generate an empty Sling
webapp based on the launcher/app and launcher/webapp modules.

usling-servlets:
Currently contains only one do-nothing UslingMainServlet, implemented
as an OSGi SCR service.

The next steps would be to port the existing microsling servlets to
usling-servlets, and move the existing microsling integration test
suite to usling-webapp.

Questions:

1) Does this match the "vision" of how to use those app and webapp modules?

2) Shall we put all existing microsling servlets in the
usling-servlets module (that's what I suggest, at least initially), or
do we want to separate them in different bundles?

3) To activate the usling-servlets bundle automatically in the
usling-webapp, I've added this maven-dependency-plugin config to the
usling-webapp pom.xml, to copy the bundle to
WEB-INF/resources/bundles. Is that the correct way of doing that?

          <execution>
            <!-- Copy bundles that must be initially installed to
WEB-INF/resources/bundles -->
            <id>copy-dependencies</id>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/resources/bundles</outputDirectory>
              <excludeTransitive>true</excludeTransitive>

              <!-- List artifact names of bundles to install here -->
              <includeArtifactIds>org.apache.sling.usling.servlets</includeArtifactIds>
            </configuration>
          </execution>
        </executions>

A final comment: there's a lot of resource copying going on in the
various POMs, feels a bit complex. No urgent problem though.

-Bertrand

Re: Sling Scripting, again

Posted by Felix Meschberger <fm...@gmail.com>.
Am Dienstag, den 08.01.2008, 12:02 -0800 schrieb Padraic Hannon:
> I'd like to update the various ScriptEngineFactories so that they  
> provide their services via osgi. This way the registration of  
> factories can be done via standard osgi bundle activation. This would  
> allow the default script resolver to access Freemarker and the other  
> engines, and could be used for microSling as well.
> 
> WDYT?

The ScriptResolver is capable of getting ScriptEngineFactories from
bundles through the META-INF/services/* mechanism as well as getting
ScriptEngineFactory services. So both methods are acceptable.

If we are talking about reuse of ScriptEngineFactory implementations,
having support for the META-INF/services/* mechanism is crucial, as this
is the default mechanism to inject such a biest in a traditional
(static) application.

The other way around also works: Our implementations could theoretically
be used in traditional applications. Whether someone would be interested
in this (and not using Sling) is another question :-)

Regards
Felix


Re: Sling Scripting, again

Posted by Padraic Hannon <pi...@wasabicowboy.com>.
I guess the current bundles are accessible to the DefaultSlingScript  
resolver (assuming they are active and an entry for META-INF/services/ 
javax.script.ScriptEngineFactory), I was thinking that it might be  
nice to have their packages exported rather than remain private. I  
guess, though, then people might start using them without going  
through the script resolver...

-paddy

On Jan 8, 2008, at 12:02 PM, Padraic Hannon wrote:

> I'd like to update the various ScriptEngineFactories so that they  
> provide their services via osgi. This way the registration of  
> factories can be done via standard osgi bundle activation. This  
> would allow the default script resolver to access Freemarker and the  
> other engines, and could be used for microSling as well.
>
> WDYT?
> paddy



Sling Scripting, again

Posted by Padraic Hannon <pi...@wasabicowboy.com>.
I'd like to update the various ScriptEngineFactories so that they  
provide their services via osgi. This way the registration of  
factories can be done via standard osgi bundle activation. This would  
allow the default script resolver to access Freemarker and the other  
engines, and could be used for microSling as well.

WDYT?
paddy