. Import Website Content dialog removed from Web Project screen and added to Create menu in Browse Sandbox screen

- Renamed "Import Website Content" to "Bulk Import"
 - Action can be used to import an archive of content into any folder, such as a root webapp folder or a sub-folder of content
 - Action can now be used to import into a user sandbox rather than just the staging area

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4720 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-01-04 11:17:45 +00:00
parent 938ef3d326
commit 51ce3c21d7
6 changed files with 34 additions and 59 deletions

View File

@@ -911,7 +911,7 @@ sandbox_icon=Browse Website
sandbox_snapshot=Create Snapshot
sandbox_snapshot_info=Create a snaphost of this sandbox.
sandbox_remove=Delete Sandbox
import_website_content=Import Website Content
import_website_content=Bulk Import
title_browse_sandbox=Browse Sandbox
sandbox_info=Use this view to browse the files and folders within the sandbox for a web project.
sandbox_title=Website ''{0}'' sandbox ''{1}''
@@ -944,9 +944,9 @@ snapshot_preview=Preview
webapp_current=Current Webapp Folder
# Website actions and dialog messages
title_import_content=Import Content into Website
import_website_content_title=Import Content into Website
import_website_content_desc=Use this dialog to import an archive of content into the default webapp for the website.
title_import_content=Web Project Bulk Import
import_website_content_title=Bulk Import
import_website_content_desc=Use this dialog to import an archive of content into the web project.
delete_avm_file_info=To remove this file from the sandbox, click OK.
delete_avm_file_confirm=Are you sure you want to remove \"{0}\" from the sandbox?
delete_folder=Delete Folder

View File

@@ -163,6 +163,17 @@
<action-listener>#{AddAvmContentDialog.start}</action-listener>
</action>
<!-- Bulk Import -->
<action id="bulk_import">
<permissions>
<permission allow="true">CreateChildren</permission>
</permissions>
<label-id>import_website_content</label-id>
<image>/images/icons/import_website.gif</image>
<action>dialog:importContent</action>
<action-listener>#{ImportWebsiteDialog.start}</action-listener>
</action>
<!-- Update document -->
<action id="update_file">
<permissions>
@@ -289,6 +300,7 @@
<action idref="add_content" />
<action idref="create_avm_content" />
<action idref="create_folder" />
<action idref="bulk_import" />
</action-group>
<!-- Actions for the More Actions menu in the sandbox browse screen -->

View File

