RE: [VOTE] Release Commons Testing 2.0.6, OSGi Installer 3.0.0, JCR Installer 3.0.0, and File Installer 1.0.0

2010-09-16 Thread Stefan Seifert

Don't know if this is just me, but I'm getting reports on bad
signatures for all artifacts:

i've tested it on a linux machine and got GOOD results for the md5 and sha1 
hashes, BAD only for pgp
(although i've scanned the results only briefly and deleted them already)

stefan


RE: sideeffects of ResourceResolver.map method

2010-12-16 Thread Stefan Seifert

Well, the map methods are intended to be the reverse to the resolve
methods (and vice versa). As such the namespace mangling is a required
part of the operation.

If there is a concrete case of wrong URL encoding/externalizing, please
report a JIRA issue such that we can fix this.

i've created an issue
https://issues.apache.org/jira/browse/SLING-1899

with a unit test that reproduces the problem and a patch proposal.
still, this is a change that breaks backward-compatibility if used with paths 
with special chars in it.


 besides this, it would be helpful if the namespace mangling code could be
called from outside as well, e.g. JcrResourceUtil class.

Well, namespace mangling is a simple application of a regexp
search/replace.

IMHO we can expose this as a utility method. But what is your use case
for that ?

yes, basically you're right.
we've two usecases for it, but they count only partially: a mock implementation 
of the jcrresourceresolver to run in our standalone unit tests in-memory, which 
has to reproduce the functionality from the real implementation. and one 
special other usecase where we have to bypass the map method because of invalid 
results method and escape the namespaces ourself, we've not did a deep research 
yet if the reason was a bug in sling our in our application usecase. consider 
this which than as rather cosmetic.

stefan


RE: release of fsresource bundle?

2010-02-19 Thread Stefan Seifert
i tested it in two different project environments - it works as expected!

stefan

-Original Message-
From: Carsten Ziegeler [mailto:cziege...@apache.org]
Sent: Friday, February 19, 2010 11:46 AM
To: dev@sling.apache.org
Subject: Re: release of fsresource bundle?

Hi Stefan,

I added SLING-1387 in trunk; maybe you could give it a test drive and I
will do the release early next week then.

Regards
Carsten


RE: [VOTE] Release Commons MIME type support 2.1.4, Eventing 2.3, File System Provider 1.0, and Scripting Core 2.0.10

2010-02-23 Thread Stefan Seifert
Apache Sling File System Provider 1.0.0
https://issues.apache.org/jira/browse/SLING/fixforversion/12314388
Several fixes

+1 (non-binding)


RE: [OT] Support Confluence Wiki Syntax in issue comments

2012-05-31 Thread Stefan Seifert
+1

stefan

-Original Message-
From: Felix Meschberger [mailto:fmesc...@adobe.com]
Sent: Thursday, May 31, 2012 11:40 AM
To: dev@sling.apache.org
Subject: [OT] Support Confluence Wiki Syntax in issue comments

Hi,

We can configure the SLING JIRA project to support the Confluence Wiki syntax
for issue comments. This would help creating lists and other formatting.

How about doing that ?

Regards
Felix


RE: [Tooling] Experimental Plugin for Eclipse for Sling aka Slingclipse

2012-10-25 Thread Stefan Seifert
hello antonio.

this sounds interesting!

what is the difference to the filesystem resource provider with which you can 
mount any folder in the filesystem to a JCR tree? the filesystem resource 
provider currently only supports nt:file and nt:folder nodes, but works very 
well for those (e.g. jsp, css, javascript files).

if i find some time i planned to improve the filesystem resource provider to 
support other JCR content structures stored in JSON files in the file system as 
well. this would be independent from any IDE and its plugin system.

stefan

-Original Message-
From: Antonio Sanso [mailto:asa...@adobe.com]
Sent: Thursday, October 25, 2012 2:34 PM
To: dev@sling.apache.org
Subject: [Tooling] Experimental Plugin for Eclipse for Sling aka Slingclipse

Hi *,

I have started to work on an experimental plugin for Eclipse for Sling named
(at least for now :)) Slingclipse, see [0].

Slingclipse is an attempt to make easier the development phase while using
Sling.
The scope is still open and I would be more than glad to hear some
feedbacks/ideas.

What I have committed for now are 3 plugins/bundles:

- org.apache.sling.slingclipse
- org.apache.sling.slingclipse.api
- org.apache.sling.slingclipse.http

The idea implemented for now is that at any save (this is configurable) the
correspondent action will be transmitted in the repository (only if if
this is in a project with a path name for the file that contains jcr_root to
be precise).
The actions implemented for now are:

- create a  new file: the file is created also in the repository (if the file
is not empty, is a bug)
- change the content of a file: the file is modified in the repository
- delete a file: the file is deleted in the repository

The trigger is the save action in Eclipse.
At the moment there is not support for any jcr type other than nt:file (but
this is going to improve).
Another important thing  to highlight for the moment is the way this
information is transmitted from the file system to the repository.
Slingclipse uses Declarative Service and the implemented solution uses HTTP
for now (org.apache.sling.slingclipse.http bundle).
Should somebody else would like to use some other way to achieve the same
result is enough to create another bundle implementing the api contained in
the  org.apache.sling.slingclipse.api bundle,

I would try to create some basic documentation somewhere in the wiki soon

Regards

Antonio

[0] http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/



RE: Resource merging and symlinks - two similar patches, do we unify?

2013-10-11 Thread Stefan Seifert
On Fri, Sep 27, 2013 at 11:59 AM, Carsten Ziegeler
cziege...@apache.org wrote:
 ...Not quite the same - but we might be able to share code /
functionality...

Yeah that's my main concern: the merging/overriding logic should use
the same code.

-Bertrand

yes, i think this is a good thought as well.
i will start playing with this idea in context of 
https://issues.apache.org/jira/browse/SLING-1778 in a separate github 
repository and check if it is feels good or not.
currently i'm unsure where such a shared piece of merging code should be 
placed within sling, but this can be decided later.

stefan



failure running sling.extensions.event unit/integraiton tests on windows?

2013-10-15 Thread Stefan Seifert
running win7 64bit, java 1.7.0_17, maven 3.0.5

any idea why this integration tests for sling event module fails when building 
with mvn clean install?
i assume they run on other platforms?


Results :

Tests in error:
  testHistory(org.apache.sling.event.it.HistoryTest): test timed out after 
30 milliseconds

Tests run: 18, Failures: 0, Errors: 1, Skipped: 0


the other integration tests are running, but take quite a lot of time to 
complete.

stefan


RE: failure running sling.extensions.event unit/integraiton tests on windows?

2013-10-16 Thread Stefan Seifert
strange. i tried to isolate the problem by disabling all integration tests by 
added junit @Ignore annotation to them.
the HistoryTest IT runs then fine.
i startet adding/removing more integration tests and sometims it succeeds, 
sometimes not. perhaps a racing condition, or a cleanup issue of the 
integration tests.

if it fails it takes a long time executing this step Starting job queue test:

...
16.10.2013 13:23:27.352 *INFO* [Thread-102] 
org.apache.sling.event.impl.jobs.TopologyCapabilities Detected capabilities of 
86db438e-86fa-43b2-85c2-62d22a12db6b : 
/,sling/test/history,sling/webconsole/test
16.10.2013 13:23:27.352 *INFO* [Thread-102] 
PAXEXAM-PROBE-914abd18-50d6-448f-82ca-29f27441a4cc Service [99] ServiceEvent 
REGISTERED
16.10.2013 13:23:29.342 *INFO* [Apache Sling Job Background Loader] 
org.apache.sling.event Service [QueueMBean for queue test,100] ServiceEvent 
REGISTERED
16.10.2013 13:23:29.342 *INFO* [Apache Sling Job Queue test] 
org.apache.sling.event.impl.jobs.queues.OrderedJobQueue.test Starting job queue 
test

 it hangs here for several minutes 

16.10.2013 13:28:27.364 *INFO* [CM Event Dispatcher (Fire ConfigurationEvent: 
pid=org.apache.sling.event.jobs.QueueConfiguration.2be31a75-f846-4e17-a1b9-8482c5fcaed2)]
 org.apache.sling.event Service 
[org.apache.sling.event.jobs.QueueConfiguration.2be31a75-f846-4e17-a1b9-8482c5fcaed2,98]
 ServiceEvent UNREGISTERING
16.10.2013 13:28:27.364 *INFO* [main] 
PAXEXAM-PROBE-914abd18-50d6-448f-82ca-29f27441a4cc BundleEvent STOPPING
16.10.2013 13:28:27.364 *INFO* [main] 
PAXEXAM-PROBE-914abd18-50d6-448f-82ca-29f27441a4cc Service [73] ServiceEvent 
UNREGISTERING
...

the failsafe report contains only this:

---
Test set: org.apache.sling.event.it.HistoryTest
---
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 305.173 sec  
FAILURE!
testHistory(org.apache.sling.event.it.HistoryTest)  Time elapsed: 305.163 sec  
 ERROR!
java.lang.Exception: test timed out after 30 milliseconds
at java.lang.Thread.sleep(Native Method)
at 
org.apache.sling.event.it.AbstractJobHandlingTest.sleep(AbstractJobHandlingTest.java:160)
at 
org.apache.sling.event.it.HistoryTest.testHistory(HistoryTest.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at 
org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)


stefan

-Original Message-
From: Carsten Ziegeler [mailto:cziege...@apache.org]
Sent: Wednesday, October 16, 2013 12:08 PM
To: dev@sling.apache.org
Subject: Re: failure running sling.extensions.event unit/integraiton
tests on windows?

Hi,

the tests run fine on my machine - it seems that in your case the loop
waits forever to get 10 finished jobs in the history.
Do you see any exception in the log output?

Carsten


RE: failure running sling.extensions.event unit/integraiton tests on windows?

2013-10-16 Thread Stefan Seifert
i was able to reproduce it in 2 of 3 tries with only two integration tests 
activated:
- ClassloadingTest
- HistoryTest

running historytest or ClassloadingTest standalone worked.
running both (i assume ClassloadingTest did run first) did not work in 2 of 3 
tries.

stefan

-Original Message-
From: Carsten Ziegeler [mailto:cziege...@apache.org]
Sent: Wednesday, October 16, 2013 4:50 PM
To: dev@sling.apache.org
Subject: Re: failure running sling.extensions.event unit/integraiton
tests on windows?

Yes, it seems to hang at that point as it doesn't get any jobs - I
guess
the difference between windows and other machines is the order in
which
test cases are executed. So it must be some previous test which does
not
clean up correctly. Can you please find out from the logs which tests
are
run before the HistoryTest?

Carsten


RE: [VOTE] Release Apache Sling Models API 1.0.2 Implementation 1.0.6

2014-06-27 Thread Stefan Seifert
+1 (non-binding)

p.s. integration tests are running fine on my machine


-Original Message-
From: justinedel...@gmail.com [mailto:justinedel...@gmail.com] On Behalf Of
Justin Edelson
Sent: Wednesday, June 25, 2014 6:02 PM
To: dev@sling.apache.org
Subject: [VOTE] Release Apache Sling Models API 1.0.2  Implementation 1.0.6

Hi,

We solved 9 issues in these releases:
https://issues.apache.org/jira/browse/SLING/fixforversion/12326850
https://issues.apache.org/jira/browse/SLING/fixforversion/12327153

Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-1070/

You can use this UNIX script to download the release and verify the
signatures:
http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

Usage:
sh check_staged_release.sh 1070 /tmp/sling-staging

Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

This majority vote is open for at least 72 hours.


release of fsresource bundle?

2014-06-30 Thread Stefan Seifert
can we make a new release of the fsresource bundle?

in rev. 1510565 the dependencies to the sling api bundle were relaxed which is 
important to run this bundle with the latest version of sling.

stefan



[RT] Sling Models as scoped Dependency Injection Framework

2014-06-30 Thread Stefan Seifert
in the last days we played around with Sling Models as underpinning of our 
views in a Sling+Sightly based application. it works fantastic. but during our 
experiments we detected that we were not using Sling Models for accessing 
resource content, i.e. we are not adapting resources to models to access its 
data. this is not required when using JSP or Sightly because you can access the 
properties directly. but we were using Sling Models as Dependency Injection 
frameworks for our java controller classes which are used behind the views, 
which need access to scoped objects of the current request like resource 
resolver and others. and if those controller classes need other business 
classes which depend on scope objects, we use Sling Models injection for them 
as well.

a very simple example for illustration:

this is a controller class behind the view:

@Model(adaptables = SlingHttpServletRequest.class)
public class MyController {

  @Inject
  private MyBusinessClass businessClass;

  private String result;

  @PostConstruct
  protected void activate() {
result = this.businessClass.calculateTheResult();
  }

  public String getResult() {
return this.result;
  }

}

and this is the business classes used by the controller

@Model(adaptables = SlingHttpServletRequest.class)
public class MyBusinessClass {

  @Inject
  private ResourceResolver resourceResolver;

  public String calculateTheResult() {
// access resources using resource resolver
return myResult;
  }

}

effectively we can use Sling Models to navigate through a hierarchy of loose 
coupled POJOs all using DI for getting the dependencies they need - much like 
in Spring. we have already dependency injection in Felix SCR/OSGi? that's 
right, but only for OSGi services, and not for scoped objects depending on a 
current request or resource resolver instance.

using the adapter concept to adapt the controller and business classes from the 
scope object they depend on (e.g. from SlingHttpServletRequest for request 
scope, from ResourceResolver if they need access to resources in context of a 
JCR user session etc.) they get all scope context objects they need, and those 
that can be adapted from them. and of course it's still possible to inject OSGi 
services as well.

out of the box the sample displayed above will not work with Sling Models - a 
small custom injector is required:

@Component
@Service
@Property(name = Constants.SERVICE_RANKING, intValue = 50)
public class SelfAdaptInjector implements Injector {

  public String getName() {
return selfadapt;
  }

  public Object getValue(Object pAdaptable, String pName, Type pType, 
AnnotatedElement pElement, DisposalCallbackRegistry pCallbackRegistry) {
if (!(pType instanceof Class)) {
  return null;
}
if (!(pAdaptable instanceof Adaptable)) {
  return null;
}
return ((Adaptable)pAdaptable).adaptTo((Class?)pType);
  }

}

which effectively supports navigation through a graph of objects which share 
the same scope adaptable. using another custom injector which allows indirect 
adaption from SlingHttpServletRequest-ResourceResolver-CustomClass it is 
possible to have classes that can be used both in request scope, and in 
ResourceResolver-only scope as well (the latter may be a resource resolver 
instance which is opened in context of an OSGi service or event handler). this 
is already possible via via, but i want to avoid boilerplate code as much as 
possible for much-used context objects.

additionally all relevant context objects that can be derived from the 
adaptable should be supported for injection. Justin already added in SLING-3700 
as custom injector for resource resolver, but it should support others as well, 
e.g. injecting the request, the response etc. and in my opinion this should be 
done primary using detection by class type, not by property name (this can be 
controlled already by injector ordering and custom injectors).

if Sling is running in other context like AEM an AEM specific injector can 
ensure that AEM-typical context objects are available as well (again Justin has 
an example for this in AEM commons, although based on property names and not on 
class types).

to be even more Spring-like and support developers with Spring background it 
would be nice to support other Spring-typical features as well, e.g. 
constructor dependency injection (currently only supported for the adaptable 
itself) and JSR-250 @PreDestroy annotation. all this should not be an big 
issue, because most infrastructure is already there in the current codebase.

is it worth to make this a core feature for Sling Models, and propagate it in 
documentation etc.?

WDYT?

stefan


RE: [RT] Sling Models as scoped Dependency Injection Framework

2014-06-30 Thread Stefan Seifert
ok, i've touched multiple different topics in my post, i created 4 ticket for 
each of them so we can discuss them further separately:
https://issues.apache.org/jira/browse/SLING-3715
https://issues.apache.org/jira/browse/SLING-3716
https://issues.apache.org/jira/browse/SLING-3718
https://issues.apache.org/jira/browse/SLING-3718

stefan


-Original Message-
From: justinedel...@gmail.com [mailto:justinedel...@gmail.com] On Behalf Of
Justin Edelson
Sent: Monday, June 30, 2014 6:16 PM
To: dev@sling.apache.org
Subject: Re: [RT] Sling Models as scoped Dependency Injection Framework

Hi Stefan,
The big problem IMHO with injecting by class vs. name is that by class
is too ambigious in many cases. For example, in AEM, it is relatively
common to want to inject a Page object, but in fact there are two
different page objects which come into play (currentPage and
resourcePage) and getting the wrong one could be highly problematic.
You are correct that things like the request and response could
presumably be injected by class rather than by name, but the question
then becomes how do we judge these cases? In my opinion, the bindings
names are sensible. I personally don't find myself wanting to write
this very often:

@Inject
private SlingHttpServletRequest somenameOtherThanRequest;

The self injector is interesting. I held off on that initially because
it seems too easy to create a circular injection. Any thoughts on how
that can be avoided?

I'm certainly open to patches which broaden the scope for constructor
injection and @PreDestroy.

Regards,
Justin

On Mon, Jun 30, 2014 at 10:13 AM, Stefan Seifert sseif...@pro-vision.de
wrote:
 in the last days we played around with Sling Models as underpinning of our
