Merge Offline Edit dev branch to HEAD

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8527 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2008-03-13 13:43:38 +00:00
parent 3e8c994816
commit bb38db8dec
46 changed files with 7963 additions and 5847 deletions

View File

@@ -104,6 +104,7 @@ linkdetails_description=View the details about the link object.
previewdocument_description=Preview the content or space within a Template.
spacedetails_description=View the details about the space.
undocheckoutfile_description=Cancel the check out of a document and discard any changes.
cancel_editing_file_description=Cancel editing of a document and discard any changes.
updatefile_description=Update a document on the repository with content from your computer.
editfile_description=Edit the content of the file.
editfileinline_description=Edit the content of the document, then click Save.
@@ -131,7 +132,22 @@ no_icons_found=No icons found
required_field=Required Field
no_data=--
# Download document
download_doc=Download
# Offline editing
click_here= click here
offline_help=For help on offline editing
offline_download_first=If your document does not start downloading in
offline_download_second=seconds then
offline_download_auto_change=If you do not want files to start downloading automatically when you select offline editing then
offline_download_not_started=If your document has not started downloading then
offline_editing=Offline Editing
offline_title=Download of ''{0}'' for offline editing.
# UI Component messages
done=Done
yes=Yes
no=No
no_not_now=No not now
@@ -283,6 +299,10 @@ click_to_set_date=Click to set a date
today=Today
reset=Reset
label=Label
edit_doc_offline=Edit offline
edit_doc_online=Edit online
upload_new_version=Upload new version
checkin_this_file=Checkin this file
# Properties
username=User Name
@@ -331,6 +351,7 @@ checkin=Check In
checkout=Check Out
checkout_document=Check out this document
undocheckout=Undo Check Out
cancel_editing=Cancel File Editing
delete_space=Delete Space
delete_file=Delete File
delete_rule=Delete Rule
@@ -610,6 +631,12 @@ file_location=Location
minor_change=Minor Change
major_change=Major Change
notes=Notes
new_version_has=This new version has
initial_version=This is initial version
minor_changes=Minor Changes
major_changes=Major Changes
missing_original_node=Missing original content node
version_info=Version Info
# Check-out messages
check_out=Check Out
@@ -622,13 +649,12 @@ check_out_of=Check Out of
copy_file_checkedout=A copy of the file ''{0}'' is now checked out to you for editing.
edit_workingcopy_title=Edit the working copy now
edit_workingcopy_info=To edit the working copy of the file, click the link below and if asked select Save.
continue_working_title=Continue working
continue_working_info1=If you do not want to edit the file now click OK to close the page.
continue_working_info2=To edit the file in the future click the Edit action
download_complete=When the download is complete, click OK.
undo_checkout_for=Undo Check Out for
undo_checkout=Undo Check Out
undo_checkout_info=If you undo the check out of a document, the associated working copy will be deleted and all changes to it since the Check Out will be lost.
cancel_editing_for=Cancel Editing for
cancel_editing_info=If you cancel editing of a document, the associated working copy will be deleted and all changes to it since the Check Out will be lost.
complete=complete
working_copy_for=Working copy for
working_copy_missing_info=The working copy is no longer available. This could be due to an active rule(s) applied to the space you checked-out to.
@@ -1512,6 +1538,7 @@ start_location=Start Location
interface_language=Interface Language
content_language_filter=Content Language Filter
content_all_languages=All Languages
download_automatically=Automatically download files for offline editing
user_management=Management
select_avatar_prompt=Click here to select an Avatar image

View File

@@ -42,6 +42,72 @@
</params>
</action>
<!-- Edit document offline action -->
<action id="edit_doc_offline">
<permissions>
<permission allow="true">Write</permission>
</permissions>
<evaluator>org.alfresco.web.action.evaluator.EditDocOfflineEvaluator</evaluator>
<label-id>edit_doc_offline</label-id>
<image>/images/icons/edit_offline.gif</image>
<action-listener>#{EditOfflineDialog.setupContentAction}</action-listener>
<params>
<param name="id">#{actionContext.id}</param>
</params>
</action>
<!-- Download document -->
<action id="download_doc">
<evaluator>org.alfresco.web.action.evaluator.DownloadEvaluator</evaluator>
<label-id>download_doc</label-id>
<image>/images/icons/download_doc.gif</image>
<href>#{actionContext.url}</href>
</action>
<!-- Edit document online action via webdav -->
<action id="edit_doc_online_webdav">
<permissions>
<permission allow="true">Write</permission>
</permissions>
<evaluator>org.alfresco.web.action.evaluator.EditDocOnlineWebDavEvaluator</evaluator>
<label-id>edit_doc_online</label-id>
<image>/images/icons/edit_online.gif</image>
<action-listener>#{EditOnlineDialog.handleWebdavEditing}</action-listener>
<params>
<param name="id">#{actionContext.id}</param>
<param name="webdavUrl">#{actionContext.webdavUrl}</param>
</params>
</action>
<!-- Edit document online action via cifs -->
<action id="edit_doc_online_cifs">
<permissions>
<permission allow="true">Write</permission>
</permissions>
<evaluator>org.alfresco.web.action.evaluator.EditDocOnlineCIFSEvaluator</evaluator>
<label-id>edit_doc_online</label-id>
<image>/images/icons/edit_online.gif</image>
<action-listener>#{EditOnlineDialog.handleCifsEditing}</action-listener>
<params>
<param name="id">#{actionContext.id}</param>
<param name="cifsPath">#{actionContext.cifsPath}</param>
</params>
</action>
<!-- Edit document online action via http -->
<action id="edit_doc_online_http">
<permissions>
<permission allow="true">Write</permission>
</permissions>
<evaluator>org.alfresco.web.action.evaluator.EditDocOnlineHttpEvaluator</evaluator>
<label-id>edit_doc_online</label-id>
<image>/images/icons/edit_online.gif</image>
<action-listener>#{EditOnlineDialog.handleHttpEditing}</action-listener>
<params>
<param name="id">#{actionContext.id}</param>
</params>
</action>
<!-- Edit document action to open using normal HTTP access or inline Edit if set -->
<action id="edit_doc_http">
<permissions>
@@ -118,6 +184,29 @@
</params>
</action>
<!-- Cancel editing document -->
<action id="cancel_editing_doc">
<evaluator>org.alfresco.web.action.evaluator.CancelEditingDocEvaluator</evaluator>
<label-id>cancel_editing</label-id>
<image>/images/icons/cancel_editing.gif</image>
<action-listener>#{CancelEditingDialog.setupContentAction}</action-listener>
<action>dialog:cancelEditing</action>
<params>
<param name="id">#{actionContext.id}</param>
</params>
</action>
<!-- Done-editing document -->
<action id="done_editing_doc">
<evaluator>org.alfresco.web.action.evaluator.DoneEditingDocEvaluator</evaluator>
<label-id>checkin</label-id>
<image>/images/icons/done_editing.gif</image>
<action-listener>#{DoneEditingDialog.handle}</action-listener>
<params>
<param name="id">#{actionContext.id}</param>
</params>
</action>
<!-- View document details -->
<action id="details_doc">
<label-id>view_details</label-id>
@@ -206,6 +295,22 @@
</params>
</action>
<!-- Upload new version of document-->
<action id="upload_new_version">
<permissions>
<permission allow="true">Write</permission>
</permissions>
<evaluator>org.alfresco.web.action.evaluator.UploadNewVersionEvaluator</evaluator>
<label-id>upload_new_version</label-id>
<image>/images/icons/upload_new_version.gif</image>
<action-listener>#{UploadNewVersionDialog.setupContentAction}</action-listener>
<action>dialog:uploadVersion</action>
<params>
<param name="id">#{actionContext.id}</param>
</params>
</action>
<!-- 'Approve' workflow step for document -->
<action id="approve_doc">
<permissions>
@@ -887,11 +992,28 @@
<show-link>false</show-link>
<style-class>inlineAction</style-class>
<action idref="upload_new_version" />
<action idref="edit_doc_online_webdav" />
<action idref="edit_doc_online_cifs" />
<action idref="edit_doc_online_http" />
<action idref="edit_doc_offline" />
<action idref="checkout_doc" />
<action idref="done_editing_doc" />
<action idref="cancel_editing_doc" />
<action idref="download_doc" />
<!-- Actions previously used for checkin/checkout -->
<!-- If old behaviour is required uncomment the -->
<!-- actions below and comment out the ones above -->
<!--
<action idref="edit_doc_http" />
<action idref="edit_doc_webdav" />
<action idref="edit_doc_cifs" />
<action idref="checkout_doc" />
<action idref="checkin_doc" />
-->
<action idref="details_doc" />
<action idref="delete_doc" />
@@ -913,7 +1035,10 @@
<action-group id="document_browse_menu">
<action idref="preview_doc" />
<action idref="update_doc" />
<!-- Old Cancel Checkout action -->
<!--
<action idref="cancelcheckout_doc" />
-->
<action idref="approve_doc" />
<action idref="reject_doc" />
<action idref="cut_node" />
@@ -975,17 +1100,31 @@
<!-- Actions Menu for Document Details screen -->
<action-group id="doc_details_actions">
<action idref="upload_new_version" />
<action idref="edit_doc_online_http" />
<action idref="edit_doc_online_webdav" />
<action idref="edit_doc_online_cifs" />
<action idref="edit_doc_offline" />
<action idref="checkout_doc" />
<action idref="done_editing_doc" />
<action idref="download_doc" />
<action idref="cancel_editing_doc" />
<!-- Actions previously used for checkin/checkout -->
<!-- If old behaviour is required uncomment the -->
<!-- actions below and comment out the ones above -->
<!--
<action idref="checkout_doc" />
<action idref="checkin_doc" />
<action idref="cancelcheckout_doc" />
<action idref="approve_doc_details" />
<action idref="reject_doc_details" />
<action idref="edit_doc_http" />
<!-- TODO: add these once the appropriate props (webdavUrl and cifsPath) are added
to the node bean as resolvers (probably need to change valuebindings also)
<action idref="edit_doc_webdav" />
<action idref="edit_doc_cifs" />
-->
<action idref="approve_doc_details" />
<action idref="reject_doc_details" />
<action idref="update_doc" />
<action idref="cut_node" />
<action idref="copy_node" />