@@ -25,7 +25,6 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.DateFormat;
import java.text.MessageFormat;
import java.util.Enumeration;
import java.util.zip.ZipException;
@@ -37,7 +36,6 @@ import javax.transaction.UserTransaction;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel;
import org.alfresco.model.WCMAppModel;
import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.service.ServiceRegistry;
@@ -52,9 +50,8 @@ import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.util.TempFileProvider;
import org.alfresco.web.app.AlfrescoNavigationHandler;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.context.UIContextService;
import org.alfresco.web.bean.FileUploadBean;
import org.alfresco.web.bean.NavigationBean;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
import org.apache.tools.zip.ZipEntry;
@@ -78,7 +75,6 @@ public class ImportWebsiteDialog
protected FileFolderService fileFolderService;
protected ContentService contentService;
protected NavigationBean navigationBean;
protected AVMBrowseBean avmBrowseBean;
protected AVMService avmService;
protected NodeService nodeService;
@@ -100,14 +96,6 @@ public class ImportWebsiteDialog
this.fileFolderService = fileFolderService;
}
/**
* @param navigationBean The NavigationBean to set.
*/
public void setNavigationBean(NavigationBean navigationBean)
{
this.navigationBean = navigationBean;
}
/**
* @param avmBrowseBean The AVMBrowseBean to set.
*/
@@ -207,38 +195,25 @@ public class ImportWebsiteDialog
tx = Repository.getUserTransaction(context);
tx.begin();
// TODO: explicit permission check for WRITE on website node for this user
// get the AVM path that will contain the imported content
String rootPath = this.avmBrowseBean.getCurrentPath();
// import the content into the appropriate store for the website
Node website = this.navigationBean.getCurrentNode();
String storeRoot = (String)website.getProperties().get(WCMAppModel.PROP_AVMSTORE);
String webapp = this.avmBrowseBean.getWebapp();
if (storeRoot != null && webapp != null)
{
String store = AVMConstants.buildStagingStoreName(storeRoot);
if (this.avmService.getStore(store) != null)
{
// get the path to the root webapp import area of the store
String rootPath = AVMConstants.buildStoreWebappPath(store, webapp);
// convert the AVM path to a NodeRef so we can use the NodeService to perform import
NodeRef importRef = AVMNodeConverter.ToNodeRef(-1, rootPath);
processZipImport(this.file, importRef);
// After an import it's a good idea to snapshot the staging store
this.avmService.createSnapshot(store, "Import of file: " + this.fileName, null);
// Reload virtualisation server as required
AVMConstants.updateVServerWebapp(rootPath, true);
}
}
else
{
throw new IllegalStateException("Unable to find root store/webapp property for website!");
}
// convert the AVM path to a NodeRef so we can use the NodeService to perform import
NodeRef importRef = AVMNodeConverter.ToNodeRef(-1, rootPath);
processZipImport(this.file, importRef);
// After a bulk import it's a good idea to snapshot the store
this.avmService.createSnapshot(
AVMConstants.getStoreName(rootPath),
"Import of file: " + this.fileName, null);
// Reload virtualisation server as required
AVMConstants.updateVServerWebapp(rootPath, true);
tx.commit();
UIContextService.getInstance(context).notifyBeans();
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
}
catch (Throwable e)

View File

@@ -2288,10 +2288,6 @@
<property-name>contentService</property-name>
<value>#{ContentService}</value>
</managed-property>
<managed-property>
<property-name>navigationBean</property-name>
<value>#{NavigationBean}</value>
</managed-property>
<managed-property>
<property-name>avmService</property-name>
<value>#{AVMService}</value>

View File

@@ -78,7 +78,7 @@
<a:actionLink value="#{msg.sandbox_preview}" image="/images/icons/preview_website.gif" href="#{AVMBrowseBean.sandboxPreviewUrl}" target="new" />
</td>
<r:permissionEvaluator value="#{AVMBrowseBean.currentPathNode}" allow="CreateChildren" id="eval1">
<td style="padding-left:4px" width=80>
<td style="padding-left:4px;white-space:nowrap" width=80>
<%-- Create actions menu --%>
<a:menu id="createMenu" itemSpacing="4" label="#{msg.create_options}" image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu" style="white-space:nowrap">
<r:actions id="acts_create" value="avm_create_menu" context="#{AVMBrowseBean.currentPathNode}" />

View File

@@ -74,7 +74,7 @@
<div class="mainSubText"><h:outputText value="#{msg.website_info}" id="msg3" /></div>
<div class="mainSubText"><h:outputText value="#{NavigationBean.nodeProperties.description}" id="msg4" /></div>
</td>
<td align=right>
<td align="right" style="white-space:nowrap" width=150>
<nobr>
<%-- More actions menu --%>
<a:menu id="actions-menu" itemSpacing="4" label="#{msg.actions}" image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu" style="white-space:nowrap">
@@ -82,14 +82,6 @@
</a:menu>
</nobr>
</td>
<a:panel id="import-panel" rendered="#{AVMBrowseBean.isManagerRole}">
<td align=right width=160>
<nobr>
<%-- Import website content action --%>
<a:actionLink value="#{msg.import_website_content}" image="/images/icons/import_website.gif" padding="2" action="dialog:importContent" actionListener="#{ImportWebsiteDialog.start}" />
</nobr>
</td>
</a:panel>
</tr>
</table>