views in a Sling+Sightly based application. it works fantastic. but during our
experiments we detected that we were not using Sling Models for accessing
resource content, i.e. we are not adapting resources to models to access its
data. this is not required when using JSP or Sightly because you can access
the properties directly. but we were using Sling Models as Dependency
Injection frameworks for our java controller classes which are used behind the
views, which need access to scoped objects of the current request like
resource resolver and others. and if those controller classes need other
business classes which depend on scope objects, we use Sling Models injection
for them as well.

 a very simple example for illustration:

 this is a controller class behind the view:

 @Model(adaptables = SlingHttpServletRequest.class)
 public class MyController {

   @Inject
   private MyBusinessClass businessClass;

   private String result;

   @PostConstruct
   protected void activate() {
 result = this.businessClass.calculateTheResult();
   }

   public String getResult() {
 return this.result;
   }

 }

 and this is the business classes used by the controller

 @Model(adaptables = SlingHttpServletRequest.class)
 public class MyBusinessClass {

   @Inject
   private ResourceResolver resourceResolver;

   public String calculateTheResult() {
 // access resources using resource resolver
 return myResult;
   }

 }

 effectively we can use Sling Models to navigate through a hierarchy of loose
coupled POJOs all using DI for getting the dependencies they need - much like
in Spring. we have already dependency injection in Felix SCR/OSGi? that's
right, but only for OSGi services, and not for scoped objects depending on a
current request or resource resolver instance.

 using the adapter concept to adapt the controller and business classes from
the scope object they depend on (e.g. from SlingHttpServletRequest for request
scope, from ResourceResolver if they need access to resources in context of a
JCR user session etc.) they get all scope context objects they need, and those
that can be adapted from them. and of course it's still possible to inject
OSGi services as well.

 out of the box the sample displayed above will not work with Sling Models -
a small custom injector is required:

 @Component
 @Service
 @Property(name = Constants.SERVICE_RANKING, intValue = 50)
 public class SelfAdaptInjector implements Injector {

   public String getName() {
 return selfadapt;
   }

   public Object getValue(Object pAdaptable, String pName, Type pType,
AnnotatedElement pElement, DisposalCallbackRegistry pCallbackRegistry) {
 if (!(pType instanceof Class)) {
   return null;
 }
 if (!(pAdaptable instanceof Adaptable)) {
   return null;
 }
 return ((Adaptable)pAdaptable).adaptTo((Class?)pType);
   }

 }

 which effectively supports navigation through a graph of objects which share
the same scope adaptable. using another custom injector which allows indirect
adaption from SlingHttpServletRequest-ResourceResolver-CustomClass it is
possible to have classes that can be used both in request scope, and in
ResourceResolver-only scope as well (the latter may be a resource resolver
instance which

RE: adaptTo and results ....

2014-07-01 Thread Stefan Seifert
 Foo f = someObject.adaptTo(RequireAdapterFoo.class));

this would still require an unwrapping of the object out of the 
RequireAdapterFoo instance.

 Foo f = someObject.adaptTo(RequireAdapter.for(Foo.class));

this looks interesting, and does not need unwrapping if the return value is the 
input class.
i assume it could be implemented using a ThreadLocal or similar as well?

stefan


-Original Message-
From: Konrad Windszus [mailto:konra...@gmx.de]
Sent: Tuesday, July 01, 2014 11:58 AM
To: dev@sling.apache.org
Cc: Bertrand Delacretaz
Subject: Re: adaptTo and results 

I like that approach. It is backwards-compatible and allows the developers to
decide whether they want to check for null or to rely on exceptions.
The AdapterManagerImpl indeed would need to deal with such a parametrisation
and in addition the javadocs would need to be adjusted to make it clear that
AdapterFactories may throw RuntimeExceptions.
Those exceptions should be caught by the AdapterManagerImpl when the
RequireAdapter was not requested and in the other case just passed along.


On 01 Jul 2014, at 09:44, Bertrand Delacretaz bdelacre...@apache.org wrote:

 On Tue, Jul 1, 2014 at 9:41 AM, Bertrand Delacretaz
 bdelacre...@apache.org wrote:
 ...how about this:

  Foo f = someObject.adaptTo(RequireAdapter.for(Foo.class));

 Actually, rereading SLING-3714, this can be made simpler with generics

  Foo f = someObject.adaptTo(RequireAdapterFoo.class));

 where RequireAdapter causes AdapterManagerImpl to wrap the adapters to
 throw an exception if adaption returns null.

 -Bertrand



RE: adaptTo and results ....

2014-07-01 Thread Stefan Seifert
example: usecase like here
https://issues.apache.org/jira/browse/SLING-3714?focusedCommentId=14048040#comment-14048040

the caller code expects that the adaption is always successful if everything 
works correct - if not it is an application error which should be propagated 
through error handling and result in an error log message.

stefan


-Original Message-
From: Carsten Ziegeler [mailto:cziege...@apache.org]
Sent: Tuesday, July 01, 2014 12:14 PM
To: dev@sling.apache.org
Subject: Re: adaptTo and results 

So if your adapter is buggy and you get an exception, what do you do with
it?

Carsten


2014-07-01 12:08 GMT+02:00 Jeff Young j...@adobe.com:

 Hi Carsten,

 Sure, but Konrad has a point in that I think sometimes the client *does*
 care why the adaption failed.  For instance, if it had to do with
 something entirely different from whether or not adaption would normally
 work.

 Let's say that I have a resource that should adapt to XYZ, but that my
 adapter is currently buggy.  I'd like to get an exception for that, but
 said exception is going to get eaten.

 I do agree that if I have a resource that should NOT adapt to XYZ, that
 getting back null is fine, and that I don't care why the adaption failed.

 Cheers,
 Jeff.


 On 01/07/2014 10:19, Carsten Ziegeler cziege...@apache.org wrote:

 Sure :) For the adapter pattern, the client does not care why the adaption
 failed, the client is just interested in the result (success or not)
 Validation is a different beast, if validation fails you want to know
 specific reasons why it failed - and this can be multiple.
 I tried to explain in my first mail on this thread, that all other use
 cases mentioned can be handled with the current implementation - with the
 exception of validation. But I think validation requires a different
 concept than the adapter pattern.
 
 Carsten
 
 
 2014-07-01 11:09 GMT+02:00 Jeff Young j...@adobe.com:
 
  Hi Carsten,
 
  Can you say more?  (I'm not sure I understand what you're getting
 at)
 
  Thanks,
  Jeff.
 
 
  On 01/07/2014 09:56, Carsten Ziegeler cziege...@apache.org wrote:
 
  adaption and validation are different concerns
  
  Carsten
  
  
  2014-07-01 10:55 GMT+02:00 Jeff Young j...@adobe.com:
  
   We could solve that by defining a specific exception for
   adaptation-not-possible and then catch only that.
  
   Of course that would leak tons of exceptions from code written before
  that
   exception became available.  Maybe do the catching based on some
 sort of
   version clue?
  
   Cheers,
   Jeff.
  
  
   On 01/07/2014 09:40, Konrad Windszus konra...@gmx.de wrote:
  
   It is not (only) about throwing exceptions in case no suitable
 adapter
  is
   available. It rather is about the fact, that today the adaptTo is a
   barrier for all kinds of exceptions. In some cases the adaptation
 fails
   for a specific reason (one example is Sling Models where injection
  fails,
   another one is the issue mentioned in
   https://issues.apache.org/jira/browse/SLING-2712 (ValueMap not
  supporting
   primitives)). Both would be valid use cases where the client would
 be
   interested to catch the exception here.
   
   On 01 Jul 2014, at 10:34, Carsten Ziegeler cziege...@apache.org
  wrote:
   
Adding a new interface would require us to implement it all over
 the
   place
and as Felix points out, client code would always need to check
  whether
   the
new interface is implemented or not Having to methods, like
  hasAdapter
   and
adaptOrThrow does not work very well as between the two calls
 things
   might
have changed already: while hasAdapter returns true, the
 underlying
   factory
gets unregistered before adaptOrThrow is called.
In many use cases, the current pattern works fine - the client
 does
  not
care whether an exception is thrown within the adaption - it just
  cares
whether an object is returned or not. And there are valid use
 cases,
   where
client code does different things whether the adaption works or
 not
   (e.g.
the post servlet checks for adaptTo(Node) and then does additional
   things
if the resource is backed up by a node.)
   
I see the point that there are also use cases where it would be
 fine
  to
simpy throw an exception if adaptTo is not successful. This would
  make
   the
client code easier. However as this most properly is a runtime
   exception,
client code can today just call a method on the object and end up
  with a
NPE - having the same result :)
   
This leaves us with use cases where the client code explicitely
  wants to
catch the exception and then do something depending on the
 exception.
   Maybe
we should just add something for this explicit use case instead of
   bloating
the general adaptTo mechanism?
   
Regards
Carsten
   
   
   
   
2014-07-01 9:44 GMT+02:00 Konrad Windszus konra...@gmx.de:
   
Regarding 1) Having such a Result class would mean that all
 

RE: adaptTo and results ....

2014-07-01 Thread Stefan Seifert
the NPE would swallow all maybe usefull excpetion information, that might be 
contained in the root cause of the exception throws by a method like 
adaptToOrThrow method. always logging the exception internally by the adapter 
manager has the drawback that the application might not be interested in the 
failure and does not want to log it. the decision whether a adaption failure is 
relevant or not should be taken by the application.

I'm not convinced that a new interface and a adaptToOrThrow is the best 
solution either - but lets start to convince ourselves that it is a relevant 
usecase to have (optional, but with full error information) exception handling 
on an adaptTo call, whatever solution we find to add this without a big mess in 
the interface design. bertrand opened an interesting discussion on alternatives.

stefan

-Original Message-
From: Carsten Ziegeler [mailto:cziege...@apache.org]
Sent: Tuesday, July 01, 2014 12:21 PM
To: dev@sling.apache.org
Subject: Re: adaptTo and results 

Yes, but right now you would get an NPE accessing the object - so you
already have a runtime exception and don't need to check for null (I'm not
arguing that this is a good way, I'm just trying to avoid heavy changes).
And we could change the adapter manager/factory implemntation to log the
exceptions (if they're not doing it already)

Carsten


2014-07-01 12:17 GMT+02:00 Stefan Seifert sseif...@pro-vision.de:

 example: usecase like here

 https://issues.apache.org/jira/browse/SLING-
3714?focusedCommentId=14048040#comment-14048040

 the caller code expects that the adaption is always successful if
 everything works correct - if not it is an application error which should
 be propagated through error handling and result in an error log message.

 stefan


 -Original Message-
 From: Carsten Ziegeler [mailto:cziege...@apache.org]
 Sent: Tuesday, July 01, 2014 12:14 PM
 To: dev@sling.apache.org
 Subject: Re: adaptTo and results 
 
 So if your adapter is buggy and you get an exception, what do you do with
 it?
 
 Carsten
 
 
 2014-07-01 12:08 GMT+02:00 Jeff Young j...@adobe.com:
 
  Hi Carsten,
 
  Sure, but Konrad has a point in that I think sometimes the client *does*
  care why the adaption failed.  For instance, if it had to do with
  something entirely different from whether or not adaption would normally
  work.
 
  Let's say that I have a resource that should adapt to XYZ, but that my
  adapter is currently buggy.  I'd like to get an exception for that, but
  said exception is going to get eaten.
 
  I do agree that if I have a resource that should NOT adapt to XYZ, that
  getting back null is fine, and that I don't care why the adaption
 failed.
 
  Cheers,
  Jeff.
 
 
  On 01/07/2014 10:19, Carsten Ziegeler cziege...@apache.org wrote:
 
  Sure :) For the adapter pattern, the client does not care why the
 adaption
  failed, the client is just interested in the result (success or not)
  Validation is a different beast, if validation fails you want to know
  specific reasons why it failed - and this can be multiple.
  I tried to explain in my first mail on this thread, that all other use
  cases mentioned can be handled with the current implementation - with
 the
  exception of validation. But I think validation requires a different
  concept than the adapter pattern.
  
  Carsten
  
  
  2014-07-01 11:09 GMT+02:00 Jeff Young j...@adobe.com:
  
   Hi Carsten,
  
   Can you say more?  (I'm not sure I understand what you're getting
  at)
  
   Thanks,
   Jeff.
  
  
   On 01/07/2014 09:56, Carsten Ziegeler cziege...@apache.org
 wrote:
  
   adaption and validation are different concerns
   
   Carsten
   
   
   2014-07-01 10:55 GMT+02:00 Jeff Young j...@adobe.com:
   
We could solve that by defining a specific exception for
adaptation-not-possible and then catch only that.
   
Of course that would leak tons of exceptions from code written
 before
   that
exception became available.  Maybe do the catching based on some
  sort of
version clue?
   
Cheers,
Jeff.
   
   
On 01/07/2014 09:40, Konrad Windszus konra...@gmx.de wrote:
   
It is not (only) about throwing exceptions in case no suitable
  adapter
   is
available. It rather is about the fact, that today the adaptTo
 is a
barrier for all kinds of exceptions. In some cases the adaptation
  fails
for a specific reason (one example is Sling Models where
 injection
   fails,
another one is the issue mentioned in
https://issues.apache.org/jira/browse/SLING-2712 (ValueMap not
   supporting
primitives)). Both would be valid use cases where the client
 would
  be
interested to catch the exception here.

On 01 Jul 2014, at 10:34, Carsten Ziegeler cziege...@apache.org
 
   wrote:

 Adding a new interface would require us to implement it all
 over
  the
place
 and as Felix points out, client code would always need to check
   whether
the
 new

RE: adaptTo and results ....

2014-07-02 Thread Stefan Seifert

The example Stefan gave [1] is just about removing the boilerplate of the null
check + throwing a runtime exception, which could be handled using a static
utility method (adaptOrThrow, but outside the adaptable interface). 

yes, you are right - this would be an alternative for this simple usecase with 
the null-check.

stefan


RE: adaptTo and results ....

2014-07-03 Thread Stefan Seifert

* My original suggestion of using a Result interface. This requires
more verbose code on the caller side -- the caller needs to check a
success flag -- but allows for fine-grained information (which would
be appropriate for a validation use case).

+1

https://issues.apache.org/jira/browse/SLING-3714

and following alex hint it is still possible to use separate static method to 
convert this result object adaption call into a single-line adaptOrThrow 
method with throws a runtime exception, without having to build this into the 
adaptto API. for projects that use this a lot.

stefan


RE: [RT] Multi Tenancy

2014-08-11 Thread Stefan Seifert
hello carsten.

thanks for bringing this up. multi-tenancy is very important for our projects. 
but to be honest, until now i did not see that any of the current tenant api 
implementation [2] is of much use for user usecases.

let's start with the detecting of a tenant:

* if adapting from a resource resolver, detection by user is done. but this 
implies that every user is exactly assigned to one tenant, which is - at least 
in our projects - not always the case. there are always users that have access 
to multiple tenants, controlled via ACLs. so this is not a 1:1 relation, but a 
1-to-many relation.