View File

@@ -353,21 +353,29 @@
description-id="modify_user_roles_description" />
<dialog name="editHtmlInline" page="/jsp/content/edit-html-inline.jsp" managed-bean="CCEditHtmlInlineDialog"
icon="/images/icons/edit_large.gif" title-id="editfile_description"
icon="/images/icons/edit_online_large.gif" title-id="editfile_description"
description-id="editfileinline_description" />
<dialog name="editTextInline" page="/jsp/content/edit-text-inline.jsp" managed-bean="CCEditTextInlineDialog"
icon="/images/icons/edit_large.gif" title-id="editfile_description"
icon="/images/icons/edit_online_large.gif" title-id="editfile_description"
description-id="editfileinline_description" />
<dialog name="undoCheckoutFile" page="/jsp/coci/undocheckout-file.jsp" managed-bean="CCUndoCheckoutFileDialog"
icon="/images/icons/cancel_checkout_large.gif" title-id="undo_checkout_for"
description-id="undocheckoutfile_description" />
<dialog name="cancelEditing" page="/jsp/coci/cancel-editing-file.jsp" managed-bean="CancelEditingDialog"
icon="/images/icons/cancel_editing_large.gif" title-id="cancel_editing_for"
description-id="cancel_editing_file_description" />
<dialog name="checkoutFile" page="/jsp/coci/checkout-file.jsp" managed-bean="CCCheckoutFileDialog"
icon="/images/icons/check_out_large.gif" title-id="check_out"
description-id="checkoutfile_description" />
<dialog name="editOfflineDialog" page="/jsp/coci/edit-offline-file.jsp" managed-bean="EditOfflineDialog"
icon="/images/icons/edit_offline_large.gif" title-id="edit_doc_offline"
show-ok-button="false"/>
<dialog name="editFile" page="/jsp/content/edit-file.jsp" managed-bean="CCEditFileDialog"
icon="/images/icons/edit_large.gif" title-id="edit"
description-id="editfile_description" show-ok-button="false" />
@@ -548,6 +556,9 @@
icon="/images/icons/check_in_large.gif" title-id="check_in"
description-id="checkinfile_description" />
<dialog name="doneEditingFile" page="/jsp/coci/done-editing.jsp" managed-bean="DoneEditingDialog"
icon="/images/icons/done_editing_large.gif" description-id="checkinfile_description" />
<dialog name="previewSpace" page="/jsp/spaces/preview-space.jsp" managed-bean="SpacePreviewBean"
icon="/images/icons/preview_large.gif" title-id="preview_of" description-id="previewdocument_description" show-ok-button="false" />
@@ -562,6 +573,8 @@
icon="/images/icons/users_large.gif" title-id="manage_content_users" description-id="manage_content_users_description" show-ok-button="false"
actions-config-id="invite_content_user_menu" error-message-id="empty_message"/>
<dialog name="uploadVersion" page="/jsp/content/upload-new-version.jsp" managed-bean="UploadNewVersionDialog"
icon="/images/icons/upload_new_version_large.gif" title-id="upload_new_version_of" />
</dialogs>
</config>

View File

@@ -0,0 +1,47 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.action.evaluator;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.web.bean.repository.Node;
/**
* UI Action Evaluator - Cancel editing document.
*
*/
public class CancelEditingDocEvaluator extends BaseActionEvaluator
{
/**
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
*/
public boolean evaluate(Node node)
{
return (node.hasPermission(PermissionService.CANCEL_CHECK_OUT) &&
node.hasAspect(ContentModel.ASPECT_WORKING_COPY));
}
}

View File

@@ -0,0 +1,45 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.action.evaluator;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.web.bean.repository.Node;
/**
* UI Action Evaluator - Done editing document.
*
*/
public class DoneEditingDocEvaluator extends BaseActionEvaluator
{
/**
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
*/
public boolean evaluate(Node node)
{
return (node.hasPermission(PermissionService.CHECK_IN) &&
node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == true);
}
}

View File

@@ -0,0 +1,50 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.action.evaluator;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
public class DownloadEvaluator extends BaseActionEvaluator
{
/**
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
*/
public boolean evaluate(Node node)
{
FacesContext fc = FacesContext.getCurrentInstance();
DictionaryService dd = Repository.getServiceRegistry(fc).getDictionaryService();
if (dd.isSubClass(node.getType(), ContentModel.TYPE_CONTENT))
{
return !node.isLocked();
}
return false;
}
}

View File

