Author: rfelden
Date: Wed Jun 20 16:30:18 2007
New Revision: 5

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D5&repname=3Df=
ix_apply
Log:
jahia.skeleton merge treatment

Modified:
    branches/jahia/fixapplier/src/main/java/org/jahia/fixapplier/controller=
/MyController.java

Modified: branches/jahia/fixapplier/src/main/java/org/jahia/fixapplier/cont=
roller/MyController.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/jahia/fixapp=
lier/src/main/java/org/jahia/fixapplier/controller/MyController.java&rev=3D=
5&repname=3Dfix_apply
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/jahia/fixapplier/src/main/java/org/jahia/fixapplier/controller=
/MyController.java (original)
+++ branches/jahia/fixapplier/src/main/java/org/jahia/fixapplier/controller=
/MyController.java Wed Jun 20 16:30:18 2007
@@ -39,8 +39,6 @@
 =

     private PrintStream logStream ;
 =

-    private boolean yesToAll =3D false ;
-
     /**
      * Constructor, first call of the application.
      * @param nogui disable the gui
@@ -546,7 +544,12 @@
 =

         // file processing
         } else {
-            if (neu.getName().endsWith(".old")) {
+            // jahia specific treatment
+            if (neu.getName().equals("jahia.skeleton")) {
+                jahiaSkeletonTreatment(neu);
+                return ;
+            }
+            else if (neu.getName().endsWith(".old")) {
                 return ;
             }
             String targetPath =3D StringUtils.replaceFirstToken(neu.getAbs=
olutePath(), dataModel.temp().getAbsolutePath() + File.separator + "output"=
, dataModel.getProject().getAbsolutePath()) ;
@@ -564,6 +567,25 @@
     }
 =

     /**
+     * Jahia-specific method to merge changes made to jahia.skeleton (-> j=
ahia.properties).
+     * @param skeleton the jahia.skeleton file
+     */
+    private void jahiaSkeletonTreatment(File skeleton) {
+        String targetPath =3D StringUtils.replaceFirstToken(skeleton.getAb=
solutePath(), dataModel.temp().getAbsolutePath() + File.separator + "output=
", dataModel.getProject().getAbsolutePath()) ;
+        targetPath =3D StringUtils.replaceLastToken(targetPath, "jahia.ske=
leton", "jahia.properties") ;
+        File destination =3D new File(targetPath) ;
+
+        // this is the text merge
+        checkConfiguration(skeleton, destination) ;
+
+        File parentPath =3D destination.getParentFile() ;
+        parentPath.mkdirs() ;
+        Tools.copy(skeleton, destination) ;
+        out(skeleton.getName() + " replaced (jahia.properties)");
+        printUI("   " + skeleton.getName() + " replaced (jahia.properties)=
");
+    }
+
+    /**
      * This concerns the merge file merging. It checks a given update file=
 and its existing copy,
      * and modifies the processed file resulting from the smart merge betw=
een these two. To do so, it uses
      * the .old file that should be included if merging has to be done.

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to