* if adapting from a resource a path-based detection is used. here i do not 
fully understand which path is meant - the path to the content of the tenant 
(e.g. /content/*), or the path to custom scripts used in script resolution 
(comparable to /apps/*). i do not get the distinction from your RT as well - 
you refer only to the script resolution part. but if adapting from a resource, 
this is usually a content resource, not a resource pointing to a script.
in my opinion both is relevant - to be able to connect one or multiple subtrees 
in the content resource hierarchy with a specific tenant, and to allow to 
provide tenant-specific script overlays.
in a 1:1 releation user-tenant the content dependency could be modeled via 
ACLs, but if you have one user that can access multiple tenants this does not 
work.

besides this for our usecases the option to provide tenant-specific script 
resources has no high prio. much more importance is the possibility to create 
tenant-specific configuration. this may apply OSGi services, which currently 
support only one global configuration (ore one per runmode combination). on the 
other side this applies to other application-specific business logic which 
should behave differently from site to site or from tenant to tenant.

btw. we should perhaps first start to define what we mean with the term 
tenant. this much-used and overloaded term might be a source of confusion as 
well. in my view a tenant is in its smallest form e.g. one site (homepage and 
all content pages below), perhaps plus a separate area for media assets. but a 
tenant can also be a huge entity consisting of a lot of sites and other 
content. because even for a huge tenant there might be the need for different 
configuration for different sites/areas of the content we are currently 
thinking if we even need support for nested tenants, which allow a 
configuration parameter inheritance between the inner and outer tenants, up to 
the global level of OSGi configurations.

for the configuration topic perhaps a separate RT should be started, but it's 
closely related to a tenant concept.

stefan



-Original Message-
From: Carsten Ziegeler [mailto:cziege...@apache.org]
Sent: Monday, August 11, 2014 1:18 PM
To: dev@sling.apache.org
Subject: [RT] Multi Tenancy

Hi,

we've seen a lot of different dicsussions over time wrt multi tenancy in
this list. In addition, there is the age old proposal at [1] and the tenant
module in [2] which superceeds parts of the proposal on the wiki
The current tenant module detects the tenant of a request either based on
the requested content path or the user home and provides this information
via an adapter factory for both, the resource resolver and a resource.
While this mechanism might not be sufficient, I think the key point here is
that you get the tenant by adapting the resource resolver - which actually
allows to do any detection being it path based, or based on the url, a
cookie whatever. In that sense, it seems that this design is sufficient.
When it comes to content, structuring content by tenant and using ACLs to
protect this seems to be sufficient as well.

Now, the tricky and yet unsolved part is resource and script resolution.
The idea outlined in [1] is imho obsolete because we now already have
tenant support.

I think we can add tenant support to resource resolving and script
resolution without any further api changes: both implementation can try to
adapt the resource resolver to a Tenant and then the resource resolver
implementation can use this extra information for lookups. The script
resolver uses the resource resolver anyway, the only thing needed to be
added there is that caching of script resolution should take the tenant
into account.

My suggestion is that, if the Tenant information is availabe, resource
resolving looks at three places. For example if foo/bar should be
resolved:

1. /tenants/{tenandId}/foo/bar
2. /apps/foo/bar
3. /libs/foo/bar

The first available will be used.

I think there is no need for several search paths per tenant or to make
this further configurable

WDYT?

Regards
Carsten


[1] https://cwiki.apache.org/confluence/display/SLING/Multitenancy+Support
[2] https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/tenant
--
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org


RE: [RT] Multi Tenancy

2014-08-11 Thread Stefan Seifert
when looking in the wiki i found another page [1] with some thoughts on multi 
tenancy from a mailing list discussion from february [2]

from this i get we have two quite different scenarios although they have a 
shared part:

* the fully isolated tenant scenario
- tenants are fully isolated and have their own script (overlay) path, own 
users, own i18n etc.
- as described in [1]
- the existing tenant implementation targets on this scenario as well, but does 
currently fulfill only part of the requirements from [1]

* the manage multiple tenants scenario
- a set of users (editors, admins etc.) manages a set of tenants with n-to-m 
relation between users and tenants
- providing script overlays and admin separation is not that important, but 
configuration and content separation

it think both scenarios can be handled with a single (flexible/customizable) 
implementation, but both have their own complexities not relevant for the 
other. so when starting a wiki page we have to respect both scenarios.

stefan

[1] 
https://cwiki.apache.org/confluence/display/SLING/Multitenancy+Support+Integration
[2] 
http://apache-sling.73963.n3.nabble.com/Tenant-Implementation-in-Sling-td4031217.html#none

-Original Message-
From: Bertrand Delacretaz [mailto:bdelacre...@apache.org]
Sent: Monday, August 11, 2014 3:32 PM
To: Bertrand Delacretaz
Cc: dev
Subject: Re: [RT] Multi Tenancy

On Mon, Aug 11, 2014 at 3:29 PM, Bertrand Delacretaz
bdelacre...@apache.org wrote:
 ...I suggest creating a page under
 https://cwiki.apache.org/confluence/display/SLING for multi-tenant use
 cases and definitions...

There's already
https://cwiki.apache.org/confluence/display/SLING/Multitenancy+Support
but as Carsten says we do have a tenant API now. Like Stefan I'm just
suspecting people have different ideas about what multi-tenancy means,
so having use cases would help.

-Bertrand


RE: write access to sling wiki

2014-08-12 Thread Stefan Seifert
Done via 
https://cwiki.apache.org/confluence/spaces/spacepermissions.action?key=SLING

thanks, works!

stefan


RE: [RT] Multi Tenancy

2014-08-12 Thread Stefan Seifert


-Original Message-
From: Alexander Klimetschek [mailto:aklim...@adobe.com]
Sent: Tuesday, August 12, 2014 1:47 AM
To: dev@sling.apache.org
Subject: Re: [RT] Multi Tenancy
...
And here it becomes tricky. Because if you are allowed to write arbitrary
code (e.g. in JSPs), you can get an admin session, and thus do what you want
anyway. So enforcing to set the right resource types in the first place (e.g.
UIs not allowing you to choose templates / components from another tenant)
have the same level of security then a complex tenant script resolution
mechanism.

if the tenant-specific scripts are allowed to get an admin session, they cannot 
only access scripts of other tenants, but all their content as well, which is i 
suppose much more problematic than accessing the custom scripts. you can 
effectively steal all content of all other tenants of the same instance.

so, it's difficult to use the current architecture for a tenant model where the 
deployed scripts have to be considered unsafe and the tenants cannot not 
trust each other. i think it would be possible to extend the sling API with 
ways to prevent getting an admin session via configuration, but is this still 
save when accessing JCR API directly, or other services running in the OSGi 
context which may expose administrative access to other parts as well.

so this really depends on the usecases (i will start creating a wiki page for 
them today) that the tenant support has to fulfill.

stefan



RE: [RT] Multi Tenancy

2014-08-12 Thread Stefan Seifert
i created a first draft of a wiki page where i tried to collect the different 
views of and requirements for multitenancy of the recent discussions:
https://cwiki.apache.org/confluence/x/So2uAg

i coined new names for the two scenarios Virtual Hosting and Massive Multi 
Site

we should decide first which of the requirements we can target in a first 
phase, and which are more complex or even not solvable within the current 
architecture. and - of course - what is already fulfilled by the current sling 
tenant implementation.

my interest is currently primary in the massive multi site scenario, and 
especially the configuration part in it.

stefan


RE: [RT] Multi Tenancy

2014-08-12 Thread Stefan Seifert

-Original Message-
From: Alexander Saar [mailto:alexander.s...@googlemail.com]
Sent: Tuesday, August 12, 2014 8:34 PM
To: dev@sling.apache.org
Subject: Re: [RT] Multi Tenancy
...
thanks for putting this together. While I agree that the requirements are
different for the 2 scenarios, I'd rather see the multi-site scenario as a
subset of virtual hosting. Tenants in virtual hosting could be structured
internally as a multi-site as well.

yes, i hope as well we can find a solution which fits both needs. just wanted 
to make sure all aspects of both scenarios are covered.

I'm not sure I understand the definition that tenants are defined upfront
in virtual hosting. They can be created dynamically at run time.

my thought was that in a virtual hosting scenario you start creating a tenant, 
and automatically a content subtree is created assigned for this tenant, e.g. 
using a tenant creation wizard. in the multi site scenario this is different - 
a user just creates a new site, and if it matches a specific pattern/structure 
(which is configurable), automatically a new tenant or configuration scope is 
created. this is the usecase view, from a technical point of view this should 
not be much a difference.

stefan


resourceresolver-mock implementation: support for binary data?

2014-08-13 Thread Stefan Seifert
today i had a deeper look at the current implementation of 
resourceresolver-mock [1].
nice work, simulates an simple in-memory resource tree without any underlying 
JCR. data can be written using Sling CRUD API.

unfortunately currently no support for binary data exists, and i'm unsure 
what's the best way to implement it:

a) in JCR resource implementation binary data can be read and written via 
InputStream objects in the ValueMap - that's gets converted internaly to a JCR 
BinaryValue, that means the InputStream can be read again many times, not only 
once. read is not done via ValueMap, but via adapting the property resource to 
InputStream.
this does not work in resourceresolver-mock because a) only a simple map is 
used for storage and b) Resources for properties are not supported at all.

b) the resourceresolver-mock could be somehow extended to detect InputStream 
values and apply a special treatment, mimicking the behavior of the JCR 
ValueMap implementation 

c) or the generic ValueMapDecorator implementation is extended to support such 
binary data handling

my goal is to be able to use the resourceresolver-mock implementation in unit 
tests to test code that reads and writes data using Sling CRUD API including 
binary data.

stefan

[1] http://svn.apache.org/repos/asf/sling/trunk/testing/resourceresolver-mock



RE: [RT] The various roles of (multitenant) content

2014-08-22 Thread Stefan Seifert
hello betrand.

i try to find the bridge to the multitenancy scenarios i've described in [1]:

Deliverable content:
Displayed on a website or mobile app for example.
Can be global, shared between a group of tenants or tenant-specific.

this is what i've called content in the wiki page. may be page content, media 
assets etc., everything the editors enter into the system.
i18n translations may fall into this role as well.


System content:
Defines how a specific version of the system behaves.
Multiple system versions can coexist in a shared content repository
(as we demonstrated in [1], in a limited way)

this is for example configuration - but as you describe it mainly system-level 
configuration (e.g. OSGI configuration).
what is with the other types of configuration on the different levels (regions, 
tenants, sites). they do not belong into the role system content, but they do 
not fit in the other roles as well.


Application content:
Extensions or overrides of system content, that modify how the system
behaves.
Usually tenant-specific, or maybe shared between a group of tenants

if an application is installed to be used by all tenants (e.g. massive multi 
site scenario), it may be global application-level overrides as well. but this 
fits in your group of tenants picture, where the group is all tenants.

i assume the whole application bundle falls into this category? but an 
application bundle usually consist of both OSGi bundles (system role) and 
scripts (application context role).


Module state content:
The typical example is workflow models and state, which is not
deliverable but persistent and might be partially shared.

other examples are background jobs using sling event/job infrastructure. this 
is not module-related, or i do not understand clearly what you mean with 
model in this context.


Instance-specific transient content:
Transient content that's relevant to a single Sling instance. Compiled
scripts, for example.
Not needed when the Sling instance starts.

ok


stefan 

[1] https://cwiki.apache.org/confluence/x/So2uAg



RE: resourceresolver-mock implementation: support for binary data?

2014-08-27 Thread Stefan Seifert
done, see https://issues.apache.org/jira/browse/SLING-3889
(amongst fixes for other behavior that was different from the JCR resource 
implementation)

stefan

-Original Message-
From: Carsten Ziegeler [mailto:cziege...@apache.org]
Sent: Thursday, August 14, 2014 5:07 AM
To: dev@sling.apache.org
Subject: Re: resourceresolver-mock implementation: support for binary data?

Hi Stefan

I guess a good first step would be to go with b)

Carsten


2014-08-13 23:51 GMT+02:00 Stefan Seifert sseif...@pro-vision.de:

 today i had a deeper look at the current implementation of
 resourceresolver-mock [1].
 nice work, simulates an simple in-memory resource tree without any
 underlying JCR. data can be written using Sling CRUD API.

 unfortunately currently no support for binary data exists, and i'm unsure
 what's the best way to implement it:

 a) in JCR resource implementation binary data can be read and written via
 InputStream objects in the ValueMap - that's gets converted internaly to a
 JCR BinaryValue, that means the InputStream can be read again many times,
 not only once. read is not done via ValueMap, but via adapting the property
 resource to InputStream.
 this does not work in resourceresolver-mock because a) only a simple map
 is used for storage and b) Resources for properties are not supported at
 all.

 b) the resourceresolver-mock could be somehow extended to detect
 InputStream values and apply a special treatment, mimicking the behavior of
 the JCR ValueMap implementation

 c) or the generic ValueMapDecorator implementation is extended to support
 such binary data handling

 my goal is to be able to use the resourceresolver-mock implementation in
 unit tests to test code that reads and writes data using Sling CRUD API
 including binary data.

 stefan

 [1]
 http://svn.apache.org/repos/asf/sling/trunk/testing/resourceresolver-mock




--
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org


RE: Two models integration tests fail

2014-08-29 Thread Stefan Seifert
I filed https://issues.apache.org/jira/browse/SLING-3884 for this a
couple of day ago.

patch attached in the ticket.

stefan


RE: [VOTE] Release Apache Sling Filesystem ResourceProvider 1.1.4

2014-09-02 Thread Stefan Seifert
+1 (non-binding)

-Original Message-
From: Robert Munteanu [mailto:romb...@apache.org]
Sent: Tuesday, September 02, 2014 4:06 PM
To: dev@sling.apache.org
Subject: [VOTE] Release Apache Sling Filesystem ResourceProvider 1.1.4

Hi,

We solved 2 issues in this release:
https://issues.apache.org/jira/browse/SLING/fixforversion/12324318

Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-1108/

You can use this UNIX script to download the release and verify the
signatures:
http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

Usage:
sh check_staged_release.sh 1108 /tmp/sling-staging

Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

This majority vote is open for at least 72 hours.


RE: [VOTE] Release Apache Sling Models API Implementation 1.1.0

2014-09-02 Thread Stefan Seifert
+1! (non-binding)

-Original Message-
From: justinedel...@gmail.com [mailto:justinedel...@gmail.com] On Behalf Of
Justin Edelson
Sent: Tuesday, September 02, 2014 9:22 PM
To: dev@sling.apache.org
Subject: [VOTE] Release Apache Sling Models API  Implementation 1.1.0

Hi,

We solved 15 issues in this release:

https://issues.apache.org/jira/browse/SLING/fixforversion/12327365
https://issues.apache.org/jira/browse/SLING/fixforversion/12327364

Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-1112/

You can use this UNIX script to download the release and verify the
signatures:
http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

Usage:
sh check_staged_release.sh 1112 /tmp/sling-staging

Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

This majority vote is open for at least 72 hours.


RE: [ANN] New Apache Sling Committer: Stefan Seifert

2014-09-08 Thread Stefan Seifert
thank you very much!

a few introductory words about me:

i'm living (and was born) in berlin. i'm closely attached with apache projects 
since nearly 15 years now. in the first years that was primarily the apache 
cocoon framework, but since 2009 my focus lies at apache sling and felix. i've 
touched a lot of areas of sling in the past, currently i'm involved in the 
sling models and testing subprojects. a new area where i see the need for 
adding important features to the sling frameworks is multi tenancy and 
configuration support. i'm looking forward to further support sling in the 
future!

stefan

p.s. btw. my company is the host and sponsor (together with adobe) of the 
yearly conference for Sling  Friends in Berlin: http://adapt.to


-Original Message-
From: Carsten Ziegeler [mailto:cziege...@apache.org]
Sent: Monday, September 08, 2014 6:21 PM
To: dev@sling.apache.org
Subject: [ANN] New Apache Sling Committer: Stefan Seifert

Hi

it's my pleasure to announce that the Apache Sling PMC has invited Stefan
Seifert as a new Sling committer...and Stefan accepted.


RE: [VOTE] Release Apache Sling Filesystem ResourceProvider 1.1.4

2014-09-09 Thread Stefan Seifert
any more votes? one (binding) vote is still missing.

stefan


2014-09-02 16:05 GMT+02:00 Robert Munteanu romb...@apache.org:

 Hi,

 We solved 2 issues in this release:
 https://issues.apache.org/jira/browse/SLING/fixforversion/12324318

 Staging repository:
 https://repository.apache.org/content/repositories/orgapachesling-1108/

 You can use this UNIX script to download the release and verify the
 signatures:
 http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

 Usage:
 sh check_staged_release.sh 1108 /tmp/sling-staging

 Please vote to approve this release:

   [ ] +1 Approve the release
   [ ]  0 Don't care
   [ ] -1 Don't release, because ...

 This majority vote is open for at least 72 hours.




--
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org


prepare release of resourceresolver-mock?

2014-09-19 Thread Stefan Seifert
we did considerable amount of fixes and enhancements to the 
testing/resourceresoler-mock implementation - see [1]

i think we should do a release, it is quite stable now, i tested it in a 
complex unit test environment.

can i help in preparing the release?

stefan


[1] 
https://issues.apache.org/jira/issues/?jql=project%20%3D%20SLING%20AND%20fixVersion%20%3D%20%22Testing%20ResourceResolver%20Mock%200.3.0%22



adaptTo() 2014 finished - slides are online

2014-09-24 Thread Stefan Seifert
adaptTo() 2014 in berlin is finished - thanks again to all speakers, 
participants and supporters!

for those that were not able to attend - all slides are now online (extra page 
for each talk in the schedule):
http://adapt.to/2014/en/schedule.html

we will add some more photos the next days to the gallery.

see you next year again!

stefan


[VOTE] Release Apache Sling Testing Resource Resolver Mock version 0.3.0

2014-09-25 Thread Stefan Seifert
Hi,

We solved 4 issues in this release:
https://issues.apache.org/jira/browse/SLING/fixforversion/12326159

Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-1131/

You can use this UNIX script to download the release and verify the signatures:
http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

Usage:
sh check_staged_release.sh 1131 /tmp/sling-staging

Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

This majority vote is open for at least 72 hours.


stefan

p.s. this is my first apache sling release, hopefully PGP signing etc. is all 
correct.


RE: [PROPOSAL] Sightly donation to Apache Sling

2014-09-25 Thread Stefan Seifert
a big +1 from my side, i'm very happy to see the sightly implementation 
becoming open source.

some detail questions on the process:

- i've had only a brief look at the sources, but if i understand correctly the 
org.apache.sling.scripting.sightly.zip/engine bundle contains both the sightly 
language implementation itself, as well as the integration with sling and the 
sling-specific sightly extensions (e.g. support for data-sly-resource).

- would it not be better to separate this into different bundles - one for the 
language itself and one for the sling-specific extensions?

- i've not seen the specification of sightly yet - does it contain the 
sling-specific extensions as well, or is it partitioned this way?

- this would be the first time that the sling project does not only host the 
script language integration, but the script language implementation itself. are 
we as sling community prepared for it, and the best host for it? i do not want 
to put any stones in the way with this question, just to get the opinion of the 
community.

stefan



-Original Message-
From: Radu Cotescu [mailto:r...@apache.org]
Sent: Monday, September 22, 2014 11:00 AM
To: Sling Dev
Subject: [PROPOSAL] Sightly donation to Apache Sling

Hello,

On behalf of Adobe Systems Inc. I'd like to contribute two modules to
Apache Sling:

   - org.apache.sling.scripting.sightly
   - org.apache.sling.xss


Sightly is the new web templating language shipped with Adobe Experience
Manager 6.0 [0]. Our contribution to Apache Sling is a Java-based
implementation, fully compliant with the language's specification. However,
the language's specification is and will be owned by Adobe.

For Sightly's contextual-based automated XSS escaping feature we're also
donating the org.apache.sling.xss bundle that provides two useful services
meant to help escaping or filtering user-submitted content that might be
prone to XSS attacks.

While the XSS module contains a decent amount of unit tests, the Sightly
implementation was tested using a proprietary (for now) UI testing
framework. I'm currently working on porting those tests into a test runner
that will be made available under an Apache License on Maven Central; this
runner could easily be integrated into Sightly's build process in the near
future.

SLING-3959 [1] has been opened to track the donation progress and the
bundles are attached there. If the Sling community finds this donation
interesting we can carry on with the IP clearance.

Thanks,
Radu

*Sightly Credits:*
Senol Tas, Honwai Wong - initial language specification and implementation
Gabriel Walt - product manager, language specification
Marius Dănilă, Radu Cotescu, Sameer Charles - Java implementation and
JavaScript Use-API support
Cătălin Buzoiu - engineering manager
Feike Visser, Florin Iordache - early adopters implementing projects with
Sightly, who provided valuable feedback during Sightly's development process

[0] - http://docs.adobe.com/content/docs/en/aem/6-0/develop/sightly.html
[1] - *https://issues.apache.org/jira/browse/SLING-3959
https://issues.apache.org/jira/browse/SLING-3959*


[PROPOSAL] Integrate Superimposing Resource Provider into contrib

2014-09-26 Thread Stefan Seifert
hello.

4 years ago julian sedding contributed a great prototype for a symlink 
resource provider in SLING-1778 [1].
i've picked up this idea, enhanced it and added unit tests and documentation, 
currently hosted at github [2].

i want to included it into the sling SVN at contrib. i'm prepared to maintain 
it in the future. we're currently using it in production for somewhat about 
1000 sites worldwide.

my goal would be to make a 0.2.0 release soon after the donation, to allow 
others to use it easily and experiment with it.

steps for future enhancements would be:
- add an separate integration test project for it - the mockito-based unit 
tests are a bit too much mocked currently
- make the sling:superimposeOverlayable feature production ready (currently 
it's marked as experimental in the documentation)
- evaluate if there is some code that can be shared with the Sling Resource 
Merger

[2] contains some words as well what is the difference between Superimposing 
and Resource Merger.

stefan


[1] https://issues.apache.org/jira/browse/SLING-1778
[2] https://github.com/stefanseifert/sling-superimposing



[RESULT] [VOTE] Release Apache Sling Testing Resource Resolver Mock version 0.3.0

2014-09-29 Thread Stefan Seifert
Hi,

The vote has passed with the following result :

+1 (binding): Robert Munteanu, Mike Müller, Carsten Ziegeler


@any PMC member: can you take over promoting the release artifacts?
i'm not sure for which of the release promotion steps from [1] i have 
sufficient rights.
i'll take care of the JIRA issues.


stefan


[1] http://sling.apache.org/documentation/development/release-management.html


RE: [RESULT] [VOTE] Release Apache Sling Testing Resource Resolver Mock version 0.3.0

2014-09-29 Thread Stefan Seifert

I've updated the dist directory and released the Nexus staging
repository. You should be able to perform the rest of the steps
yourself, please let me know if that's not the case.

thanks, i've completed step 6 (news) and 7 (downloads page) on the sling site.

stefan 


RE: [PROPOSAL] Integrate Superimposing Resource Provider into contrib

2014-09-29 Thread Stefan Seifert
thanks for the feedback
i've committed it to 
https://svn.eu.apache.org/repos/asf/sling/trunk/contrib/extensions/superimposing

stefan


-Original Message-
From: Oliver Lietz [mailto:apa...@oliverlietz.de]
Sent: Saturday, September 27, 2014 1:04 PM
To: dev@sling.apache.org
Subject: Re: [PROPOSAL] Integrate Superimposing Resource Provider into
contrib

On Friday 26 September 2014 17:15:27 Stefan Seifert wrote:
 hello.

 4 years ago julian sedding contributed a great prototype for a symlink
 resource provider in SLING-1778 [1]. i've picked up this idea, enhanced
 it and added unit tests and documentation, currently hosted at github [2].

 i want to included it into the sling SVN at contrib. i'm prepared to
 maintain it in the future. we're currently using it in production for
 somewhat about 1000 sites worldwide.

 my goal would be to make a 0.2.0 release soon after the donation, to allow
 others to use it easily and experiment with it.

 steps for future enhancements would be:
 - add an separate integration test project for it - the mockito-based unit
 tests are a bit too much mocked currently - make the
 sling:superimposeOverlayable feature production ready (currently it's
 marked as experimental in the documentation) - evaluate if there is some
 code that can be shared with the Sling Resource Merger

 [2] contains some words as well what is the difference between
 Superimposing and Resource Merger.

go on - sounds good to me also.

O.

 stefan


 [1] https://issues.apache.org/jira/browse/SLING-1778
 [2] https://github.com/stefanseifert/sling-superimposing


[VOTE] Release Apache Sling Superimposing Resource Provider 0.2.0

2014-09-29 Thread Stefan Seifert
Hi,

This is the initial release of the 'Superimposing Resource Provider' from 
contrib:
https://issues.apache.org/jira/browse/SLING/fixforversion/12328740

Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-1133/

You can use this UNIX script to download the release and verify the signatures:
http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

Usage:
sh check_staged_release.sh 1133 /tmp/sling-staging

Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

This majority vote is open for at least 72 hours.

stefan



RE: [VOTE] Release Apache Sling Launchpad Builder 7

2014-10-01 Thread Stefan Seifert
+1 (non-binding)

downloaded it, verified it and deployed a demo application - works well.

stefan

-Original Message-
From: Robert Munteanu [mailto:romb...@apache.org]
Sent: Tuesday, September 30, 2014 9:58 PM
To: dev@sling.apache.org
Subject: [VOTE] Release Apache Sling Launchpad Builder 7

Hi,

We solved 31 issues in this release:
https://issues.apache.org/jira/browse/SLING/fixforversion/12316176

There are still some outstanding issues:
https://issues.apache.org/jira/browse/SLING/component/12312146

Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-1134/

You can use this UNIX script to download the release and verify the
signatures:
http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

Usage:
sh check_staged_release.sh 1134 /tmp/sling-staging

Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

This majority vote is open for at least 72 hours.


RE: [VOTE] Release Apache Sling Superimposing Resource Provider 0.2.0

2014-10-01 Thread Stefan Seifert
ah, you are correct, the javadoc is confusing, leftover of some renamings in 
the past (the API itself is correct).

this is fixed in rev. 1628716

stefan

-Original Message-
From: Oliver Lietz [mailto:apa...@oliverlietz.de]
Sent: Wednesday, October 01, 2014 4:26 PM
To: dev@sling.apache.org
Subject: Re: [VOTE] Release Apache Sling Superimposing Resource Provider
0.2.0

On Monday 29 September 2014 23:12:01 Stefan Seifert wrote:
 Hi,

 This is the initial release of the 'Superimposing Resource Provider' from
 contrib:
 https://issues.apache.org/jira/browse/SLING/fixforversion/12328740

hi Stefan,

this looks confusing to me:

/**
 * @return Root path (source path)
 */
String getRootPath();

/**
 * @return Target path (destination path)
 */
String getSourcePath();

Is it intended?

The README is well done. We should make such READMEs mandatory ;)