@@ -31,6 +31,7 @@ import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.coci.EditOnlineDialog;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
@@ -59,7 +60,8 @@ public class EditDocCIFSEvaluator extends BaseActionEvaluator
if (node.hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE) == false &&
"cifs".equals(Application.getClientConfig(fc).getEditLinkType()))
{
if (node.isWorkingCopyOwner() == true ||
if ((node.isWorkingCopyOwner() == true && node.getProperties().get(ContentModel.PROP_WORKING_COPY_MODE) != null &&
node.getProperties().get(ContentModel.PROP_WORKING_COPY_MODE).equals(EditOnlineDialog.ONLINE_EDITING))||
(node.hasAspect(ContentModel.ASPECT_WORKING_COPY) && node.hasPermission(PermissionService.WRITE)) ||
(node.isLocked() == false && node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false))
{

View File

@@ -31,6 +31,7 @@ import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.coci.EditOnlineDialog;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
@@ -63,10 +64,12 @@ public class EditDocHttpEvaluator extends BaseActionEvaluator
// always be used otherwise the configured approach is used
else if (dd.isSubClass(node.getType(), ContentModel.TYPE_CONTENT))
{
if (node.hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE) == true ||
"http".equals(Application.getClientConfig(fc).getEditLinkType()))
if (node.hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE) == true &&
node.getProperties().get(ApplicationModel.PROP_EDITINLINE) != null &&
((Boolean)node.getProperties().get(ApplicationModel.PROP_EDITINLINE)).booleanValue() == true)
{
if (node.isWorkingCopyOwner() == true ||
if ((node.isWorkingCopyOwner() == true && node.getProperties().get(ContentModel.PROP_WORKING_COPY_MODE) != null &&
node.getProperties().get(ContentModel.PROP_WORKING_COPY_MODE).equals(EditOnlineDialog.ONLINE_EDITING)) ||
(node.hasAspect(ContentModel.ASPECT_WORKING_COPY) && node.hasPermission(PermissionService.WRITE)) ||
(node.isLocked() == false && node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false))
{

View File

@@ -0,0 +1,33 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.action.evaluator;
/**
* UI Action Evaluator - Offline Document Editing.
*/
public class EditDocOfflineEvaluator extends CheckoutDocEvaluator
{
}

View File

@@ -0,0 +1,78 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.action.evaluator;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.coci.EditOnlineDialog;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
/**
* UI Action Evaluator - Edit document online via CIFS.
*
*/
public class EditDocOnlineCIFSEvaluator extends CheckoutDocEvaluator
{
/**
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
*/
public boolean evaluate(Node node)
{
FacesContext fc = FacesContext.getCurrentInstance();
DictionaryService dd = Repository.getServiceRegistry(fc).getDictionaryService();
boolean result = false;
// if the node is inline editable, the inline online editing should always be used
if (dd.isSubClass(node.getType(), ContentModel.TYPE_CONTENT))
{
Map<String, Object> props = node.getProperties();
if ((node.hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE) == false || props.get(ApplicationModel.PROP_EDITINLINE) == null ||
((Boolean)props.get(ApplicationModel.PROP_EDITINLINE)).booleanValue() == false) && "cifs".equals(Application.getClientConfig(fc).getEditLinkType()))
{
if (node.hasAspect(ContentModel.ASPECT_WORKING_COPY))
{
if (props.get(ContentModel.PROP_WORKING_COPY_MODE) != null && props.get(ContentModel.PROP_WORKING_COPY_MODE).equals(EditOnlineDialog.ONLINE_EDITING))
result = true;
}
else
{
result = super.evaluate(node);
}
}
}
return result;
}
}

View File

@@ -0,0 +1,82 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.action.evaluator;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.web.bean.coci.EditOnlineDialog;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
/**
* UI Action Evaluator - Edit document online via http.
*
*/
public class EditDocOnlineHttpEvaluator extends CheckoutDocEvaluator
{
/**
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
*/
public boolean evaluate(Node node)
{
FacesContext fc = FacesContext.getCurrentInstance();
DictionaryService dd = Repository.getServiceRegistry(fc).getDictionaryService();
boolean result = false;
if(node.hasAspect(ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION))
{
// this branch from EditDocHttpEvaluator
// skip, result = false
}
else if (dd.isSubClass(node.getType(), ContentModel.TYPE_CONTENT))
{
Map<String, Object> props = node.getProperties();
if ((node.hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE) &&
props.get(ApplicationModel.PROP_EDITINLINE) != null &&
((Boolean)props.get(ApplicationModel.PROP_EDITINLINE)).booleanValue() == true))
{
if (node.hasAspect(ContentModel.ASPECT_WORKING_COPY))
{
if (props.get(ContentModel.PROP_WORKING_COPY_MODE) != null && props.get(ContentModel.PROP_WORKING_COPY_MODE).equals(EditOnlineDialog.ONLINE_EDITING))
result = true;
}
else
{
result = super.evaluate(node);
}
}
}
return result;
}
}

View File

@@ -0,0 +1,80 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.action.evaluator;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.coci.EditOfflineDialog;
import org.alfresco.web.bean.coci.EditOnlineDialog;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
/**
* UI Action Evaluator - Edit document online via WebDav.
*
*/
public class EditDocOnlineWebDavEvaluator extends CheckoutDocEvaluator
{
/**
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
*/
public boolean evaluate(Node node)
{
FacesContext fc = FacesContext.getCurrentInstance();
DictionaryService dd = Repository.getServiceRegistry(fc).getDictionaryService();
boolean result = false;
// if the node is inline editable, the inline online editing should always be used
if (dd.isSubClass(node.getType(), ContentModel.TYPE_CONTENT))
{
Map<String, Object> props = node.getProperties();
if ((node.hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE) == false || props.get(ApplicationModel.PROP_EDITINLINE) == null ||
((Boolean)props.get(ApplicationModel.PROP_EDITINLINE)).booleanValue() == false) && "webdav".equals(Application.getClientConfig(fc).getEditLinkType()))
{
if (node.hasAspect(ContentModel.ASPECT_WORKING_COPY))
{
if (props.get(ContentModel.PROP_WORKING_COPY_MODE) != null && props.get(ContentModel.PROP_WORKING_COPY_MODE).equals(EditOnlineDialog.ONLINE_EDITING))
result = true;
}
else
{
result = super.evaluate(node);
}
}
}
return result;
}
}

View File

@@ -31,6 +31,7 @@ import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.coci.EditOnlineDialog;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
@@ -59,7 +60,7 @@ public class EditDocWebDavEvaluator extends BaseActionEvaluator
if (node.hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE) == false &&
"webdav".equals(Application.getClientConfig(fc).getEditLinkType()))
{
if (node.isWorkingCopyOwner() == true ||
if ((node.isWorkingCopyOwner() == true && node.getProperties().get(ContentModel.PROP_WORKING_COPY_MODE).equals(EditOnlineDialog.ONLINE_EDITING)) ||
(node.hasAspect(ContentModel.ASPECT_WORKING_COPY) && node.hasPermission(PermissionService.WRITE)) ||
(node.isLocked() == false && node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false))
{

View File

@@ -24,10 +24,13 @@
*/
package org.alfresco.web.action.evaluator;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.web.bean.coci.EditOfflineDialog;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
@@ -48,9 +51,12 @@ public class UpdateDocEvaluator extends BaseActionEvaluator
DictionaryService dd = Repository.getServiceRegistry(
FacesContext.getCurrentInstance()).getDictionaryService();
Map<String, Object> props = node.getProperties();
boolean isOfflineEditing = props.get(ContentModel.PROP_WORKING_COPY_MODE) != null && props.get(ContentModel.PROP_WORKING_COPY_MODE).equals(EditOfflineDialog.OFFLINE_EDITING);
return dd.isSubClass(node.getType(), ContentModel.TYPE_CONTENT) &&
((node.isWorkingCopyOwner() == true ||
(node.isLocked() == false &&
node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false)));
((node.isWorkingCopyOwner() == true && !isOfflineEditing) ||
(node.isLocked() == false && node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false));
}
}

View File

@@ -0,0 +1,52 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.action.evaluator;
import java.util.Map;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.web.bean.coci.EditOfflineDialog;
import org.alfresco.web.bean.repository.Node;
/**
* UI Action Evaluator - Upload new version
*
*/
public class UploadNewVersionEvaluator extends BaseActionEvaluator
{
/**
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
*/
public boolean evaluate(Node node)
{
Map<String, Object> props = node.getProperties();
return (node.hasPermission(PermissionService.CHECK_IN) && node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == true &&
props.get(ContentModel.PROP_WORKING_COPY_MODE) != null && props.get(ContentModel.PROP_WORKING_COPY_MODE).equals(EditOfflineDialog.OFFLINE_EDITING));
}
}

View File

@@ -1699,7 +1699,7 @@ public class BrowseBean implements IContextListener, Serializable
{
// create the node ref, then our node representation
NodeRef ref = new NodeRef(Repository.getStoreRef(), id);
Node node = new Node(ref);
Node node = new MapNode(ref);
// store the URL to for downloading the content
if (ApplicationModel.TYPE_FILELINK.equals(node.getType()))
@@ -1710,6 +1710,8 @@ public class BrowseBean implements IContextListener, Serializable
{
node.addPropertyResolver("url", this.resolverDownload);
}
node.addPropertyResolver("webdavUrl", this.resolverWebdavUrl);
node.addPropertyResolver("cifsPath", this.resolverCifsPath);
node.addPropertyResolver("fileType32", this.resolverFileType32);
node.addPropertyResolver("mimetype", this.resolverMimetype);
node.addPropertyResolver("encoding", this.resolverEncoding);

View File

@@ -32,6 +32,7 @@ import javax.faces.context.FacesContext;
import org.alfresco.service.cmr.coci.CheckOutCheckInService;
import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.version.VersionService;
import org.alfresco.service.cmr.workflow.WorkflowService;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
@@ -44,6 +45,9 @@ public class CCProperties implements Serializable
/** The VersionOperationsService to be used by the bean */
transient protected CheckOutCheckInService versionOperationsService;
/** The VersionQueryService to be used by the bean */
transient protected VersionService versionQueryService;
/** The ContentService to be used by the bean */
transient protected ContentService contentService;
@@ -65,6 +69,8 @@ public class CCProperties implements Serializable
/** transient form and upload properties */
private File file;
private String fileName;
private String webdavUrl;
private String cifsPath;
private boolean keepCheckedOut = false;
private boolean minorChange = true;
private boolean isWorkflowAction = false;
@@ -100,6 +106,28 @@ public class CCProperties implements Serializable
this.versionOperationsService = versionOperationsService;
}
/**
* @return Returns the VersionQueryService.
*/
public VersionService getVersionQueryService()
{
if (this.versionQueryService == null)
{
this.versionQueryService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getVersionService();
}
return this.versionQueryService;
}
/**
* @param versionQueryService
* The VersionQueryService to set.
*/
public void setVersionQueryService(VersionService versionQueryService)
{
this.versionQueryService = versionQueryService;
}
/**
* @return Returns the ContentService.
*/
@@ -367,4 +395,36 @@ public class CCProperties implements Serializable
{
this.copyLocation = copyLocation;
}
/**
* @return Returns WebDav url for online editing. If webdav online editing didn't yet started, returns null
*/
public String getWebdavUrl()
{
return webdavUrl;
}
/**
* @param webdavUrl The webdav url. Using only for online editing
*/
public void setWebdavUrl(String webdavUrl)
{
this.webdavUrl = webdavUrl;
}
/**
* @return Returns CIFS path for online editing. If cifs online editing didn't yet started, returns null
*/
public String getCifsPath()
{
return cifsPath;
}
/**
* @param cifsPath The cifs path. Using only for online editing
*/
public void setCifsPath(String cifsPath)
{
this.cifsPath = cifsPath;
}
}

View File

@@ -0,0 +1,117 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.bean.coci;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.ui.common.Utils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class CancelEditingDialog extends CheckinCheckoutDialog
{
public static final String LBL_CANCEL_EDITING = "cancel_editing";
public static final String MSG_CANCEL_EDITING_FOR = "cancel_editing_for";
private static Log logger = LogFactory.getLog(CheckinCheckoutDialog.class);
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
undoCheckoutFile(context, outcome);
return "dialog:close[2]";
}
@Override
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_CANCEL_EDITING_FOR) + " '" + property.getDocument().getName() + "'";
}
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), LBL_CANCEL_EDITING);
}
/**
* Action to undo the checkout of a locked document. This document may
* either by the original copy or the working copy node. Therefore calculate
* which it is, if the working copy is found then we simply cancel checkout
* on that document. If the original copy is found then we need to find the
* appropriate working copy and perform the action on that node.
*/
public String undoCheckoutFile(FacesContext context, String outcome)
{
Node node = property.getDocument();
if (node != null)
{
try
{
if (node.hasAspect(ContentModel.ASPECT_WORKING_COPY))
{
this.property.getVersionOperationsService().cancelCheckout(node.getNodeRef());
}
else if (node.hasAspect(ContentModel.ASPECT_LOCKABLE))
{
// TODO: find the working copy for this document and cancel
// the checkout on it
// is this possible? as currently only the workingcopy
// aspect has the copyReference
// attribute - this means we cannot find out where the copy
// is to cancel it!
// can we construct an XPath node lookup?
throw new RuntimeException("NOT IMPLEMENTED");
}
else
{
throw new IllegalStateException("Node supplied for undo checkout has neither Working Copy or Locked aspect!");
}
resetState();
}
catch (Throwable err)
{
Utils.addErrorMessage(Application.getMessage(FacesContext.getCurrentInstance(), MSG_ERROR_CANCELCHECKOUT) + err.getMessage(), err);
}
}
else
{
logger.warn("WARNING: undoCheckout called without a current WorkingDocument!");
}
return outcome;
}
}

