[jira] [Commented] (JCRVLT-388) Subpackage not installed in defined order

2019-10-25 Thread Ben Zahler (Jira)


[ 
https://issues.apache.org/jira/browse/JCRVLT-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16959718#comment-16959718
 ] 

Ben Zahler commented on JCRVLT-388:
---

[~kwin]
I did try adding a dependency to aem-apps-sites-content in 
aem-permissions-author (using pom.xml), but that did not help. I will try again 
to verify if that dependency is promoted correctly to filevalut properties.

> Subpackage not installed in defined order
> -
>
> Key: JCRVLT-388
> URL: https://issues.apache.org/jira/browse/JCRVLT-388
> Project: Jackrabbit FileVault
>  Issue Type: Bug
>Affects Versions: 3.2.8
>    Reporter: Ben Zahler
>Priority: Minor
>
> I have a package with subpackages that need to be installed in a specific 
> order.
> In my case, one package contains the content and the other package contains 
> permissions to be installed on top of that content.
> My package has the following filter:
> 
>   root="/etc/packages/com.axa.ch.aem/aem-apps-sites-content-3.57.2-SNAPSHOT.zip"
>  />
>   root="/etc/packages/com.axa.ch.aem/aem-permissions-author-3.57.2-SNAPSHOT.zip"
>  />
> 
>  
> *Expected*: aem-apps-sites-content is installed first, then 
> aem-permissions-author
> *Actual*: Installation order is not deterministic and not defined by the 
> filter definition.
> I did check the source code and found out that the order is defined from 
> reading the files in the zip file (using java.util.zip), so this cannot (and 
> probably should be) changed.
> My suggesion is to order the subpages by adding the following method to 
> Importer.java and calling it from here:
> [https://github.com/apache/jackrabbit-filevault/blob/60c66c3cb7fe456c6e1fd6599736afdddec862a4/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/io/Importer.java#L472|https://github.com/apache/jackrabbit-filevault/blob/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/io/Importer.java#L472]
>  
> {color:#808080}private List getOrderedSubPackages(){{color}
>  List orderedSubPackages = {color:#cc7832}new 
> {color}LinkedList<>(){color:#cc7832};
> {color}{color:#cc7832} if 
> {color}({color:#cc7832}this{color}.{color:#9876aa}filter {color}== 
> {color:#cc7832}null {color}|| 
> {color:#cc7832}this{color}.{color:#9876aa}subPackages {color}== 
> {color:#cc7832}null {color}|| 
> {color:#cc7832}this{color}.{color:#9876aa}subPackages{color}.isEmpty()) {
>  {color:#cc7832}return {color}orderedSubPackages{color:#cc7832};
> {color} }
>  {color:#cc7832}final {color}List unOrderedSubPackages = 
> {color:#cc7832}new 
> {color}ArrayList<>({color:#cc7832}this{color}.{color:#9876aa}subPackages{color}){color:#cc7832};{color}{color:#cc7832}
> {color}{color:#cc7832}
> {color}{color:#cc7832} for {color}(PathFilterSet filterSet : 
> {color:#cc7832}this{color}.{color:#9876aa}filter{color}.getFilterSets()) {
>  {color:#cc7832}for {color}(String subPackage : unOrderedSubPackages) {
>  {color:#cc7832}if {color}(filterSet.contains(subPackage) && 
> !orderedSubPackages.contains(subPackage)) {
>  orderedSubPackages.add(subPackage){color:#cc7832};
> {color} }
>  }
>  }
>  {color:#cc7832}return {color}orderedSubPackages{color:#cc7832};
> {color}}
>  
> Let me know if you think this makes sense, if yes I'm happy to check out/ 
> build the code and provide a patch with unit tests.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (JCRVLT-388) Subpackage not installed in defined order

2019-10-25 Thread Ben Zahler (Jira)


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

Ben Zahler updated JCRVLT-388:
--
Affects Version/s: 3.2.8

I tested this with 3.2.8, but I think 3.4.0 is also affected, I could not find 
any rleated code changes or Jira tickets

> Subpackage not installed in defined order
> -
>
> Key: JCRVLT-388
> URL: https://issues.apache.org/jira/browse/JCRVLT-388
> Project: Jackrabbit FileVault
>  Issue Type: Bug
>Affects Versions: 3.2.8
>    Reporter: Ben Zahler
>Priority: Minor
>
> I have a package with subpackages that need to be installed in a specific 
> order.
> In my case, one package contains the content and the other package contains 
> permissions to be installed on top of that content.
> My package has the following filter:
> 
>   root="/etc/packages/com.axa.ch.aem/aem-apps-sites-content-3.57.2-SNAPSHOT.zip"
>  />
>   root="/etc/packages/com.axa.ch.aem/aem-permissions-author-3.57.2-SNAPSHOT.zip"
>  />
> 
>  
> *Expected*: aem-apps-sites-content is installed first, then 
> aem-permissions-author
> *Actual*: Installation order is not deterministic and not defined by the 
> filter definition.
> I did check the source code and found out that the order is defined from 
> reading the files in the zip file (using java.util.zip), so this cannot (and 
> probably should be) changed.
> My suggesion is to order the subpages by adding the following method to 
> Importer.java and calling it from here:
> [https://github.com/apache/jackrabbit-filevault/blob/60c66c3cb7fe456c6e1fd6599736afdddec862a4/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/io/Importer.java#L472|https://github.com/apache/jackrabbit-filevault/blob/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/io/Importer.java#L472]
>  
> {color:#808080}private List getOrderedSubPackages(){{color}
>  List orderedSubPackages = {color:#cc7832}new 
> {color}LinkedList<>(){color:#cc7832};
> {color}{color:#cc7832} if 
> {color}({color:#cc7832}this{color}.{color:#9876aa}filter {color}== 
> {color:#cc7832}null {color}|| 
> {color:#cc7832}this{color}.{color:#9876aa}subPackages {color}== 
> {color:#cc7832}null {color}|| 
> {color:#cc7832}this{color}.{color:#9876aa}subPackages{color}.isEmpty()) {
>  {color:#cc7832}return {color}orderedSubPackages{color:#cc7832};
> {color} }
>  {color:#cc7832}final {color}List unOrderedSubPackages = 
> {color:#cc7832}new 
> {color}ArrayList<>({color:#cc7832}this{color}.{color:#9876aa}subPackages{color}){color:#cc7832};{color}{color:#cc7832}
> {color}{color:#cc7832}
> {color}{color:#cc7832} for {color}(PathFilterSet filterSet : 
> {color:#cc7832}this{color}.{color:#9876aa}filter{color}.getFilterSets()) {
>  {color:#cc7832}for {color}(String subPackage : unOrderedSubPackages) {
>  {color:#cc7832}if {color}(filterSet.contains(subPackage) && 
> !orderedSubPackages.contains(subPackage)) {
>  orderedSubPackages.add(subPackage){color:#cc7832};
> {color} }
>  }
>  }
>  {color:#cc7832}return {color}orderedSubPackages{color:#cc7832};
> {color}}
>  
> Let me know if you think this makes sense, if yes I'm happy to check out/ 
> build the code and provide a patch with unit tests.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (JCRVLT-388) Subpackage not installed in defined order

2019-10-25 Thread Ben Zahler (Jira)
Ben Zahler created JCRVLT-388:
-

 Summary: Subpackage not installed in defined order
 Key: JCRVLT-388
 URL: https://issues.apache.org/jira/browse/JCRVLT-388
 Project: Jackrabbit FileVault
  Issue Type: Bug
Reporter: Ben Zahler


I have a package with subpackages that need to be installed in a specific order.

In my case, one package contains the content and the other package contains 
permissions to be installed on top of that content.

My package has the following filter:


 
 


 

*Expected*: aem-apps-sites-content is installed first, then 
aem-permissions-author
*Actual*: Installation order is not deterministic and not defined by the filter 
definition.

I did check the source code and found out that the order is defined from 
reading the files in the zip file (using java.util.zip), so this cannot (and 
probably should be) changed.

My suggesion is to order the subpages by adding the following method to 
Importer.java and calling it from here:
[https://github.com/apache/jackrabbit-filevault/blob/60c66c3cb7fe456c6e1fd6599736afdddec862a4/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/io/Importer.java#L472|https://github.com/apache/jackrabbit-filevault/blob/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/io/Importer.java#L472]

 

{color:#808080}private List getOrderedSubPackages(){{color}
 List orderedSubPackages = {color:#cc7832}new 
{color}LinkedList<>(){color:#cc7832};
{color}{color:#cc7832} if 
{color}({color:#cc7832}this{color}.{color:#9876aa}filter {color}== 
{color:#cc7832}null {color}|| 
{color:#cc7832}this{color}.{color:#9876aa}subPackages {color}== 
{color:#cc7832}null {color}|| 
{color:#cc7832}this{color}.{color:#9876aa}subPackages{color}.isEmpty()) {
 {color:#cc7832}return {color}orderedSubPackages{color:#cc7832};
{color} }
 {color:#cc7832}final {color}List unOrderedSubPackages = 
{color:#cc7832}new 
{color}ArrayList<>({color:#cc7832}this{color}.{color:#9876aa}subPackages{color}){color:#cc7832};{color}{color:#cc7832}
{color}{color:#cc7832}
{color}{color:#cc7832} for {color}(PathFilterSet filterSet : 
{color:#cc7832}this{color}.{color:#9876aa}filter{color}.getFilterSets()) {
 {color:#cc7832}for {color}(String subPackage : unOrderedSubPackages) {
 {color:#cc7832}if {color}(filterSet.contains(subPackage) && 
!orderedSubPackages.contains(subPackage)) {
 orderedSubPackages.add(subPackage){color:#cc7832};
{color} }
 }
 }
 {color:#cc7832}return {color}orderedSubPackages{color:#cc7832};
{color}}

 

Let me know if you think this makes sense, if yes I'm happy to check out/ build 
the code and provide a patch with unit tests.

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


Re: Oak Training: MikroKernels/NodeStores

2014-04-10 Thread Ben Zahler
Thanks, Thomas, the term MongoDataStore was a mistake on my side (meant to
write MongoDocumentStore).

I will discuss the other points with Michael, who is responsible for the
training on the Adobe side.


Regards,
Ben Zahler

Inside Solutions AG | Felsenstrasse 11 | 4450 Sissach | Schweiz
Telefon: +41 61 551 00 40 | Direkt: +41 61 551 00 43
http://www.inside-solutions.ch http://www.inside-solutions.ch/





Am 07.04.14 12:16 schrieb Thomas Mueller unter muel...@adobe.com:

Hi,

Since a CQ developer/architect must know the options for Oak
architectures, I think the concepts of MikroKernel, NodeStore and
DataStore must be part of the training. The actual APIs are not described
in the training.

Well, at the moment, the MicroKernel and the NodeStore are purely internal
APIs. We might change (rename, whatever) those APIs without affecting the
users. That's why I would not document those. What is important and needs
to be documented is the Mongo storage, and the Tar storage. But I would
not use purely internal names, and specially I would not use the names
MikroKernel and NodeStore, because that already caused confusion in the
past.

The DataStore API is less internal, I think it's OK to document it. Even
thought, it's also problematic. I would just document that there are
multiple way to store binaries: store them in the file system as separate
files, store them in the file system inside the Tar file (for the Tar
storage), store them in S3, store them in MongoDB. The DataStore API is
only used for two of those cases: separate files, and S3. The term
MongoDataStore doesn't exist in Oak (not even internally), so please
don't use it.

Regards,
Thomas





On 03/04/14 16:27, Ben Zahler ben.zah...@inside-solutions.ch wrote:

Hi Thomas,
This is a AEM6 training that I am writing, so it¹s not exactly Oak
documentation, and the delivery format is a word file.

Of course if you feel that the documentation is helpful to the Oak
project, it may make sense to add it to the oak-doc project.

About your comments:
Since a CQ developer/architect must know the options for Oak
architectures, I think the concepts of MikroKernel, NodeStore and
DataStore must be part of the training. The actual APIs are not described
in the training.

We describe MongoDB and the MongoDataStore in other sections of the
training (complete training:
http://oak.inside-apps.com/AEM6_OAK_Training_StudentWorkbook_v0-9-1.docx
,
review/oak4502). RDBMS was not described in deatil because afaik it is
not
yet officially supported as a storage in CQ (please correct me if I¹m
wrong).

Does that make sense for you?

Regards,
Ben Zahler

Inside Solutions AG | Felsenstrasse 11 | 4450 Sissach | Schweiz
Telefon: +41 61 551 00 40 | Direkt: +41 61 551 00 43
http://www.inside-solutions.ch http://www.inside-solutions.ch/





Am 03.04.14 11:45 schrieb Thomas Mueller unter muel...@adobe.com:

Hi,

This is user documentation, right? We have a documentation project,
oak-doc, could you provide patches for that instead of writing
documentation in a Word file? I think that would be much more helpful.
Otherwise, your documentation will very quickly get ouf of date, unless
you spend a lot of time updating it. It's kind of the same as with copy

paste of source code: it's problematic because it increases mainteance,
as
well as the probability of bugs.

As for documentation that is product specific, I would keep that
separate
and link to the relevant sections of the Oak documentation.

So far, both the NodeStore and the MicroKernel APIs are internal APIs,
and
they don't affect the users of Oak. So I wouldn't mention them in user
documentation. If they are documented, that should be in internal
architecture and design documentation, meant for Oak developers, and not
Oak users.

What I would document is MongoDB storage, RDBMS storage, Tar file
storage.
The advantages / disadvantages, features and limitations, how to
configure
them, and so on.

I would keep the documentation about the Document format, in the MongoDB
storage section, because that's useful to analyze existing repositories
(to find problems, to get statistics, and so on). The details of that
data
model may change, but not that often, so I think it makes sense to
document it.

Regards,
Thomas





On 03/04/14 07:45, Ben Zahler ben.zah...@inside-solutions.ch wrote:

Hi all,
after the last review feedback, I have revised the section on
MicroKernels and NodeStores.

I would appreciate any feedback if this new version is both technically
correct and also using the right terms.

The revised section is available here (User : review/Pwd: oak4502):
http://oak.inside-apps.com/Review_Microkernels_NodeStores.docx

Thanks in advance for any comments!

Regards,
Ben Zahler

Inside Solutions AG | Felsenstrasse 11 | 4450 Sissach | Schweiz
Telefon: +41 61 551 00 40 | Direkt: +41 61 551 00 43
http://www.inside-solutions.chhttp://www.inside-solutions.ch/





Re: Oak Training: MikroKernels/NodeStores

2014-04-03 Thread Ben Zahler
Hi Thomas,
This is a AEM6 training that I am writing, so it¹s not exactly Oak
documentation, and the delivery format is a word file.

Of course if you feel that the documentation is helpful to the Oak
project, it may make sense to add it to the oak-doc project.

About your comments:
Since a CQ developer/architect must know the options for Oak
architectures, I think the concepts of MikroKernel, NodeStore and
DataStore must be part of the training. The actual APIs are not described
in the training.

We describe MongoDB and the MongoDataStore in other sections of the
training (complete training:
http://oak.inside-apps.com/AEM6_OAK_Training_StudentWorkbook_v0-9-1.docx ,
review/oak4502). RDBMS was not described in deatil because afaik it is not
yet officially supported as a storage in CQ (please correct me if I¹m
wrong).

Does that make sense for you?

Regards,
Ben Zahler

Inside Solutions AG | Felsenstrasse 11 | 4450 Sissach | Schweiz
Telefon: +41 61 551 00 40 | Direkt: +41 61 551 00 43
http://www.inside-solutions.ch http://www.inside-solutions.ch/





Am 03.04.14 11:45 schrieb Thomas Mueller unter muel...@adobe.com:

Hi,

This is user documentation, right? We have a documentation project,
oak-doc, could you provide patches for that instead of writing
documentation in a Word file? I think that would be much more helpful.
Otherwise, your documentation will very quickly get ouf of date, unless
you spend a lot of time updating it. It's kind of the same as with copy 
paste of source code: it's problematic because it increases mainteance, as
well as the probability of bugs.

As for documentation that is product specific, I would keep that separate
and link to the relevant sections of the Oak documentation.

So far, both the NodeStore and the MicroKernel APIs are internal APIs, and
they don't affect the users of Oak. So I wouldn't mention them in user
documentation. If they are documented, that should be in internal
architecture and design documentation, meant for Oak developers, and not
Oak users.

What I would document is MongoDB storage, RDBMS storage, Tar file storage.
The advantages / disadvantages, features and limitations, how to configure
them, and so on.

I would keep the documentation about the Document format, in the MongoDB
storage section, because that's useful to analyze existing repositories
(to find problems, to get statistics, and so on). The details of that data
model may change, but not that often, so I think it makes sense to
document it.

Regards,
Thomas





On 03/04/14 07:45, Ben Zahler ben.zah...@inside-solutions.ch wrote:

Hi all,
after the last review feedback, I have revised the section on
MicroKernels and NodeStores.

I would appreciate any feedback if this new version is both technically
correct and also using the right terms.

The revised section is available here (User : review/Pwd: oak4502):
http://oak.inside-apps.com/Review_Microkernels_NodeStores.docx

Thanks in advance for any comments!

Regards,
Ben Zahler

Inside Solutions AG | Felsenstrasse 11 | 4450 Sissach | Schweiz
Telefon: +41 61 551 00 40 | Direkt: +41 61 551 00 43
http://www.inside-solutions.chhttp://www.inside-solutions.ch/




Oak Training: MikroKernels/NodeStores

2014-04-02 Thread Ben Zahler
Hi all,
after the last review feedback, I have revised the section on MicroKernels and 
NodeStores.

I would appreciate any feedback if this new version is both technically correct 
and also using the right terms.

The revised section is available here (User : review/Pwd: oak4502):
http://oak.inside-apps.com/Review_Microkernels_NodeStores.docx

Thanks in advance for any comments!

Regards,
Ben Zahler

Inside Solutions AG | Felsenstrasse 11 | 4450 Sissach | Schweiz
Telefon: +41 61 551 00 40 | Direkt: +41 61 551 00 43
http://www.inside-solutions.chhttp://www.inside-solutions.ch/


Oak Training CrowdReview

2014-03-21 Thread Ben Zahler
Hi all,
As mentioned before, I am writing a training for Oak users. Michael Marth has 
suggested to do a CrowdReview of the document: Since most of you know the 
technical details of Oak very well, it would be great if you could review the 
rechnical details in the training.

I'd be very grateful if you could check the table of contents of file and 
review particularly lessons 1,3 and 4.

The draft of the training is available at
http://oak.inside-apps.com/oak-training-DRAFT.pdf
user: review
password: oak4502

Thanks in advance,
Ben

Mit besten Grüssen
Ben Zahler

Inside Solutions AG | Felsenstrasse 11 | 4450 Sissach | Schweiz
Telefon: +41 61 551 00 40 | Direkt: +41 61 551 00 43
http://www.inside-solutions.chhttp://www.inside-solutions.ch/


Re: Oak Property Index Question

2014-03-14 Thread Ben Zahler
Thanks for your response, Davide, I did get the propertyIndex to work!

I have one question however:
I can only get the query to work when querying for nt:unstructured, but
not for nt:base. Is this the expected behaviour?

I can create my index either with the „declaringNodeTypes“ property set to
„nt:base“ or with the property omitted:

Node propertyIndexNode =
session.getNode(/oak:index).addNode(testIndex,
oak:QueryIndexDefinition);
propertyIndexNode.setProperty(type, property) ;
propertyIndexNode.setProperty(propertyNames,
trainingProperty);
propertyIndexNode.setProperty(declaringNodeTypes,nt:base“);
// can be omitted
propertyIndexNode.setProperty(unique, false);
propertyIndexNode.setProperty(reindex, true);

In both cases the following query is using the index:
SELECT *  FROM [nt:unstructured] WHERE trainingProperty = 13

But the following query is not:
SELECT *  FROM [nt:base] WHERE trainingProperty = 13


Thanks,
Ben

Inside Solutions AG | Felsenstrasse 11 | 4450 Sissach | Schweiz
Telefon: +41 61 551 00 40 | Direkt: +41 61 551 00 43
http://www.inside-solutions.ch http://www.inside-solutions.ch/





Am 14.03.14 09:12 schrieb Davide Giannella unter
giannella.dav...@gmail.com:

On 13/03/2014 17:41, Ben Zahler wrote:
 I execute the following query:
 String expression = SELECT *  FROM [nt:base] WHERE trainingProperty 
 10;
 Query query = queryManager.createQuery(expression,Query.JCR_SQL2);

 As expected, I get the message
  WARN  o.a.j.o.s.q.Cursors$TraversingCursor - Traversed 1000 nodes
 with filter Filter(query=SELECT *  FROM [nt:base] WHERE
 trainingProperty  10, path=/*, property=[trainingProperty=(10..]);
 consider creating an index or changing the query

 ...
 Node propertyIndexNode =
 session.getNode(/oak:index).addNode(testIndex,
 oak:QueryIndexDefinition);
 propertyIndexNode.setProperty(type, property) ;
 propertyIndexNode.setProperty(propertyNames,
 trainingProperty);
 propertyIndexNode.setProperty(unique, false);
 propertyIndexNode.setProperty(reindex, true);
 session.save();

The PropertyIndex does not react on range queries. Only equality, in and
nonnull properties.

D.





Oak Property Index Question

2014-03-13 Thread Ben Zahler
Hi all,
I am currently writing a training for Oak Users and have found an issue with 
query indexing where things to not work as expected.

I execute the following query:
String expression = SELECT *  FROM [nt:base] WHERE trainingProperty  10;
Query query = queryManager.createQuery(expression,Query.JCR_SQL2);

As expected, I get the message
 WARN  o.a.j.o.s.q.Cursors$TraversingCursor - Traversed 1000 nodes with filter 
Filter(query=SELECT *  FROM [nt:base] WHERE trainingProperty  10, path=/*, 
property=[trainingProperty=(10..]); consider creating an index or changing the 
query

However, I did not manage to create a PropertyIndex to index the query.

Here is the code that  I used to create the index:

Node propertyIndexNode = 
session.getNode(/oak:index).addNode(testIndex, oak:QueryIndexDefinition);
propertyIndexNode.setProperty(type, property) ;
propertyIndexNode.setProperty(propertyNames, trainingProperty);
propertyIndexNode.setProperty(unique, false);
propertyIndexNode.setProperty(reindex, true);
session.save();

From what I read, I would expect the query to be indexed with that node, but I 
still get the message above.
Is there anything that I missed?

A running java sample (requiring some oak imports) is attached.

Regards,
Ben Zahler
Inside Solutions AG | Felsenstrasse 11 | 4450 Sissach | Schweiz
Telefon: +41 61 551 00 40 | Direkt: +41 61 551 00 43
http://www.inside-solutions.chhttp://www.inside-solutions.ch/