Regards,
O.

[...]
 stefan


[RESULT] [VOTE] Release Apache Sling Superimposing Resource Provider 0.2.0

2014-10-03 Thread Stefan Seifert
Hi,

The vote has passed with the following result :

+1 (binding): Carsten Ziegeler, Oliver Lietz, Robert Munteanu

@any PMC member: please promote the release to dist and maven central.
i take care of the site and JIRA updates.

stefan


RE: [RESULT] [VOTE] Release Apache Sling Superimposing Resource Provider 0.2.0

2014-10-03 Thread Stefan Seifert
thanks!

-Original Message-
From: Oliver Lietz [mailto:apa...@oliverlietz.de]
Sent: Friday, October 03, 2014 10:43 AM
To: dev@sling.apache.org
Subject: Re: [RESULT] [VOTE] Release Apache Sling Superimposing Resource
Provider 0.2.0

On Friday 03 October 2014 10:26:44 Stefan Seifert wrote:
 Hi,

 The vote has passed with the following result :

 +1 (binding): Carsten Ziegeler, Oliver Lietz, Robert Munteanu

 @any PMC member: please promote the release to dist and maven central.
 i take care of the site and JIRA updates.

Done.

O.

 stefan


[PROPOSAL] Context-specific configuration for Apache Sling, Multitenancy

2014-10-03 Thread Stefan Seifert
this proposal is about context-specific configuration, that means configuration 
that cannot be stored as OSGi configurations. OSGi configurations are always 
system-wide, so they are not well-suited for storing configurations per context 
e.g. site, region or tenant. this is related to the multitenancy discussion on 
this list, see [1] for a summary of the past discussion.
 
we've implementation a solution for this and are currently thinking about 
donating it to Apache Sling. a documentation of what is currently implemented 
is at [2]. the most relevant pages you should read are [3], [4], [5], [6]. the 
implementation is based on the requirements from [7], although not all that is 
listed on that page is implemented currently (but a good deal of it). source 
code is at [8], a sample application at [9].

the current implementation is targeted to a specific sling-based CMS - but 
besides the configuration editor and the parameter persistence provider it does 
not depend on the CMS API but only on the Sling APIs, being technically suited 
to be donated to Apache Sling. it's already published under apache license 2.0.

i'm interested if there is more need in the community for solving the 
requirements i've listed, and the solutions we have implemented for it. and if 
there are other sling committers who want to take part in its development and 
enhancement as well. although we're using the current implementation from 
wcm.io already in our projects nothing of it's current architecture is carved 
in stone and i'm open to broaden the scope of requirements it should support.

WDYT?

stefan


[1] https://cwiki.apache.org/confluence/x/zJBcAg
[2] http://wcm.io/config/
[3] http://wcm.io/config/api/terminology.html
[4] http://wcm.io/config/api/usage-api.html
[5] http://wcm.io/config/api/usage-spi.html
[6] http://wcm.io/config/editor/usage.html
[7] https://wcm-io.atlassian.net/wiki/x/HIAH
[8] https://github.com/wcm-io/wcm-io/tree/master/config
[9] http://wcm.io/samples/config-sample-app/



FW: [PROPOSAL] Context-specific configuration for Apache Sling, Multitenancy

2014-10-03 Thread Stefan Seifert
p.s. url [1] is wrong - it should be 
https://cwiki.apache.org/confluence/x/So2uAg

-Original Message-
From: Stefan Seifert [mailto:sseif...@pro-vision.de] 
Sent: Saturday, October 04, 2014 1:54 AM
To: dev@sling.apache.org
Subject: [PROPOSAL] Context-specific configuration for Apache Sling, 
Multitenancy

this proposal is about context-specific configuration, that means configuration 
that cannot be stored as OSGi configurations. OSGi configurations are always 
system-wide, so they are not well-suited for storing configurations per context 
e.g. site, region or tenant. this is related to the multitenancy discussion on 
this list, see [1] for a summary of the past discussion.
 
we've implementation a solution for this and are currently thinking about 
donating it to Apache Sling. a documentation of what is currently implemented 
is at [2]. the most relevant pages you should read are [3], [4], [5], [6]. the 
implementation is based on the requirements from [7], although not all that is 
listed on that page is implemented currently (but a good deal of it). source 
code is at [8], a sample application at [9].

the current implementation is targeted to a specific sling-based CMS - but 
besides the configuration editor and the parameter persistence provider it does 
not depend on the CMS API but only on the Sling APIs, being technically suited 
to be donated to Apache Sling. it's already published under apache license 2.0.

i'm interested if there is more need in the community for solving the 
requirements i've listed, and the solutions we have implemented for it. and if 
there are other sling committers who want to take part in its development and 
enhancement as well. although we're using the current implementation from 
wcm.io already in our projects nothing of it's current architecture is carved 
in stone and i'm open to broaden the scope of requirements it should support.

WDYT?

stefan


[1] https://cwiki.apache.org/confluence/x/zJBcAg
[2] http://wcm.io/config/
[3] http://wcm.io/config/api/terminology.html
[4] http://wcm.io/config/api/usage-api.html
[5] http://wcm.io/config/api/usage-spi.html
[6] http://wcm.io/config/editor/usage.html
[7] https://wcm-io.atlassian.net/wiki/x/HIAH
[8] https://github.com/wcm-io/wcm-io/tree/master/config
[9] http://wcm.io/samples/config-sample-app/



[PROPOSAL] donate sling-mock, jcr-mock, osgi-mock to Apache Sling

2014-10-10 Thread Stefan Seifert
in the last week i've developed at suite of mocking libraries to run OSGi/SCR, 
JCR and esp. Sling in a simulated in-memory environment for unit tests, 
ensuring minimal setup time. it uses either a mocked in-memory JCR, or the 
resourceresolver-mock [1] implementation that is already part of the sling 
project. additional convenience features like bulk-loading JSON content and 
binaries into the simulated resource tree via a content loader makes it easy 
setting up complex text fixtures for your unit tests.

the mocking libraries are currently documented at:
- http://wcm.io/testing/osgi-mock/
- http://wcm.io/testing/jcr-mock/
- http://wcm.io/testing/sling-mock/

some documentation examples to see how it works: [2], [3], [4]
types of resource resolver implementations supported: [5]
a short introduction from adaptTo: [6]

i would donate this with full unit test coverage and documentation to apache 
sling and can maintain it in the future. it's already published with apache 
license 2.0.

my proposal would be to place this as additional subprojects below [7]

WDYT?

stefan


[1] https://svn. apache.org/repos/asf/sling/trunk/testing/resourceresolver-mock
[2] http://wcm.io/testing/sling-mock/usage-mocks.html
[3] http://wcm.io/testing/sling-mock/usage-content-loader.html
[4] http://wcm.io/testing/osgi-mock/usage.html
[5] http://wcm.io/testing/sling-mock/resource-resolver-types.html
[6] 
http://adapt.to/content/dam/adaptto/production/presentations/2014/adaptTo2014-Lightning-Mock-AEMCo-for-Unit-Tests-Stefan-Seifert.pdf
[7] https://svn.apache.org/repos/asf/sling/trunk/testing



RE: [PROPOSAL] donate sling-mock, jcr-mock, osgi-mock to Apache Sling

2014-10-10 Thread Stefan Seifert
the mocks implement only a certain level of functionality, and not all features 
of the relevant interfaces. some methods just throw unsupportedoperation 
exception.

they are currently focused on features that normal application and component 
logic for sling apps require. the intro pages of the documentations listed 
below have some bullets about whats supported and what not.

advanced features like JCR search, transactions, versioning, observation are 
currently not supported, although for some of them it would be possible to add 
them later as required. we're using these mocks already for several complex 
projects and features e.g. for http://wcm.io, and you can get really far with 
what's supported currently, although in some cases you have to know how the 
mocking is working to correctly setup you unit test. this will be covered in 
the documentation.

stefan


-Original Message-
From: ianbos...@gmail.com [mailto:ianbos...@gmail.com] On Behalf Of Ian
Boston
Sent: Friday, October 10, 2014 12:52 PM
To: dev@sling.apache.org
Subject: Re: [PROPOSAL] donate sling-mock, jcr-mock, osgi-mock to Apache
Sling

Hi,
This would be a great addition. I frequently spend hours building
mockito based mocks to do the same and although the first time it was
fun, it gets a real pain the n'th time. Although you can do the same
with a real OSGi Unit test and an in memory version of Jackrabbit, the
runtime of each unit test often adds to much to the overall build
time.

I am +1 on this if it came to a vote.

Are there any areas where these Mocks wont work ?
Multiple threads, observation, locks, versioning ?


Best Regards
Ian


On 10 October 2014 09:10, Stefan Seifert sseif...@pro-vision.de wrote:
 in the last week i've developed at suite of mocking libraries to run
OSGi/SCR, JCR and esp. Sling in a simulated in-memory environment for unit
tests, ensuring minimal setup time. it uses either a mocked in-memory JCR, or
the resourceresolver-mock [1] implementation that is already part of the
sling project. additional convenience features like bulk-loading JSON content
and binaries into the simulated resource tree via a content loader makes it
easy setting up complex text fixtures for your unit tests.

 the mocking libraries are currently documented at:
 - http://wcm.io/testing/osgi-mock/
 - http://wcm.io/testing/jcr-mock/
 - http://wcm.io/testing/sling-mock/

 some documentation examples to see how it works: [2], [3], [4]
 types of resource resolver implementations supported: [5]
 a short introduction from adaptTo: [6]

 i would donate this with full unit test coverage and documentation to
apache sling and can maintain it in the future. it's already published with
apache license 2.0.

 my proposal would be to place this as additional subprojects below [7]

 WDYT?

 stefan


 [1] https://svn. apache.org/repos/asf/sling/trunk/testing/resourceresolver-
mock
 [2] http://wcm.io/testing/sling-mock/usage-mocks.html
 [3] http://wcm.io/testing/sling-mock/usage-content-loader.html
 [4] http://wcm.io/testing/osgi-mock/usage.html
 [5] http://wcm.io/testing/sling-mock/resource-resolver-types.html
 [6]
http://adapt.to/content/dam/adaptto/production/presentations/2014/adaptTo2014
-Lightning-Mock-AEMCo-for-Unit-Tests-Stefan-Seifert.pdf
 [7] https://svn.apache.org/repos/asf/sling/trunk/testing



RE: [mocks] Question on dependency management while adding a test case

2014-10-10 Thread Stefan Seifert

Are the Event tests part of the same module? If they are, you can move
them to a different module and then test + runtime dependencies are
separated.

Robert

this would be a workaround, but not a nice one if these mocks are used widely 
in a lot of projects. this is a general problem for all of those mocks. you 
cannot just lower the sling API version of the mock, because if the code you 
want to test depends on the newer version you need a mock of the most recent 
version of the interfaces.

in the worst case we have to branch these mock projects to support different 
version of APIs. fortunately the APIs for OSGi and JCR are very stable, but for 
sling itself this may be relevant. it get's more complicated when multiple APIs 
of different sling subprojects are mixed.

for wcm.io we have a solution where we will do a big branch for each major 
version of the commercial CMS it's targeted to, and ensure compatibility within 
the version.

stefan


RE: Question on dependency management while adding a test case

2014-10-11 Thread Stefan Seifert
this worked well, resolved in https://issues.apache.org/jira/browse/SLING-4033

stefan

-Original Message-
From: Julian Sedding [mailto:jsedd...@gmail.com]
Sent: Friday, October 10, 2014 4:28 PM
To: dev@sling.apache.org
Subject: Re: Question on dependency management while adding a test case

Hi Amit