View File

@@ -265,7 +265,7 @@ public class CheckinCheckoutDialog extends BaseDialogBean
* @param id GUID of the node to setup as the content document context
* @return The Node
*/
private Node setupContentDocument(String id)
protected Node setupContentDocument(String id)
{
if (logger.isDebugEnabled())
logger.debug("Setup for action, setting current document to: " + id);

View File

@@ -0,0 +1,210 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.bean.coci;
import java.io.Serializable;
import java.util.Map;
import java.util.StringTokenizer;
import javax.faces.application.NavigationHandler;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.version.Version;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.AlfrescoNavigationHandler;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.ui.common.Utils;
/**
* This bean class handle done-editing(commit) dialog.
*
*/
public class DoneEditingDialog extends CheckinCheckoutDialog
{
private final static String MSG_DONE = "done";
private static final String MSG_CHECK_IN = "check_in";
private final static String MSG_MISSING_ORIGINAL_NODE = "missing_original_node";
private final static String DIALOG_NAME = AlfrescoNavigationHandler.DIALOG_PREFIX + "doneEditingFile";
/**
* this flag indicates occurrence when source node isn't versionable, but working copy yet is versionable
*/
private boolean sourceVersionable;
/**
* this field contains reference to source node for working copy
*/
private NodeRef sourceNodeRef;
/**
* @return Returns label for new version with major changes
*/
public String getMajorNewVersionLabel()
{
String label = getCurrentVersionLabel();
StringTokenizer st = new StringTokenizer(label, ".");
return (Integer.valueOf(st.nextToken()) + 1) + ".0";
}
/**
* @return Returns label for new version with minor changes
*/
public String getMinorNewVersionLabel()
{
String label = getCurrentVersionLabel();
StringTokenizer st = new StringTokenizer(label, ".");
return st.nextToken() + "." + (Integer.valueOf(st.nextToken()) + 1);
}
/**
* @return Returns flag, which indicates occurrence when source node is versionable
*/
public boolean isSourceVersionable()
{
return sourceVersionable;
}
/**
* @return Returns true if source node for selected working copy founded
*/
public boolean isSourceFounded()
{
return (sourceNodeRef != null);
}
/**
* Method for handling done-editing action(e.g. "done_editing_doc")
* @param event Action Event
*/
public void handle(ActionEvent event)
{
setupContentAction(event);
FacesContext fc = FacesContext.getCurrentInstance();
NavigationHandler nh = fc.getApplication().getNavigationHandler();
// if content is versionable then check-in else move to dialog for filling version info
if (isVersionable())
{
nh.handleNavigation(fc, null, DIALOG_NAME);
}
else
{
checkinFileOK(fc, null);
nh.handleNavigation(fc, null, AlfrescoNavigationHandler.DIALOG_PREFIX + "browse");
}
}
@Override
public void setupContentAction(ActionEvent event)
{
super.setupContentAction(event);
Node node = property.getDocument();
if (node != null)
{
sourceNodeRef = getSourceNodeRef(node.getNodeRef());
if (sourceNodeRef != null)
sourceVersionable = getNodeService().hasAspect(sourceNodeRef, ContentModel.ASPECT_VERSIONABLE);
}
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_DONE);
}
@Override
public boolean getFinishButtonDisabled()
{
return !isSourceFounded();
}
@Override
public String getContainerTitle()
{
if (isSourceFounded())
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_CHECK_IN) + " '" + getNodeService().getProperty(sourceNodeRef, ContentModel.PROP_NAME) + "'";
}
else
{
String message = Application.getMessage(FacesContext.getCurrentInstance(), MSG_MISSING_ORIGINAL_NODE);
Utils.addErrorMessage(message);
return message;
}
}
@Override
public void resetState()
{
super.resetState();
sourceVersionable = false;
sourceNodeRef = null;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return checkinFileOK(context, outcome);
}
/**
* @return Returns version label for source node for working copy. Null indicates error
*/
private String getCurrentVersionLabel()
{
if (isSourceFounded())
{
Version curVersion = property.getVersionQueryService().getCurrentVersion(sourceNodeRef);
return curVersion.getVersionLabel();
}
return null;
}
/**
* @param workingCopyNodeRef node reference to working copy
* @return Returns node reference to node, which is source for working copy node. Null indicates error
*/
private NodeRef getSourceNodeRef(NodeRef workingCopyNodeRef)
{
if (getNodeService().hasAspect(workingCopyNodeRef, ContentModel.ASPECT_COPIEDFROM) == true)
{
Map<QName, Serializable> workingCopyProperties = getNodeService().getProperties(workingCopyNodeRef);
return (NodeRef) workingCopyProperties.get(ContentModel.PROP_COPY_REFERENCE);
}
return null;
}
}

