portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r789004 - in /portals/jetspeed-2/portal/trunk: components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/ components/jetspeed-registry/src/main/java/org/apache/jetspeed/serializer/ components/jetspeed-seri...
Date Sat, 27 Jun 2009 17:58:28 GMT
Author: rwatler
Date: Sat Jun 27 17:58:27 2009
New Revision: 789004

URL: http://svn.apache.org/viewvc?rev=789004&view=rev
Log:
JS-1034: add user prefs import/export to installer; extend user prefs import to support load
on empty registry for migration use case; extends user prefs import to include 2.1.X compatability

Added:
    portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSEntityPreferenceCompat.java
Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/serializer/JetspeedRegistrySerializer.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSNVPElement.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesProvider.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializer.java
    portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/database/build.xml

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java?rev=789004&r1=789003&r2=789004&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java
Sat Jun 27 17:58:27 2009
@@ -803,11 +803,21 @@
         return userNames;
     }
 
-    public void storePortletPreference(org.apache.jetspeed.om.portlet.PortletDefinition portletdefinition,
String windowId, String userName,
-                                       Map<String, PortletPreference> map)
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.portletpreferences.PortletPreferencesProvider#storePortletPreference(org.apache.jetspeed.om.portlet.PortletDefinition,
java.lang.String, java.lang.String, java.util.Map)
+     */
+    public void storePortletPreference(org.apache.jetspeed.om.portlet.PortletDefinition portletdefinition,
String windowId, String userName, Map<String, PortletPreference> map)
     {
         String appName = portletdefinition.getApplication().getName();
         String portletName = portletdefinition.getPortletName();
+        storePortletPreference(appName, portletName, windowId, userName, map);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.portletpreferences.PortletPreferencesProvider#storePortletPreference(java.lang.String,
java.lang.String, java.lang.String, java.lang.String, java.util.Map)
+     */
+    public void storePortletPreference(String appName, String portletName, String windowId,
String userName, Map<String, PortletPreference> map)
+    {
         // always read in to get a fresh copy for merge
         Criteria c = new Criteria();
         c.addEqualTo("dtype", DISCRIMINATOR_USER);

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/serializer/JetspeedRegistrySerializer.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/serializer/JetspeedRegistrySerializer.java?rev=789004&r1=789003&r2=789004&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/serializer/JetspeedRegistrySerializer.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/serializer/JetspeedRegistrySerializer.java
Sat Jun 27 17:58:27 2009
@@ -33,6 +33,7 @@
 import org.apache.jetspeed.serializer.objects.JSEntities;
 import org.apache.jetspeed.serializer.objects.JSEntity;
 import org.apache.jetspeed.serializer.objects.JSEntityPreference;
+import org.apache.jetspeed.serializer.objects.JSEntityPreferenceCompat;
 import org.apache.jetspeed.serializer.objects.JSEntityPreferences;
 import org.apache.jetspeed.serializer.objects.JSNVPElement;
 import org.apache.jetspeed.serializer.objects.JSNVPElements;
@@ -125,24 +126,29 @@
         JSApplications applications = snapshot.getApplications();
         if (applications == null)
         {
-            System.out.println("NO DATA!!!!!!");
             return;
         }
-        Iterator it = applications.iterator();
-        while (it.hasNext())
-        {
-            JSApplication app = (JSApplication) it.next();
-            PortletApplication portletApp = registry.getPortletApplication(app.getName());
-            if (portletApp != null)
+
+		// import preferences for registered portlets if applications
+		// have been registered; otherwise, import all preferences
+		boolean importAll = registry.getPortletApplications().isEmpty();
+		if (!applications.isEmpty())
+		{
+            Iterator it = applications.iterator();
+            while (it.hasNext())
             {
-                importPA(app, portletApp, settings, log);
+                JSApplication app = (JSApplication) it.next();
+                PortletApplication portletApp = registry.getPortletApplication(app.getName());
+		        if ((portletApp != null) || importAll)
+                {
+                    importPA(app, portletApp, settings, log);
+                }
             }
         }
     }
 
     void importPA(JSApplication app, PortletApplication pa, Map settings, Logger log) throws
SerializerException
     {
-        System.out.println("--processed PA " + pa.getName());
         /**
          * while more PAs for each portletDef list:entityMan:getPortletEntity(pd)
          */
@@ -150,38 +156,59 @@
         while (pi.hasNext())
         {
             JSPortlet portlet = (JSPortlet) pi.next();
-            PortletDefinition pd = pa.getPortlet(portlet.getName());
-            if (pd != null)
-            {
-                importPD(portlet, pd, settings, log);
+			if (pa != null)
+			{
+                PortletDefinition pd = pa.getPortlet(portlet.getName());
+                if (pd != null)
+                {
+                    importPD(app, portlet, pd, settings, log);
+                }
             }
+			else
+			{
+                importPD(app, portlet, null, settings, log);			    
+			}
         }
     }
 
-    private void importPD(JSPortlet portlet, PortletDefinition pd, Map settings, Logger log)
throws SerializerException
+    private void importPD(JSApplication app, JSPortlet portlet, PortletDefinition pd, Map
settings, Logger log) throws SerializerException
     {
         Iterator it = portlet.getEntities().iterator();
         while (it.hasNext())
         {
             JSEntity entity = (JSEntity) it.next();
-            importEntityPref(pd, entity, settings, log);
+            importEntityPref(app, portlet, entity, pd, settings, log);
         }
     }
 
-    private void importEntityPref(PortletDefinition pd, JSEntity entity, Map settings, Logger
log)
+    private void importEntityPref(JSApplication app, JSPortlet portlet, JSEntity entity,
PortletDefinition pd, Map settings, Logger log)
     {
         JSEntityPreferences preferences = entity.getEntityPreferences();
         if ((preferences == null) || (preferences.size() == 0))
             return;
+
         try
         {
             Iterator it = preferences.iterator();
             while (it.hasNext())
             {
                 Map<String, PortletPreference> portletPreference = new HashMap<String,
PortletPreference>();
-                JSEntityPreference preference = (JSEntityPreference) it.next();
-                String userName = preference.getPrincapalName();
-                for (JSNVPElement element : preference.getPreferences().getValues())
+                Object preference = it.next();
+                String userName = null;
+                JSNVPElements preferenceElements = null;
+                if (preference instanceof JSEntityPreference)
+                {
+                    JSEntityPreference pref = (JSEntityPreference)preference;
+                    userName = pref.getPrincapalName();
+                    preferenceElements = pref.getPreferences();
+                }
+                else if (preference instanceof JSEntityPreferenceCompat)
+                {
+                    JSEntityPreferenceCompat pref = (JSEntityPreferenceCompat)preference;
+                    userName = pref.getName();
+                    preferenceElements = pref.getPreferences();                    
+                }
+                for (JSNVPElement element : preferenceElements.getValues())
                 {
                     if (element.getValues() == null)
                     {
@@ -198,7 +225,14 @@
                 }
                 if (portletPreference.size() > 0)
                 {
-                    prefsProvider.storePortletPreference(pd, entity.getId(), userName, portletPreference);
+                    if (pd != null)
+                    {
+                        prefsProvider.storePortletPreference(pd, entity.getId(), userName,
portletPreference);
+                    }
+                    else
+                    {
+                        prefsProvider.storePortletPreference(app.getName(), portlet.getName(),
entity.getId(), userName, portletPreference);
+                    }
                 }
             }
         }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java?rev=789004&r1=789003&r2=789004&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java
Sat Jun 27 17:58:27 2009
@@ -39,6 +39,7 @@
 import org.apache.jetspeed.serializer.objects.JSClients;
 import org.apache.jetspeed.serializer.objects.JSEntities;
 import org.apache.jetspeed.serializer.objects.JSEntity;
+import org.apache.jetspeed.serializer.objects.JSEntityPreferenceCompat;
 import org.apache.jetspeed.serializer.objects.JSEntityPreference;
 import org.apache.jetspeed.serializer.objects.JSEntityPreferences;
 import org.apache.jetspeed.serializer.objects.JSGroup;
@@ -121,11 +122,31 @@
     public void importData(String filename, Map settings) throws SerializerException
     {
         Map processSettings = getProcessSettings(settings);
-        JSSnapshot snapshot = readSnapshot(filename);
-
-        if (snapshot == null)
-            throw new SerializerException(SerializerException.FILE_PROCESSING_ERROR.create(new
String[] { filename,
-                    "Snapshot is NULL" }));
+        JSSnapshot snapshot = null;
+        SerializerException snapshotException = null;
+        for (int i = 0; ((i < TAG_SNAPSHOT_NAMES.length) && (snapshot == null));
i++)
+        {
+            String snapshotTagName = TAG_SNAPSHOT_NAMES[i];
+            try
+            {
+                snapshot = readSnapshot(filename, snapshotTagName);
+            }
+            catch (SerializerException se)
+            {
+                if (snapshotException == null)
+                {
+                    snapshotException = se;
+                }
+            }
+        }
+        if (snapshotException != null)
+        {
+            throw snapshotException;
+        }
+        else if (snapshot == null)
+        {
+            throw new SerializerException(SerializerException.FILE_PROCESSING_ERROR.create(new
String[] { filename, "Snapshot is NULL" }));
+        }
 
         if (!(snapshot.checkVersion()))
             throw new SerializerException(SerializerException.INCOMPETIBLE_VERSION.create(new
String[] { filename,
@@ -231,9 +252,9 @@
         binding.setAlias(JSPortlets.class, "Portlets");
         binding.setAlias(JSEntity.class, "Entity");
         binding.setAlias(JSEntities.class, "Entities");
+        binding.setAlias(JSEntityPreferenceCompat.class, "Principal");        
         binding.setAlias(JSEntityPreference.class, "EntityPreference");
         binding.setAlias(JSEntityPreferences.class, "EntityPreferences");
-        //binding.setAlias(JSEntityPreference.class, "Principal");
         binding.setAlias(JSEntityPreferences.class, "Settings");
         binding.setAlias(JSSecurityDomains.class, "SecurityDomains");
         binding.setAlias(JSSecurityDomain.class, "SecurityDomain");
@@ -249,7 +270,7 @@
         binding.setClassAttribute(null);
     }
 
-    protected JSSnapshot readSnapshot(String importFileName) throws SerializerException
+    protected JSSnapshot readSnapshot(String importFileName, String snapshotTagName) throws
SerializerException
     {
         XMLObjectReader reader = null;
         JSSnapshot snap = null;
@@ -270,11 +291,10 @@
         {
             if (this.binding != null)
                 reader.setBinding(this.binding);
-            snap = (JSSnapshot) reader.read(TAG_SNAPSHOT, JSSnapshot.class);
+            snap = (JSSnapshot) reader.read(snapshotTagName, JSSnapshot.class);
         }
         catch (Exception e)
         {
-            e.printStackTrace();
             new SerializerException(SerializerException.FILE_PROCESSING_ERROR.create(new
String[] { importFileName,
                     e.getMessage() }));
         }
@@ -315,7 +335,7 @@
         try
         {
             log.debug("*********Writing data*********");
-            writer.write(snapshot, TAG_SNAPSHOT, JSSnapshot.class);
+            writer.write(snapshot, DEFAULT_TAG_SNAPSHOT_NAME, JSSnapshot.class);
 
         }
         catch (Exception e)

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSEntityPreferenceCompat.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSEntityPreferenceCompat.java?rev=789004&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSEntityPreferenceCompat.java
(added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSEntityPreferenceCompat.java
Sat Jun 27 17:58:27 2009
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.serializer.objects;
+
+import javolution.xml.XMLFormat;
+import javolution.xml.stream.XMLStreamException;
+
+import org.apache.commons.lang.StringEscapeUtils;
+
+/**
+ * Jetspeed Compatibility Serialized (JS) EntityPreference
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ */
+public class JSEntityPreferenceCompat
+{
+    private String name;
+    private JSNVPElements preferences;
+
+
+    public JSEntityPreferenceCompat()
+    {
+    }
+ 
+    /**
+     * @return Returns the preferences.
+     */
+    public JSNVPElements getPreferences()
+    {
+        return preferences;
+    }
+
+    /**
+     * @param preferences
+     *            The preferences to set.
+     */
+    public void setPreferences(JSNVPElements preferences)
+    {
+        this.preferences = preferences;
+    }
+
+    /**
+     * @return the name
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /**
+     * @param name the name to set
+     */
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    /***************************************************************************
+     * SERIALIZER
+     */
+    private static final XMLFormat XML = new XMLFormat(JSEntityPreferenceCompat.class)
+    {
+        public void write(Object o, OutputElement xml) throws XMLStreamException
+        {
+            try
+            {
+                JSEntityPreferenceCompat g = (JSEntityPreferenceCompat) o;
+                xml.setAttribute("name", ((g.getName() != null) ? g.getName() : "-"));
+
+                if ((g.preferences != null) && (g.preferences.size()>0))
+                {
+                    xml.add(g.preferences);
+                }
+
+            }
+            catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+
+        public void read(InputElement xml, Object o)
+        {
+            try
+            {
+                JSEntityPreferenceCompat g = (JSEntityPreferenceCompat) o;
+                g.name = StringEscapeUtils.unescapeHtml(xml.getAttribute("name", "-"));
+                
+                Object o1 = null;
+                while (xml.hasNext())
+                {
+                    o1 = xml.getNext();
+                    
+                    if (o1 instanceof JSNVPElements)
+                    {
+                        g.preferences  = (JSNVPElements) o1;
+                    }
+                }
+            }
+            catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+    };
+}

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSNVPElement.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSNVPElement.java?rev=789004&r1=789003&r2=789004&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSNVPElement.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSNVPElement.java
Sat Jun 27 17:58:27 2009
@@ -44,7 +44,7 @@
 
     public JSNVPElement()
     {
-    };
+    }
 
     public JSNVPElement(String key, String value)
     {

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesProvider.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesProvider.java?rev=789004&r1=789003&r2=789004&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesProvider.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesProvider.java
Sat Jun 27 17:58:27 2009
@@ -158,13 +158,23 @@
     public Map<String,PortletPreference>getUserPreferences(PortletDefinition portletdefinition,String
windowId,String userName);
     
     /**
-     * Store entity preferences contained in the map parameter for a given window and username

+     * Store portlet definition entity preferences contained in the map parameter
+     * for a given window and username 
      * @param portletdefinition
      * @param windowId
      * @param userName
      * @param map
      */
-    public void storePortletPreference(PortletDefinition portletdefinition,String windowId,String
userName, Map<String, PortletPreference> map);
-
+    public void storePortletPreference(PortletDefinition portletdefinition, String windowId,
String userName, Map<String,PortletPreference> map);
 
+    /**
+     * Store portlet entity preferences contained in the map parameter for a given
+     * window and username 
+     * @param appName
+     * @param portletName
+     * @param windowId
+     * @param userName
+     * @param map
+     */
+    public void storePortletPreference(String appName, String portletName, String windowId,
String userName, Map<String,PortletPreference> map);
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializer.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializer.java?rev=789004&r1=789003&r2=789004&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializer.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializer.java
Sat Jun 27 17:58:27 2009
@@ -78,7 +78,8 @@
     String KEY_EXPORT_INDENTATION = "export_indentation";
     
     /**<p> the main tag in the XML file */
-    String TAG_SNAPSHOT = "Snapshot"; 
+    String DEFAULT_TAG_SNAPSHOT_NAME = "Snapshot"; 
+    String [] TAG_SNAPSHOT_NAMES = new String[] {DEFAULT_TAG_SNAPSHOT_NAME, "SecondaryData"};

     
     List getSerializers();
     Map getDefaultSettings();

Modified: portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/database/build.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/database/build.xml?rev=789004&r1=789003&r2=789004&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/database/build.xml (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-installer/etc/database/build.xml Sat Jun 27 17:58:27
2009
@@ -128,7 +128,7 @@
               -p &quot;${jetspeedWebInfDir}/conf/spring-filter.properties&quot;"
/>
         </java>
 
-        <echo>Export Jetspeed database pages to ${exportDataDir}/pages</echo>
+        <echo>Export Jetspeed database pages to ${exportDataDir}/pages directory</echo>
 
         <mkdir dir="${exportDataDir}/pages"/>
         <java classname="org.apache.jetspeed.tools.page.serializer.JetspeedPageSerializerApplicationImpl"
fork="yes">
@@ -162,6 +162,19 @@
 
     <target name="importDB" depends="checkDerby" unless="_derby" if="importDataDir">
 
+        <available file="${importDataDir}/j2-data.xml" type="file" property="_importData"/>
+        <antcall target="importData"/>
+        <available file="${importDataDir}/j2-prefs-data.xml" type="file" property="_importPrefs"/>
+        <antcall target="importPrefs"/>
+        <available file="${importDataDir}/pages" type="dir" property="_importPages"/>
+        <antcall target="importPages"/>
+
+        <echo>Import Jetspeed database complete!</echo>
+
+    </target>
+
+    <target name="importData" if="_importData">
+
         <echo>Import Jetspeed database from ${importDataDir}/j2-data.xml</echo>
 
         <java classname="org.apache.jetspeed.tools.db.serializer.JetspeedSerializerApplicationImpl"
fork="yes">
@@ -172,17 +185,26 @@
               -c &quot;serializer&quot;
               -p &quot;${jetspeedWebInfDir}/conf/spring-filter.properties&quot;"
/>
         </java>
+    </target>
 
-        <echo>Import Jetspeed database pages from ${importDataDir}/pages</echo>
-
-        <available file="${importDataDir}/pages" type="dir" property="_importPages"/>
-        <antcall target="importPages"/>
+    <target name="importPrefs" if="_importPrefs">
 
-        <echo>Import Jetspeed database complete!</echo>
+        <echo>Import Jetspeed database from ${importDataDir}/j2-prefs-data.xml</echo>
 
+        <java classname="org.apache.jetspeed.tools.db.serializer.JetspeedSerializerApplicationImpl"
fork="yes">
+            <classpath refid="installationClasspath"/>
+            <syspropertyset refid="installationProps"/>
+            <arg line="-I &quot;${importDataDir}/j2-prefs-data.xml&quot; 
+              -a &quot;${basedir}/../webapps/${portalName}&quot;
+              -c &quot;serializer&quot;
+              -p &quot;${jetspeedWebInfDir}/conf/spring-filter.properties&quot;"
/>
+        </java>
     </target>
 
     <target name="importPages" if="_importPages">
+
+        <echo>Import Jetspeed database pages from ${importDataDir}/pages directory</echo>
+
         <java classname="org.apache.jetspeed.tools.page.serializer.JetspeedPageSerializerApplicationImpl"
fork="yes">
             <classpath refid="installationClasspath"/>
             <syspropertyset refid="installationProps"/>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message