Re: Dependency Management

2009-01-05 Thread Carsten Ziegeler
Felix Meschberger wrote:
> #1 each module must fully describe its dependencies
> Some dependencies should probably be considered globally valid and will
> still be available through dependency management:
>JCR API (1.0)
>Servlet API (2.4)
>OSGi APIs (should generally be R4 based)
+1

> #2 each dependency version must be to the lowest possible number
> This ensures that Import-Package version numbers will not increase
> needlessly. Dependency version numbers should primarily be based on
> API-functionality. Any higher version required due to bug-fixes in the
> implementation is not an issue for a module to care about.
+1

> #3 keep dependency management for plugins (plugin management)
> Plugin management is concerned with the build process only and it makes
> perfect sense to keep this support and functionality.
+1

Carsten
-- 
Carsten Ziegeler
cziege...@apache.org


Re: A question about sling launchpad

2009-01-05 Thread Bertrand Delacretaz
Hi,

On Mon, Jan 5, 2009 at 3:04 PM, yanshaozhiGmail  wrote:
> ...2009-01-05 21:48:43.616:/:WARN:  ERROR: Error starting 
> slinginstall:org.apache.sling.jcr.ocm-2.0.3-i
> ncubator-SNAPSHOT.jar (org.osgi.framework.BundleException: Unresolved package 
> in bundle 31: package;
>  (package=org.apache.commons.lang))
> org.osgi.framework.BundleException: Unresolved package in bundle 31: package; 
> (package=org.apache.co
> mmons.lang)...

That's a bug indeed, if you look at the
http://localhost:/system/console/bundles page you can see that the
org.apache.sling.jcr.ocm bundle is not started, because if this
missing bundle. I can have a look later today.

-Bertrand


[jira] Closed: (SLING-808) Increase version of parent pom to avoid problems with snapshot builds

2009-01-05 Thread Carsten Ziegeler (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-808?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Carsten Ziegeler closed SLING-808.
--

Resolution: Fixed

Updated in revision 731526

> Increase version of parent pom to avoid problems with snapshot builds
> -
>
> Key: SLING-808
> URL: https://issues.apache.org/jira/browse/SLING-808
> Project: Sling
>  Issue Type: Bug
>  Components: General
>Reporter: Carsten Ziegeler
>Assignee: Carsten Ziegeler
>
> We are using the 4-snapshot version of the parent pom for a long time now, if 
> we change it (like we did with removing the jcr dependencies) this breaks all 
> older snapshot builds as they
> refer to the old parent pom.
> Therefore, we'll update our parent pom to 5-snapshot. This allows us to 
> modify the pom without breaking old builds.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Re: Esp files and context root of a web application

2009-01-05 Thread Alexander Klimetschek
On Mon, Jan 5, 2009 at 11:18 AM, Scott Taylor  wrote:
> P.S. I suspect that this question might be strictly a EcmaScript question
> and not have much to do with how Sling uses it. If so I apologize for
> posting it here. Can some kind soul post a good link to a site explaining
> EcmaScript in a webapplication. (Eg. how do you read http parameters, get
> access to request and response object, etc...)

Have a look at 
http://cwiki.apache.org/confluence/display/SLING/Scripting+variables

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetsc...@day.com


[jira] Assigned: (SLING-799) Job Folder is not ordered and results in unordered queue

2009-01-05 Thread Carsten Ziegeler (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-799?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Carsten Ziegeler reassigned SLING-799:
--

Assignee: Carsten Ziegeler

> Job Folder is not ordered and results in unordered queue
> 
>
> Key: SLING-799
> URL: https://issues.apache.org/jira/browse/SLING-799
> Project: Sling
>  Issue Type: Bug
>  Components: Event
>Affects Versions: Extensions Event 2.0.2
>Reporter: Tobias Bocanegra
>Assignee: Carsten Ziegeler
>
> check code of
> AbstractRepositoryEventHandler.ensureRepositoryPath()
> /**
>  * Check if the repository path already exists. If not, create it.
>  */
> protected Node ensureRepositoryPath()
> throws RepositoryException {
> final Node node = JcrResourceUtil.createPath(this.repositoryPath,
>EventHelper.NODETYPE_FOLDER,
>EventHelper.NODETYPE_FOLDER,
>this.writerSession, true);
> return node;
> }
> this should use a "sling:OrderedFolder"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



A question about sling launchpad

2009-01-05 Thread yanshaozhiGmail
HI:
  
When I built run the launchapd webapp with mvn jetty:run (the newest sling), 
after the server started I encounter with  a question  as follow: (I want to 
know it's ling's bug or not ,how can I do it?)
 
2009-01-05 21:48:43.616:/:WARN:  ERROR: Error starting 
slinginstall:org.apache.sling.jcr.ocm-2.0.3-i
ncubator-SNAPSHOT.jar (org.osgi.framework.BundleException: Unresolved package 
in bundle 31: package;
 (package=org.apache.commons.lang))
org.osgi.framework.BundleException: Unresolved package in bundle 31: package; 
(package=org.apache.co
mmons.lang)
at org.apache.felix.framework.Felix._resolveBundle(Felix.java:1728)
at org.apache.felix.framework.Felix._startBundle(Felix.java:1591)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1544)
at 
org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:1125)
at 
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:258)
at java.lang.Thread.run(Thread.java:595)
2009-01-05 21:48:45.225:/:INFO:  sling: Servlet sling initialized
2009-01-05 21:48:46.317::INFO:  Started selectchannelconnec...@0.0.0.0:
[INFO] Started Jetty Server

