Index: src/main/java/org/apache/jetspeed/portlets/admin/JetspeedDataImporter.java =================================================================== --- src/main/java/org/apache/jetspeed/portlets/admin/JetspeedDataImporter.java (revision 763930) +++ src/main/java/org/apache/jetspeed/portlets/admin/JetspeedDataImporter.java (working copy) @@ -1,228 +0,0 @@ -/* - * 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.admin; - -import java.io.File; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -import javax.portlet.ActionRequest; -import javax.portlet.ActionResponse; -import javax.portlet.PortletConfig; -import javax.portlet.PortletException; -import javax.portlet.RenderRequest; -import javax.portlet.RenderResponse; - -import org.apache.commons.fileupload.FileItem; -import org.apache.commons.fileupload.disk.DiskFileItemFactory; -import org.apache.commons.fileupload.portlet.PortletFileUpload; -import org.apache.commons.io.FileUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.jetspeed.CommonPortletServices; -import org.apache.jetspeed.headerresource.HeaderResource; -import org.apache.jetspeed.security.GroupManager; -import org.apache.jetspeed.security.RoleManager; -import org.apache.jetspeed.security.UserManager; -import org.apache.jetspeed.serializer.JetspeedSerializer; -import org.apache.portals.gems.dojo.AbstractDojoVelocityPortlet; - -/** - * Manage the Portal Site - * - * @author Vivek Kumar - * - * @version $Id$ - */ -public class JetspeedDataImporter extends AbstractDojoVelocityPortlet -{ - - protected final Log log = LogFactory.getLog(this.getClass()); - - // components - protected UserManager userManager; - - protected GroupManager groupManager; - - protected RoleManager roleManager; - - int refCouter = 0; - - protected JetspeedSerializer serializer; - - protected void includeHeaderContent(HeaderResource headerResource) - { - headerResource.dojoAddCoreLibraryRequire("dojo.lang.*"); - // headerResource.dojoAddCoreLibraryRequire("dojo.dnd.*"); - headerResource.dojoAddCoreLibraryRequire("dojo.dnd.HtmlDragManager"); - headerResource.dojoAddCoreLibraryRequire("dojo.dnd.DragAndDrop"); - headerResource.dojoAddCoreLibraryRequire("dojo.dnd.HtmlDragAndDrop"); - - headerResource.dojoAddCoreLibraryRequire("dojo.event.*"); - headerResource.dojoAddCoreLibraryRequire("dojo.io"); - - headerResource.dojoAddCoreLibraryRequire("dojo.widget.ContentPane"); - headerResource.dojoAddCoreLibraryRequire("dojo.widget.LayoutContainer"); - - headerResource.dojoAddCoreLibraryRequire("dojo.widget.Tree"); - headerResource.dojoAddCoreLibraryRequire("dojo.widget.TreeRPCController"); - headerResource.dojoAddCoreLibraryRequire("dojo.widget.TreeSelector"); - headerResource.dojoAddCoreLibraryRequire("dojo.widget.TreeNode"); - headerResource.dojoAddCoreLibraryRequire("dojo.widget.TreeContextMenu"); - - headerResource.dojoAddCoreLibraryRequire("dojo.widget.ValidationTextbox"); - headerResource.dojoAddCoreLibraryRequire("dojo.widget.ComboBox"); - headerResource.dojoAddCoreLibraryRequire("dojo.widget.Checkbox"); - headerResource.dojoAddCoreLibraryRequire("dojo.widget.Dialog"); - headerResource.dojoAddCoreLibraryRequire("dojo.widget.Button"); - - headerResource.dojoAddModuleLibraryRequire("jetspeed.desktop.core"); - headerResource.dojoAddModuleLibraryRequire("jetspeed.widget.EditorTable"); - } - - public void init(PortletConfig config) throws PortletException - { - super.init(config); - userManager = (UserManager) getPortletContext().getAttribute(CommonPortletServices.CPS_USER_MANAGER_COMPONENT); - if (null == userManager) - { - PortletException pe = new PortletException("Failed to find the User Manager on SiteViewController initialization"); - throw new RuntimeException(pe); - } - groupManager = (GroupManager) getPortletContext().getAttribute(CommonPortletServices.CPS_GROUP_MANAGER_COMPONENT); - if (null == groupManager) - { - PortletException pe = new PortletException( - "Failed to find the Group Manager on SiteViewController initialization"); - throw new RuntimeException(pe); - } - roleManager = (RoleManager) getPortletContext().getAttribute(CommonPortletServices.CPS_ROLE_MANAGER_COMPONENT); - if (null == roleManager) - { - PortletException pe = new PortletException("Failed to find the Group Manager on SiteViewController initialization"); - throw new RuntimeException(pe); - } - serializer = (JetspeedSerializer)getPortletContext().getAttribute(CommonPortletServices.CPS_JETSPEED_SERIALIZER); - if (null == serializer) - { - PortletException pe = new PortletException("Failed to find the Serializer on SiteViewController initialization"); - throw new RuntimeException(pe); - } - } - - public void doView(RenderRequest request, RenderResponse response) - throws PortletException, IOException - { - super.doView(request, response); - request.getPortletSession().removeAttribute("status"); - request.getPortletSession().removeAttribute("msg"); - } - - public void processAction(ActionRequest request, - ActionResponse actionResponse) throws PortletException, - java.io.IOException - { - File userTempDir = getUserTempDir(request.getUserPrincipal().getName()); - - File importFile = null; - boolean success = false; - - try - { - if (PortletFileUpload.isMultipartContent(request)) - { - DiskFileItemFactory diskFileItemFactory = new DiskFileItemFactory(); - PortletFileUpload portletFileUpload = new PortletFileUpload(diskFileItemFactory); - - for (Object item : portletFileUpload.parseRequest(request)) - { - FileItem fileItem = (FileItem) item; - - if ("importFile".equals(fileItem.getFieldName())) - { - synchronized (this) - { - if (userTempDir.isDirectory()) - { - FileUtils.cleanDirectory(userTempDir); - } - else - { - userTempDir.mkdirs(); - } - - importFile = new File(userTempDir, fileItem.getName()); - fileItem.write(importFile); - success = importJetspeedData(importFile); - } - - break; - } - } - } - - if (success) - { - request.getPortletSession().setAttribute("status", importFile.getName()); - request.getPortletSession().setAttribute("msg", "File imported succesfully"); - } - else - { - request.getPortletSession().setAttribute("status", "false"); - request.getPortletSession().setAttribute("msg", "Failed to import file. Please check XML file for correctness."); - } - } - catch (Exception e) - { - request.getPortletSession().setAttribute("status", "false"); - request.getPortletSession().setAttribute("msg", e.getMessage()); - } - } - - private boolean importJetspeedData(File importFile) - { - try - { - Map settings = new HashMap(); - - 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); - - serializer.importData(importFile.getCanonicalPath(), settings); - - return true; - } - catch (Exception e) - { - return false; - } - } - - private File getUserTempDir(String userName) - { - File tempDir = new File(System.getProperty("java.io.tmpdir")); - return new File(tempDir, userName); - } -} Index: src/main/java/org/apache/jetspeed/portlets/JetspeedServiceLocator.java =================================================================== --- src/main/java/org/apache/jetspeed/portlets/JetspeedServiceLocator.java (revision 763930) +++ src/main/java/org/apache/jetspeed/portlets/JetspeedServiceLocator.java (working copy) @@ -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); + } + } Index: src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.java =================================================================== --- src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.java (revision 0) +++ src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.java (revision 0) @@ -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 { + + 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(this, "doUserGroupsRoles"))); + add(new Label("usersGroupsRolesLabel", new ResourceModel("export.users_groups_roles"))); + + add(new ExportCheckBox(PERMISSIONS, new PropertyModel(this, "doPermissions"))); + add(new Label("permissionsLabel", new ResourceModel("export.permissions"))); + + add(new ExportCheckBox(PROFILING, new PropertyModel(this, "doProfiling"))); + add(new Label("profilingLabel", new ResourceModel("export.profiling_rules"))); + + add(new ExportCheckBox(CAPABILITIES, new PropertyModel(this,"doCapabilities"))); + add(new Label("capabilitiesLabel", new ResourceModel("export.capabilities"))); + + add(new ExportCheckBox(USER_PREFS, new PropertyModel(this, "doUserPrefs"))); + add(new Label("userPrefsLabel", new ResourceModel("export.user_preferences"))); + + add(new ExportCheckBox(ENTITIES, new PropertyModel(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(this, "exportResourceProvider")){ + + private static final long serialVersionUID = 0L; + + @Override + public void onClick() { + Map settings = new HashMap(); + 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 settings = new HashMap(); + 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 settings) { + this.settings = settings; + } + } + } + + private class ImportForm extends Form { + + private static final long serialVersionUID = 1L; + + private final Map settings = new HashMap(); + { + 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 Property changes on: src\main\java\org\apache\jetspeed\portlets\serializer\PortalDataSerializer.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Index: src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.html =================================================================== --- src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.html (revision 0) +++ src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializer.html (revision 0) @@ -0,0 +1,59 @@ + + + + + + + + _export + + + _users_groups_roles + + + + _profiling_rules + + + + _capabilities + + + + _permissions + + + + _portlet_entities + + + + _user_preferences + + + + + + + + + + _import + + _choose a file to import + + + _please select.. + + + + + + + + + + + + + Property changes on: src\main\java\org\apache\jetspeed\portlets\serializer\PortalDataSerializer.html ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Index: src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializerApplication.java =================================================================== --- src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializerApplication.java (revision 0) +++ src/main/java/org/apache/jetspeed/portlets/serializer/PortalDataSerializerApplication.java (revision 0) @@ -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 Property changes on: src\main\java\org\apache\jetspeed\portlets\serializer\PortalDataSerializerApplication.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Index: src/main/java/org/apache/jetspeed/portlets/serializer/resources/PortalDataSerializer.properties =================================================================== --- src/main/java/org/apache/jetspeed/portlets/serializer/resources/PortalDataSerializer.properties (revision 0) +++ src/main/java/org/apache/jetspeed/portlets/serializer/resources/PortalDataSerializer.properties (revision 0) @@ -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 Property changes on: src\main\java\org\apache\jetspeed\portlets\serializer\resources\PortalDataSerializer.properties ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Index: src/webapp/WEB-INF/portlet.xml =================================================================== --- src/webapp/WEB-INF/portlet.xml (revision 763930) +++ src/webapp/WEB-INF/portlet.xml (working copy) @@ -1897,49 +1897,7 @@ - - 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 - - PortalSchemaExporter - Portal Schema Importer - ポータルサイトマネージャ - org.apache.jetspeed.portlets.admin.JetspeedDataImporter - - ViewPage - /WEB-INF/view/admin/importer-view.vm - - - HeaderPage - /WEB-INF/view/admin/importer-header.vm - - - dojo.requires.core - 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; - - - portlet-icon - user-home.png - - 300 - - text/html - view - - org.apache.jetspeed.portlets.admin.resources.Importer - - Import Export Service - Import-Export - schema,export,import,users,group,roles - - - - defaultLayout - jetspeed-layouts::VelocityTwoColumns - - - - - + Provides common custom config mode edit portlet. CustomConfigModePortlet Custom Config Mode Portlet @@ -1962,6 +1920,7 @@ admin,config,custom + 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. ContentViewer @@ -2164,6 +2123,33 @@ + + + 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. + PortalDataSerializer + Portal Data Serializer + org.apache.jetspeed.portlets.wicket.AdminWicketPortlet + + wicketFilterPath + /portalDataSerializer + + + serviceComponentNames + cps:JetspeedSerializer + + 0 + + text/html + view + + en + + Import Export Service + Import Export + admin,schema,data,import,export,serializer + + a Custom Edit_defaults Mode Index: src/webapp/WEB-INF/web.xml =================================================================== --- src/webapp/WEB-INF/web.xml (revision 763930) +++ src/webapp/WEB-INF/web.xml (working copy) @@ -143,6 +143,15 @@ + PortalDataSerializerApplication + org.apache.wicket.protocol.http.WicketFilter + + applicationClassName + org.apache.jetspeed.portlets.serializer.PortalDataSerializerApplication + + + + PortletRegistryManager org.apache.wicket.protocol.http.WicketFilter @@ -157,6 +166,13 @@ REQUEST INCLUDE + + + PortalDataSerializerApplication + /portalDataSerializer/* + REQUEST + INCLUDE + JetspeedPrincipalManagementPortlet