We could change the resourceresolver-mock to use a lower Sling API
version than it implements. I.e. in MockResourceResolver, change all
resource.getValueMap() to ResourceUtil.getValueMap(resource). Then it
should be compatible with lower API versions. This should work as long
as there are no major API changes.

Regards
Julian

On Fri, Oct 10, 2014 at 9:57 AM, Amit.. Gupta. amitg...@adobe.com wrote:
 Hello Team,


 I am adding a test case of [0], for this I need to use latest of


groupIdorg.apache.sling/groupId
 artifactIdorg.apache.sling.testing.resourceresolver-
mock/artifactId

 ?

 This introduces a dependency to sling.api:2.7.0, because of
resource.getValueMap


 sling event module, otherwise is quite content with older api dependency.
So, I don't want to introduce this higher dependency.

 I can explicitly give a lower bound in import, which isn't nice either. Is
there any other way.


 Regards,

 Amit


 [0] https://issues.apache.org/jira/browse/SLING-4014


RE: [PROPOSAL] donate sling-mock, jcr-mock, osgi-mock to Apache Sling

2014-10-13 Thread Stefan Seifert
thanks for the feedback, i've created 
https://issues.apache.org/jira/browse/SLING-4042
for tracking the donation and creating the projects within the sling testing 
area.

stefan


-Original Message-
From: Stefan Seifert [mailto:sseif...@pro-vision.de]
Sent: Friday, October 10, 2014 10:11 AM
To: dev@sling.apache.org
Subject: [PROPOSAL] donate sling-mock, jcr-mock, osgi-mock to Apache Sling

in the last week i've developed at suite of mocking libraries to run
OSGi/SCR, JCR and esp. Sling in a simulated in-memory environment for unit
tests, ensuring minimal setup time. it uses either a mocked in-memory JCR, or
the resourceresolver-mock [1] implementation that is already part of the
sling project. additional convenience features like bulk-loading JSON content
and binaries into the simulated resource tree via a content loader makes it
easy setting up complex text fixtures for your unit tests.

the mocking libraries are currently documented at:
- http://wcm.io/testing/osgi-mock/
- http://wcm.io/testing/jcr-mock/
- http://wcm.io/testing/sling-mock/

some documentation examples to see how it works: [2], [3], [4]
types of resource resolver implementations supported: [5]
a short introduction from adaptTo: [6]

i would donate this with full unit test coverage and documentation to apache
sling and can maintain it in the future. it's already published with apache
license 2.0.

my proposal would be to place this as additional subprojects below [7]

WDYT?

stefan


[1] https://svn. apache.org/repos/asf/sling/trunk/testing/resourceresolver-
mock
[2] http://wcm.io/testing/sling-mock/usage-mocks.html
[3] http://wcm.io/testing/sling-mock/usage-content-loader.html
[4] http://wcm.io/testing/osgi-mock/usage.html
[5] http://wcm.io/testing/sling-mock/resource-resolver-types.html
[6]
http://adapt.to/content/dam/adaptto/production/presentations/2014/adaptTo2014
-Lightning-Mock-AEMCo-for-Unit-Tests-Stefan-Seifert.pdf
[7] https://svn.apache.org/repos/asf/sling/trunk/testing



RE: Can we group the mock stuff under testing/mocks?

2014-10-13 Thread Stefan Seifert
yes, i will take care of it in context of SLING-4042

stefan

-Original Message-
From: Bertrand Delacretaz [mailto:bdelacre...@apache.org]
Sent: Monday, October 13, 2014 3:25 PM
To: dev
Subject: Can we group the mock stuff under testing/mocks?

Hi,

Currently we have

testing/jcr-mock:
testing/osgi-mock:
testing/resourceresolver-mock:
testing/sling-mock-jackrabbit:
testing/sling-mock:

could we move that under testing/mocks to better group things?

-Bertrand


release of sling-/osgi-/jcr-/resourceresolver-mock end of week

2014-10-13 Thread Stefan Seifert
the donation of the new mock implementations is complete, and documentation is 
online (see [1]).

i would like to prepare the release for the three new mocks and for the 
resourceresolver-mock project as well (it's a dependency). if no one objects i 
will cut the release and start the official voting process thursday evening or 
friday this week, so you have some time reviewing it before this.

my plan is to release all mock projects (including resourceresolver-mock) with 
version 1.0.0.

stefan

[1] 
https://issues.apache.org/jira/browse/SLING-4042?focusedCommentId=14169352#comment-14169352



RE: FW: [PROPOSAL] Context-specific configuration for Apache Sling, Multitenancy

2014-10-14 Thread Stefan Seifert
hello justin.

as described in [1] we currently took the design decision to have only a flat 
parameter list, namespacing can and has to be done inside the parameter names. 
the goal was to really support the full configuration in a single value map. 
but i'm aware this may not be sufficient, but wanted to start simple in this 
case. each parameter definition already has an application ID assigned as well, 
so technically it would not be a problem to have a parameter namespace per 
application/library that provides the parameters. i've not found yet a nice 
client API solution for this - chaining two get methods as in your example 
would be a solution.

as the configuration API is designed to work with parameter constants holding 
the parameter definition [2] this chaining would only be needed if the 
configuration value map is accessed using string values. if using the parameter 
definition constant all information is in place. parameter definitions can have 
more metadata if a configuration editor is supported as well, see example [3] 
resulting in [4].

stefan

[1] http://wcm.io/config/api/usage-spi.html#Preconditions_and_limitations
[2] http://wcm.io/config/api/usage-spi.html#Providing_parameter_definitions
[3] 
https://github.com/wcm-io/wcm-io/blob/master/samples/config-sample-app/src/main/java/io/wcm/samples/configsampleapp/config/Params.java
[4] http://wcm.io/config/editor/usage.html


-Original Message-
From: justinedel...@gmail.com [mailto:justinedel...@gmail.com] On Behalf Of
Justin Edelson
Sent: Tuesday, October 14, 2014 4:58 PM
To: dev@sling.apache.org
Subject: Re: FW: [PROPOSAL] Context-specific configuration for Apache Sling,
Multitenancy

Hi Dominik,
Thanks for this link, but I'm still confused about scoping. Looking at
http://wcm.io/config/api/usage-api.html, it seems like a Configuration
object is essentially just a ValueMap. In a non-trivial application,
it seems like you need some kind of namespace for configuration
properties. For example, let's say that I'm integrating with multiple
OAuth services. I thus have multiple configuration properties which
are natually named 'secretKey'. Do I need to prefix these property
keys with the service name, e.g. facebook.secretKey and
linkedin.secretKey? I would expect that I could have a Map of Maps
so I could say something like
configuration.get(facebook).get(secretKey) ?

How is this embodied in the API? Are facebook and linkedin applications?

Justin

On Tue, Oct 14, 2014 at 5:13 AM, Dominik Süß dominik.su...@gmail.com wrote:
 Hi everyone,

 I guess people yet just had no chance to dig into the proposal since there
 are a lot of scenarios adressed throught this proposal. As far as I
 understood the API  SPI the main driver for this proposal is the massive
 multisite scenario as described in the mentioned wiki page. Key aspects
 seem to be to get an aggregated context specific view for a configuration
 while lookup aspects (such as where to look up the configs and how
 inheritance is solved) are designed in a pluggable way that allows to
 implement application specific behavior.

 From offlist discussions I know that there might be some confusion around
 how the scoping should work so I just wanted to highlight the mentioned
 link [3] that might eliminate confusion around the wording (especially
 appliation).

 IMHO it would be an extremely valuable addition providing sufficient
 flexiblity to solve all the cases I do have in mind while establishing one
 unified methodology to deal with all the non osgi configuration without
 rewriting casespecific lookup (boilerplate) code over and over again.

 Best regards,
 Dominik

 [3] http://wcm.io/config/api/terminology.html



 On Sat, Oct 4, 2014 at 1:55 AM, Stefan Seifert sseif...@pro-vision.de
 wrote:

 p.s. url [1] is wrong - it should be
 https://cwiki.apache.org/confluence/x/So2uAg

 -Original Message-
 From: Stefan Seifert [mailto:sseif...@pro-vision.de]
 Sent: Saturday, October 04, 2014 1:54 AM
 To: dev@sling.apache.org
 Subject: [PROPOSAL] Context-specific configuration for Apache Sling,
 Multitenancy

 this proposal is about context-specific configuration, that means
 configuration that cannot be stored as OSGi configurations. OSGi
 configurations are always system-wide, so they are not well-suited for
 storing configurations per context e.g. site, region or tenant. this is
 related to the multitenancy discussion on this list, see [1] for a summary
 of the past discussion.

 we've implementation a solution for this and are currently thinking about
 donating it to Apache Sling. a documentation of what is currently
 implemented is at [2]. the most relevant pages you should read are [3],
 [4], [5], [6]. the implementation is based on the requirements from [7],
 although not all that is listed on that page is implemented currently (but
 a good deal of it). source code is at [8], a sample application at [9].

 the current implementation is targeted to a specific sling-based CMS

RE: [PROPOSAL] Context-specific configuration for Apache Sling, Multitenancy

2014-10-14 Thread Stefan Seifert
hello alex.

-Original Message-
From: Alexander Klimetschek [mailto:aklim...@adobe.com]
Sent: Tuesday, October 14, 2014 10:13 PM
To: dev@sling.apache.org
Subject: Re: [PROPOSAL] Context-specific configuration for Apache Sling,
Multitenancy

I see 3 problems:

- allowing to hook in a custom lookup strategy and not defining a clear lookup
 content model (too much magic in such things is bad, it should be obvious by
just browsing the JCR, just as with resource types)
- the idea of putting configurations itself under /content; configs have a
different management lifecycle and ACLs

to shorten a discussion i've written a persistence provider that stores exactly 
you want it - in a shadow structure below /conf. this was only a small 
deviation from the existing persistence provider, documentation of 
ConfStructurePersistenceProvider at [1], impl at [2]

still i see a need for a pluggable architecture at this point. starting on the 
green you are right. but we have already thousands of sling-based applications 
out there. and because no standard for context-specific configs existed in the 
past, every dev team has invented their own strategy having tens of thousands 
of sites with existing configuration. supporting them only needs an 
implementation of a custom PeristenceProvider, new configuration can be stored 
at /conf (the implementation supports multiple persistence providers for 
reading).

and not all configuration parameters are so sensitive that they cannot be 
stored together with content. we have configuration parameters like list of 
news category names or parameters to tweak the style or behavior of some 
marketing features on the site. they should be allowed to be configured by 
authors and are more or less part of the content. but let's not start 
philosophical discussions on that.


- complexity of the API, Parameter generics just replicate the valuemap, but
in what seems to me like an overengineered fashion  one that shields too much
from the power of JCR, which might lead to have people invent custom string
formats instead of using JCR properties; in reality, 80% of properties are
strings, 10% each are boolean or integers (subjective experience stats TM :))

the Parameter generics only supports types supported by JCR (single and 
multi-valued), and a map which is stored in a string array internally.
see more on this topic in my answer to justins mail.


[1] http://wcm.io/config/core/persistence-providers.html
[2] 
https://github.com/wcm-io/wcm-io/blob/master/config/core/src/main/java/io/wcm/config/core/persistence/impl/ConfStructurePersistenceProvider.java



RE: FW: [PROPOSAL] Context-specific configuration for Apache Sling, Multitenancy

2014-10-14 Thread Stefan Seifert
hello justin.

yes, this is my expectation for the java code. if you only provide a 
string-based access to configuration parameter every developer will start to 
create a NameConstants class to define the much-used property names (or you 
will provide such a class as part of your applications API). then the developer 
has to remember which type belongs to which string constant. then you have to 
find a way where you define the default values of a parameter, and describe its 
edit mode capabilities. all this is covered by building a structured parameter 
definition. but yes, it started as a simple helper class with constants to easy 
access all existing parameters of an application.

as a bonus there is an abstract implementation of the ParameterProvider 
interface which just reads the static fields of such a class and provides the 
defined parameters as OSGi service to the config infrastructure.

you still need the string-based (or map-based) access for usecases like sightly 
templates where it is not so easy or uncommon to use constants for accessing 
map values. but in our experience the parameters are used in most cases in the 
java business logic behind the presentation layer, not in the presentation 
layer (scripts) itself. and of course the lazy developers can use this access 
at well in java code...

stefan


-Original Message-
From: justinedel...@gmail.com [mailto:justinedel...@gmail.com] On Behalf Of
Justin Edelson
Sent: Tuesday, October 14, 2014 11:32 PM
To: dev@sling.apache.org
Subject: Re: FW: [PROPOSAL] Context-specific configuration for Apache Sling,
Multitenancy

Hi Stefan,
Thanks for clarifying. So is it accurate to say that your expectation
that the *vast* majority of clients to use a strongly-typed Parameter
object rather than doing a simple String lookup?

To me, this seems very heavyweight, but maybe I am being short sighted
(or lazy).

But on the other hand, if you expect clients to use Paramter objects,
why support String lookup at all?

Justin


RE: FW: [PROPOSAL] Context-specific configuration for Apache Sling, Multitenancy

2014-10-15 Thread Stefan Seifert
hello justin.

i understand you concerns and see what you are pointing at. i hit the problem 
as well at the same time wanting to have single valuemap with all parameters 
and application separation or parameter names. i'm open to removing the 
parameter stuff from the main API, it can always added as a layer on-top.

but carsten introduced a new idea, lets discuss this first.

stefan


-Original Message-
From: justinedel...@gmail.com [mailto:justinedel...@gmail.com] On Behalf Of
Justin Edelson
Sent: Wednesday, October 15, 2014 2:50 AM
To: dev@sling.apache.org
Subject: Re: FW: [PROPOSAL] Context-specific configuration for Apache Sling,
Multitenancy

Hi Stefan,
To me, this sounds a bit schizophrenic - you're saying that the
preferred way is to use a Parameter object, but that we need to
support String-based lookup. And I'm not actually sure what which
type belongs to which string constant actually means.

Above all, this seems to create a confusing API. Since the expectation
is that String-based lookups will work consistently, there's
effectively no way to use the extra data within the Parameter object
inside the lookup mechanism. For example, you mentioned the idea of
using the application ID from the Parameter object as a way of
expressing scope. But of course, this can't actually happen because
there would be no way to do this with just Strings.

I also personally find the setting of the default at the Parameter
level a bit confusing. IME, defaults are *very* context-sensitive,
whereas (if I understand) the Parameter objects are meant to be used
across-contexts.

All of which is to say that I would rather see the API have a clean
separation between configuration lookup (which can be done purely with
Strings) and Parameter definition. Or, to put in AEM terms, separate
the functionality common to author  publish (configuration lookup)
from the author-side functionality (parameter defintion which leads to
editing).