2009-01-05 



yanshaozhiGmail 


Re: Dependency Management

2009-01-05 Thread Bertrand Delacretaz
Hi Felix,

I agree with your proposals, with one slight concern:

On Mon, Jan 5, 2009 at 8:45 AM, Felix Meschberger  wrote:
> ...#2 each dependency version must be to the lowest possible number
> This ensures that Import-Package version numbers will not increase
> needlessly. Dependency version numbers should primarily be based on
> API-functionality

Ok

> ...Any higher version required due to bug-fixes in the
> implementation is not an issue for a module to care about

In such a case, how and where do we express which actual version is required?

If module A depends on V1.1 of library X at the API level, but V1.1 is
buggy and we know that you really need 1.1.4 for things to work, where
do people find out about that?

"In the integration tests module" might be a valid answer, but I'd
like to have your opinion on this.

-Bertrand


[jira] Created: (SLING-807) Reduce number of background threads

2009-01-05 Thread Carsten Ziegeler (JIRA)
Reduce number of background threads
---

 Key: SLING-807
 URL: https://issues.apache.org/jira/browse/SLING-807
 Project: Sling
  Issue Type: Improvement
  Components: Event
Affects Versions: Extensions Event 2.0.2
Reporter: Carsten Ziegeler
Assignee: Carsten Ziegeler
 Fix For: Extensions Event 2.0.4


Currently all services in the event module create background threads to 
periodically check something. In addition they use the scheduler for other 
things. This creates several (mostly idle) background threads which should be 
reduced to a minimum.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Re: Esp files and context root of a web application

2009-01-05 Thread Scott Taylor

Alexander Klimetschek wrote:

On Mon, Jan 5, 2009 at 11:18 AM, Scott Taylor  wrote:
  

P.S. I suspect that this question might be strictly a EcmaScript question
and not have much to do with how Sling uses it. If so I apologize for
posting it here. Can some kind soul post a good link to a site explaining
EcmaScript in a webapplication. (Eg. how do you read http parameters, get
access to request and response object, etc...)



Have a look at 
http://cwiki.apache.org/confluence/display/SLING/Scripting+variables

Regards,
Alex
  
Thanks for the link Alex. I believe I just have to ensure all links to 
my own web application are preceded
with <%=request.contextPath%>. Eg. href="<%=request.contextPath%>/mynode">mynode


/Scott



[jira] Closed: (SLING-807) Reduce number of background threads

