You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2010/04/06 18:45:33 UTC

[jira] Commented: (SLING-1440) Overwrite rule of bundle initial content cannot be switched back to "false"

    [ https://issues.apache.org/jira/browse/SLING-1440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12854053#action_12854053 ] 

Carsten Ziegeler commented on SLING-1440:
-----------------------------------------

Hi Davide,

could you please try this patch to the ContentLoaderService?

Index: bundles/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java
===================================================================
--- bundles/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java	(revision 931203)
+++ bundles/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/ContentLoaderService.java	(working copy)
@@ -416,6 +416,7 @@
                 bcNode.setProperty(ContentLoaderService.PROPERTY_CONTENT_LOADED, false);
                 bcNode.setProperty(PROPERTY_CONTENT_UNLOADED_AT, Calendar.getInstance());
                 bcNode.setProperty(PROPERTY_CONTENT_UNLOADED_BY, this.slingId);
+                bcNode.setProperty(PROPERTY_UNINSTALL_PATHS, (String[])null);
                 bcNode.save();
             }
         } catch (RepositoryException re) {

If I'm not mistaken, the problem is that once the paths for uninstalling are set, they are never cleared. The above patch fixes this.

> Overwrite rule of bundle initial content cannot be switched back to "false"
> ---------------------------------------------------------------------------
>
>                 Key: SLING-1440
>                 URL: https://issues.apache.org/jira/browse/SLING-1440
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: JCR Contentloader 2.0.6
>         Environment: Windows XP, Jetty Hightide 7
>            Reporter: Davide Maestroni
>            Assignee: Carsten Ziegeler
>             Fix For: JCR ContentLoader 2.0.8
>
>
> I came across an issue with the <Sling-Initial-Content> setting in my bundle.
> As far as I set it to "SLING-INF/content;overwrite:=false" everything works correctly, i.e. when I re-deploy the bundle the content of the repository is still there. But, after the first time I deploy it with "SLING-INF/content;overwrite:=true" there's no way to return to the previous setting. In fact, even if I re-deploy the bundle with the original configuration ("SLING-INF/content;overwrite:=false"), the content is deleted every time.
> Here is what I did:
> 1) deploy the bundle with "overwrite:=false"
> 2) add some nodes
> 3) deploy the bundle with "overwrite:=false", the nodes are still there (OK)
> 4) deploy the bundle with "overwrite:=true", the nodes are deleted (OK)
> 5) add some nodes
> 6) deploy the bundle with "overwrite:=false", the nodes are not there (OK, since uninstall was implicitly true)
> 7) add some nodes
> 8) deploy the bundle with "overwrite:=false", the nodes are not there anymore! (NG)
> 9) add some nodes
> 10) deploy the bundle with "overwrite:=false", the nodes are still not there! (NG)
> I tried also to explicitly set the "uninstall" property but with no luck.

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