portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r764098 - in /portals/jetspeed-2/applications/j2-admin/trunk/src: main/java/org/apache/jetspeed/portlets/ main/java/org/apache/jetspeed/portlets/admin/ main/java/org/apache/jetspeed/portlets/serializer/ main/java/org/apache/jetspeed/portlet...
Date Fri, 10 Apr 2009 23:20:58 GMT
Author: taylor
Date: Fri Apr 10 23:20:57 2009
New Revision: 764098

URL: http://svn.apache.org/viewvc?rev=764098&view=rev
Log:
JS2-880
contribution from Jeroen Hoffman. Ported Import/Export Serializer to Wicket 

Added:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.html
  (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.java
  (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializerApplication.java
  (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/resources/
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/resources/PortalDataSerializer.properties
  (with props)
Removed:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/admin/JetspeedDataImporter.java
Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/JetspeedServiceLocator.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/portlet.xml
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/web.xml

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/JetspeedServiceLocator.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/JetspeedServiceLocator.java?rev=764098&r1=764097&r2=764098&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/JetspeedServiceLocator.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/JetspeedServiceLocator.java
Fri Apr 10 23:20:57 2009
@@ -41,6 +41,7 @@
 import org.apache.jetspeed.security.SecurityException;
 import org.apache.jetspeed.security.User;
 import org.apache.jetspeed.security.UserManager;
+import org.apache.jetspeed.serializer.JetspeedSerializer;
 import org.apache.jetspeed.tools.pamanager.PortletApplicationManagement;
 import org.apache.jetspeed.tools.pamanager.servletcontainer.ApplicationServerManager;
 import org.apache.wicket.RequestContext;
@@ -161,4 +162,9 @@
         return getUserManager().getPasswordCredential(user);
     }
     
+    public JetspeedSerializer getJetspeedSerializer()
+    {
+        return (JetspeedSerializer) getPortletContext().getAttribute(CommonPortletServices.CPS_JETSPEED_SERIALIZER);
+    }
+    
 }

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.html
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.html?rev=764098&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.html
(added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.html
Fri Apr 10 23:20:57 2009
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" >
+<body>
+	<table width="100%" border="0" cellspacing="0" cellpadding="5">
+	  <tr>
+	    <td width="40%">
+			<form wicket:id="exportForm">
+				<b><div wicket:id="exportHeader">_export</div></b>
+				<div>
+					<input type="checkbox" wicket:id="usersGroupsRoles" id="usersGroupsRoles" class="portlet-form-field">
+		          	<label wicket:id="usersGroupsRolesLabel" for="usersGroupsRoles" class="portlet-form-field-label">_users_groups_roles</label>
+		        </div>
+			    <div>
+			    	<input type="checkbox" wicket:id="profiling" id="profiling" class="portlet-form-field">
+			        <label wicket:id="profilingLabel" for="profiling" class="portlet-form-field-label">_profiling_rules</label>
+			    </div>
+		        <div>
+		        	<input type="checkbox" wicket:id="capabilities" id="capabilities" class="portlet-form-field">
+		          	<label wicket:id="capabilitiesLabel" for="capabilities" class="portlet-form-field-label">_capabilities</label>
+		        </div>
+		        <div>
+		        	<input type="checkbox" wicket:id="permissions" id="permissions" class="portlet-form-field">
+		          	<label wicket:id="permissionsLabel" for="permissions" class="portlet-form-field-label">_permissions</label>
+		        </div>
+		        <div>
+		        	<input type="checkbox" wicket:id="entities" id="entities" class="portlet-form-field">
+		          	<label wicket:id="entitiesLabel" for="entities" class="portlet-form-field-label">_portlet_entities</label>
+		        </div>
+		        <div>
+		        	<input type="checkbox" wicket:id="userPrefs" id="userPrefs" class="portlet-form-field">
+		          	<label wicket:id="userPrefsLabel" for="userPrefs" class="portlet-form-field-label">_user_preferences</label>
+		        </div>
+				<div>&#160;</div>
+				<div>
+		        	<button wicket:id="exportLink" class="portlet-form-button" target="_blank"><span
wicket:id="exportAction"/></button>
+				</div>
+			</form>
+		</td>
+	    <td>
+			<form wicket:id="importForm">
+				<b><div wicket:id="importHeader">_import</div></b>
+			  	<div>
+		        	<label wicket:id="importFileLabel" class="portlet-form-field-label" for="importFile">_choose
a file to import</label>
+		        	<input wicket:id="importFile" type="file" id="importFile" class="portlet-form-input-field"
/>
+		        </div>
+		        <div wicket:id="importText">_please select..</div>
+				<div>&#160;</div>
+		        <div>
+		        	<input type="submit" wicket:id="importAction" class="portlet-form-button" value="_import"/>
+		        </div>
+				<div>&#160;</div>
+		  		<div wicket:id="importErrorMessage" class="portlet-msg-error"/>
+		  		<div wicket:id="importInfoMessage" class="portlet-msg-info"/>
+		    </form>
+	    </td>
+	  </tr>
+	</table>
+</body>
+</html>

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.html
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.java?rev=764098&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.java
(added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.java
Fri Apr 10 23:20:57 2009
@@ -0,0 +1,360 @@
+/*
+ * 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.portlets.serializer;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.jetspeed.portlets.AdminPortletWebPage;
+import org.apache.jetspeed.portlets.wicket.component.DynamicResourceLink;
+import org.apache.jetspeed.portlets.wicket.component.ResourceProvider;
+import org.apache.jetspeed.serializer.JetspeedSerializer;
+import org.apache.jetspeed.serializer.SerializerException;
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Button;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.upload.FileUpload;
+import org.apache.wicket.markup.html.form.upload.FileUploadField;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+
+/**
+ * Wicket Serializer WebPage for import and export of portal data.
+ * 
+ * @author
+ * @version $Id$
+ */
+public class PortalDataSerializer extends AdminPortletWebPage {
+
+	private static final String USERS_GROUPS_ROLES = "usersGroupsRoles";
+	private static final String PERMISSIONS = "permissions";
+	private static final String PROFILING = "profiling";
+	private static final String CAPABILITIES = "capabilities";
+	private static final String USER_PREFS = "userPrefs";
+	private static final String ENTITIES = "entities";
+
+	public PortalDataSerializer() {
+		
+		super();
+		
+		// a first form to export data
+		add(new ExportForm("exportForm"));
+		
+		// a second form to import data
+		add(new ImportForm("importForm"));
+	}
+
+	private class ExportForm extends Form<Object> {
+
+		private static final long serialVersionUID = 0L;
+
+		private final ExportResourceProvider exportResourceProvider;
+
+		private boolean doUserGroupsRoles = true;
+		private boolean doPermissions = true;
+		private boolean doProfiling = true;
+		private boolean doCapabilities = true;
+		private boolean doUserPrefs = true;
+		private boolean doEntities = true;
+
+		/* Constructor */
+		public ExportForm(final String id) {
+
+			super(id);
+
+			add(new Label("exportHeader", new ResourceModel("export.header")));
+
+			add(new ExportCheckBox(USERS_GROUPS_ROLES, new PropertyModel<Boolean>(this, "doUserGroupsRoles")));
+			add(new Label("usersGroupsRolesLabel", new ResourceModel("export.users_groups_roles")));
+
+			add(new ExportCheckBox(PERMISSIONS, new PropertyModel<Boolean>(this, "doPermissions")));
+			add(new Label("permissionsLabel", new ResourceModel("export.permissions")));
+
+			add(new ExportCheckBox(PROFILING, new PropertyModel<Boolean>(this, "doProfiling")));
+			add(new Label("profilingLabel", new ResourceModel("export.profiling_rules")));
+
+			add(new ExportCheckBox(CAPABILITIES, new PropertyModel<Boolean>(this,"doCapabilities")));
+			add(new Label("capabilitiesLabel", new ResourceModel("export.capabilities")));
+
+			add(new ExportCheckBox(USER_PREFS, new PropertyModel<Boolean>(this, "doUserPrefs")));
+			add(new Label("userPrefsLabel", new ResourceModel("export.user_preferences")));
+
+			add(new ExportCheckBox(ENTITIES, new PropertyModel<Boolean>(this, "doEntities")));
+			add(new Label("entitiesLabel", new ResourceModel("export.portlet_entities")));
+
+			this.exportResourceProvider = new ExportResourceProvider( 
+					getPortletRequest().getUserPrincipal().getName());
+
+			DynamicResourceLink downloadLink = new DynamicResourceLink("exportLink", new PropertyModel<ExportResourceProvider>(this,
"exportResourceProvider")){
+
+				private static final long serialVersionUID = 0L;
+
+				@Override
+				public void onClick() {
+					Map<String, Object> settings = new HashMap<String, Object>();
+					settings.put(JetspeedSerializer.KEY_PROCESS_USERS, new Boolean(doUserGroupsRoles));
+					settings.put(JetspeedSerializer.KEY_PROCESS_PERMISSIONS, new Boolean(doPermissions));
+					settings.put(JetspeedSerializer.KEY_PROCESS_PROFILER, new Boolean(doProfiling));
+					settings.put(JetspeedSerializer.KEY_PROCESS_CAPABILITIES, new Boolean(doCapabilities));
+					settings.put(JetspeedSerializer.KEY_PROCESS_USER_PREFERENCES,new Boolean(doUserPrefs));
+					settings.put(JetspeedSerializer.KEY_PROCESS_ENTITIES,new Boolean(doEntities));
+					settings.put(JetspeedSerializer.KEY_EXPORT_INDENTATION, "\t");
+					settings.put(JetspeedSerializer.KEY_OVERWRITE_EXISTING, Boolean.TRUE);
+					settings.put(JetspeedSerializer.KEY_BACKUP_BEFORE_PROCESS, Boolean.FALSE);					
+					
+					exportResourceProvider.setSettings(settings);
+				}				
+			};
+			downloadLink.add(new Label("exportAction", new ResourceModel("export.action")));
+			add(downloadLink);
+		};
+
+		private class ExportCheckBox extends AjaxCheckBox 
+		{
+			private static final long serialVersionUID = 1L;
+
+			private ExportCheckBox(final String id, final IModel model) {
+				super(id, model);
+			}
+			
+			@Override
+			protected void onUpdate(AjaxRequestTarget target) {
+				// nothing
+			}
+		}
+
+		private class ExportResourceProvider implements ResourceProvider, Serializable
+		{
+			private static final long serialVersionUID = 1L;
+
+			private final String userName;
+			
+			private Map<String, Object> settings = new HashMap<String, Object>();
+			private File exportFile = null; 
+			private String onOpenError = null;
+			
+			public ExportResourceProvider(final String userName) {
+				super();
+				
+				this.userName = userName;
+			}
+			
+			public void close() {
+				try {
+					if (this.exportFile != null) {
+						this.exportFile.delete();
+						this.exportFile = null;
+					}
+				}
+				catch (Throwable t) {
+					t.printStackTrace();
+				}
+			}
+
+			public String getContentType() {
+				
+				// make browser open/save dialog appear 
+				return "application/octet-stream";
+			}
+
+			public long getLastModified() {
+				return (exportFile != null) ? exportFile.lastModified() : 0;
+			}
+
+			public long getLength() {
+				return (exportFile != null) ? exportFile.length() : 0;
+			}
+
+			public String getName() {
+				return (exportFile != null) ? exportFile.getName() : "";
+			}
+
+			public InputStream getResource() {
+				
+				if (this.onOpenError != null) {
+					return new ByteArrayInputStream(this.onOpenError.getBytes());
+				}
+				
+				try {
+					return new FileInputStream(this.exportFile);
+				}
+				catch (Throwable t) {
+					// FileNotFoundException by FileInputStream or any other unexpected condition 
+					return new ByteArrayInputStream(createMessage("export.message.exception", 
+							new Object[] { t.getClass().getName(), t.getMessage() }).getBytes());
+				}
+			}
+
+			public void open() {
+
+				try {
+					final File tempDir = new File(System.getProperty("java.io.tmpdir"));
+					final File userTempDir = new File(tempDir, userName);
+					if (!userTempDir.exists()) {
+						userTempDir.mkdirs();
+					}
+					
+					exportFile = new File(userTempDir, "export.xml");
+	
+					getJetspeedSerializer().exportData("jetspeedadmin_export", 
+							exportFile.getCanonicalPath(), this.settings);
+				}
+				catch (Throwable t) {
+					// SerializerException  and IOException by exportData()
+					// but also SecurityException by mkdir() or any other unexpected condition
+					this.onOpenError = createMessage("export.message.exception", 
+							new Object[] { t.getClass().getName(), t.getMessage() });
+				}
+			}
+
+			public void setSettings(Map<String, Object> settings) {
+				this.settings = settings;
+			}
+		}
+	}
+
+	private class ImportForm extends Form<Object> {
+
+		private static final long serialVersionUID = 1L;
+
+		private final Map<String, Boolean> settings = new HashMap<String, Boolean>();
+		{
+			settings.put(JetspeedSerializer.KEY_PROCESS_USERS, Boolean.TRUE);
+			settings.put(JetspeedSerializer.KEY_PROCESS_CAPABILITIES, Boolean.TRUE);
+			settings.put(JetspeedSerializer.KEY_PROCESS_PROFILER, Boolean.TRUE);
+			settings.put(JetspeedSerializer.KEY_PROCESS_USER_PREFERENCES, Boolean.TRUE);
+			settings.put(JetspeedSerializer.KEY_PROCESS_PORTAL_PREFERENCES, Boolean.TRUE);
+			settings.put(JetspeedSerializer.KEY_PROCESS_ENTITIES, Boolean.TRUE);
+			settings.put(JetspeedSerializer.KEY_OVERWRITE_EXISTING, Boolean.TRUE);
+			settings.put(JetspeedSerializer.KEY_BACKUP_BEFORE_PROCESS, Boolean.FALSE);
+		}
+		
+		private String errorMessage;
+		private String infoMessage;
+		private String fileName;
+
+		/* Constructor */
+		private ImportForm(final String id) {
+
+			super(id);
+
+			setMultiPart(true);
+
+			add(new Label("importHeader", new ResourceModel("import.header")));
+
+			add(new FileUploadField("importFile", new PropertyModel(this, "fileName")));
+			add(new Label("importFileLabel", new ResourceModel("import.choose.file")));
+
+			add(new Label("importText", new ResourceModel("import.text")));
+			add(new Button("importAction", new ResourceModel("import.action")));
+
+			add((new Label("importErrorMessage", new PropertyModel(this, "errorMessage")) {
+				@Override
+				public boolean isVisible() {
+					return (errorMessage != null);
+				}
+			}).setVisibilityAllowed(true));
+
+			add((new Label("importInfoMessage", new PropertyModel(this, "infoMessage")) {
+				@Override
+				public boolean isVisible() {
+					return (infoMessage != null);
+				}
+			}).setVisibilityAllowed(true));
+		}
+
+		@Override
+		public void onSubmit() {
+
+			this.clearMessages();
+
+			File tempDir = new File(System.getProperty("java.io.tmpdir"));
+			File userTempDir = new File(tempDir, getPortletRequest().getUserPrincipal().getName());
+
+			final FileUpload upload = ((FileUploadField) this.get("importFile")).getFileUpload();
+
+			if (upload == null) {
+				this.errorMessage = createMessage("import.message.nofile", null);
+				return;
+			}
+
+			synchronized (this) {
+				try {
+					if (!userTempDir.isDirectory()) {
+						userTempDir.mkdirs();
+					}
+
+					final File importFile = new File(userTempDir, upload.getClientFileName());
+					this.fileName = importFile.getCanonicalPath();
+
+					if (importFile.exists()) {
+						importFile.delete();
+					}
+
+					upload.writeTo(importFile);
+				} 
+				catch (IOException ioe) {
+					this.errorMessage = createMessage("import.message.exception", new Object[] {
+									upload.getClientFileName(), ioe.getMessage() });
+				}
+
+				try {
+					getJetspeedSerializer().importData(this.fileName, this.settings);
+
+					this.infoMessage = createMessage("import.message.success",
+							new Object[] { this.fileName });
+				} catch (SerializerException se) {
+					this.errorMessage = createMessage( "import.message.exception",
+							new Object[] { upload.getClientFileName(), se.getMessage() });
+				}
+			}
+		}
+
+		private void clearMessages() {
+			this.errorMessage = null;
+			this.infoMessage = null;
+		}
+	}
+
+	private String createMessage(String resourceKey, Object[] args) {
+
+		String message = getLocalizer().getString(resourceKey, (Component) null);
+
+		if (args != null) {
+			// apply the arguments
+			final MessageFormat format = new MessageFormat(message, getLocale());
+			message = format.format(args);
+		}
+
+		return message;
+	}
+
+	private JetspeedSerializer getJetspeedSerializer() {
+		return getServiceLocator().getJetspeedSerializer();
+	}
+}
\ No newline at end of file

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializerApplication.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializerApplication.java?rev=764098&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializerApplication.java
(added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializerApplication.java
Fri Apr 10 23:20:57 2009
@@ -0,0 +1,46 @@
+/*
+ * 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.portlets.serializer;
+
+import org.apache.jetspeed.portlets.wicket.AbstractAdminWebApplication;
+import org.apache.wicket.resource.loader.BundleStringResourceLoader;
+
+/**
+ * Data Serializer Wicket Application
+ * 
+ * @author 
+ * @version $Id$
+ */
+public class PortalDataSerializerApplication extends AbstractAdminWebApplication
+{
+
+	protected void init()
+	{
+        super.init();
+        
+        getResourceSettings().addStringResourceLoader(
+        		new BundleStringResourceLoader("org.apache.jetspeed.portlets.serializer.resources.PortalDataSerializer"));
+	}
+	
+	/**
+	 * @see org.apache.wicket.Application#getHomePage()
+	 */
+	public Class getHomePage()
+	{
+		return PortalDataSerializer.class;
+	}
+}
\ No newline at end of file

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializerApplication.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializerApplication.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/resources/PortalDataSerializer.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/resources/PortalDataSerializer.properties?rev=764098&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/resources/PortalDataSerializer.properties
(added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/resources/PortalDataSerializer.properties
Fri Apr 10 23:20:57 2009
@@ -0,0 +1,36 @@
+# 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.
+#
+#
+
+export.header=Export
+export.users_groups_roles=Users/Groups/Roles
+export.permissions=Permissions (triggers exporting Users/Groups/Roles)
+export.profiling_rules=Profiling Rules
+export.capabilities=Capabilities (mimetypes, mediatypes, capabilities, clients)
+export.portlet_entities=Portlet Entities
+export.user_preferences=User Preferences (triggers exporting Portlet Entities)
+export.action=Export
+
+export.message.exception=Export failed: {0} with message {1}   
+
+import.header=Import
+import.choose.file=Choose file to import
+import.text=Please select xml file to import, containing jetspeed objects
+import.action=Import
+
+import.message.nofile=No file selected for import
+import.message.exception=Import of file {0} failed: {1}   
+import.message.success=Successful import of file {0}
\ No newline at end of file

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/resources/PortalDataSerializer.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/serializer/resources/PortalDataSerializer.properties
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/portlet.xml?rev=764098&r1=764097&r2=764098&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/portlet.xml (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/portlet.xml Fri Apr
10 23:20:57 2009
@@ -1897,49 +1897,7 @@
     </portlet-preferences>
 </portlet>
 
- <portlet>
-    <description>The Portal Data Importer, import and export the jetspeed data from
jetspeed schema. From here you import/export the users,group,roles and jetspeed objects
-	</description>
-    <portlet-name>PortalSchemaExporter</portlet-name>
-    <display-name>Portal Schema Importer</display-name>
-    <display-name xml:lang="ja">ポータルサイトマネージャ</display-name>
-    <portlet-class>org.apache.jetspeed.portlets.admin.JetspeedDataImporter</portlet-class>
-    <init-param>
-      <name>ViewPage</name>
-      <value>/WEB-INF/view/admin/importer-view.vm</value>
-    </init-param>
-    <init-param>
-      <name>HeaderPage</name>
-      <value>/WEB-INF/view/admin/importer-header.vm</value>
-    </init-param>
-    <init-param>
-      <name>dojo.requires.core</name>
-      <value>dojo.lang.*;dojo.event.*;dojo.io.*;dojo.dnd.*;dojo.widget.*;dojo.widget.Tree;dojo.widget.Button;dojo.widget.Checkbox;dojo.widget.Dialog;dojo.widget.TabContainer;dojo.widget.ContentPane;dojo.widget.LayoutContainer;dojo.widget.TreeRPCController;dojo.widget.TreeSelector;dojo.widget.TreeNode;dojo.widget.TreeContextMenu;dojo.widget.validate;dojo.widget.ComboBox;</value>
-    </init-param>
-    <init-param>
-      <name>portlet-icon</name>
-      <value>user-home.png</value>
-    </init-param>
-    <expiration-cache>300</expiration-cache>
-    <supports>
-      <mime-type>text/html</mime-type>
-      <portlet-mode>view</portlet-mode>
-    </supports>
-    <resource-bundle>org.apache.jetspeed.portlets.admin.resources.Importer</resource-bundle>
-    <portlet-info>
-      <title>Import Export Service</title>
-      <short-title>Import-Export</short-title>
-      <keywords>schema,export,import,users,group,roles</keywords>
-    </portlet-info>
-    <portlet-preferences>
-      <preference>
-        <name>defaultLayout</name>
-        <value>jetspeed-layouts::VelocityTwoColumns</value>
-      </preference>
-    </portlet-preferences>
-  </portlet>  
-  
-  <portlet id="CustomConfigModePortlet">    
+ <portlet id="CustomConfigModePortlet">    
     <description>Provides common custom config mode edit portlet.</description>
     <portlet-name>CustomConfigModePortlet</portlet-name>
     <display-name>Custom Config Mode Portlet</display-name>
@@ -1962,6 +1920,7 @@
       <keywords>admin,config,custom</keywords>
     </portlet-info>
   </portlet>
+
   <portlet>
         <description>Content Viewer displays the content of an HTML, PDF, or other
file types from any where on the file system, or relative to the portlet application.</description>
         <portlet-name>ContentViewer</portlet-name>
@@ -2164,6 +2123,33 @@
 	    	</preference>
 	    </portlet-preferences>
   </portlet>
+
+    <portlet id="PortalDataSerializer">
+        <description>The Portal Data Serializer imports and exports Jetspeed data from
and to Jetspeed schema.
+            From here you import and export users, groups, roles and other Jetspeed objects.</description>
+        <portlet-name>PortalDataSerializer</portlet-name>
+        <display-name>Portal Data Serializer</display-name>
+        <portlet-class>org.apache.jetspeed.portlets.wicket.AdminWicketPortlet</portlet-class>
+        <init-param>
+            <name>wicketFilterPath</name>
+            <value>/portalDataSerializer</value>
+        </init-param>
+        <init-param>
+            <name>serviceComponentNames</name>
+            <value>cps:JetspeedSerializer</value>
+        </init-param>
+        <expiration-cache>0</expiration-cache>
+        <supports>
+            <mime-type>text/html</mime-type>
+            <portlet-mode>view</portlet-mode>
+        </supports>
+        <supported-locale>en</supported-locale>
+        <portlet-info>
+            <title>Import Export Service</title>
+            <short-title>Import Export</short-title>
+            <keywords>admin,schema,data,import,export,serializer</keywords>
+        </portlet-info>
+    </portlet>
     
     <custom-portlet-mode>
         <description>a Custom Edit_defaults Mode</description>            

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/web.xml?rev=764098&r1=764097&r2=764098&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/web.xml (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/web.xml Fri Apr 10 23:20:57
2009
@@ -143,6 +143,15 @@
     </filter>
 
   <filter>
+    <filter-name>PortalDataSerializerApplication</filter-name>
+    <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+    <init-param>
+      <param-name>applicationClassName</param-name>
+      <param-value>org.apache.jetspeed.portlets.serializer.PortalDataSerializerApplication</param-value>
+    </init-param>
+  </filter>
+  
+  <filter>
     <filter-name>PortletRegistryManager</filter-name>
     <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
     <init-param>
@@ -157,6 +166,13 @@
       <dispatcher>REQUEST</dispatcher>
       <dispatcher>INCLUDE</dispatcher>
     </filter-mapping>
+  
+  <filter-mapping>
+    <filter-name>PortalDataSerializerApplication</filter-name>
+    <url-pattern>/portalDataSerializer/*</url-pattern>
+    <dispatcher>REQUEST</dispatcher>
+    <dispatcher>INCLUDE</dispatcher>
+  </filter-mapping>
 
     <filter-mapping>
       <filter-name>JetspeedPrincipalManagementPortlet</filter-name>



---------------------------------------------------------------------
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