2009-01-05 Thread Carsten Ziegeler (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-807?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Carsten Ziegeler closed SLING-807.
--

Resolution: Invalid

The number of threads is already reduced. The only solution to further reduce 
the threads would be to combine the different services into a single service
which is imho not desirable. Therefore closing this bug as invalid.

> Reduce number of background threads
> ---
>
> Key: SLING-807
> URL: https://issues.apache.org/jira/browse/SLING-807
> Project: Sling
>  Issue Type: Improvement
>  Components: Event
>Affects Versions: Extensions Event 2.0.2
>Reporter: Carsten Ziegeler
>Assignee: Carsten Ziegeler
> Fix For: Extensions Event 2.0.4
>
>
> Currently all services in the event module create background threads to 
> periodically check something. In addition they use the scheduler for other 
> things. This creates several (mostly idle) background threads which should be 
> reduced to a minimum.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Created: (SLING-808) Increase version of parent pom to avoid problems with snapshot builds

2009-01-05 Thread Carsten Ziegeler (JIRA)
Increase version of parent pom to avoid problems with snapshot builds
-

 Key: SLING-808
 URL: https://issues.apache.org/jira/browse/SLING-808
 Project: Sling
  Issue Type: Bug
  Components: General
Reporter: Carsten Ziegeler
Assignee: Carsten Ziegeler


We are using the 4-snapshot version of the parent pom for a long time now, if 
we change it (like we did with removing the jcr dependencies) this breaks all 
older snapshot builds as they
refer to the old parent pom.
Therefore, we'll update our parent pom to 5-snapshot. This allows us to modify 
the pom without breaking old builds.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



direct script execution

2009-01-05 Thread Torgeir Veimo
Is it possible to request a script directly, eg. use a request such  
as /apps/notes/html.esp, and make that script execute instead of being  
returned as plaintext?


--
Torgeir Veimo
torg...@pobox.com






Can't use some JCR classes in Sling

2009-01-05 Thread Joshua Oransky

Is there a reason I keep getting this error in my JSP sling templates?

org.apache.sling.scripting.jsp.jasper.JasperException: Unable to  
compile class for JSP: An error occurred at line: 1 in the jsp file: / 
apps/cms/admin/global/replicate.jsp com.day.crx.j2ee.CRXContext cannot  
be resolved to a type null


I've tried importing specifically, and even fully qualifying the class  
name in my JSP code, to no avail.


-Josh


[jira] Closed: (SLING-635) Stop thread for own job queues when it is unused

2009-01-05 Thread Carsten Ziegeler (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-635?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Carsten Ziegeler closed SLING-635.
--

Resolution: Fixed

SLING-635: Remove a thread after two clean up cycles by marking it in the first 
cycle to be removed and remove it in the second cycle - if the thread hasn't 
been used in the meantime.
Implemented in revision 731544

> Stop thread for own job queues when it is unused
> 
>
> Key: SLING-635
> URL: https://issues.apache.org/jira/browse/SLING-635
> Project: Sling
>  Issue Type: Improvement
>  Components: Event
>Affects Versions: Extensions Event 2.0.2
>Reporter: Carsten Ziegeler
>Assignee: Carsten Ziegeler
> Fix For: Extensions Event 2.0.4
>
>
> The background thread should check if a job queue thread has been unused for 
> a longer time and then stop it.
> This avoids too many idle threads.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Created: (SLING-809) Add possibility to force a reprocess of an queued job entry

2009-01-05 Thread Tobias Bocanegra (JIRA)
Add possibility to force a reprocess of an queued job entry
---

 Key: SLING-809
 URL: https://issues.apache.org/jira/browse/SLING-809
 Project: Sling
  Issue Type: New Feature
  Components: Event
Affects Versions: Extensions Event 2.0.2
Reporter: Tobias Bocanegra


A FIFO job event queue processes the jobs in proper sequence. when a job cannot 
be processed it can be scheduled for retry after a certain period.
when the queue waits for that retry delay to pass, new job can be added to the 
queue. sometime it might be useful to bypass the wait time "manually" and let 
the queue re-process the job immediately. for example after a config change or 
per user-interaction via a GUI.

add something like: 
  JobStatusProvider.forceReProcess(String queueName)





-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Rendering custom 404 pages

2009-01-05 Thread Scott Taylor
In my sling repository I've defined a /apps/foo/bar/html.esp which 
decorates all my web pages with the standard layout used through out the 
site.


Eg.


 
   <%= currentNode.title %>
   
 
 
   <%= currentNode.title %>
   <%=currentNode.text %> 



 


Now when any node with sling:resourceType=/foo/bar is accessed it is 
automatically decorated with the website's standard layout. This is 
awesome and I would like to be able to use the above html.esp to 
decorate even error pages like 404. For example, I would like to be able 
to create a node with a title property of "Page Not Found" and a text 
property like "Sorry the page you were looking for was not 
found", and have Sling render 404 error pages using that node and 
the /apps/foo/bar/html.esp script. Is this possible with Sling?


I'm aware that I can create a /apps/sling/servlet/errorhandler/404.esp 
file but that doesn't allow me to use the /apps/foo/bar/html.esp decorator.


/Scott







Esp files and context root of a web application

2009-01-05 Thread Scott Taylor
I want to create a html.esp file that contains links to stylesheets, 
however I would like to create the links so that they take into 
consideration the context root of the web application. In jsp pages I 
would use something like this . Is 
there something equivalent in esp pages?


/Scott

P.S. I suspect that this question might be strictly a EcmaScript 
question and not have much to do with how Sling uses it. If so I 
apologize for posting it here. Can some kind soul post a good link to a 
site explaining EcmaScript in a webapplication. (Eg. how do you read 
http parameters, get access to request and response object, etc...)





Re: Esp files and context root of a web application

2009-01-05 Thread Alexander Klimetschek
On Mon, Jan 5, 2009 at 7:58 PM, Scott Taylor  wrote:
> I believe I just have to ensure all links to my
> own web application are preceded
> with <%=request.contextPath%>. Eg.  href="<%=request.contextPath%>/mynode">mynode

Right.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetsc...@day.com


Re: Can't use some JCR classes in Sling

2009-01-05 Thread Tobias Bocanegra
hi josh,
only the packages exported by the bundles or the ones specified as
bootclasspath (via sling.properties config) are visible by other
bundles and jsps. in this case it's a bit difficult, since the
crx-explorer stuff is not available as bundle and i doubt that it will
work. why would you need to CRXContext in a non-crx webapp ?

regards, toby

On 1/5/09, Joshua Oransky  wrote:
> Is there a reason I keep getting this error in my JSP sling templates?
>
>  org.apache.sling.scripting.jsp.jasper.JasperException:
> Unable to compile class for JSP: An error occurred at line: 1 in the jsp
> file: /apps/cms/admin/global/replicate.jsp
> com.day.crx.j2ee.CRXContext cannot be resolved to a type null
>
>  I've tried importing specifically, and even fully qualifying the class name
> in my JSP code, to no avail.
>
>  -Josh
>


Re: Can't use some JCR classes in Sling

2009-01-05 Thread Joshua Oransky

Toby,

	I'm trying to create a script that can replicate a node, so I need  
access to these classes. I'm using the content.jsp code from the CRX  
webapp, but I want the code to reside INSIDE my app, so that I can  
package it up and send it to the servers I need, since I wont have  
access to the command line or FS.


Here's my code:

	String action_arg0 = currentNode.getPath(); try  
{ com.day.crx.replication.ReplicationManager mgr =  
(com.day.crx.replication.ReplicationManager)  
((com.day.crx.core.CRXRepositoryImpl)  
repSession 
.getRepository 
()).getModule 
(com.day.crx.replication.ReplicationManager.class.getName()); if (mgr  
== null) { %>Replication not configured<% } else  
{ mgr.replicate( repSession, "Activate", action_arg0, null, false,  
null ); %>  alert("Replication of Node < 
%= org.apache.commons.lang.StringEscapeUtils.escapeJava(action_arg0)  
%> added to syndicator queues.");  <% } } catch (Exception e)  
{ %><%= e.toString() %><% }


-Josh

On Jan 5, 2009, at 11:58 AM, Tobias Bocanegra wrote:


hi josh,
only the packages exported by the bundles or the ones specified as
bootclasspath (via sling.properties config) are visible by other
bundles and jsps. in this case it's a bit difficult, since the
crx-explorer stuff is not available as bundle and i doubt that it will
work. why would you need to CRXContext in a non-crx webapp ?

regards, toby

On 1/5/09, Joshua Oransky  wrote:
Is there a reason I keep getting this error in my JSP sling  
templates?


org.apache.sling.scripting.jsp.jasper.JasperException:
Unable to compile class for JSP: An error occurred at line: 1 in  
the jsp

file: /apps/cms/admin/global/replicate.jsp
com.day.crx.j2ee.CRXContext cannot be resolved to a type null

I've tried importing specifically, and even fully qualifying the  
class name

in my JSP code, to no avail.

-Josh





Re: Dependency Management

Hi,

Bertrand Delacretaz schrieb:
> Hi Felix,
> 
> I agree with your proposals, with one slight concern:
> 
> On Mon, Jan 5, 2009 at 8:45 AM, Felix Meschberger  wrote:
>> ...#2 each dependency version must be to the lowest possible number
>> This ensures that Import-Package version numbers will not increase
>> needlessly. Dependency version numbers should primarily be based on
>> API-functionality
> 
> Ok
> 
>> ...Any higher version required due to bug-fixes in the
>> implementation is not an issue for a module to care about
> 
> In such a case, how and where do we express which actual version is required?
> 
> If module A depends on V1.1 of library X at the API level, but V1.1 is
> buggy and we know that you really need 1.1.4 for things to work, where
> do people find out about that?
> 
> "In the integration tests module" might be a valid answer, but I'd
> like to have your opinion on this.

Well, the black-and-white answer would really be "in the final packaging
build", be it launchpad/app, launchpad/webapp or even the actualy
deployment.

There may be some shades of gray, though: If the 1.1 versions is really
that buggy, the bundle itself may of course request version 1.1.4, esp.
if the operation of the bundle cannot be guaranteed with any version
prior to 1.1.4.

On the other hand: If the bundle would be fully and completely
operational with 1.1 (even though it contains some bugs in some areas),
the bundle should still just depend on 1.1.

Regards
Felix


Re: Can't use some JCR classes in Sling


Toby,

	By the way, this webapp *IS* in CRX. I just can't have my users using  
the CRX content browser. I need them to be able to activate content  
from within the app I built.


-Josh


On Jan 5, 2009, at 11:58 AM, Tobias Bocanegra wrote:


hi josh,
only the packages exported by the bundles or the ones specified as
bootclasspath (via sling.properties config) are visible by other
bundles and jsps. in this case it's a bit difficult, since the
crx-explorer stuff is not available as bundle and i doubt that it will
work. why would you need to CRXContext in a non-crx webapp ?

regards, toby

On 1/5/09, Joshua Oransky  wrote:
Is there a reason I keep getting this error in my JSP sling  
templates?


org.apache.sling.scripting.jsp.jasper.JasperException:
Unable to compile class for JSP: An error occurred at line: 1 in  
the jsp

file: /apps/cms/admin/global/replicate.jsp
com.day.crx.j2ee.CRXContext cannot be resolved to a type null

I've tried importing specifically, and even fully qualifying the  
class name

in my JSP code, to no avail.

-Josh





Re: Creating an HTML response for URLS with no extensions


Felix Meschberger wrote:

Hi Scott,

Scott Taylor schrieb:
  

I've just started playing around with Sling, and I would like to try to
move one of my web applications over to Sling. The application is just a
set of HTML pages, but it uses URLs without extensions. So instead of
urls like http://www.mydomain.com/mynode.html I would like to use
http://www.mydomain.com/mynode/ to return an HTML page. I tried creating
a GET.esp script, and while that caused an html page to be return when
no extension was present, it also affected the other extensions as well
(eg. .json). Basically I would like Sling to treat urls without
extensions as having an .html extension (but without using a redirect).
Is that possible? I believe I saw some discussion about this in the
email archives, but I'm not sure what the outcome was.

Any help greatly appreciated,
/Scott



With the recent extensions of the ResourceResolver it is now possible to
internally handle any request without an extensions as if it would have
an .html extension by defining an entry below /etc/map such as:

/etc/map/http/no_extension: {
"jcr:primaryType": "sling:Mapping"
"sling:internalRedirect": "http://$1:$2$3.html";,
"sling:match": "([^/]+)\\.(\\d+)(/(.*/)?[^/^.]+)/?$",
}

using curl, the following command line should do the trick:

  $ curl -u admin:admin -Fjcr:primaryType=sling:Mapping \
 -F"sling:match=([^/]+)\\.(\\d+)(/(.*/)?[^/^.]+)/?$" \
 -F"sling:internalRedirect=http://\$1:\$2\$3.html"; \
 http://localhost:/etc/map/http/no_extension

For this to work, you need the current trunk of the jcr/resource module
installed.

Hope this helps.

Regards
Felix
  
Unfortunately I didn't get it to work after building from the current 
trunk, but I found I was able to basically get the desired result by 
creating a node called index under the node "mynode". The url 
http://www.mydomain.com/mynode would return a html page based on the 
properties in the index node. I may revisit this later as I think the 
solution you mentioned might be cleaner for my purposes, but the index 
solution is good enough for now. Thanks for the help!


/Scott



[jira] Closed: (SLING-799) Job Folder is not ordered and results in unordered queue


 [ 
https://issues.apache.org/jira/browse/SLING-799?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Carsten Ziegeler closed SLING-799.
--

   Resolution: Fixed
Fix Version/s: Extensions Event 2.0.4

Fixed in revision 731509 by creating an ordered folder and sorting the query 
result.

> Job Folder is not ordered and results in unordered queue
> 
>
> Key: SLING-799
> URL: https://issues.apache.org/jira/browse/SLING-799
> Project: Sling
>  Issue Type: Bug
>  Components: Event
>Affects Versions: Extensions Event 2.0.2
>Reporter: Tobias Bocanegra
>Assignee: Carsten Ziegeler
> Fix For: Extensions Event 2.0.4
>
>
> check code of
> AbstractRepositoryEventHandler.ensureRepositoryPath()
> /**
>  * Check if the repository path already exists. If not, create it.
>  */
> protected Node ensureRepositoryPath()
> throws RepositoryException {
> final Node node = JcrResourceUtil.createPath(this.repositoryPath,
>EventHelper.NODETYPE_FOLDER,
>EventHelper.NODETYPE_FOLDER,
>this.writerSession, true);
> return node;
> }
> this should use a "sling:OrderedFolder"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Reopened: (SLING-760) Filter characters in http error messages


 [ 
https://issues.apache.org/jira/browse/SLING-760?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bertrand Delacretaz reopened SLING-760:
---


> Filter characters in http error messages
> 
>
> Key: SLING-760
> URL: https://issues.apache.org/jira/browse/SLING-760
> Project: Sling
>  Issue Type: Bug
>  Components: Servlets Get
>Affects Versions: Engine 2.0.2
>Reporter: Bertrand Delacretaz
>Assignee: Bertrand Delacretaz
>Priority: Minor
> Fix For: Engine 2.0.4
>
>
> The default get servlet includes the supplied extension as is in the "No 
> renderer for extension" error page, it should filter it to avoid garbling the 
> error page depending on the extension.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[newbie] WebDav - Content Negociation

I want to make a simple wiki where pages can be edited by WebDav. 
Several formats can be available.


For example: The page http://example.com/main can be modified by one of 
this file :


/
|- main.html (for modifications with an HTML Editor like DreamWeaver)
|- main.doc (for modifications with MS Office)
|- main.odt (for modifications with OpenOffice)
|- main.wiki (for modifications with Notepad with Wiki Syntax)
|- main.pdf (read-only PDF format for export)

Can Sling help me to do that?



Re: Dependency Management

Hi Felix,

On Mon, Jan 5, 2009 at 11:40 AM, Felix Meschberger  wrote:
> ...There may be some shades of gray, though: If the 1.1 versions is really
> that buggy, the bundle itself may of course request version 1.1.4, esp.
> if the operation of the bundle cannot be guaranteed with any version
> prior to 1.1.4.
>
> On the other hand: If the bundle would be fully and completely
> operational with 1.1 (even though it contains some bugs in some areas),
> the bundle should still just depend on 1.1

Ok, so we seem to be in agreement here: a bundle should *in principle*
depend on the lowest version that it needs API-wise, but if it's
obvious that that version will not work, we'll bump the dependency
accordingly.

-Bertrand


[jira] Resolved: (SLING-760) Filter characters in http error messages


 [ 
https://issues.apache.org/jira/browse/SLING-760?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bertrand Delacretaz resolved SLING-760.
---

   Resolution: Fixed
Fix Version/s: (was: Engine 2.0.4)
Servlets Resolver 2.0.6

In revision 731608, removed the xml escaping code from the 
SlingHttpServletResponseImpl, and implemented it in the 
DefaultErrorHandlerServlet.

I have also added a getXmlEscapingWriter(Writer w) method to ResponseUtil, to 
provide an escaping Writer that can be used for stack trace dumps, etc.

> Filter characters in http error messages
> 
>
> Key: SLING-760
> URL: https://issues.apache.org/jira/browse/SLING-760
> Project: Sling
>  Issue Type: Bug
>  Components: Servlets Get
>Affects Versions: Engine 2.0.2
>Reporter: Bertrand Delacretaz
>Assignee: Bertrand Delacretaz
>Priority: Minor
> Fix For:  Servlets Resolver 2.0.6
>
>
> The default get servlet includes the supplied extension as is in the "No 
> renderer for extension" error page, it should filter it to avoid garbling the 
> error page depending on the extension.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Re: direct script execution

Hi Torgeir,

Torgeir Veimo schrieb:
> Is it possible to request a script directly, eg. use a request such as
> /apps/notes/html.esp, and make that script execute instead of being
> returned as plaintext?

This is not currently possible (though the implementation would be
rather simple).

The problem is that we also support WebDAV on "/" through the Sling
WebDAV bundle. So, for WebDAV we might want to expect the script to be
returned as plaintext to be able to edit and modify it.

I could imagine two options: (1) we add a configuration setting, which
controls whether scripts are executed or not or (2) add a servlet to
handle a special extension, which would execute the script. I would
prefer this second option.

The servlet would have a rather simple service() method implementation:

   public void service(ServletRequest req, ServletResponse res)
   throws ServletException, IOException {

   Servlet servlet = ((SlingHttpServletRequest) req).
getResource.adaptTo(Servlet.class);
   if (servlet != null) {
   servlet.service(req, res);
   } else {
   // send error
   }
}

Regards
Felix


Re: A question about sling launchpad

Hi Yan,

As Betrand said, this is actually a (known) bug in the definition of the
OCM bundle of Sling. If you don't need/use OCM (Object Content Mapping),
you can safely ignore this error.

Anyway, I know of this problem and will fix it later this week.

Regards
Felix

yanshaozhiGmail schrieb:
> HI:
>   
> When I built run the launchapd webapp with mvn jetty:run (the newest sling), 
> after the server started I encounter with  a question  as follow: (I want to 
> know it's ling's bug or not ,how can I do it?)
>  
> 2009-01-05 21:48:43.616:/:WARN:  ERROR: Error starting 
> slinginstall:org.apache.sling.jcr.ocm-2.0.3-i
> ncubator-SNAPSHOT.jar (org.osgi.framework.BundleException: Unresolved package 
> in bundle 31: package;
>  (package=org.apache.commons.lang))
> org.osgi.framework.BundleException: Unresolved package in bundle 31: package; 
> (package=org.apache.co
> mmons.lang)
> at org.apache.felix.framework.Felix._resolveBundle(Felix.java:1728)
> at org.apache.felix.framework.Felix._startBundle(Felix.java:1591)
> at org.apache.felix.framework.Felix.startBundle(Felix.java:1544)
> at 
> org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:1125)
> at 
> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:258)
> at java.lang.Thread.run(Thread.java:595)
> 2009-01-05 21:48:45.225:/:INFO:  sling: Servlet sling initialized
> 2009-01-05 21:48:46.317::INFO:  Started selectchannelconnec...@0.0.0.0:
> [INFO] Started Jetty Server
> 
> 2009-01-05 
> 
> 
> 
> yanshaozhiGmail 
> 


Re: Rendering custom 404 pages

Hi Scott,

Scott Taylor schrieb:
> In my sling repository I've defined a /apps/foo/bar/html.esp which
> decorates all my web pages with the standard layout used through out the
> site.
> 
> Eg.
> 
> 
>  
><%= currentNode.title %>
>
>  
>  
><%= currentNode.title %>
><%=currentNode.text %>
> 
>  
> 
> 
> Now when any node with sling:resourceType=/foo/bar is accessed it is
> automatically decorated with the website's standard layout. This is
> awesome and I would like to be able to use the above html.esp to
> decorate even error pages like 404. For example, I would like to be able
> to create a node with a title property of "Page Not Found" and a text
> property like "Sorry the page you were looking for was not
> found", and have Sling render 404 error pages using that node and
> the /apps/foo/bar/html.esp script. Is this possible with Sling?
> 
> I'm aware that I can create a /apps/sling/servlet/errorhandler/404.esp
> file but that doesn't allow me to use the /apps/foo/bar/html.esp decorator.

You might want to create a /apps/sling/content/error404 node, set the
sling:resourceType, title, and text properties and in your error handler
you do:

<%
sling.include("/apps/sling/content/error404.html");
%>

This will return a page with your decorator etc.

Regards
Felix



Re: Creating an HTML response for URLS with no extensions

Hi Scott,

Scott Taylor schrieb:
> Felix Meschberger wrote:
>> Hi Scott,
>>
>> Scott Taylor schrieb:
>>  
>>> I've just started playing around with Sling, and I would like to try to
>>> move one of my web applications over to Sling. The application is just a
>>> set of HTML pages, but it uses URLs without extensions. So instead of
>>> urls like http://www.mydomain.com/mynode.html I would like to use
>>> http://www.mydomain.com/mynode/ to return an HTML page. I tried creating
>>> a GET.esp script, and while that caused an html page to be return when
>>> no extension was present, it also affected the other extensions as well
>>> (eg. .json). Basically I would like Sling to treat urls without
>>> extensions as having an .html extension (but without using a redirect).
>>> Is that possible? I believe I saw some discussion about this in the
>>> email archives, but I'm not sure what the outcome was.
>>>
>>> Any help greatly appreciated,
>>> /Scott
>>> 
>>
>> With the recent extensions of the ResourceResolver it is now possible to
>> internally handle any request without an extensions as if it would have
>> an .html extension by defining an entry below /etc/map such as:
>>
>> /etc/map/http/no_extension: {
>> "jcr:primaryType": "sling:Mapping"
>> "sling:internalRedirect": "http://$1:$2$3.html";,
>> "sling:match": "([^/]+)\\.(\\d+)(/(.*/)?[^/^.]+)/?$",
>> }
>>
>> using curl, the following command line should do the trick:
>>
>>   $ curl -u admin:admin -Fjcr:primaryType=sling:Mapping \
>>  -F"sling:match=([^/]+)\\.(\\d+)(/(.*/)?[^/^.]+)/?$" \
>>  -F"sling:internalRedirect=http://\$1:\$2\$3.html"; \
>>  http://localhost:/etc/map/http/no_extension
>>
>> For this to work, you need the current trunk of the jcr/resource module
>> installed.
>>
>> Hope this helps.
>>
>> Regards
>> Felix
>>   
> Unfortunately I didn't get it to work after building from the current
> trunk, but I found I was able to basically get the desired result by
> creating a node called index under the node "mynode". The url
> http://www.mydomain.com/mynode would return a html page based on the
> properties in the index node. I may revisit this later as I think the
> solution you mentioned might be cleaner for my purposes, but the index
> solution is good enough for now. Thanks for the help!

Ok, thanks for the feedback.

Regards
Felix


can't locate pax-web-service

hello - mvn can't seem to find pax-web-service anywhere. any ideas?

jason


JSP vs GWT

is it possible to use a GWT frontend for sling?


Re: can't locate pax-web-service

Hi Jason,


Jason Pratt schrieb:
> hello - mvn can't seem to find pax-web-service anywhere. any ideas?

This artifact is not available from the central maven repository but
from the OPS4J repository.

The Sling launchpad/app module is set up to find the artifact correctly.
If you need it in your own module, you might want to add the following
repository definition to your pom.xml:


OPS4J
OPS4J Repository
http://repository.ops4j.org/maven2

true


false



HTH

Regards
Felix


Re: JSP vs GWT

Hi Jason,

Jason Pratt schrieb:
> is it possible to use a GWT frontend for sling?

Yes, there are two GWT modules in the Sling project inside the
extensions/gwt folder: The servlet module provides the basic Server Side
infrastructure and is required. The sample module is a sample GWT form.

HTH

Regards
Felix


Re: unit test failing

Hi,

Jason Pratt schrieb:
> hello - i am getting the following failure while trying to build from the
> trunk root
> 
> Tests in error:
> 
> testSingleResourceDetection(org.apache.sling.jcr.jcrinstall.jcr.impl.ResourceDetectionTest)
> 
> testMultipleResourcesWithException(org.apache.sling.jcr.jcrinstall.jcr.impl.ResourceDetectionTest)
> 
> what do i need to do to correct this?

Hmm, the last time I checked, they did run on my box.

Would it be possible to get the test results, best in a JIRA issue. Thanks.

Regards
Felix


Re: direct script execution



On 6 Jan 2009, at 07:19, Felix Meschberger wrote:


Hi Torgeir,

Torgeir Veimo schrieb:
Is it possible to request a script directly, eg. use a request such  
as

/apps/notes/html.esp, and make that script execute instead of being
returned as plaintext?


This is not currently possible (though the implementation would be
rather simple).

The problem is that we also support WebDAV on "/" through the Sling
WebDAV bundle. So, for WebDAV we might want to expect the script to be
returned as plaintext to be able to edit and modify it.

I could imagine two options: (1) we add a configuration setting, which
controls whether scripts are executed or not or (2) add a servlet to
handle a special extension, which would execute the script. I would
prefer this second option.



Maybe it could be possible to set a resource type, sling:Script on  
these, to allow execution? They could be edited if accessed through  
the /dav/ prefix.


--
Torgeir Veimo
torg...@pobox.com






How can I use a jar to run sling

HI:
   
  As I remembered , in the launchpad app project.
I can run a sling demo only with a jar (with java -jar command ), to my 
surprise the latest versioin can't work well.

  Now I want to do it too , which jar can I use?
Has the architecture been changed in the launchpad?

2009-01-06 


yanjie 


Re: How can I use a jar to run sling

I am able to run sling lunchpad app by following example below
http://incubator.apache.org/sling/site/getting-and-building-sling.html
 
set JAVA_HOME=C:\jdk
set PATH=%JAVA_HOME%\bin
set M2_HOME=C:\maven
set PATH=%M2_HOME%\bin
set MAVEN_OPTS=-Xmx256m

cd /sling
mvn clean install
 
I have notice that sometimes the jcrapp jar does not build, unless you
 
cd /sling/launchpad/jcrapp
mvn clean install
 
then when the build is done
 
Java -jar target/org.apache.sling.launchpad.jcrapp-2.0.0-incubator-SNAPSHOT.jar 
-c sling -f -
 
this should work 
Cheers

Ransford Segu-Baffoe

paks...@yahoo.com

http://www.noqmx.com/
https://serenade.dev.java.net/

--- On Mon, 1/5/09, yanshaozhiGmail  wrote:

From: yanshaozhiGmail 
Subject: How can I use a jar to run sling
To: "sling-dev@incubator.apache.org" 
Date: Monday, January 5, 2009, 8:34 PM

HI:
   
  As I remembered , in the launchpad app project.
I can run a sling demo only with a jar (with java -jar command ), to my
surprise the latest versioin can't work well.

  Now I want to do it too , which jar can I use?
Has the architecture been changed in the launchpad?

2009-01-06 


yanjie 



  

Re: How can I use a jar to run sling

correction in the previous example is 
 
cd /sling/launchpad/app

Ransford Segu-Baffoe

paks...@yahoo.com

http://www.noqmx.com/
https://serenade.dev.java.net/

--- On Mon, 1/5/09, yanshaozhiGmail  wrote:

From: yanshaozhiGmail 
Subject: How can I use a jar to run sling
To: "sling-dev@incubator.apache.org" 
Date: Monday, January 5, 2009, 8:34 PM

HI:
   
  As I remembered , in the launchpad app project.
I can run a sling demo only with a jar (with java -jar command ), to my
surprise the latest versioin can't work well.

  Now I want to do it too , which jar can I use?
Has the architecture been changed in the launchpad?

2009-01-06 


yanjie