View File

@@ -0,0 +1,209 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.bean.coci;
import java.text.MessageFormat;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.servlet.DownloadContentServlet;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.users.UserPreferencesBean;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.UIActionLink;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class EditOfflineDialog extends CheckinCheckoutDialog
{
public static final String OFFLINE_EDITING = "offlineEditing";
public static final String CLOSE = "close";
public static final String MSG_ERROR_CHECKOUT = "error_checkout";
public static final String OFFLINE_TITLE = "offline_title";
private static Log logger = LogFactory.getLog(EditOfflineDialog.class);
private boolean continueCountdown;
protected UserPreferencesBean userPreferencesBean;
@Override
public void init(Map<String, String> parameters)
{
super.init(parameters);
continueCountdown = true;
}
@Override
public void restored()
{
super.restored();
continueCountdown = false;
}
@Override
public String getContainerTitle()
{
FacesContext fc = FacesContext.getCurrentInstance();
String pattern = Application.getMessage(fc, OFFLINE_TITLE);
return MessageFormat.format(pattern, property.getDocument().getName());
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return outcome;
}
@Override
public String getCancelButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), CLOSE);
}
/**
* Action listener for handle offline editing action. E.g "edit_doc_offline"
* action
*
* @param event ActionEvent
*/
public void setupContentAction(ActionEvent event)
{
UIActionLink link = (UIActionLink) event.getComponent();
Map<String, String> params = link.getParameterMap();
String id = params.get("id");
if (id != null && id.length() != 0)
{
super.setupContentDocument(id);
checkoutFile(property.getDocument());
if (userPreferencesBean.isDownloadAutomatically())
{
FacesContext fc = FacesContext.getCurrentInstance();
this.navigator.setupDispatchContext(property.getDocument());
fc.getApplication().getNavigationHandler().handleNavigation(fc, null,
"dialog:editOfflineDialog");
}
else
{
FacesContext fc = FacesContext.getCurrentInstance();
fc.getApplication().getNavigationHandler().handleNavigation(fc, null,
"dialog:close:browse");
}
}
else
{
property.setDocument(null);
}
super.resetState();
}
/**
* Checkout document to the same space as original one and then add the
* OFFLINE_EDITING property.
*/
private void checkoutFile(Node node)
{
if (node != null)
{
try
{
if (logger.isDebugEnabled())
logger.debug("Trying to checkout content node Id: " + node.getId());
NodeRef workingCopyRef = null;
// checkout the content to the current space
workingCopyRef = property.getVersionOperationsService().checkout(node.getNodeRef());
getNodeService().setProperty(workingCopyRef, ContentModel.PROP_WORKING_COPY_MODE,
OFFLINE_EDITING);
// set the working copy Node instance
Node workingCopy = new Node(workingCopyRef);
property.setWorkingDocument(workingCopy);
// create content URL to the content download servlet with ID and
// expected filename
String url = DownloadContentServlet.generateDownloadURL(workingCopyRef, workingCopy
.getName());
workingCopy.getProperties().put("url", url);
workingCopy.getProperties().put("fileType32",
Utils.getFileTypeImage(workingCopy.getName(), false));
}
catch (Throwable err)
{
Utils.addErrorMessage(Application.getMessage(FacesContext.getCurrentInstance(),
MSG_ERROR_CHECKOUT)
+ err.getMessage(), err);
}
}
else
{
logger.warn("WARNING: checkoutFile called without a current Document!");
}
}
@Override
public String cancel()
{
super.cancel();
return "dialog:close:browse";
}
/**
* @return userPreferencesBean bean with current user's preferences
*/
public UserPreferencesBean getUserPreferencesBean()
{
return userPreferencesBean;
}
/**
* @param userPreferencesBean bean with current user's preferences to set
*/
public void setUserPreferencesBean(UserPreferencesBean userPreferencesBean)
{
this.userPreferencesBean = userPreferencesBean;
}
/**
* @return continueCountdown
*/
public boolean isContinueCountdown()
{
return continueCountdown;
}
/**
* @param continueCountdown
*/
public void setContinueCountdown(boolean continueCountdown)
{
this.continueCountdown = continueCountdown;
}
}

View File