At this point, Configuration just becomes MapString, ValueMap. The
keys are are the application IDs and the resulting maps are the actual
configurations for that application (which frankly I'd rather see
called 'component' but that's neither here nor there). The only
deviation I'd suggest from normal Map behavior is that
config.get(non-existing-application-id) should return an empty
ValueMap. This would allow you to do null-safe chaining, e.g.
config.get(foo).get(bar) could return null, but never throw an NPE
(unless config itself is null)

If developers choose to adopt the Parameter objects, that's fine.
Perhaps we even should have a utility method
ConfigurationUtils.get(config, param) which calls
config.get(param.getApplicationId()).get(param.getName(),
param.getType()) But this is an optional step and the use of Parameter
objects isn't implied by the Configuration API.

Regards,
Justin

On Tue, Oct 14, 2014 at 6:58 PM, Stefan Seifert sseif...@pro-vision.de
wrote:
 hello justin.

 yes, this is my expectation for the java code. if you only provide a string-
based access to configuration parameter every developer will start to create a
NameConstants class to define the much-used property names (or you will
provide such a class as part of your applications API). then the developer has
to remember which type belongs to which string constant. then you have to find
a way where you define the default values of a parameter, and describe its
edit mode capabilities. all this is covered by building a structured parameter
definition. but yes, it started as a simple helper class with constants to
easy access all existing parameters of an application.

 as a bonus there is an abstract implementation of the ParameterProvider
interface which just reads the static fields of such a class and provides the
defined parameters as OSGi service to the config infrastructure.

 you still need the string-based (or map-based) access for usecases like
sightly templates where it is not so easy or uncommon to use constants for
accessing map values. but in our experience the parameters are used in most
cases in the java business logic behind the presentation layer, not in the
presentation layer (scripts) itself. and of course the lazy developers can use
this access at well in java code...

 stefan


-Original Message-
From: justinedel...@gmail.com [mailto:justinedel...@gmail.com] On Behalf Of
Justin Edelson
Sent: Tuesday, October 14, 2014 11:32 PM
To: dev@sling.apache.org
Subject: Re: FW: [PROPOSAL] Context-specific configuration for Apache Sling,
Multitenancy

Hi Stefan,
Thanks for clarifying. So is it accurate to say that your expectation
that the *vast* majority of clients to use a strongly-typed Parameter
object rather than doing a simple String lookup?

To me, this seems very heavyweight, but maybe I am being short sighted
(or lazy).

But on the other hand, if you expect clients to use Paramter objects,
why support String lookup at all?

Justin


RE: FW: [PROPOSAL] Context-specific configuration for Apache Sling, Multitenancy

2014-10-15 Thread Stefan Seifert
hello carsten.

like it! so each application defines one (or multiple) of such configuration 
annotation classes. the first get on an configuration object would expect an 
annotation class, and the second would be nice typed access to a configuration 
value. providing additional metadata per configuration parameter (e.g. for a 
configuration editor) would still be possible by adding annotations to the 
annotation methods.

of course we somewhat misuse the annotation concept here because it's never 
used as annotation at all - but it works quite well and is very comfortable. 
the only drawback i see that such annotations will be presented as well to 
users in their IDEs when typing @... to see what annotations are available to 
annotate their classes.

do you have a link where such a concept is defined in context of the new DS 
specification? using the same concept as a (new) DS version would be plus.

wouldn't it be an option to use a plain interface with default values as 
annotations? this comes close to what sling models supports today.

my statement about support only types from JCR was not precise - i meant 
support all primitive types including string array plus map, but no custom or 
more advanced objects, because this would make things really complicated. 
currently a subset of primitive types is supported [1].

stefan

[1] http://wcm.io/config/api/usage-spi.html#Providing_parameter_definitions




-Original Message-
From: Carsten Ziegeler [mailto:cziege...@apache.org]
Sent: Wednesday, October 15, 2014 8:24 AM
To: dev@sling.apache.org
Subject: Re: FW: [PROPOSAL] Context-specific configuration for Apache Sling,
Multitenancy

In general, using typed objects is the preferred way to go, so I think a
configuration object should be a type object and return configuration
values in the correct type. Let's not fall back into the 80s and fiddle
around with string conversions all over the place.
Having a type for a configuration removes also the need for those ugly
name constants and we could hopefully also get away with having ugly
constants for default values.

So what about using the approach we use in the new Declarative Service
specification and you define a configuration as an annotation:

public @interface MyConfiguration {

   int port() default 465;

   String host() default localhost;

   String userId;
}

This leaves us with a single place to define a type configuration object
in combination with default values. We then define simple mapping rules
from names to resource names.

And we should also support *all* java types not just those JCR supports.
Internally all numbers can be stored as long but the configuration
object gives you an integer, char whatever.

This is how I would like to deal with configurations in code.

Carsten

--
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org


RE: FW: [PROPOSAL] Context-specific configuration for Apache Sling, Multitenancy

2014-10-15 Thread Stefan Seifert

 do you have a link where such a concept is defined in context of the
 new DS specification? using the same concept as a (new) DS version
 would be plus.
Sure, the spec can be found here
https://github.com/osgi/design/blob/master/rfcs/rfc0190/rfc-0190-
Declarative_Services_Enhancements.pdf

cool. chapter 5.6 precisely describes the supported types and coercion rules, 
we should implement it exactly the same way.
in my view this decides whether to use a plain interface or an annotation type 
- do it the same way as DS (will be) doing it: with annotation types.

stefan


RE: FW: [PROPOSAL] Context-specific configuration for Apache Sling, Multitenancy

2014-10-15 Thread Stefan Seifert

However, one downside would be that you don't have hierarchical
configurations or maps - just scalar types and arrays of it.

support for maps we can add using a helper method - internally its stored as 
string array anyway.

hierarchical configurations could be modeled using annotation properties 
referencing other annotations - but the DS spec forbids this so i would vote to 
not support it. but an application could provide multiple configuration 
annotation types, e.g. one per aspect, so you do not have to define one single 
mega annotation with dozens of unrelated configuration properties.

stefan


RE: FW: [PROPOSAL] Context-specific configuration for Apache Sling, Multitenancy

2014-10-15 Thread Stefan Seifert

[...] But to my
mind, one of the key targets for this new configuration structure is
scripts.

this does not match the experience of our projects. we need those parameters 
only in rare occasions directly in the scripts (e.g. sightly), and in most time 
in the java code (models the scripts, different layers of business logic). but 
of course your experience may be different.

stefan


[VOTE] Release Apache Sling Resource Resolver Mock 1.0.0, JCR Mock 1.0.0, OSGi Mock 1.0.0, Sling Mock 1.0.0, Sling Mock Jackrabbit 0.1.0

2014-10-17 Thread Stefan Seifert
Hi,

We solved 4 issues in this release of Resource Resolver Mock 1.0.0:
https://issues.apache.org/jira/browse/SLING/fixforversion/12328721

First release of this modules:

JCR Mock 1.0.0
https://issues.apache.org/jira/browse/SLING/fixforversion/12328830

OSGi Mock 1.0.0
https://issues.apache.org/jira/browse/SLING/fixforversion/12328831

Sling Mock 1.0.0
https://issues.apache.org/jira/browse/SLING/fixforversion/12328832

Sling Mock Jackrabbit 0.1.0 *)
https://issues.apache.org/jira/browse/SLING/fixforversion/12328833


Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-1140/

You can use this UNIX script to download the release and verify the signatures:
http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

Usage:
sh check_staged_release.sh 1140 /tmp/sling-staging

Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

This majority vote is open for at least 72 hours.

stefan

*) this is still experimental, thus only a 0.1.0 release.



RE: FW: [PROPOSAL] Context-specific configuration for Apache Sling, Multitenancy

2014-10-17 Thread Stefan Seifert
good idea, i've created a wiki page to collect usecases for context-specific 
configuration and added some we had in our projects in the past:
https://cwiki.apache.org/confluence/x/1ATTAg

feel free to add your use cases as well to that page.

stefan

-Original Message-
From: Bertrand Delacretaz [mailto:bdelacre...@apache.org]
Sent: Wednesday, October 15, 2014 4:01 PM
To: dev
Subject: Re: FW: [PROPOSAL] Context-specific configuration for Apache Sling,
Multitenancy

On Wed, Oct 15, 2014 at 3:48 PM, Stefan Seifert sseif...@pro-vision.de
wrote:
 ...this does not match the experience of our projects. we need those
parameters only in rare occasions directly
 in the scripts (e.g. sightly)...

As usual, IMO having a shared list of use cases (wiki?) would help a
lot in getting consensus on what's needed and how to get there. ATM it
looks like there are quite different visions of this stuff.

-Bertrand


RE: [PROPOSAL] Context-specific configuration for Apache Sling, Multitenancy

2014-10-17 Thread Stefan Seifert

 2) I'm assuming that the lookup key for these configuration objects is
 the class name. IMHO, we need some kind of differentiator, see for
 example my OAuth example earlier in this thread.

I haven't thought of this part yet, I've just stated my strong wish
for strongly typed configuration objects :)

it seems as we would need some sort of factory-configuration for this usecase 
as well? this would be problematic in my initial approach with only a flat list 
of properties in a valuemap as well.

an oauth bundle would provide an annotation type class and mark it as 
multiple or factory. the API has to provide a way to get lists of 
annotation class instances to iterate over. the configuration editor has to 
support it as well. should be possible, although it would make the API a bit 
more complex.

stefan 


RE: FW: [PROPOSAL] Context-specific configuration for Apache Sling, Multitenancy

2014-10-17 Thread Stefan Seifert
hello Bertrand.

On Fri, Oct 17, 2014 at 11:56 AM, Stefan Seifert sseif...@pro-vision.de
wrote:
 ... https://cwiki.apache.org/confluence/x/1ATTAg ...

Thanks for this. Looking at your use-cases it feels like your context
is always derived from the current resource's position in the content
tree, am I correct?

yes, this is the configuration scope identified by a configuration id (e.g. the 
path of the site's root page)


If yes that explains why you suggest putting the configuration
alongside the content - but we might want to also support configs
stored under /conf or somewhere else safe. Quoting Alex K earlier in
this thread

 ...configs have a different management lifecycle and ACLs than content ...

this is not directly related - storing the config along with the config was 
just the first persistence provider implemented as example.

the configuration id the resource path, but as long if this key is preserved 
the configuration can be stored anywhere, also below a /conf node.

the alternative storing at /conf is already implemented [1] - it's up to the 
system configuration which persistence provider is used.

stefan

[1] http://wcm.io/config/core/persistence-providers.html



RE: [PROPOSAL] Context-specific configuration for Apache Sling, Multitenancy

2014-10-17 Thread Stefan Seifert
hello carsten.

So I think adding an adaptTo method to Configuration might do  the trick:

MyTypedConfig =
resource.adaptTo(Configuration.class).adaptTo(MyTypedConfig.class);

The adaption within the implementation of the configuration class can be
done on the fly by creating a proxy.
We should check if
esource.adaptTo(Configuration.class).adaptTo(MyTypedConfig[].class)
would be implementable as well.

this is nice as well.

in this case the Configuration interface could be reduced to an extension of 
two other interfaces: ValueMap and Adaptable.

what is left to be defined is how the string-based access without annotation 
types is working then in single and multiple variant. it's not a s easy as in 
DS, because in DS the context is always a service with a flat property list. 
here we have an aggregated view of a big number of annotation types which may 
overlap in the defined property names.

stefan 


RE: [VOTE] Release Apache Sling Resource Resolver Mock 1.0.0, JCR Mock 1.0.0, OSGi Mock 1.0.0, Sling Mock 1.0.0, Sling Mock Jackrabbit 0.1.0

2014-10-21 Thread Stefan Seifert
one (binding) vote still missing...

stefan

-Original Message-
From: Stefan Seifert [mailto:sseif...@pro-vision.de]
Sent: Friday, October 17, 2014 10:56 AM
To: dev@sling.apache.org
Subject: [VOTE] Release Apache Sling Resource Resolver Mock 1.0.0, JCR Mock
1.0.0, OSGi Mock 1.0.0, Sling Mock 1.0.0, Sling Mock Jackrabbit 0.1.0

Hi,

We solved 4 issues in this release of Resource Resolver Mock 1.0.0:
https://issues.apache.org/jira/browse/SLING/fixforversion/12328721

First release of this modules:

JCR Mock 1.0.0
https://issues.apache.org/jira/browse/SLING/fixforversion/12328830

OSGi Mock 1.0.0
https://issues.apache.org/jira/browse/SLING/fixforversion/12328831

Sling Mock 1.0.0
https://issues.apache.org/jira/browse/SLING/fixforversion/12328832

Sling Mock Jackrabbit 0.1.0 *)
https://issues.apache.org/jira/browse/SLING/fixforversion/12328833


Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-1140/

You can use this UNIX script to download the release and verify the
signatures:
http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

Usage:
sh check_staged_release.sh 1140 /tmp/sling-staging

Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

This majority vote is open for at least 72 hours.

stefan

*) this is still experimental, thus only a 0.1.0 release.



RE: [VOTE] Release Apache Sling Resource Resolver Mock 1.0.0, JCR Mock 1.0.0, OSGi Mock 1.0.0, Sling Mock 1.0.0, Sling Mock Jackrabbit 0.1.0

2014-10-21 Thread Stefan Seifert
thanks tommaso for checking this ... but we still need one binding (PMC) vote 
for this.

stefan


-Original Message-
From: Tommaso Teofili [mailto:tommaso.teof...@gmail.com]
Sent: Tuesday, October 21, 2014 8:22 AM
To: dev@sling.apache.org
Subject: Re: [VOTE] Release Apache Sling Resource Resolver Mock 1.0.0, JCR
Mock 1.0.0, OSGi Mock 1.0.0, Sling Mock 1.0.0, Sling Mock Jackrabbit 0.1.0

+1

Tommaso

2014-10-17 10:56 GMT+02:00 Stefan Seifert sseif...@pro-vision.de:

 Hi,

 We solved 4 issues in this release of Resource Resolver Mock 1.0.0:
 https://issues.apache.org/jira/browse/SLING/fixforversion/12328721

 First release of this modules:

 JCR Mock 1.0.0
 https://issues.apache.org/jira/browse/SLING/fixforversion/12328830

 OSGi Mock 1.0.0
 https://issues.apache.org/jira/browse/SLING/fixforversion/12328831

 Sling Mock 1.0.0
 https://issues.apache.org/jira/browse/SLING/fixforversion/12328832

 Sling Mock Jackrabbit 0.1.0 *)
 https://issues.apache.org/jira/browse/SLING/fixforversion/12328833


 Staging repository:
 https://repository.apache.org/content/repositories/orgapachesling-1140/

 You can use this UNIX script to download the release and verify the
 signatures:
 http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

 Usage:
 sh check_staged_release.sh 1140 /tmp/sling-staging

 Please vote to approve this release:

   [ ] +1 Approve the release
   [ ]  0 Don't care
   [ ] -1 Don't release, because ...

 This majority vote is open for at least 72 hours.

 stefan

 *) this is still experimental, thus only a 0.1.0 release.




[RESULT] [VOTE] Release Apache Sling Resource Resolver Mock 1.0.0, JCR Mock 1.0.0, OSGi Mock 1.0.0, Sling Mock 1.0.0, Sling Mock Jackrabbit 0.1.0

2014-10-21 Thread Stefan Seifert
Hi,

The vote has passed with the following result :

+1 (binding): Carsten Ziegeler, Daniel Klco, Robert Munteanu
+1 (non binding): Tommaso Teofili

@any PMC member: please promote the releases to maven central and dist, i'll 
take care of JIRA and the website.

stefan


[RTC] ThreadLocal for getting current request in sling

2014-10-22 Thread Stefan Seifert
i propose to add a new feature to the Sling API and Sling Engine to access to 
the current request via an OSGi service, using a servlet filter and a thread 
local internally.

a proposal for such an implementation is currently part of sling models trunk, 
but should be renamed and moved to a more central part if we agree if it is a 
good idea. interface [1], impl [2].

we have already a comparable threadlocal concept for resource resolver [3]

my current usecases are:
- having the ability to inject context objects like request in any sling model, 
regardless of the adaptable. this is e.g. importing when adapting from a 
resource, but in context of a request (SLING-4083)
- configuration parameter override provider which injects overrides from HTTP 
header for test environments [4]

stefan

p.s. as pointed out by justin this topic was discussed already in the past, 
e.g. as a side-aspect of this thread [5]. this thread contains some more 
usecaes.


[1] 
https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/SlingObjectInjectorRequestContext.java

[2] 
https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/SlingObjectInjectorRequestContextFilter.java

[3] 
http://sling.apache.org/apidocs/sling7/org/apache/sling/api/resource/ResourceResolverFactory.html#getThreadResourceResolver--

[4] 
https://github.com/wcm-io/wcm-io/blob/master/config/core/src/main/java/io/wcm/config/core/override/impl/RequestHeaderOverrideProvider.java

[5] http://sling.markmail.org/thread/epn5vdw3fkmpsk6w



RE: [RTC] ThreadLocal for getting current request in sling

2014-10-22 Thread Stefan Seifert

 my current usecases are:
 - having the ability to inject context objects like request in any sling
model, regardless of the adaptable. this is e.g. importing when adapting from
a resource, but in context of a request (SLING-4083)

That should be possible to solve differently, such injection sounds like too
much magic to me. Why can't sling models have a clear API that passes in such
objects when they are created instead of going through a threadlocal?

sling models is based on a very simple API: adaptTo().

adaptTo passes in only the adaptable, and if this is not the request object 
there is no chance for the sling models implementation to get hold of it 
besides some not-so-clean way using a threadlocal.

but it's not always possible nor desired to just use the request as adaptable. 
e.g. if you handle multiple different resources inside your request and adapt 
them to a model and need access to the request there is no other way i can 
think of.


if fully agree that this way to access a request should not be the standard 
way, and in most usecases there should be a better way (although not in the 
wcm.io configuration example because it as well relies on adaptTo(), but do not 
discuss this here in this thread further). SlingObjectInjectorRequestContext 
was only an name internal to the implementation of sling models.

stefan



RE: [RTC] ThreadLocal for getting current request in sling

2014-10-24 Thread Stefan Seifert

Personally, I don't quite see the use case -- if your AdapterFactory
(whether it is generated by Sling Models or hand-coded) needs
request-based context, the adaptable is the request.

to shed some more light on my usecase an example:

- a sightly template calls a controller model, which adapts from the current 
request
- this model wants to output an object structed based on a complex data 
structure (e.g. a list of nodes with subnodes)
- this data structure cannot be used directly for output, but some properties 
need some special processing
- so we build a set of models for this data structures adapting to a resource 
for each node, injecting each other for @ChildResource for the hierarchy
- each of this resource models does post processing on some attributes, e.g.
  - resolving a media asset reference to a set of externalized image URLs for 
responsive imaging
  - externalizing an URL respecting sling short URL mapping
  - injecting dummy images or links for invalid references - but only if the 
edit mode of the CMS is active.
- this post processing is done with further models that implement the business 
logic to solve this centrally

it is an implementation details of the post processing business models that 
they need a request for some part of their job (e.g. distinguish between edit 
and preview mode). the caller of the initial adaption is not necessary aware of 
this and should not care of it in my point of view. if you call and OSGi 
service you do not have to know what services this has bound internally, OSGi 
takes care that all are resolved or the service is not available.

i'm not a fan of the proposals to extend the adaptTo() semantic for this 
usecase. not only because its difficult to do it without breaking existing code 
(or leads to an interface like Adaptable2), the caller should not have to now 
the implementation details for such cross-cutting concern models that are 
required deeper in the model structure. for the same reason extending the sling 
models factory interface or having additional setRequest() methods on the 
models are no fitting solutions - the model that is adapted initially is not 
the problem, but those further down the hierarchy.

having an interface like RequestScope is basicall going into the right 
direction - but who should detect this interface and inject the request? the 
sling models implementation? than we have the same problem not able to geht the 
request objects if it's not the adaptable. and sling models does not need such 
interfaces, its solely based on @Inject annotations.

this is getting a long thread, i'll write a summary to lead to a decision.

stefan



RE: [RTC] ThreadLocal for getting current request in sling - summary

2014-10-24 Thread Stefan Seifert
a summary of this thread:
- there are good ideas how to implement this, if we want to implement it (via 
the engine, not a servlet filter)
- but there are a lot of objections if we should add such a thread-local-based 
feature at all with good arguments
- still there are usecases for some of us (like me) for needing this, and other 
API changes do not seem to fulfill the goals


to proceed I see this alternatives:

A) revert my changes from SLING-4083, and do not support this feature in sling 
models and sling at all

B) do not add this feature as a main sling feature with a dedicated API, but 
only implement as it is currently in SLING-4083 to be usable inside sling models