@@ -0,0 +1,183 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.bean.coci;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.ui.common.component.UIActionLink;
/**
* This is fiction dialog class for provides method for online editing. He
* doesn't have entry in web-client-config-dialogs.xml
*
*/
public class EditOnlineDialog extends CCCheckoutFileDialog
{
public final static String ONLINE_EDITING = "onlineEditing";
/**
* Action listener for handle webdav online editing action. E.g "edit_doc_online_webdav" action
*
* @param event ActionEvent
*/
public void handleWebdavEditing(ActionEvent event)
{
handle(event);
Node workingCopyNode = property.getDocument();
if (workingCopyNode != null)
{
UIActionLink link = (UIActionLink) event.getComponent();
Map<String, String> params = link.getParameterMap();
String webdavUrl = params.get("webdavUrl");
if (webdavUrl != null)
{
// modify webDav for editing working copy
property.setWebdavUrl(webdavUrl.substring(0, webdavUrl.lastIndexOf("/") + 1) + workingCopyNode.getName());
}
FacesContext fc = FacesContext.getCurrentInstance();
fc.getApplication().getNavigationHandler().handleNavigation(fc, null,"dialog:close:browse");
}
}
/**
* Action listener for handle cifs online editing action. E.g "edit_doc_online_cifs" action
*
* @param event ActionEvent
*/
public void handleCifsEditing(ActionEvent event)
{
handle(event);
Node workingCopyNode = property.getDocument();
if (workingCopyNode != null)
{
UIActionLink link = (UIActionLink) event.getComponent();
Map<String, String> params = link.getParameterMap();
String cifsPath = params.get("cifsPath");
if (cifsPath != null)
{
// modify cifsPath for editing working copy
property.setCifsPath(cifsPath.substring(0, cifsPath.lastIndexOf("/") + 1) + workingCopyNode.getName());
}
FacesContext fc = FacesContext.getCurrentInstance();
fc.getApplication().getNavigationHandler().handleNavigation(fc, null,"dialog:close:browse");
}
}
/**
* Action listener for handle http online(inline) editing action. E.g "edit_doc_online_http" action
*
* @param event ActionEvent
*/
public void handleHttpEditing(ActionEvent event)
{
handle(event);
Node workingCopyNode = property.getDocument();
if (workingCopyNode != null)
{
ContentReader reader = property.getContentService().getReader(workingCopyNode.getNodeRef(), ContentModel.PROP_CONTENT);
if (reader != null)
{
String mimetype = reader.getMimetype();
// calculate which editor screen to display
if (MimetypeMap.MIMETYPE_TEXT_PLAIN.equals(mimetype) || MimetypeMap.MIMETYPE_XML.equals(mimetype) || MimetypeMap.MIMETYPE_TEXT_CSS.equals(mimetype)
|| MimetypeMap.MIMETYPE_JAVASCRIPT.equals(mimetype))
{
// make content available to the text editing screen
property.setEditorOutput(reader.getContentString());
// navigate to appropriate screen
FacesContext fc = FacesContext.getCurrentInstance();
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "dialog:close:browse");
this.navigator.setupDispatchContext(workingCopyNode);
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "dialog:editTextInline");
}
else
{
// make content available to the html editing screen
property.setDocumentContent(reader.getContentString());
property.setEditorOutput(null);
// navigate to appropriate screen
FacesContext fc = FacesContext.getCurrentInstance();
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "dialog:close:browse");
this.navigator.setupDispatchContext(workingCopyNode);
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "dialog:editHtmlInline");
}
}
}
}
/**
* Base handling method.
*
* @param event ActionEvent
*/
public void handle(ActionEvent event)
{
super.setupContentAction(event);
Node node = property.getDocument();
if (node != null)
{
// if current content is already working copy then we don't checkout
if (node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false)
{
// if checkout is successful, then checkoutFile sets property workingDocument
checkoutFile(FacesContext.getCurrentInstance(), null);
Node workingCopyNode = property.getWorkingDocument();
if (workingCopyNode != null)
{
// set working copy node as document for editing
property.setDocument(workingCopyNode);
getNodeService().setProperty(workingCopyNode.getNodeRef(), ContentModel.PROP_WORKING_COPY_MODE, ONLINE_EDITING);
}
}
}
}
}

View File

@@ -0,0 +1,77 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.bean.coci;
import javax.faces.context.FacesContext;
import org.alfresco.web.app.Application;
public class UploadNewVersionDialog extends DoneEditingDialog
{
private final static String MSG_UPLOAD_NEW_VERSION = "upload_new_version";
private final static String MSG_OF = "of";
private boolean finishedEditing = false;
public void setFinishedEditing(boolean finished)
{
this.finishedEditing = finished;
}
public boolean isFinishedEditing()
{
return finishedEditing;
}
@Override
public boolean getFinishButtonDisabled()
{
return property.getFile() == null;
}
@Override
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_UPLOAD_NEW_VERSION) + " " + Application.getMessage(FacesContext.getCurrentInstance(), MSG_OF) + " '"
+ property.getDocument().getName() + "'";
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
property.setKeepCheckedOut(!finishedEditing);
return checkinFileOK(context, outcome);
}
@Override
public void resetState()
{
super.resetState();
finishedEditing = false;
}
}

View File

@@ -147,8 +147,15 @@ public class MapNode extends Node implements Map<String, Object>
propsInitialised = true;
}
if (key.equals("properties"))
{
return props;
}
else
{
return props.get(key);
}
}
/**
* @see java.util.Map#isEmpty()
@@ -198,6 +205,13 @@ public class MapNode extends Node implements Map<String, Object>
return getProperties().size();
}
@Override
public void reset()
{
super.reset();
propsInitialised = false;
}
/**
* @see java.util.Map#values()
*/

View File

@@ -56,9 +56,11 @@ public class UserPreferencesBean implements Serializable
{
private static final long serialVersionUID = -1262481849503163054L;
public static final String PREF_INTERFACELANGUAGE = "interface-language";
private static final String PREF_STARTLOCATION = "start-location";
private static final String PREF_CONTENTFILTERLANGUAGE = "content-filter-language";
public static final String PREF_INTERFACELANGUAGE = "interface-language";
private static final String PREF_DOWNLOADAUTOMATICALLY = "download-automatically";
/**
* Remplacement message for set the filter at 'all languages'.
@@ -388,4 +390,28 @@ public class UserPreferencesBean implements Serializable
}
return contentFilterLanguagesService;
}
/**
* @return download files automatically for offline editing or not
*/
public boolean isDownloadAutomatically()
{
Boolean downloadAutomatically = (Boolean) PreferencesService.getPreferences().getValue(PREF_DOWNLOADAUTOMATICALLY);
if (downloadAutomatically == null)
{
return true;
}
else
{
return downloadAutomatically.booleanValue();
}
}
/**
* @param downloadAutomatically the boolean value to set
*/
public void setDownloadAutomatically(boolean downloadAutomatically)
{
PreferencesService.getPreferences().setValue(PREF_DOWNLOADAUTOMATICALLY, downloadAutomatically);
}
}

View File

@@ -27,11 +27,14 @@ package org.alfresco.web.ui.repo.tag;
import java.io.IOException;
import java.io.Writer;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.servlet.FacesHelper;
import org.alfresco.web.bean.coci.CCProperties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -57,6 +60,8 @@ public class PageTag extends TagSupport
"/scripts/menu.js",
// webdav javascript
"/scripts/webdav.js",
// functional for window.onload
"/scripts/onload.js",
// base yahoo file
"/scripts/ajax/yahoo/yahoo/yahoo-min.js",
// io handling (AJAX)
@@ -268,11 +273,17 @@ public class PageTag extends TagSupport
out.write(SCRIPTS_END);
}
out.write("<script type=\"text/javascript\">"); // start - generate naked javascript code
// set the context path used by some Alfresco script objects
out.write("<script type=\"text/javascript\">");
out.write("setContextPath('");
out.write(reqPath);
out.write("');</script>\n");
out.write("');");
// generate window onload code
out.write(getWindowOnloadCode());
out.write("</script>\n"); // end - generate naked javascript code
if (!Application.inPortalServer())
{
@@ -352,4 +363,29 @@ public class PageTag extends TagSupport
}
return PageTag.alfresco;
}
/**
* This method generate code for setting window.onload reference if we need (we need to open WebDav or Cifs url or may be else)
* Using javascript code(function onloadFunc) from onload.js file
* @return Returns window.onload javascript code
*/
private String getWindowOnloadCode()
{
CCProperties ccProps = (CCProperties) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "CCProperties");
StringBuffer onloadCode = new StringBuffer();
if (ccProps.getWebdavUrl() != null || ccProps.getCifsPath() != null)
{
String webdavUrl = (ccProps.getWebdavUrl() != null) ? (ccProps.getWebdavUrl()) : ("");
String cifsPath = (ccProps.getCifsPath() != null) ? (ccProps.getCifsPath()) : ("");
onloadCode.append("window.onload=onloadFunc('").append(webdavUrl).append("','").append(cifsPath).append("');");
ccProps.setCifsPath(null); // we need reset cifsPath flag
ccProps.setWebdavUrl(null); // we need reset webdavUrl flag
}
return onloadCode.toString();
}
}

View File

@@ -1301,6 +1301,10 @@
<managed-bean-name>CCProperties</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.coci.CCProperties</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>versionQueryService</property-name>
<value>#{VersionService}</value>
</managed-property>
<managed-property>
<property-name>versionOperationsService</property-name>
<value>#{CheckoutCheckinService}</value>
@@ -1315,6 +1319,56 @@
</managed-property>
</managed-bean>
<managed-bean>
<description>The bean that help with edit offline procedure.</description>
<managed-bean-name>EditOfflineDialog</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.coci.EditOfflineDialog</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>browseBean</property-name>
<value>#{BrowseBean}</value>
</managed-property>
<managed-property>
<property-name>navigator</property-name>
<value>#{NavigationBean}</value>
</managed-property>
<managed-property>
<property-name>nodeService</property-name>
<value>#{NodeService}</value>
</managed-property>
<managed-property>
<property-name>property</property-name>
<value>#{CCProperties}</value>
</managed-property>
<managed-property>
<property-name>userPreferencesBean</property-name>
<value>#{UserPreferencesBean}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>The bean that helps with edit online procedure and presents fiction online editing dialog.</description>
<managed-bean-name>EditOnlineDialog</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.coci.EditOnlineDialog</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>browseBean</property-name>
<value>#{BrowseBean}</value>
</managed-property>
<managed-property>
<property-name>navigator</property-name>
<value>#{NavigationBean}</value>
</managed-property>
<managed-property>
<property-name>nodeService</property-name>
<value>#{NodeService}</value>
</managed-property>
<managed-property>
<property-name>property</property-name>
<value>#{CCProperties}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>The bean that backs up the Checkin and Checkout pages.</description>
<managed-bean-name>CheckinCheckoutDialog</managed-bean-name>
@@ -1351,6 +1405,27 @@
</managed-property>
</managed-bean>
<managed-bean>
<description>The bean for the Upload a new versoin Screen.</description>
<managed-bean-name>UploadNewVersionDialog</managed-bean-name>
<managed-bean-class>
org.alfresco.web.bean.coci.UploadNewVersionDialog
</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>property</property-name>
<value>#{CCProperties}</value>
</managed-property>
<managed-property>
<property-name>navigator</property-name>
<value>#{NavigationBean}</value>
</managed-property>
<managed-property>
<property-name>nodeService</property-name>
<value>#{NodeService}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>
The bean that holds manage content rules state
@@ -5497,6 +5572,20 @@
</managed-property>
</managed-bean>
<managed-bean>
<description>The bean for the Cancel Editing File Screen.</description>
<managed-bean-name>CancelEditingDialog</managed-bean-name>
<managed-bean-class>
org.alfresco.web.bean.coci.CancelEditingDialog
</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>property</property-name>
<value>#{CCProperties}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>The bean for the Working Copy Missing Screen.</description>
<managed-bean-name>CCWorkingCopyMissingDialog</managed-bean-name>
@@ -5523,6 +5612,23 @@
</managed-property>
</managed-bean>
<managed-bean>
<description>The bean for the Done-Editing File Screen(New commit dialog).</description>
<managed-bean-name>DoneEditingDialog</managed-bean-name>
<managed-bean-class>
org.alfresco.web.bean.coci.DoneEditingDialog
</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>property</property-name>
<value>#{CCProperties}</value>
</managed-property>
<managed-property>
<property-name>nodeService</property-name>
<value>#{NodeService}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>The bean for the Edit Search Screen.</description>
<managed-bean-name>EditSearchDialog</managed-bean-name>

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,48 @@
<%--
* Copyright (C) 2005-2007 Alfresco Software Limited.
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<f:verbatim>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "yellowInner", "#ffffcc"); %>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td valign=top style="padding-top:2px" width=20></f:verbatim><h:graphicImage url="/images/icons/info_icon.gif" width="16" height="16"/><f:verbatim></td>
<td class="mainSubText"></f:verbatim><h:outputText value="#{msg.cancel_editing_info}" /><f:verbatim></td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner"); %>
</td>
</tr>
</table>
</f:verbatim>

View File

@@ -74,21 +74,6 @@
</td>
</tr>
<tr><td colspan="2" class="paddingRow"></td></tr>
<tr>
<td class="mainSubTitle">
</f:verbatim><h:outputText value="#{msg.continue_working_title}" /><f:verbatim>
</td>
</tr>
<tr>
<td class="mainSubText">
</f:verbatim><h:outputText value="#{msg.continue_working_info1}" /><f:verbatim>
</td>
</tr>
<tr>
<td class="mainSubText">
</f:verbatim><h:outputText value="#{msg.continue_working_info2}" /><f:verbatim> <img src="<%=request.getContextPath()%>/images/icons/edit_icon.gif" align="absmiddle" width="12" height="16">
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>

View File

@@ -0,0 +1,79 @@
<%--
* Copyright (C) 2005-2007 Alfresco Software Limited.
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a"%>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r"%>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8"%>
<a:booleanEvaluator value="#{DialogManager.bean.sourceFounded}">
<f:verbatim>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td class="wizardSectionHeading"> </f:verbatim>
<h:outputText value="#{msg.version_info}" /> <f:verbatim>
</td>
</tr>
<tr>
<td> </f:verbatim>
<h:outputText value="#{msg.new_version_has}" escape="false" rendered="#{DialogManager.bean.sourceVersionable}" />
<h:outputText value="#{msg.initial_version}" escape="false" rendered="#{!DialogManager.bean.sourceVersionable}" /> <f:verbatim>
</td>
</tr>
<tr>
<td> </f:verbatim>
<h:selectOneRadio value="#{CCProperties.minorChange}" layout="pageDirection" rendered="#{DialogManager.bean.sourceVersionable}">
<f:selectItem itemValue="#{true}" itemLabel="#{msg.minor_changes} (#{DialogManager.bean.minorNewVersionLabel})" />
<f:selectItem itemValue="#{false}" itemLabel="#{msg.major_changes} (#{DialogManager.bean.majorNewVersionLabel})" />
</h:selectOneRadio> <f:verbatim>
</span> <br/>
</td>
</tr>
<tr>
<td> </f:verbatim>
<h:outputText value="#{msg.version_notes}"/> <f:verbatim>
</td>
</tr>
<tr>
<td> </f:verbatim>
<h:inputTextarea value="#{CCProperties.versionNotes}" rows="4" cols="50" /> <f:verbatim>
</span>
</td>
</tr>
<tr>
<td class="paddingRow"> </td>
</tr>
</table>
</td>
</tr>
</table>
</f:verbatim>
</a:booleanEvaluator>

View File