C) add it as main feature to sling as part of the public API.


for B) and C) we would need a vote. 

for A) i still have the possibility to implement this outside sling in a custom 
sling models injector and a request filter, so i'll be fine with this way as 
well if the community does not want A) or B).


stefan


-Original Message-
From: Stefan Seifert [mailto:sseif...@pro-vision.de]
Sent: Wednesday, October 22, 2014 10:22 AM
To: dev@sling.apache.org
Subject: [RTC] ThreadLocal for getting current request in sling

i propose to add a new feature to the Sling API and Sling Engine to access to
the current request via an OSGi service, using a servlet filter and a thread
local internally.

a proposal for such an implementation is currently part of sling models
trunk, but should be renamed and moved to a more central part if we agree if
it is a good idea. interface [1], impl [2].

we have already a comparable threadlocal concept for resource resolver [3]

my current usecases are:
- having the ability to inject context objects like request in any sling
model, regardless of the adaptable. this is e.g. importing when adapting from
a resource, but in context of a request (SLING-4083)
- configuration parameter override provider which injects overrides from HTTP
header for test environments [4]

stefan

p.s. as pointed out by justin this topic was discussed already in the past,
e.g. as a side-aspect of this thread [5]. this thread contains some more
usecaes.


[1]
https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl/s
rc/main/java/org/apache/sling/models/impl/injectors/SlingObjectInjectorReques
tContext.java

[2]
https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl/s
rc/main/java/org/apache/sling/models/impl/injectors/SlingObjectInjectorReques
tContextFilter.java

[3]
http://sling.apache.org/apidocs/sling7/org/apache/sling/api/resource/Resource
ResolverFactory.html#getThreadResourceResolver--

[4] https://github.com/wcm-io/wcm-
io/blob/master/config/core/src/main/java/io/wcm/config/core/override/impl/Req
uestHeaderOverrideProvider.java

[5] http://sling.markmail.org/thread/epn5vdw3fkmpsk6w



RE: [RTC] ThreadLocal for getting current request in sling

2014-10-27 Thread Stefan Seifert
hello justin.

 it is an implementation details of the post processing business models that
they need a request for some part of their job (e.g. distinguish between edit
and preview mode). the caller of the initial adaption is not necessary aware
of this and should not care of it in my point of view.

This is all just an implementation choice. Nothing is forcing you do
to the post processing in an object which doesn't have the request.
You can just as easily (probably better) do that post processing in an
object which has direct access to the request. Or, as Alex suggested,
provide the request to those objects once they are adapted.

And of course the caller has to be aware that the request is
necessary. It is part of the context of that the execution of that
post processing.

in our current approach the post processing step should not be separate, and 
the user of the models should not be aware of it.
but we are still in the first few months of developing our new architecture 
style based on sling models, perhaps we think otherwise a few months ahead when 
the first applications with it are finished. it is too early for me to make a 
final judgement.

coming back to my summary post [1] I have the feeling we should go with A) 
currently, and see if others have the same needs for such a threadlocal in the 
future - or not. unit then i can continue experiment with it outside the main 
sling build.

stefan

[1] 
http://apache-sling.73963.n3.nabble.com/RE-RTC-ThreadLocal-for-getting-current-request-in-sling-summary-tt4042631.html




 if you call and OSGi service you do not have to know what services this has
bound internally, OSGi takes care that all are resolved or the service is not
available.

I don't think this is the right analogy. You aren't talking about
service dependencies, you are talking about the API. If I have a
method called getFoo(Object context) and the context object is
required for proper execution. If I pass null as the context object,
then I shouldn't expect to get a valid response.


 i'm not a fan of the proposals to extend the adaptTo() semantic for this
usecase. not only because its difficult to do it without breaking existing
code (or leads to an interface like Adaptable2), the caller should not have to
now the implementation details for such cross-cutting concern models that are
required deeper in the model structure. for the same reason extending the
sling models factory interface or having additional setRequest() methods on
the models are no fitting solutions - the model that is adapted initially is
not the problem, but those further down the hierarchy.

 having an interface like RequestScope is basicall going into the right
direction - but who should detect this interface and inject the request? the
sling models implementation? than we have the same problem not able to geht
the request objects if it's not the adaptable. and sling models does not need
such interfaces, its solely based on @Inject annotations.

As I said, this has nothing to do with Sling Models. It is a general
problem with adapters.

Justin


 this is getting a long thread, i'll write a summary to lead to a decision.

 stefan



RE: Jenkins build is still unstable: sling-trunk-1.8 » Apache Sling Event Support #381

2014-10-29 Thread Stefan Seifert
i tried to run the integration tests for the event part on my (windows) 
machines, sometimes the pass, sometimes they fail, not always with the same 
result. but never because of a port mismatch.

today I started a new try:

* windows 7 + JDK 1.7: tests passed (but a showing frightening lot of 
exceptions like  javax.jcr.InvalidItemStateException: Item does not exist 
anymore: 897fc158-e48e-480c-b5af-cc8d761d959a)


* windows 7 + JKD 1.8:

---
Failed tests:
  ChaosTest.testDoChaos:397 Checking topic sling/chaos/ordered/0 
expected:3387 but was:3386

Tests run: 20, Failures: 1, Errors: 0, Skipped: 0
---

* windows 7 + JKD 1.8 (repeated run without other changes - seems to hang up 
somewhere and than run into timeouts):

---
Failed tests:
  ClassloadingTest.testFailedClassloading:204 RetryLoop failed, condition is 
false after 5 seconds: Waiting for job failure to be recorded. Conditions 
faildJobsCount=0, finishedEvents=0, findJobs= 1, queuedJobs=0, active
Jobs=0
  ClassloadingTest.testSimpleClassloading:131 RetryLoop failed, condition is 
false after 5 seconds: Waiting for finishedEvents to have at least one element
  DeprecatedJobsTest.testSimpleJobExecutionUsingBridge:120 No event received in 
the given time.
  DeprecatedJobsTest.testSimpleJobWithIdExecution:147 No event received in the 
given time.
  JobHandlingTest.testSimpleJobExecutionUsingJobExecutor:139 No event received 
in the given time.
  JobHandlingTest.testStartJobAndReschedule:304 No event received in the given 
time.
  JobHandlingTest.testSimpleJobExecutionUsingJobConsumer:111 No event received 
in the given time.
  OrderedQueueTest.testOrderedQueue:147 No event received in the given time.
  RoundRobinQueueTest.testRoundRobinQueue:132 No event received in the given 
time.

Tests in error:
  ChaosTest.testDoChaos:393-AbstractJobHandlingTest.sleep:175 »  test timed 
out...
  DeprecatedJobsTest.testForceCancelJob:175 »  test timed out after 30 
milli...
  HistoryTest.testHistory:117 »  test timed out after 30 milliseconds
  JobHandlingTest.testNoJobProcessor:472 »  test timed out after 30 
millisec...
  JobHandlingTest.testNotifications:422  Timeout during notification test.
  JobHandlingTest.testManyJobs:180 »  test timed out after 30 milliseconds
  JobHandlingTest.testCancelJob:214 »  test timed out after 30 milliseconds
  JobHandlingTest.testGetJob:262 »  test timed out after 30 milliseconds
  TimedJobsTest.testTimedJob:84-AbstractJobHandlingTest.sleep:175 »  test 
timed...

Tests run: 20, Failures: 9, Errors: 9, Skipped: 0
---

with all this pax-exam stuff i do not know in detail it's difficult to tell 
where it makes sense debugging or further analyzing.
last week i had problems running the tests with JDK 1.7 as well, so i assume 
it's not a JDK 1.8 related issue.

stefan



-Original Message-
From: Carsten Ziegeler [mailto:cziege...@apache.org]
Sent: Tuesday, October 28, 2014 8:58 PM
To: dev@sling.apache.org
Subject: Re: Jenkins build is still unstable: sling-trunk-1.8 » Apache Sling
Event Support #381

Am 28.10.14 um 17:22 schrieb Apache Jenkins Server:
 See https://builds.apache.org/job/sling-trunk-
1.8/org.apache.sling$org.apache.sling.event/381/


This is a sporadic problem with Java 8 - it seems when a new Pax Exam
test starts, the old one isn't finished yet as the port is still in use
and the repository is locked.

Does anyone have a good idea how to workaround this problem or let pax
wait until really all threads are finished?

Or even better, can anyone reproduce this locally so we could get a
thread dump?

Carsten

--
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org


[Sling Models] performance optimization

2014-11-06 Thread Stefan Seifert
fyi, i've implemented some performance optimizations for sling models in a 
private branch as described in [1].
performance measurement results in the same ticket.

if no one objects i will apply this to the trunk next week, so other can test 
it using a snapshot as well.

stefan


[1] https://issues.apache.org/jira/browse/SLING-4112



RE: [ANN] New Apache Sling Committers: Konrad Windszus and Julian Sedding

2014-11-12 Thread Stefan Seifert
welcome to both of you! glad to have you onboard.

stefan

-Original Message-
From: Carsten Ziegeler [mailto:cziege...@apache.org]
Sent: Wednesday, November 12, 2014 3:02 PM
To: Sling Developers
Subject: [ANN] New Apache Sling Committers: Konrad Windszus and Julian Sedding

Hi

it's my pleasure to announce that the Apache Sling PMC has invited
Konrad Windszus and Julian Sedding as new Sling committers...and I'm
very happy that both accepted.

Please join me in welcoming Konrad and Julian.

@Konrad, @Julian you might wanna introduce yourself

Regards
Carsten
--
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org


RE: Sling Mocks: registering AdapterFactory service

2014-11-25 Thread Stefan Seifert
the first variant should work if SCR metadata are present in the classpath.
did you test this by running the unit tests on the command line, or within an 
IDE?
if you use eclipse make sure to use m2e and make sure the maven scr plugin gets 
executed as well before running the test (e.g. by clean/rebuild the project).

the latest (not-yet-relased) version of osgi-mock implements a better error 
handling when the SCR metadata is not present [1]

some of this hints are documented here: [2]. perhaps this could be more 
prominent.

stefan

[1] https://issues.apache.org/jira/browse/SLING-4165
[2] 
http://sling.apache.org/documentation/development/osgi-mock.html#activation-and-dependency-injection


-Original Message-
From: Robert Munteanu [mailto:romb...@apache.org]
Sent: Tuesday, November 25, 2014 3:39 PM
To: dev@sling.apache.org
Subject: Sling Mocks: registering AdapterFactory service

Hi,

I'm following the documentation at [1] to register a new adapter
factory service. I'm using the SlingContext @Rule for this.

What I see is that the short form does not work

context.registerService(new MyAdapterFactory());

However, the long form works

context.registerService(AdapterFactory.class, new MyAdapterFactory());

I'm not sure whether this is intended ( and therefore the docs should
be adjusted ) or a bug ( and therefore the code should be fixed ).

Thoughts?

Robert


[1]: http://sling.apache.org/documentation/development/sling-
mock.html#adapter-factories


RE: Debugging Sling Models IT

2014-12-05 Thread Stefan Seifert
what i did was adding the JVM debugging parameters the IT sling instance 
startup (jar.executor.vm.options, commented out), and then attached to the IT 
JVM while it was starting up (it takes some seconds while bundles are deploying 
before the tests really gets executed, so it's no problem to attach to it 
before they start). then the IT's stopped at my breakpoints as expected.

i never used the keepJarRunning flag.

stefan

-Original Message-
From: Konrad Windszus [mailto:konra...@gmx.de]
Sent: Friday, December 05, 2014 4:42 PM
To: dev@sling.apache.org
Subject: Debugging Sling Models IT


HI,
I need some help with resolving failures in the models.integration-
tests module (don’t worry, those only fail for me due to some local
changes).
I tried to run the integration-tests with mvn install with the option
keepJarRunningtrue/keepJarRunning (set inside the pom.xml) and to
start the launchpad with the remote debugging options set.
Now I get the following exception when executing the integration test

32492 [main] ERROR org.apache.sling.models.it.RemoteIT - Exception in
maybeStartServer()
java.lang.IllegalMonitorStateException
   at java.lang.Object.wait(Native Method)
   at java.lang.Object.wait(Object.java:503)
   at
org.apache.sling.testing.tools.sling.SlingTestBase.blockIfRequested(Sl
ingTestBase.java:234)
   at
org.apache.sling.testing.tools.sling.SlingTestBase.startServerIfNeeded
(SlingTestBase.java:152)
   at
org.apache.sling.testing.tools.sling.SlingTestBase.getServerBaseUrl(Sl
ingTestBase.java:211)
   at
org.apache.sling.models.it.RemoteIT.getJunitServletUrl(RemoteIT.java:2
8)
   at
org.apache.sling.junit.remote.testrunner.SlingRemoteTestRunner.maybeEx
ecuteTests(SlingRemoteTestRunner.java:95)
   at
org.apache.sling.junit.remote.testrunner.SlingRemoteTestRunner.getChil
dren(SlingRemoteTestRunner.java:138)
   at
org.junit.runners.ParentRunner.getFilteredChildren(ParentRunner.java:3
63)
   at
org.junit.runners.ParentRunner.getDescription(ParentRunner.java:297)
   at org.junit.runners.ParentRunner.run(ParentRunner.java:305)
   at
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider
.java:264)
   at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4P
rovider.java:153)
   at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.
java:124)
   at
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClas
sLoader(ForkedBooter.java:200)
   at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(Forke
dBooter.java:153)
   at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:1
03)

I don’t know why the IllegalMonitorStateException is triggered there.
Any idea?
Thanks in advance,
Konrad


[VOTE] Release Apache Sling Testing Sling Mock 1.1.0, OSGi Mock 1.1.0, JCR Mock 1.1.0, ResourceResolver Mock 1.1.0

2014-12-09 Thread Stefan Seifert
Hi,

We solved issues in this release:

Sling Mock 1.1.0 - 7 issues
https://issues.apache.org/jira/browse/SLING/fixforversion/12328857

OSGi Mock 1.1.0 - 8 issues
https://issues.apache.org/jira/browse/SLING/fixforversion/12328856

JCR Mock 1.1.0 - 3 issues
https://issues.apache.org/jira/browse/SLING/fixforversion/12328855

Resource Resolver Mock 1.1.0 - 2 issues
https://issues.apache.org/jira/browse/SLING/fixforversion/12328854

Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-1156/

You can use this UNIX script to download the release and verify the signatures:
http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

Usage:
sh check_staged_release.sh 1156 /tmp/sling-staging

Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

This majority vote is open for at least 72 hours.


stefan


RE: Whitespace handling in Sightly

2014-12-11 Thread Stefan Seifert
the Apache Sling JSP Script Handler has an OSGi configuration option Trim 
spaces, seems to based on a Jasper feature.

i would favor such a switch for the sightly script handler as well, instead of 
introducing such features in the sightly language itself or making it 
conditional for some tags. if you want to remove whitespaces, all unnecessary 
whitespaces should be removed, not only those of elements with unwrap.

stefan

-Original Message-
From: Konrad Windszus [mailto:konra...@gmx.de]
Sent: Thursday, December 11, 2014 11:41 AM
To: dev@sling.apache.org
Subject: Whitespace handling in Sightly

Hi,
since JSP 2.1 it is possible to remove extra whitespace characters from the
generated servlet by leveraging the trim-directive-whitespaces element on the
page directive (JSP 2.1 Spec, $JSP.3.3.8). Does Sightly comes with something
similar?
One example which leads to unwanted empty lines is like

link data-sly-call=“templatea data-sly-test.condition=“${true} data-sly-
unwrap/link
link data-sly-call=“templateb data-sly-test=${!condition} data-sly-
unwrap/link

Since either the first or second template is called you would end up with one
empty newline (which is not wanted).

Maybe data-sly-unwrap should also remove the line break from the output?
WDYT?

Konrad



RE: [VOTE] Release Apache Sling Testing Sling Mock 1.1.0, OSGi Mock 1.1.0, JCR Mock 1.1.0, ResourceResolver Mock 1.1.0

2014-12-13 Thread Stefan Seifert
one binding vote still missing...

stefan

-Original Message-
From: Stefan Seifert [mailto:sseif...@pro-vision.de]
Sent: Wednesday, December 10, 2014 12:58 AM
To: dev@sling.apache.org
Subject: [VOTE] Release Apache Sling Testing Sling Mock 1.1.0, OSGi Mock
1.1.0, JCR Mock 1.1.0, ResourceResolver Mock 1.1.0

Hi,

We solved issues in this release:

Sling Mock 1.1.0 - 7 issues
https://issues.apache.org/jira/browse/SLING/fixforversion/12328857

OSGi Mock 1.1.0 - 8 issues
https://issues.apache.org/jira/browse/SLING/fixforversion/12328856

JCR Mock 1.1.0 - 3 issues
https://issues.apache.org/jira/browse/SLING/fixforversion/12328855

Resource Resolver Mock 1.1.0 - 2 issues
https://issues.apache.org/jira/browse/SLING/fixforversion/12328854

Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-1156/

You can use this UNIX script to download the release and verify the
signatures:
http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

Usage:
sh check_staged_release.sh 1156 /tmp/sling-staging

Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

This majority vote is open for at least 72 hours.


stefan


[launchpad] uninstalled bundles get not uninstalled?

2014-12-15 Thread Stefan Seifert
in SLING-4226 encountered a strange bundle deployment problem in integration 
tests which I could reproduce with a few steps in launchpad and webconsole [1].

the generic steps are:
1. bundle B depends on exports of bundle A
2. bundle A is uninstalled - B is still running
3. bundle B can even be stopped/started, the dependencies to A still resolve 
although A is uninstalled and no longer visible in webconsole
4. after stopping/starting the launchpad/OSGi container B cannot be started due 
to missing dependency A - this is expected

how it this possible?
in what status is A after uninstalling?
shouldn't be bundle B stopped automatically by OSGi when A is uninstalled, or 
at least when then bundle is restarted?

stefan


[1] 
https://issues.apache.org/jira/browse/SLING-4226?focusedCommentId=14246855#comment-14246855



RE: [launchpad] uninstalled bundles get not uninstalled?

2014-12-15 Thread Stefan Seifert
ah, good point. it's documented here [2] as well.
i think we have to update the testing tools to issue a refresh package and the 
problem from SLING-4226 should be solved. will have a look into it.

stefan

[2] 
http://felix.apache.org/documentation/tutorials-examples-and-presentations/apache-felix-osgi-faq.html#when-i-update-my-bundle-why-are-my-bundles-old-classes-still-being-used


-Original Message-
From: Carsten Ziegeler [mailto:cziege...@apache.org]
Sent: Monday, December 15, 2014 6:36 PM
To: dev@sling.apache.org
Subject: Re: [launchpad] uninstalled bundles get not uninstalled?

Am 15.12.14 um 18:25 schrieb Stefan Seifert:
 in SLING-4226 encountered a strange bundle deployment problem in integration
tests which I could reproduce with a few steps in launchpad and webconsole
[1].

 the generic steps are:
 1. bundle B depends on exports of bundle A
 2. bundle A is uninstalled - B is still running
 3. bundle B can even be stopped/started, the dependencies to A still resolve
although A is uninstalled and no longer visible in webconsole
 4. after stopping/starting the launchpad/OSGi container B cannot be started
due to missing dependency A - this is expected

 how it this possible?
 in what status is A after uninstalling?
 shouldn't be bundle B stopped automatically by OSGi when A is uninstalled,
or at least when then bundle is restarted?

At least at step 2 bundle B is still wired to A until a package refresh
is done, so resources (class loader) of A is really only freed after
package refresh (if another bundle is wired to A).
For 3. as start/stop does not rewire bundle B, its still the same.

So, general rule is: if you uninstall a bundle, make sure to invoke a
package refresh, unless you want other bundles to continue to be wired
to the uninstalled instance.

Carsten
--
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org


FW: [RESULT] [VOTE] Release Apache Sling Testing Sling Mock 1.1.0, OSGi Mock 1.1.0, JCR Mock 1.1.0, ResourceResolver Mock 1.1.0

2014-12-16 Thread Stefan Seifert
@any PMC member: please copy the released artifacts to dist.

stefan


-Original Message-
From: Stefan Seifert [mailto:sseif...@pro-vision.de] 
Sent: Monday, December 15, 2014 9:54 AM
To: dev@sling.apache.org
Subject: [RESULT] [VOTE] Release Apache Sling Testing Sling Mock 1.1.0, OSGi 
Mock 1.1.0, JCR Mock 1.1.0, ResourceResolver Mock 1.1.0

Hi,

The vote has passed with the following result :

+1 (binding): Robert Munteanu, Carsten Ziegeler, Chetan Mehrotra 

I will promote the artifacts to the central Maven repository and update the CMS 
site.

@any PMC member: please copy the released artifacts to dist.

stefan


RE: Can we reduce the amount of Jenkins mails?

2014-12-17 Thread Stefan Seifert
it seems that what fails are mainly different integration tests.

we could add a special maven profile in those projects that have failing 
integration tests that disables the IT in only that project, and create a 
ticket for each project to track that we remove it when the IT problem is 
solved. on Jenkins this profile is enabled so these problematic ITs are skipped 
by default, but not when running them locally withouth the profile.

those integration tests are not only problematic on jenkins, i have problems 
running them with windows as well. a starting point before analyzing deeper the 
root cause of the failing might by updating the involved testing tools, e.g. 
sling testing tools, pax exam etc. the ITs use quite different version 
currently.

stefan


-Original Message-
From: Carsten Ziegeler [mailto:cziege...@apache.org]
Sent: Wednesday, December 17, 2014 9:32 AM
To: Sling Developers
Subject: Can we reduce the amount of Jenkins mails?

I think the wast amount of jenkins mails is really really annoying;
and
we have them for a very long time (yes, I know I can easily filter
them
out).
I seriously think either we fix the problems or stop flooding the
mailing list.

Carsten
--
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org


RE: Can we reduce the amount of Jenkins mails?

2014-12-17 Thread Stefan Seifert
So what about disabling all jobs on Jenkins, and enable just one and
try
to get that one running clean, then we can enable the next one etc.?

yes, this would be a way. perhaps start with a main build job that builds all 
projects, runs all unit tests, but without any integration tests. then add 
integration tests one after another.
i've no overview how the jobs on Jenkins are currently structured (and who has 
the rights to change them).

stefan


RE: Can we reduce the amount of Jenkins mails?

2014-12-17 Thread Stefan Seifert

 Sure, do we know what broke it?

I don't know yet. In theory whoever made those breaking changes should
have run the tests and seen the failures...

the problem is that these integration tests run on some environments, and on 
some not, on some they succeed sometime and sometimes not. this makes it so 
difficult to spot the real problem, maybe its just a racing condition or 
similar. thus my proposal to deactivate those tests in Jenkins for now and 
create a ticket for each one. we pick one to start with and ask around who has 
an environment where those tests fail every time or most times and try to find 
the issue. if it then runs on those environment we have a good chance that it 
will run on Jenkins as well.

stefan



FW: [RESULT] [VOTE] Release Apache Sling Testing Sling Mock 1.1.0, OSGi Mock 1.1.0, JCR Mock 1.1.0, ResourceResolver Mock 1.1.0

2014-12-18 Thread Stefan Seifert
@any PMC member: please copy the released artifacts to dist.

stefan


-Original Message-
From: Stefan Seifert [mailto:sseif...@pro-vision.de] 
Sent: Tuesday, December 16, 2014 12:05 PM
To: dev@sling.apache.org
Subject: FW: [RESULT] [VOTE] Release Apache Sling Testing Sling Mock 1.1.0, 
OSGi Mock 1.1.0, JCR Mock 1.1.0, ResourceResolver Mock 1.1.0

@any PMC member: please copy the released artifacts to dist.

stefan


-Original Message-
From: Stefan Seifert [mailto:sseif...@pro-vision.de] 
Sent: Monday, December 15, 2014 9:54 AM
To: dev@sling.apache.org
Subject: [RESULT] [VOTE] Release Apache Sling Testing Sling Mock 1.1.0, OSGi 
Mock 1.1.0, JCR Mock 1.1.0, ResourceResolver Mock 1.1.0

Hi,

The vote has passed with the following result :

+1 (binding): Robert Munteanu, Carsten Ziegeler, Chetan Mehrotra 

I will promote the artifacts to the central Maven repository and update the CMS 
site.

@any PMC member: please copy the released artifacts to dist.

stefan


RE: [PROPOSAL] Context-specific configuration for Apache Sling, Multitenancy

2015-01-23 Thread Stefan Seifert
hello oliver.

what's the status here? Will you move this project to Sling?

this is not decided yet, no precise plans yet. this depends if it is useful for 
a broader audience in the sling community and projects/applications built with 
sling. until then just try it out from wcm.io. additionally i wanted to 
experiment with carstens idea to define configuration parameters using 
annotation classes as defined in the new OSGi specifications, but i had found 
no time for this yet.
we already use this in production, but surely there is still room for 
improvement.


Is it possible to read/write configurations of the current resource only or
are configurations always collected up the tree?

this depends on the configuration finder strategey used. our intention is 
that the configuration is normally not in the current resource, but always 
somewhere up in the tree. or in a shadow tree like /conf. see [1] and [2] for 
details.


stefan

[1] http://wcm.io/config/api/terminology.html
[2] http://wcm.io/config/api/usage-spi.html




RE: [RT] Sling Resource Providers for NoSQL databases - MongoDB, Couchbase

2015-02-02 Thread Stefan Seifert

ok - my next plan is to create a branch for a proof of concept couchbase
resource adapter including a proposal for a shared part of nosql providers
(and create a ticket for further discussion).

ticket and whiteboard branch created:
https://issues.apache.org/jira/browse/SLING-4381

stefan


RE: [RT] Ideas for a multi-tenant and multi-module content model

2015-02-02 Thread Stefan Seifert
hello bertrand.

some notes from my side:

* multi tenant scenario
- what you describe is a solution for the virtual hosting multi-tenant 
scenario as described here https://cwiki.apache.org/confluence/x/So2uAg
- if this should be usable for the massive multi site scenario as well 
additional requirements like nested tenants should be taken into account as 
well.

* tenant-specific OSGi bundles
- you plan for a solution to deploy tenant-specific OSGi bundles (using the 
amdatu solution or something similar)
- i think this is a very important point, because a tenant concept that only 
supports tenant-specific scripts but no tenant-specific OSGi bundles will 
prevent it to be usable for complex real-world applications
- how do you want to protect against malicious code that may be introduced by a 
tenant-specific bundle? event with a amdatu-like solution you have to grant 
access to a lot of core bundles e.g. providing resource resolver or JCR API, 
and it will be easy for the tenant's code to find ways to get system-wide 
access to all content in the repositories, including that of other tenants.
- are we sure we find ways to protect against this in reliable manner?

* tenant identification
- you propose that the tenant identifier is always the next level below 
/content.
- this is quite inflexible, it should be possible to allow a deeper structure 
to group tenants, and define via configuration or content properties where the 
tenant identification starts
- this is not only useful for a better overview of the tenants, but for 
sharding scenarios as well where different groups of tenants are stored at 
different machines or web centers

* modules/X/content/default
- i do not fully understand this section, how should this work if multiple 
independent modules are used by a tenant, and if the further content structure 
below the tenant identification node is not known (he may have multiple sites 
for example)


stefan


-Original Message-
From: Bertrand Delacretaz [mailto:bdelacre...@apache.org]
Sent: Tuesday, January 27, 2015 6:55 PM
To: dev
Subject: [RT] Ideas for a multi-tenant and multi-module content model

Hi,

I've been thinking a lot about a content model that would help Sling
applications be naturally friendly to multi-tenancy and to continuous
deployment where multiple versions of modules need to coexist.

I have now written those thoughts down at
https://cwiki.apache.org/confluence/display/SLING/Ideas+for+a+multi-
tenant+and+multi-module+content+model

Feedback is welcome but please keep in mind that this is mostly just
thinking outloud at this point.

Credit goes to Dominik Suess for the assemblies idea, it looks like
this intermediate routing layer might help make sense of complex
multi-T and multi-M systems.

-Bertrand


RE: Please welcome Tomek Rękawek as a Sling committer!

2015-02-05 Thread Stefan Seifert
welcome aboard!

stefan

-Original Message-
From: Bertrand Delacretaz [mailto:bdelacre...@apache.org]
Sent: Thursday, February 05, 2015 1:47 PM
To: dev
Subject: Please welcome Tomek Rękawek as a Sling committer!

Hi Sling community,

Based on his ongoing and valuable contributions to the project,
including the Sling Query module (and not to mention implementing the
Towers of Hanoi in Sightly ;-), the Sling PMC has elected Tomek
Rękawek as a Sling committer, and he has accepted the invitation.

Please join me in welcoming him!

Tomek if you want to honor the old tradition of new committers briefly
introducing themselves to the list, feel free.

If needed the new committers info is at
http://www.apache.org/dev/new-committers-guide.html and generally
under http://www.apache.org/dev/ - and feel free to ask if you have
any questions.

Congrats and keep up the good work!

-Bertrand, for the Sling PMC

P.S. I have updated
http://sling.apache.org/project-information/project-team.html but
we'll need to add your username once your Apache ID is created. And
you affiliation if you want to mention it.


[VOTE] Release Apache Sling Testing JCR Mock 1.1.2, ResourceResolver Mock 1.1.2, Sling Mock 1.1.2, Sling Mock Jackrabbit 0.1.2

2015-01-22 Thread Stefan Seifert
Hi,

We solved 2 issues in JCR Mock 1.1.2:
https://issues.apache.org/jira/browse/SLING/fixforversion/12329091

We solved 2 issues in ResourceResolver Mock 1.1.2:
https://issues.apache.org/jira/browse/SLING/fixforversion/12329092

We solved 3 issues in Sling Mock 1.1.2:
https://issues.apache.org/jira/browse/SLING/fixforversion/12329089

We solved 2 issues in Sling Mock Jackrabbit 0.1.2:
https://issues.apache.org/jira/browse/SLING/fixforversion/12328858

Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-1175/

You can use this UNIX script to download the release and verify the signatures:
http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

Usage:
sh check_staged_release.sh 1175 /tmp/sling-staging

Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

This majority vote is open for at least 72 hours.


stefan


[RESULT] [VOTE] Release Apache Sling Testing JCR Mock 1.1.2, ResourceResolver Mock 1.1.2, Sling Mock 1.1.2, Sling Mock Jackrabbit 0.1.2

2015-01-28 Thread Stefan Seifert
Hi,

The vote has passed with the following result:

+1 (binding): Robert Munteanu, Carsten Ziegeler, Stefan Egli

I will promote the artifacts to the central Maven repository and update this 
sling site.

@any PMC member: please copy this release to the Sling dist directory.

stefan


RE: [RT] Sling Resource Providers for NoSQL databases - MongoDB, Couchbase

2015-01-29 Thread Stefan Seifert

 1. what is the status of the mongodb provider? is someone using it already
in production? looking at the code it seems to be not threadsafe concerning
the CRUD handling with non-synchronized hash maps.

Afaik, there are people using that code slightly modified (not sure what
the changes are) in production. I think the impl is thread safe as a
resource provider by itself must not be thread safe. But if it's not, we
should fix it.

ah, i see. each resource resolver gets its own instance of resource providers, 
so the resource provider itself does not have to care about concurrency because 
resource resolver is not thread-safe either. this makes the implementation 
simpler.


In general it would be cool to have some more/better NoSQL support in
Sling to attract devs using these storages.

ok - my next plan is to create a branch for a proof of concept couchbase 
resource adapter including a proposal for a shared part of nosql providers (and 
create a ticket for further discussion).

stefan


RE: [RT] Sling Resource Providers for NoSQL databases - MongoDB, Couchbase

2015-01-27 Thread Stefan Seifert
yes, this is a good point. have to think about it.

on the first sight it feels a bit heavyweight for my usecase: in an 
osgi-microservice scenario without JCR/oak, and currently without sling engine 
but with some sling subprojects including launchpad i want to use sling 
distributed events and job processing and discovery. but the current 
implementations need to store some small parts of data in a shared repository, 
for which couchbase would suit well because it's used already by the 
microservices. but this is of course a very special usecase.

stefan

-Original Message-
From: Bertrand Delacretaz [mailto:bdelacre...@apache.org]
Sent: Tuesday, January 27, 2015 5:38 PM
To: dev
Subject: Re: [RT] Sling Resource Providers for NoSQL databases - MongoDB,
Couchbase

Hi,

On Tue, Jan 27, 2015 at 5:09 PM, Stefan Seifert sseif...@pro-vision.de
wrote:
 ...we currently evaluate to integrate a Couchbase NoSQL database [1] into a
sling resource tree...

As mentioned in a different thread about DynamoDB, it might be
interesting to consider writing a Couchbase backend for Oak instead.

The advantages are inheriting Oak's indexing and other useful JCR
features, and maybe that helps with the other issues that you mention,
transient space etc.

It's probably a bit more complicated, IIUC the current recommended way
is to implement an Oak DocumentStore, but that should be checked with
the Oak team.

-Bertrand


[RT] Sling Resource Providers for NoSQL databases - MongoDB, Couchbase

2015-01-27 Thread Stefan Seifert
we currently evaluate to integrate a Couchbase NoSQL database [1] into a sling 
resource tree. as a starting point i had a deeper look on the MongoDB resource 
provider [2], because the concept is quite similar.

some thoughts on this:

1. what is the status of the mongodb provider? is someone using it already in 
production? looking at the code it seems to be not threadsafe concerning the 
CRUD handling with non-synchronized hash maps.

2. how to map resource URLs to NoSQL: the mongodb provider has a syntax like:
root_path/collection/custom_path
where root_path and the mongodb database name is configurable via OSGi 
(multiple entry points possible), collection has to match with an existing 
collection in mongodb and the remaining path is mapped to a property in a 
document in the collection.
i wonder if this is the best solution, the collection path part seems too 
restrictive to me (fails if the collection does not exist). i would favor 
specifying both root_path and collection via osgi allowing entry points with an 
unconstrained tree hierarchy below.
couchbase for example does not have such a collection concept, it has only 
bucket which is comparable to the mongodb database.

3. the resource provider mixes up the in-memory CRUD handling with keeping maps 
of changed/deleted resources, and the mapping to the NoSQL structure. if these 
two aspects would be separated the former could be reused for all NoSQL 
databases and the latter is responsible only for the flat list 
resource-to-document mapping and will be different for each NoSQL database. 
bonus: the thread-safety of the CRUD handling has to be implemented only once, 
not once for each resource provider.
additional logic like type mapping values to strings, generic value map 
implementations, automatic tree creation etc. could be shared between all NoSQL 
providers.

4. an open point is whether to support binary data as well, or to leave it out 
in the first phase. storing binary data may be problematic for some NoSQL 
databases, requiring a separate storage concept for this. the mongodb resource 
provider currently does not support binary data.

5. there were plans to create a SOLR sling resource provider [3][4], which goes 
roughly in the same direction; but it seems it had no outcome.

WDYT?

stefan

[1] http://www.couchbase.com
[2] https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/mongodb
[3] https://issues.apache.org/jira/browse/SLING-2795
[4] 
http://apache-sling.73963.n3.nabble.com/GSoC-2013-Apache-Solr-backend-for-Apache-Sling-tt4023347.html



  1   2   3   4   5   6   7   8   9   10   >