@@ -0,0 +1,114 @@
<%--
* Copyright (C) 2005-2007 Alfresco Software Limited.
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
--%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="a" uri="/WEB-INF/alfresco.tld" %>
<%@taglib prefix="c" uri="/WEB-INF/c.tld" %>
<script type="text/javascript">
<!--
var continueCountdown = document.getElementById("dialog:dialog-body:continueCountdown").value;
window.onload = startTimer;
function startTimer()
{
timer(5);
}
function timer(second)
{
if (continueCountdown == "true")
{
document.getElementById("time").innerHTML = second;
if (second > 0)
{
second--;
window.setTimeout('timer('+second+')', 1000);
}
else
{
document.location.href = getContextPath() + document.getElementById("dialog:dialog-body:url").value;
}
}
}
function stopCountdown()
{
continueCountdown = false;
document.location.href = getContextPath() + document.getElementById("dialog:dialog-body:url").value;
}
//-->
</script>
<h:inputHidden value="#{DialogManager.bean.continueCountdown}" id="continueCountdown"/>
<h:inputHidden value="#{CCProperties.document.properties.url}" id="url"/>
<h:panelGrid columns="4" cellpadding="1" cellspacing="1" rendered="#{DialogManager.bean.continueCountdown}">
<h:outputText value="#{msg.offline_download_first}"/>
<f:verbatim>&nbsp;<b id="time">5</b>&nbsp;</f:verbatim>
<h:outputText value="#{msg.offline_download_second}"/>
<a:actionLink
style="text-decoration: underline;"
value="#{msg.click_here}"
onclick="javascript:stopCountdown();"/>
</h:panelGrid>
<h:panelGrid columns="2" cellpadding="1" cellspacing="1" rendered="#{DialogManager.bean.continueCountdown == false}">
<h:outputText value="#{msg.offline_download_not_started}"/>
<a:actionLink
style="text-decoration: underline;"
value="#{msg.click_here}"
onclick="javascript:stopCountdown();"/>
</h:panelGrid>
<f:verbatim>
<div style="padding: 4px"></div>
</f:verbatim>
<h:panelGrid columns="2" cellpadding="1" cellspacing="1">
<h:outputText value="#{msg.offline_download_auto_change}"/>
<a:actionLink value="#{msg.click_here}"
action="dialog:userConsole"
actionListener="#{UsersDialog.setupUserAction}"
style="text-decoration: underline;">
<f:param name="id" value="#{NavigationBean.currentUser.person.id}" />
</a:actionLink>
</h:panelGrid>
<f:verbatim>
<div style="padding: 4px"></div>
</f:verbatim>
<h:panelGrid columns="3" cellpadding="1" cellspacing="1">
<h:graphicImage url="/images/icons/Help_icon.gif" alt="#{msg.help}"/>
<h:outputText value="#{msg.offline_help}"/>
<a:actionLink value="#{msg.click_here}"
style="text-decoration: underline;"
target="_blank"
href="#{NavigationBean.helpUrl}" />
</h:panelGrid>

View File

@@ -0,0 +1,167 @@
<%--
* Copyright (C) 2005-2007 Alfresco Software Limited.
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a"%>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r"%>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator"%>
<%@ page import="org.alfresco.web.bean.coci.UploadNewVersionDialog"%>
<%@ page import="org.alfresco.web.app.servlet.FacesHelper"%>
<%@ page import="javax.faces.context.FacesContext"%>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8"%>
<%
boolean fileUploaded = false;
UploadNewVersionDialog dialog = (UploadNewVersionDialog) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "UploadNewVersionDialog");
if (dialog != null && dialog.getFileName() != null)
{
fileUploaded = true;
}
%>
<f:verbatim>
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/validation.js"> </script>
<%
if (fileUploaded)
{
PanelGenerator.generatePanelStart(out, request.getContextPath(), "yellowInner", "#ffffcc");
out.write("<img alt='' align='absmiddle' src='");
out.write(request.getContextPath());
out.write("/images/icons/info_icon.gif' />&nbsp;&nbsp;");
out.write(dialog.getFileUploadSuccessMsg());
PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner");
out.write("<div style='padding:2px;'></div>");
}
%>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
</f:verbatim>
<a:booleanEvaluator value="#{empty DialogManager.bean.fileName}" ><f:verbatim>
<tr>
<td class="wizardSectionHeading"></f:verbatim><h:outputText value="#{msg.local_copy_location}" /><f:verbatim></td>
</tr>
<tr>
<td></f:verbatim>
<h:panelGrid id="upload_panel" columns="2" cellpadding="2" cellspacing="2" border="0" width="100%" columnClasses="panelGridLabelColumn,panelGridValueColumn" >
<h:outputText value="#{msg.locate_content_upload}" style="padding-left:8px"/>
<f:verbatim> <br/> </f:verbatim>
<h:outputText id="out_schema" value="#{msg.file_location}:" style="padding-left:8px" />
<h:column id="upload_empty" rendered="#{empty DialogManager.bean.fileName}">
<r:upload id="uploader" value="#{DialogManager.bean.fileName}" framework="dialog"/>
</h:column>
</h:panelGrid>
<f:verbatim>
</td>
</tr>
</f:verbatim>
</a:booleanEvaluator>
<%
if (fileUploaded)
{
%>
<f:verbatim>
<tr>
<td>
</f:verbatim>
<a:booleanEvaluator value="#{DialogManager.bean.versionable}" >
<f:verbatim>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td class="wizardSectionHeading"> </f:verbatim>
<h:outputText value="#{msg.version_info}" /> <f:verbatim>
</td>
</tr>
<tr>
<td> </f:verbatim>
<h:outputText value="#{msg.new_version_has}" escape="false" rendered="#{DialogManager.bean.sourceVersionable}" />
<h:outputText value="#{msg.initial_version}" escape="false" rendered="#{!DialogManager.bean.sourceVersionable}" /> <f:verbatim>
</td>
</tr>
<tr>
<td> </f:verbatim>
<h:selectOneRadio value="#{CCProperties.minorChange}" required="true" layout="pageDirection" rendered="#{DialogManager.bean.sourceVersionable}">
<f:selectItem itemValue="#{true}" itemLabel="#{msg.minor_changes} (#{DialogManager.bean.minorNewVersionLabel})" />
<f:selectItem itemValue="#{false}" itemLabel="#{msg.major_changes} (#{DialogManager.bean.majorNewVersionLabel})" />
</h:selectOneRadio>
<f:verbatim>
</span> <br/>
</td>
</tr>
<tr>
<td> </f:verbatim>
<h:outputText value="#{msg.version_notes}" /> <f:verbatim>
</td>
</tr>
<tr>
<td> </f:verbatim>
<h:inputTextarea value="#{CCProperties.versionNotes}" rows="4" cols="50" /> <f:verbatim>
</span></td>
</tr>
<tr>
<td class="paddingRow"></td>
</tr>
</table> </f:verbatim>
</a:booleanEvaluator>
<f:verbatim>
</td>
</tr>
<tr>
<td>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td class="wizardSectionHeading" colspan="2"></f:verbatim><h:outputText value="#{msg.other_options}" /><f:verbatim></td>
</tr>
<tr>
<td>
</f:verbatim>
<h:selectBooleanCheckbox value="#{DialogManager.bean.finishedEditing}"/>
<f:verbatim>
</td>
<td width="100%">
</f:verbatim>
<h:outputText value="#{msg.checkin_this_file}"/>
<f:verbatim>
</td>
</tr>
</table>
</td>
</tr>
</f:verbatim>
<%
}
%>
<f:verbatim>
</table>
</f:verbatim>

View File

@@ -136,8 +136,21 @@
<f:selectItems value="#{UserPreferencesBean.contentFilterLanguages}" />
</h:selectOneMenu>
</h:panelGrid>
</a:panel>
<%-- Download automatically checkbox --%>
<f:verbatim><br/></f:verbatim>
<h:outputText value="#{msg.offline_editing}"/>
<h:panelGrid cellpadding="2" columns="2" cellspacing="2">
<h:selectBooleanCheckbox
id="download-automatically"
value="#{UserPreferencesBean.downloadAutomatically}"
onchange="document.forms['dialog'].submit(); return true;"/>
<h:outputText value="#{msg.download_automatically}"/>
</h:panelGrid>
</a:panel>
<f:verbatim/>
<a:panel label="#{msg.user_management}" id="man-panel"

View File

@@ -0,0 +1,12 @@
//
// window.onload function for r:page tag
//
function onloadFunc(webdavUrl, cifsPath)
{
// i place this here only for others usage of onloadFunc
if (webdavUrl != "")
openDoc(webdavUrl);
if (cifsPath != "")
window.open(cifsPath, "_blank");
}