Merge of converted wizards and dialogs done by usethelink

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6828 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2007-09-19 15:12:24 +00:00
parent 30e7b62d4a
commit bdea4b33d9
136 changed files with 12973 additions and 12167 deletions

View File

@@ -28,7 +28,7 @@
<style-class>inlineAction</style-class> <style-class>inlineAction</style-class>
<image>/images/icons/edit_icon.gif</image> <image>/images/icons/edit_icon.gif</image>
<!-- action, action-listener, onclick, href and target action attributes are supported --> <!-- action, action-listener, onclick, href and target action attributes are supported -->
<action-listener>#{CheckinCheckoutBean.editFile}</action-listener> <action-listener>#{CheckinCheckoutDialog.editFile}</action-listener>
<action>editDocument</action> <action>editDocument</action>
<href>http://...</href> <href>http://...</href>
<target>new</target> <target>new</target>
@@ -50,7 +50,7 @@
<evaluator>org.alfresco.web.action.evaluator.EditDocHttpEvaluator</evaluator> <evaluator>org.alfresco.web.action.evaluator.EditDocHttpEvaluator</evaluator>
<label-id>edit</label-id> <label-id>edit</label-id>
<image>/images/icons/edit_icon.gif</image> <image>/images/icons/edit_icon.gif</image>
<action-listener>#{CheckinCheckoutBean.editFile}</action-listener> <action-listener>#{CheckinCheckoutDialog.editFile}</action-listener>
<params> <params>
<param name="id">#{actionContext.id}</param> <param name="id">#{actionContext.id}</param>
</params> </params>
@@ -87,7 +87,7 @@
<evaluator>org.alfresco.web.action.evaluator.CheckinDocEvaluator</evaluator> <evaluator>org.alfresco.web.action.evaluator.CheckinDocEvaluator</evaluator>
<label-id>checkin</label-id> <label-id>checkin</label-id>
<image>/images/icons/CheckIn_icon.gif</image> <image>/images/icons/CheckIn_icon.gif</image>
<action-listener>#{CheckinCheckoutBean.setupContentAction}</action-listener> <action-listener>#{CheckinCheckoutDialog.setupContentAction}</action-listener>
<action>dialog:checkinFile</action> <action>dialog:checkinFile</action>
<params> <params>
<param name="id">#{actionContext.id}</param> <param name="id">#{actionContext.id}</param>
@@ -99,7 +99,7 @@
<evaluator>org.alfresco.web.action.evaluator.CheckoutDocEvaluator</evaluator> <evaluator>org.alfresco.web.action.evaluator.CheckoutDocEvaluator</evaluator>
<label-id>checkout</label-id> <label-id>checkout</label-id>
<image>/images/icons/CheckOut_icon.gif</image> <image>/images/icons/CheckOut_icon.gif</image>
<action-listener>#{CheckinCheckoutBean.setupContentAction}</action-listener> <action-listener>#{CCCheckoutFileDialog.setupContentAction}</action-listener>
<action>dialog:checkoutFile</action> <action>dialog:checkoutFile</action>
<params> <params>
<param name="id">#{actionContext.id}</param> <param name="id">#{actionContext.id}</param>
@@ -111,7 +111,7 @@
<evaluator>org.alfresco.web.action.evaluator.CancelCheckoutDocEvaluator</evaluator> <evaluator>org.alfresco.web.action.evaluator.CancelCheckoutDocEvaluator</evaluator>
<label-id>undocheckout</label-id> <label-id>undocheckout</label-id>
<image>/images/icons/undo_checkout.gif</image> <image>/images/icons/undo_checkout.gif</image>
<action-listener>#{CheckinCheckoutBean.setupContentAction}</action-listener> <action-listener>#{CCUndoCheckoutFileDialog.setupContentAction}</action-listener>
<action>dialog:undoCheckoutFile</action> <action>dialog:undoCheckoutFile</action>
<params> <params>
<param name="id">#{actionContext.id}</param> <param name="id">#{actionContext.id}</param>
@@ -199,7 +199,7 @@
<evaluator>org.alfresco.web.action.evaluator.UpdateDocEvaluator</evaluator> <evaluator>org.alfresco.web.action.evaluator.UpdateDocEvaluator</evaluator>
<label-id>update</label-id> <label-id>update</label-id>
<image>/images/icons/update.gif</image> <image>/images/icons/update.gif</image>
<action-listener>#{CheckinCheckoutBean.setupContentAction}</action-listener> <action-listener>#{CheckinCheckoutDialog.setupContentAction}</action-listener>
<action>dialog:updateFile</action> <action>dialog:updateFile</action>
<params> <params>
<param name="id">#{actionContext.id}</param> <param name="id">#{actionContext.id}</param>
@@ -571,14 +571,14 @@
<action id="reapply-rules"> <action id="reapply-rules">
<label-id>reapply_rules</label-id> <label-id>reapply_rules</label-id>
<image>/images/icons/reapply_rules.gif</image> <image>/images/icons/reapply_rules.gif</image>
<action-listener>#{RulesBean.reapplyRules}</action-listener> <action-listener>#{RulesDialog.reapplyRules}</action-listener>
</action> </action>
<!-- Ignore Inherited Rules --> <!-- Ignore Inherited Rules -->
<action id="ignore-inherited-rules"> <action id="ignore-inherited-rules">
<label>#{RulesBean.ignoreInheritedRulesLabelId}</label> <label>#{RulesDialog.ignoreInheritedRulesLabelId}</label>
<image>/images/icons/reapply_rules.gif</image> <image>/images/icons/reapply_rules.gif</image>
<action-listener>#{RulesBean.ignoreInheritedRules}</action-listener> <action-listener>#{RulesDialog.ignoreInheritedRules}</action-listener>
</action> </action>
<!-- Reset Tree --> <!-- Reset Tree -->
@@ -688,7 +688,7 @@
<evaluator>org.alfresco.web.action.evaluator.CheckoutDocEvaluator</evaluator> <evaluator>org.alfresco.web.action.evaluator.CheckoutDocEvaluator</evaluator>
<label-id>checkout</label-id> <label-id>checkout</label-id>
<image>/images/icons/CheckOut_icon.gif</image> <image>/images/icons/CheckOut_icon.gif</image>
<action-listener>#{CheckinCheckoutBean.setupContentAction}</action-listener> <action-listener>#{CheckinCheckoutDialog.setupContentAction}</action-listener>
<action>checkoutFile</action> <action>checkoutFile</action>
</action>--> </action>-->

View File

@@ -256,6 +256,190 @@
icon="/images/icons/link_validation_report_large.gif" icon="/images/icons/link_validation_report_large.gif"
title-id="link_validaton_dialog_title" title-id="link_validaton_dialog_title"
description-id="link_validaton_dialog_desc" /> description-id="link_validaton_dialog_desc" />
<dialog name="editUserDetails" page="/jsp/users/edit-user-details.jsp" managed-bean="EditUserDetailsDialog"
icon="/images/icons/edituser_large.gif" title-id="edit_user_details"
description-id="edit_user_details_description" />
<dialog name="removeInvitedUser" page="/jsp/roles/remove-invited-user.jsp" managed-bean="RemoveInvitedUserDialog"
icon="/images/icons/delete_large.gif" title-id="remove_user"
description-id="remove_invited_user_info" />
<dialog name="editLinkProperties" page="/jsp/dialog/edit-link-properties.jsp" managed-bean="LinkPropertiesDialog"
icon="/images/icons/details_large.gif" title-id="modify_props_of"
description-id="editlink_description" />
<dialog name="editUserRoles" page="/jsp/roles/edit-user-roles.jsp" managed-bean="EditUserRolesDialog"
icon="/images/icons/edituser_large.gif" title-id="modify_user_roles"
description-id="modify_user_roles_description" />
<dialog name="deleteUser" page="/jsp/users/delete-user.jsp" managed-bean="DeleteUserDialog"
icon="/images/icons/delete_large.gif" title-id="title_delete_user"
description-id="delete_user_info"/>
<dialog name="addUsers" page="/jsp/groups/add-user.jsp" managed-bean="AddUsersDialog"
icon="/images/icons/add_user_large.gif" title-id="add_user"
description-id="add_user_group_description"/>
<dialog name="removeContentUser" page="/jsp/roles/remove-content-user.jsp" managed-bean="RemoveContentUserDialog"
icon="/images/icons/delete_large.gif" title-id="title_remove_invited_user"
description-id="remove_content_user_confirm" />
<dialog name="editFileDialog" page="/jsp/dialog/edit-file.jsp" managed-bean="EditFileDialog"
icon="/images/icons/edit_large.gif" title-id="title_edit_file"
description-id="editfile_description"/>
<dialog name="deleteGroup" page="/jsp/groups/delete-group.jsp" managed-bean="DeleteGroupDialog"
icon="/images/icons/delete_group_large.gif" title-id="delete_group"
description-id="delete_group_info"/>
<dialog name="createGroup" page="/jsp/groups/new-group.jsp" managed-bean="CreateGroupDialog"
icon="/images/icons/create_group_large.gif" title-id="new_group"
description-id="new_group_description"/>
<dialog name="editContentUserRoles" page="/jsp/roles/edit-content-user-roles.jsp" managed-bean="EditContentUserRolesDialog"
icon="/images/icons/edituser_large.gif" title-id="title_change_user_roles"
description-id="modify_user_roles_description" />
<dialog name="editHtmlInline" page="/jsp/dialog/edit-html-inline.jsp" managed-bean="CCEditHtmlInlineDialog"
icon="/images/icons/edit_large.gif" title-id="editfile_description"
description-id="editfileinline_description" />
<dialog name="editTextInline" page="/jsp/dialog/edit-text-inline.jsp" managed-bean="CCEditTextInlineDialog"
icon="/images/icons/edit_large.gif" title-id="editfile_description"
description-id="editfileinline_description" />
<dialog name="undoCheckoutFile" page="/jsp/dialog/undocheckout-file.jsp" managed-bean="CCUndoCheckoutFileDialog"
icon="/images/icons/cancel_checkout_large.gif" title-id="undo_checkout_for"
description-id="undocheckoutfile_description" />
<dialog name="checkoutFile" page="/jsp/dialog/checkout-file.jsp" managed-bean="CCCheckoutFileDialog"
icon="/images/icons/check_out_large.gif" title-id="check_out"
description-id="checkoutfile_description" />
<dialog name="editFile" page="/jsp/dialog/edit-file.jsp" managed-bean="CCEditFileDialog"
icon="/images/icons/edit_large.gif" title-id="edit"
description-id="editfile_description" show-ok-button="false" />
<dialog name="checkoutFileLink" page="/jsp/dialog/checkout-file-link.jsp" managed-bean="CCCheckoutFileLinkDialog"
icon="/images/icons/check_out_large.gif" title-id="check_out_of"
description-id="checkoutfilelink_description" />
<dialog name="workingCopyMissing" page="/jsp/dialog/working-copy-missing.jsp" managed-bean="CCWorkingCopyMissingDialog"
icon="/images/icons/check_out_large.gif" title-id="working_copy_for"
show-ok-button="false" />
<dialog name="adminConsole" page="/jsp/admin/admin-console.jsp" managed-bean="AdminConsoleDialog"
icon="/images/icons/admin_console_large.gif" title-id="title_admin_console"
description-id="admin_description" show-ok-button="false"/>
<dialog name="deleteRule" page="/jsp/dialog/delete-rule.jsp" managed-bean="RulesDialog"
icon="/images/icons/delete_large.gif" title-id="delete_rule"
description-id="delete_rule_info" />
<dialog name="deleteCategory" page="/jsp/categories/delete-category.jsp" managed-bean="DeleteCategoryDialog"
icon="/images/icons/delete_category_large.gif" title-id="title_delete_category"
description-id="delete_category_info" />
<dialog name="editCategory" page="/jsp/categories/edit-category.jsp" managed-bean="EditCategoryDialog"
icon="/images/icons/edit_category_large.gif" title-id="title_edit_category"
description-id="edit_category_description" />
<dialog name="export" page="/jsp/dialog/export.jsp" managed-bean="ExportDialog"
icon="/images/icons/export_large.gif" title-id="export"
description-id="export_info" />
<dialog name="showMLContainerDetails_" page="/jsp/ml/ml-container-details.jsp" managed-bean="MultilingualManageDialog"
icon="/images/ml/details_large.gif" title-id="manage_multilingual_details_for"
description-id="manage_multilingual_details_description" />
<dialog name="saveSearch" page="/jsp/dialog/save-search.jsp" managed-bean="SaveSearchDialog"
icon="/images/icons/edit_search_large.gif" title-id="save_new_search"
description-id="save_search_description" />
<dialog name="editSearch" page="/jsp/dialog/edit-search.jsp" managed-bean="EditSearchDialog"
icon="/images/icons/save_search_large.gif" title-id="save_edit_search"
description-id="save_search_description" />
<dialog name="editContentCategories" page="/jsp/dialog/edit-category.jsp" managed-bean="DocumentDetailsBean"
icon="/images/icons/edit_large.gif" title-id="modify_categories_of"
description-id="editcategory_description" />
<dialog name="editSpaceCategories" page="/jsp/dialog/edit-space-category.jsp" managed-bean="SpaceDetailsBean"
icon="/images/icons/edit_large.gif" title-id="modify_categories_of"
description-id="editcategory_space_description" />
<dialog name="createCategory" page="/jsp/categories/new-category.jsp" managed-bean="CreateCategoryDialog"
icon="/images/icons/create_category_large.gif" title-id="new_category"
description-id="new_category_description" />
<dialog name="deleteItem" page="/jsp/trashcan/delete-item.jsp" managed-bean="TrashcanDeleteItemDialog"
icon="/images/icons/delete_large.gif" title-id="delete_item"
description-id="delete_item_info" />
<dialog name="deleteAllItems" page="/jsp/trashcan/delete-all.jsp" managed-bean="TrashcanDeleteAllItemsDialog"
icon="/images/icons/delete_all_large.gif" title-id="delete_all_items"
description-id="delete_all_items_info" />
<dialog name="deleteListedItems" page="/jsp/trashcan/delete-listed.jsp" managed-bean="TrashcanDeleteListedItemsDialog"
icon="/images/icons/delete_all_large.gif" title-id="delete_listed_items"
description-id="delete_listed_items_info" />
<dialog name="applyDocTemplate" page="/jsp/dialog/apply-doc-template.jsp" managed-bean="ApplyDocTemplateDialog"
icon="/images/icons/preview_large.gif" title-id="apply_template"
description-id="apply_dashboard_doc_info" />
<dialog name="applyRSSTemplate" page="/jsp/dialog/apply-rss-template.jsp" managed-bean="ApplyRssTemplateDialog"
icon="/images/icons/rss_large.gif" title-id="apply_rss_feed"
description-id="apply_rss_feed_info" />
<dialog name="applySpaceTemplate" page="/jsp/dialog/apply-space-template.jsp" managed-bean="ApplySpaceTemplateDialog"
icon="/images/icons/preview_large.gif" title-id="apply_template"
description-id="apply_dashboard_info" />
<dialog name="editSimpleWorkflow" page="/jsp/dialog/edit-simple-workflow.jsp" managed-bean="EditSimpleWorkflowDialog"
icon="/images/icons/edit_large.gif" title-id="modify_workflow_props"
description-id="editworkflow_description" />
<dialog name="editSpaceSimpleWorkflow" page="/jsp/dialog/edit-space-simple-workflow.jsp" managed-bean="EditSpaceSimpleWorkflowDialog"
icon="/images/icons/edit_large.gif" title-id="modify_workflow_props"
description-id="editworkflow_description" />
<dialog name="changeMyPassword" page="/jsp/users/change-my-password.jsp" managed-bean="ChangeMyPasswordDialog"
icon="/images/icons/edituser_large.gif" title-id="change_password"
description-id="change_my_password_description" error-message-id="error_wizard" />
<dialog name="changePassword" page="/jsp/users/change-password.jsp" managed-bean="ChangePasswordDialog"
icon="/images/icons/edituser_large.gif" title-id="change_password"
description-id="change_password_description" error-message-id="error_wizard" />
<dialog name="itemDetails" page="/jsp/trashcan/item-details.jsp" managed-bean="TrashcanItemDetailsDialog"
icon="/images/icons/details_large.gif" title-id="details_of"
description-id="original_location" show-ok-button="false" />
<dialog name="recoverItem" page="/jsp/trashcan/recover-item.jsp" managed-bean="TrashcanRecoverItemDialog"
icon="/images/icons/recover_large.gif" title-id="recover_item"
description-id="recover_item_info" />
<dialog name="recoverAllItems" page="/jsp/trashcan/recover-all.jsp" managed-bean="TrashcanRecoverAllItemsDialog"
icon="/images/icons/recover_all_large.gif" title-id="recover_all_items"
description-id="recover_all_items_info" />
<dialog name="recoverListedItems" page="/jsp/trashcan/recover-listed.jsp" managed-bean="TrashcanRecoverListedItemsDialog"
icon="/images/icons/recover_all_large.gif" title-id="recover_listed_items"
description-id="recover_listed_items_info" />
<dialog name="userConsole" page="/jsp/users/user-console.jsp" managed-bean="UserConsoleDialog"
icon="/images/icons/user_console_large.gif" title-id="user_console_info"
description-id="user_console_description" show-ok-button="false"/>
<dialog name="recoveryReport" page="/jsp/trashcan/recovery-report.jsp" managed-bean="TrashcanRecoveryReportDialog"
icon="/images/icons/recover_all_large.gif" title-id="recovery_report"
description-id="recovery_report_info" show-ok-button="false" />
<dialog name="showSystemInfo" page="/jsp/dialog/system-info.jsp" managed-bean="ShowSystemInfoDialog"
icon="/images/icons/file_large.gif" title-id="system_info"
description-id="current_user" show-ok-button="false"/>
</dialogs> </dialogs>
</config> </config>

View File

@@ -10,7 +10,7 @@
<evaluator>org.alfresco.web.action.evaluator.ForumsCheckinDocEvaluator</evaluator> <evaluator>org.alfresco.web.action.evaluator.ForumsCheckinDocEvaluator</evaluator>
<label-id>checkin</label-id> <label-id>checkin</label-id>
<image>/images/icons/CheckIn_icon.gif</image> <image>/images/icons/CheckIn_icon.gif</image>
<action-listener>#{CheckinCheckoutBean.setupContentAction}</action-listener> <action-listener>#{CheckinCheckoutDialog.setupContentAction}</action-listener>
<action>dialog:checkinFile</action> <action>dialog:checkinFile</action>
<params> <params>
<param name="id">#{actionContext.id}</param> <param name="id">#{actionContext.id}</param>

View File

@@ -559,7 +559,65 @@
instruction-id="new_edition_finish_instruction" /> instruction-id="new_edition_finish_instruction" />
</step> </step>
</wizard> </wizard>
<wizard name="createUser"
managed-bean="CreateUserWizard"
title-id="new_user_title"
description-id="new_user_desc"
icon="/images/icons/new_user_large.gif">
<step name="person-properties"
title-id="person_properties"
description-id="new_user_step1_desc">
<page
path="/jsp/users/person-properties.jsp"
title-id="new_user_step1_title"
description-id="new_user_step1_desc"
instruction-id="default_instruction" />
</step>
<step name="user-properties" title-id="user_properties"
description-id="new_user_step2_desc">
<page
path="/jsp/users/new-user-properties.jsp"
title-id="new_user_step2_title"
description-id="new_user_step2_desc"
instruction-id="default_instruction" />
</step>
<step name="summary" title-id="summary"
description-id="summary_step_description">
<page path="/jsp/wizard/summary.jsp"
title-id="summary" description-id="summary_desc"
instruction-id="new_user_finish_instruction" />
</step>
</wizard>
<wizard name="editUser"
managed-bean="EditUserWizard"
title-id="new_user_title"
description-id="new_user_desc"
icon="/images/icons/new_user_large.gif">
<step name="person-properties"
title-id="person_properties"
description-id="new_user_step1_desc">
<page
path="/jsp/users/person-properties.jsp"
title-id="new_user_step1_title"
description-id="new_user_step1_desc"
instruction-id="default_instruction" />
</step>
<step name="user-properties" title-id="user_properties"
description-id="new_user_step2_desc">
<page
path="/jsp/users/edit-user-properties.jsp"
title-id="new_user_step2_title"
description-id="new_user_step2_desc"
instruction-id="default_instruction" />
</step>
<step name="summary" title-id="summary"
description-id="summary_step_description">
<page path="/jsp/wizard/summary.jsp"
title-id="summary" description-id="summary_desc"
instruction-id="new_user_finish_instruction" />
</step>
</wizard>
<!-- <!--
Definition of the 2 steps edition wizard. Definition of the 2 steps edition wizard.
The first step is skiped to force the new edition to start with a translation selected by the user. The first step is skiped to force the new edition to start with a translation selected by the user.

View File

@@ -101,7 +101,7 @@
<evaluator>org.alfresco.web.action.evaluator.CheckinDocEvaluator</evaluator> <evaluator>org.alfresco.web.action.evaluator.CheckinDocEvaluator</evaluator>
<label-id>checkin</label-id> <label-id>checkin</label-id>
<image>/images/icons/CheckIn_icon.gif</image> <image>/images/icons/CheckIn_icon.gif</image>
<action-listener>#{CheckinCheckoutBean.setupWorkflowContentAction}</action-listener> <action-listener>#{CheckinCheckoutDialog.setupWorkflowContentAction}</action-listener>
<action>dialog:checkinFile</action> <action>dialog:checkinFile</action>
<params> <params>
<param name="id">#{actionContext.id}</param> <param name="id">#{actionContext.id}</param>
@@ -114,7 +114,7 @@
<evaluator>org.alfresco.web.action.evaluator.CheckoutDocEvaluator</evaluator> <evaluator>org.alfresco.web.action.evaluator.CheckoutDocEvaluator</evaluator>
<label-id>checkout</label-id> <label-id>checkout</label-id>
<image>/images/icons/CheckOut_icon.gif</image> <image>/images/icons/CheckOut_icon.gif</image>
<action-listener>#{CheckinCheckoutBean.setupWorkflowContentAction}</action-listener> <action-listener>#{CheckinCheckoutDialog.setupWorkflowContentAction}</action-listener>
<action>dialog:checkoutFile</action> <action>dialog:checkoutFile</action>
<params> <params>
<param name="id">#{actionContext.id}</param> <param name="id">#{actionContext.id}</param>
@@ -127,7 +127,7 @@
<evaluator>org.alfresco.web.action.evaluator.CancelCheckoutDocEvaluator</evaluator> <evaluator>org.alfresco.web.action.evaluator.CancelCheckoutDocEvaluator</evaluator>
<label-id>undocheckout</label-id> <label-id>undocheckout</label-id>
<image>/images/icons/undo_checkout.gif</image> <image>/images/icons/undo_checkout.gif</image>
<action-listener>#{CheckinCheckoutBean.setupWorkflowContentAction}</action-listener> <action-listener>#{CheckinCheckoutDialog.setupWorkflowContentAction}</action-listener>
<action>dialog:undoCheckoutFile</action> <action>dialog:undoCheckoutFile</action>
<params> <params>
<param name="id">#{actionContext.id}</param> <param name="id">#{actionContext.id}</param>

View File

@@ -0,0 +1,46 @@
/*
* 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;
import javax.faces.context.FacesContext;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.dialog.BaseDialogBean;
public class AdminConsoleDialog extends BaseDialogBean
{
private static final String BUTTON_CLOSE = "close";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return outcome;
}
@Override
public String getCancelButtonLabel() {
return Application.getMessage(FacesContext.getCurrentInstance(), BUTTON_CLOSE);
}
}

View File

@@ -0,0 +1,109 @@
/*
* 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;
import java.text.MessageFormat;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
public class ApplyDocTemplateDialog extends BaseDialogBean
{
protected String template;
private static final String DIALOG_CLOSE = "dialog:close";
private static final String MSG_APPLY_TEMPLATE = "apply_template";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
if (this.template != null && this.template.equals(TemplateSupportBean.NO_SELECTION) == false)
{
try
{
// apply the templatable aspect if required
if (getNode().hasAspect(ContentModel.ASPECT_TEMPLATABLE) == false)
{
this.nodeService.addAspect(getNode().getNodeRef(), ContentModel.ASPECT_TEMPLATABLE, null);
}
// get the selected template from the Template Picker
NodeRef templateRef = new NodeRef(Repository.getStoreRef(), this.template);
// set the template NodeRef into the templatable aspect property
this.nodeService.setProperty(getNode().getNodeRef(), ContentModel.PROP_TEMPLATE, templateRef);
// reset node details for next refresh of details page
getNode().reset();
}
catch (Exception e)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), e.getMessage()), e);
}
}
return DIALOG_CLOSE;
}
public boolean getFinishButtonDisabled()
{
return false;
}
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_APPLY_TEMPLATE) + " '" + getName() + "'";
}
public String getTemplate()
{
// return current template if it exists
NodeRef ref = (NodeRef) getNode().getProperties().get(ContentModel.PROP_TEMPLATE);
return ref != null ? ref.getId() : this.template;
}
public void setTemplate(String template)
{
this.template = template;
}
public Node getNode()
{
return this.browseBean.getDocument();
}
public String getName()
{
return getNode().getName();
}
}

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;
import java.text.MessageFormat;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import org.alfresco.model.ApplicationModel;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
public class ApplyRssTemplateDialog extends BaseDialogBean
{
private static final String DIALOG_CLOSE = "dialog:close";
private static final String MSG_APPLY_RSS_FEED = "apply_rss_feed";
private String rssTemplate;
public void setRSSTemplate(String rssTemplate)
{
this.rssTemplate = rssTemplate;
}
/**
* @return Returns the current RSS Template ID.
*/
public String getRSSTemplate()
{
// return current template if it exists
NodeRef ref = (NodeRef) getNode().getProperties().get(ApplicationModel.PROP_FEEDTEMPLATE);
return ref != null ? ref.getId() : this.rssTemplate;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
applyRSSTemplate(null);
return DIALOG_CLOSE;
}
public boolean getFinishButtonDisabled()
{
return false;
}
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_APPLY_RSS_FEED) + " '" + getNode().getName() + "'";
}
public void applyRSSTemplate(ActionEvent event)
{
if (this.rssTemplate != null && this.rssTemplate.equals(TemplateSupportBean.NO_SELECTION) == false)
{
try
{
// apply the feedsource aspect if required
if (getNode().hasAspect(ApplicationModel.ASPECT_FEEDSOURCE) == false)
{
this.nodeService.addAspect(getNode().getNodeRef(), ApplicationModel.ASPECT_FEEDSOURCE, null);
}
// get the selected template Id from the Template Picker
NodeRef templateRef = new NodeRef(Repository.getStoreRef(), this.rssTemplate);
// set the template NodeRef into the templatable aspect property
this.nodeService.setProperty(getNode().getNodeRef(), ApplicationModel.PROP_FEEDTEMPLATE, templateRef);
// reset node details for next refresh of details page
getNode().reset();
}
catch (Exception e)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), e.getMessage()), e);
}
}
}
/**
* Returns the Node this bean is currently representing
*
* @return The Node
*/
public Node getNode()
{
return this.browseBean.getActionSpace();
}
}

View File

@@ -0,0 +1,110 @@
/*
* 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;
import java.text.MessageFormat;
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.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
public class ApplySpaceTemplateDialog extends BaseDialogBean
{
protected String template;
private static final String DIALOG_CLOSE = "dialog:close";
private static final String MSG_APPLY_TEMPLATE = "apply_template";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
applyTemplate(null);
return DIALOG_CLOSE;
}
public boolean getFinishButtonDisabled()
{
return false;
}
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_APPLY_TEMPLATE) + " '" + getNode().getName() + "'";
}
public void applyTemplate(ActionEvent event)
{
if (this.template != null && this.template.equals(TemplateSupportBean.NO_SELECTION) == false)
{
try
{
// apply the templatable aspect if required
if (getNode().hasAspect(ContentModel.ASPECT_TEMPLATABLE) == false)
{
this.nodeService.addAspect(getNode().getNodeRef(), ContentModel.ASPECT_TEMPLATABLE, null);
}
// get the selected template from the Template Picker
NodeRef templateRef = new NodeRef(Repository.getStoreRef(), this.template);
// set the template NodeRef into the templatable aspect property
this.nodeService.setProperty(getNode().getNodeRef(), ContentModel.PROP_TEMPLATE, templateRef);
// reset node details for next refresh of details page
getNode().reset();
}
catch (Exception e)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), e.getMessage()), e);
}
}
}
public Node getNode()
{
return this.browseBean.getActionSpace();
}
public String getTemplate()
{
// return current template if it exists
NodeRef ref = (NodeRef) getNode().getProperties().get(ContentModel.PROP_TEMPLATE);
return ref != null ? ref.getId() : this.template;
}
public void setTemplate(String template)
{
this.template = template;
}
}

View File

@@ -0,0 +1,186 @@
/*
* 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;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.workflow.WorkflowModel;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.workflow.WorkflowTask;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.servlet.DownloadContentServlet;
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 CCCheckoutFileDialog extends CheckinCheckoutDialog
{
public static final String LBL_SAVE = "save";
public static final String LBL_CHECKOUT = "check_out";
private static Log logger = LogFactory.getLog(CCCheckoutFileDialog.class);
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return checkoutFile(context, outcome);
}
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), LBL_CHECKOUT);
}
@Override
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), LBL_CHECKOUT) + " '" + property.getDocument().getName() + "'";
}
/**
* Action called upon completion of the Check Out file page
*/
public String checkoutFile(FacesContext context, String outcome)
{
boolean checkoutSuccessful = false;
final Node node = property.getDocument();
if (node != null)
{
try
{
if (logger.isDebugEnabled())
logger.debug("Trying to checkout content node Id: " + node.getId());
// checkout the node content to create a working copy
if (logger.isDebugEnabled())
{
logger.debug("Checkout copy location: " + property.getCopyLocation());
logger.debug("Selected Space Id: " + property.getSelectedSpaceId());
}
NodeRef workingCopyRef = null;
if (property.getCopyLocation().equals(CCProperties.COPYLOCATION_OTHER) && property.getSelectedSpaceId() != null)
{
// checkout to a arbituary parent Space
NodeRef destRef = property.getSelectedSpaceId();
ChildAssociationRef childAssocRef = nodeService.getPrimaryParent(destRef);
workingCopyRef = property.getVersionOperationsService().checkout(node.getNodeRef(), destRef, ContentModel.ASSOC_CONTAINS, childAssocRef.getQName());
}
else
{
// checkout the content to the current space
workingCopyRef = property.getVersionOperationsService().checkout(node.getNodeRef());
// if this is a workflow action and there is a task id
// present we need
// to also link the working copy to the workflow package so
// it appears
// in the resources panel in the manage task dialog
if (property.isWorkflowAction() && property.getWorkflowTaskId() != null && (property.getWorkflowTaskId().equals("null") == false))
{
WorkflowTask task = property.getWorkflowService().getTaskById(property.getWorkflowTaskId());
if (task != null)
{
NodeRef workflowPackage = (NodeRef) task.properties.get(WorkflowModel.ASSOC_PACKAGE);
if (workflowPackage != null)
{
nodeService.addChild(workflowPackage, workingCopyRef, ContentModel.ASSOC_CONTAINS, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, QName
.createValidLocalName((String) nodeService.getProperty(workingCopyRef, ContentModel.PROP_NAME))));
if (logger.isDebugEnabled())
logger.debug("Added working copy to workflow package: " + workflowPackage);
}
}
}
}
// 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
// the myfile part will be ignored by the servlet but gives the
// browser a hint
String url = DownloadContentServlet.generateDownloadURL(workingCopyRef, workingCopy.getName());
workingCopy.getProperties().put("url", url);
workingCopy.getProperties().put("fileType32", Utils.getFileTypeImage(workingCopy.getName(), false));
// mark as successful
checkoutSuccessful = true;
}
catch (Throwable err)
{
Utils.addErrorMessage(Application.getMessage(context, MSG_ERROR_CHECKOUT) + err.getMessage(), err);
}
}
else
{
logger.warn("WARNING: checkoutFile called without a current Document!");
}
// determine which page to show next if the checkout was successful.
if (checkoutSuccessful)
{
// If a check-in rule is present in the space
// the document was checked out to the working copy would have
// already disappeared!
if (this.nodeService.exists(property.getWorkingDocument().getNodeRef()))
{
// go to the page that allows the user to download the content
// for editing
outcome = "dialog:checkoutFileLink"; // "checkoutFileLink";
// //checkout-file-link.jsp
// currentAction = Action.CHECKOUT_FILE_LINK;
}
else
{
// show a page telling the user that the content has already
// been checked in
outcome = "dialog:workingCopyMissing";// "workingCopyMissing";
// //
// working-copy-missing.jsp
// currentAction = Action.WORKING_COPY_MISSING;
}
}
return outcome;
}
}

View File

@@ -0,0 +1,103 @@
/*
* 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;
import javax.faces.context.FacesContext;
import org.alfresco.web.app.AlfrescoNavigationHandler;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Node;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class CCCheckoutFileLinkDialog extends CheckinCheckoutDialog
{
public static final String MSG_CHECKOUT_OF = "check_out_of";
public static final String LBL_UNDO_CHECKOUT = "undo_checkout";
private static Log logger = LogFactory.getLog(CCCheckoutFileLinkDialog.class);
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return checkoutFileOK(context, outcome);
}
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
@Override
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_CHECKOUT_OF) + " '" + property.getDocument().getName() + "'";
}
@Override
public String getCancelButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), LBL_UNDO_CHECKOUT);
}
@Override
public String cancel()
{
undoCheckout();
resetState();
super.cancel();
return "browse";
}
/**
* Action called upon completion of the Check Out file Link download page
*/
public String checkoutFileOK(FacesContext context, String outcome)
{
Node node = property.getWorkingDocument();
if (node != null)
{
// reset the underlying node
if (this.browseBean.getDocument() != null)
{
this.browseBean.getDocument().reset();
}
// clean up and clear action context
resetState();
property.setDocument(null);
property.setWorkingDocument(null);
// currentAction = Action.NONE;
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME + ":browse";
}
else
{
logger.warn("WARNING: checkoutFileOK called without a current WorkingDocument!");
}
return outcome;
}
}

View File

@@ -0,0 +1,63 @@
/*
* 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;
import javax.faces.context.FacesContext;
import org.alfresco.web.app.Application;
public class CCEditFileDialog extends CheckinCheckoutDialog
{
public static final String LBL_CLOSE = "close";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return super.cancel();
}
@Override
public String cancel()
{
property.setDocument(null);
property.setWorkingDocument(null);
resetState();
return super.cancel();
}
@Override
public String getCancelButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), LBL_CLOSE);
}
@Override
public String getContainerTitle()
{
return "'" + property.getDocument().getName() + "'";
}
}

View File

@@ -0,0 +1,61 @@
/*
* 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;
import javax.faces.context.FacesContext;
import org.alfresco.web.app.Application;
public class CCEditHtmlInlineDialog extends CheckinCheckoutDialog
{
public static final String LBL_SAVE = "save";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return editInline(context, outcome);
}
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), LBL_SAVE);
}
@Override
public String getContainerTitle()
{
return property.getDocument().getName();
}
}

View File

@@ -0,0 +1,61 @@
/*
* 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;
import javax.faces.context.FacesContext;
import org.alfresco.web.app.Application;
public class CCEditTextInlineDialog extends CheckinCheckoutDialog
{
public static final String LBL_SAVE = "save";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return editInline(context, outcome);
}
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), LBL_SAVE);
}
@Override
public String getContainerTitle()
{
return property.getDocument().getName();
}
}

View File

@@ -0,0 +1,349 @@
/*
* 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;
import java.io.File;
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.workflow.WorkflowService;
import org.alfresco.web.bean.repository.Node;
public class CCProperties
{
/** The VersionOperationsService to be used by the bean */
protected CheckOutCheckInService versionOperationsService;
/** The ContentService to be used by the bean */
protected ContentService contentService;
/** The WorkflowService to be used by the bean */
protected WorkflowService workflowService;
/** Content of the document returned from in-line editing */
private String editorOutput;
/** Content of the document used for HTML in-line editing */
private String documentContent;
/** The working copy of the document we are checking out */
private Node workingDocument;
/** The current document */
private Node document;
/** transient form and upload properties */
private File file;
private String fileName;
private boolean keepCheckedOut = false;
private boolean minorChange = true;
private boolean isWorkflowAction = false;
private String workflowTaskId;
private NodeRef selectedSpaceId = null;
/** constants for copy location selection */
public static final String COPYLOCATION_CURRENT = "current";
public static final String COPYLOCATION_OTHER = "other";
private String versionNotes = "";
private String copyLocation = COPYLOCATION_CURRENT;
/**
* @return Returns the VersionOperationsService.
*/
public CheckOutCheckInService getVersionOperationsService()
{
return this.versionOperationsService;
}
/**
* @param versionOperationsService
* The VersionOperationsService to set.
*/
public void setVersionOperationsService(CheckOutCheckInService versionOperationsService)
{
this.versionOperationsService = versionOperationsService;
}
/**
* @return Returns the ContentService.
*/
public ContentService getContentService()
{
return this.contentService;
}
/**
* @param contentService
* The ContentService to set.
*/
public void setContentService(ContentService contentService)
{
this.contentService = contentService;
}
/**
* @param workflowService
* The WorkflowService to set.
*/
public void setWorkflowService(WorkflowService workflowService)
{
this.workflowService = workflowService;
}
/**
* @return the workflowService
*/
public WorkflowService getWorkflowService()
{
return this.workflowService;
}
/**
* @return Returns output from the in-line editor page.
*/
public String getEditorOutput()
{
return this.editorOutput;
}
/**
* @param editorOutput
* The output from the in-line editor page
*/
public void setEditorOutput(String editorOutput)
{
this.editorOutput = editorOutput;
}
/**
* @return Returns the document content used for HTML in-line editing.
*/
public String getDocumentContent()
{
return this.documentContent;
}
/**
* @param documentContent
* The document content for HTML in-line editing.
*/
public void setDocumentContent(String documentContent)
{
this.documentContent = documentContent;
}
/**
* @return Returns the working copy Document.
*/
public Node getWorkingDocument()
{
return this.workingDocument;
}
/**
* @param workingDocument
* The working copy Document to set.
*/
public void setWorkingDocument(Node workingDocument)
{
this.workingDocument = workingDocument;
}
/**
* @return The document node being used for the current operation
*/
public Node getDocument()
{
return this.document;
}
/**
* @param document
* The document node to be used for the current operation
*/
public void setDocument(Node document)
{
this.document = document;
}
/**
* @return Returns the selected Space Id.
*/
public NodeRef getSelectedSpaceId()
{
return this.selectedSpaceId;
}
/**
* @param selectedSpaceId
* The selected Space Id to set.
*/
public void setSelectedSpaceId(NodeRef selectedSpaceId)
{
this.selectedSpaceId = selectedSpaceId;
}
/**
* @return the file
*/
public File getFile()
{
return file;
}
/**
* @param file the file to set
*/
public void setFile(File file)
{
this.file = file;
}
/**
* @return the fileName
*/
public String getFileName()
{
return fileName;
}
/**
* @param fileName the fileName to set
*/
public void setFileName(String fileName)
{
this.fileName = fileName;
}
/**
* @param keepCheckedOut
* The keepCheckedOut to set.
*/
public void setKeepCheckedOut(boolean keepCheckedOut)
{
this.keepCheckedOut = keepCheckedOut;
}
/**
* @return Returns the keepCheckedOut.
*/
public boolean getKeepCheckedOut()
{
return this.keepCheckedOut;
}
/**
* @param minorChange
* The minorChange to set.
*/
public void setMinorChange(boolean minorChange)
{
this.minorChange = minorChange;
}
/**
* @return Returns the minorChange flag.
*/
public boolean getMinorChange()
{
return this.minorChange;
}
/**
* @return the isWorkflowAction
*/
public boolean isWorkflowAction()
{
return isWorkflowAction;
}
/**
* @param isWorkflowAction the isWorkflowAction to set
*/
public void setWorkflowAction(boolean isWorkflowAction)
{
this.isWorkflowAction = isWorkflowAction;
}
/**
* @return the workflowTaskId
*/
public String getWorkflowTaskId()
{
return workflowTaskId;
}
/**
* @param workflowTaskId the workflowTaskId to set
*/
public void setWorkflowTaskId(String workflowTaskId)
{
this.workflowTaskId = workflowTaskId;
}
/**
* @return Returns the version history notes.
*/
public String getVersionNotes()
{
return this.versionNotes;
}
/**
* @param versionNotes
* The version history notes to set.
*/
public void setVersionNotes(String versionNotes)
{
this.versionNotes = versionNotes;
}
/**
* @return Returns the copy location. Either the current or other space.
*/
public String getCopyLocation()
{
if (this.getFileName() != null)
{
return CCProperties.COPYLOCATION_OTHER;
}
else
{
return this.copyLocation;
}
}
/**
* @param copyLocation
* The copy location. Either the current or other space.
*/
public void setCopyLocation(String copyLocation)
{
this.copyLocation = copyLocation;
}
}

View File

@@ -0,0 +1,118 @@
/*
* 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;
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 CCUndoCheckoutFileDialog extends CheckinCheckoutDialog
{
public static final String LBL_UNDO_CHECKOUT = "undo_checkout";
public static final String MSG_UNDO_CHECKOUT_FOR = "undo_checkout_for";
private static Log logger = LogFactory.getLog(CheckinCheckoutDialog.class);
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return undoCheckoutFile(context, outcome);
}
@Override
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_UNDO_CHECKOUT_FOR) + " '" + property.getDocument().getName() + "'";
}
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), LBL_UNDO_CHECKOUT);
}
/**
* 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

@@ -0,0 +1,64 @@
/*
* 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;
import javax.faces.context.FacesContext;
import org.alfresco.web.app.AlfrescoNavigationHandler;
import org.alfresco.web.app.Application;
public class CCWorkingCopyMissingDialog extends CheckinCheckoutDialog
{
public static final String MSG_WORKING_COPY_FOR = "working_copy_for";
public static final String LBL_CLOSE = "close";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().remove(AlfrescoNavigationHandler.EXTERNAL_CONTAINER_SESSION);
return getDefaultCancelOutcome();
}
@Override
public String cancel()
{
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().remove(AlfrescoNavigationHandler.EXTERNAL_CONTAINER_SESSION);
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME + ":browse";
}
@Override
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_WORKING_COPY_FOR) + " '" + property.getDocument().getName() + "'";
}
@Override
public String getCancelButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), LBL_CLOSE);
}
}

View File

@@ -1,740 +0,0 @@
/*
* 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;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.transaction.UserTransaction;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.search.CategoryService;
import org.alfresco.service.cmr.search.CategoryService.Depth;
import org.alfresco.service.cmr.search.CategoryService.Mode;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.context.IContextListener;
import org.alfresco.web.app.context.UIContextService;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.IBreadcrumbHandler;
import org.alfresco.web.ui.common.component.UIActionLink;
import org.alfresco.web.ui.common.component.UIBreadcrumb;
import org.alfresco.web.ui.common.component.UIModeList;
import org.alfresco.web.ui.common.component.data.UIRichList;
import org.alfresco.web.ui.repo.component.IRepoBreadcrumbHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Backing Bean for the Category Management pages.
*
* @author Kevin Roast
*/
public class CategoriesBean implements IContextListener
{
private static final String DEFAULT_OUTCOME = "finish";
private static final String MSG_CATEGORIES = "categories";
private static Log logger = LogFactory.getLog(CategoriesBean.class);
/** The NodeService to be used by the bean */
protected NodeService nodeService;
protected CategoryService categoryService;
/** Component references */
protected UIRichList categoriesRichList;
/** Currently visible category Node*/
private Node category = null;
/** Current category ref */
private NodeRef categoryRef = null;
/** Action category node */
private Node actionCategory = null;
/** Members of the linked items of a category */
private Collection<ChildAssociationRef> members = null;
/** Dialog properties */
private String name = null;
private String description = null;
/** RichList view mode */
private String viewMode = "icons";
/** Category path breadcrumb location */
private List<IBreadcrumbHandler> location = null;
// ------------------------------------------------------------------------------
// Construction
/**
* Default Constructor
*/
public CategoriesBean()
{
UIContextService.getInstance(FacesContext.getCurrentInstance()).registerBean(this);
}
// ------------------------------------------------------------------------------
// Bean property getters and setters
/**
* @param nodeService The NodeService to set.
*/
public void setNodeService(NodeService nodeService)
{
this.nodeService = nodeService;
}
/**
* @param categoryService The CategoryService to set.
*/
public void setCategoryService(CategoryService categoryService)
{
this.categoryService = categoryService;
}
/**
* @param list The categories RichList to set.
*/
public void setCategoriesRichList(UIRichList list)
{
this.categoriesRichList = list;
}
/**
* @return Returns the categories RichList to set.
*/
public UIRichList getCategoriesRichList()
{
return this.categoriesRichList;
}
/**
* @return Returns the description.
*/
public String getDescription()
{
return this.description;
}
/**
* @param description The description to set.
*/
public void setDescription(String description)
{
this.description = description;
}
/**
* @return Returns the viewMode.
*/
public String getViewMode()
{
return this.viewMode;
}
/**
* @param viewMode The viewMode to set.
*/
public void setViewMode(String viewMode)
{
this.viewMode = viewMode;
}
/**
* @return Returns the name.
*/
public String getName()
{
return this.name;
}
/**
* @param name The name to set.
*/
public void setName(String name)
{
this.name = name;
}
/**
* @return Returns the members count for current action category.
*/
public int getMembers()
{
return (this.members != null ? this.members.size() : 0);
}
/**
* @return Returns the Node being used for the current action screen.
*/
public Node getActionCategory()
{
return this.actionCategory;
}
/**
* @param node Set the Node to be used for the current category screen action.
*/
public void setActionCategory(Node node)
{
this.actionCategory = node;
if (node != null)
{
// setup form properties
this.name = node.getName();
this.description = (String)node.getProperties().get(ContentModel.PROP_DESCRIPTION);
this.members = this.categoryService.getChildren(node.getNodeRef(), Mode.MEMBERS, Depth.ANY);
}
else
{
this.name = null;
this.description = null;
this.members = Collections.emptyList();
}
}
/**
* @return The currently displayed category as a Node or null if at the root.
*/
public Node getCurrentCategory()
{
if (this.category == null)
{
if (this.categoryRef != null)
{
this.category = new Node(this.categoryRef);
}
}
return this.category;
}
/**
* @return The ID of the currently displayed category or null if at the root.
*/
public String getCurrentCategoryId()
{
if (this.categoryRef != null)
{
return categoryRef.getId();
}
else
{
return null;
}
}
/**
* Set the current category node.
* <p>
* Setting this value causes the UI to update and display the specified node as current.
*
* @param ref The current category node.
*/
public void setCurrentCategory(NodeRef ref)
{
if (logger.isDebugEnabled())
logger.debug("Setting current category: " + ref);
// set the current NodeRef for our UI context operations
this.categoryRef = ref;
// clear current node context
this.category = null;
// inform that the UI needs updating after this change
contextUpdated();
}
/**
* @return Breadcrumb location list
*/
public List<IBreadcrumbHandler> getLocation()
{
if (this.location == null)
{
List<IBreadcrumbHandler> loc = new ArrayList<IBreadcrumbHandler>(8);
loc.add(new CategoryBreadcrumbHandler(null,
Application.getMessage(FacesContext.getCurrentInstance(), MSG_CATEGORIES)));
this.location = loc;
}
return this.location;
}
/**
* @param location Breadcrumb location list
*/
public void setLocation(List<IBreadcrumbHandler> location)
{
this.location = location;
}
/**
* @return The list of categories Nodes to display. Returns the list root categories or the
* list of sub-categories for the current category if set.
*/
public List<Node> getCategories()
{
List<Node> categories;
UserTransaction tx = null;
try
{
FacesContext context = FacesContext.getCurrentInstance();
tx = Repository.getUserTransaction(context, true);
tx.begin();
Collection<ChildAssociationRef> refs;
if (this.categoryRef == null)
{
// root categories
refs = this.categoryService.getCategories(Repository.getStoreRef(), ContentModel.ASPECT_GEN_CLASSIFIABLE, Depth.IMMEDIATE);
}
else
{
// sub-categories of an existing category
refs = this.categoryService.getChildren(this.categoryRef, Mode.SUB_CATEGORIES, Depth.IMMEDIATE);
}
categories = new ArrayList<Node>(refs.size());
for (ChildAssociationRef child : refs)
{
Node categoryNode = new Node(child.getChildRef());
// force early props init within transaction
categoryNode.getProperties();
categories.add(categoryNode);
}
// commit the transaction
tx.commit();
}
catch (InvalidNodeRefException refErr)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_NODEREF), new Object[] {refErr.getNodeRef()}) );
categories = Collections.<Node>emptyList();
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
}
catch (Throwable err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
categories = Collections.<Node>emptyList();
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
}
return categories;
}
/**
* Set the Category to be used for next action dialog
*/
public void setupCategoryAction(ActionEvent event)
{
UIActionLink link = (UIActionLink)event.getComponent();
Map<String, String> params = link.getParameterMap();
String id = params.get("id");
if (id != null && id.length() != 0)
{
if (logger.isDebugEnabled())
logger.debug("Setup for action, setting current Category to: " + id);
try
{
// create the node ref, then our node representation
NodeRef ref = new NodeRef(Repository.getStoreRef(), id);
Node node = new Node(ref);
// prepare a node for the action context
setActionCategory(node);
// clear datalist cache ready from return from action dialog
contextUpdated();
}
catch (InvalidNodeRefException refErr)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_NODEREF), new Object[] {id}) );
}
}
}
/**
* Clear the category action context - e.g. ready for a Create operation
*/
public void clearCategoryAction(ActionEvent event)
{
setActionCategory(null);
// clear datalist cache ready from return from action dialog
contextUpdated();
}
/**
* Action called when a category folder is clicked.
* Navigate into the category.
*/
public void clickCategory(ActionEvent event)
{
UIActionLink link = (UIActionLink)event.getComponent();
Map<String, String> params = link.getParameterMap();
String id = params.get("id");
if (id != null && id.length() != 0)
{
try
{
NodeRef ref = new NodeRef(Repository.getStoreRef(), id);
// refresh UI based on node selection
updateUILocation(ref);
}
catch (InvalidNodeRefException refErr)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_NODEREF), new Object[] {id}) );
}
}
}
/**
* Action handler called on Create Category finish button click.
*/
public String finishCreate()
{
String outcome = DEFAULT_OUTCOME;
try
{
FacesContext context = FacesContext.getCurrentInstance();
RetryingTransactionHelper txnHelper = Repository.getRetryingTransactionHelper(context);
RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>()
{
public Object execute() throws Throwable
{
// create category using categoryservice
NodeRef ref;
if (categoryRef == null)
{
ref = categoryService.createRootCategory(Repository.getStoreRef(), ContentModel.ASPECT_GEN_CLASSIFIABLE, name.trim());
}
else
{
ref = categoryService.createCategory(categoryRef, name.trim());
}
// apply the titled aspect - for description
Map<QName, Serializable> titledProps = new HashMap<QName, Serializable>(1, 1.0f);
titledProps.put(ContentModel.PROP_DESCRIPTION, description);
nodeService.addAspect(ref, ContentModel.ASPECT_TITLED, titledProps);
return null;
}
};
txnHelper.doInTransaction(callback);
}
catch (Throwable err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
outcome = null;
}
return outcome;
}
/**
* Action handler called on Edit Category finish button click.
*/
public String finishEdit()
{
String outcome = DEFAULT_OUTCOME;
try
{
FacesContext context = FacesContext.getCurrentInstance();
RetryingTransactionHelper txnHelper = Repository.getRetryingTransactionHelper(context);
RetryingTransactionCallback<NodeRef> callback = new RetryingTransactionCallback<NodeRef>()
{
public NodeRef execute() throws Throwable
{
// update the category node
NodeRef nodeRef = getActionCategory().getNodeRef();
nodeService.setProperty(nodeRef, ContentModel.PROP_NAME, name);
// apply the titled aspect - for description
if (nodeService.hasAspect(nodeRef, ContentModel.ASPECT_TITLED) == false)
{
Map<QName, Serializable> titledProps = new HashMap<QName, Serializable>(1, 1.0f);
titledProps.put(ContentModel.PROP_DESCRIPTION, description);
nodeService.addAspect(nodeRef, ContentModel.ASPECT_TITLED, titledProps);
}
else
{
nodeService.setProperty(nodeRef, ContentModel.PROP_DESCRIPTION, description);
}
return nodeRef;
}
};
NodeRef nodeRef = txnHelper.doInTransaction(callback);
// edit the node in the breadcrumb if required
List<IBreadcrumbHandler> location = getLocation();
IBreadcrumbHandler handler = location.get(location.size() - 1);
// see if the current breadcrumb location is our node
if ( nodeRef.equals(((IRepoBreadcrumbHandler)handler).getNodeRef()) )
{
// and update with the modified node details
IBreadcrumbHandler newHandler = new CategoryBreadcrumbHandler(
nodeRef, Repository.getNameForNode(nodeService, nodeRef));
location.set(location.size() - 1, newHandler);
}
}
catch (Throwable err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
outcome = null;
}
return outcome;
}
/**
* Action handler called on Delete Category finish button click.
*/
public String finishDelete()
{
String outcome = DEFAULT_OUTCOME;
if (getActionCategory() != null)
{
try
{
FacesContext context = FacesContext.getCurrentInstance();
RetryingTransactionHelper txnHelper = Repository.getRetryingTransactionHelper(context);
RetryingTransactionCallback<NodeRef> callback = new RetryingTransactionCallback<NodeRef>()
{
public NodeRef execute() throws Throwable
{
// delete the category node using the nodeservice
NodeRef categoryNodeRef = getActionCategory().getNodeRef();
categoryService.deleteCategory(categoryNodeRef);
// if there are other items in the repository using this category
// all the associations to the category should be removed too
if (members != null && members.size() > 0)
{
for (ChildAssociationRef childRef : members)
{
List<NodeRef> list = new ArrayList<NodeRef>(members.size());
NodeRef member = childRef.getChildRef();
Collection<NodeRef> categories = (Collection<NodeRef>)nodeService.
getProperty(member, ContentModel.PROP_CATEGORIES);
for (NodeRef category : categories)
{
if (category.equals(categoryNodeRef) == false)
{
list.add(category);
}
}
// persist the list back to the repository
nodeService.setProperty(member, ContentModel.PROP_CATEGORIES, (Serializable)list);
}
}
return categoryNodeRef;
}
};
NodeRef categoryNodeRef = txnHelper.doInTransaction(callback);
// remove this node from the breadcrumb if required
List<IBreadcrumbHandler> location = getLocation();
IBreadcrumbHandler handler = location.get(location.size() - 1);
// see if the current breadcrumb location is our node
if ( categoryNodeRef.equals(((IRepoBreadcrumbHandler)handler).getNodeRef()) )
{
location.remove(location.size() - 1);
// now work out which node to set the list to refresh against
if (location.size() != 0)
{
handler = location.get(location.size() - 1);
this.setCurrentCategory(((IRepoBreadcrumbHandler)handler).getNodeRef());
}
}
// clear action context
setActionCategory(null);
}
catch (Throwable err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
outcome = null;
}
}
return outcome;
}
/**
* Change the current view mode based on user selection
*
* @param event ActionEvent
*/
public void viewModeChanged(ActionEvent event)
{
UIModeList viewList = (UIModeList)event.getComponent();
// get the view mode ID
setViewMode(viewList.getValue().toString());
}
/**
* Update the breadcrumb with the clicked category location
*/
private void updateUILocation(NodeRef ref)
{
String name = Repository.getNameForNode(this.nodeService, ref);
this.location.add(new CategoryBreadcrumbHandler(ref, name));
this.setCurrentCategory(ref);
}
// ------------------------------------------------------------------------------
// IContextListener implementation
/**
* @see org.alfresco.web.app.context.IContextListener#contextUpdated()
*/
public void contextUpdated()
{
if (logger.isDebugEnabled())
logger.debug("Invalidating Category Management Components...");
// force a requery of the current category ref properties
this.category = null;
// force a requery of the richlist dataset
this.categoriesRichList.setValue(null);
}
/**
* @see org.alfresco.web.app.context.IContextListener#areaChanged()
*/
public void areaChanged()
{
// nothing to do
}
/**
* @see org.alfresco.web.app.context.IContextListener#spaceChanged()
*/
public void spaceChanged()
{
// nothing to do
}
// ------------------------------------------------------------------------------
// Inner classes
/**
* Class to handle breadcrumb interaction for Categories pages
*/
private class CategoryBreadcrumbHandler implements IRepoBreadcrumbHandler
{
private static final long serialVersionUID = 3831234653171036630L;
/**
* Constructor
*
* @param NodeRef The NodeRef for this browse navigation element
* @param label Element label
*/
public CategoryBreadcrumbHandler(NodeRef nodeRef, String label)
{
this.label = label;
this.nodeRef = nodeRef;
}
/**
* @see java.lang.Object#toString()
*/
public String toString()
{
return this.label;
}
/**
* @see org.alfresco.web.ui.common.component.IBreadcrumbHandler#navigationOutcome(org.alfresco.web.ui.common.component.UIBreadcrumb)
*/
@SuppressWarnings("unchecked")
public String navigationOutcome(UIBreadcrumb breadcrumb)
{
// All category breadcrumb elements relate to a Categiry Node Id
// when selected we set the current category Id and return
setCurrentCategory(this.nodeRef);
setLocation( (List)breadcrumb.getValue() );
return null;
}
public NodeRef getNodeRef()
{
return this.nodeRef;
}
private NodeRef nodeRef;
private String label;
}
}

View File

@@ -0,0 +1,432 @@
/*
* 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;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.transaction.UserTransaction;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.search.CategoryService.Depth;
import org.alfresco.service.cmr.search.CategoryService.Mode;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.context.IContextListener;
import org.alfresco.web.app.context.UIContextService;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.IBreadcrumbHandler;
import org.alfresco.web.ui.common.component.UIActionLink;
import org.alfresco.web.ui.common.component.UIBreadcrumb;
import org.alfresco.web.ui.common.component.UIModeList;
import org.alfresco.web.ui.repo.component.IRepoBreadcrumbHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Backing Bean for the Category Management pages.
*
* @author Kevin Roast
*/
public class CategoriesDialog extends BaseDialogBean implements IContextListener
{
protected CategoriesProperties properties;
private static final String MSG_CATEGORIES = "categories";
private static Log logger = LogFactory.getLog(CategoriesDialog.class);
// ------------------------------------------------------------------------------
// Construction
/**
* Default Constructor
*/
public CategoriesDialog()
{
UIContextService.getInstance(FacesContext.getCurrentInstance()).registerBean(this);
}
// ------------------------------------------------------------------------------
public void setProperties(CategoriesProperties properties)
{
this.properties = properties;
}
/**
* @return Returns the members count for current action category.
*/
public int getMembers()
{
return (properties.getMembers() != null ? properties.getMembers().size() : 0);
}
/**
* @param node Set the Node to be used for the current category screen action.
*/
@SuppressWarnings("unchecked")
public void setActionCategory(Node node)
{
properties.setActionCategory(node);
if (node != null)
{
// setup form properties
properties.setName(node.getName());
properties.setDescription((String)node.getProperties().get(ContentModel.PROP_DESCRIPTION));
properties.setMembers(properties.getCategoryService().getChildren(node.getNodeRef(), Mode.MEMBERS, Depth.ANY));
}
else
{
properties.setName(null);
properties.setDescription(null);
Object emptyCollection = Collections.emptyList();
properties.setMembers((Collection<ChildAssociationRef>) emptyCollection);
}
}
/**
* @return The currently displayed category as a Node or null if at the root.
*/
public Node getCurrentCategory()
{
if (properties.getCategory() == null)
{
if (properties.getCategoryRef() != null)
{
properties.setCategory(new Node(properties.getCategoryRef()));
}
}
return properties.getCategory();
}
/**
* @return The ID of the currently displayed category or null if at the root.
*/
public String getCurrentCategoryId()
{
if (properties.getCategoryRef() != null)
{
return properties.getCategoryRef().getId();
}
else
{
return null;
}
}
/**
* Set the current category node.
* <p>
* Setting this value causes the UI to update and display the specified node as current.
*
* @param ref The current category node.
*/
public void setCurrentCategory(NodeRef ref)
{
if (logger.isDebugEnabled())
logger.debug("Setting current category: " + ref);
// set the current NodeRef for our UI context operations
properties.setCategoryRef(ref);
// clear current node context
properties.setCategory(null);
// inform that the UI needs updating after this change
contextUpdated();
}
/**
* @return Breadcrumb location list
*/
public List<IBreadcrumbHandler> getLocation()
{
if (properties.getLocation() == null)
{
List<IBreadcrumbHandler> loc = new ArrayList<IBreadcrumbHandler>(8);
loc.add(new CategoryBreadcrumbHandler(null,
Application.getMessage(FacesContext.getCurrentInstance(), MSG_CATEGORIES)));
properties.setLocation(loc);
}
return properties.getLocation();
}
/**
* @return The list of categories Nodes to display. Returns the list root categories or the
* list of sub-categories for the current category if set.
*/
public List<Node> getCategories()
{
List<Node> categories;
UserTransaction tx = null;
try
{
FacesContext context = FacesContext.getCurrentInstance();
tx = Repository.getUserTransaction(context, true);
tx.begin();
Collection<ChildAssociationRef> refs;
if (properties.getCategoryRef() == null)
{
// root categories
refs = properties.getCategoryService().getCategories(Repository.getStoreRef(), ContentModel.ASPECT_GEN_CLASSIFIABLE, Depth.IMMEDIATE);
}
else
{
// sub-categories of an existing category
refs = properties.getCategoryService().getChildren(properties.getCategoryRef(), Mode.SUB_CATEGORIES, Depth.IMMEDIATE);
}
categories = new ArrayList<Node>(refs.size());
for (ChildAssociationRef child : refs)
{
Node categoryNode = new Node(child.getChildRef());
// force early props init within transaction
categoryNode.getProperties();
categories.add(categoryNode);
}
// commit the transaction
tx.commit();
}
catch (InvalidNodeRefException refErr)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_NODEREF), new Object[] {refErr.getNodeRef()}));
categories = Collections.<Node>emptyList();
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
}
catch (Throwable err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
categories = Collections.<Node>emptyList();
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
}
return categories;
}
/**
* Set the Category to be used for next action dialog
*/
public void setupCategoryAction(ActionEvent event)
{
UIActionLink link = (UIActionLink)event.getComponent();
Map<String, String> params = link.getParameterMap();
String id = params.get("id");
if (id != null && id.length() != 0)
{
if (logger.isDebugEnabled())
logger.debug("Setup for action, setting current Category to: " + id);
try
{
// create the node ref, then our node representation
NodeRef ref = new NodeRef(Repository.getStoreRef(), id);
Node node = new Node(ref);
// prepare a node for the action context
setActionCategory(node);
// clear datalist cache ready from return from action dialog
contextUpdated();
}
catch (InvalidNodeRefException refErr)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_NODEREF), new Object[] {id}));
}
}
}
/**
* Clear the category action context - e.g. ready for a Create operation
*/
public void clearCategoryAction(ActionEvent event)
{
setActionCategory(null);
// clear datalist cache ready from return from action dialog
contextUpdated();
}
/**
* Action called when a category folder is clicked.
* Navigate into the category.
*/
public void clickCategory(ActionEvent event)
{
UIActionLink link = (UIActionLink)event.getComponent();
Map<String, String> params = link.getParameterMap();
String id = params.get("id");
if (id != null && id.length() != 0)
{
try
{
NodeRef ref = new NodeRef(Repository.getStoreRef(), id);
// refresh UI based on node selection
updateUILocation(ref);
}
catch (InvalidNodeRefException refErr)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_NODEREF), new Object[] { id }));
}
}
}
/**
* Change the current view mode based on user selection
*
* @param event ActionEvent
*/
public void viewModeChanged(ActionEvent event)
{
UIModeList viewList = (UIModeList)event.getComponent();
// get the view mode ID
properties.setViewMode(viewList.getValue().toString());
}
/**
* Update the breadcrumb with the clicked category location
*/
private void updateUILocation(NodeRef ref)
{
String name = Repository.getNameForNode(this.nodeService, ref);
properties.getLocation().add(new CategoryBreadcrumbHandler(ref, name));
this.setCurrentCategory(ref);
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return null;
}
// ------------------------------------------------------------------------------
// IContextListener implementation
/**
* @see org.alfresco.web.app.context.IContextListener#contextUpdated()
*/
public void contextUpdated()
{
if (logger.isDebugEnabled())
logger.debug("Invalidating Category Management Components...");
// force a requery of the current category ref properties
properties.setCategory(null);
// force a requery of the richlist dataset
properties.getCategoriesRichList().setValue(null);
}
/**
* @see org.alfresco.web.app.context.IContextListener#areaChanged()
*/
public void areaChanged()
{
// nothing to do
}
/**
* @see org.alfresco.web.app.context.IContextListener#spaceChanged()
*/
public void spaceChanged()
{
// nothing to do
}
// ------------------------------------------------------------------------------
// Inner classes
/**
* Class to handle breadcrumb interaction for Categories pages
*/
protected class CategoryBreadcrumbHandler implements IRepoBreadcrumbHandler
{
private static final long serialVersionUID = 3831234653171036630L;
/**
* Constructor
*
* @param NodeRef The NodeRef for this browse navigation element
* @param label Element label
*/
public CategoryBreadcrumbHandler(NodeRef nodeRef, String label)
{
this.label = label;
this.nodeRef = nodeRef;
}
/**
* @see java.lang.Object#toString()
*/
public String toString()
{
return this.label;
}
/**
* @see org.alfresco.web.ui.common.component.IBreadcrumbHandler#navigationOutcome(org.alfresco.web.ui.common.component.UIBreadcrumb)
*/
@SuppressWarnings("unchecked")
public String navigationOutcome(UIBreadcrumb breadcrumb)
{
// All category breadcrumb elements relate to a Categiry Node Id
// when selected we set the current category Id and return
setCurrentCategory(this.nodeRef);
properties.setLocation((List)breadcrumb.getValue());
return null;
}
public NodeRef getNodeRef()
{
return this.nodeRef;
}
private NodeRef nodeRef;
private String label;
}
}

View File

@@ -0,0 +1,168 @@
/*
* 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;
import java.util.Collection;
import java.util.List;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.search.CategoryService;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.ui.common.component.IBreadcrumbHandler;
import org.alfresco.web.ui.common.component.data.UIRichList;
public class CategoriesProperties
{
protected CategoryService categoryService;
/** Component references */
protected UIRichList categoriesRichList;
/** Currently visible category Node */
private Node category = null;
/** Current category ref */
private NodeRef categoryRef = null;
/** Action category node */
private Node actionCategory = null;
/** Members of the linked items of a category */
private Collection<ChildAssociationRef> members = null;
/** Dialog properties */
private String name = null;
private String description = null;
/** RichList view mode */
private String viewMode = "icons";
/** Category path breadcrumb location */
private List<IBreadcrumbHandler> location = null;
public CategoryService getCategoryService()
{
return categoryService;
}
public void setCategoryService(CategoryService categoryService)
{
this.categoryService = categoryService;
}
public UIRichList getCategoriesRichList()
{
return categoriesRichList;
}
public void setCategoriesRichList(UIRichList categoriesRichList)
{
this.categoriesRichList = categoriesRichList;
}
public Node getCategory()
{
return category;
}
public void setCategory(Node category)
{
this.category = category;
}
public NodeRef getCategoryRef()
{
return categoryRef;
}
public void setCategoryRef(NodeRef categoryRef)
{
this.categoryRef = categoryRef;
}
public Node getActionCategory()
{
return actionCategory;
}
public void setActionCategory(Node actionCategory)
{
this.actionCategory = actionCategory;
}
public Collection<ChildAssociationRef> getMembers()
{
return members;
}
public void setMembers(Collection<ChildAssociationRef> members)
{
this.members = members;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public String getDescription()
{
return description;
}
public void setDescription(String description)
{
this.description = description;
}
public String getViewMode()
{
return viewMode;
}
public void setViewMode(String viewMode)
{
this.viewMode = viewMode;
}
public List<IBreadcrumbHandler> getLocation()
{
return location;
}
public void setLocation(List<IBreadcrumbHandler> location)
{
this.location = location;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,599 @@
/*
* 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;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.repo.version.VersionModel;
import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.version.Version;
import org.alfresco.service.cmr.version.VersionType;
import org.alfresco.web.app.AlfrescoNavigationHandler;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.context.UIContextService;
import org.alfresco.web.app.servlet.DownloadContentServlet;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
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;
/**
* @author Kevin Roast
*/
public class CheckinCheckoutDialog extends BaseDialogBean
{
// ------------------------------------------------------------------------------
// Private data
private static Log logger = LogFactory.getLog(CheckinCheckoutDialog.class);
/* /** I18N messages */
public static final String MSG_ERROR_CHECKIN = "error_checkin";
public static final String MSG_ERROR_CANCELCHECKOUT = "error_cancel_checkout";
public static final String MSG_ERROR_UPDATE = "error_update";
public static final String MSG_ERROR_CHECKOUT = "error_checkout";
protected CCProperties property;
// ------------------------------------------------------------------------------
// Bean property getters and setters
/**
* @param property the property to set
*/
public void setProperty(CCProperties property)
{
this.property = property;
}
/**
* @param navigator The NavigationBean to set.
*/
public void setNavigator(NavigationBean navigator)
{
this.navigator = navigator;
}
/**
* @return Returns the BrowseBean.
*/
public BrowseBean getBrowseBean()
{
return this.browseBean;
}
/**
* @param browseBean The BrowseBean to set.
*/
public void setBrowseBean(BrowseBean browseBean)
{
this.browseBean = browseBean;
}
/**
* @return Returns the NodeService.
*/
public NodeService getNodeService()
{
return this.nodeService;
}
/**
* @param nodeService The NodeService to set.
*/
public void setNodeService(NodeService nodeService)
{
this.nodeService = nodeService;
}
/**
* Determines whether the document being checked in has
* the versionable aspect applied
*
* @return true if the versionable aspect is applied
*/
public boolean isVersionable()
{
return property.getDocument().hasAspect(ContentModel.ASPECT_VERSIONABLE);
}
/**
* @return Returns the message to display when a file has been uploaded
*/
public String getFileUploadSuccessMsg()
{
String msg = Application.getMessage(FacesContext.getCurrentInstance(), "file_upload_success");
return MessageFormat.format(msg, new Object[] {getFileName()});
}
/**
* @return Returns the name of the file
*/
public String getFileName()
{
// try and retrieve the file and filename from the file upload bean
// representing the file we previously uploaded.
FacesContext ctx = FacesContext.getCurrentInstance();
FileUploadBean fileBean = (FileUploadBean)ctx.getExternalContext().getSessionMap().
get(FileUploadBean.FILE_UPLOAD_BEAN_NAME);
if (fileBean != null)
{
property.setFile(fileBean.getFile());
property.setFileName(fileBean.getFileName());
}
return property.getFileName();
}
/**
* @param fileName The name of the file
*/
public void setFileName(String fileName)
{
property.setFileName(fileName);
// we also need to keep the file upload bean in sync
FacesContext ctx = FacesContext.getCurrentInstance();
FileUploadBean fileBean = (FileUploadBean)ctx.getExternalContext().getSessionMap().
get(FileUploadBean.FILE_UPLOAD_BEAN_NAME);
if (fileBean != null)
{
fileBean.setFileName(property.getFileName());
}
}
// ------------------------------------------------------------------------------
// Navigation action event handlers
/**
* Action event called by all actions that need to setup a Content Document context on the
* CheckinCheckoutDialog before an action page/wizard is called. The context will be a Node in
* setDocument() which can be retrieved on action pages via getDocument().
*
* @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)
{
setupContentDocument(id);
}
else
{
property.setDocument(null);
}
resetState();
}
public void setupWorkflowContentAction(ActionEvent event)
{
// do the common processing
setupContentAction(event);
// retrieve the id of the task
UIActionLink link = (UIActionLink)event.getComponent();
Map<String, String> params = link.getParameterMap();
property.setWorkflowTaskId(params.get("taskId"));
property.setWorkflowAction(true);
if (logger.isDebugEnabled())
logger.debug("Setup for workflow package action for task id: " + property.getWorkflowTaskId());
}
/**
* Setup a content document node context
*
* @param id GUID of the node to setup as the content document context
* @return The Node
*/
private Node setupContentDocument(String id)
{
if (logger.isDebugEnabled())
logger.debug("Setup for action, setting current document to: " + id);
Node node = null;
try
{
// create the node ref, then our node representation
NodeRef ref = new NodeRef(Repository.getStoreRef(), id);
node = new Node(ref);
// create content URL to the content download servlet with ID and expected filename
// the myfile part will be ignored by the servlet but gives the browser a hint
String url = DownloadContentServlet.generateDownloadURL(ref, node.getName());
node.getProperties().put("url", url);
node.getProperties().put("workingCopy", node.hasAspect(ContentModel.ASPECT_WORKING_COPY));
node.getProperties().put("fileType32", Utils.getFileTypeImage(node.getName(), false));
// remember the document
property.setDocument(node);
// refresh the UI, calling this method now is fine as it basically makes sure certain
// beans clear the state - so when we finish here other beans will have been reset
UIContextService.getInstance(FacesContext.getCurrentInstance()).notifyBeans();
}
catch (InvalidNodeRefException refErr)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_NODEREF), new Object[] {id}) );
}
return node;
}
/**
* Action handler called to calculate which editing screen to display based on the mimetype
* of a document. If appropriate, the in-line editing screen will be shown.
*/
public void editFile(ActionEvent event)
{
UIActionLink link = (UIActionLink)event.getComponent();
Map<String, String> params = link.getParameterMap();
String id = params.get("id");
if (id != null && id.length() != 0)
{
boolean editingInline = false;
Node node = setupContentDocument(id);
// detect the inline editing aspect to see which edit mode to use
if (node.hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE) &&
node.getProperties().get(ApplicationModel.PROP_EDITINLINE) != null &&
((Boolean)node.getProperties().get(ApplicationModel.PROP_EDITINLINE)).booleanValue() == true)
{
// retrieve the content reader for this node
ContentReader reader = property.getContentService().getReader(node.getNodeRef(), ContentModel.PROP_CONTENT);
if (reader != null)
{
editingInline = true;
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();
this.navigator.setupDispatchContext(node);
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();
this.navigator.setupDispatchContext(node);
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "dialog:editHtmlInline");
}
}
}
if (editingInline == false)
{
// normal downloadable document
FacesContext fc = FacesContext.getCurrentInstance();
this.navigator.setupDispatchContext(node);
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "dialog:editFile");
}
}
}
/**
* Action handler called to set the content of a node from an inline editing page.
*/
public String editInline(FacesContext context, String outcome)
{
final Node node = property.getDocument();
if (node != null)
{
try
{
if (logger.isDebugEnabled())
logger.debug("Trying to update content node Id: " + node.getId());
// get an updating writer that we can use to modify the content on the current node
ContentWriter writer = property.getContentService().getWriter(node.getNodeRef(), ContentModel.PROP_CONTENT, true);
writer.putContent(property.getEditorOutput());
// clean up and clear action context
resetState();
property.setDocument(null);
property.setDocumentContent(null);
property.setEditorOutput(null);
}
catch (Throwable err)
{
Utils.addErrorMessage(Application.getMessage(
FacesContext.getCurrentInstance(), MSG_ERROR_UPDATE) + err.getMessage());
outcome = null;
}
}
else
{
logger.warn("WARNING: editInlineOK called without a current Document!");
}
return outcome;
}
/**
* Action to undo the checkout of a document just checked out from the checkout screen.
*/
public String undoCheckout()
{
String outcome = null;
Node node = property.getWorkingDocument();
if (node != null)
{
try
{
// try to cancel checkout of the working copy
this.property.getVersionOperationsService().cancelCheckout(node.getNodeRef());
resetState();
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
}
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;
}
/**
* Action called upon completion of the Check In file page
*/
public String checkinFileOK()
{
String outcome = null;
// NOTE: for checkin the document node _is_ the working document!
final Node node = property.getDocument();
if (node != null && (property.getCopyLocation().equals(CCProperties.COPYLOCATION_CURRENT) || this.getFileName() != null))
{
try
{
final FacesContext context = FacesContext.getCurrentInstance();
RetryingTransactionHelper txnHelper = Repository.getRetryingTransactionHelper(FacesContext.getCurrentInstance());
RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>()
{
public Object execute() throws Throwable
{
if (logger.isDebugEnabled())
logger.debug("Trying to checkin content node Id: " + node.getId());
// we can either checkin the content from the current working copy node
// which would have been previously updated by the user
String contentUrl;
if (property.getCopyLocation().equals(CCProperties.COPYLOCATION_CURRENT))
{
ContentData contentData = (ContentData) node.getProperties().get(ContentModel.PROP_CONTENT);
contentUrl = (contentData == null ? null : contentData.getContentUrl());
}
// or specify a specific file as the content instead
else
{
// add the content to an anonymous but permanent writer location
// we can then retrieve the URL to the content to to be set on the node during checkin
ContentWriter writer = property.getContentService().getWriter(node.getNodeRef(), ContentModel.PROP_CONTENT, true);
// also update the mime type in case a different type of file is uploaded
String mimeType = Repository.getMimeTypeForFileName(context, property.getFileName());
writer.setMimetype(mimeType);
writer.putContent(property.getFile());
contentUrl = writer.getContentUrl();
}
if (contentUrl == null || contentUrl.length() == 0)
{
throw new IllegalStateException("Content URL is empty for specified working copy content node!");
}
// add version history text to props
Map<String, Serializable> props = new HashMap<String, Serializable>(1, 1.0f);
props.put(Version.PROP_DESCRIPTION, property.getVersionNotes());
// set the flag for minor or major change
if (property.getMinorChange())
{
props.put(VersionModel.PROP_VERSION_TYPE, VersionType.MINOR);
}
else
{
props.put(VersionModel.PROP_VERSION_TYPE, VersionType.MAJOR);
}
// perform the checkin
property.getVersionOperationsService().checkin(node.getNodeRef(),
props, contentUrl, property.getKeepCheckedOut());
return null;
}
};
txnHelper.doInTransaction(callback);
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
if (property.isWorkflowAction() == false)
{
outcome = outcome + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + "browse";
}
// clear action context
property.setDocument(null);
resetState();
}
catch (Throwable err)
{
Utils.addErrorMessage(Application.getMessage(
FacesContext.getCurrentInstance(), MSG_ERROR_CHECKIN) + err.getMessage(), err);
}
}
else
{
logger.warn("WARNING: checkinFileOK called without a current Document!");
}
return outcome;
}
/**
* Action called upon completion of the Update File page
*/
public String updateFileOK()
{
String outcome = null;
// NOTE: for update the document node _is_ the working document!
final Node node = property.getDocument();
if (node != null && this.getFileName() != null)
{
try
{
final FacesContext context = FacesContext.getCurrentInstance();
RetryingTransactionHelper txnHelper = Repository.getRetryingTransactionHelper(FacesContext.getCurrentInstance());
RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>()
{
public Object execute() throws Throwable
{
if (logger.isDebugEnabled())
logger.debug("Trying to update content node Id: " + node.getId());
// get an updating writer that we can use to modify the content on the current node
ContentWriter writer = property.getContentService().getWriter(node.getNodeRef(), ContentModel.PROP_CONTENT, true);
// also update the mime type in case a different type of file is uploaded
String mimeType = Repository.getMimeTypeForFileName(context, property.getFileName());
writer.setMimetype(mimeType);
writer.putContent(property.getFile());
return null;
}
};
txnHelper.doInTransaction(callback);
// clear action context
property.setDocument(null);
resetState();
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
}
catch (Throwable err)
{
Utils.addErrorMessage(Application.getMessage(
FacesContext.getCurrentInstance(), MSG_ERROR_UPDATE) + err.getMessage(), err);
}
}
else
{
logger.warn("WARNING: updateFileOK called without a current Document!");
}
return outcome;
}
/**
* Deals with the cancel button being pressed on the check in file page
*/
public String cancel()
{
String outcome = getDefaultCancelOutcome();
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().remove(AlfrescoNavigationHandler.EXTERNAL_CONTAINER_SESSION);
// reset the state
resetState();
return outcome;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return outcome;
}
/**
* Clear form state and upload file bean
*/
public void resetState()
{
// delete the temporary file we uploaded earlier
if (property.getFile() != null)
{
property.getFile().delete();
}
property.setFile(null);
property.setFileName(null);
property.setKeepCheckedOut(false);
property.setMinorChange(true);
property.setCopyLocation(CCProperties.COPYLOCATION_CURRENT);
property.setVersionNotes("");
property.setSelectedSpaceId(null);
property.setWorkflowAction(false);
property.setWorkflowTaskId(null);
// remove the file upload bean from the session
FacesContext ctx = FacesContext.getCurrentInstance();
ctx.getExternalContext().getSessionMap().remove(FileUploadBean.FILE_UPLOAD_BEAN_NAME);
}
}

View File

@@ -0,0 +1,106 @@
/*
* 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;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
public class CreateCategoryDialog extends CategoriesDialog
{
private static final String DEFAULT_OUTCOME = "finish";
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
finishCreate();
return outcome;
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), "new_category");
}
public String finishCreate()
{
String outcome = DEFAULT_OUTCOME;
try
{
FacesContext context = FacesContext.getCurrentInstance();
RetryingTransactionHelper txnHelper = Repository.getRetryingTransactionHelper(context);
RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>()
{
public Object execute() throws Throwable
{
// create category using categoryservice
NodeRef ref;
if (properties.getCategoryRef() == null)
{
ref = properties.getCategoryService().createRootCategory(Repository.getStoreRef(), ContentModel.ASPECT_GEN_CLASSIFIABLE, properties.getName());
}
else
{
ref = properties.getCategoryService().createCategory(properties.getCategoryRef(), properties.getName());
}
// apply the titled aspect - for description
Map<QName, Serializable> titledProps = new HashMap<QName, Serializable>(1, 1.0f);
titledProps.put(ContentModel.PROP_DESCRIPTION, properties.getDescription());
nodeService.addAspect(ref, ContentModel.ASPECT_TITLED, titledProps);
return null;
}
};
txnHelper.doInTransaction(callback);
}
catch (Throwable err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
outcome = null;
}
return outcome;
}
}

View File

@@ -0,0 +1,156 @@
/*
* 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;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.IBreadcrumbHandler;
import org.alfresco.web.ui.repo.component.IRepoBreadcrumbHandler;
public class DeleteCategoryDialog extends CategoriesDialog
{
private static final String DEFAULT_OUTCOME = "finish";
private final static String MSG_DELETE_CATEGORY = "delete_category";
private final static String MSG_DELETE = "delete";
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
finishDelete();
return outcome;
}
@Override
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_DELETE_CATEGORY) + " '" + properties.getActionCategory().getName() + "'";
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_DELETE);
}
public String finishDelete()
{
String outcome = DEFAULT_OUTCOME;
if (properties.getActionCategory() != null)
{
try
{
FacesContext context = FacesContext.getCurrentInstance();
RetryingTransactionHelper txnHelper = Repository.getRetryingTransactionHelper(context);
RetryingTransactionCallback<NodeRef> callback = new RetryingTransactionCallback<NodeRef>()
{
@SuppressWarnings("unchecked")
public NodeRef execute() throws Throwable
{
// delete the category node using the nodeservice
NodeRef categoryNodeRef = properties.getActionCategory().getNodeRef();
properties.getCategoryService().deleteCategory(categoryNodeRef);
// if there are other items in the repository using this category
// all the associations to the category should be removed too
if (properties.getMembers() != null && properties.getMembers().size() > 0)
{
for (ChildAssociationRef childRef : properties.getMembers())
{
List<NodeRef> list = new ArrayList<NodeRef>(properties.getMembers().size());
NodeRef member = childRef.getChildRef();
Collection<NodeRef> categories = (Collection<NodeRef>) nodeService.getProperty(member, ContentModel.PROP_CATEGORIES);
for (NodeRef category : categories)
{
if (category.equals(categoryNodeRef) == false)
{
list.add(category);
}
}
// persist the list back to the repository
nodeService.setProperty(member, ContentModel.PROP_CATEGORIES, (Serializable) list);
}
}
return categoryNodeRef;
}
};
NodeRef categoryNodeRef = txnHelper.doInTransaction(callback);
// remove this node from the breadcrumb if required
List<IBreadcrumbHandler> location = getLocation();
IBreadcrumbHandler handler = location.get(location.size() - 1);
// see if the current breadcrumb location is our node
if (categoryNodeRef.equals(((IRepoBreadcrumbHandler) handler).getNodeRef()))
{
location.remove(location.size() - 1);
// now work out which node to set the list to refresh against
if (location.size() != 0)
{
handler = location.get(location.size() - 1);
this.setCurrentCategory(((IRepoBreadcrumbHandler) handler).getNodeRef());
}
}
// clear action context
setActionCategory(null);
}
catch (Throwable err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
outcome = null;
}
}
return outcome;
}
}

View File

@@ -60,19 +60,23 @@ import org.alfresco.service.cmr.version.VersionService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
import org.alfresco.web.app.servlet.DownloadContentServlet; import org.alfresco.web.app.servlet.DownloadContentServlet;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.dialog.IDialogBean;
import org.alfresco.web.bean.ml.MultilingualUtils; import org.alfresco.web.bean.ml.MultilingualUtils;
import org.alfresco.web.bean.repository.MapNode; import org.alfresco.web.bean.repository.MapNode;
import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.config.DialogsConfigElement.DialogButtonConfig;
import org.alfresco.web.ui.common.Utils; import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.Utils.URLMode; import org.alfresco.web.ui.common.Utils.URLMode;
import org.alfresco.web.ui.common.component.UIActionLink; import org.alfresco.web.ui.common.component.UIActionLink;
/** /**
* Backing bean providing access to the details of a document * Backing bean providing access to the details of a document
* *
* @author gavinc * @author gavinc
*/ */
public class DocumentDetailsBean extends BaseDetailsBean public class DocumentDetailsBean extends BaseDetailsBean implements IDialogBean
{ {
private static final String OUTCOME_RETURN = "showDocDetails"; private static final String OUTCOME_RETURN = "showDocDetails";
@@ -84,6 +88,7 @@ public class DocumentDetailsBean extends BaseDetailsBean
private static final String MSG_ERROR_ASPECT_VERSIONING = "error_aspect_versioning"; private static final String MSG_ERROR_ASPECT_VERSIONING = "error_aspect_versioning";
private static final String MSG_ERROR_ASPECT_CLASSIFY = "error_aspect_classify"; private static final String MSG_ERROR_ASPECT_CLASSIFY = "error_aspect_classify";
private static final String MSG_ERROR_UPDATE_CATEGORY = "error_update_category"; private static final String MSG_ERROR_UPDATE_CATEGORY = "error_update_category";
private static final String MSG_MODIFY_CATEGORIES_OF = "modify_categories_of";
private static final String ML_VERSION_PANEL_ID = "ml-versions-panel"; private static final String ML_VERSION_PANEL_ID = "ml-versions-panel";
@@ -98,8 +103,18 @@ public class DocumentDetailsBean extends BaseDetailsBean
private List categories; private List categories;
private Node translationDocument; private Node translationDocument;
private BaseDialogBean baseDialogBean = new BaseDialogBeanImpl();
private class BaseDialogBeanImpl extends BaseDialogBean
{
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return saveCategories(context, outcome);
}
}
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// Construction // Construction
@@ -617,9 +632,9 @@ public class DocumentDetailsBean extends BaseDetailsBean
* *
* @return The outcome * @return The outcome
*/ */
public String saveCategories() public String saveCategories(FacesContext newContext, String newOutcome)
{ {
String outcome = "cancel"; String outcome = newOutcome;
try try
{ {
@@ -628,13 +643,13 @@ public class DocumentDetailsBean extends BaseDetailsBean
{ {
public Object execute() throws Throwable public Object execute() throws Throwable
{ {
// firstly retrieve all the properties for the current node // firstly retrieve all the properties for the current node
Map<QName, Serializable> updateProps = nodeService.getProperties(getDocument().getNodeRef()); Map<QName, Serializable> updateProps = nodeService.getProperties(getDocument().getNodeRef());
// create a node ref representation of the selected id and set the new properties // create a node ref representation of the selected id and set the new properties
updateProps.put(ContentModel.PROP_CATEGORIES, (Serializable) categories); updateProps.put(ContentModel.PROP_CATEGORIES, (Serializable) categories);
// set the properties on the node // set the properties on the node
nodeService.setProperties(getDocument().getNodeRef(), updateProps); nodeService.setProperties(getDocument().getNodeRef(), updateProps);
return null; return null;
} }
@@ -644,7 +659,6 @@ public class DocumentDetailsBean extends BaseDetailsBean
// reset the state of the current document so it reflects the changes just made // reset the state of the current document so it reflects the changes just made
getDocument().reset(); getDocument().reset();
outcome = "finish";
} }
catch (Throwable e) catch (Throwable e)
{ {
@@ -667,7 +681,7 @@ public class DocumentDetailsBean extends BaseDetailsBean
{ {
public Object execute() throws Throwable public Object execute() throws Throwable
{ {
// add the general classifiable aspect to the node // add the general classifiable aspect to the node
nodeService.addAspect(getDocument().getNodeRef(), ContentModel.ASPECT_GEN_CLASSIFIABLE, null); nodeService.addAspect(getDocument().getNodeRef(), ContentModel.ASPECT_GEN_CLASSIFIABLE, null);
return null; return null;
} }
@@ -1083,7 +1097,58 @@ public class DocumentDetailsBean extends BaseDetailsBean
{ {
this.editionService = editionService; this.editionService = editionService;
} }
// ------------------------------------------------------------------------------
// IDialogBean implementation
public String cancel()
{
return baseDialogBean.cancel();
}
public String finish()
{
return baseDialogBean.finish();
}
public List<DialogButtonConfig> getAdditionalButtons()
{
return baseDialogBean.getAdditionalButtons();
}
public String getCancelButtonLabel()
{
return baseDialogBean.getCancelButtonLabel();
}
public String getContainerDescription()
{
return baseDialogBean.getContainerDescription();
}
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_MODIFY_CATEGORIES_OF) +
" '" + getDocument().getName() + "'";
}
public boolean getFinishButtonDisabled()
{
return false;
}
public String getFinishButtonLabel()
{
return baseDialogBean.getFinishButtonLabel();
}
public void init(Map<String, String> parameters)
{
baseDialogBean.init(parameters);
}
public void restored()
{
baseDialogBean.restored();
}
} }

View File

@@ -0,0 +1,131 @@
/*
* 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;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.IBreadcrumbHandler;
import org.alfresco.web.ui.repo.component.IRepoBreadcrumbHandler;
public class EditCategoryDialog extends CategoriesDialog
{
private static final String DEFAULT_OUTCOME = "finish";
private final static String MSG_EDIT_CATEGORY = "edit_category";
private final static String MSG_FINISH = "finish_button";
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
finishEdit();
return outcome;
}
@Override
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_EDIT_CATEGORY) + " '" + properties.getActionCategory().getName() + "'";
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_FINISH);
}
public String finishEdit()
{
String outcome = DEFAULT_OUTCOME;
try
{
FacesContext context = FacesContext.getCurrentInstance();
RetryingTransactionHelper txnHelper = Repository.getRetryingTransactionHelper(context);
RetryingTransactionCallback<NodeRef> callback = new RetryingTransactionCallback<NodeRef>()
{
public NodeRef execute() throws Throwable
{
// update the category node
NodeRef nodeRef = properties.getActionCategory().getNodeRef();
nodeService.setProperty(nodeRef, ContentModel.PROP_NAME, properties.getName());
// apply the titled aspect - for description
if (nodeService.hasAspect(nodeRef, ContentModel.ASPECT_TITLED) == false)
{
Map<QName, Serializable> titledProps = new HashMap<QName, Serializable>(1, 1.0f);
titledProps.put(ContentModel.PROP_DESCRIPTION, properties.getDescription());
nodeService.addAspect(nodeRef, ContentModel.ASPECT_TITLED, titledProps);
}
else
{
nodeService.setProperty(nodeRef, ContentModel.PROP_DESCRIPTION, properties.getDescription());
}
return nodeRef;
}
};
NodeRef nodeRef = txnHelper.doInTransaction(callback);
// edit the node in the breadcrumb if required
List<IBreadcrumbHandler> location = getLocation();
IBreadcrumbHandler handler = location.get(location.size() - 1);
// see if the current breadcrumb location is our node
if (nodeRef.equals(((IRepoBreadcrumbHandler) handler).getNodeRef()))
{
// and update with the modified node details
IBreadcrumbHandler newHandler = new CategoryBreadcrumbHandler(nodeRef, Repository.getNameForNode(nodeService, nodeRef));
location.set(location.size() - 1, newHandler);
}
}
catch (Throwable err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
outcome = null;
}
return outcome;
}
}

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;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
public class EditSearchDialog extends AdvancedSearchDialog
{
private static final String MSG_ERROR_SAVE_SEARCH = "error_save_search";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return saveEditSearchOK(context, outcome);
}
@Override
public String getFinishButtonLabel()
{
return super.getFinishButtonLabel();
}
public String saveEditSearchOK(FacesContext newContext, String newOutcome)
{
String outcome = newOutcome;
final SearchContext search = this.navigator.getSearchContext();
if (search != null)
{
try
{
final FacesContext context = newContext;
RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>()
{
public Object execute() throws Throwable
{
// handle Edit e.g. Overwrite of existing search
// detect if was previously selected saved search (e.g.
// NodeRef not null)
NodeRef searchRef = new NodeRef(Repository.getStoreRef(), properties.getSavedSearch());
if (nodeService.exists(searchRef))
{
Map<QName, Serializable> props = nodeService.getProperties(searchRef);
props.put(ContentModel.PROP_NAME, properties.getSearchName());
props.put(ContentModel.PROP_DESCRIPTION, properties.getSearchDescription());
nodeService.setProperties(searchRef, props);
ContentService contentService = Repository.getServiceRegistry(context).getContentService();
ContentWriter writer = contentService.getWriter(searchRef, ContentModel.PROP_CONTENT, true);
// get a writer to our new node ready for XML
// content
writer.setMimetype(MimetypeMap.MIMETYPE_XML);
writer.setEncoding("UTF-8");
// output an XML serialized version of the
// SearchContext object
writer.putContent(search.toXML());
}
return null;
}
};
callback.execute();
properties.getCachedSavedSearches().clear();
properties.setSavedSearch(null);
}
catch (Throwable e)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(newContext, MSG_ERROR_SAVE_SEARCH), e.getMessage()), e);
outcome = null;
this.isFinished = false;
}
}
return outcome;
}
}

View File

@@ -0,0 +1,180 @@
/*
* 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;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.model.ApplicationModel;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.actions.handlers.SimpleWorkflowHandler;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.ui.common.Utils;
public class EditSimpleWorkflowDialog extends BaseDialogBean
{
private static final String MSG_ERROR_UPDATE_SIMPLEWORKFLOW = "error_update_simpleworkflow";
protected Map<String, Serializable> workflowProperties;
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
saveWorkflow();
return outcome;
}
public boolean getFinishButtonDisabled()
{
return false;
}
public Node getNode()
{
return this.browseBean.getDocument();
}
public Node getDocument()
{
return this.getNode();
}
public String saveWorkflow()
{
String outcome = "cancel";
try
{
Map<QName, Serializable> updateProps = nodeService.getProperties(getNode().getNodeRef());
// update the simple workflow properties
// set the approve step name
updateProps.put(ApplicationModel.PROP_APPROVE_STEP, workflowProperties.get(SimpleWorkflowHandler.PROP_APPROVE_STEP_NAME));
// specify whether the approve step will copy or move the content
boolean approveMove = true;
String approveAction = (String) workflowProperties.get(SimpleWorkflowHandler.PROP_APPROVE_ACTION);
if (approveAction != null && approveAction.equals("copy"))
{
approveMove = false;
}
updateProps.put(ApplicationModel.PROP_APPROVE_MOVE, Boolean.valueOf(approveMove));
// create node ref representation of the destination folder
updateProps.put(ApplicationModel.PROP_APPROVE_FOLDER, workflowProperties.get(SimpleWorkflowHandler.PROP_APPROVE_FOLDER));
// determine whether there should be a reject step
boolean requireReject = true;
String rejectStepPresent = (String) workflowProperties.get(SimpleWorkflowHandler.PROP_REJECT_STEP_PRESENT);
if (rejectStepPresent != null && rejectStepPresent.equals("no"))
{
requireReject = false;
}
if (requireReject)
{
// set the reject step name
updateProps.put(ApplicationModel.PROP_REJECT_STEP, workflowProperties.get(SimpleWorkflowHandler.PROP_REJECT_STEP_NAME));
// specify whether the reject step will copy or move the content
boolean rejectMove = true;
String rejectAction = (String) workflowProperties.get(SimpleWorkflowHandler.PROP_REJECT_ACTION);
if (rejectAction != null && rejectAction.equals("copy"))
{
rejectMove = false;
}
updateProps.put(ApplicationModel.PROP_REJECT_MOVE, Boolean.valueOf(rejectMove));
// create node ref representation of the destination folder
updateProps.put(ApplicationModel.PROP_REJECT_FOLDER, workflowProperties.get(SimpleWorkflowHandler.PROP_REJECT_FOLDER));
}
else
{
// set all the reject properties to null to signify there should
// be no reject step
updateProps.put(ApplicationModel.PROP_REJECT_STEP, null);
updateProps.put(ApplicationModel.PROP_REJECT_MOVE, null);
updateProps.put(ApplicationModel.PROP_REJECT_FOLDER, null);
}
// set the properties on the node
nodeService.setProperties(getNode().getNodeRef(), updateProps);
getNode().reset();
}
catch (Throwable e)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), MSG_ERROR_UPDATE_SIMPLEWORKFLOW), e.getMessage()), e);
}
return outcome;
}
public Map<String, Serializable> getWorkflowProperties()
{
if (this.workflowProperties == null && getNode().hasAspect(ApplicationModel.ASPECT_SIMPLE_WORKFLOW))
{
// get the exisiting properties for the node
Map<String, Object> props = getNode().getProperties();
String approveStepName = (String) props.get(ApplicationModel.PROP_APPROVE_STEP.toString());
String rejectStepName = (String) props.get(ApplicationModel.PROP_REJECT_STEP.toString());
Boolean approveMove = (Boolean) props.get(ApplicationModel.PROP_APPROVE_MOVE.toString());
Boolean rejectMove = (Boolean) props.get(ApplicationModel.PROP_REJECT_MOVE.toString());
NodeRef approveFolder = (NodeRef) props.get(ApplicationModel.PROP_APPROVE_FOLDER.toString());
NodeRef rejectFolder = (NodeRef) props.get(ApplicationModel.PROP_REJECT_FOLDER.toString());
// put the workflow properties in a separate map for use by the JSP
this.workflowProperties = new HashMap<String, Serializable>(7);
this.workflowProperties.put(SimpleWorkflowHandler.PROP_APPROVE_STEP_NAME, approveStepName);
this.workflowProperties.put(SimpleWorkflowHandler.PROP_APPROVE_ACTION, approveMove ? "move" : "copy");
this.workflowProperties.put(SimpleWorkflowHandler.PROP_APPROVE_FOLDER, approveFolder);
if (rejectStepName == null || rejectMove == null || rejectFolder == null)
{
this.workflowProperties.put(SimpleWorkflowHandler.PROP_REJECT_STEP_PRESENT, "no");
}
else
{
this.workflowProperties.put(SimpleWorkflowHandler.PROP_REJECT_STEP_PRESENT, "yes");
this.workflowProperties.put(SimpleWorkflowHandler.PROP_REJECT_STEP_NAME, rejectStepName);
this.workflowProperties.put(SimpleWorkflowHandler.PROP_REJECT_ACTION, rejectMove ? "move" : "copy");
this.workflowProperties.put(SimpleWorkflowHandler.PROP_REJECT_FOLDER, rejectFolder);
}
}
return this.workflowProperties;
}
}

View File

@@ -0,0 +1,196 @@
/*
* 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;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.model.ApplicationModel;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.actions.handlers.SimpleWorkflowHandler;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
public class EditSpaceSimpleWorkflowDialog extends BaseDialogBean
{
protected Map<String, Serializable> workflowProperties;
private static final String MSG_ERROR_UPDATE_SIMPLEWORKFLOW = "error_update_simpleworkflow";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
saveWorkflow();
return outcome;
}
public boolean getFinishButtonDisabled()
{
return false;
}
public String saveWorkflow()
{
String outcome = "cancel";
try
{
RetryingTransactionHelper txnHelper = Repository.getRetryingTransactionHelper(FacesContext.getCurrentInstance());
RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>()
{
public Object execute() throws Throwable
{
// firstly retrieve all the properties for the current node
Map<QName, Serializable> updateProps = nodeService.getProperties(getNode().getNodeRef());
// update the simple workflow properties
// set the approve step name
updateProps.put(ApplicationModel.PROP_APPROVE_STEP, workflowProperties.get(SimpleWorkflowHandler.PROP_APPROVE_STEP_NAME));
// specify whether the approve step will copy or move the content
boolean approveMove = true;
String approveAction = (String) workflowProperties.get(SimpleWorkflowHandler.PROP_APPROVE_ACTION);
if (approveAction != null && approveAction.equals("copy"))
{
approveMove = false;
}
updateProps.put(ApplicationModel.PROP_APPROVE_MOVE, Boolean.valueOf(approveMove));
// create node ref representation of the destination folder
updateProps.put(ApplicationModel.PROP_APPROVE_FOLDER, workflowProperties.get(SimpleWorkflowHandler.PROP_APPROVE_FOLDER));
// determine whether there should be a reject step
boolean requireReject = true;
String rejectStepPresent = (String) workflowProperties.get(SimpleWorkflowHandler.PROP_REJECT_STEP_PRESENT);
if (rejectStepPresent != null && rejectStepPresent.equals("no"))
{
requireReject = false;
}
if (requireReject)
{
// set the reject step name
updateProps.put(ApplicationModel.PROP_REJECT_STEP, workflowProperties.get(SimpleWorkflowHandler.PROP_REJECT_STEP_NAME));
// specify whether the reject step will copy or move the content
boolean rejectMove = true;
String rejectAction = (String) workflowProperties.get(SimpleWorkflowHandler.PROP_REJECT_ACTION);
if (rejectAction != null && rejectAction.equals("copy"))
{
rejectMove = false;
}
updateProps.put(ApplicationModel.PROP_REJECT_MOVE, Boolean.valueOf(rejectMove));
// create node ref representation of the destination folder
updateProps.put(ApplicationModel.PROP_REJECT_FOLDER, workflowProperties.get(SimpleWorkflowHandler.PROP_REJECT_FOLDER));
}
else
{
// set all the reject properties to null to signify there should
// be no reject step
updateProps.put(ApplicationModel.PROP_REJECT_STEP, null);
updateProps.put(ApplicationModel.PROP_REJECT_MOVE, null);
updateProps.put(ApplicationModel.PROP_REJECT_FOLDER, null);
}
// set the properties on the node
nodeService.setProperties(getNode().getNodeRef(), updateProps);
return null;
}
};
txnHelper.doInTransaction(callback);
// reset the state of the current node so it reflects the changes just made
getNode().reset();
outcome = "finish";
}
catch (Throwable e)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), MSG_ERROR_UPDATE_SIMPLEWORKFLOW), e.getMessage()), e);
}
return outcome;
}
/**
* Returns the properties for the attached workflow as a map
*
* @return Properties of the attached workflow, null if there is no workflow
*/
public Map<String, Serializable> getWorkflowProperties()
{
if (this.workflowProperties == null && getNode().hasAspect(ApplicationModel.ASPECT_SIMPLE_WORKFLOW))
{
// get the exisiting properties for the node
Map<String, Object> props = getNode().getProperties();
String approveStepName = (String) props.get(ApplicationModel.PROP_APPROVE_STEP.toString());
String rejectStepName = (String) props.get(ApplicationModel.PROP_REJECT_STEP.toString());
Boolean approveMove = (Boolean) props.get(ApplicationModel.PROP_APPROVE_MOVE.toString());
Boolean rejectMove = (Boolean) props.get(ApplicationModel.PROP_REJECT_MOVE.toString());
NodeRef approveFolder = (NodeRef) props.get(ApplicationModel.PROP_APPROVE_FOLDER.toString());
NodeRef rejectFolder = (NodeRef) props.get(ApplicationModel.PROP_REJECT_FOLDER.toString());
// put the workflow properties in a separate map for use by the JSP
this.workflowProperties = new HashMap<String, Serializable>(7);
this.workflowProperties.put(SimpleWorkflowHandler.PROP_APPROVE_STEP_NAME, approveStepName);
this.workflowProperties.put(SimpleWorkflowHandler.PROP_APPROVE_ACTION, approveMove ? "move" : "copy");
this.workflowProperties.put(SimpleWorkflowHandler.PROP_APPROVE_FOLDER, approveFolder);
if (rejectStepName == null || rejectMove == null || rejectFolder == null)
{
this.workflowProperties.put(SimpleWorkflowHandler.PROP_REJECT_STEP_PRESENT, "no");
}
else
{
this.workflowProperties.put(SimpleWorkflowHandler.PROP_REJECT_STEP_PRESENT, "yes");
this.workflowProperties.put(SimpleWorkflowHandler.PROP_REJECT_STEP_NAME, rejectStepName);
this.workflowProperties.put(SimpleWorkflowHandler.PROP_REJECT_ACTION, rejectMove ? "move" : "copy");
this.workflowProperties.put(SimpleWorkflowHandler.PROP_REJECT_FOLDER, rejectFolder);
}
}
return this.workflowProperties;
}
public Node getNode()
{
return this.browseBean.getActionSpace();
}
}

View File

@@ -25,12 +25,10 @@
package org.alfresco.web.bean; package org.alfresco.web.bean;
import java.io.Serializable; import java.io.Serializable;
import java.text.MessageFormat;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import javax.faces.context.FacesContext; import javax.faces.context.FacesContext;
import javax.transaction.UserTransaction;
import org.alfresco.repo.action.executer.ExporterActionExecuter; import org.alfresco.repo.action.executer.ExporterActionExecuter;
import org.alfresco.repo.action.executer.RepositoryExporterActionExecuter; import org.alfresco.repo.action.executer.RepositoryExporterActionExecuter;
@@ -39,8 +37,8 @@ import org.alfresco.service.cmr.action.ActionService;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@@ -49,16 +47,14 @@ import org.apache.commons.logging.LogFactory;
* *
* @author gavinc * @author gavinc
*/ */
public class ExportBean public class ExportDialog extends BaseDialogBean
{ {
private static final Log logger = LogFactory.getLog(ExportBean.class); private static final Log logger = LogFactory.getLog(ExportDialog.class);
private static final String ALL_SPACES = "all"; private static final String ALL_SPACES = "all";
private static final String CURRENT_SPACE = "current"; private static final String CURRENT_SPACE = "current";
private static final String DEFAULT_OUTCOME = "dialog:close"; private static final String DEFAULT_OUTCOME = "dialog:close";
private static final String MSG_EXPORT = "export";
private static final String MSG_ERROR = "error_export";
protected BrowseBean browseBean; protected BrowseBean browseBean;
protected NodeService nodeService; protected NodeService nodeService;
@@ -72,76 +68,58 @@ public class ExportBean
private boolean runInBackground = true; private boolean runInBackground = true;
private boolean includeSelf; private boolean includeSelf;
/** @Override
* Performs the export operation using the current state of the bean protected String finishImpl(FacesContext context, String outcome) throws Exception
*
* @return The outcome
*/
public String export()
{ {
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
logger.debug("Called export for " + this.mode + " with package name: " + this.packageName); logger.debug("Called export for " + this.mode + " with package name: " + this.packageName);
String outcome = DEFAULT_OUTCOME; // construct appropriate action to execute
Action action = null;
UserTransaction tx = null; NodeRef startNode = this.browseBean.getActionSpace().getNodeRef();
try // get the appropriate node
if (this.mode.equals(ALL_SPACES))
{ {
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance()); Map<String, Serializable> params = new HashMap<String, Serializable>(5);
tx.begin(); params.put(ExporterActionExecuter.PARAM_PACKAGE_NAME, this.packageName);
params.put(ExporterActionExecuter.PARAM_DESTINATION_FOLDER, this.destination);
// construct appropriate action to execute action = this.actionService.createAction(RepositoryExporterActionExecuter.NAME, params);
Action action = null;
NodeRef startNode = this.browseBean.getActionSpace().getNodeRef();
// get the appropriate node
if (this.mode.equals(ALL_SPACES))
{
Map<String, Serializable> params = new HashMap<String, Serializable>(5);
params.put(ExporterActionExecuter.PARAM_PACKAGE_NAME, this.packageName);
params.put(ExporterActionExecuter.PARAM_DESTINATION_FOLDER, this.destination);
action = this.actionService.createAction(RepositoryExporterActionExecuter.NAME, params);
}
else
{
Map<String, Serializable> params = new HashMap<String, Serializable>(5);
params.put(ExporterActionExecuter.PARAM_STORE, Repository.getStoreRef().toString());
params.put(ExporterActionExecuter.PARAM_PACKAGE_NAME, this.packageName);
params.put(ExporterActionExecuter.PARAM_ENCODING, this.encoding);
params.put(ExporterActionExecuter.PARAM_DESTINATION_FOLDER, this.destination);
params.put(ExporterActionExecuter.PARAM_INCLUDE_CHILDREN, Boolean.valueOf(includeChildren));
params.put(ExporterActionExecuter.PARAM_INCLUDE_SELF, new Boolean(includeSelf));
action = this.actionService.createAction(ExporterActionExecuter.NAME, params);
}
// execute action
action.setExecuteAsynchronously(this.runInBackground);
this.actionService.executeAction(action, startNode);
if (logger.isDebugEnabled())
{
logger.debug("Executed space export action with action params of " + action.getParameterValues());
}
// commit the transaction
tx.commit();
// reset the bean
reset();
} }
catch (Throwable e) else
{ {
// rollback the transaction Map<String, Serializable> params = new HashMap<String, Serializable>(5);
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {} params.put(ExporterActionExecuter.PARAM_STORE, Repository.getStoreRef().toString());
Utils.addErrorMessage(MessageFormat.format(Application.getMessage( params.put(ExporterActionExecuter.PARAM_PACKAGE_NAME, this.packageName);
FacesContext.getCurrentInstance(), MSG_ERROR), e.toString()), e); params.put(ExporterActionExecuter.PARAM_ENCODING, this.encoding);
outcome = null; params.put(ExporterActionExecuter.PARAM_DESTINATION_FOLDER, this.destination);
params.put(ExporterActionExecuter.PARAM_INCLUDE_CHILDREN, Boolean.valueOf(includeChildren));
params.put(ExporterActionExecuter.PARAM_INCLUDE_SELF, new Boolean(includeSelf));
action = this.actionService.createAction(ExporterActionExecuter.NAME, params);
} }
// execute action
action.setExecuteAsynchronously(this.runInBackground);
this.actionService.executeAction(action, startNode);
if (logger.isDebugEnabled())
{
logger.debug("Executed space export action with action params of " + action.getParameterValues());
}
// reset the bean
reset();
return outcome; return outcome;
} }
@Override
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_EXPORT) +
" '" + browseBean.getActionSpace().getName() + "'";
}
/** /**
* Action called when the dialog is cancelled, just resets the bean's state * Action called when the dialog is cancelled, just resets the bean's state
* *

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,520 @@
/*
* 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;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.transaction.UserTransaction;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.AuthorityType;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.context.IContextListener;
import org.alfresco.web.app.context.UIContextService;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.groups.GroupsProperties;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.IBreadcrumbHandler;
import org.alfresco.web.ui.common.component.UIActionLink;
import org.alfresco.web.ui.common.component.UIBreadcrumb;
import org.alfresco.web.ui.common.component.UIModeList;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Backing Bean for the Groups Management pages.
*
* @author Kevin Roast
*/
public class GroupsDialog extends BaseDialogBean implements IContextListener
{
protected GroupsProperties properties;
private static final String FILTER_CHILDREN = "children";
private static final String MSG_GROUPS = "root_groups";
private static Log logger = LogFactory.getLog(GroupsDialog.class);
// ------------------------------------------------------------------------------
// Construction
/**
* Default Constructor
*/
public GroupsDialog()
{
UIContextService.getInstance(FacesContext.getCurrentInstance()).registerBean(this);
}
// ------------------------------------------------------------------------------
// Bean property getters and setters
public void setProperties(GroupsProperties properties)
{
this.properties = properties;
}
/**
* @param filterMode The filterMode to set.
*/
public void setFilterMode(String filterMode)
{
properties.setFilterMode(filterMode);
// clear datalist cache ready to change results based on filter setting
contextUpdated();
}
/**
* @param group Set the Group to be used for the current action screen.
*/
public void setActionGroup(String group)
{
properties.setActionGroup(group);
if (group != null)
{
// calculate action group metadata
properties.setActionGroupName(properties.getAuthService().getShortName(group));
int count = properties.getAuthService().getContainedAuthorities(AuthorityType.GROUP, group, false).size();
count += properties.getAuthService().getContainedAuthorities(AuthorityType.USER, group, false).size();
properties.setActionGroupItems(count);
}
else
{
properties.setActionGroupName(null);
properties.setActionGroupItems(0);
}
// clear value used by Create Group form
properties.setName(null);
}
/**
* Set the current Group Authority.
* <p>
* Setting this value causes the UI to update and display the specified node as current.
*
* @param group The current group authority.
*/
public void setCurrentGroup(String group, String groupName)
{
if (logger.isDebugEnabled())
logger.debug("Setting current group: " + group);
// set the current Group Authority for our UI context operations
properties.setGroup(group);
properties.setGroupName(groupName);
// inform that the UI needs updating after this change
contextUpdated();
}
/**
* @return Breadcrumb location list
*/
public List<IBreadcrumbHandler> getLocation()
{
if (properties.getLocation() == null)
{
List<IBreadcrumbHandler> loc = new ArrayList<IBreadcrumbHandler>(8);
loc.add(new GroupBreadcrumbHandler(null,
Application.getMessage(FacesContext.getCurrentInstance(), MSG_GROUPS)));
properties.setLocation(loc);
}
return properties.getLocation();
}
/**
* @return The list of group objects to display. Returns the list of root groups or the
* list of sub-groups for the current group if set.
*/
public List<Map> getGroups()
{
List<Map> groups;
UserTransaction tx = null;
try
{
FacesContext context = FacesContext.getCurrentInstance();
tx = Repository.getUserTransaction(context);
tx.begin();
Set<String> authorities;
boolean immediate = (properties.getFilterMode().equals(FILTER_CHILDREN));
if (properties.getGroup() == null)
{
// root groups
if (immediate == true)
{
authorities = properties.getAuthService().getAllRootAuthorities(AuthorityType.GROUP);
}
else
{
authorities = properties.getAuthService().getAllAuthorities(AuthorityType.GROUP);
}
}
else
{
// sub-group of an existing group
authorities = properties.getAuthService().getContainedAuthorities(AuthorityType.GROUP, properties.getGroup(), immediate);
}
groups = new ArrayList<Map>(authorities.size());
for (String authority : authorities)
{
Map<String, String> authMap = new HashMap<String, String>(3, 1.0f);
String name = properties.getAuthService().getShortName(authority);
authMap.put("name", name);
authMap.put("id", authority);
groups.add(authMap);
}
// commit the transaction
tx.commit();
}
catch (Throwable err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
groups = Collections.<Map>emptyList();
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
}
return groups;
}
/**
* @return The list of user objects to display. Returns the list of user for the current group.
*/
public List<Map> getUsers()
{
List<Map> users;
UserTransaction tx = null;
try
{
FacesContext context = FacesContext.getCurrentInstance();
tx = Repository.getUserTransaction(context);
tx.begin();
Set<String> authorities;
if (properties.getGroup() == null)
{
authorities = Collections.<String>emptySet();
}
else
{
// users of an existing group
boolean immediate = (properties.getFilterMode().equals(FILTER_CHILDREN));
authorities = properties.getAuthService().getContainedAuthorities(AuthorityType.USER, properties.getGroup(), immediate);
}
users = new ArrayList<Map>(authorities.size());
for (String authority : authorities)
{
Map<String, String> authMap = new HashMap<String, String>(3, 1.0f);
String userName = properties.getAuthService().getShortName(authority);
authMap.put("userName", userName);
authMap.put("id", authority);
// get Person details for this Authority
NodeRef ref = properties.getPersonService().getPerson(authority);
String firstName = (String)this.nodeService.getProperty(ref, ContentModel.PROP_FIRSTNAME);
String lastName = (String)this.nodeService.getProperty(ref, ContentModel.PROP_LASTNAME);
// build a sensible label for display
StringBuilder label = new StringBuilder(48);
label.append(firstName)
.append(' ')
.append(lastName);
authMap.put("name", label.toString());
users.add(authMap);
}
// commit the transaction
tx.commit();
}
catch (Throwable err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
users = Collections.<Map>emptyList();
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
}
return users;
}
/**
* Set the Group to be used for next action dialog
*/
public void setupGroupAction(ActionEvent event)
{
UIActionLink link = (UIActionLink)event.getComponent();
Map<String, String> params = link.getParameterMap();
String group = params.get("id");
if (group != null && group.length() != 0)
{
if (logger.isDebugEnabled())
logger.debug("Setup for action, setting current Group to: " + group);
// prepare a node for the action context
setActionGroup(group);
// clear datalist cache ready from return from action dialog
contextUpdated();
}
}
/**
* Clear the Group action context - e.g. ready for a Create Root Group operation
*/
public void clearGroupAction(ActionEvent event)
{
setActionGroup(null);
// clear datalist cache ready from return from action dialog
contextUpdated();
}
/**
* Action called when a Group folder is clicked.
* Navigate into the Group and show child Groups and child Users.
*/
public void clickGroup(ActionEvent event)
{
UIActionLink link = (UIActionLink)event.getComponent();
Map<String, String> params = link.getParameterMap();
String group = params.get("id");
if (group != null && group.length() != 0)
{
// refresh UI based on node selection
updateUILocation(group);
}
}
/**
* Remove specified user from the current group
*/
public void removeUser(ActionEvent event)
{
UIActionLink link = (UIActionLink)event.getComponent();
Map<String, String> params = link.getParameterMap();
String authority = params.get("id");
if (authority != null && authority.length() != 0)
{
try
{
properties.getAuthService().removeAuthority(properties.getGroup(), authority);
// refresh UI after change
contextUpdated();
}
catch (Throwable err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
}
}
}
/**
* Change the current view mode based on user selection
*/
public void viewModeChanged(ActionEvent event)
{
UIModeList viewList = (UIModeList)event.getComponent();
// update view mode from user selection
properties.setViewMode(viewList.getValue().toString());
}
/**
* Change the current list filter mode based on user selection
*/
public void filterModeChanged(ActionEvent event)
{
UIModeList viewList = (UIModeList)event.getComponent();
// update list filter mode from user selection
setFilterMode(viewList.getValue().toString());
}
/**
* Update the breadcrumb with the clicked Group location
*/
private void updateUILocation(String group)
{
String groupName = properties.getAuthService().getShortName(group);
properties.getLocation().add(new GroupBreadcrumbHandler(group, groupName));
this.setCurrentGroup(group, groupName);
}
public void removeFromBreadcrumb(String group)
{
// remove this node from the breadcrumb if required
List<IBreadcrumbHandler> location = getLocation();
GroupBreadcrumbHandler handler = (GroupBreadcrumbHandler) location.get(location.size() - 1);
// see if the current breadcrumb location is our Group
if (group.equals(handler.Group))
{
location.remove(location.size() - 1);
// now work out which Group to set the list to refresh against
if (location.size() != 0)
{
handler = (GroupBreadcrumbHandler) location.get(location.size() - 1);
this.setCurrentGroup(handler.Group, handler.Label);
}
}
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return null;
}
// ------------------------------------------------------------------------------
// IContextListener implementation
/**
* @see org.alfresco.web.app.context.IContextListener#contextUpdated()
*/
public void contextUpdated()
{
if (logger.isDebugEnabled())
logger.debug("Invalidating Group Management Components...");
// force a requery of the richlist dataset
properties.getGroupsRichList().setValue(null);
properties.getUsersRichList().setValue(null);
}
/**
* @see org.alfresco.web.app.context.IContextListener#areaChanged()
*/
public void areaChanged()
{
// nothing to do
}
/**
* @see org.alfresco.web.app.context.IContextListener#spaceChanged()
*/
public void spaceChanged()
{
// nothing to do
}
// ------------------------------------------------------------------------------
// Inner classes
/**
* Class to handle breadcrumb interaction for Group pages
*/
private class GroupBreadcrumbHandler implements IBreadcrumbHandler
{
private static final long serialVersionUID = 1871876653151036630L;
/**
* Constructor
*
* @param group The group for this navigation element if any
* @param label Element label
*/
public GroupBreadcrumbHandler(String group, String label)
{
this.Group = group;
this.Label = label;
}
/**
* @see java.lang.Object#toString()
*/
public String toString()
{
return this.Label;
}
/**
* @see org.alfresco.web.ui.common.component.IBreadcrumbHandler#navigationOutcome(org.alfresco.web.ui.common.component.UIBreadcrumb)
*/
public String navigationOutcome(UIBreadcrumb breadcrumb)
{
// All group breadcrumb elements relate to a Group
// when selected we set the current Group Id and return
setCurrentGroup(this.Group, this.Label);
properties.setLocation( (List)breadcrumb.getValue() );
return null;
}
public String Group;
public String Label;
}
/**
* Simple wrapper bean exposing user authority and person details for JSF results list
*/
public static class UserAuthorityDetails
{
public UserAuthorityDetails(String name, String authority)
{
this.name = name;
this.authority = authority;
}
public String getName()
{
return this.name;
}
public String getAuthority()
{
return this.authority;
}
private String name;
private String authority;
}
}

View File

@@ -31,7 +31,6 @@ import java.util.Map;
import javax.faces.context.FacesContext; import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent; import javax.faces.event.ActionEvent;
import javax.transaction.UserTransaction;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition; import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
@@ -41,7 +40,9 @@ import org.alfresco.service.cmr.repository.InvalidNodeRefException;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.AlfrescoNavigationHandler;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils; import org.alfresco.web.ui.common.Utils;
@@ -51,15 +52,23 @@ import org.alfresco.web.ui.common.Utils.URLMode;
* Backing bean for the edit link properties dialog * Backing bean for the edit link properties dialog
* *
* @author kevinr * @author kevinr
* @author YanO
*/ */
public class LinkPropertiesBean public class LinkPropertiesDialog extends BaseDialogBean
{ {
protected NodeService nodeService;
protected DictionaryService dictionaryService;
protected BrowseBean browseBean;
protected NavigationBean navigator;
private Node editableNode; private Node editableNode;
public Map<String, Object> getProperties()
{
return this.editableNode.getProperties();
}
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
/** /**
* Returns the node being edited * Returns the node being edited
* *
@@ -122,25 +131,11 @@ public class LinkPropertiesBean
return Utils.generateURL(FacesContext.getCurrentInstance(), new Node(destRef), URLMode.SHOW_DETAILS); return Utils.generateURL(FacesContext.getCurrentInstance(), new Node(destRef), URLMode.SHOW_DETAILS);
} }
/** @Override
* Event handler used to save the edited properties back to the repository protected String finishImpl(FacesContext context, String outcome) throws Exception
*
* @return The outcome
*/
public String save()
{ {
String outcome = "cancelEdit";
// setup the dispatch context as it is required for correct cancel/finish back to link dialog
this.navigator.setupDispatchContext(this.editableNode);
UserTransaction tx = null;
try try
{ {
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance());
tx.begin();
NodeRef nodeRef = this.editableNode.getNodeRef(); NodeRef nodeRef = this.editableNode.getNodeRef();
Map<String, Object> props = this.editableNode.getProperties(); Map<String, Object> props = this.editableNode.getProperties();
@@ -192,100 +187,29 @@ public class LinkPropertiesBean
// send the properties back to the repository // send the properties back to the repository
this.nodeService.setProperties(nodeRef, properties); this.nodeService.setProperties(nodeRef, properties);
// commit the transaction
tx.commit();
// set the outcome to refresh
outcome = "finishEdit";
// reset any document held by the browse bean as it's just been updated // reset any document held by the browse bean as it's just been updated
// if this is a space link then it doesn't matter anyway // if this is a space link then it doesn't matter anyway
if (this.browseBean.getDocument() != null) if (this.browseBean.getDocument() != null)
{ {
this.browseBean.getDocument().reset(); this.browseBean.getDocument().reset();
} }
} }
catch (InvalidNodeRefException err) catch (InvalidNodeRefException err)
{ {
// rollback the transaction
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
Utils.addErrorMessage(MessageFormat.format(Application.getMessage( Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_NODEREF), new Object[] {this.browseBean.getDocument().getId()}) ); context, Repository.ERROR_NODEREF), new Object[] {this.browseBean.getDocument().getId()}));
// this failure means the node no longer exists - we cannot show the doc properties screen // this failure means the node no longer exists - we cannot show the doc properties screen
outcome = "browse"; outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME +
AlfrescoNavigationHandler.OUTCOME_SEPARATOR + "browse";
} }
catch (Throwable e) catch (Throwable e)
{ {
// rollback the transaction
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
Utils.addErrorMessage(MessageFormat.format(Application.getMessage( Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), e.getMessage()), e); context, Repository.ERROR_GENERIC), e.getMessage()), e);
outcome = null;
} }
return outcome; return outcome;
} }
public String cancel()
{
// setup the dispatch context as it is required for correct cancel/finish back to link dialog
this.navigator.setupDispatchContext(this.editableNode);
return "cancelEdit";
}
public Map<String, Object> getProperties()
{
return this.editableNode.getProperties();
}
/**
* @return Returns the nodeService.
*/
public NodeService getNodeService()
{
return this.nodeService;
}
/**
* @param nodeService The nodeService to set.
*/
public void setNodeService(NodeService nodeService)
{
this.nodeService = nodeService;
}
/**
* Sets the DictionaryService to use when persisting metadata
*
* @param dictionaryService The DictionaryService
*/
public void setDictionaryService(DictionaryService dictionaryService)
{
this.dictionaryService = dictionaryService;
}
/**
* @return The BrowseBean
*/
public BrowseBean getBrowseBean()
{
return this.browseBean;
}
/**
* @param browseBean The BrowseBean to set.
*/
public void setBrowseBean(BrowseBean browseBean)
{
this.browseBean = browseBean;
}
/**
* @param navigator The NavigationBean to set.
*/
public void setNavigator(NavigationBean navigator)
{
this.navigator = navigator;
}
} }

View File

@@ -0,0 +1,126 @@
/*
* 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;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
public class SaveSearchDialog extends AdvancedSearchDialog
{
private static final String MSG_ERROR_SAVE_SEARCH = "error_save_search";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return saveNewSearchOK(context, outcome);
}
@Override
public String getFinishButtonLabel()
{
return super.getFinishButtonLabel();
}
public String saveNewSearchOK(FacesContext newContext, String newOutcome)
{
String outcome = newOutcome;
NodeRef searchesRef;
if (properties.isSearchSaveGlobal())
{
searchesRef = getGlobalSearchesRef();
}
else
{
searchesRef = getUserSearchesRef();
}
final SearchContext search = this.navigator.getSearchContext();
if (searchesRef != null && search != null)
{
try
{
final FacesContext context = newContext;// FacesContext.getCurrentInstance();
final NodeRef searchesRefFinal = searchesRef;
RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>()
{
public Object execute() throws Throwable
{
// create new content node as the saved search object
Map<QName, Serializable> props = new HashMap<QName, Serializable>(2, 1.0f);
props.put(ContentModel.PROP_NAME, properties.getSearchName());
props.put(ContentModel.PROP_DESCRIPTION, properties.getSearchDescription());
ChildAssociationRef childRef = nodeService.createNode(searchesRefFinal, ContentModel.ASSOC_CONTAINS, QName.createQName(NamespaceService.ALFRESCO_URI, QName
.createValidLocalName(properties.getSearchName())), ContentModel.TYPE_CONTENT, props);
ContentService contentService = Repository.getServiceRegistry(context).getContentService();
ContentWriter writer = contentService.getWriter(childRef.getChildRef(), ContentModel.PROP_CONTENT, true);
// get a writer to our new node ready for XML content
writer.setMimetype(MimetypeMap.MIMETYPE_XML);
writer.setEncoding("UTF-8");
// output an XML serialized version of the SearchContext
// object
writer.putContent(search.toXML());
return null;
}
};
callback.execute();
properties.getCachedSavedSearches().clear();
properties.setSavedSearch(null);
}
catch (Throwable e)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(newContext, MSG_ERROR_SAVE_SEARCH), e.getMessage()), e);
outcome = null;
this.isFinished = false;
}
}
return outcome;
}
}

View File

@@ -0,0 +1,514 @@
/*
* 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;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.faces.model.DataModel;
import javax.faces.model.SelectItem;
import org.alfresco.repo.cache.ExpiringValueCache;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.config.AdvancedSearchConfigElement;
public class SearchProperties
{
private static final String MODE_ALL = "all";
private static final String LOOKIN_ALL = "all";
private static final String SAVED_SEARCHES_USER = "user";
/** PermissionService */
protected PermissionService permissionService;
/** Client Config reference */
protected AdvancedSearchConfigElement searchConfigElement = null;
/** Progressive panel UI state */
private Map<String, Boolean> panels = new HashMap<String, Boolean>(5, 1.0f);
/** Saved search properties */
private String searchName;
private String searchDescription;
/** custom property names to values */
private Map<String, Object> customProperties = new HashMap<String, Object>(5, 1.0f);
/**
* lookup of custom property QName string to DataTypeDefinition for the property
*/
private Map<String, DataTypeDefinition> customPropertyLookup = null;
/** content format list restricting searches */
private List<SelectItem> contentFormats;
/** content format selection */
private String contentFormat;
/** content type selection */
private String contentType;
/** content types for restricting searches */
private List<SelectItem> contentTypes;
/** folder type selection */
private String folderType;
/** folder types for restricting searches */
private List<SelectItem> folderTypes;
/** the text to search for */
private String text = "";
/** search mode */
private String mode = MODE_ALL;
/** folder lookin mode */
private String lookin = LOOKIN_ALL;
/** Space Selector location */
private NodeRef location = null;
/** categories to search */
private List<Node> categories = new ArrayList<Node>(2);
/** datamodel for table of categories to search */
private DataModel categoriesDataModel = null;
/** title attribute to search */
private String title = null;
/** description attribute to search */
private String description = null;
/** created attribute to search from */
private Date createdDateFrom = null;
/** created attribute to search to */
private Date createdDateTo = null;
/** modified attribute to search from */
private Date modifiedDateFrom = null;
/** modified attribute to search to */
private Date modifiedDateTo = null;
/** true to search location children as well as location */
private boolean locationChildren = true;
/** author (creator) attribute to search */
private String author = null;
private boolean modifiedDateChecked = false;
private boolean createdDateChecked = false;
/** cached ref to the global saved searches folder */
private NodeRef globalSearchesRef = null;
/** cached ref to the current users saved searches folder */
private NodeRef userSearchesRef = null;
/** ID to the last selected saved search */
private String savedSearch = null;
/** ModeList component value for selecting user/global searches */
private String savedSearchMode = SAVED_SEARCHES_USER;
/** name of the saved search to edit */
private String editSearchName = null;
/** form field for saving search as user/global */
private boolean searchSaveGlobal = false;
/** auto-expiring cache of the list of saved searches */
private ExpiringValueCache<List<SelectItem>> cachedSavedSearches = new ExpiringValueCache<List<SelectItem>>();
public PermissionService getPermissionService()
{
return permissionService;
}
public void setPermissionService(PermissionService permissionService)
{
this.permissionService = permissionService;
}
public AdvancedSearchConfigElement getSearchConfigElement()
{
return searchConfigElement;
}
public void setSearchConfigElement(AdvancedSearchConfigElement searchConfigElement)
{
this.searchConfigElement = searchConfigElement;
}
public Map<String, Boolean> getPanels()
{
return panels;
}
public void setPanels(Map<String, Boolean> panels)
{
this.panels = panels;
}
public String getSearchName()
{
return searchName;
}
public void setSearchName(String searchName)
{
this.searchName = searchName;
}
public String getSearchDescription()
{
return searchDescription;
}
public void setSearchDescription(String searchDescription)
{
this.searchDescription = searchDescription;
}
public Map<String, Object> getCustomProperties()
{
return customProperties;
}
public void setCustomProperties(Map<String, Object> customProperties)
{
this.customProperties = customProperties;
}
public Map<String, DataTypeDefinition> getCustomPropertyLookup()
{
return customPropertyLookup;
}
public void setCustomPropertyLookup(Map<String, DataTypeDefinition> customPropertyLookup)
{
this.customPropertyLookup = customPropertyLookup;
}
public List<SelectItem> getContentFormats()
{
return contentFormats;
}
public void setContentFormats(List<SelectItem> contentFormats)
{
this.contentFormats = contentFormats;
}
public String getContentFormat()
{
return contentFormat;
}
public void setContentFormat(String contentFormat)
{
this.contentFormat = contentFormat;
}
public String getContentType()
{
return contentType;
}
public void setContentType(String contentType)
{
this.contentType = contentType;
}
public List<SelectItem> getContentTypes()
{
return contentTypes;
}
public void setContentTypes(List<SelectItem> contentTypes)
{
this.contentTypes = contentTypes;
}
public String getFolderType()
{
return folderType;
}
public void setFolderType(String folderType)
{
this.folderType = folderType;
}
public List<SelectItem> getFolderTypes()
{
return folderTypes;
}
public void setFolderTypes(List<SelectItem> folderTypes)
{
this.folderTypes = folderTypes;
}
public String getText()
{
return text;
}
public void setText(String text)
{
this.text = text;
}
public String getMode()
{
return mode;
}
public void setMode(String mode)
{
this.mode = mode;
}
public String getLookin()
{
return lookin;
}
public void setLookin(String lookin)
{
this.lookin = lookin;
}
public NodeRef getLocation()
{
return location;
}
public void setLocation(NodeRef location)
{
this.location = location;
}
public List<Node> getCategories()
{
return categories;
}
public void setCategories(List<Node> categories)
{
this.categories = categories;
}
public DataModel getCategoriesDataModel()
{
return categoriesDataModel;
}
public void setCategoriesDataModel(DataModel categoriesDataModel)
{
this.categoriesDataModel = categoriesDataModel;
}
public String getTitle()
{
return title;
}
public void setTitle(String title)
{
this.title = title;
}
public String getDescription()
{
return description;
}
public void setDescription(String description)
{
this.description = description;
}
public Date getCreatedDateFrom()
{
return createdDateFrom;
}
public void setCreatedDateFrom(Date createdDateFrom)
{
this.createdDateFrom = createdDateFrom;
}
public Date getCreatedDateTo()
{
return createdDateTo;
}
public void setCreatedDateTo(Date createdDateTo)
{
this.createdDateTo = createdDateTo;
}
public Date getModifiedDateFrom()
{
return modifiedDateFrom;
}
public void setModifiedDateFrom(Date modifiedDateFrom)
{
this.modifiedDateFrom = modifiedDateFrom;
}
public Date getModifiedDateTo()
{
return modifiedDateTo;
}
public void setModifiedDateTo(Date modifiedDateTo)
{
this.modifiedDateTo = modifiedDateTo;
}
public boolean isLocationChildren()
{
return locationChildren;
}
public void setLocationChildren(boolean locationChildren)
{
this.locationChildren = locationChildren;
}
public String getAuthor()
{
return author;
}
public void setAuthor(String author)
{
this.author = author;
}
public boolean isModifiedDateChecked()
{
return modifiedDateChecked;
}
public void setModifiedDateChecked(boolean modifiedDateChecked)
{
this.modifiedDateChecked = modifiedDateChecked;
}
public boolean isCreatedDateChecked()
{
return createdDateChecked;
}
public void setCreatedDateChecked(boolean createdDateChecked)
{
this.createdDateChecked = createdDateChecked;
}
public NodeRef getGlobalSearchesRef()
{
return globalSearchesRef;
}
public void setGlobalSearchesRef(NodeRef globalSearchesRef)
{
this.globalSearchesRef = globalSearchesRef;
}
public NodeRef getUserSearchesRef()
{
return userSearchesRef;
}
public void setUserSearchesRef(NodeRef userSearchesRef)
{
this.userSearchesRef = userSearchesRef;
}
public String getSavedSearch()
{
return savedSearch;
}
public void setSavedSearch(String savedSearch)
{
this.savedSearch = savedSearch;
}
public String getSavedSearchMode()
{
return savedSearchMode;
}
public void setSavedSearchMode(String savedSearchMode)
{
this.savedSearchMode = savedSearchMode;
}
public String getEditSearchName()
{
return editSearchName;
}
public void setEditSearchName(String editSearchName)
{
this.editSearchName = editSearchName;
}
public boolean isSearchSaveGlobal()
{
return searchSaveGlobal;
}
public void setSearchSaveGlobal(boolean searchSaveGlobal)
{
this.searchSaveGlobal = searchSaveGlobal;
}
public ExpiringValueCache<List<SelectItem>> getCachedSavedSearches()
{
return cachedSavedSearches;
}
public void setCachedSavedSearches(ExpiringValueCache<List<SelectItem>> cachedSavedSearches)
{
this.cachedSavedSearches = cachedSavedSearches;
}
}

View File

@@ -0,0 +1,68 @@
/*
* 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;
import javax.faces.context.FacesContext;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.dialog.BaseDialogBean;
public class ShowSystemInfoDialog extends BaseDialogBean
{
private final static String MSG_CURRENT_USER = "current_user";
private static final String LBL_CLOSE = "close";
private NavigationBean navigationBean;
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return null;
}
public NavigationBean getNavigationBean()
{
return navigationBean;
}
public void setNavigationBean(NavigationBean navigationBean)
{
this.navigationBean = navigationBean;
}
@Override
public String getContainerDescription()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_CURRENT_USER) + " '" + navigationBean.getCurrentUser().getUserName() + "'";
}
@Override
public String getCancelButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), LBL_CLOSE);
}
}

View File

@@ -39,13 +39,15 @@ import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.TemplateService; import org.alfresco.service.cmr.repository.TemplateService;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.AlfrescoNavigationHandler; import org.alfresco.web.app.AlfrescoNavigationHandler;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
import org.alfresco.web.app.servlet.GuestTemplateContentServlet; import org.alfresco.web.app.servlet.GuestTemplateContentServlet;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.dialog.IDialogBean;
import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.config.DialogsConfigElement.DialogButtonConfig;
import org.alfresco.web.ui.common.Utils; import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.Utils.URLMode; import org.alfresco.web.ui.common.Utils.URLMode;
import org.alfresco.web.ui.common.component.UIActionLink; import org.alfresco.web.ui.common.component.UIActionLink;
@@ -55,21 +57,31 @@ import org.alfresco.web.ui.common.component.UIActionLink;
* *
* @author Kevin Roast * @author Kevin Roast
*/ */
public class SpaceDetailsBean extends BaseDetailsBean public class SpaceDetailsBean extends BaseDetailsBean implements IDialogBean
{ {
private static final String MSG_HAS_FOLLOWING_CATEGORIES = "has_following_categories_space"; private static final String MSG_HAS_FOLLOWING_CATEGORIES = "has_following_categories_space";
private static final String MSG_NO_CATEGORIES_APPLIED = "no_categories_applied_space"; private static final String MSG_NO_CATEGORIES_APPLIED = "no_categories_applied_space";
private static final String MSG_ERROR_UPDATE_CATEGORY = "error_update_category"; private static final String MSG_ERROR_UPDATE_CATEGORY = "error_update_category";
private static final String MSG_ERROR_ASPECT_CLASSIFY = "error_aspect_classify_space"; private static final String MSG_ERROR_ASPECT_CLASSIFY = "error_aspect_classify_space";
private static final String MSG_MODIFY_CATEGORIES_OF = "modify_categories_of";
/** Category details */ /** Category details */
private NodeRef addedCategory; private NodeRef addedCategory;
private List categories; private List categories;
private BaseDialogBean baseDialogBean = new BaseDialogBeanImpl();
/** RSS Template ID */ /** RSS Template ID */
private String rssTemplate; private String rssTemplate;
private class BaseDialogBeanImpl extends BaseDialogBean
{
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return saveCategories(context, outcome);
}
}
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// Construction // Construction
@@ -397,9 +409,9 @@ public class SpaceDetailsBean extends BaseDetailsBean
* *
* @return The outcome * @return The outcome
*/ */
public String saveCategories() public String saveCategories(FacesContext newContext, String newOutcome)
{ {
String outcome = "cancel"; String outcome = newOutcome;
UserTransaction tx = null; UserTransaction tx = null;
@@ -423,8 +435,6 @@ public class SpaceDetailsBean extends BaseDetailsBean
// reset the state of the current document so it reflects the changes just made // reset the state of the current document so it reflects the changes just made
getSpace().reset(); getSpace().reset();
outcome = "finish";
} }
catch (Throwable e) catch (Throwable e)
{ {
@@ -588,4 +598,58 @@ public class SpaceDetailsBean extends BaseDetailsBean
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), e.getMessage()), e); FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), e.getMessage()), e);
} }
} }
// ------------------------------------------------------------------------------
// dialog implementation
public String cancel()
{
return baseDialogBean.cancel();
}
public String finish()
{
return baseDialogBean.finish();
}
public List<DialogButtonConfig> getAdditionalButtons()
{
return baseDialogBean.getAdditionalButtons();
}
public String getCancelButtonLabel()
{
return baseDialogBean.getCancelButtonLabel();
}
public String getContainerDescription()
{
return baseDialogBean.getContainerDescription();
}
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_MODIFY_CATEGORIES_OF) +
" '" + getSpace().getName() + "'";
}
public boolean getFinishButtonDisabled()
{
return false;
}
public String getFinishButtonLabel()
{
return baseDialogBean.getFinishButtonLabel();
}
public void init(Map<String, String> parameters)
{
baseDialogBean.init(parameters);
}
public void restored()
{
baseDialogBean.restored();
}
} }

View File

@@ -0,0 +1,89 @@
/*
* 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;
import java.text.MessageFormat;
import javax.faces.context.FacesContext;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
public class TrashcanDeleteAllItemsDialog extends TrashcanDialog
{
private static final String MSG_YES = "yes";
private static final String MSG_NO = "no";
private String deleteAllItems(FacesContext context, String outcome)
{
if (property.isInProgress())
return null;
property.setInProgress(true);
try
{
property.getNodeArchiveService().purgeAllArchivedNodes(Repository.getStoreRef());
}
catch (Throwable err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(context, Repository.ERROR_GENERIC), err.getMessage()), err);
}
finally
{
property.setInProgress(false);
}
return outcome;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return deleteAllItems(context, outcome);
}
@Override
public String getCancelButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_NO);
}
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_YES);
}
}

View File

@@ -0,0 +1,101 @@
/*
* 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;
import java.text.MessageFormat;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
public class TrashcanDeleteItemDialog extends TrashcanDialog
{
private static final String RICHLIST_ID = "trashcan-list";
private static final String RICHLIST_MSG_ID = "trashcan" + ':' + RICHLIST_ID;
private static final String MSG_YES = "yes";
private static final String MSG_NO = "no";
private static final String MSG_DELETE_ITEM = "delete_item";
private String deleteItem(FacesContext newContext, String newOutcome)
{
Node item = property.getItem();
if (item != null)
{
try
{
property.getNodeArchiveService().purgeArchivedNode(item.getNodeRef());
FacesContext fc = newContext;
String msg = MessageFormat.format(Application.getMessage(fc, "delete_item_success"), item.getName());
FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg);
fc.addMessage(RICHLIST_MSG_ID, facesMsg);
}
catch (Throwable err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(newContext, Repository.ERROR_GENERIC), err.getMessage()), err);
}
}
return newOutcome;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
deleteItem(context, outcome);
return "dialog:goToTrashList";
}
@Override
public String getCancelButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_NO);
}
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_YES);
}
@Override
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_DELETE_ITEM) + " '" + property.getItem().getName() + "'";
}
}

View File

@@ -0,0 +1,98 @@
/*
* 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;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import javax.faces.context.FacesContext;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
public class TrashcanDeleteListedItemsDialog extends TrashcanDialog
{
private static final String MSG_YES = "yes";
private static final String MSG_NO = "no";
private String deleteListedItems(FacesContext context, String outcome)
{
if (property.isInProgress())
return null;
property.setInProgress(true);
try
{
List<NodeRef> nodeRefs = new ArrayList<NodeRef>(property.getListedItems().size());
for (Node node : property.getListedItems())
{
nodeRefs.add(node.getNodeRef());
}
property.getNodeArchiveService().purgeArchivedNodes(nodeRefs);
}
catch (Throwable err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(context, Repository.ERROR_GENERIC), err.getMessage()), err);
}
finally
{
property.setInProgress(false);
}
return outcome;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return deleteListedItems(context, outcome);
}
@Override
public String getCancelButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_NO);
}
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_YES);
}
}

View File

@@ -0,0 +1,302 @@
/*
* 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;
import java.util.Collections;
import java.util.List;
import org.alfresco.repo.node.archive.NodeArchiveService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.ui.common.component.data.UIRichList;
public class TrashcanDialogProperty
{
private static final String FILTER_DATE_ALL = "all";
private static final String FILTER_USER_ALL = "all";
/** NodeArchiveService bean reference */
protected NodeArchiveService nodeArchiveService;
/** Component reference for Deleted Items RichList control */
protected UIRichList itemsRichList;
/** Search text */
private String searchText = null;
/** We show an empty list until a Search or Show All is executed */
private boolean showItems = false;
private boolean fullTextSearch = false;
/** Currently listed items */
private List<Node> listedItems = Collections.<Node> emptyList();
private List<Node> successItems = Collections.<Node> emptyList();
private List<Node> failureItems = Collections.<Node> emptyList();
/** Current action context Node */
private Node actionNode;
/** Root node to the spaces store archive store */
private NodeRef archiveRootRef = null;
/** Alternative destination for recovered items */
private NodeRef destination = null;
/** Date filter selection */
private String dateFilter = FILTER_DATE_ALL;
/** User filter selection */
private String userFilter = FILTER_USER_ALL;
/** User filter search box text */
private String userSearchText = null;
private boolean inProgress = false;
/**
* @param nodeArchiveService The nodeArchiveService to set.
*/
public void setNodeArchiveService(NodeArchiveService nodeArchiveService)
{
this.nodeArchiveService = nodeArchiveService;
}
/**
* @return Returns the itemsRichList.
*/
public UIRichList getItemsRichList()
{
return this.itemsRichList;
}
/**
* @param itemsRichList The itemsRichList to set.
*/
public void setItemsRichList(UIRichList itemsRichList)
{
this.itemsRichList = itemsRichList;
}
/**
* @return Returns the searchText.
*/
public String getSearchText()
{
return this.searchText;
}
/**
* @param searchText The searchText to set.
*/
public void setSearchText(String searchText)
{
this.searchText = searchText;
}
/**
* @return Returns the alternative destination to use if recovery fails.
*/
public NodeRef getDestination()
{
return this.destination;
}
/**
* @param destination The alternative destination to use if recovery fails.
*/
public void setDestination(NodeRef destination)
{
this.destination = destination;
}
/**
* @return Returns the dateFilter.
*/
public String getDateFilter()
{
return this.dateFilter;
}
/**
* @param dateFilter The dateFilter to set.
*/
public void setDateFilter(String dateFilter)
{
this.dateFilter = dateFilter;
}
/**
* @return Returns the userFilter.
*/
public String getUserFilter()
{
return this.userFilter;
}
/**
* @param userFilter The userFilter to set.
*/
public void setUserFilter(String userFilter)
{
this.userFilter = userFilter;
}
/**
* @return Returns the userSearchText.
*/
public String getUserSearchText()
{
return this.userSearchText;
}
/**
* @param userSearchText The userSearchText to set.
*/
public void setUserSearchText(String userSearchText)
{
this.userSearchText = userSearchText;
}
/**
* @return Returns the listed items.
*/
public List<Node> getListedItems()
{
return this.listedItems;
}
/**
* @param listedItems The listed items to set.
*/
public void setListedItems(List<Node> listedItems)
{
this.listedItems = listedItems;
}
/**
* @return count of the items that failed to recover
*/
public int getFailureItemsCount()
{
return this.failureItems.size();
}
/**
* @param node The item context for the current action
*/
public void setItem(Node node)
{
this.actionNode = node;
}
/**
* @return the item context for the current action
*/
public Node getItem()
{
return this.actionNode;
}
public boolean isShowItems()
{
return showItems;
}
public void setShowItems(boolean showItems)
{
this.showItems = showItems;
}
public boolean isFullTextSearch()
{
return fullTextSearch;
}
public void setFullTextSearch(boolean fullTextSearch)
{
this.fullTextSearch = fullTextSearch;
}
public List<Node> getSuccessItems()
{
return successItems;
}
public void setSuccessItems(List<Node> successItems)
{
this.successItems = successItems;
}
public List<Node> getFailureItems()
{
return failureItems;
}
public void setFailureItems(List<Node> failureItems)
{
this.failureItems = failureItems;
}
public Node getActionNode()
{
return actionNode;
}
public void setActionNode(Node actionNode)
{
this.actionNode = actionNode;
}
public NodeRef getArchiveRootRef()
{
return archiveRootRef;
}
public void setArchiveRootRef(NodeRef archiveRootRef)
{
this.archiveRootRef = archiveRootRef;
}
public boolean isInProgress()
{
return inProgress;
}
public void setInProgress(boolean inProgress)
{
this.inProgress = inProgress;
}
public NodeArchiveService getNodeArchiveService()
{
return nodeArchiveService;
}
}

View File

@@ -0,0 +1,75 @@
/*
* 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;
import javax.faces.context.FacesContext;
import org.alfresco.service.cmr.repository.Path;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Node;
public class TrashcanItemDetailsDialog extends TrashcanDialog
{
private static final String MSG_DETAILS_OF = "details_of";
private static final String MSG_ORIGINAL_LOCATION = "original_location";
private static final String MSG_DELETEDITEM_DETAILS_DESCR = "deleteditem_details_description";
private static final String MSG_CLOSE = "close";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return null;
}
@Override
public String getContainerDescription()
{
Path path = (Path) property.getItem().getProperties().get("locationPath");
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_ORIGINAL_LOCATION) + ": " + path.toDisplayPath(nodeService) + "\n"
+ Application.getMessage(FacesContext.getCurrentInstance(), MSG_DELETEDITEM_DETAILS_DESCR);
}
@Override
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_DETAILS_OF) + " '" + property.getItem().getName() + "'";
}
public Node getItem()
{
return property.getItem();
}
@Override
public String getCancelButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_CLOSE);
}
}

View File

@@ -0,0 +1,109 @@
/*
* 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;
import java.util.List;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import org.alfresco.repo.node.archive.RestoreNodeReport;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository;
public class TrashcanRecoverAllItemsDialog extends TrashcanDialog
{
private static final String OUTCOME_RECOVERY_REPORT = "dialog:recoveryReport";
private static final String MSG_NO = "no";
private static final String MSG_YES = "yes";
private String recoverAllItems(FacesContext context, String outcome)
{
if (property.isInProgress())
return null;
property.setInProgress(true);
try
{
// restore all nodes - the user may have requested a restore to a
// different parent
List<RestoreNodeReport> reports;
if (property.getDestination() == null)
{
reports = property.getNodeArchiveService().restoreAllArchivedNodes(Repository.getStoreRef());
}
else
{
reports = property.getNodeArchiveService().restoreAllArchivedNodes(Repository.getStoreRef(), property.getDestination(), null, null);
}
saveReportDetail(reports);
}
finally
{
property.setInProgress(false);
}
return OUTCOME_RECOVERY_REPORT;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return recoverAllItems(context, outcome);
}
@Override
public String getCancelButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_NO);
}
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_YES);
}
@Override
public void setupListAction(ActionEvent event)
{
super.setupListAction(event);
clearSearch(event);
getItems();
}
}

View File

@@ -0,0 +1,155 @@
/*
* 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;
import java.text.MessageFormat;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import org.alfresco.repo.node.archive.RestoreNodeReport;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Node;
public class TrashcanRecoverItemDialog extends TrashcanDialog
{
private static final String RICHLIST_ID = "trashcan-list";
private static final String RICHLIST_MSG_ID = "trashcan" + ':' + RICHLIST_ID;
private static final String MSG_RECOVERED_ITEM_SUCCESS = "recovered_item_success";
private static final String MSG_RECOVERED_ITEM_INTEGRITY = "recovered_item_integrity";
private static final String MSG_RECOVERED_ITEM_PERMISSION = "recovered_item_permission";
private static final String MSG_RECOVERED_ITEM_PARENT = "recovered_item_parent";
private static final String MSG_RECOVERED_ITEM_FAILURE = "recovered_item_failure";
private static final String MSG_RECOVER_ITEM = "recover_item";
private static final String MSG_NO = "no";
private static final String MSG_YES = "yes";
private String recoverItem(FacesContext context, String outcome)
{
Node item = property.getItem();
if (item != null)
{
FacesContext fc = context;
try
{
String msg;
FacesMessage errorfacesMsg = null;
// restore the node - the user may have requested a restore to a
// different parent
RestoreNodeReport report;
if (property.getDestination() == null)
{
report = property.getNodeArchiveService().restoreArchivedNode(item.getNodeRef());
}
else
{
report = property.getNodeArchiveService().restoreArchivedNode(item.getNodeRef(), property.getDestination(), null, null);
}
switch (report.getStatus())
{
case SUCCESS:
msg = MessageFormat.format(Application.getMessage(fc, MSG_RECOVERED_ITEM_SUCCESS), item.getName());
FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg);
fc.addMessage(RICHLIST_MSG_ID, facesMsg);
break;
case FAILURE_INVALID_PARENT:
msg = MessageFormat.format(Application.getMessage(fc, MSG_RECOVERED_ITEM_PARENT), item.getName());
errorfacesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, msg);
break;
case FAILURE_PERMISSION:
msg = MessageFormat.format(Application.getMessage(fc, MSG_RECOVERED_ITEM_PERMISSION), item.getName());
errorfacesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, msg);
break;
case FAILURE_INTEGRITY:
msg = MessageFormat.format(Application.getMessage(fc, MSG_RECOVERED_ITEM_INTEGRITY), item.getName());
errorfacesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, msg);
break;
default:
String reason = report.getCause().getMessage();
msg = MessageFormat.format(Application.getMessage(fc, MSG_RECOVERED_ITEM_FAILURE), item.getName(), reason);
errorfacesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, msg);
break;
}
// report the failure if one occured we stay on the current
// screen
if (errorfacesMsg != null)
{
fc.addMessage(null, errorfacesMsg);
}
}
catch (Throwable err)
{
// most exceptions will be caught and returned as
// RestoreNodeReport objects by the service
String reason = err.getMessage();
String msg = MessageFormat.format(Application.getMessage(fc, MSG_RECOVERED_ITEM_FAILURE), item.getName(), reason);
FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, msg);
fc.addMessage(null, facesMsg);
}
}
return "dialog:goToTrashList";
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return recoverItem(context, outcome);
}
@Override
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_RECOVER_ITEM) + " '" + property.getItem().getName() + "'";
}
@Override
public String getCancelButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_NO);
}
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_YES);
}
}

View File

@@ -0,0 +1,107 @@
/*
* 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;
import java.util.ArrayList;
import java.util.List;
import javax.faces.context.FacesContext;
import org.alfresco.repo.node.archive.RestoreNodeReport;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Node;
public class TrashcanRecoverListedItemsDialog extends TrashcanDialog
{
private static final String OUTCOME_RECOVERY_REPORT = "dialog:recoveryReport";
private static final String MSG_NO = "no";
private static final String MSG_YES = "yes";
private String recoverListedItems(FacesContext context, String outcome)
{
if (property.isInProgress())
return null;
property.setInProgress(true);
try
{
// restore the nodes - the user may have requested a restore to a
// different parent
List<NodeRef> nodeRefs = new ArrayList<NodeRef>(property.getListedItems().size());
for (Node node : property.getListedItems())
{
nodeRefs.add(node.getNodeRef());
}
List<RestoreNodeReport> reports;
if (property.getDestination() == null)
{
reports = property.getNodeArchiveService().restoreArchivedNodes(nodeRefs);
}
else
{
reports = property.getNodeArchiveService().restoreArchivedNodes(nodeRefs, property.getDestination(), null, null);
}
saveReportDetail(reports);
}
finally
{
property.setInProgress(false);
}
return OUTCOME_RECOVERY_REPORT;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return recoverListedItems(context, outcome);
}
@Override
public String getCancelButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_NO);
}
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_YES);
}
}

View File

@@ -0,0 +1,54 @@
/*
* 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;
import javax.faces.context.FacesContext;
import org.alfresco.web.app.Application;
public class TrashcanRecoveryReportDialog extends TrashcanDialog
{
private final static String MSG_CLOSE = "close";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return outcome;
}
@Override
public String getCancelButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_CLOSE);
}
@Override
protected String getDefaultCancelOutcome()
{
return "dialog:goToTrashList";
}
}

View File

@@ -0,0 +1,251 @@
/*
* 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.groups;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;
import javax.faces.model.SelectItem;
import javax.transaction.UserTransaction;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.GroupsDialog;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.SortableSelectItem;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.UIGenericPicker;
/**
* @author YanO
*/
/**
* @author Administrator
*/
public class AddUsersDialog extends GroupsDialog
{
private static final String BUTTON_FINISH = "finish_button";
/** selected users to be added to a group */
private List<UserAuthorityDetails> usersForGroup;
/** datamodel for table of users added to group */
private DataModel usersDataModel = null;
@Override
public void init(Map<String, String> parameters)
{
super.init(parameters);
usersForGroup = new ArrayList<UserAuthorityDetails>();
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
try
{
// add each selected user to the current group in turn
for (UserAuthorityDetails wrapper : this.usersForGroup)
{
properties.getAuthService().addAuthority(properties.getActionGroup(), wrapper.getAuthority());
}
}
catch (Throwable err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
outcome = null;
}
setActionGroup(null);
return outcome;
}
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
/**
* Query callback method executed by the Generic Picker component. This method is part of the contract to the Generic Picker, it is up to the backing bean to execute whatever
* query is appropriate and return the results.
*
* @param filterIndex Index of the filter drop-down selection
* @param contains Text from the contains textbox
* @return An array of SelectItem objects containing the results to display in the picker.
*/
public SelectItem[] pickerCallback(int filterIndex, final String contains)
{
final FacesContext context = FacesContext.getCurrentInstance();
UserTransaction tx = null;
try
{
RetryingTransactionHelper txHelper = Repository.getRetryingTransactionHelper(context);// getUserTransaction(context);
return txHelper.doInTransaction(new RetryingTransactionCallback<SelectItem[]>()
{
public SelectItem[] execute() throws Exception
{
SelectItem[] items;
// build xpath to match available User/Person objects
ServiceRegistry services = Repository.getServiceRegistry(context);
NodeRef peopleRef = properties.getPersonService().getPeopleContainer();
String xpath = "*[like(@" + NamespaceService.CONTENT_MODEL_PREFIX + ":" + "firstName, '%" + contains + "%', false)" + " or " + "like(@"
+ NamespaceService.CONTENT_MODEL_PREFIX + ":" + "lastName, '%" + contains + "%', false)]";
List<NodeRef> nodes = services.getSearchService().selectNodes(peopleRef, xpath, null, services.getNamespaceService(), false);
ArrayList<SelectItem> itemList = new ArrayList<SelectItem>(nodes.size());
for (NodeRef personRef : nodes)
{
String username = (String) nodeService.getProperty(personRef, ContentModel.PROP_USERNAME);
if (PermissionService.GUEST_AUTHORITY.equals(username) == false)
{
String firstName = (String) nodeService.getProperty(personRef, ContentModel.PROP_FIRSTNAME);
String lastName = (String) nodeService.getProperty(personRef, ContentModel.PROP_LASTNAME);
SelectItem item = new SortableSelectItem(username, firstName + " " + lastName, lastName);
itemList.add(item);
}
}
items = new SelectItem[itemList.size()];
itemList.toArray(items);
return items;
}
});
}
catch (Exception err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
try
{
if (tx != null)
{
tx.rollback();
}
}
catch (Exception tex)
{
}
return new SelectItem[0];
}
}
/**
* Add the selected User to the list for adding to a Group
*/
public void addSelectedUsers(ActionEvent event)
{
UIGenericPicker picker = (UIGenericPicker) event.getComponent().findComponent("picker");
String[] results = picker.getSelectedResults();
if (results != null)
{
for (int i = 0; i < results.length; i++)
{
String authority = results[i];
// check for same authority so not added twice
boolean foundExisting = false;
for (int n = 0; n < this.usersForGroup.size(); n++)
{
UserAuthorityDetails wrapper = this.usersForGroup.get(n);
if (authority.equals(wrapper.getAuthority()))
{
foundExisting = true;
break;
}
}
if (foundExisting == false)
{
StringBuilder label = new StringBuilder(48);
// build a display label showing the user person name
if (properties.getPersonService().personExists(authority) == true)
{
// found a Person with a User authority
NodeRef ref = properties.getPersonService().getPerson(authority);
String firstName = (String) this.nodeService.getProperty(ref, ContentModel.PROP_FIRSTNAME);
String lastName = (String) this.nodeService.getProperty(ref, ContentModel.PROP_LASTNAME);
// build a sensible label for display
label.append(firstName).append(' ').append(lastName);
// add a wrapper object with the details to the results list for display
UserAuthorityDetails userDetails = new UserAuthorityDetails(label.toString(), authority);
this.usersForGroup.add(userDetails);
}
}
}
}
}
/**
* Action handler called when the Remove button is pressed to remove a user from the results list
*/
public void removeUserSelection(ActionEvent event)
{
UserAuthorityDetails wrapper = (UserAuthorityDetails) this.usersDataModel.getRowData();
if (wrapper != null)
{
this.usersForGroup.remove(wrapper);
}
}
/**
* @return Returns the usersDataModel.
*/
public DataModel getUsersDataModel()
{
if (this.usersDataModel == null)
{
this.usersDataModel = new ListDataModel();
}
this.usersDataModel.setWrappedData(this.usersForGroup);
return this.usersDataModel;
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), BUTTON_FINISH);
}
}

View File

@@ -0,0 +1,102 @@
/*
* 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.groups;
import java.text.MessageFormat;
import java.util.Map;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.ValidatorException;
import org.alfresco.service.cmr.security.AuthorityType;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.GroupsDialog;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
public class CreateGroupDialog extends GroupsDialog
{
private static final String MSG_ERR_EXISTS = "groups_err_exists";
private static final String BUTTON_NEW_GROUP = "new_group";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
try
{
// create new Group using Authentication Service
String groupName = properties.getAuthService().getName(AuthorityType.GROUP, properties.getName());
if (properties.getAuthService().authorityExists(groupName) == false)
{
properties.getAuthService().createAuthority(AuthorityType.GROUP, properties.getActionGroup(), properties.getName());
}
else
{
Utils.addErrorMessage(Application.getMessage(context, MSG_ERR_EXISTS));
outcome = null;
}
}
catch (Throwable err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(context, Repository.ERROR_GENERIC), err.getMessage()), err);
outcome = null;
}
if (outcome == null)
{
isFinished = false;
}
return outcome;
}
@Override
public void init(Map<String, String> parameters)
{
super.init(parameters);
properties.setName("");
}
public void validateGroupName(FacesContext context, UIComponent component, Object value) throws ValidatorException
{
String name = (String) value;
if (name.indexOf('\'') != -1 || name.indexOf('"') != -1 || name.indexOf('\\') != -1)
{
String err = MessageFormat.format(Application.getMessage(context, "groups_err_group_name"), new Object[] { "', \", \\" });
throw new ValidatorException(new FacesMessage(err));
}
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), BUTTON_NEW_GROUP);
}
}

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.bean.groups;
import java.text.MessageFormat;
import javax.faces.context.FacesContext;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.GroupsDialog;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
public class DeleteGroupDialog extends GroupsDialog
{
private static final String BUTTON_DELETE = "delete";
private static final String MSG_DELETE_GROUP = "delete_group";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
try
{
// delete group using the Authentication Service
properties.getAuthService().deleteAuthority(properties.getActionGroup());
removeFromBreadcrumb(properties.getActionGroup());
// clear action context
setActionGroup(null);
}
catch (Throwable err)
{
// rollback the transaction
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
outcome = null;
}
return outcome;
}
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), BUTTON_DELETE);
}
@Override
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_DELETE_GROUP) + " '" + properties.getActionGroupName() + "'";
}
}

View File

@@ -0,0 +1,199 @@
/*
* 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.groups;
import java.util.List;
import org.alfresco.service.cmr.security.AuthorityService;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.web.ui.common.component.IBreadcrumbHandler;
import org.alfresco.web.ui.common.component.data.UIRichList;
public class GroupsProperties
{
private static final String FILTER_CHILDREN = "children";
/** The AuthorityService to be used by the bean */
private AuthorityService authService;
/** personService bean reference */
private PersonService personService;
/** Component references */
private UIRichList groupsRichList;
private UIRichList usersRichList;
/** Currently visible Group Authority */
private String group = null;
private String groupName = null;
/** Action group authority */
private String actionGroup = null;
private String actionGroupName = null;
private int actionGroupItems = 0;
/** Dialog properties */
private String name = null;
/** RichList view mode */
private String viewMode = "icons";
/** List filter mode */
private String filterMode = FILTER_CHILDREN;
/** Groups path breadcrumb location */
private List<IBreadcrumbHandler> location = null;
public AuthorityService getAuthService()
{
return authService;
}
public void setAuthService(AuthorityService authService)
{
this.authService = authService;
}
public PersonService getPersonService()
{
return personService;
}
public void setPersonService(PersonService personService)
{
this.personService = personService;
}
public UIRichList getGroupsRichList()
{
return groupsRichList;
}
public void setGroupsRichList(UIRichList groupsRichList)
{
this.groupsRichList = groupsRichList;
}
public UIRichList getUsersRichList()
{
return usersRichList;
}
public void setUsersRichList(UIRichList usersRichList)
{
this.usersRichList = usersRichList;
}
public String getGroup()
{
return group;
}
public void setGroup(String group)
{
this.group = group;
}
public String getGroupName()
{
return groupName;
}
public void setGroupName(String groupName)
{
this.groupName = groupName;
}
public String getActionGroup()
{
return actionGroup;
}
public void setActionGroup(String actionGroup)
{
this.actionGroup = actionGroup;
}
public String getActionGroupName()
{
return actionGroupName;
}
public void setActionGroupName(String actionGroupName)
{
this.actionGroupName = actionGroupName;
}
public int getActionGroupItems()
{
return actionGroupItems;
}
public void setActionGroupItems(int actionGroupItems)
{
this.actionGroupItems = actionGroupItems;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public String getViewMode()
{
return viewMode;
}
public void setViewMode(String viewMode)
{
this.viewMode = viewMode;
}
public String getFilterMode()
{
return filterMode;
}
public void setFilterMode(String filterMode)
{
this.filterMode = filterMode;
}
public List<IBreadcrumbHandler> getLocation()
{
return location;
}
public void setLocation(List<IBreadcrumbHandler> location)
{
this.location = location;
}
}

View File

@@ -0,0 +1,64 @@
/*
* 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.ml;
import java.util.List;
import javax.faces.context.FacesContext;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.DocumentDetailsBean;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.config.DialogsConfigElement.DialogButtonConfig;
public class MultilingualManageDialog extends BaseDialogBean
{
private final String MSG_MANAGE_DETAILS_FOR="manage_multilingual_details_for";
//TODO: load the bean
private DocumentDetailsBean docDetails;
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
// TODO Auto-generated method stub
return null;
}
@Override
public String getContainerTitle()
{
// TODO Auto-generated method stub
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_MANAGE_DETAILS_FOR) + " '" + docDetails.getName() + "'";
}
@Override
public List<DialogButtonConfig> getAdditionalButtons()
{
// TODO Auto-generated method stub
return super.getAdditionalButtons();
}
}

View File

@@ -72,7 +72,7 @@ public class CreateRuleWizard extends BaseActionWizard
protected static final String PROP_CONDITION_SUMMARY = "conditionSummary"; protected static final String PROP_CONDITION_SUMMARY = "conditionSummary";
protected RuleService ruleService; protected RuleService ruleService;
protected RulesBean rulesBean; protected RulesDialog rulesDialog;
private List<SelectItem> modelTypes; private List<SelectItem> modelTypes;
private List<SelectItem> mimeTypes; private List<SelectItem> mimeTypes;
@@ -683,13 +683,13 @@ public class CreateRuleWizard extends BaseActionWizard
} }
/** /**
* Sets the RulesBean instance to be used by the wizard in edit mode * Sets the rulesDialog instance to be used by the wizard in edit mode
* *
* @param rulesBean The RulesBean * @param rulesDialog The rulesDialog
*/ */
public void setRulesBean(RulesBean rulesBean) public void setRulesDialog(RulesDialog RulesDialog)
{ {
this.rulesBean = rulesBean; this.rulesDialog = RulesDialog;
} }

View File

@@ -63,7 +63,7 @@ public class EditRuleWizard extends CreateRuleWizard
super.init(parameters); super.init(parameters);
// get hold of the current rule details // get hold of the current rule details
Rule rule = this.rulesBean.getCurrentRule(); Rule rule = this.rulesDialog.getCurrentRule();
if (rule == null) if (rule == null)
{ {
@@ -163,7 +163,7 @@ public class EditRuleWizard extends CreateRuleWizard
Node currentSpace = browseBean.getActionSpace(); Node currentSpace = browseBean.getActionSpace();
// get the existing rule // get the existing rule
Rule rule = this.rulesBean.getCurrentRule(); Rule rule = this.rulesDialog.getCurrentRule();
// Get the composite action // Get the composite action
CompositeAction compositeAction = getCompositeAction(rule); CompositeAction compositeAction = getCompositeAction(rule);

View File

@@ -48,6 +48,7 @@ import org.alfresco.web.app.Application;
import org.alfresco.web.app.context.IContextListener; import org.alfresco.web.app.context.IContextListener;
import org.alfresco.web.app.context.UIContextService; import org.alfresco.web.app.context.UIContextService;
import org.alfresco.web.bean.BrowseBean; import org.alfresco.web.bean.BrowseBean;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils; import org.alfresco.web.ui.common.Utils;
@@ -62,7 +63,7 @@ import org.apache.commons.logging.LogFactory;
* *
* @author gavinc * @author gavinc
*/ */
public class RulesBean implements IContextListener public class RulesDialog extends BaseDialogBean implements IContextListener
{ {
private static final String MSG_ERROR_DELETE_RULE = "error_delete_rule"; private static final String MSG_ERROR_DELETE_RULE = "error_delete_rule";
private static final String MSG_REAPPLY_RULES_SUCCESS = "reapply_rules_success"; private static final String MSG_REAPPLY_RULES_SUCCESS = "reapply_rules_success";
@@ -71,7 +72,11 @@ public class RulesBean implements IContextListener
private static final String LOCAL = "local"; private static final String LOCAL = "local";
private static final String INHERITED = "inherited"; private static final String INHERITED = "inherited";
private static Log logger = LogFactory.getLog(RulesBean.class); private static final String MSG_DELETE_RULE = "delete_rule";
private static final String MSG_YES = "yes";
private static final String MSG_NO = "no";
private static Log logger = LogFactory.getLog(RulesDialog.class);
private String viewMode = INHERITED; private String viewMode = INHERITED;
protected BrowseBean browseBean; protected BrowseBean browseBean;
@@ -82,11 +87,10 @@ public class RulesBean implements IContextListener
private ActionService actionService; private ActionService actionService;
private NodeService nodeService; private NodeService nodeService;
/** /**
* Default constructor * Default constructor
*/ */
public RulesBean() public RulesDialog()
{ {
UIContextService.getInstance(FacesContext.getCurrentInstance()).registerBean(this); UIContextService.getInstance(FacesContext.getCurrentInstance()).registerBean(this);
} }
@@ -157,7 +161,6 @@ public class RulesBean implements IContextListener
logger.debug("Rule clicked, it's id is: " + id); logger.debug("Rule clicked, it's id is: " + id);
this.currentRule = this.ruleService.getRule(new NodeRef(id)); this.currentRule = this.ruleService.getRule(new NodeRef(id));
//getSpace().getNodeRef(), id);
// refresh list // refresh list
contextUpdated(); contextUpdated();
@@ -186,7 +189,7 @@ public class RulesBean implements IContextListener
boolean executeInherited = true; boolean executeInherited = true;
if (LOCAL.equals(this.getViewMode()) == true) if (LOCAL.equals(this.getViewMode()) == true)
{ {
executeInherited = false; executeInherited = false;
} }
action.setParameterValue(ExecuteAllRulesActionExecuter.PARAM_EXECUTE_INHERITED_RULES, executeInherited); action.setParameterValue(ExecuteAllRulesActionExecuter.PARAM_EXECUTE_INHERITED_RULES, executeInherited);
@@ -218,19 +221,19 @@ public class RulesBean implements IContextListener
*/ */
public String getIgnoreInheritedRulesLabelId() public String getIgnoreInheritedRulesLabelId()
{ {
FacesContext fc = FacesContext.getCurrentInstance(); FacesContext fc = FacesContext.getCurrentInstance();
String result = Application.getMessage(fc, MSG_IGNORE_INHERTIED_RULES); String result = Application.getMessage(fc, MSG_IGNORE_INHERTIED_RULES);
if (this.nodeService.hasAspect(this.getSpace().getNodeRef(), RuleModel.ASPECT_IGNORE_INHERITED_RULES) == true) if (this.nodeService.hasAspect(this.getSpace().getNodeRef(), RuleModel.ASPECT_IGNORE_INHERITED_RULES) == true)
{ {
result = Application.getMessage(fc, MSG_INCLUDE_INHERITED_RULES); result = Application.getMessage(fc, MSG_INCLUDE_INHERITED_RULES);
} }
return result; return result;
} }
public boolean getIgnoreInheritedRules() public boolean getIgnoreInheritedRules()
{ {
return this.nodeService.hasAspect(this.getSpace().getNodeRef(), RuleModel.ASPECT_IGNORE_INHERITED_RULES); return this.nodeService.hasAspect(this.getSpace().getNodeRef(), RuleModel.ASPECT_IGNORE_INHERITED_RULES);
} }
/** /**
@@ -240,21 +243,21 @@ public class RulesBean implements IContextListener
*/ */
public void ignoreInheritedRules(ActionEvent event) public void ignoreInheritedRules(ActionEvent event)
{ {
NodeRef nodeRef = this.getSpace().getNodeRef(); NodeRef nodeRef = this.getSpace().getNodeRef();
if (this.nodeService.hasAspect(nodeRef, RuleModel.ASPECT_IGNORE_INHERITED_RULES) == true) if (this.nodeService.hasAspect(nodeRef, RuleModel.ASPECT_IGNORE_INHERITED_RULES) == true)
{ {
this.nodeService.removeAspect(nodeRef, RuleModel.ASPECT_IGNORE_INHERITED_RULES); this.nodeService.removeAspect(nodeRef, RuleModel.ASPECT_IGNORE_INHERITED_RULES);
} }
else else
{ {
this.nodeService.addAspect(nodeRef, RuleModel.ASPECT_IGNORE_INHERITED_RULES, null); this.nodeService.addAspect(nodeRef, RuleModel.ASPECT_IGNORE_INHERITED_RULES, null);
} }
// force the list to be re-queried when the page is refreshed // force the list to be re-queried when the page is refreshed
if (this.richList != null) if (this.richList != null)
{ {
this.richList.setValue(null); this.richList.setValue(null);
} }
} }
/** /**
@@ -267,15 +270,9 @@ public class RulesBean implements IContextListener
return this.currentRule; return this.currentRule;
} }
/** @Override
* Handler called upon the completion of the Delete Rule page protected String finishImpl(FacesContext context, String outcome) throws Exception
*
* @return outcome
*/
public String deleteOK()
{ {
String outcome = null;
if (this.currentRule != null) if (this.currentRule != null)
{ {
try try
@@ -288,9 +285,6 @@ public class RulesBean implements IContextListener
// clear the current rule // clear the current rule
this.currentRule = null; this.currentRule = null;
// setting the outcome will show the browse view again
outcome = "manageRules";
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
logger.debug("Deleted rule '" + ruleTitle + "'"); logger.debug("Deleted rule '" + ruleTitle + "'");
} }
@@ -308,6 +302,30 @@ public class RulesBean implements IContextListener
return outcome; return outcome;
} }
@Override
public String getContainerTitle()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_DELETE_RULE) + " '" + currentRule.getTitle() + "'";
}
@Override
public String getCancelButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_NO);
}
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
@Override
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_YES);
}
/** /**
* Change the current view mode based on user selection * Change the current view mode based on user selection
* *
@@ -378,7 +396,7 @@ public class RulesBean implements IContextListener
*/ */
public void setNodeService(NodeService nodeService) public void setNodeService(NodeService nodeService)
{ {
this.nodeService = nodeService; this.nodeService = nodeService;
} }

View File

@@ -0,0 +1,91 @@
/*
* 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.users;
import java.text.MessageFormat;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
public class ChangeMyPasswordDialog extends UsersDialog
{
private static final String MSG_FINISH_BUTTON = "finish_button";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
String result = changeMyPasswordOK(outcome, context);
if (result == null)
{
isFinished = false;
}
return result;
}
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_FINISH_BUTTON);
}
public boolean getFinishButtonDisabled()
{
return false;
}
/**
* Action handler called for OK button press on Change My Password screen For this screen the user is required to enter their old password - effectively login.
*/
public String changeMyPasswordOK(String newOutcome, FacesContext newContext)
{
String outcome = newOutcome;
if (properties.getPassword() != null && properties.getConfirm() != null && properties.getPassword().equals(properties.getConfirm()))
{
try
{
String userName = (String) properties.getPerson().getProperties().get(ContentModel.PROP_USERNAME);
properties.getAuthenticationService().updateAuthentication(userName, properties.getOldPassword().toCharArray(), properties.getPassword().toCharArray());
}
catch (Exception e)
{
outcome = null;
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(newContext, Repository.ERROR_GENERIC), e.getMessage()), e);
}
}
else
{
outcome = null;
Utils.addErrorMessage(Application.getMessage(newContext, ERROR_PASSWORD_MATCH));
}
return outcome;
}
}

View File

@@ -0,0 +1,90 @@
/*
* 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.users;
import java.text.MessageFormat;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
public class ChangePasswordDialog extends UsersDialog
{
private static final String MSG_FINISH_BUTTON = "finish_button";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
String result = changePasswordOK(outcome, context);
if (result == null)
{
isFinished = false;
}
return result;
}
public String getFinishButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_FINISH_BUTTON);
}
public boolean getFinishButtonDisabled()
{
return false;
}
/**
* Action handler called for OK button press on Change Password screen
*/
public String changePasswordOK(String newOutcome, FacesContext newContext)
{
String outcome = newOutcome;
if (properties.getPassword() != null && properties.getConfirm() != null && properties.getPassword().equals(properties.getConfirm()))
{
try
{
String userName = (String) properties.getPerson().getProperties().get(ContentModel.PROP_USERNAME);
properties.getAuthenticationService().setAuthentication(userName, properties.getPassword().toCharArray());
}
catch (Exception e)
{
outcome = null;
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(newContext, Repository.ERROR_GENERIC), e.getMessage()), e);
}
}
else
{
outcome = null;
Utils.addErrorMessage(Application.getMessage(newContext, ERROR_PASSWORD_MATCH));
}
return outcome;
}
}

View File

@@ -0,0 +1,596 @@
/*
* 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.users;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.validator.ValidatorException;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.AuthenticationService;
import org.alfresco.service.cmr.security.OwnableService;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.context.UIContextService;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.spaces.CreateSpaceWizard;
import org.alfresco.web.bean.wizard.BaseWizardBean;
import org.alfresco.web.config.ClientConfigElement;
import org.alfresco.web.ui.common.Utils;
import org.apache.log4j.Logger;
/**
* @author Kevin Roast
*/
public class CreateUserWizard extends BaseWizardBean
{
private static Logger logger = Logger.getLogger(CreateUserWizard.class);
protected static final String ERROR = "error_person";
/** form variables */
protected String firstName = null;
protected String lastName = null;
protected String userName = null;
protected String password = null;
protected String confirm = null;
protected String email = null;
protected String companyId = null;
protected String homeSpaceName = "";
protected NodeRef homeSpaceLocation = null;
/** AuthenticationService bean reference */
private AuthenticationService authenticationService;
/** PersonService bean reference */
private PersonService personService;
/** PermissionService bean reference */
private PermissionService permissionService;
/** OwnableService bean reference */
private OwnableService ownableService;
/** ref to the company home space folder */
private NodeRef companyHomeSpaceRef = null;
/** ref to the default home location */
private NodeRef defaultHomeSpaceRef;
/**
* @param authenticationService The AuthenticationService to set.
*/
public void setAuthenticationService(AuthenticationService authenticationService)
{
this.authenticationService = authenticationService;
}
/**
* @param personService The person service.
*/
public void setPersonService(PersonService personService)
{
this.personService = personService;
}
/**
* @param permissionService The PermissionService to set.
*/
public void setPermissionService(PermissionService permissionService)
{
this.permissionService = permissionService;
}
/**
* @param ownableService The ownableService to set.
*/
public void setOwnableService(OwnableService ownableService)
{
this.ownableService = ownableService;
}
/**
* Initialises the wizard
*/
@Override
public void init(Map<String, String> arg0)
{
super.init(arg0);
// reset all variables
this.firstName = "";
this.lastName = "";
this.userName = "";
this.password = "";
this.confirm = "";
this.email = "";
this.companyId = "";
this.homeSpaceName = "";
this.homeSpaceLocation = getDefaultHomeSpace();
}
/**
* @return Returns the summary data for the wizard.
*/
public String getSummary()
{
String homeSpaceLabel = this.homeSpaceName;
if (this.homeSpaceName.length() == 0 && this.homeSpaceLocation != null)
{
homeSpaceLabel = Repository.getNameForNode(this.nodeService, this.homeSpaceLocation);
}
ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance());
return buildSummary(new String[] { bundle.getString("name"), bundle.getString("username"), bundle.getString("password"), bundle.getString("homespace") }, new String[] {
this.firstName + " " + this.lastName, this.userName, "********", homeSpaceLabel });
}
/**
* Init the users screen
*/
public void setupUsers(ActionEvent event)
{
invalidateUserList();
}
/**
* @return Returns the companyId.
*/
public String getCompanyId()
{
return this.companyId;
}
/**
* @param companyId The companyId to set.
*/
public void setCompanyId(String companyId)
{
this.companyId = companyId;
}
/**
* @return Returns the email.
*/
public String getEmail()
{
return this.email;
}
/**
* @param email The email to set.
*/
public void setEmail(String email)
{
this.email = email;
}
/**
* @return Returns the firstName.
*/
public String getFirstName()
{
return this.firstName;
}
/**
* @param firstName The firstName to set.
*/
public void setFirstName(String firstName)
{
this.firstName = firstName;
}
/**
* @return Returns the homeSpaceLocation.
*/
public NodeRef getHomeSpaceLocation()
{
return this.homeSpaceLocation;
}
/**
* @param homeSpaceLocation The homeSpaceLocation to set.
*/
public void setHomeSpaceLocation(NodeRef homeSpaceLocation)
{
this.homeSpaceLocation = homeSpaceLocation;
}
/**
* @return Returns the homeSpaceName.
*/
public String getHomeSpaceName()
{
return this.homeSpaceName;
}
/**
* @param homeSpaceName The homeSpaceName to set.
*/
public void setHomeSpaceName(String homeSpaceName)
{
this.homeSpaceName = homeSpaceName;
}
/**
* @return Returns the lastName.
*/
public String getLastName()
{
return this.lastName;
}
/**
* @param lastName The lastName to set.
*/
public void setLastName(String lastName)
{
this.lastName = lastName;
}
/**
* @return Returns the userName.
*/
public String getUserName()
{
return this.userName;
}
/**
* @param userName The userName to set.
*/
public void setUserName(String userName)
{
this.userName = userName;
}
/**
* @return Returns the password.
*/
public String getPassword()
{
return this.password;
}
/**
* @param password The password to set.
*/
public void setPassword(String password)
{
this.password = password;
}
/**
* @return Returns the confirm password.
*/
public String getConfirm()
{
return this.confirm;
}
/**
* @param confirm The confirm password to set.
*/
public void setConfirm(String confirm)
{
this.confirm = confirm;
}
// ------------------------------------------------------------------------------
// Validator methods
/**
* Validate password field data is acceptable
*/
public void validatePassword(FacesContext context, UIComponent component, Object value) throws ValidatorException
{
String pass = (String) value;
if (pass.length() < 5 || pass.length() > 12)
{
String err = "Password must be between 5 and 12 characters in length.";
throw new ValidatorException(new FacesMessage(err));
}
for (int i = 0; i < pass.length(); i++)
{
if (Character.isLetterOrDigit(pass.charAt(i)) == false)
{
String err = "Password can only contain characters or digits.";
throw new ValidatorException(new FacesMessage(err));
}
}
}
/**
* Validate Username field data is acceptable
*/
public void validateUsername(FacesContext context, UIComponent component, Object value) throws ValidatorException
{
String pass = (String) value;
if (pass.length() < 5 || pass.length() > 12)
{
String err = "Username must be between 5 and 12 characters in length.";
throw new ValidatorException(new FacesMessage(err));
}
for (int i = 0; i < pass.length(); i++)
{
if (Character.isLetterOrDigit(pass.charAt(i)) == false)
{
String err = "Username can only contain characters or digits.";
throw new ValidatorException(new FacesMessage(err));
}
}
}
// ------------------------------------------------------------------------------
// Helper methods
/**
* Helper to return the company home space
*
* @return company home space NodeRef
*/
protected NodeRef getCompanyHomeSpace()
{
if (this.companyHomeSpaceRef == null)
{
String companyXPath = Application.getRootPath(FacesContext.getCurrentInstance());
NodeRef rootNodeRef = this.nodeService.getRootNode(Repository.getStoreRef());
List<NodeRef> nodes = this.searchService.selectNodes(rootNodeRef, companyXPath, null, this.namespaceService, false);
if (nodes.size() == 0)
{
throw new IllegalStateException("Unable to find company home space path: " + companyXPath);
}
this.companyHomeSpaceRef = nodes.get(0);
}
return this.companyHomeSpaceRef;
}
protected NodeRef getDefaultHomeSpace()
{
if ((this.defaultHomeSpaceRef == null) || !nodeService.exists(this.defaultHomeSpaceRef))
{
String defaultHomeSpacePath = Application.getClientConfig(FacesContext.getCurrentInstance()).getDefaultHomeSpacePath();
NodeRef rootNodeRef = this.nodeService.getRootNode(Repository.getStoreRef());
List<NodeRef> nodes = this.searchService.selectNodes(rootNodeRef, defaultHomeSpacePath, null, this.namespaceService, false);
if (nodes.size() == 0)
{
return getCompanyHomeSpace();
}
this.defaultHomeSpaceRef = nodes.get(0);
}
return this.defaultHomeSpaceRef;
}
/**
* Create the specified home space if it does not exist, and return the ID
*
* @param locationId Parent location
* @param spaceName Home space to create, can be null to simply return the parent
* @param error True to throw an error if the space already exists, else ignore and return
* @return ID of the home space
*/
protected NodeRef createHomeSpace(String locationId, String spaceName, boolean error)
{
NodeRef homeSpaceNodeRef = null;
if (spaceName != null && spaceName.length() != 0)
{
NodeRef parentRef = new NodeRef(Repository.getStoreRef(), locationId);
// check for existance of home space with same name - return immediately
// if it exists or throw an exception an give user chance to enter another name
// TODO: this might be better replaced with an XPath query!
List<ChildAssociationRef> children = this.nodeService.getChildAssocs(parentRef);
for (ChildAssociationRef ref : children)
{
String childNodeName = (String) this.nodeService.getProperty(ref.getChildRef(), ContentModel.PROP_NAME);
if (spaceName.equals(childNodeName))
{
if (error)
{
throw new AlfrescoRuntimeException("A Home Space with the same name already exists.");
}
else
{
return ref.getChildRef();
}
}
}
// space does not exist already, create a new Space under it with
// the specified name
String qname = QName.createValidLocalName(spaceName);
ChildAssociationRef assocRef = this.nodeService.createNode(parentRef, ContentModel.ASSOC_CONTAINS, QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, qname),
ContentModel.TYPE_FOLDER);
NodeRef nodeRef = assocRef.getChildRef();
// set the name property on the node
this.nodeService.setProperty(nodeRef, ContentModel.PROP_NAME, spaceName);
if (logger.isDebugEnabled())
logger.debug("Created Home Space for with name: " + spaceName);
// apply the uifacets aspect - icon, title and description props
Map<QName, Serializable> uiFacetsProps = new HashMap<QName, Serializable>(3);
uiFacetsProps.put(ApplicationModel.PROP_ICON, CreateSpaceWizard.DEFAULT_SPACE_ICON_NAME);
uiFacetsProps.put(ContentModel.PROP_TITLE, spaceName);
this.nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, uiFacetsProps);
setupHomeSpacePermissions(nodeRef);
// return the ID of the created space
homeSpaceNodeRef = nodeRef;
}
return homeSpaceNodeRef;
}
/**
* Setup the default permissions for this and other users on the Home Space
*
* @param homeSpaceRef Home Space reference
*/
private void setupHomeSpacePermissions(NodeRef homeSpaceRef)
{
// Admin Authority has full permissions by default (automatic - set in the permission config)
// give full permissions to the new user
this.permissionService.setPermission(homeSpaceRef, this.userName, permissionService.getAllPermission(), true);
// by default other users will only have GUEST access to the space contents
// or whatever is configured as the default in the web-client-xml config
String permission = getDefaultPermission();
if (permission != null && permission.length() != 0)
{
this.permissionService.setPermission(homeSpaceRef, permissionService.getAllAuthorities(), permission, true);
}
// the new user is the OWNER of their own space and always has full permissions
this.ownableService.setOwner(homeSpaceRef, this.userName);
this.permissionService.setPermission(homeSpaceRef, permissionService.getOwnerAuthority(), permissionService.getAllPermission(), true);
// now detach (if we did this first we could not set any permissions!)
this.permissionService.setInheritParentPermissions(homeSpaceRef, false);
}
/**
* @return default permission string to set for other users for a new Home Space
*/
private String getDefaultPermission()
{
ClientConfigElement config = Application.getClientConfig(FacesContext.getCurrentInstance());
return config.getHomeSpacePermission();
}
private void invalidateUserList()
{
UIContextService.getInstance(FacesContext.getCurrentInstance()).notifyBeans();
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
// TODO: implement create new Person object from specified details
try
{
if (this.password.equals(this.confirm))
{
// create properties for Person type from submitted Form data
Map<QName, Serializable> props = new HashMap<QName, Serializable>(7, 1.0f);
props.put(ContentModel.PROP_USERNAME, this.userName);
props.put(ContentModel.PROP_FIRSTNAME, this.firstName);
props.put(ContentModel.PROP_LASTNAME, this.lastName);
NodeRef homeSpaceNodeRef;
if (this.homeSpaceLocation != null && this.homeSpaceName.length() != 0)
{
// create new
homeSpaceNodeRef = createHomeSpace(this.homeSpaceLocation.getId(), this.homeSpaceName, true);
}
else if (this.homeSpaceLocation != null)
{
// set to existing
homeSpaceNodeRef = homeSpaceLocation;
setupHomeSpacePermissions(homeSpaceNodeRef);
}
else
{
// default to Company Home
homeSpaceNodeRef = getCompanyHomeSpace();
}
props.put(ContentModel.PROP_HOMEFOLDER, homeSpaceNodeRef);
props.put(ContentModel.PROP_EMAIL, this.email);
props.put(ContentModel.PROP_ORGID, this.companyId);
// create the node to represent the Person
NodeRef newPerson = this.personService.createPerson(props);
// ensure the user can access their own Person object
this.permissionService.setPermission(newPerson, this.userName, permissionService.getAllPermission(), true);
if (logger.isDebugEnabled())
logger.debug("Created Person node for username: " + this.userName);
// create the ACEGI Authentication instance for the new user
this.authenticationService.createAuthentication(this.userName, this.password.toCharArray());
if (logger.isDebugEnabled())
logger.debug("Created User Authentication instance for username: " + this.userName);
}
else
{
outcome = null;
Utils.addErrorMessage(Application.getMessage(context, UsersDialog.ERROR_PASSWORD_MATCH));
}
invalidateUserList();
}
catch (Throwable e)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), ERROR), e.getMessage()), e);
outcome = null;
}
if (outcome == null) {
this.isFinished = false;
}
return outcome;
}
@Override
public boolean getFinishButtonDisabled()
{
if (this.firstName != null && this.lastName != null && this.email != null && this.firstName.length() > 0 && this.lastName.length() > 0 && this.email.length() > 0)
{
return false;
}
return true;
}
}

View File

@@ -0,0 +1,258 @@
/*
* 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.users;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.transaction.UserTransaction;
import org.alfresco.repo.security.authentication.AuthenticationException;
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.search.SearchParameters;
import org.alfresco.service.cmr.search.SearchService;
import org.alfresco.service.cmr.security.AuthenticationService;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.util.ISO9075;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.LoginBean;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.MapNode;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.UIActionLink;
import org.apache.log4j.Logger;
public class DeleteUserDialog extends BaseDialogBean {
private static Logger logger = Logger.getLogger(DeleteUserDialog.class);
private static final String ERROR_DELETE = "error_delete_user";
private static final String ERROR_USER_DELETE = "error_delete_user_object";
private static final String BUTTON_YES = "yes";
private static final String MSG_TITLE_DELETE_USER = "title_delete_user";
private static final String BUTTON_NO = "no";
private AuthenticationService authenticationService;
private List<Node> users = Collections.<Node> emptyList();
private PersonService personService;
private Node person = null;
private String searchCriteria = null;
@Override
public boolean getFinishButtonDisabled() {
return false;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception {
try {
String userName = (String) getPerson().getProperties().get("userName");
// we only delete the user auth if Alfresco is managing the authentication
Map session = context.getExternalContext().getSessionMap();
if (session.get(LoginBean.LOGIN_EXTERNAL_AUTH) == null) {
// delete the User authentication
try {
authenticationService.deleteAuthentication(userName);
} catch (AuthenticationException authErr) {
Utils.addErrorMessage(Application.getMessage(context, ERROR_USER_DELETE));
}
}
// delete the associated Person
this.personService.deletePerson(userName);
// re-do the search to refresh the list
search();
} catch (Throwable e) {
// rollback the transaction
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(context, ERROR_DELETE), e.getMessage()),
e);
}
return outcome;
}
public String search() {
if (this.searchCriteria == null || this.searchCriteria.length() == 0) {
this.users = Collections.<Node> emptyList();
} else {
FacesContext context = FacesContext.getCurrentInstance();
UserTransaction tx = null;
try {
tx = Repository.getUserTransaction(context, true);
tx.begin();
// define the query to find people by their first or last name
String search = ISO9075.encode(this.searchCriteria);
String query = "( TYPE:\"{http://www.alfresco.org/model/content/1.0}person\") AND "
+ "((@\\{http\\://www.alfresco.org/model/content/1.0\\}firstName:" + search
+ "*) OR (@\\{http\\://www.alfresco.org/model/content/1.0\\}lastName:" + search
+ "*) OR (@\\{http\\://www.alfresco.org/model/content/1.0\\}userName:" + search + "*)))";
if (logger.isDebugEnabled())
logger.debug("Query: " + query);
// define the search parameters
SearchParameters params = new SearchParameters();
params.setLanguage(SearchService.LANGUAGE_LUCENE);
params.addStore(Repository.getStoreRef());
params.setQuery(query);
List<NodeRef> people = this.searchService.query(params).getNodeRefs();
if (logger.isDebugEnabled())
logger.debug("Found " + people.size() + " users");
this.users = new ArrayList<Node>(people.size());
for (NodeRef nodeRef : people) {
// create our Node representation
MapNode node = new MapNode(nodeRef);
// set data binding properties
// this will also force initialisation of the props now during the UserTransaction
// it is much better for performance to do this now rather than during page bind
Map<String, Object> props = node.getProperties();
props.put("fullName", ((String) props.get("firstName")) + ' ' + ((String) props.get("lastName")));
NodeRef homeFolderNodeRef = (NodeRef) props.get("homeFolder");
if (homeFolderNodeRef != null) {
props.put("homeSpace", homeFolderNodeRef);
}
this.users.add(node);
}
// commit the transaction
tx.commit();
} catch (InvalidNodeRefException refErr) {
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(context, Repository.ERROR_NODEREF),
new Object[] { "root" }));
this.users = Collections.<Node> emptyList();
try {
if (tx != null) {
tx.rollback();
}
} catch (Exception tex) {
}
} catch (Exception err) {
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(context, Repository.ERROR_GENERIC),
err.getMessage()), err);
this.users = Collections.<Node> emptyList();
try {
if (tx != null) {
tx.rollback();
}
} catch (Exception tex) {
}
}
}
// return null to stay on the same page
return null;
}
public void setupUserAction(ActionEvent event) {
UIActionLink link = (UIActionLink) event.getComponent();
Map<String, String> params = link.getParameterMap();
String id = params.get("id");
if (id != null && id.length() != 0) {
if (logger.isDebugEnabled())
logger.debug("Setup for action, setting current Person to: " + id);
try {
// create the node ref, then our node representation
NodeRef ref = new NodeRef(Repository.getStoreRef(), id);
Node node = new Node(ref);
// remember the Person node
setPerson(node);
} catch (InvalidNodeRefException refErr) {
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(),
Repository.ERROR_NODEREF), new Object[] { id }));
}
} else {
setPerson(null);
}
}
public AuthenticationService getAuthenticationService() {
return authenticationService;
}
public void setAuthenticationService(AuthenticationService authenticationService) {
this.authenticationService = authenticationService;
}
public PersonService getPersonService() {
return personService;
}
public void setPersonService(PersonService personService) {
this.personService = personService;
}
public Node getPerson() {
return person;
}
public void setPerson(Node person) {
this.person = person;
}
@Override
public String getCancelButtonLabel() {
return Application.getMessage(FacesContext.getCurrentInstance(), BUTTON_NO);
}
@Override
public String getFinishButtonLabel() {
return Application.getMessage(FacesContext.getCurrentInstance(), BUTTON_YES);
}
@Override
public String getContainerTitle() {
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_TITLE_DELETE_USER) + " '"
+ getPerson().getProperties().get("userName") + "'";
}
}

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"
*/
package org.alfresco.web.bean.users;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.model.DataModel;
import org.alfresco.web.bean.dialog.BaseDialogBean;
public class EditContentUserRolesDialog extends BaseDialogBean
{
ContentUsersBean contentUsersBean;
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
public ContentUsersBean getContentUsersBean()
{
return contentUsersBean;
}
public void setContentUsersBean(ContentUsersBean contentUsersBean)
{
this.contentUsersBean = contentUsersBean;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
contentUsersBean.finishOK();
return outcome;
}
public void addRole(ActionEvent event)
{
contentUsersBean.addRole(event);
}
public void setupUserAction(ActionEvent event)
{
contentUsersBean.setupUserAction(event);
}
public void removeRole(ActionEvent event)
{
contentUsersBean.removeRole(event);
}
public DataModel getPersonRolesDataModel()
{
return contentUsersBean.getPersonRolesDataModel();
}
}

View File

@@ -0,0 +1,41 @@
/*
* 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.users;
import javax.faces.context.FacesContext;
import org.alfresco.web.bean.dialog.BaseDialogBean;
public class EditFileDialog extends BaseDialogBean
{
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
// TODO Auto-generated method stub
return null;
}
}

View File

@@ -0,0 +1,124 @@
/*
* 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.users;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
/**
* @author YanO
*
*/
public class EditUserDetailsDialog extends BaseDialogBean
{
private Node person;
protected UsersBeanProperties properties;
/**
* @param properties the properties to set
*/
public void setProperties(UsersBeanProperties properties)
{
this.properties = properties;
}
@Override
public void init(Map<String, String> parameters)
{
super.init(parameters);
person = properties.getPerson();
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
try
{
Map<QName, Serializable> props = this.nodeService.getProperties(getPerson().getNodeRef());
props.put(ContentModel.PROP_FIRSTNAME, getFirstName());
props.put(ContentModel.PROP_LASTNAME, getLastName());
props.put(ContentModel.PROP_EMAIL, getEmail());
// persist changes
this.nodeService.setProperties(getPerson().getNodeRef(), props);
// if the above call was successful, then reset Person Node in the session
Application.getCurrentUser(context).reset();
}
catch (Throwable err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(context, Repository.ERROR_GENERIC), err.getMessage()), err);
outcome = null;
}
return outcome;
}
private Node getPerson()
{
return person;
}
public String getEmail()
{
return person.getProperties().get(ContentModel.PROP_EMAIL).toString();
}
public void setEmail(String email)
{
person.getProperties().put(ContentModel.PROP_EMAIL.toString(), email);
}
public String getFirstName()
{
return person.getProperties().get(ContentModel.PROP_FIRSTNAME).toString();
}
public void setFirstName(String firstName)
{
person.getProperties().put(ContentModel.PROP_FIRSTNAME.toString(), firstName);
}
public String getLastName()
{
return person.getProperties().get(ContentModel.PROP_LASTNAME).toString();
}
public void setLastName(String lastName)
{
person.getProperties().put(ContentModel.PROP_LASTNAME.toString(), lastName);
}
}

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"
*/
package org.alfresco.web.bean.users;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.model.DataModel;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.dialog.BaseDialogBean;
public class EditUserRolesDialog extends BaseDialogBean {
private static final String MSG_MODIFY_USER_ROLE = "modify_user_roles";
SpaceUsersBean spaceUsersBean;
@Override
public boolean getFinishButtonDisabled() {
return false;
}
public SpaceUsersBean getSpaceUsersBean() {
return spaceUsersBean;
}
public void setSpaceUsersBean(SpaceUsersBean spaceUsersBean) {
this.spaceUsersBean = spaceUsersBean;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception {
spaceUsersBean.finishOK();
return outcome;
}
public void addRole(ActionEvent event) {
spaceUsersBean.addRole(event);
}
public void setupUserAction(ActionEvent event) {
spaceUsersBean.setupUserAction(event);
}
public void removeRole(ActionEvent event) {
spaceUsersBean.removeRole(event);
}
public DataModel getPersonRolesDataModel() {
return spaceUsersBean.getPersonRolesDataModel();
}
@Override
public String getContainerTitle() {
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_MODIFY_USER_ROLE) + " '" + spaceUsersBean.getPersonName() + "'";
}
}

View File

@@ -0,0 +1,192 @@
/*
* 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.users;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
import org.apache.log4j.Logger;
/**
* @author YanO
*
*/
public class EditUserWizard extends CreateUserWizard
{
private static Logger logger = Logger.getLogger(EditUserWizard.class);
protected UsersBeanProperties properties;
/**
* @param properties the properties to set
*/
public void setProperties(UsersBeanProperties properties)
{
this.properties = properties;
}
@Override
public void init(Map<String, String> arg0)
{
super.init(arg0);
// set values for edit mode
Map<String, Object> props = properties.getPerson().getProperties();
this.firstName = (String) props.get("firstName");
this.lastName = (String) props.get("lastName");
this.userName = (String) props.get("userName");
this.email = (String) props.get("email");
this.companyId = (String) props.get("organizationId");
// calculate home space name and parent space Id from homeFolderId
this.homeSpaceLocation = null; // default to Company root space
NodeRef homeFolderRef = (NodeRef) props.get("homeFolder");
if (this.nodeService.exists(homeFolderRef) == true)
{
ChildAssociationRef childAssocRef = this.nodeService.getPrimaryParent(homeFolderRef);
NodeRef parentRef = childAssocRef.getParentRef();
if (this.nodeService.getRootNode(Repository.getStoreRef()).equals(parentRef) == false)
{
this.homeSpaceLocation = parentRef;
this.homeSpaceName = Repository.getNameForNode(nodeService, homeFolderRef);
}
else
{
this.homeSpaceLocation = homeFolderRef;
}
}
if (logger.isDebugEnabled())
logger.debug("Edit user home space location: " + homeSpaceLocation + " home space name: " + homeSpaceName);
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
try
{
// update the existing node in the repository
NodeRef nodeRef = properties.getPerson().getNodeRef();
Map<QName, Serializable> props = this.nodeService.getProperties(nodeRef);
props.put(ContentModel.PROP_USERNAME, this.userName);
props.put(ContentModel.PROP_FIRSTNAME, this.firstName);
props.put(ContentModel.PROP_LASTNAME, this.lastName);
// calculate whether we need to move the old home space or create new
NodeRef newHomeFolderRef;
NodeRef oldHomeFolderRef = (NodeRef) this.nodeService.getProperty(nodeRef, ContentModel.PROP_HOMEFOLDER);
boolean moveHomeSpace = false;
boolean renameHomeSpace = false;
if (oldHomeFolderRef != null && this.nodeService.exists(oldHomeFolderRef) == true)
{
// the original home folder ref exists so may need moving if it has been changed
ChildAssociationRef childAssocRef = this.nodeService.getPrimaryParent(oldHomeFolderRef);
NodeRef currentHomeSpaceLocation = childAssocRef.getParentRef();
if (this.homeSpaceName.length() != 0)
{
if (currentHomeSpaceLocation.equals(this.homeSpaceLocation) == false && oldHomeFolderRef.equals(this.homeSpaceLocation) == false
&& currentHomeSpaceLocation.equals(getCompanyHomeSpace()) == false && currentHomeSpaceLocation.equals(getDefaultHomeSpace()) == false)
{
moveHomeSpace = true;
}
String oldHomeSpaceName = Repository.getNameForNode(nodeService, oldHomeFolderRef);
if (oldHomeSpaceName.equals(this.homeSpaceName) == false && oldHomeFolderRef.equals(this.homeSpaceLocation) == false)
{
renameHomeSpace = true;
}
}
}
if (logger.isDebugEnabled())
logger.debug("Moving space: " + moveHomeSpace + " and renaming space: " + renameHomeSpace);
if (moveHomeSpace == false && renameHomeSpace == false)
{
if (this.homeSpaceLocation != null && this.homeSpaceName.length() != 0)
{
newHomeFolderRef = createHomeSpace(this.homeSpaceLocation.getId(), this.homeSpaceName, false);
}
else if (this.homeSpaceLocation != null)
{
// location selected but no home space name entered,
// so the home ref should be set to the newly selected space
newHomeFolderRef = this.homeSpaceLocation;
// set the permissions for this space so the user can access it
}
else
{
// nothing selected - use Company Home by default
newHomeFolderRef = getCompanyHomeSpace();
}
}
else
{
// either move, rename or both required
if (moveHomeSpace == true)
{
this.nodeService
.moveNode(oldHomeFolderRef, this.homeSpaceLocation, ContentModel.ASSOC_CONTAINS, this.nodeService.getPrimaryParent(oldHomeFolderRef).getQName());
}
newHomeFolderRef = oldHomeFolderRef; // ref ID doesn't change
if (renameHomeSpace == true)
{
// change HomeSpace node name
this.nodeService.setProperty(newHomeFolderRef, ContentModel.PROP_NAME, this.homeSpaceName);
}
}
props.put(ContentModel.PROP_HOMEFOLDER, newHomeFolderRef);
props.put(ContentModel.PROP_EMAIL, this.email);
props.put(ContentModel.PROP_ORGID, this.companyId);
this.nodeService.setProperties(nodeRef, props);
// TODO: RESET HomeSpace Ref found in top-level navigation bar!
// NOTE: not need cos only admin can do this?
}
catch (Throwable e)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), ERROR), e.getMessage()), e);
outcome = null;
}
return outcome;
}
}

View File

@@ -0,0 +1,73 @@
/*
* 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.users;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import org.alfresco.web.bean.dialog.BaseDialogBean;
public class RemoveContentUserDialog extends BaseDialogBean
{
private ContentUsersBean contentUsersBean;
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
contentUsersBean.removeOK();
return outcome;
}
public void setupUserAction(ActionEvent event)
{
this.contentUsersBean.setupUserAction(event);
}
public String getPersonName()
{
return this.contentUsersBean.getPersonName();
}
public void setPersonName(String personName)
{
this.contentUsersBean.setPersonName(personName);
}
public ContentUsersBean getContentUsersBean()
{
return contentUsersBean;
}
public void setContentUsersBean(ContentUsersBean contentUsersBean)
{
this.contentUsersBean = contentUsersBean;
}
}

View File

@@ -0,0 +1,89 @@
/*
* 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.users;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.dialog.BaseDialogBean;
public class RemoveInvitedUserDialog extends BaseDialogBean {
private static final String BUTTON_NO = "no";
private static final String BUTTON_YES = "yes";
private static final String MSG_REMOVE_USER = "remove_user";
private SpaceUsersBean spaceUsersBean;
@Override
public boolean getFinishButtonDisabled() {
return false;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception {
spaceUsersBean.removeOK();
return outcome;
}
public void setupUserAction(ActionEvent event) {
spaceUsersBean.setupUserAction(event);
}
public String getPersonName() {
return spaceUsersBean.getPersonName();
}
public void setPersonName(String personName) {
this.spaceUsersBean.setPersonName(personName);
}
public SpaceUsersBean getSpaceUsersBean() {
return spaceUsersBean;
}
public void setSpaceUsersBean(SpaceUsersBean spaceUsersBean) {
this.spaceUsersBean = spaceUsersBean;
}
@Override
public String getCancelButtonLabel() {
return Application.getMessage(FacesContext.getCurrentInstance(), BUTTON_NO);
}
@Override
public String getFinishButtonLabel() {
return Application.getMessage(FacesContext.getCurrentInstance(), BUTTON_YES);
}
@Override
public String getContainerTitle() {
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_REMOVE_USER) + " '"
+ spaceUsersBean.getPersonName() + "'";
}
}

View File

@@ -0,0 +1,56 @@
/*
* 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.users;
import javax.faces.context.FacesContext;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.dialog.BaseDialogBean;
public class UserConsoleDialog extends BaseDialogBean
{
private static final String BUTTON_CLOSE = "close";
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return null;
}
@Override
public String getCancelButtonLabel()
{
return Application.getMessage(FacesContext.getCurrentInstance(), BUTTON_CLOSE);
}
@Override
public String cancel()
{
super.cancel();
return "dialog:close:browse";
}
}

View File

@@ -0,0 +1,228 @@
/*
* 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.users;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.search.SearchService;
import org.alfresco.service.cmr.security.AuthenticationService;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.ui.common.component.data.UIRichList;
public class UsersBeanProperties
{
/** NodeService bean reference */
private NodeService nodeService;
/** SearchService bean reference */
private SearchService searchService;
/** AuthenticationService bean reference */
private AuthenticationService authenticationService;
/** PersonService bean reference */
private PersonService personService;
/** Component reference for Users RichList control */
private UIRichList usersRichList;
/** action context */
private Node person = null;
private String password = null;
private String oldPassword = null;
private String confirm = null;
private String searchCriteria = null;
// ------------------------------------------------------------------------------
// Bean property getters and setters
/**
* @return the nodeService
*/
public NodeService getNodeService()
{
return nodeService;
}
/**
* @return the searchService
*/
public SearchService getSearchService()
{
return searchService;
}
/**
* @return the authenticationService
*/
public AuthenticationService getAuthenticationService()
{
return authenticationService;
}
/**
* @return the personService
*/
public PersonService getPersonService()
{
return personService;
}
/**
* @param nodeService The NodeService to set.
*/
public void setNodeService(NodeService nodeService)
{
this.nodeService = nodeService;
}
/**
* @param searchService the search service
*/
public void setSearchService(SearchService searchService)
{
this.searchService = searchService;
}
/**
* @param authenticationService The AuthenticationService to set.
*/
public void setAuthenticationService(AuthenticationService authenticationService)
{
this.authenticationService = authenticationService;
}
/**
* @param personService The PersonService to set.
*/
public void setPersonService(PersonService personService)
{
this.personService = personService;
}
/**
* @return Returns the usersRichList.
*/
public UIRichList getUsersRichList()
{
return this.usersRichList;
}
/**
* @param usersRichList The usersRichList to set.
*/
public void setUsersRichList(UIRichList usersRichList)
{
this.usersRichList = usersRichList;
}
/**
* @return Returns the search criteria
*/
public String getSearchCriteria()
{
return searchCriteria;
}
/**
* @param searchCriteria The search criteria to select
*/
public void setSearchCriteria(String searchCriteria)
{
this.searchCriteria = searchCriteria;
}
/**
* @return Returns the confirm password.
*/
public String getConfirm()
{
return this.confirm;
}
/**
* @param confirm The confirm password to set.
*/
public void setConfirm(String confirm)
{
this.confirm = confirm;
}
/**
* @return Returns the password.
*/
public String getPassword()
{
return this.password;
}
/**
* @param password The password to set.
*/
public void setPassword(String password)
{
this.password = password;
}
/**
* @return Returns the old password.
*/
public String getOldPassword()
{
return this.oldPassword;
}
/**
* @param oldPassword The old password to set.
*/
public void setOldPassword(String oldPassword)
{
this.oldPassword = oldPassword;
}
/**
* @return Returns the person context.
*/
public Node getPerson()
{
return this.person;
}
/**
* @param person The person context to set.
*/
public void setPerson(Node person)
{
this.person = person;
}
}

View File

@@ -41,31 +41,28 @@ import org.alfresco.repo.search.impl.lucene.QueryParser;
import org.alfresco.repo.security.authentication.AuthenticationException; import org.alfresco.repo.security.authentication.AuthenticationException;
import org.alfresco.service.cmr.repository.InvalidNodeRefException; import org.alfresco.service.cmr.repository.InvalidNodeRefException;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.search.SearchParameters; import org.alfresco.service.cmr.search.SearchParameters;
import org.alfresco.service.cmr.search.SearchService; import org.alfresco.service.cmr.search.SearchService;
import org.alfresco.service.cmr.security.AuthenticationService;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
import org.alfresco.web.app.context.IContextListener; import org.alfresco.web.app.context.IContextListener;
import org.alfresco.web.app.context.UIContextService; import org.alfresco.web.app.context.UIContextService;
import org.alfresco.web.bean.LoginBean; import org.alfresco.web.bean.LoginBean;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.MapNode; import org.alfresco.web.bean.repository.MapNode;
import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils; import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.UIActionLink; import org.alfresco.web.ui.common.component.UIActionLink;
import org.alfresco.web.ui.common.component.data.UIRichList;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
/** /**
* @author Kevin Roast * @author Kevin Roast
*/ */
public class UsersBean implements IContextListener public class UsersDialog extends BaseDialogBean implements IContextListener
{ {
private static Log logger = LogFactory.getLog(UsersBean.class); private static Log logger = LogFactory.getLog(UsersDialog.class);
public static final String ERROR_PASSWORD_MATCH = "error_password_match"; public static final String ERROR_PASSWORD_MATCH = "error_password_match";
private static final String ERROR_DELETE = "error_delete_user"; private static final String ERROR_DELETE = "error_delete_user";
@@ -74,31 +71,9 @@ public class UsersBean implements IContextListener
private static final String DEFAULT_OUTCOME = "manageUsers"; private static final String DEFAULT_OUTCOME = "manageUsers";
private static final String DIALOG_CLOSE = "dialog:close"; private static final String DIALOG_CLOSE = "dialog:close";
/** NodeService bean reference */ protected UsersBeanProperties properties;
protected NodeService nodeService;
/** SearchService bean reference */
protected SearchService searchService;
/** AuthenticationService bean reference */
protected AuthenticationService authenticationService;
/** PersonService bean reference */
protected PersonService personService;
/** Component reference for Users RichList control */
protected UIRichList usersRichList;
/** action context */
private Node person = null;
private List<Node> users = Collections.<Node>emptyList(); private List<Node> users = Collections.<Node>emptyList();
private String password = null;
private String oldPassword = null;
private String confirm = null;
private String searchCriteria = null;
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// Construction // Construction
@@ -106,7 +81,7 @@ public class UsersBean implements IContextListener
/** /**
* Default Constructor * Default Constructor
*/ */
public UsersBean() public UsersDialog()
{ {
UIContextService.getInstance(FacesContext.getCurrentInstance()).registerBean(this); UIContextService.getInstance(FacesContext.getCurrentInstance()).registerBean(this);
} }
@@ -116,51 +91,11 @@ public class UsersBean implements IContextListener
// Bean property getters and setters // Bean property getters and setters
/** /**
* @param nodeService The NodeService to set. * @param properties the properties to set
*/ */
public void setNodeService(NodeService nodeService) public void setProperties(UsersBeanProperties properties)
{ {
this.nodeService = nodeService; this.properties = properties;
}
/**
* @param searchService the search service
*/
public void setSearchService(SearchService searchService)
{
this.searchService = searchService;
}
/**
* @param authenticationService The AuthenticationService to set.
*/
public void setAuthenticationService(AuthenticationService authenticationService)
{
this.authenticationService = authenticationService;
}
/**
* @param personService The PersonService to set.
*/
public void setPersonService(PersonService personService)
{
this.personService = personService;
}
/**
* @return Returns the usersRichList.
*/
public UIRichList getUsersRichList()
{
return this.usersRichList;
}
/**
* @param usersRichList The usersRichList to set.
*/
public void setUsersRichList(UIRichList usersRichList)
{
this.usersRichList = usersRichList;
} }
/** /**
@@ -176,91 +111,11 @@ public class UsersBean implements IContextListener
return this.users; return this.users;
} }
/**
* @return Returns the search criteria
*/
public String getSearchCriteria()
{
return searchCriteria;
}
/**
* @param searchCriteria The search criteria to select
*/
public void setSearchCriteria(String searchCriteria)
{
this.searchCriteria = searchCriteria;
}
/**
* @return Returns the confirm password.
*/
public String getConfirm()
{
return this.confirm;
}
/**
* @param confirm The confirm password to set.
*/
public void setConfirm(String confirm)
{
this.confirm = confirm;
}
/**
* @return Returns the password.
*/
public String getPassword()
{
return this.password;
}
/**
* @param password The password to set.
*/
public void setPassword(String password)
{
this.password = password;
}
/**
* @return Returns the old password.
*/
public String getOldPassword()
{
return this.oldPassword;
}
/**
* @param oldPassword The old password to set.
*/
public void setOldPassword(String oldPassword)
{
this.oldPassword = oldPassword;
}
/**
* @return Returns the person context.
*/
public Node getPerson()
{
return this.person;
}
/**
* @param person The person context to set.
*/
public void setPerson(Node person)
{
this.person = person;
}
/** /**
* Action event called by all actions that need to setup a Person context on * Action event called by all actions that need to setup a Person context on
* the Users bean before an action page is called. The context will be a * the Users bean before an action page is called. The context will be a
* Person Node in setPerson() which can be retrieved on the action page from * Person Node in setPerson() which can be retrieved on the action page from
* UsersBean.getPerson(). * UsersDialog.getPerson().
*/ */
public void setupUserAction(ActionEvent event) public void setupUserAction(ActionEvent event)
{ {
@@ -279,7 +134,7 @@ public class UsersBean implements IContextListener
Node node = new Node(ref); Node node = new Node(ref);
// remember the Person node // remember the Person node
setPerson(node); properties.setPerson(node);
// clear the UI state in preparation for finishing the action // clear the UI state in preparation for finishing the action
// and returning to the main page // and returning to the main page
@@ -293,7 +148,7 @@ public class UsersBean implements IContextListener
} }
else else
{ {
setPerson(null); properties.setPerson(null);
} }
} }
@@ -305,7 +160,7 @@ public class UsersBean implements IContextListener
FacesContext context = FacesContext.getCurrentInstance(); FacesContext context = FacesContext.getCurrentInstance();
try try
{ {
String userName = (String)getPerson().getProperties().get("userName"); String userName = (String) properties.getPerson().getProperties().get("userName");
// we only delete the user auth if Alfresco is managing the authentication // we only delete the user auth if Alfresco is managing the authentication
Map session = context.getExternalContext().getSessionMap(); Map session = context.getExternalContext().getSessionMap();
@@ -314,7 +169,7 @@ public class UsersBean implements IContextListener
// delete the User authentication // delete the User authentication
try try
{ {
authenticationService.deleteAuthentication(userName); properties.getAuthenticationService().deleteAuthentication(userName);
} }
catch (AuthenticationException authErr) catch (AuthenticationException authErr)
{ {
@@ -323,7 +178,7 @@ public class UsersBean implements IContextListener
} }
// delete the associated Person // delete the associated Person
this.personService.deletePerson(userName); properties.getPersonService().deletePerson(userName);
// re-do the search to refresh the list // re-do the search to refresh the list
search(); search();
@@ -339,70 +194,7 @@ public class UsersBean implements IContextListener
} }
/** /**
* Action handler called for OK button press on Change Password screen * Action handler called for the OK button press
*/
public String changePasswordOK()
{
String outcome = DIALOG_CLOSE;
if (this.password != null && this.confirm != null && this.password.equals(this.confirm))
{
try
{
String userName = (String)this.person.getProperties().get(ContentModel.PROP_USERNAME);
this.authenticationService.setAuthentication(userName, this.password.toCharArray());
}
catch (Exception e)
{
outcome = null;
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext
.getCurrentInstance(), Repository.ERROR_GENERIC), e.getMessage()), e);
}
}
else
{
outcome = null;
Utils.addErrorMessage(Application.getMessage(FacesContext.getCurrentInstance(),
ERROR_PASSWORD_MATCH));
}
return outcome;
}
/**
* Action handler called for OK button press on Change My Password screen
* For this screen the user is required to enter their old password - effectively login.
*/
public String changeMyPasswordOK()
{
String outcome = DIALOG_CLOSE;
if (this.password != null && this.confirm != null && this.password.equals(this.confirm))
{
try
{
String userName = (String)this.person.getProperties().get(ContentModel.PROP_USERNAME);
this.authenticationService.updateAuthentication(userName, this.oldPassword.toCharArray(), this.password.toCharArray());
}
catch (Exception e)
{
outcome = null;
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext
.getCurrentInstance(), Repository.ERROR_GENERIC), e.getMessage()), e);
}
}
else
{
outcome = null;
Utils.addErrorMessage(Application.getMessage(FacesContext.getCurrentInstance(),
ERROR_PASSWORD_MATCH));
}
return outcome;
}
/**
* Action handler called for the OK button press
*/ */
public String changeUserDetails() public String changeUserDetails()
{ {
@@ -411,16 +203,16 @@ public class UsersBean implements IContextListener
FacesContext context = FacesContext.getCurrentInstance(); FacesContext context = FacesContext.getCurrentInstance();
try try
{ {
Map<QName, Serializable> props = this.nodeService.getProperties(getPerson().getNodeRef()); Map<QName, Serializable> props = properties.getNodeService().getProperties(properties.getPerson().getNodeRef());
props.put(ContentModel.PROP_FIRSTNAME, props.put(ContentModel.PROP_FIRSTNAME,
(String)getPerson().getProperties().get(ContentModel.PROP_FIRSTNAME)); (String) properties.getPerson().getProperties().get(ContentModel.PROP_FIRSTNAME));
props.put(ContentModel.PROP_LASTNAME, props.put(ContentModel.PROP_LASTNAME,
(String)getPerson().getProperties().get(ContentModel.PROP_LASTNAME)); (String) properties.getPerson().getProperties().get(ContentModel.PROP_LASTNAME));
props.put(ContentModel.PROP_EMAIL, props.put(ContentModel.PROP_EMAIL,
(String)getPerson().getProperties().get(ContentModel.PROP_EMAIL)); (String) properties.getPerson().getProperties().get(ContentModel.PROP_EMAIL));
// persist changes // persist changes
this.nodeService.setProperties(getPerson().getNodeRef(), props); properties.getNodeService().setProperties(properties.getPerson().getNodeRef(), props);
// if the above call was successful, then reset Person Node in the session // if the above call was successful, then reset Person Node in the session
Application.getCurrentUser(context).reset(); Application.getCurrentUser(context).reset();
@@ -441,9 +233,9 @@ public class UsersBean implements IContextListener
*/ */
public String search() public String search()
{ {
this.usersRichList.setValue(null); properties.getUsersRichList().setValue(null);
if (this.searchCriteria == null || this.searchCriteria.trim().length() == 0) if (properties.getSearchCriteria() == null || properties.getSearchCriteria().trim().length() == 0)
{ {
this.users = Collections.<Node>emptyList(); this.users = Collections.<Node>emptyList();
} }
@@ -458,7 +250,7 @@ public class UsersBean implements IContextListener
tx.begin(); tx.begin();
// define the query to find people by their first or last name // define the query to find people by their first or last name
String search = this.searchCriteria.trim(); String search = properties.getSearchCriteria().trim();
StringBuilder query = new StringBuilder(256); StringBuilder query = new StringBuilder(256);
query.append("TYPE:\"{http://www.alfresco.org/model/content/1.0}person\" AND ("); query.append("TYPE:\"{http://www.alfresco.org/model/content/1.0}person\" AND (");
for (StringTokenizer t = new StringTokenizer(search, " "); t.hasMoreTokens(); /**/) for (StringTokenizer t = new StringTokenizer(search, " "); t.hasMoreTokens(); /**/)
@@ -483,7 +275,7 @@ public class UsersBean implements IContextListener
params.addStore(Repository.getStoreRef()); params.addStore(Repository.getStoreRef());
params.setQuery(query.toString()); params.setQuery(query.toString());
List<NodeRef> people = this.searchService.query(params).getNodeRefs(); List<NodeRef> people = properties.getSearchService().query(params).getNodeRefs();
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
logger.debug("Found " + people.size() + " users"); logger.debug("Found " + people.size() + " users");
@@ -539,15 +331,20 @@ public class UsersBean implements IContextListener
*/ */
public String showAll() public String showAll()
{ {
this.usersRichList.setValue(null); properties.getUsersRichList().setValue(null);
this.users = Repository.getUsers(FacesContext.getCurrentInstance(), this.users = Repository.getUsers(FacesContext.getCurrentInstance(),
this.nodeService, this.searchService); properties.getNodeService(), properties.getSearchService());
// return null to stay on the same page // return null to stay on the same page
return null; return null;
} }
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
return null;
}
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// IContextListener implementation // IContextListener implementation
@@ -557,9 +354,9 @@ public class UsersBean implements IContextListener
*/ */
public void contextUpdated() public void contextUpdated()
{ {
if (this.usersRichList != null) if (properties.getUsersRichList() != null)
{ {
this.usersRichList.setValue(null); properties.getUsersRichList().setValue(null);
this.users = null; this.users = null;
} }
} }

View File

@@ -57,7 +57,7 @@ import org.alfresco.web.app.context.UIContextService;
import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.spaces.CreateSpaceWizard; import org.alfresco.web.bean.spaces.CreateSpaceWizard;
import org.alfresco.web.bean.users.UsersBean; import org.alfresco.web.bean.users.UsersDialog;
import org.alfresco.web.config.ClientConfigElement; import org.alfresco.web.config.ClientConfigElement;
import org.alfresco.web.ui.common.Utils; import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.UIActionLink; import org.alfresco.web.ui.common.component.UIActionLink;
@@ -558,7 +558,7 @@ public class NewUserWizard extends AbstractWizardBean
else else
{ {
outcome = null; outcome = null;
Utils.addErrorMessage(Application.getMessage(context, UsersBean.ERROR_PASSWORD_MATCH)); Utils.addErrorMessage(Application.getMessage(context, UsersDialog.ERROR_PASSWORD_MATCH));
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -77,6 +77,30 @@
<from-outcome>import</from-outcome> <from-outcome>import</from-outcome>
<to-view-id>/jsp/dialog/import.jsp</to-view-id> <to-view-id>/jsp/dialog/import.jsp</to-view-id>
</navigation-case> </navigation-case>
<navigation-case>
<from-outcome>manageCategories</from-outcome>
<to-view-id>/jsp/categories/categories.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>manageUsers</from-outcome>
<to-view-id>/jsp/users/users.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>manageGroups</from-outcome>
<to-view-id>/jsp/groups/groups.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>showSystemInfo</from-outcome>
<to-view-id>/jsp/dialog/system-info.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>showNodeBrowser</from-outcome>
<to-view-id>/jsp/admin/store-browser.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>export</from-outcome>
<to-view-id>/jsp/dialog/export.jsp</to-view-id>
</navigation-case>
</navigation-rule> </navigation-rule>
<!-- rule to get to the Advanced Search page from anywhere --> <!-- rule to get to the Advanced Search page from anywhere -->
@@ -209,30 +233,6 @@
<!-- Admin Console rules --> <!-- Admin Console rules -->
<navigation-rule> <navigation-rule>
<from-view-id>/jsp/admin/admin-console.jsp</from-view-id> <from-view-id>/jsp/admin/admin-console.jsp</from-view-id>
<navigation-case>
<from-outcome>manageCategories</from-outcome>
<to-view-id>/jsp/categories/categories.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>manageUsers</from-outcome>
<to-view-id>/jsp/users/users.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>manageGroups</from-outcome>
<to-view-id>/jsp/groups/groups.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>showSystemInfo</from-outcome>
<to-view-id>/jsp/dialog/system-info.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>showNodeBrowser</from-outcome>
<to-view-id>/jsp/admin/store-browser.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>export</from-outcome>
<to-view-id>/jsp/dialog/export.jsp</to-view-id>
</navigation-case>
</navigation-rule> </navigation-rule>
<navigation-rule> <navigation-rule>
@@ -267,18 +267,6 @@
</navigation-case> </navigation-case>
</navigation-rule> </navigation-rule>
<navigation-rule>
<from-view-id>/jsp/dialog/checkout-file.jsp</from-view-id>
<navigation-case>
<from-outcome>checkoutFileLink</from-outcome>
<to-view-id>/jsp/dialog/checkout-file-link.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>workingCopyMissing</from-outcome>
<to-view-id>/jsp/dialog/working-copy-missing.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule> <navigation-rule>
<from-view-id>/jsp/dialog/space-details.jsp</from-view-id> <from-view-id>/jsp/dialog/space-details.jsp</from-view-id>
<navigation-case> <navigation-case>
@@ -289,10 +277,6 @@
<from-outcome>manageRules</from-outcome> <from-outcome>manageRules</from-outcome>
<to-view-id>/jsp/dialog/rules.jsp</to-view-id> <to-view-id>/jsp/dialog/rules.jsp</to-view-id>
</navigation-case> </navigation-case>
<navigation-case>
<from-outcome>export</from-outcome>
<to-view-id>/jsp/dialog/export.jsp</to-view-id>
</navigation-case>
<navigation-case> <navigation-case>
<from-outcome>applyTemplate</from-outcome> <from-outcome>applyTemplate</from-outcome>
<to-view-id>/jsp/dialog/apply-space-template.jsp</to-view-id> <to-view-id>/jsp/dialog/apply-space-template.jsp</to-view-id>
@@ -320,7 +304,7 @@
</navigation-rule> </navigation-rule>
<navigation-rule> <navigation-rule>
<from-view-id>/jsp/dialog/apply-rss-template.jsp</from-view-id> <from-view-id>/jsp/dialog/*</from-view-id>
<navigation-case> <navigation-case>
<from-outcome>manageInvitedUsers</from-outcome> <from-outcome>manageInvitedUsers</from-outcome>
<to-view-id>/jsp/roles/manage-invited-users.jsp</to-view-id> <to-view-id>/jsp/roles/manage-invited-users.jsp</to-view-id>
@@ -616,7 +600,7 @@
<!-- User Details and preferences action outcomes --> <!-- User Details and preferences action outcomes -->
<navigation-rule> <navigation-rule>
<from-view-id>/jsp/users/user-console.jsp</from-view-id> <from-view-id>/jsp/*</from-view-id>
<navigation-case> <navigation-case>
<from-outcome>changePassword</from-outcome> <from-outcome>changePassword</from-outcome>
<to-view-id>/jsp/users/change-my-password.jsp</to-view-id> <to-view-id>/jsp/users/change-my-password.jsp</to-view-id>
@@ -825,10 +809,6 @@
<from-outcome>manageInvitedUsers</from-outcome> <from-outcome>manageInvitedUsers</from-outcome>
<to-view-id>/jsp/roles/manage-invited-users.jsp</to-view-id> <to-view-id>/jsp/roles/manage-invited-users.jsp</to-view-id>
</navigation-case> </navigation-case>
<navigation-case>
<from-outcome>export</from-outcome>
<to-view-id>/jsp/dialog/export.jsp</to-view-id>
</navigation-case>
</navigation-rule> </navigation-rule>
<!-- Manage Deleted Items screen action outcomes --> <!-- Manage Deleted Items screen action outcomes -->
@@ -884,6 +864,14 @@
<from-outcome>topicDeleted</from-outcome> <from-outcome>topicDeleted</from-outcome>
<to-view-id>/jsp/forums/forum.jsp</to-view-id> <to-view-id>/jsp/forums/forum.jsp</to-view-id>
</navigation-case> </navigation-case>
<navigation-case>
<from-outcome>checkoutFileLink</from-outcome>
<to-view-id>/jsp/dialog/checkout-file-link.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>workingCopyMissing</from-outcome>
<to-view-id>/jsp/dialog/working-copy-missing.jsp</to-view-id>
</navigation-case>
</navigation-rule> </navigation-rule>
<navigation-rule> <navigation-rule>
@@ -931,4 +919,15 @@
<to-view-id>/jsp/wcm/browse-sandbox.jsp</to-view-id> <to-view-id>/jsp/wcm/browse-sandbox.jsp</to-view-id>
</navigation-case> </navigation-case>
</navigation-rule> </navigation-rule>
<!-- Overridden dialog:close navigation rules for Recovery Report -->
<navigation-rule>
<from-view-id>/jsp/*</from-view-id>
<navigation-case>
<from-outcome>goToTrashList</from-outcome>
<to-view-id>/jsp/trashcan/trash-list.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config> </faces-config>

View File

@@ -28,150 +28,60 @@
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> <f:verbatim>
<%@ page isELIgnored="false" %> <table cellpadding="6" cellspacing="6" border="0" width="100%" >
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <tr>
<td>
<r:page titleId="title_admin_console"> </f:verbatim>
<a:actionLink value="#{msg.manage_users}" image="/images/icons/users.gif" action="dialog:manageUsers" styleClass="title" />
<f:view> <f:verbatim>
</td>
<%-- load a bundle of properties with I18N strings --%> </tr>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/> <tr>
<td>
<h:form acceptcharset="UTF-8" id="admin-console"> </f:verbatim>
<a:actionLink value="#{msg.manage_groups}" image="/images/icons/group.gif" padding="2" action="dialog:manageGroups" styleClass="title" />
<%-- Main outer table --%> <f:verbatim>
<table cellspacing="0" cellpadding="2"> </td>
</tr>
<%-- Title bar --%> <tr>
<tr> <td>
<td colspan="2"> </f:verbatim>
<%@ include file="../parts/titlebar.jsp" %> <a:actionLink value="#{msg.category_management}" image="/images/icons/categories.gif" padding="2" action="dialog:manageCategories" styleClass="title" />
</td> <f:verbatim>
</tr> </td>
</tr>
<%-- Main area --%> <tr>
<tr valign="top"> <td>
<%-- Shelf --%> </f:verbatim>
<td> <a:actionLink value="#{msg.import}" image="/images/icons/import.gif" padding="2" action="dialog:import" actionListener="#{BrowseBean.setupSpaceAction}" styleClass="title">
<%@ include file="../parts/shelf.jsp" %> <f:param name="id" value="#{NavigationBean.currentNodeId}" />
</td> </a:actionLink>
<f:verbatim>
<%-- Work Area --%> </td>
<td width="100%"> </tr>
<table cellspacing="0" cellpadding="0" width="100%"> <tr>
<%-- Breadcrumb --%> <td>
<%@ include file="../parts/breadcrumb.jsp" %> </f:verbatim>
<a:actionLink value="#{msg.export}" image="/images/icons/export.gif" padding="2" action="dialog:export" actionListener="#{BrowseBean.setupSpaceAction}" styleClass="title">
<%-- Status and Actions --%> <f:param name="id" value="#{NavigationBean.currentNodeId}" />
<tr> </a:actionLink>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td> <f:verbatim>
<td bgcolor="#dfe6ed"> </td>
</tr>
<%-- Status and Actions inner contents table --%> <tr>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%> <td>
<table cellspacing="4" cellpadding="0" width="100%"> </f:verbatim>
<tr> <a:actionLink value="#{msg.system_info}" image="/images/icons/info_icon.gif" padding="2" action="dialog:showSystemInfo" styleClass="title" />
<td width=32> <f:verbatim>
<h:graphicImage id="logo" url="/images/icons/admin_console_large.gif" width="32" height="32" /> </td>
</td> </tr>
<td> <tr>
<div class="mainTitle"><h:outputText value="#{msg.admin_console}" /></div> <td>
<div class="mainSubText"><h:outputText value="#{msg.admin_description}" /></div> </f:verbatim>
</td> <a:actionLink value="#{msg.node_browser}" image="/images/icons/node_browser.gif" padding="2" action="dialog:showNodeBrowser" styleClass="title" />
</tr> <f:verbatim>
</table> </td>
</tr>
</td> </table>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td> </f:verbatim>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td valign=top>
<table cellspacing=4 cellpadding=4 border=0 width=100%>
<tr>
<td width=100%>
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "ballongrey", "#EEEEEE"); %>
<table cellpadding="6" cellspacing="6" border="0" width="100%">
<tr>
<td><a:actionLink value="#{msg.manage_users}" image="/images/icons/users.gif" padding="2" action="dialog:manageUsers" styleClass="title" actionListener="#{NewUserWizard.setupUsers}" /></td>
</tr>
<tr>
<td><a:actionLink value="#{msg.manage_groups}" image="/images/icons/group.gif" padding="2" action="dialog:manageGroups" styleClass="title" /></td>
</tr>
<tr>
<td><a:actionLink value="#{msg.category_management}" image="/images/icons/categories.gif" padding="2" action="dialog:manageCategories" styleClass="title" /></td>
</tr>
<tr>
<td>
<a:actionLink value="#{msg.import}" image="/images/icons/import.gif" padding="2" action="dialog:import" actionListener="#{BrowseBean.setupSpaceAction}" styleClass="title">
<f:param name="id" value="#{NavigationBean.currentNodeId}" />
</a:actionLink>
</td>
</tr>
<tr>
<td>
<a:actionLink value="#{msg.export}" image="/images/icons/export.gif" padding="2" action="dialog:export" actionListener="#{BrowseBean.setupSpaceAction}" styleClass="title">
<f:param name="id" value="#{NavigationBean.currentNodeId}" />
</a:actionLink>
</td>
</tr>
<tr>
<td><a:actionLink value="#{msg.system_info}" image="/images/icons/info_icon.gif" padding="2" action="dialog:showSystemInfo" styleClass="title" /></td>
</tr>
<tr>
<td><a:actionLink value="#{msg.node_browser}" image="/images/icons/node_browser.gif" padding="2" action="dialog:showNodeBrowser" styleClass="title" /></td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "ballongrey"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.close}" action="dialog:close" styleClass="wizardButton" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -172,9 +172,9 @@
<%-- More Search actions --%> <%-- More Search actions --%>
<a:menu id="searchMenu" itemSpacing="4" label="#{msg.more_actions}" image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu" style="white-space:nowrap"> <a:menu id="searchMenu" itemSpacing="4" label="#{msg.more_actions}" image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu" style="white-space:nowrap">
<a:booleanEvaluator value="#{NavigationBean.isGuest == false}" id="eval0"> <a:booleanEvaluator value="#{NavigationBean.isGuest == false}" id="eval0">
<a:actionLink value="#{msg.save_new_search}" image="/images/icons/save_search.gif" padding="4" action="#{AdvancedSearchBean.saveNewSearch}" id="link20_1" /> <a:actionLink value="#{msg.save_new_search}" image="/images/icons/save_search.gif" padding="4" action="#{AdvancedSearchDialog.saveNewSearch}" id="link20_1" />
<a:booleanEvaluator value="#{AdvancedSearchBean.allowEdit == true}" id="eval0_1"> <a:booleanEvaluator value="#{AdvancedSearchDialog.allowEdit == true}" id="eval0_1">
<a:actionLink value="#{msg.save_edit_search}" image="/images/icons/edit_search.gif" padding="4" action="#{AdvancedSearchBean.saveEditSearch}" id="link20_2" /> <a:actionLink value="#{msg.save_edit_search}" image="/images/icons/edit_search.gif" padding="4" action="#{AdvancedSearchDialog.saveEditSearch}" id="link20_2" />
</a:booleanEvaluator> </a:booleanEvaluator>
</a:booleanEvaluator> </a:booleanEvaluator>
</a:menu> </a:menu>

View File

@@ -80,8 +80,8 @@
<div class="mainTitle"><h:outputText value="#{msg.category_management}" /></div> <div class="mainTitle"><h:outputText value="#{msg.category_management}" /></div>
<div class="mainSubTitle"> <div class="mainSubTitle">
<%-- show either root message or the current category name --%> <%-- show either root message or the current category name --%>
<h:outputText value="#{msg.categories}" rendered="#{CategoriesBean.currentCategoryId == null}" /> <h:outputText value="#{msg.categories}" rendered="#{CategoriesDialog.currentCategoryId == null}" />
<h:outputText value="#{CategoriesBean.currentCategory.name}" rendered="#{CategoriesBean.currentCategoryId != null}" /> <h:outputText value="#{CategoriesDialog.currentCategory.name}" rendered="#{CategoriesDialog.currentCategoryId != null}" />
</div> </div>
<div class="mainSubText"><h:outputText value="#{msg.categories_description}" /></div> <div class="mainSubText"><h:outputText value="#{msg.categories_description}" /></div>
</td> </td>
@@ -89,18 +89,18 @@
<td style="padding-left:4px" width=52> <td style="padding-left:4px" width=52>
<%-- Create actions menu --%> <%-- Create actions menu --%>
<a:menu id="createMenu" itemSpacing="4" label="#{msg.create_options}" image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu" style="white-space:nowrap"> <a:menu id="createMenu" itemSpacing="4" label="#{msg.create_options}" image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu" style="white-space:nowrap">
<a:actionLink value="#{msg.add_category}" image="/images/icons/add_category.gif" action="addCategory" actionListener="#{CategoriesBean.clearCategoryAction}" /> <a:actionLink value="#{msg.add_category}" image="/images/icons/add_category.gif" action="dialog:createCategory" actionListener="#{CategoriesDialog.clearCategoryAction}" />
</a:menu> </a:menu>
</td> </td>
<td style="padding-left:4px" width=80> <td style="padding-left:4px" width=80>
<%-- More actions menu --%> <%-- More actions menu --%>
<a:menu id="actionsMenu" itemSpacing="4" label="#{msg.more_actions}" image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu" style="white-space:nowrap"> <a:menu id="actionsMenu" itemSpacing="4" label="#{msg.more_actions}" image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu" style="white-space:nowrap">
<a:booleanEvaluator value="#{CategoriesBean.currentCategoryId != null}"> <a:booleanEvaluator value="#{CategoriesDialog.currentCategoryId != null}">
<a:actionLink value="#{msg.edit_category}" image="/images/icons/edit_category.gif" action="editCategory" actionListener="#{CategoriesBean.setupCategoryAction}"> <a:actionLink value="#{msg.edit_category}" image="/images/icons/edit_category.gif" action="dialog:editCategory" actionListener="#{CategoriesDialog.setupCategoryAction}">
<f:param name="id" value="#{CategoriesBean.currentCategoryId}" /> <f:param name="id" value="#{CategoriesDialog.currentCategoryId}" />
</a:actionLink> </a:actionLink>
<a:actionLink value="#{msg.delete_category}" image="/images/icons/delete_category.gif" action="deleteCategory" actionListener="#{CategoriesBean.setupCategoryAction}"> <a:actionLink value="#{msg.delete_category}" image="/images/icons/delete_category.gif" action="dialog:deleteCategory" actionListener="#{CategoriesDialog.setupCategoryAction}">
<f:param name="id" value="#{CategoriesBean.currentCategoryId}" /> <f:param name="id" value="#{CategoriesDialog.currentCategoryId}" />
</a:actionLink> </a:actionLink>
</a:booleanEvaluator> </a:booleanEvaluator>
</a:menu> </a:menu>
@@ -110,7 +110,7 @@
<td width=110 valign=middle> <td width=110 valign=middle>
<%-- View mode settings --%> <%-- View mode settings --%>
<a:modeList itemSpacing="3" iconColumnWidth="20" selectedStyleClass="statusListHighlight" selectedImage="/images/icons/Details.gif" <a:modeList itemSpacing="3" iconColumnWidth="20" selectedStyleClass="statusListHighlight" selectedImage="/images/icons/Details.gif"
value="#{CategoriesBean.viewMode}" actionListener="#{CategoriesBean.viewModeChanged}" menu="true" menuImage="/images/icons/menu.gif" styleClass="moreActionsMenu"> value="#{CategoriesProperties.viewMode}" actionListener="#{CategoriesDialog.viewModeChanged}" menu="true" menuImage="/images/icons/menu.gif" styleClass="moreActionsMenu">
<a:listItem value="icons" label="#{msg.category_icons}" /> <a:listItem value="icons" label="#{msg.category_icons}" />
<a:listItem value="details" label="#{msg.category_details}" /> <a:listItem value="details" label="#{msg.category_details}" />
</a:modeList> </a:modeList>
@@ -138,7 +138,7 @@
<%-- Category Path Breadcrumb --%> <%-- Category Path Breadcrumb --%>
<div style="padding-left:8px;padding-top:4px;padding-bottom:4px"> <div style="padding-left:8px;padding-top:4px;padding-bottom:4px">
<a:breadcrumb value="#{CategoriesBean.location}" styleClass="title" /> <a:breadcrumb value="#{CategoriesDialog.location}" styleClass="title" />
</div> </div>
<%-- Categories List --%> <%-- Categories List --%>
@@ -146,9 +146,9 @@
<a:panel id="categories-panel" border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" styleClass="mainSubTitle" label="#{msg.items}"> <a:panel id="categories-panel" border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" styleClass="mainSubTitle" label="#{msg.items}">
<a:richList id="categories-list" binding="#{CategoriesBean.categoriesRichList}" viewMode="#{CategoriesBean.viewMode}" pageSize="15" <a:richList id="categories-list" binding="#{CategoriesProperties.categoriesRichList}" viewMode="#{CategoriesProperties.viewMode}" pageSize="15"
styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%" styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
value="#{CategoriesBean.categories}" var="r" initialSortColumn="name" initialSortDescending="true"> value="#{CategoriesDialog.categories}" var="r" initialSortColumn="name" initialSortDescending="true">
<%-- Primary column for icons view mode --%> <%-- Primary column for icons view mode --%>
<a:column primary="true" style="padding:2px;text-align:left;vertical-align:top;"> <a:column primary="true" style="padding:2px;text-align:left;vertical-align:top;">
@@ -156,16 +156,16 @@
<a:sortLink label="#{msg.name}" value="name" mode="case-insensitive" styleClass="header"/> <a:sortLink label="#{msg.name}" value="name" mode="case-insensitive" styleClass="header"/>
</f:facet> </f:facet>
<f:facet name="large-icon"> <f:facet name="large-icon">
<a:actionLink value="#{r.name}" image="/images/icons/category.gif" actionListener="#{CategoriesBean.clickCategory}" showLink="false"> <a:actionLink value="#{r.name}" image="/images/icons/category.gif" actionListener="#{CategoriesDialog.clickCategory}" showLink="false">
<f:param name="id" value="#{r.id}" /> <f:param name="id" value="#{r.id}" />
</a:actionLink> </a:actionLink>
</f:facet> </f:facet>
<f:facet name="small-icon"> <f:facet name="small-icon">
<a:actionLink value="#{r.name}" image="/images/icons/category_small.gif" actionListener="#{CategoriesBean.clickCategory}" showLink="false"> <a:actionLink value="#{r.name}" image="/images/icons/category_small.gif" actionListener="#{CategoriesDialog.clickCategory}" showLink="false">
<f:param name="id" value="#{r.id}" /> <f:param name="id" value="#{r.id}" />
</a:actionLink> </a:actionLink>
</f:facet> </f:facet>
<a:actionLink value="#{r.name}" actionListener="#{CategoriesBean.clickCategory}" styleClass="header"> <a:actionLink value="#{r.name}" actionListener="#{CategoriesDialog.clickCategory}" styleClass="header">
<f:param name="id" value="#{r.id}" /> <f:param name="id" value="#{r.id}" />
</a:actionLink> </a:actionLink>
</a:column> </a:column>
@@ -175,10 +175,10 @@
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{msg.actions}"/> <h:outputText value="#{msg.actions}"/>
</f:facet> </f:facet>
<a:actionLink value="#{msg.modify}" image="/images/icons/edit_category.gif" showLink="false" action="editCategory" style="padding-right:2px" actionListener="#{CategoriesBean.setupCategoryAction}"> <a:actionLink value="#{msg.modify}" image="/images/icons/edit_category.gif" showLink="false" action="dialog:editCategory" style="padding-right:2px" actionListener="#{CategoriesDialog.setupCategoryAction}">
<f:param name="id" value="#{r.id}" /> <f:param name="id" value="#{r.id}" />
</a:actionLink> </a:actionLink>
<a:actionLink value="#{msg.delete}" image="/images/icons/delete_category.gif" showLink="false" action="deleteCategory" actionListener="#{CategoriesBean.setupCategoryAction}"> <a:actionLink value="#{msg.delete}" image="/images/icons/delete_category.gif" showLink="false" action="dialog:deleteCategory" actionListener="#{CategoriesDialog.setupCategoryAction}">
<f:param name="id" value="#{r.id}" /> <f:param name="id" value="#{r.id}" />
</a:actionLink> </a:actionLink>
</a:column> </a:column>

View File

@@ -28,156 +28,46 @@
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<r:page titleId="title_delete_category"> <f:verbatim>
<table cellpadding="2" cellspacing="2" border="0">
<f:view> </f:verbatim>
<a:panel id="delete-panel" rendered="#{DialogManager.bean.members != 0}">
<%-- load a bundle of properties with I18N strings --%> <f:verbatim>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/> <tr>
<td width="100%" valign="top">
<%-- set the form name here --%> <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "yellowInner", "#ffffcc"); %>
<h:form acceptcharset="UTF-8" id="delete-category"> <table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<%-- Main outer table --%> <td valign=top style="padding-top:2px" width=20>
<table cellspacing="0" cellpadding="2"> </f:verbatim>
<h:graphicImage url="/images/icons/info_icon.gif" width="16" height="16"/>
<%-- Title bar --%> <f:verbatim>
<tr> </td>
<td colspan="2"> <td class="mainSubText">
<%@ include file="../parts/titlebar.jsp" %> </f:verbatim>
</td> <h:outputFormat value="#{msg.delete_category_warning}">
</tr> <f:param value="#{DialogManager.bean.members}" />
</h:outputFormat>
<%-- Main area --%> <f:verbatim>
<tr valign="top"> </td>
<%-- Shelf --%> </tr>
<td> </table>
<%@ include file="../parts/shelf.jsp" %> <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner"); %>
</td> </td>
</tr>
<%-- Work Area --%> </f:verbatim>
<td width="100%"> </a:panel>
<table cellspacing="0" cellpadding="0" width="100%"> <f:verbatim>
<%-- Breadcrumb --%> <tr>
<%@ include file="../parts/breadcrumb.jsp" %> <td class="mainSubTitle">
</f:verbatim>
<%-- Status and Actions --%> <h:outputFormat value="#{msg.delete_category_confirm}">
<tr> <f:param value="#{CategoriesProperties.actionCategory.name}"/>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td> </h:outputFormat>
<td bgcolor="#dfe6ed"> <f:verbatim>
</td>
<%-- Status and Actions inner contents table --%> </tr>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%> </table>
<table cellspacing="4" cellpadding="0" width="100%"> </f:verbatim>
<tr>
<td width="32">
<h:graphicImage url="/images/icons/delete_category_large.gif"/>
</td>
<td>
<div class="mainTitle"><h:outputText value="#{msg.delete_category}" /> '<h:outputText value="#{CategoriesBean.actionCategory.name}" />'</div>
<div class="mainSubText"><h:outputText value="#{msg.delete_category_info}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<table cellspacing="0" cellpadding="4" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<table cellpadding="2" cellspacing="2" border="0">
<a:panel id="delete-panel" rendered="#{CategoriesBean.members != 0}">
<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><h:graphicImage url="/images/icons/info_icon.gif" width="16" height="16"/></td>
<td class="mainSubText">
<h:outputFormat value="#{msg.delete_category_warning}">
<f:param value="#{CategoriesBean.members}" />
</h:outputFormat>
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner"); %>
</td>
</tr>
</a:panel>
<tr>
<td class="mainSubTitle">
<h:outputFormat value="#{msg.delete_category_confirm}">
<f:param value="#{CategoriesBean.actionCategory.name}"/>
</h:outputFormat>
</td>
</tr>
<tr>
<td>
<%-- Error Messages --%>
<%-- messages tag to show messages not handled by other specific message tags --%>
<h:messages globalOnly="true" styleClass="errorMessage" layout="table" />
<td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.delete}" action="#{CategoriesBean.finishDelete}" styleClass="dialogControls" />
</td>
</tr>
<tr><td class="dialogButtonSpacing"></td></tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="cancel" styleClass="dialogControls" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -28,165 +28,50 @@
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> <f:verbatim>
<%@ page isELIgnored="false" %> <script language="JavaScript1.2">
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
window.onload = pageLoaded;
<r:page titleId="title_edit_category">
function pageLoaded()
<script language="JavaScript1.2">
window.onload = pageLoaded;
function pageLoaded()
{
document.getElementById("edit-category:name").focus();
checkButtonState();
}
function checkButtonState()
{
if (document.getElementById("edit-category:name").value.length == 0 )
{ {
document.getElementById("edit-category:ok-button").disabled = true; document.getElementById("dialog:dialog-body:name").focus();
checkButtonState();
} }
else
function checkButtonState()
{ {
document.getElementById("edit-category:ok-button").disabled = false; if (document.getElementById("dialog:dialog-body:name").value.length == 0 )
{
document.getElementById("dialog:finish-button").disabled = true;
}
else
{
document.getElementById("dialog:finish-button").disabled = false;
}
} }
} </script>
</script> <table cellpadding="2" cellspacing="2" border="0" width="100%">
<f:view>
<%-- load a bundle of properties with I18N strings --%>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
<h:form acceptcharset="UTF-8" id="edit-category">
<%-- Main outer table --%>
<table cellspacing="0" cellpadding="2">
<%-- Title bar --%>
<tr> <tr>
<td colspan="2"> <td colspan="2" class="wizardSectionHeading">
<%@ include file="../parts/titlebar.jsp" %> </f:verbatim><h:outputText value="#{msg.category_props}" /><f:verbatim>
</td> </td>
</tr> </tr>
<tr>
<%-- Main area --%> <td></f:verbatim><h:outputText value="#{msg.name}" /><f:verbatim>:</td>
<tr valign="top">
<%-- Shelf --%>
<td> <td>
<%@ include file="../parts/shelf.jsp" %> </f:verbatim>
<h:inputText id="name" value="#{CategoriesProperties.name}" size="35" maxlength="1024"
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();"/>
<f:verbatim>&nbsp;*
</td> </td>
</tr>
<%-- Work Area --%> <tr>
<td width="100%"> <td></f:verbatim><h:outputText value="#{msg.description}" /><f:verbatim>:</td>
<table cellspacing="0" cellpadding="0" width="100%"> <td>
<%-- Breadcrumb --%> </f:verbatim><h:inputText value="#{CategoriesProperties.description}" size="35" maxlength="1024" /><f:verbatim>
<%@ include file="../parts/breadcrumb.jsp" %> </td>
</tr>
<%-- Status and Actions --%> </table>
<tr> </f:verbatim>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
<td bgcolor="#dfe6ed">
<%-- Status and Actions inner contents table --%>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
<table cellspacing="4" cellpadding="0" width="100%">
<tr>
<td width="32">
<h:graphicImage id="logo" url="/images/icons/edit_category_large.gif" />
</td>
<td>
<div class="mainTitle"><h:outputText value="#{msg.edit_category}" /> '<h:outputText value="#{CategoriesBean.actionCategory.name}" />'</div>
<div class="mainSubText"><h:outputText value="#{msg.edit_category_description}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<a:errors message="#{msg.error_wizard}" styleClass="errorMessage" />
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.category_props}" /></td>
</tr>
<tr>
<td><h:outputText value="#{msg.name}" />:</td>
<td>
<h:inputText id="name" value="#{CategoriesBean.name}" size="35" maxlength="1024"
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();"/>&nbsp;*
</td>
</tr>
<tr>
<td><h:outputText value="#{msg.description}" />:</td>
<td>
<h:inputText value="#{CategoriesBean.description}" size="35" maxlength="1024" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton id="ok-button" value="#{msg.finish_button}" action="#{CategoriesBean.finishEdit}"
styleClass="wizardButton" disabled="true" />
</td>
</tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="cancel" styleClass="wizardButton" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -28,165 +28,53 @@
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> <f:verbatim>
<%@ page isELIgnored="false" %> <script language="JavaScript1.2">
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> window.onload = pageLoaded;
<r:page titleId="title_create_category"> function pageLoaded()
<script language="JavaScript1.2">
window.onload = pageLoaded;
function pageLoaded()
{
document.getElementById("new-category:name").focus();
checkButtonState();
}
function checkButtonState()
{
if (document.getElementById("new-category:name").value.length == 0 )
{ {
document.getElementById("new-category:ok-button").disabled = true; document.getElementById("dialog:dialog-body:name").focus();
checkButtonState();
} }
else
function checkButtonState()
{ {
document.getElementById("new-category:ok-button").disabled = false; if (document.getElementById("dialog:dialog-body:name").value.length == 0 )
{
document.getElementById("dialog:finish-button").disabled = true;
}
else
{
document.getElementById("dialog:finish-button").disabled = false;
}
} }
} </script>
</script> <table cellpadding="2" cellspacing="2" border="0" width="100%">
<f:view>
<%-- load a bundle of properties with I18N strings --%>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
<h:form acceptcharset="UTF-8" id="new-category">
<%-- Main outer table --%>
<table cellspacing="0" cellpadding="2">
<%-- Title bar --%>
<tr> <tr>
<td colspan="2"> <td colspan="2" class="wizardSectionHeading">
<%@ include file="../parts/titlebar.jsp" %> </f:verbatim><h:outputText value="#{msg.category_props}" /><f:verbatim>
</td> </td>
</tr> </tr>
<tr>
<%-- Main area --%> <td></f:verbatim><h:outputText value="#{msg.name}" /><f:verbatim>:</td>
<tr valign="top">
<%-- Shelf --%>
<td> <td>
<%@ include file="../parts/shelf.jsp" %> </f:verbatim>
<h:inputText id="name" value="#{CategoriesProperties.name}"
size="35" maxlength="1024" onkeyup="javascript:checkButtonState();"
onchange="javascript:checkButtonState();" />
<f:verbatim>&nbsp;*
</td> </td>
</tr>
<%-- Work Area --%> <tr>
<td width="100%"> <td></f:verbatim><h:outputText value="#{msg.description}" /><f:verbatim>:</td>
<table cellspacing="0" cellpadding="0" width="100%"> <td>
<%-- Breadcrumb --%> </f:verbatim>
<%@ include file="../parts/breadcrumb.jsp" %> <h:inputText value="#{CategoriesProperties.description}" size="35"
maxlength="1024" />
<%-- Status and Actions --%> <f:verbatim>
<tr> </td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td> </tr>
<td bgcolor="#dfe6ed"> </table>
</f:verbatim>
<%-- Status and Actions inner contents table --%>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
<table cellspacing="4" cellpadding="0" width="100%">
<tr>
<td width="32">
<h:graphicImage id="logo" url="/images/icons/create_category_large.gif" />
</td>
<td>
<div class="mainTitle"><h:outputText value="#{msg.new_category}" /></div>
<div class="mainSubText"><h:outputText value="#{msg.new_category_description}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<a:errors message="#{msg.error_create_category_dialog}" styleClass="errorMessage" />
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.category_props}" /></td>
</tr>
<tr>
<td><h:outputText value="#{msg.name}" />:</td>
<td>
<h:inputText id="name" value="#{CategoriesBean.name}" size="35" maxlength="1024"
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();"/>&nbsp;*
</td>
</tr>
<tr>
<td><h:outputText value="#{msg.description}" />:</td>
<td>
<h:inputText value="#{CategoriesBean.description}" size="35" maxlength="1024" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton id="ok-button" value="#{msg.new_category}" action="#{CategoriesBean.finishCreate}"
styleClass="wizardButton" disabled="true" />
</td>
</tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="cancel" styleClass="wizardButton" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -94,14 +94,14 @@
</td> </td>
<td align=right> <td align=right>
<a:actionLink value="#{msg.resetall}" image="/images/icons/delete.gif" padding="2" actionListener="#{AdvancedSearchBean.reset}" style="white-space:nowrap" /> <a:actionLink value="#{msg.resetall}" image="/images/icons/delete.gif" padding="2" actionListener="#{AdvancedSearchDialog.reset}" style="white-space:nowrap" />
</td> </td>
<td class="separator" width=1><img src="<%=request.getContextPath()%>/images/parts/dotted_separator.gif" border=0 height=29 width=1></td> <td class="separator" width=1><img src="<%=request.getContextPath()%>/images/parts/dotted_separator.gif" border=0 height=29 width=1></td>
<td width=128 style="padding-left:4px"> <td width=128 style="padding-left:4px">
<%-- Available Saved Searches --%> <%-- Available Saved Searches --%>
<div style="padding-top:4px" style="white-space:nowrap"> <div style="padding-top:4px" style="white-space:nowrap">
<a:modeList itemSpacing="3" iconColumnWidth="20" style="text-align:right" selectedStyleClass="statusListHighlight" disabledStyleClass="statusListDisabled" selectedImage="/images/icons/filter.gif" <a:modeList itemSpacing="3" iconColumnWidth="20" style="text-align:right" selectedStyleClass="statusListHighlight" disabledStyleClass="statusListDisabled" selectedImage="/images/icons/filter.gif"
value="#{AdvancedSearchBean.savedSearchMode}" actionListener="#{AdvancedSearchBean.savedSearchModeChanged}" menu="true" menuImage="/images/icons/menu.gif" styleClass="moreActionsMenu" label="#{msg.saved_searches}"> value="#{SearchProperties.savedSearchMode}" actionListener="#{AdvancedSearchDialog.savedSearchModeChanged}" menu="true" menuImage="/images/icons/menu.gif" styleClass="moreActionsMenu" label="#{msg.saved_searches}">
<a:listItem value="user" label="#{msg.user_searches}" /> <a:listItem value="user" label="#{msg.user_searches}" />
<a:listItem value="global" label="#{msg.global_searches}" /> <a:listItem value="global" label="#{msg.global_searches}" />
</a:modeList> </a:modeList>
@@ -113,10 +113,10 @@
<%-- uses a nasty hack to execute an ActionListener for the drop-down. <%-- uses a nasty hack to execute an ActionListener for the drop-down.
tried using a valueChangedListener+formsubmit but the valueChangedListener tried using a valueChangedListener+formsubmit but the valueChangedListener
is called too late in the lifecycle for the form controls to be modified --%> is called too late in the lifecycle for the form controls to be modified --%>
<h:selectOneMenu id="searches" value="#{AdvancedSearchBean.savedSearch}" onchange="document.forms['advsearch']['advsearch:act'].value='advsearch:show-search'; document.forms['advsearch'].submit(); return true;"> <h:selectOneMenu id="searches" value="#{SearchProperties.savedSearch}" onchange="document.forms['advsearch']['advsearch:act'].value='advsearch:show-search'; document.forms['advsearch'].submit(); return true;">
<f:selectItems value="#{AdvancedSearchBean.savedSearches}" /> <f:selectItems value="#{AdvancedSearchDialog.savedSearches}" />
</h:selectOneMenu> </h:selectOneMenu>
<div style="display:none"><a:actionLink id="show-search" value="Select" actionListener="#{AdvancedSearchBean.selectSearch}" /></div> <div style="display:none"><a:actionLink id="show-search" value="Select" actionListener="#{AdvancedSearchDialog.selectSearch}" /></div>
</div> </div>
</td> </td>
</tr> </tr>
@@ -147,18 +147,18 @@
<tr> <tr>
<td colspan=2> <td colspan=2>
<h:outputText value="#{msg.look_for}" style="font-weight:bold" />:&nbsp; <h:outputText value="#{msg.look_for}" style="font-weight:bold" />:&nbsp;
<h:inputText id="search-text" value="#{AdvancedSearchBean.text}" size="48" maxlength="1024" /> <h:inputText id="search-text" value="#{SearchProperties.text}" size="48" maxlength="1024" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top"> <td valign="top">
<a:panel label="#{msg.show_results_for}" id="restrict-panel" style="font-weight:bold" border="white" bgcolor="white" progressive="true" <a:panel label="#{msg.show_results_for}" id="restrict-panel" style="font-weight:bold" border="white" bgcolor="white" progressive="true"
expanded='#{AdvancedSearchBean.panels["restrict-panel"]}' expandedActionListener="#{AdvancedSearchBean.expandPanel}"> expanded='#{SearchProperties.panels["restrict-panel"]}' expandedActionListener="#{AdvancedSearchDialog.expandPanel}">
<table cellpadding="2" cellspacing="2" border="0"> <table cellpadding="2" cellspacing="2" border="0">
<tr> <tr>
<td> <td>
<h:selectOneRadio value="#{AdvancedSearchBean.mode}" layout="pageDirection" id="radioMode" > <h:selectOneRadio value="#{SearchProperties.mode}" layout="pageDirection" id="radioMode" >
<f:selectItem itemValue="all" itemLabel="#{msg.all_items}" id="selectAll" /> <f:selectItem itemValue="all" itemLabel="#{msg.all_items}" id="selectAll" />
<f:selectItem itemValue="files_text" itemLabel="#{msg.file_names_contents}" id="selectFilesText" /> <f:selectItem itemValue="files_text" itemLabel="#{msg.file_names_contents}" id="selectFilesText" />
<f:selectItem itemValue="files" itemLabel="#{msg.file_names}" id="selectFiles" /> <f:selectItem itemValue="files" itemLabel="#{msg.file_names}" id="selectFiles" />
@@ -172,11 +172,11 @@
<div style="padding:3px"></div> <div style="padding:3px"></div>
<a:panel label="#{msg.look_in}" id="location-panel" style="font-weight:bold" border="white" bgcolor="white" progressive="true" <a:panel label="#{msg.look_in}" id="location-panel" style="font-weight:bold" border="white" bgcolor="white" progressive="true"
expanded='#{AdvancedSearchBean.panels["location-panel"]}' expandedActionListener="#{AdvancedSearchBean.expandPanel}"> expanded='#{SearchProperties.panels["location-panel"]}' expandedActionListener="#{AdvancedSearchDialog.expandPanel}">
<table cellpadding="2" cellspacing="2" border="0"> <table cellpadding="2" cellspacing="2" border="0">
<tr> <tr>
<td> <td>
<h:selectOneRadio value="#{AdvancedSearchBean.lookin}" layout="pageDirection" id="radioLookin"> <h:selectOneRadio value="#{SearchProperties.lookin}" layout="pageDirection" id="radioLookin">
<f:selectItem itemValue="all" itemLabel="#{msg.all_spaces}" id="spacesAll" /> <f:selectItem itemValue="all" itemLabel="#{msg.all_spaces}" id="spacesAll" />
<f:selectItem itemValue="other" itemLabel="#{msg.specify_space}:" id="spacesOther" /> <f:selectItem itemValue="other" itemLabel="#{msg.specify_space}:" id="spacesOther" />
</h:selectOneRadio> </h:selectOneRadio>
@@ -184,12 +184,12 @@
</tr> </tr>
<tr> <tr>
<td style="padding-left:26px"> <td style="padding-left:26px">
<r:spaceSelector label="#{msg.select_space_prompt}" value="#{AdvancedSearchBean.location}" initialSelection="#{NavigationBean.currentNodeId}" styleClass="selector" id="spaceSelector" /> <r:spaceSelector label="#{msg.select_space_prompt}" value="#{SearchProperties.location}" initialSelection="#{NavigationBean.currentNodeId}" styleClass="selector" id="spaceSelector" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left:22px"> <td style="padding-left:22px">
<h:selectBooleanCheckbox value="#{AdvancedSearchBean.locationChildren}" id="chkLocation" /> <h:selectBooleanCheckbox value="#{SearchProperties.locationChildren}" id="chkLocation" />
<span style="vertical-align:20%"><h:outputText value="#{msg.include_child_spaces}" id="incchild" /></span> <span style="vertical-align:20%"><h:outputText value="#{msg.include_child_spaces}" id="incchild" /></span>
</td> </td>
</tr> </tr>
@@ -199,7 +199,7 @@
<div style="padding:3px"></div> <div style="padding:3px"></div>
<a:panel label="#{msg.show_results_categories}" id="categories-panel" style="font-weight:bold" border="white" bgcolor="white" progressive="true" <a:panel label="#{msg.show_results_categories}" id="categories-panel" style="font-weight:bold" border="white" bgcolor="white" progressive="true"
expanded='#{AdvancedSearchBean.panels["categories-panel"]}' expandedActionListener="#{AdvancedSearchBean.expandPanel}"> expanded='#{SearchProperties.panels["categories-panel"]}' expandedActionListener="#{AdvancedSearchDialog.expandPanel}">
<table cellpadding="2" cellspacing="2" border="0"> <table cellpadding="2" cellspacing="2" border="0">
<tr> <tr>
<td style="padding-left:8px;padding-top:8px"> <td style="padding-left:8px;padding-top:8px">
@@ -214,16 +214,16 @@
</tr> </tr>
<tr> <tr>
<td style="padding-left:4px"> <td style="padding-left:4px">
<h:commandButton id="btnAddCat" value="#{msg.add_to_list_button}" actionListener="#{AdvancedSearchBean.addCategory}" styleClass="wizardButton" /> <h:commandButton id="btnAddCat" value="#{msg.add_to_list_button}" actionListener="#{AdvancedSearchDialog.addCategory}" styleClass="wizardButton" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left:4px"> <td style="padding-left:4px">
<h:dataTable value="#{AdvancedSearchBean.categoriesDataModel}" var="row" id="catTable" <h:dataTable value="#{AdvancedSearchDialog.categoriesDataModel}" var="row" id="catTable"
rowClasses="selectedItemsRow,selectedItemsRowAlt" rowClasses="selectedItemsRow,selectedItemsRowAlt"
styleClass="selectedItems" headerClass="selectedItemsHeader" styleClass="selectedItems" headerClass="selectedItemsHeader"
cellspacing="0" cellpadding="4" cellspacing="0" cellpadding="4"
rendered="#{AdvancedSearchBean.categoriesDataModel.rowCount != 0}"> rendered="#{SearchProperties.categoriesDataModel.rowCount != 0}">
<h:column id="col1"> <h:column id="col1">
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{msg.category}" id="tblCatNameHead" /> <h:outputText value="#{msg.category}" id="tblCatNameHead" />
@@ -239,12 +239,12 @@
</h:outputText> </h:outputText>
</h:column> </h:column>
<h:column id="col3"> <h:column id="col3">
<a:actionLink actionListener="#{AdvancedSearchBean.removeCategory}" image="/images/icons/delete.gif" <a:actionLink actionListener="#{AdvancedSearchDialog.removeCategory}" image="/images/icons/delete.gif"
value="#{msg.remove}" showLink="false" style="padding-left:6px" id="tblCatAdd" /> value="#{msg.remove}" showLink="false" style="padding-left:6px" id="tblCatAdd" />
</h:column> </h:column>
</h:dataTable> </h:dataTable>
<a:panel id="no-items" rendered="#{AdvancedSearchBean.categoriesDataModel.rowCount == 0}"> <a:panel id="no-items" rendered="#{SearchProperties.categoriesDataModel.rowCount == 0}">
<table cellspacing='0' cellpadding='2' border='0' class='selectedItems'> <table cellspacing='0' cellpadding='2' border='0' class='selectedItems'>
<tr> <tr>
<td colspan='2' class='selectedItemsHeader'><h:outputText id="no-items-category" value="#{msg.category}" /></td> <td colspan='2' class='selectedItemsHeader'><h:outputText id="no-items-category" value="#{msg.category}" /></td>
@@ -264,7 +264,7 @@
<td valign="top"> <td valign="top">
<a:panel label="#{msg.also_search_results}" id="attrs-panel" style="font-weight:bold" border="white" bgcolor="white" progressive="true" <a:panel label="#{msg.also_search_results}" id="attrs-panel" style="font-weight:bold" border="white" bgcolor="white" progressive="true"
expanded='#{AdvancedSearchBean.panels["attrs-panel"]}' expandedActionListener="#{AdvancedSearchBean.expandPanel}"> expanded='#{SearchProperties.panels["attrs-panel"]}' expandedActionListener="#{AdvancedSearchDialog.expandPanel}">
<table cellpadding="2" cellspacing="2" border="0"> <table cellpadding="2" cellspacing="2" border="0">
<tr> <tr>
<td> <td>
@@ -272,63 +272,63 @@
<tr> <tr>
<td style="padding-left:8px"><h:outputText value="#{msg.folder_type}" id="folderType" />:</td> <td style="padding-left:8px"><h:outputText value="#{msg.folder_type}" id="folderType" />:</td>
<td> <td>
<h:selectOneMenu value="#{AdvancedSearchBean.folderType}" id="selectFolderType"> <h:selectOneMenu value="#{SearchProperties.folderType}" id="selectFolderType">
<f:selectItems value="#{AdvancedSearchBean.folderTypes}" id="folderTypes" /> <f:selectItems value="#{AdvancedSearchDialog.folderTypes}" id="folderTypes" />
</h:selectOneMenu> </h:selectOneMenu>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left:8px"><h:outputText value="#{msg.content_type}" id="contentType" />:</td> <td style="padding-left:8px"><h:outputText value="#{msg.content_type}" id="contentType" />:</td>
<td> <td>
<h:selectOneMenu value="#{AdvancedSearchBean.contentType}" id="selectContentType"> <h:selectOneMenu value="#{SearchProperties.contentType}" id="selectContentType">
<f:selectItems value="#{AdvancedSearchBean.contentTypes}" id="contentTypes" /> <f:selectItems value="#{AdvancedSearchDialog.contentTypes}" id="contentTypes" />
</h:selectOneMenu> </h:selectOneMenu>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left:8px"><h:outputText value="#{msg.content_format}" id="contentFormat" />:</td> <td style="padding-left:8px"><h:outputText value="#{msg.content_format}" id="contentFormat" />:</td>
<td> <td>
<h:selectOneMenu value="#{AdvancedSearchBean.contentFormat}" id="selectContentFormat"> <h:selectOneMenu value="#{SearchProperties.contentFormat}" id="selectContentFormat">
<f:selectItems value="#{AdvancedSearchBean.contentFormats}" id="contentFormats" /> <f:selectItems value="#{AdvancedSearchDialog.contentFormats}" id="contentFormats" />
</h:selectOneMenu> </h:selectOneMenu>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left:8px"><h:outputText value="#{msg.title}" id="title" />:</td><td><h:inputText value="#{AdvancedSearchBean.title}" size="#{TextFieldGenerator.size}" maxlength="1024" id="txtTitle" /></td> <td style="padding-left:8px"><h:outputText value="#{msg.title}" id="title" />:</td><td><h:inputText value="#{SearchProperties.title}" size="#{TextFieldGenerator.size}" maxlength="1024" id="txtTitle" /></td>
</tr> </tr>
<tr> <tr>
<td style="padding-left:8px"><h:outputText value="#{msg.description}" id="desc" />:</td><td><h:inputText value="#{AdvancedSearchBean.description}" size="#{TextFieldGenerator.size}" maxlength="1024" id="txtDesc" /></td> <td style="padding-left:8px"><h:outputText value="#{msg.description}" id="desc" />:</td><td><h:inputText value="#{SearchProperties.description}" size="#{TextFieldGenerator.size}" maxlength="1024" id="txtDesc" /></td>
</tr> </tr>
<tr> <tr>
<td style="padding-left:8px"><h:outputText value="#{msg.author}" id="author" />:</td><td><h:inputText value="#{AdvancedSearchBean.author}" size="#{TextFieldGenerator.size}" maxlength="1024" id="txtAuthor" /></td> <td style="padding-left:8px"><h:outputText value="#{msg.author}" id="author" />:</td><td><h:inputText value="#{SearchProperties.author}" size="#{TextFieldGenerator.size}" maxlength="1024" id="txtAuthor" /></td>
</tr> </tr>
</table> </table>
<table cellpadding="1" cellspacing="0" border="0"> <table cellpadding="1" cellspacing="0" border="0">
<tr><td colspan="2" class="paddingRow"></td></tr> <tr><td colspan="2" class="paddingRow"></td></tr>
<tr> <tr>
<td colspan="2"><h:selectBooleanCheckbox value="#{AdvancedSearchBean.modifiedDateChecked}" id="chkModDate" /><span style="vertical-align:20%"><h:outputText value="#{msg.modified_date}" id="modDate" />:</span></td> <td colspan="2"><h:selectBooleanCheckbox value="#{SearchProperties.modifiedDateChecked}" id="chkModDate" /><span style="vertical-align:20%"><h:outputText value="#{msg.modified_date}" id="modDate" />:</span></td>
</tr> </tr>
<tr> <tr>
<td style="padding-left:8px"><h:outputText value="#{msg.from}" id="modDateFrom" />:</td><td><a:inputDatePicker value="#{AdvancedSearchBean.modifiedDateFrom}" yearCount="#{DatePickerGenerator.yearCount}" startYear="#{DatePickerGenerator.startYear}" id="dateModFrom" initialiseIfNull="true" /></td> <td style="padding-left:8px"><h:outputText value="#{msg.from}" id="modDateFrom" />:</td><td><a:inputDatePicker value="#{SearchProperties.modifiedDateFrom}" yearCount="#{DatePickerGenerator.yearCount}" startYear="#{DatePickerGenerator.startYear}" id="dateModFrom" initialiseIfNull="true" /></td>
</tr> </tr>
<tr> <tr>
<td style="padding-left:8px"><h:outputText value="#{msg.to}" id="modDateTo" />:</td><td><a:inputDatePicker value="#{AdvancedSearchBean.modifiedDateTo}" yearCount="#{DatePickerGenerator.yearCount}" startYear="#{DatePickerGenerator.startYear}" id="dateModTo" initialiseIfNull="true" /></td> <td style="padding-left:8px"><h:outputText value="#{msg.to}" id="modDateTo" />:</td><td><a:inputDatePicker value="#{SearchProperties.modifiedDateTo}" yearCount="#{DatePickerGenerator.yearCount}" startYear="#{DatePickerGenerator.startYear}" id="dateModTo" initialiseIfNull="true" /></td>
</tr> </tr>
<tr> <tr>
<td colspan="2"><h:selectBooleanCheckbox value="#{AdvancedSearchBean.createdDateChecked}" id="chkCreateDate" /><span style="vertical-align:20%"><h:outputText value="#{msg.created_date}" id="createDate" />:</span></td> <td colspan="2"><h:selectBooleanCheckbox value="#{SearchProperties.createdDateChecked}" id="chkCreateDate" /><span style="vertical-align:20%"><h:outputText value="#{msg.created_date}" id="createDate" />:</span></td>
</tr> </tr>
<tr> <tr>
<td style="padding-left:8px"><h:outputText value="#{msg.from}" id="createDateFrom" />:</td><td><a:inputDatePicker value="#{AdvancedSearchBean.createdDateFrom}" yearCount="#{DatePickerGenerator.yearCount}" startYear="#{DatePickerGenerator.startYear}" id="dateCreatedFrom" initialiseIfNull="true" /></td> <td style="padding-left:8px"><h:outputText value="#{msg.from}" id="createDateFrom" />:</td><td><a:inputDatePicker value="#{SearchProperties.createdDateFrom}" yearCount="#{DatePickerGenerator.yearCount}" startYear="#{DatePickerGenerator.startYear}" id="dateCreatedFrom" initialiseIfNull="true" /></td>
</tr> </tr>
<tr> <tr>
<td style="padding-left:8px"><h:outputText value="#{msg.to}" id="createDateTo" />:</td><td><a:inputDatePicker value="#{AdvancedSearchBean.createdDateTo}" yearCount="#{DatePickerGenerator.yearCount}" startYear="#{DatePickerGenerator.startYear}" id="dateCreatedTo" initialiseIfNull="true" /></td> <td style="padding-left:8px"><h:outputText value="#{msg.to}" id="createDateTo" />:</td><td><a:inputDatePicker value="#{SearchProperties.createdDateTo}" yearCount="#{DatePickerGenerator.yearCount}" startYear="#{DatePickerGenerator.startYear}" id="dateCreatedTo" initialiseIfNull="true" /></td>
</tr> </tr>
</table> </table>
<div style="padding:4px"></div> <div style="padding:4px"></div>
<a:panel label="#{msg.additional_options}" id="custom-panel" style="font-weight:bold" progressive="true" <a:panel label="#{msg.additional_options}" id="custom-panel" style="font-weight:bold" progressive="true"
expanded='#{AdvancedSearchBean.panels["custom-panel"]}' expandedActionListener="#{AdvancedSearchBean.expandPanel}"> expanded='#{SearchProperties.panels["custom-panel"]}' expandedActionListener="#{AdvancedSearchDialog.expandPanel}">
<r:searchCustomProperties id="customProps" bean="AdvancedSearchBean" var="customProperties" style="padding-left:12px;padding-top:4px" /> <r:searchCustomProperties id="customProps" bean="AdvancedSearchDialog" var="customProperties" style="padding-left:12px;padding-top:4px" />
</a:panel> </a:panel>
</td> </td>
</tr> </tr>
@@ -347,7 +347,7 @@
<table cellpadding="1" cellspacing="1" border="0"> <table cellpadding="1" cellspacing="1" border="0">
<tr> <tr>
<td align="center"> <td align="center">
<h:commandButton id="search-button" value="#{msg.search}" action="#{AdvancedSearchBean.search}" styleClass="wizardButton" /> <h:commandButton id="search-button" value="#{msg.search}" action="#{AdvancedSearchDialog.search}" styleClass="wizardButton" />
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -390,4 +390,4 @@
</f:view> </f:view>
</r:page> </r:page>

View File

@@ -22,136 +22,20 @@
* the FLOSS exception, and it is also available here: * the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing" * http://www.alfresco.com/legal/licensing"
--%> --%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ 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/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a"%>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r"%>
<%@ page buffer="64kb" contentType="text/html;charset=UTF-8" %> <f:verbatim>
<%@ page isELIgnored="false" %> <table cellpadding="2" cellspacing="2" border="0" width="100%">
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <tr>
<td></f:verbatim><h:outputText value="#{msg.template}" /><f:verbatim>:</td>
<r:page titleId="title_apply_template"> <td width=100%><%-- Templates drop-down selector --%> </f:verbatim><h:selectOneMenu
value="#{ApplyDocTemplateDialog.template}">
<f:view> <f:selectItems value="#{TemplateSupportBean.contentTemplates}" />
</h:selectOneMenu><f:verbatim></td>
<%-- load a bundle of properties with I18N strings --%> </tr>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/> </table>
</f:verbatim>
<h:form acceptcharset="UTF-8" id="apply-template">
<%-- Main outer table --%>
<table cellspacing="0" cellpadding="2">
<%-- Title bar --%>
<tr>
<td colspan="2">
<%@ include file="../parts/titlebar.jsp" %>
</td>
</tr>
<%-- Main area --%>
<tr valign="top">
<%-- Shelf --%>
<td>
<%@ include file="../parts/shelf.jsp" %>
</td>
<%-- Work Area --%>
<td width="100%">
<table cellspacing="0" cellpadding="0" width="100%">
<%-- Breadcrumb --%>
<%@ include file="../parts/breadcrumb.jsp" %>
<%-- Status and Actions --%>
<tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
<td bgcolor="#dfe6ed">
<%-- Status and Actions inner contents table --%>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
<table cellspacing="4" cellpadding="0" width="100%">
<tr>
<td width="32">
<h:graphicImage url="/images/icons/preview_large.gif"/>
</td>
<td>
<div class="mainTitle"><h:outputText value="#{msg.apply_template}" /> '<h:outputText value="#{DocumentDetailsBean.name}" />'</div>
<div class="mainSubText"><h:outputText value="#{msg.apply_dashboard_doc_info}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td><h:outputText value="#{msg.template}"/>:</td>
<td width=100%>
<%-- Templates drop-down selector --%>
<h:selectOneMenu value="#{DocumentDetailsBean.template}">
<f:selectItems value="#{TemplateSupportBean.contentTemplates}" />
</h:selectOneMenu>
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.ok}" actionListener="#{DocumentDetailsBean.applyTemplate}" action="dialog:close" styleClass="wizardButton" />
</td>
</tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="dialog:close" styleClass="wizardButton" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -22,154 +22,64 @@
* the FLOSS exception, and it is also available here: * the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing" * http://www.alfresco.com/legal/licensing"
--%> --%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ 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/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a"%>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r"%>
<%@ page buffer="64kb" contentType="text/html;charset=UTF-8" %> <%@ page buffer="64kb" contentType="text/html;charset=UTF-8"%>
<%@ page isELIgnored="false" %> <%@ page isELIgnored="false"%>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <%@ page import="org.alfresco.web.ui.common.PanelGenerator"%>
<r:page titleId="title_apply_template"> <f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
<f:view> <f:verbatim>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<%-- load a bundle of properties with I18N strings --%> <tr>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/> <%-- TODO: check for Guest user access and hide panel? --%>
<td width="100%" valign="top">
<h:form acceptcharset="UTF-8" id="apply-rss"> <%
PanelGenerator.generatePanelStart(out, request.getContextPath(),
<%-- Main outer table --%> "yellowInner", "#ffffcc");
<table cellspacing="0" cellpadding="2"> %>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<%-- Title bar --%> <tr>
<tr> <td valign=top style="padding-top:2px" width=20></f:verbatim><h:graphicImage
<td colspan="2"> url="/images/icons/info_icon.gif" width="16" height="16" /><f:verbatim></td>
<%@ include file="../parts/titlebar.jsp" %> <td class="mainSubText"></f:verbatim><h:outputText
</td> value="#{msg.apply_rss_feed_warning1} " /> <a:actionLink
</tr> value="#{msg.manage_invited_users}"
actionListener="#{BrowseBean.setupSpaceAction}"
<%-- Main area --%> action="dialog:manageInvitedUsers">
<tr valign="top"> <f:param name="id" value="#{SpaceDetailsBean.id}" />
<%-- Shelf --%> </a:actionLink> <h:outputText value=" #{msg.apply_rss_feed_warning2}" /><f:verbatim></td>
<td> </tr>
<%@ include file="../parts/shelf.jsp" %> </table>
</td> <%
PanelGenerator.generatePanelEnd(out, request.getContextPath(),
<%-- Work Area --%> "yellowInner");
<td width="100%"> %>
<table cellspacing="0" cellpadding="0" width="100%">
<%-- Breadcrumb --%>
<%@ include file="../parts/breadcrumb.jsp" %>
<%-- Status and Actions --%>
<tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
<td bgcolor="#dfe6ed">
<%-- Status and Actions inner contents table --%>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
<table cellspacing="4" cellpadding="0" width="100%">
<tr>
<td width="32">
<h:graphicImage url="/images/icons/rss_large.gif"/>
</td>
<td>
<div class="mainTitle"><h:outputText value="#{msg.apply_rss_feed}" /> '<h:outputText value="#{SpaceDetailsBean.name}" />'</div>
<div class="mainSubText"><h:outputText value="#{msg.apply_rss_feed_info}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<%-- TODO: check for Guest user access and hide panel? --%>
<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><h:graphicImage url="/images/icons/info_icon.gif" width="16" height="16"/></td>
<td class="mainSubText">
<h:outputText value="#{msg.apply_rss_feed_warning1}" />
<a:actionLink value="#{msg.manage_invited_users}" actionListener="#{BrowseBean.setupSpaceAction}" action="dialog:manageInvitedUsers">
<f:param name="id" value="#{SpaceDetailsBean.id}" />
</a:actionLink>
<h:outputText value="#{msg.apply_rss_feed_warning2}" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner"); %>
<div style="padding:4px"></div>
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td><nobr><h:outputText value="#{msg.rss_template}"/>:</nobr></td>
<td width=100%>
<%-- Templates drop-down selector --%>
<h:selectOneMenu value="#{SpaceDetailsBean.RSSTemplate}">
<f:selectItems value="#{TemplateSupportBean.RSSTemplates}" />
</h:selectOneMenu>
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.ok}" actionListener="#{SpaceDetailsBean.applyRSSTemplate}" action="dialog:close" styleClass="wizardButton" />
</td>
</tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="dialog:close" styleClass="wizardButton" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page> <div style="padding:4px"></div>
<%
PanelGenerator.generatePanelStart(out, request.getContextPath(),
"white", "white");
%>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td><nobr></f:verbatim><h:outputText value="#{msg.rss_template}" /><f:verbatim>:</nobr></td>
<td width=100%><%-- Templates drop-down selector --%> </f:verbatim><h:selectOneMenu
value="#{ApplyRssTemplateDialog.RSSTemplate}">
<f:selectItems value="#{TemplateSupportBean.RSSTemplates}" />
</h:selectOneMenu><f:verbatim></td>
</tr>
</table>
<%
PanelGenerator.generatePanelEnd(out, request.getContextPath(),
"white");
%>
</td>
</tr>
</table>
</f:verbatim>

View File

@@ -22,136 +22,20 @@
* the FLOSS exception, and it is also available here: * the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing" * http://www.alfresco.com/legal/licensing"
--%> --%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ 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/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a"%>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r"%>
<%@ page buffer="64kb" contentType="text/html;charset=UTF-8" %> <f:verbatim>
<%@ page isELIgnored="false" %> <table cellpadding="2" cellspacing="2" border="0" width="100%">
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <tr>
<td></f:verbatim><h:outputText value="#{msg.template}" /><f:verbatim>:</td>
<r:page titleId="title_apply_template"> <td width=100%><%-- Templates drop-down selector --%> </f:verbatim><h:selectOneMenu
value="#{ApplySpaceTemplateDialog.template}">
<f:view> <f:selectItems value="#{TemplateSupportBean.contentTemplates}" />
</h:selectOneMenu><f:verbatim></td>
<%-- load a bundle of properties with I18N strings --%> </tr>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/> </table>
</f:verbatim>
<h:form acceptcharset="UTF-8" id="apply-template">
<%-- Main outer table --%>
<table cellspacing="0" cellpadding="2">
<%-- Title bar --%>
<tr>
<td colspan="2">
<%@ include file="../parts/titlebar.jsp" %>
</td>
</tr>
<%-- Main area --%>
<tr valign="top">
<%-- Shelf --%>
<td>
<%@ include file="../parts/shelf.jsp" %>
</td>
<%-- Work Area --%>
<td width="100%">
<table cellspacing="0" cellpadding="0" width="100%">
<%-- Breadcrumb --%>
<%@ include file="../parts/breadcrumb.jsp" %>
<%-- Status and Actions --%>
<tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
<td bgcolor="#dfe6ed">
<%-- Status and Actions inner contents table --%>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
<table cellspacing="4" cellpadding="0" width="100%">
<tr>
<td width="32">
<h:graphicImage url="/images/icons/preview_large.gif"/>
</td>
<td>
<div class="mainTitle"><h:outputText value="#{msg.apply_template}" /> '<h:outputText value="#{SpaceDetailsBean.name}" />'</div>
<div class="mainSubText"><h:outputText value="#{msg.apply_dashboard_info}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td><h:outputText value="#{msg.template}"/>:</td>
<td width=100%>
<%-- Templates drop-down selector --%>
<h:selectOneMenu value="#{SpaceDetailsBean.template}">
<f:selectItems value="#{TemplateSupportBean.contentTemplates}" />
</h:selectOneMenu>
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.ok}" actionListener="#{SpaceDetailsBean.applyTemplate}" action="dialog:close" styleClass="wizardButton" />
</td>
</tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="dialog:close" styleClass="wizardButton" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -32,7 +32,7 @@
<%@ page isELIgnored="false" %> <%@ page isELIgnored="false" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<%@ page import="org.alfresco.web.app.servlet.FacesHelper" %> <%@ page import="org.alfresco.web.app.servlet.FacesHelper" %>
<%@ page import="org.alfresco.web.bean.CheckinCheckoutBean" %> <%@ page import="org.alfresco.web.bean.CheckinCheckoutDialog" %>
<%@ page import="org.alfresco.web.app.Application" %> <%@ page import="org.alfresco.web.app.Application" %>
<%@ page import="javax.faces.context.FacesContext" %> <%@ page import="javax.faces.context.FacesContext" %>
@@ -82,7 +82,7 @@
<h:graphicImage id="wizard-logo" url="/images/icons/check_in_large.gif" /> <h:graphicImage id="wizard-logo" url="/images/icons/check_in_large.gif" />
</td> </td>
<td> <td>
<div class="mainTitle"><h:outputText value="#{msg.check_in}" /> '<h:outputText value="#{CheckinCheckoutBean.document.name}" />'</div> <div class="mainTitle"><h:outputText value="#{msg.check_in}" /> '<h:outputText value="#{CCProperties.document.name}" />'</div>
<div class="mainSubText"><h:outputText value="#{msg.checkinfile_description}" /></div> <div class="mainSubText"><h:outputText value="#{msg.checkinfile_description}" /></div>
</td> </td>
</tr> </tr>
@@ -113,13 +113,13 @@
<table cellpadding="1" cellspacing="1" border="0"> <table cellpadding="1" cellspacing="1" border="0">
<tr> <tr>
<td align="center"> <td align="center">
<h:commandButton value="#{msg.check_in}" action="#{CheckinCheckoutBean.checkinFileOK}" styleClass="dialogControls" /> <h:commandButton value="#{msg.check_in}" action="#{CheckinCheckoutDialog.checkinFileOK}" styleClass="dialogControls" />
</td> </td>
</tr> </tr>
<tr><td class="dialogButtonSpacing"></td></tr> <tr><td class="dialogButtonSpacing"></td></tr>
<tr> <tr>
<td align="center"> <td align="center">
<h:commandButton value="#{msg.cancel}" action="#{CheckinCheckoutBean.cancel}" styleClass="dialogControls" /> <h:commandButton value="#{msg.cancel}" action="#{CheckinCheckoutDialog.cancel}" styleClass="dialogControls" />
</td> </td>
</tr> </tr>
</table> </table>
@@ -135,19 +135,19 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<h:outputText value="#{msg.version_notes}<br/>" escape="false" rendered="#{CheckinCheckoutBean.versionable}" /> <h:outputText value="#{msg.version_notes}<br/>" escape="false" rendered="#{CheckinCheckoutDialog.versionable}" />
<h:inputTextarea value="#{CheckinCheckoutBean.versionNotes}" rendered="#{CheckinCheckoutBean.versionable}" rows="2" cols="50" /> <h:inputTextarea value="#{CCProperties.versionNotes}" rendered="#{CheckinCheckoutDialog.versionable}" rows="2" cols="50" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<h:selectBooleanCheckbox value="#{CheckinCheckoutBean.minorChange}" /> <h:selectBooleanCheckbox value="#{CCProperties.minorChange}" />
<span style="vertical-align:20%"><h:outputText value="#{msg.minor_change}" /></span> <span style="vertical-align:20%"><h:outputText value="#{msg.minor_change}" /></span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<h:selectBooleanCheckbox value="#{CheckinCheckoutBean.keepCheckedOut}" /> <h:selectBooleanCheckbox value="#{CCProperties.keepCheckedOut}" />
<span style="vertical-align:20%"><h:outputText value="#{msg.checkin_changes_info}" /></span> <span style="vertical-align:20%"><h:outputText value="#{msg.checkin_changes_info}" /></span>
</td> </td>
</tr> </tr>
@@ -163,8 +163,8 @@
<tr> <tr>
<td> <td>
<h:selectOneRadio value="#{CheckinCheckoutBean.copyLocation}" layout="pageDirection"> <h:selectOneRadio value="#{CCProperties.copyLocation}" layout="pageDirection">
<f:selectItem itemValue="current" itemDisabled="#{CheckinCheckoutBean.fileName != null}" itemLabel="#{msg.which_copy_current}" /> <f:selectItem itemValue="current" itemDisabled="#{CCProperties.fileName != null}" itemLabel="#{msg.which_copy_current}" />
<f:selectItem itemValue="other" itemLabel="#{msg.which_copy_other}" /> <f:selectItem itemValue="other" itemLabel="#{msg.which_copy_other}" />
</h:selectOneRadio> </h:selectOneRadio>
</td> </td>
@@ -200,7 +200,7 @@
</td> </td>
</tr> </tr>
<% <%
CheckinCheckoutBean bean = (CheckinCheckoutBean)FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "CheckinCheckoutBean"); CheckinCheckoutDialog bean = (CheckinCheckoutDialog)FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "CheckinCheckoutDialog");
if (bean != null && bean.getFileName() != null) { if (bean != null && bean.getFileName() != null) {
%> %>
<tr><td class="paddingRow"></td></tr> <tr><td class="paddingRow"></td></tr>
@@ -254,4 +254,4 @@
</f:view> </f:view>
</r:page> </r:page>

View File

@@ -28,187 +28,70 @@
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<r:page titleId="title_checkout_file_link"> <f:verbatim>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<f:view> <tr>
<td width="100%" valign="top">
<%-- load a bundle of properties with I18N strings --%> <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "yellowInner", "#ffffcc"); %>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/> <table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<%-- set the form name here --%> <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>
<h:form acceptcharset="UTF-8" id="checkout-link"> <td class="mainSubText">
</f:verbatim><h:outputFormat value="#{msg.copy_file_checkedout}">
<%-- Main outer table --%> <f:param value="#{CCProperties.document.name}" />
<table cellspacing="0" cellpadding="2"> </h:outputFormat><f:verbatim>
</td>
<%-- Title bar --%> </tr>
<tr> </table>
<td colspan="2"> <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner"); %>
<%@ include file="../parts/titlebar.jsp" %> </td>
</td> </tr>
</tr> <tr>
<td width="100%" valign="top">
<%-- Main area --%> <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<tr valign="top"> <table cellpadding="2" cellspacing="2" border="0" width="100%">
<%-- Shelf --%> <tr>
<td> <td class="mainSubTitle">
<%@ include file="../parts/shelf.jsp" %> </f:verbatim><h:outputText value="#{msg.edit_workingcopy_title}" /><f:verbatim>
</td> </td>
</tr>
<%-- Work Area --%> <tr>
<td width="100%"> <td class="mainSubText">
<table cellspacing="0" cellpadding="0" width="100%"> </f:verbatim><h:outputText value="#{msg.edit_workingcopy_info}" /><f:verbatim>
<%-- Breadcrumb --%> </td>
<%@ include file="../parts/breadcrumb.jsp" %> </tr>
<tr>
<%-- Status and Actions --%> <td style="padding:6px">
<tr> <%-- downloadable file link generated by CheckinCheckoutDialog --%>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td> </f:verbatim><a:actionLink styleClass="title" image="#{CCProperties.workingDocument.properties.fileType32}" value="#{CCProperties.workingDocument.name}" href="#{CCProperties.workingDocument.properties.url}" /><f:verbatim>
<td bgcolor="#dfe6ed"> </td>
</tr>
<%-- Status and Actions inner contents table --%> <tr>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%> <td>
<table cellspacing="4" cellpadding="0" width="100%"> </f:verbatim><h:outputText value="#{msg.download_complete}" /><f:verbatim>
<tr> </td>
<td width="32"> </tr>
<h:graphicImage id="wizard-logo" url="/images/icons/check_out_large.gif" /> <tr><td colspan="2" class="paddingRow"></td></tr>
</td> <tr>
<td> <td class="mainSubTitle">
<div class="mainTitle"><h:outputText value="#{msg.check_out_of}" /> '<h:outputText value="#{CheckinCheckoutBean.document.name}" />' <h:outputText value="#{msg.complete}" /></div> </f:verbatim><h:outputText value="#{msg.continue_working_title}" /><f:verbatim>
<div class="mainSubText"><h:outputText value="#{msg.checkoutfilelink_description}" /></div> </td>
</td> </tr>
</tr> <tr>
</table> <td class="mainSubText">
</f:verbatim><h:outputText value="#{msg.continue_working_info1}" /><f:verbatim>
</td> </td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td> </tr>
</tr> <tr>
<td class="mainSubText">
<%-- separator row with gradient shadow --%> </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">
<tr> </td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td> </tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td> </table>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td> <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</tr> </td>
</tr>
<%-- Details --%> </table>
<tr valign=top> </f:verbatim>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<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><h:graphicImage url="/images/icons/info_icon.gif" width="16" height="16"/></td>
<td class="mainSubText">
<h:outputFormat value="#{msg.copy_file_checkedout}">
<f:param value="#{CheckinCheckoutBean.document.name}" />
</h:outputFormat>
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner"); %>
</td>
<td valign="top" rowspan=2>
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.ok}" action="#{CheckinCheckoutBean.checkoutFileOK}" styleClass="dialogControls" />
</td>
</tr>
<tr><td class="dialogButtonSpacing"></td></tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.undocheckout}" action="#{CheckinCheckoutBean.undoCheckout}" styleClass="dialogControls" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
<tr>
<td width="100%" valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td class="mainSubTitle">
<h:outputText value="#{msg.edit_workingcopy_title}" />
</td>
</tr>
<tr>
<td class="mainSubText">
<h:outputText value="#{msg.edit_workingcopy_info}" />
</td>
</tr>
<tr>
<td style="padding:6px">
<%-- downloadable file link generated by CheckinCheckoutBean --%>
<a:actionLink styleClass="title" image="#{CheckinCheckoutBean.workingDocument.properties.fileType32}" value="#{CheckinCheckoutBean.workingDocument.name}" href="#{CheckinCheckoutBean.workingDocument.properties.url}" />
</td>
</tr>
<tr>
<td>
<h:outputText value="#{msg.download_complete}" />
</td>
</tr>
<tr><td colspan="2" class="paddingRow"></td></tr>
<tr>
<td class="mainSubTitle">
<h:outputText value="#{msg.continue_working_title}" />
</td>
</tr>
<tr>
<td class="mainSubText">
<h:outputText value="#{msg.continue_working_info1}" />
</td>
</tr>
<tr>
<td class="mainSubText">
<h:outputText value="#{msg.continue_working_info2}" /> <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>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- Error Messages --%>
<tr valign="top">
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<%-- messages tag to show messages not handled by other specific message tags --%>
<h:messages globalOnly="true" styleClass="errorMessage" layout="table" />
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -28,172 +28,56 @@
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<r:page titleId="title_checkout_file"> <f:verbatim>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<f:view>
<%-- load a bundle of properties with I18N strings --%>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
<%-- set the form name here --%>
<h:form acceptcharset="UTF-8" id="checkout-file">
<%-- Main outer table --%>
<table cellspacing="0" cellpadding="2">
<%-- Title bar --%>
<tr> <tr>
<td colspan="2"> <td width="100%" valign="top">
<%@ include file="../parts/titlebar.jsp" %> <% 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:outputFormat value="#{msg.copy_work_with}">
<f:param value="#{CCProperties.document.name}" />
</h:outputFormat><f:verbatim>
<br>
</f:verbatim><h:outputText value="#{msg.copy_checkin_changes}" /><f:verbatim>
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner"); %>
</td> </td>
</tr> </tr>
<tr>
<%-- Main area --%> <td width="100%" valign="top">
<tr valign="top"> <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<%-- Shelf --%> <table cellpadding="2" cellspacing="2" border="0">
<td>
<%@ include file="../parts/shelf.jsp" %>
</td>
<%-- Work Area --%>
<td width="100%">
<table cellspacing="0" cellpadding="0" width="100%">
<%-- Breadcrumb --%>
<%@ include file="../parts/breadcrumb.jsp" %>
<%-- Status and Actions --%>
<tr> <tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td> <td class="mainSubText"></f:verbatim><h:outputText value="#{msg.copy_store_prompt}" /><f:verbatim></td>
<td bgcolor="#dfe6ed">
<%-- Status and Actions inner contents table --%>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
<table cellspacing="4" cellpadding="0" width="100%">
<tr>
<td width="32">
<h:graphicImage id="wizard-logo" url="/images/icons/check_out_large.gif" />
</td>
<td>
<div class="mainTitle"><h:outputText value="#{msg.check_out}" /> '<h:outputText value="#{CheckinCheckoutBean.document.name}" />'</div>
<div class="mainSubText"><h:outputText value="#{msg.checkoutfile_description}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr> </tr>
<%-- separator row with gradient shadow --%>
<tr> <tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td> <td>
<table cellspacing="0" cellpadding="3" border="0" width="100%"> </f:verbatim><h:selectOneRadio value="#{CCProperties.copyLocation}" layout="pageDirection">
<tr> <f:selectItem itemValue="current" itemLabel="#{msg.store_space_current}" />
<td width="100%" valign="top"> <f:selectItem itemValue="other" itemLabel="#{msg.store_space_selected}:" />
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "yellowInner", "#ffffcc"); %> </h:selectOneRadio><f:verbatim>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td valign=top style="padding-top:2px" width=20><h:graphicImage url="/images/icons/info_icon.gif" width="16" height="16"/></td>
<td class="mainSubText">
<h:outputFormat value="#{msg.copy_work_with}">
<f:param value="#{CheckinCheckoutBean.document.name}" />
</h:outputFormat>
<br>
<h:outputText value="#{msg.copy_checkin_changes}" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner"); %>
</td>
<td valign="top" rowspan=2>
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.check_out}" action="#{CheckinCheckoutBean.checkoutFile}" styleClass="dialogControls" />
</td>
</tr>
<tr><td class="dialogButtonSpacing"></td></tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="dialog:close" styleClass="dialogControls" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
<tr>
<td width="100%" valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<table cellpadding="2" cellspacing="2" border="0">
<tr>
<td class="mainSubText"><h:outputText value="#{msg.copy_store_prompt}" /></td>
</tr>
<tr>
<td>
<h:selectOneRadio value="#{CheckinCheckoutBean.copyLocation}" layout="pageDirection">
<f:selectItem itemValue="current" itemLabel="#{msg.store_space_current}" />
<f:selectItem itemValue="other" itemLabel="#{msg.store_space_selected}:" />
</h:selectOneRadio>
</td>
</tr>
<tr>
<td style="padding-left:26px">
<%-- Space selector to allow user to pick a Space --%>
<r:spaceSelector id="space-selector" label="#{msg.select_space_prompt}"
value="#{CheckinCheckoutBean.selectedSpaceId}"
initialSelection="#{NavigationBean.currentNodeId}"
styleClass="selector"/>
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
</tr>
</table>
</td> </td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr> </tr>
<%-- Error Messages --%>
<tr valign="top">
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<%-- messages tag to show messages not handled by other specific message tags --%>
<h:messages globalOnly="true" styleClass="errorMessage" layout="table" />
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr> <tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td> <td style="padding-left:26px">
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td> <%-- Space selector to allow user to pick a Space --%>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td> </f:verbatim>
<r:spaceSelector id="space-selector" label="#{msg.select_space_prompt}"
value="#{CCProperties.selectedSpaceId}"
initialSelection="#{NavigationBean.currentNodeId}"
styleClass="selector"/><f:verbatim>
</td>
</tr> </tr>
</table> </table>
</td> <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</tr> </td>
</table> </tr>
</table>
</h:form> </f:verbatim>
</f:view>
</r:page>

View File

@@ -28,138 +28,16 @@
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> <f:verbatim>
<%@ page isELIgnored="false" %> <table cellpadding="2" cellspacing="2" border="0">
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <tr>
<td class="mainSubTitle">
<r:page titleId="title_delete_rule"> </f:verbatim>
<h:outputFormat value="#{msg.delete_rule_confirm}">
<f:view> <f:param value="#{DialogManager.bean.currentRule.title}"/>
</h:outputFormat>
<%-- load a bundle of properties with I18N strings --%> <f:verbatim>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/> </td>
</tr>
<%-- set the form name here --%> </table>
<h:form acceptcharset="UTF-8" id="delete-file"> </f:verbatim>
<%-- Main outer table --%>
<table cellspacing="0" cellpadding="2">
<%-- Title bar --%>
<tr>
<td colspan="2">
<%@ include file="../parts/titlebar.jsp" %>
</td>
</tr>
<%-- Main area --%>
<tr valign="top">
<%-- Shelf --%>
<td>
<%@ include file="../parts/shelf.jsp" %>
</td>
<%-- Work Area --%>
<td width="100%">
<table cellspacing="0" cellpadding="0" width="100%">
<%-- Breadcrumb --%>
<%@ include file="../parts/breadcrumb.jsp" %>
<%-- Status and Actions --%>
<tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
<td bgcolor="#dfe6ed">
<%-- Status and Actions inner contents table --%>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
<table cellspacing="4" cellpadding="0" width="100%">
<tr>
<td width="32">
<h:graphicImage url="/images/icons/delete_large.gif"/>
</td>
<td>
<div class="mainTitle"><h:outputText value="#{msg.delete_rule}" /> '<h:outputText value="#{RulesBean.currentRule.title}" />'</div>
<div class="mainSubText"><h:outputText value="#{msg.delete_rule_info}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<table cellspacing="0" cellpadding="4" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<table cellpadding="2" cellspacing="2" border="0">
<tr>
<td class="mainSubTitle">
<h:outputFormat value="#{msg.delete_rule_confirm}">
<f:param value="#{RulesBean.currentRule.title}"/>
</h:outputFormat>
</td>
</tr>
<tr>
<td>
<%-- Error Messages --%>
<%-- messages tag to show messages not handled by other specific message tags --%>
<h:messages globalOnly="true" styleClass="errorMessage" layout="table" />
<td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.yes}" action="#{RulesBean.deleteOK}" styleClass="dialogControls" />
</td>
</tr>
<tr><td class="dialogButtonSpacing"></td></tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.no}" action="browse" styleClass="dialogControls" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -146,7 +146,7 @@
<h:panelGroup id="dashboard-panel-facets"> <h:panelGroup id="dashboard-panel-facets">
<f:facet name="title"> <f:facet name="title">
<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write" id="evalChange"> <r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write" id="evalChange">
<a:actionLink id="actModify" value="#{msg.modify}" action="dialog:applyTemplate" showLink="false" image="/images/icons/preview.gif" style="padding-right:8px" /> <a:actionLink id="actModify" value="#{msg.modify}" action="dialog:applyDocTemplate" showLink="false" image="/images/icons/preview.gif" style="padding-right:8px" />
<a:actionLink id="actRemove" value="#{msg.remove}" actionListener="#{DocumentDetailsBean.removeTemplate}" showLink="false" image="/images/icons/delete.gif" /> <a:actionLink id="actRemove" value="#{msg.remove}" actionListener="#{DocumentDetailsBean.removeTemplate}" showLink="false" image="/images/icons/delete.gif" />
</r:permissionEvaluator> </r:permissionEvaluator>
</f:facet> </f:facet>
@@ -158,7 +158,7 @@
<tr> <tr>
<td align=left> <td align=left>
<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write" id="evalApply"> <r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write" id="evalApply">
<a:actionLink id="actDashboard" value="#{msg.apply_template}" rendered="#{!DocumentDetailsBean.hasCustomView}" action="dialog:applyTemplate" /> <a:actionLink id="actDashboard" value="#{msg.apply_template}" rendered="#{!DocumentDetailsBean.hasCustomView}" action="dialog:applyDocTemplate" />
</r:permissionEvaluator> </r:permissionEvaluator>
<a:panel id="template-panel" rendered="#{DocumentDetailsBean.hasCustomView}"> <a:panel id="template-panel" rendered="#{DocumentDetailsBean.hasCustomView}">
<div style="padding:4px;border: 1px dashed #cccccc"> <div style="padding:4px;border: 1px dashed #cccccc">
@@ -388,7 +388,7 @@
<f:facet name="title"> <f:facet name="title">
<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write"> <r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write">
<a:actionLink id="titleLink2" value="#{msg.title_edit_simple_workflow}" showLink="false" <a:actionLink id="titleLink2" value="#{msg.title_edit_simple_workflow}" showLink="false"
image="/images/icons/Change_details.gif" action="editSimpleWorkflow" image="/images/icons/Change_details.gif" action="dialog:editSimpleWorkflow"
rendered="#{DocumentDetailsBean.approveStepName != null}" /> rendered="#{DocumentDetailsBean.approveStepName != null}" />
</r:permissionEvaluator> </r:permissionEvaluator>
</f:facet> </f:facet>
@@ -396,7 +396,7 @@
<a:panel label="#{msg.workflows}" id="workflow-panel" facetsId="workflow-panel-facets" progressive="true" <a:panel label="#{msg.workflows}" id="workflow-panel" facetsId="workflow-panel-facets" progressive="true"
border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white"
expanded='#{DocumentDetailsBean.panels["workflow-panel"]}' expandedActionListener="#{DocumentDetailsBean.expandPanel}"> expanded='#{DocumentDetailsBean.panels["workflow-panel"]}' expandedActionListener="#{DocumentDetailsBean.expandPanel}">
<r:nodeWorkflowInfo id="workflow-info" value="#{DocumentDetailsBean.document}" /> <r:nodeWorkflowInfo id="workflow-info" value="#{EditSimpleWorkflowDialog.document}" />
</a:panel> </a:panel>
<div style="padding:4px"></div> <div style="padding:4px"></div>
@@ -405,7 +405,7 @@
<f:facet name="title"> <f:facet name="title">
<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write"> <r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write">
<a:actionLink id="titleLink3" value="#{msg.change_category}" showLink="false" image="/images/icons/Change_details.gif" <a:actionLink id="titleLink3" value="#{msg.change_category}" showLink="false" image="/images/icons/Change_details.gif"
action="editCategories" actionListener="#{DocumentDetailsBean.setupCategoriesForEdit}" /> action="dialog:editContentCategories" actionListener="#{DocumentDetailsBean.setupCategoriesForEdit}" />
</r:permissionEvaluator> </r:permissionEvaluator>
</f:facet> </f:facet>
</h:panelGroup> </h:panelGroup>

View File

@@ -28,150 +28,29 @@
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> <f:verbatim>
<%@ page isELIgnored="false" %> <table cellpadding="2" cellspacing="2" border="0" width="100%">
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <tr>
<td colspan="2" class="paddingRow"></td></tr>
<r:page titleId="title_edit_categories"> <tr>
<td></f:verbatim><h:outputText value="#{msg.categories}" /><f:verbatim>:</td>
<f:view> <td width="98%">
</f:verbatim>
<%-- load a bundle of properties with I18N strings --%> <r:multiValueSelector id="multi-category-selector"
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/> value="#{DocumentDetailsBean.categories}"
lastItemAdded="#{DocumentDetailsBean.addedCategory}"
<h:form acceptcharset="UTF-8" id="edit-category"> selectItemMsg="#{msg.select_category}"
selectedItemsMsg="#{msg.selected_categories}"
<%-- Main outer table --%> noSelectedItemsMsg="#{msg.no_selected_categories}"
<table cellspacing="0" cellpadding="2"> styleClass="selector">
<f:subview id="categorySelector">
<%-- Title bar --%> <r:categorySelector id="category-selector" label="#{msg.select_category_prompt}"
<tr> styleClass="selector" value="#{DocumentDetailsBean.addedCategory}" />
<td colspan="2"> </f:subview>
<%@ include file="../parts/titlebar.jsp" %> </r:multiValueSelector>
</td> <f:verbatim>
</tr> </td>
</tr>
<%-- Main area --%> <tr><td colspan="2" class="paddingRow"></td></tr>
<tr valign="top"> </table>
<%-- Shelf --%> </f:verbatim>
<td>
<%@ include file="../parts/shelf.jsp" %>
</td>
<%-- Work Area --%>
<td width="100%">
<table cellspacing="0" cellpadding="0" width="100%">
<%-- Breadcrumb --%>
<%@ include file="../parts/breadcrumb.jsp" %>
<%-- Status and Actions --%>
<tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
<td bgcolor="#dfe6ed">
<%-- Status and Actions inner contents table --%>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
<table cellspacing="4" cellpadding="0" width="100%">
<tr>
<td width="32">
<h:graphicImage id="wizard-logo" url="/images/icons/edit_large.gif" />
</td>
<td>
<div class="mainTitle"><h:outputText value="#{msg.modify_categories_of}" /> '<h:outputText value="#{BrowseBean.document.name}" />'</div>
<div class="mainSubText"><h:outputText value="#{msg.editcategory_description}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr><td colspan="2" class="paddingRow"></td></tr>
<tr>
<td><h:outputText value="#{msg.categories}" />:</td>
<td width="98%">
<r:multiValueSelector id="multi-category-selector"
value="#{DocumentDetailsBean.categories}"
lastItemAdded="#{DocumentDetailsBean.addedCategory}"
selectItemMsg="#{msg.select_category}"
selectedItemsMsg="#{msg.selected_categories}"
noSelectedItemsMsg="#{msg.no_selected_categories}"
styleClass="selector">
<r:categorySelector id="category-selector" label="#{msg.select_category_prompt}"
styleClass="selector"
value="#{DocumentDetailsBean.addedCategory}"/>
</r:multiValueSelector>
</td>
</tr>
<tr><td colspan="2" class="paddingRow"></td></tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.ok}" action="#{DocumentDetailsBean.saveCategories}" styleClass="wizardButton" />
</td>
</tr>
<tr><td class="wizardButtonSpacing"></td></tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="cancel" styleClass="wizardButton" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- Error Messages --%>
<tr valign="top">
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<%-- messages tag to show messages not handled by other specific message tags --%>
<h:messages globalOnly="true" styleClass="errorMessage" layout="table" />
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -28,172 +28,55 @@
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<r:page titleId="title_edit_file"> <f:verbatim>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<f:view> <tr>
<td class="mainSubTitle">
<%-- load a bundle of properties with I18N strings --%> </f:verbatim><h:outputText value="#{msg.edit_file_title}" /><f:verbatim>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/> </td>
</tr>
<%-- set the form name here --%> <tr>
<h:form acceptcharset="UTF-8" id="edit-file"> <td class="mainSubText">
</f:verbatim><h:outputFormat value="#{msg.edit_file_prompt}">
<%-- Main outer table --%> <f:param value="#{CCProperties.document.name}" />
<table cellspacing="0" cellpadding="2"> </h:outputFormat><f:verbatim>
</td>
<%-- Title bar --%> </tr>
<tr> <tr>
<td colspan="2"> <td style="padding:10px" valign="middle">
<%@ include file="../parts/titlebar.jsp" %> <%-- downloadable file link generated by CheckinCheckoutDialog --%>
</td> </f:verbatim><a:actionLink styleClass="title" image="#{CCProperties.document.properties.fileType32}" value="#{CCProperties.document.name}" href="#{CCProperties.document.properties.url}" /><f:verbatim>
</tr> </td>
</tr>
<%-- Main area --%> <tr>
<tr valign="top"> <td>
<%-- Shelf --%> </f:verbatim><h:outputText value="#{msg.edit_download_complete}" /><f:verbatim>
<td> </td>
<%@ include file="../parts/shelf.jsp" %> </tr>
</td>
<%-- Hide the checkout info if this document is already checked out --%>
<%-- Work Area --%> </f:verbatim><a:panel id="checkout-panel" rendered="#{CCProperties.document.properties.workingCopy == false}"><f:verbatim>
<td width="100%"> <tr><td class="paddingRow"></td></tr>
<table cellspacing="0" cellpadding="0" width="100%"> <tr>
<%-- Breadcrumb --%> <td class="mainSubTitle">
<%@ include file="../parts/breadcrumb.jsp" %> </f:verbatim><h:outputText value="#{msg.checkout_file_title}" /><f:verbatim>
</td>
<%-- Status and Actions --%> </tr>
<tr> <tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td> <td>
<td bgcolor="#dfe6ed"> </f:verbatim><h:outputText value="#{msg.checkout_you_may_want}" /><f:verbatim>
<div class="mainSubText" style="padding-top:6px;padding-left:2px">
<%-- Status and Actions inner contents table --%> </f:verbatim><a:actionLink value="#{msg.checkout}" image="/images/icons/CheckOut_icon.gif" actionListener="#{CCEditFileDialog.setupContentAction}" action="dialog:checkoutFile">
<%-- Generally this consists of an icon, textual summary and actions for the current object --%> <f:param name="id" value="#{CCProperties.document.id}" />
<table cellspacing="4" cellpadding="0" width="100%"> <f:param name="action" value="CHECKOUT_FILE" />
<tr> </a:actionLink><f:verbatim>
<td width="26"> </div>
<h:graphicImage id="wizard-logo" url="/images/icons/edit_large.gif" /> <div class="mainSubText" style="padding-top:6px"></f:verbatim><h:outputText value="#{msg.checkout_hint1}" /><f:verbatim></div>
</td> <div class="mainSubText"></f:verbatim><h:outputText value="#{msg.checkout_hint2}" /><f:verbatim></div>
<td> </td>
<div class="mainTitle">'<h:outputText value="#{CheckinCheckoutBean.document.name}" />'</div> </tr>
<div class="mainSubText"><h:outputText value="#{msg.editfile_description}" /></div> </f:verbatim></a:panel><f:verbatim>
</td> </table>
</tr> </f:verbatim>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td class="mainSubTitle">
<h:outputText value="#{msg.edit_file_title}" />
</td>
</tr>
<tr>
<td class="mainSubText">
<h:outputFormat value="#{msg.edit_file_prompt}">
<f:param value="#{CheckinCheckoutBean.document.name}" />
</h:outputFormat>
</td>
</tr>
<tr>
<td style="padding:10px" valign="middle">
<%-- downloadable file link generated by CheckinCheckoutBean --%>
<a:actionLink styleClass="title" image="#{CheckinCheckoutBean.document.properties.fileType32}" value="#{CheckinCheckoutBean.document.name}" href="#{CheckinCheckoutBean.document.properties.url}" />
</td>
</tr>
<tr>
<td>
<h:outputText value="#{msg.edit_download_complete}" />
</td>
</tr>
<%-- Hide the checkout info if this document is already checked out --%>
<a:panel id="checkout-panel" rendered="#{CheckinCheckoutBean.document.properties.workingCopy == false}">
<tr><td class="paddingRow"></td></tr>
<tr>
<td class="mainSubTitle">
<h:outputText value="#{msg.checkout_file_title}" />
</td>
</tr>
<tr>
<td>
<h:outputText value="#{msg.checkout_you_may_want}" />
<div class="mainSubText" style="padding-top:6px;padding-left:2px">
<a:actionLink value="#{msg.checkout}" image="/images/icons/CheckOut_icon.gif" actionListener="#{CheckinCheckoutBean.setupContentAction}" action="checkoutFile">
<f:param name="id" value="#{CheckinCheckoutBean.document.id}" />
</a:actionLink>
</div>
<div class="mainSubText" style="padding-top:6px"><h:outputText value="#{msg.checkout_hint1}" /></div>
<div class="mainSubText"><h:outputText value="#{msg.checkout_hint2}" /></div>
</td>
</tr>
</a:panel>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.close}" action="#{CheckinCheckoutBean.editFileOK}" styleClass="dialogControls" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- Error Messages --%>
<tr valign="top">
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<%-- messages tag to show messages not handled by other specific message tags --%>
<h:messages globalOnly="true" styleClass="errorMessage" layout="table" />
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -28,185 +28,74 @@
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<r:page titleId="title_edit_html_inline"> <f:verbatim>
<script language="javascript" type="text/javascript" src="<%=request.getContextPath()%>/scripts/tiny_mce/tiny_mce.js"></script> <script language="javascript" type="text/javascript" src="<%=request.getContextPath()%>/scripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript"> <script language="javascript" type="text/javascript">
<%-- Init the Tiny MCE in-line HTML editor --%> <%-- Init the Tiny MCE in-line HTML editor --%>
tinyMCE.init({ tinyMCE.init({
theme : "advanced", theme : "advanced",
mode : "exact", mode : "exact",
relative_urls: false, relative_urls: false,
elements : "editor", elements : "editor",
save_callback : "saveContent", save_callback : "saveContent",
plugins : "table", plugins : "table",
theme_advanced_toolbar_location : "top", theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left", theme_advanced_toolbar_align : "left",
theme_advanced_buttons1_add : "fontselect,fontsizeselect", theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,forecolor,backcolor", theme_advanced_buttons2_add : "separator,forecolor,backcolor",
theme_advanced_buttons3_add_before : "tablecontrols,separator", theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_disable: "styleselect", theme_advanced_disable: "styleselect",
extended_valid_elements : "a[href|target|name],font[face|size|color|style],span[class|align|style]" extended_valid_elements : "a[href|target|name],font[face|size|color|style],span[class|align|style]"
}); });
function saveContent(id, content) function saveContent(id, content)
{ {
document.forms['edit-file']['edit-file:editorOutput'].value = content; //document.forms['edit-file']['edit-file:editorOutput'].value = content;
} document.getElementById("dialog:dialog-body:editorOutput").value=content;
}
</script> </script>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<%-- Hide the checkout info if this document is already checked out --%>
</f:verbatim><a:panel id="checkout-panel" rendered="#{CCProperties.document.properties.workingCopy == false}"><f:verbatim>
<% 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><td class="mainSubText">
</f:verbatim><h:outputText value="#{msg.you_may_want}" />
<h:outputText value=" "/>
<a:actionLink value="#{msg.checkout_document}" actionListener="#{CCEditHtmlInlineDialog.setupContentAction}" action="dialog:checkoutFile">
<f:param name="id" value="#{CCProperties.document.id}" />
</a:actionLink>
<h:outputText value=" "/>
<h:outputText value="#{msg.checkout_want_to}" /><f:verbatim>
<br></f:verbatim>
<h:outputText value="#{msg.checkout_warn}" /><f:verbatim>
</td>
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner"); %>
</f:verbatim></a:panel><f:verbatim>
</td>
</tr>
<f:view> <%-- Inline editor --%>
<tr>
<%-- load a bundle of properties with I18N strings --%> <td width="100%" valign="top" height="100%">
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/> <div id='editor' style='width:100%; height:360px'>
</f:verbatim><h:outputText value="#{CCProperties.documentContent}" escape="false" /><f:verbatim>
<h:form acceptcharset="UTF-8" id="edit-file"> </div>
</f:verbatim><h:inputHidden id="editorOutput" value="#{CCProperties.editorOutput}" /><f:verbatim>
<%-- Main outer table --%> </td>
<table cellspacing="0" cellpadding="2"> </tr>
</table>
<%-- Title bar --%> </f:verbatim>
<tr>
<td colspan="2">
<%@ include file="../parts/titlebar.jsp" %>
</td>
</tr>
<%-- Main area --%>
<tr valign="top">
<%-- Shelf --%>
<td>
<%@ include file="../parts/shelf.jsp" %>
</td>
<%-- Work Area --%>
<td width="100%">
<table cellspacing="0" cellpadding="0" width="100%">
<%-- Breadcrumb --%>
<%@ include file="../parts/breadcrumb.jsp" %>
<%-- Status and Actions --%>
<tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
<td bgcolor="#dfe6ed">
<%-- Status and Actions inner contents table --%>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
<table cellspacing="4" cellpadding="0" width="100%">
<tr>
<td width="32">
<h:graphicImage id="wizard-logo" url="/images/icons/edit_large.gif" />
</td>
<td>
<div class="mainTitle">'<h:outputText value="#{CheckinCheckoutBean.document.name}" />'</div>
<div class="mainSubText"><h:outputText value="#{msg.editfileinline_description}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td height="100%">
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<%-- Hide the checkout info if this document is already checked out --%>
<a:panel id="checkout-panel" rendered="#{CheckinCheckoutBean.document.properties.workingCopy == false}">
<% 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><h:graphicImage url="/images/icons/info_icon.gif" width="16" height="16"/></td>
<td><td class="mainSubText">
<h:outputText value="#{msg.you_may_want}" />
<a:actionLink value="#{msg.checkout_document}" actionListener="#{CheckinCheckoutBean.setupContentAction}" action="checkoutFile">
<f:param name="id" value="#{CheckinCheckoutBean.document.id}" />
</a:actionLink>
<h:outputText value="#{msg.checkout_want_to}" />
<br>
<h:outputText value="#{msg.checkout_warn}" />
</td>
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner"); %>
</a:panel>
</td>
<td valign="top" rowspan=2>
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.save}" action="#{CheckinCheckoutBean.editInlineOK}" styleClass="dialogControls" />
</td>
</tr>
<tr><td class="dialogButtonSpacing"></td></tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="dialog:close" styleClass="dialogControls" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
<%-- Inline editor --%>
<tr>
<td width="100%" valign="top" height="100%">
<div id='editor' style='width:100%; height:360px'>
<h:outputText value="#{CheckinCheckoutBean.documentContent}" escape="false" />
</div>
<h:inputHidden id="editorOutput" value="#{CheckinCheckoutBean.editorOutput}" />
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- Error Messages --%>
<tr valign="top">
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<%-- messages tag to show messages not handled by other specific message tags --%>
<h:messages globalOnly="true" styleClass="errorMessage" layout="table" />
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -1,26 +1,26 @@
<%-- <%--
* Copyright (C) 2005-2007 Alfresco Software Limited. * 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, * This program is free software; you can redistribute it and/or
* but WITHOUT ANY WARRANTY; without even the implied warranty of * modify it under the terms of the GNU General Public License
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * as published by the Free Software Foundation; either version 2
* GNU General Public License for more details. * of the License, or (at your option) any later version.
* You should have received a copy of the GNU General Public License * This program is distributed in the hope that it will be useful,
* along with this program; if not, write to the Free Software * but WITHOUT ANY WARRANTY; without even the implied warranty of
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* As a special exception to the terms and conditions of version 2.0 of * You should have received a copy of the GNU General Public License
* the GPL, you may redistribute this Program in connection with Free/Libre * along with this program; if not, write to the Free Software
* and Open Source Software ("FLOSS") applications as described in Alfresco's * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here: * As a special exception to the terms and conditions of version 2.0 of
* http://www.alfresco.com/legal/licensing" * 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/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
@@ -28,174 +28,49 @@
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> <f:verbatim>
<%@ page isELIgnored="false" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<r:page titleId="title_edit_link_props">
<script language="JavaScript1.2"> <script language="JavaScript1.2">
function checkButtonState() function checkButtonState()
{ {
if (document.getElementById("edit-link-props:file-name").value.length == 0) if (document.getElementById("dialog:dialog-body:file-name").value.length == 0)
{ {
document.getElementById("edit-link-props:ok-button").disabled = true; document.getElementById("dialog:finish-button").disabled = true;
} }
else else
{ {
document.getElementById("edit-link-props:ok-button").disabled = false; document.getElementById("dialog:finish-button").disabled = false;
} }
} }
</script> </script>
<f:view> <table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<%-- load a bundle of properties with I18N strings --%> <td colspan="2" class="wizardSectionHeading"></f:verbatim><h:outputText value="#{msg.link_properties}" /><f:verbatim></td>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/> </tr>
<tr><td colspan="2" class="paddingRow"></td></tr>
<h:form acceptcharset="UTF-8" id="edit-link-props"> <tr>
<td><nobr></f:verbatim><h:outputText value="#{msg.file_name}" /><f:verbatim>:</nobr></td>
<%-- Main outer table --%> <td width="90%">
<table cellspacing="0" cellpadding="2"> </f:verbatim><h:inputText id="file-name" value="#{DialogManager.bean.properties.name}" size="35" maxlength="1024"
onkeyup="javascript:checkButtonState();" /><f:verbatim>&nbsp;*
<%-- Title bar --%> </td>
<tr> </tr>
<td colspan="2"> <tr>
<%@ include file="../parts/titlebar.jsp" %> <td><nobr></f:verbatim><h:outputText value="#{msg.title}" /><f:verbatim>:</nobr></td>
</td> <td>
</tr> </f:verbatim><h:inputText id="title" value="#{DialogManager.bean.properties.title}" size="35" maxlength="1024" /><f:verbatim>
</td>
<%-- Main area --%> </tr>
<tr valign="top"> <tr>
<%-- Shelf --%> <td><nobr></f:verbatim><h:outputText value="#{msg.description}" /><f:verbatim>:</nobr></td>
<td> <td>
<%@ include file="../parts/shelf.jsp" %> </f:verbatim><h:inputText value="#{DialogManager.bean.properties.description}" size="35" maxlength="1024" /><f:verbatim>
</td> </td>
</tr>
<%-- Work Area --%> <tr>
<td width="100%"> <td><nobr></f:verbatim><h:outputText value="#{msg.link_destination}" /><f:verbatim>:</nobr></td>
<table cellspacing="0" cellpadding="0" width="100%"> <td>
<%-- Breadcrumb --%> </f:verbatim><h:outputText value="#{DialogManager.bean.destinationPath}" /><f:verbatim>
<%@ include file="../parts/breadcrumb.jsp" %> </td>
</tr>
<%-- Status and Actions --%> </table></f:verbatim>
<tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
<td bgcolor="#dfe6ed">
<%-- Status and Actions inner contents table --%>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
<table cellspacing="4" cellpadding="0" width="100%">
<tr>
<td width="32">
<h:graphicImage id="wizard-logo" url="/images/icons/details_large.gif" />
</td>
<td>
<div class="mainTitle"><h:outputText value="#{msg.modify_props_of}" /> '<h:outputText value="#{LinkPropertiesBean.properties.name}" />'</div>
<div class="mainSubText"><h:outputText value="#{msg.editlink_description}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.link_properties}" /></td>
</tr>
<tr><td colspan="2" class="paddingRow"></td></tr>
<tr>
<td><nobr><h:outputText value="#{msg.file_name}" />:</nobr></td>
<td width="90%">
<h:inputText id="file-name" value="#{LinkPropertiesBean.properties.name}" size="35" maxlength="1024"
onkeyup="javascript:checkButtonState();" />&nbsp;*
</td>
</tr>
<tr>
<td><nobr><h:outputText value="#{msg.title}" />:</nobr></td>
<td>
<h:inputText id="title" value="#{LinkPropertiesBean.properties.title}" size="35" maxlength="1024" />
</td>
</tr>
<tr>
<td><nobr><h:outputText value="#{msg.description}" />:</nobr></td>
<td>
<h:inputText value="#{LinkPropertiesBean.properties.description}" size="35" maxlength="1024" />
</td>
</tr>
<tr>
<td><nobr><h:outputText value="#{msg.link_destination}" />:</nobr></td>
<td>
<h:outputText value="#{LinkPropertiesBean.destinationPath}" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton id="ok-button" value="#{msg.ok}" action="#{LinkPropertiesBean.save}" styleClass="wizardButton" />
</td>
</tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="#{LinkPropertiesBean.cancel}" styleClass="wizardButton" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- Error Messages --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width=4></td>
<td>
<%-- messages tag to show messages not handled by other specific message tags --%>
<h:messages globalOnly="true" styleClass="errorMessage" layout="table" />
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width=4></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -1,26 +1,26 @@
<%-- <%--
* Copyright (C) 2005-2007 Alfresco Software Limited. * 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, * This program is free software; you can redistribute it and/or
* but WITHOUT ANY WARRANTY; without even the implied warranty of * modify it under the terms of the GNU General Public License
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * as published by the Free Software Foundation; either version 2
* GNU General Public License for more details. * of the License, or (at your option) any later version.
* You should have received a copy of the GNU General Public License * This program is distributed in the hope that it will be useful,
* along with this program; if not, write to the Free Software * but WITHOUT ANY WARRANTY; without even the implied warranty of
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* As a special exception to the terms and conditions of version 2.0 of * You should have received a copy of the GNU General Public License
* the GPL, you may redistribute this Program in connection with Free/Libre * along with this program; if not, write to the Free Software
* and Open Source Software ("FLOSS") applications as described in Alfresco's * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here: * As a special exception to the terms and conditions of version 2.0 of
* http://www.alfresco.com/legal/licensing" * 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/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
@@ -32,180 +32,71 @@
<%@ page isELIgnored="false" %> <%@ page isELIgnored="false" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<r:page titleId="title_save_search">
<f:verbatim>
<script language="JavaScript1.2"> <script language="JavaScript1.2">
window.onload = pageLoaded; window.onload = pageLoaded;
function pageLoaded() function pageLoaded()
{ {
document.getElementById("save-search:name").focus(); document.getElementById("dialog:dialog-body:name").focus();
checkButtonState(); checkButtonState();
} }
function checkButtonState() function checkButtonState()
{ {
if (document.getElementById("save-search:name").value.length == 0 ) if (document.getElementById("dialog:dialog-body:name").value.length == 0 )
{ {
document.getElementById("save-search:ok-button").disabled = true; document.getElementById("dialog:finish-button").disabled = true;
} }
else else
{ {
document.getElementById("save-search:ok-button").disabled = false; document.getElementById("dialog:finish-button").disabled = false;
} }
} }
</script> </script>
<f:view> <table cellpadding="2" cellspacing="2" border="0" width="100%">
</f:verbatim><a:panel id="edit-panel" rendered="#{SearchProperties.editSearchName != null}">
<%-- load a bundle of properties with I18N strings --%> <f:verbatim>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/> <tr>
<td width="100%" valign="top" colspan="2" style="padding-bottom:6px">
<h:form acceptcharset="UTF-8" id="save-search"> <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "yellowInner", "#ffffcc"); %>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<%-- Main outer table --%> <tr>
<table cellspacing="0" cellpadding="2"> <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">
<%-- Title bar --%> </f:verbatim><h:outputFormat value="#{msg.saved_search_warning}">
<tr> <f:param value="#{SearchProperties.editSearchName}" />
<td colspan="2"> </h:outputFormat>
<%@ include file="../parts/titlebar.jsp" %> <f:verbatim>
</td> </td>
</tr> </tr>
</table>
<%-- Main area --%> <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner"); %>
<tr valign="top"> </td>
<%-- Shelf --%> </tr>
<td> </f:verbatim>
<%@ include file="../parts/shelf.jsp" %> </a:panel>
</td> <f:verbatim>
<tr>
<%-- Work Area --%> <td colspan="2" class="wizardSectionHeading"></f:verbatim><h:outputText value="#{msg.search_props}" /><f:verbatim></td>
<td width="100%"> </tr>
<table cellspacing="0" cellpadding="0" width="100%"> <tr>
<%-- Breadcrumb --%> <td></f:verbatim><h:outputText value="#{msg.name}" /><f:verbatim>:</td>
<%@ include file="../parts/breadcrumb.jsp" %> <td>
</f:verbatim><h:inputText id="name" value="#{SearchProperties.searchName}" size="35" maxlength="1024"
<%-- Status and Actions --%> onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();"/><f:verbatim>&nbsp;*
<tr> </td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td> </tr>
<td bgcolor="#dfe6ed"> <tr>
<td></f:verbatim><h:outputText value="#{msg.description}" /><f:verbatim>:</td>
<%-- Status and Actions inner contents table --%> <td></f:verbatim>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%> <h:inputText value="#{SearchProperties.searchDescription}" size="35" maxlength="1024" />
<table cellspacing="4" cellpadding="0" width="100%"> <f:verbatim>
<tr> </td>
<td width="32"> </tr>
<h:graphicImage id="wizard-logo" url="/images/icons/save_search_large.gif" /> </table>
</td> </f:verbatim>
<td>
<div class="mainTitle"><h:outputText value="#{msg.save_edit_search}" /></div>
<div class="mainSubText"><h:outputText value="#{msg.save_search_description}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<a:errors message="#{msg.error_wizard}" styleClass="errorMessage" />
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<a:panel id="edit-panel" rendered="#{AdvancedSearchBean.editSearchName != null}">
<tr>
<td width="100%" valign="top" colspan="2" style="padding-bottom:6px">
<% 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><h:graphicImage url="/images/icons/info_icon.gif" width="16" height="16"/></td>
<td class="mainSubText">
<h:outputFormat value="#{msg.saved_search_warning}">
<f:param value="#{AdvancedSearchBean.editSearchName}" />
</h:outputFormat>
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner"); %>
</td>
</tr>
</a:panel>
<tr>
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.search_props}" /></td>
</tr>
<tr>
<td><h:outputText value="#{msg.name}" />:</td>
<td>
<h:inputText id="name" value="#{AdvancedSearchBean.searchName}" size="35" maxlength="1024"
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();"/>&nbsp;*
</td>
</tr>
<tr>
<td><h:outputText value="#{msg.description}" />:</td>
<td>
<h:inputText value="#{AdvancedSearchBean.searchDescription}" size="35" maxlength="1024" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton id="ok-button" value="#{msg.save}" action="#{AdvancedSearchBean.saveEditSearchOK}"
styleClass="wizardButton" disabled="true" />
</td>
</tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="browse" styleClass="wizardButton" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -28,33 +28,28 @@
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> <f:verbatim>
<%@ page isELIgnored="false" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<r:page titleId="title_edit_simple_workflow">
<script language="JavaScript1.2"> <script language="JavaScript1.2">
window.onload = pageLoaded; window.onload = pageLoaded;
function pageLoaded() function pageLoaded()
{ {
document.getElementById("edit-simple-workflow:approve-step-name").focus(); document.getElementById("dialog:dialog-body:approve-step-name").focus();
checkButtonState(); checkButtonState();
} }
function checkButtonState() function checkButtonState()
{ {
if (document.getElementById("edit-simple-workflow:approve-step-name").value.length == 0 || if (document.getElementById("dialog:dialog-body:approve-step-name").value.length == 0 ||
document.getElementById("edit-simple-workflow:client-approve-folder_selected").value.length == 0 || document.getElementById("dialog:dialog-body:client-approve-folder_selected").value.length == 0 ||
rejectValid() == false) rejectValid() == false)
{ {
document.getElementById("edit-simple-workflow:ok-button").disabled = true; document.getElementById("dialog:finish-button").disabled = true;
} }
else else
{ {
document.getElementById("edit-simple-workflow:ok-button").disabled = false; document.getElementById("dialog:finish-button").disabled = false;
} }
} }
@@ -62,9 +57,9 @@
{ {
var result = true; var result = true;
if (document.forms['edit-simple-workflow']['edit-simple-workflow:reject-step-present'][0].checked && if (document.forms['dialog']['dialog:dialog-body:reject-step-present'][0].checked &&
(document.getElementById("edit-simple-workflow:reject-step-name").value.length == 0 || (document.getElementById("dialog:dialog-body:reject-step-name").value.length == 0 ||
document.getElementById("edit-simple-workflow:client-reject-folder_selected").value.length == 0)) document.getElementById("dialog:dialog-body:client-reject-folder_selected").value.length == 0))
{ {
result = false; result = false;
} }
@@ -73,225 +68,111 @@
} }
</script> </script>
<f:view> <table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<%-- load a bundle of properties with I18N strings --%> <td colspan="2" class="wizardSectionHeading"></f:verbatim><h:outputText
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/> value="#{msg.approve_flow}" /><f:verbatim></td>
</tr>
<h:form acceptcharset="UTF-8" id="edit-simple-workflow"> <tr>
<td><nobr></f:verbatim><h:outputText value="#{msg.name_approve_step}" /><f:verbatim>:</nobr></td>
<%-- Main outer table --%> <td width="90%"></f:verbatim><h:inputText id="approve-step-name"
<table cellspacing="0" cellpadding="2"> value="#{EditSimpleWorkflowDialog.workflowProperties.approveStepName}"
onkeyup="javascript:checkButtonState();" /><f:verbatim></td>
<%-- Title bar --%> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2" class="paddingRow"></td>
<%@ include file="../parts/titlebar.jsp" %> </tr>
</td> <tr>
</tr> <td colspan="2"></f:verbatim><h:outputText
value="#{msg.choose_copy_move_location}" /><f:verbatim></td>
<%-- Main area --%> <tr>
<tr valign="top"> <td colspan="2">
<%-- Shelf --%> <table cellpadding="2" cellspacing="2" border="0">
<td> <tr>
<%@ include file="../parts/shelf.jsp" %> <td valign="top"></f:verbatim><h:selectOneRadio
</td> value="#{EditSimpleWorkflowDialog.workflowProperties.approveAction}">
<f:selectItem itemValue="move" itemLabel="Move" />
<%-- Work Area --%> <f:selectItem itemValue="copy" itemLabel="Copy" />
<td width="100%"> </h:selectOneRadio><f:verbatim></td>
<table cellspacing="0" cellpadding="0" width="100%"> <td style="padding-left:6px;"></td>
<%-- Breadcrumb --%> <td valign="top" style="padding-top:10px;"></f:verbatim><h:outputText
<%@ include file="../parts/breadcrumb.jsp" %> value="#{msg.to}" /><f:verbatim>:</td>
<td style="padding-left:6px;"></td>
<%-- Status and Actions --%> <td style="padding-top:6px;"></f:verbatim><r:spaceSelector
<tr> id="client-approve-folder"
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td> label="#{msg.select_destination_prompt}"
<td bgcolor="#dfe6ed"> value="#{EditSimpleWorkflowDialog.workflowProperties.approveFolder}"
initialSelection="#{NavigationBean.currentNodeId}"
<%-- Status and Actions inner contents table --%> styleClass="selector" /><f:verbatim></td>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%> </tr>
<table cellspacing="4" cellpadding="0" width="100%"> </table>
<tr> </td>
<td width="32"> </tr>
<h:graphicImage id="wizard-logo" url="/images/icons/edit_large.gif" /> <tr>
</td> <td colspan="2" class="paddingRow"></td>
<td> </tr>
<div class="mainTitle"><h:outputText value="#{msg.modify_workflow_props}" /></div> <tr>
<div class="mainSubText"><h:outputText value="#{msg.editworkflow_description}" /></div> <td colspan="2" class="wizardSectionHeading"></f:verbatim><h:outputText
</td> value="#{msg.reject_flow}" /><f:verbatim></td>
</tr> </tr>
</table> <tr>
<td colspan="2"></f:verbatim><h:outputText value="#{msg.select_reject_step}" /><f:verbatim></td>
</td> </tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td> <tr>
</tr> <td></f:verbatim><h:selectOneRadio id="reject-step-present"
value="#{EditSimpleWorkflowDialog.workflowProperties.rejectStepPresent}"
<%-- separator row with gradient shadow --%> onclick="javascript:checkButtonState();">
<tr> <f:selectItem itemValue="yes" itemLabel="#{msg.yes}" />
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td> <f:selectItem itemValue="no" itemLabel="#{msg.no}" />
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td> </h:selectOneRadio><f:verbatim></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td> </tr>
</tr> <tr>
<td colspan="2">
<%-- Details --%> <table cellpadding="0" cellspacing="0" border="0">
<tr valign=top> <tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td> <td style="padding-left:24px;"></td>
<td> <td>
<table cellspacing="0" cellpadding="3" border="0" width="100%"> <table cellpadding="2" cellspacing="2" border="0">
<tr> <tr>
<td width="100%" valign="top"> <td><nobr> </f:verbatim><h:outputText
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> value="#{msg.name_reject_step}" /><f:verbatim>:&nbsp; </f:verbatim><h:inputText
<table cellpadding="2" cellspacing="2" border="0" width="100%"> id="reject-step-name"
<tr> value="#{EditSimpleWorkflowDialog.workflowProperties.rejectStepName}"
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.approve_flow}" /></td> onkeyup="javascript:checkButtonState();" /><f:verbatim> </nobr></td>
</tr> </tr>
<tr> <tr>
<td><nobr><h:outputText value="#{msg.name_approve_step}" />:</nobr></td> <td class="paddingRow"></td>
<td width="90%"> </tr>
<h:inputText id="approve-step-name" value="#{DocumentDetailsBean.workflowProperties.approveStepName}" <tr>
onkeyup="javascript:checkButtonState();" /> <td></f:verbatim><h:outputText value="#{msg.choose_copy_move_location}" /><f:verbatim></td>
</td> <tr>
</tr> <td>
<tr><td colspan="2" class="paddingRow"></td></tr> <table cellpadding="2" cellspacing="2" border="0">
<tr><td colspan="2"><h:outputText value="#{msg.choose_copy_move_location}" /></td> <tr>
<tr> <td valign="top"></f:verbatim><h:selectOneRadio
<td colspan="2"> value="#{DocumentDetailsBean.workflowProperties.rejectAction}">
<table cellpadding="2" cellspacing="2" border="0"> <f:selectItem itemValue="move" itemLabel="#{msg.move}" />
<tr> <f:selectItem itemValue="copy" itemLabel="#{msg.copy}" />
<td valign="top"> </h:selectOneRadio><f:verbatim></td>
<h:selectOneRadio value="#{DocumentDetailsBean.workflowProperties.approveAction}"> <td style="padding-left:6px;"></td>
<f:selectItem itemValue="move" itemLabel="Move" /> <td valign="top" style="padding-top:10px;"></f:verbatim><h:outputText
<f:selectItem itemValue="copy" itemLabel="Copy" /> value="#{msg.to}" /><f:verbatim>:</td>
</h:selectOneRadio> <td style="padding-left:6px;"></td>
</td> <td style="padding-top:6px;"></f:verbatim><r:spaceSelector
<td style="padding-left:6px;"></td> id="client-reject-folder"
<td valign="top" style="padding-top:10px;"><h:outputText value="#{msg.to}" />:</td> label="#{msg.select_destination_prompt}"
<td style="padding-left:6px;"></td> value="#{EditSimpleWorkflowDialog.workflowProperties.rejectFolder}"
<td style="padding-top:6px;"> initialSelection="#{NavigationBean.currentNodeId}"
<r:spaceSelector id="client-approve-folder" label="#{msg.select_destination_prompt}" styleClass="selector" /><f:verbatim></td>
value="#{DocumentDetailsBean.workflowProperties.approveFolder}" </tr>
initialSelection="#{NavigationBean.currentNodeId}" </table>
styleClass="selector"/> </td>
</td> </tr>
</tr> </table>
</table> </td>
</td> </tr>
</tr> </table>
<tr><td colspan="2" class="paddingRow"></td></tr> </td>
<tr> </tr>
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.reject_flow}" /></td> </table>
</tr> </f:verbatim>
<tr>
<td colspan="2"><h:outputText value="#{msg.select_reject_step}" /></td>
</tr>
<tr>
<td>
<h:selectOneRadio id="reject-step-present" value="#{DocumentDetailsBean.workflowProperties.rejectStepPresent}"
onclick="javascript:checkButtonState();">
<f:selectItem itemValue="yes" itemLabel="#{msg.yes}" />
<f:selectItem itemValue="no" itemLabel="#{msg.no}" />
</h:selectOneRadio>
</td>
</tr>
<tr>
<td colspan="2">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-left:24px;"></td>
<td>
<table cellpadding="2" cellspacing="2" border="0">
<tr>
<td><nobr>
<h:outputText value="#{msg.name_reject_step}" />:&nbsp;
<h:inputText id="reject-step-name" value="#{DocumentDetailsBean.workflowProperties.rejectStepName}"
onkeyup="javascript:checkButtonState();" />
</nobr></td>
</tr>
<tr><td class="paddingRow"></td></tr>
<tr><td><h:outputText value="#{msg.choose_copy_move_location}" /></td>
<tr>
<td>
<table cellpadding="2" cellspacing="2" border="0">
<tr>
<td valign="top">
<h:selectOneRadio value="#{DocumentDetailsBean.workflowProperties.rejectAction}">
<f:selectItem itemValue="move" itemLabel="#{msg.move}" />
<f:selectItem itemValue="copy" itemLabel="#{msg.copy}" />
</h:selectOneRadio>
</td>
<td style="padding-left:6px;"></td>
<td valign="top" style="padding-top:10px;"><h:outputText value="#{msg.to}" />:</td>
<td style="padding-left:6px;"></td>
<td style="padding-top:6px;">
<r:spaceSelector id="client-reject-folder"
label="#{msg.select_destination_prompt}"
value="#{DocumentDetailsBean.workflowProperties.rejectFolder}"
initialSelection="#{NavigationBean.currentNodeId}"
styleClass="selector"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton id="ok-button" value="#{msg.ok}" action="#{DocumentDetailsBean.saveWorkflow}"
styleClass="wizardButton" />
</td>
</tr>
<tr><td class="wizardButtonSpacing"></td></tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="#{DocumentDetailsBean.cancelWorkflowEdit}"
styleClass="wizardButton" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- Error Messages --%>
<tr valign="top">
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<%-- messages tag to show messages not handled by other specific message tags --%>
<h:messages globalOnly="true" styleClass="errorMessage" layout="table" />
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -1,26 +1,26 @@
<%-- <%--
* Copyright (C) 2005-2007 Alfresco Software Limited. * 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, * This program is free software; you can redistribute it and/or
* but WITHOUT ANY WARRANTY; without even the implied warranty of * modify it under the terms of the GNU General Public License
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * as published by the Free Software Foundation; either version 2
* GNU General Public License for more details. * of the License, or (at your option) any later version.
* You should have received a copy of the GNU General Public License * This program is distributed in the hope that it will be useful,
* along with this program; if not, write to the Free Software * but WITHOUT ANY WARRANTY; without even the implied warranty of
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* As a special exception to the terms and conditions of version 2.0 of * You should have received a copy of the GNU General Public License
* the GPL, you may redistribute this Program in connection with Free/Libre * along with this program; if not, write to the Free Software
* and Open Source Software ("FLOSS") applications as described in Alfresco's * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here: * As a special exception to the terms and conditions of version 2.0 of
* http://www.alfresco.com/legal/licensing" * 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/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
@@ -28,150 +28,29 @@
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> <f:verbatim>
<%@ page isELIgnored="false" %> <table cellpadding="2" cellspacing="2" border="0" width="100%">
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <tr><td colspan="2" class="paddingRow"></td></tr>
<tr>
<td></f:verbatim><h:outputText value="#{msg.categories}" /><f:verbatim>:</td>
<td width="98%">
</f:verbatim><r:multiValueSelector id="multi-category-selector"
value="#{SpaceDetailsBean.categories}"
lastItemAdded="#{SpaceDetailsBean.addedCategory}"
selectItemMsg="#{msg.select_category}"
selectedItemsMsg="#{msg.selected_categories}"
noSelectedItemsMsg="#{msg.no_selected_categories}"
styleClass="selector">
<f:subview id="categorySelector">
<r:categorySelector id="category-selector" label="#{msg.select_category_prompt}"
styleClass="selector"
value="#{SpaceDetailsBean.addedCategory}"/>
</f:subview>
</r:multiValueSelector>
<f:verbatim>
</td>
</tr>
<tr><td colspan="2" class="paddingRow"></td></tr>
</table>
</f:verbatim>
<r:page titleId="title_edit_categories">
<f:view>
<%-- load a bundle of properties with I18N strings --%>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
<h:form acceptcharset="UTF-8" id="edit-category">
<%-- Main outer table --%>
<table cellspacing="0" cellpadding="2">
<%-- Title bar --%>
<tr>
<td colspan="2">
<%@ include file="../parts/titlebar.jsp" %>
</td>
</tr>
<%-- Main area --%>
<tr valign="top">
<%-- Shelf --%>
<td>
<%@ include file="../parts/shelf.jsp" %>
</td>
<%-- Work Area --%>
<td width="100%">
<table cellspacing="0" cellpadding="0" width="100%">
<%-- Breadcrumb --%>
<%@ include file="../parts/breadcrumb.jsp" %>
<%-- Status and Actions --%>
<tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
<td bgcolor="#dfe6ed">
<%-- Status and Actions inner contents table --%>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
<table cellspacing="4" cellpadding="0" width="100%">
<tr>
<td width="32">
<h:graphicImage id="wizard-logo" url="/images/icons/edit_large.gif" />
</td>
<td>
<div class="mainTitle"><h:outputText value="#{msg.modify_categories_of}" /> '<h:outputText value="#{BrowseBean.actionSpace.name}" />'</div>
<div class="mainSubText"><h:outputText value="#{msg.editcategory_space_description}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr><td colspan="2" class="paddingRow"></td></tr>
<tr>
<td><h:outputText value="#{msg.categories}" />:</td>
<td width="98%">
<r:multiValueSelector id="multi-category-selector"
value="#{SpaceDetailsBean.categories}"
lastItemAdded="#{SpaceDetailsBean.addedCategory}"
selectItemMsg="#{msg.select_category}"
selectedItemsMsg="#{msg.selected_categories}"
noSelectedItemsMsg="#{msg.no_selected_categories}"
styleClass="selector">
<r:categorySelector id="category-selector" label="#{msg.select_category_prompt}"
styleClass="selector"
value="#{SpaceDetailsBean.addedCategory}"/>
</r:multiValueSelector>
</td>
</tr>
<tr><td colspan="2" class="paddingRow"></td></tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.ok}" action="#{SpaceDetailsBean.saveCategories}" styleClass="wizardButton" />
</td>
</tr>
<tr><td class="wizardButtonSpacing"></td></tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="cancel" styleClass="wizardButton" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- Error Messages --%>
<tr valign="top">
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<%-- messages tag to show messages not handled by other specific message tags --%>
<h:messages globalOnly="true" styleClass="errorMessage" layout="table" />
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -22,39 +22,38 @@
* the FLOSS exception, and it is also available here: * the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing" * http://www.alfresco.com/legal/licensing"
--%> --%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ 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/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a"%>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r"%>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> <%@ page buffer="32kb" contentType="text/html;charset=UTF-8"%>
<%@ page isELIgnored="false" %> <%@ page isELIgnored="false"%>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <%@ page import="org.alfresco.web.ui.common.PanelGenerator"%>
<r:page titleId="title_edit_simple_workflow">
<f:verbatim>
<script language="JavaScript1.2"> <script language="JavaScript1.2">
window.onload = pageLoaded; window.onload = pageLoaded;
function pageLoaded() function pageLoaded()
{ {
document.getElementById("edit-simple-workflow:approve-step-name").focus(); document.getElementById("dialog:dialog-body:approve-step-name").focus();
checkButtonState(); checkButtonState();
} }
function checkButtonState() function checkButtonState()
{ {
if (document.getElementById("edit-simple-workflow:approve-step-name").value.length == 0 || if (document.getElementById("dialog:dialog-body:approve-step-name").value.length == 0 ||
document.getElementById("edit-simple-workflow:client-approve-folder_selected").value.length == 0 || document.getElementById("dialog:dialog-body:client-approve-folder_selected").value.length == 0 ||
rejectValid() == false) rejectValid() == false)
{ {
document.getElementById("edit-simple-workflow:ok-button").disabled = true; document.getElementById("dialog:finish-button").disabled = true;
} }
else else
{ {
document.getElementById("edit-simple-workflow:ok-button").disabled = false; document.getElementById("dialog:finish-button").disabled = false;
} }
} }
@@ -62,9 +61,9 @@
{ {
var result = true; var result = true;
if (document.forms['edit-simple-workflow']['edit-simple-workflow:reject-step-present'][0].checked && if (document.forms['dialog']['dialog:dialog-body:reject-step-present'][0].checked &&
(document.getElementById("edit-simple-workflow:reject-step-name").value.length == 0 || (document.getElementById("dialog:dialog-body:reject-step-name").value.length == 0 ||
document.getElementById("edit-simple-workflow:client-reject-folder_selected").value.length == 0)) document.getElementById("dialog:dialog-body:client-reject-folder_selected").value.length == 0))
{ {
result = false; result = false;
} }
@@ -73,225 +72,111 @@
} }
</script> </script>
<f:view> <table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<%-- load a bundle of properties with I18N strings --%> <td colspan="2" class="wizardSectionHeading"></f:verbatim><h:outputText
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/> value="#{msg.approve_flow}" /><f:verbatim></td>
</tr>
<h:form acceptcharset="UTF-8" id="edit-simple-workflow"> <tr>
<td><nobr></f:verbatim><h:outputText value="#{msg.name_approve_step}" /><f:verbatim>:</nobr></td>
<%-- Main outer table --%> <td width="90%"></f:verbatim><h:inputText id="approve-step-name"
<table cellspacing="0" cellpadding="2"> value="#{EditSpaceSimpleWorkflowDialog.workflowProperties.approveStepName}"
onkeyup="javascript:checkButtonState();" /><f:verbatim></td>
<%-- Title bar --%> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2" class="paddingRow"></td>
<%@ include file="../parts/titlebar.jsp" %> </tr>
</td> <tr>
</tr> <td colspan="2"></f:verbatim><h:outputText
value="#{msg.choose_copy_move_location}" /><f:verbatim></td>
<%-- Main area --%> <tr>
<tr valign="top"> <td colspan="2">
<%-- Shelf --%> <table cellpadding="2" cellspacing="2" border="0">
<td> <tr>
<%@ include file="../parts/shelf.jsp" %> <td valign="top"></f:verbatim><h:selectOneRadio
</td> value="#{EditSpaceSimpleWorkflowDialog.workflowProperties.approveAction}">
<f:selectItem itemValue="move" itemLabel="Move" />
<%-- Work Area --%> <f:selectItem itemValue="copy" itemLabel="Copy" />
<td width="100%"> </h:selectOneRadio><f:verbatim></td>
<table cellspacing="0" cellpadding="0" width="100%"> <td style="padding-left:6px;"></td>
<%-- Breadcrumb --%> <td valign="top" style="padding-top:10px;"></f:verbatim><h:outputText
<%@ include file="../parts/breadcrumb.jsp" %> value="#{msg.to}" /><f:verbatim>:</td>
<td style="padding-left:6px;"></td>
<%-- Status and Actions --%> <td style="padding-top:6px;"></f:verbatim><r:spaceSelector
<tr> id="client-approve-folder"
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td> label="#{msg.select_destination_prompt}"
<td bgcolor="#dfe6ed"> value="#{EditSpaceSimpleWorkflowDialog.workflowProperties.approveFolder}"
initialSelection="#{NavigationBean.currentNodeId}"
<%-- Status and Actions inner contents table --%> styleClass="selector" /><f:verbatim></td>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%> </tr>
<table cellspacing="4" cellpadding="0" width="100%"> </table>
<tr> </td>
<td width="32"> </tr>
<h:graphicImage id="wizard-logo" url="/images/icons/edit_large.gif" /> <tr>
</td> <td colspan="2" class="paddingRow"></td>
<td> </tr>
<div class="mainTitle"><h:outputText value="#{msg.modify_workflow_props}" /></div> <tr>
<div class="mainSubText"><h:outputText value="#{msg.editworkflow_description}" /></div> <td colspan="2" class="wizardSectionHeading"></f:verbatim><h:outputText
</td> value="#{msg.reject_flow}" /><f:verbatim></td>
</tr> </tr>
</table> <tr>
<td colspan="2"></f:verbatim><h:outputText value="#{msg.select_reject_step}" /><f:verbatim></td>
</td> </tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td> <tr>
</tr> <td></f:verbatim><h:selectOneRadio id="reject-step-present"
value="#{EditSpaceSimpleWorkflowDialog.workflowProperties.rejectStepPresent}"
<%-- separator row with gradient shadow --%> onclick="javascript:checkButtonState();">
<tr> <f:selectItem itemValue="yes" itemLabel="#{msg.yes}" />
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td> <f:selectItem itemValue="no" itemLabel="#{msg.no}" />
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td> </h:selectOneRadio><f:verbatim></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td> </tr>
</tr> <tr>
<td colspan="2">
<%-- Details --%> <table cellpadding="0" cellspacing="0" border="0">
<tr valign=top> <tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td> <td style="padding-left:24px;"></td>
<td> <td>
<table cellspacing="0" cellpadding="3" border="0" width="100%"> <table cellpadding="2" cellspacing="2" border="0">
<tr> <tr>
<td width="100%" valign="top"> <td><nobr> </f:verbatim><h:outputText
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> value="#{msg.name_reject_step}" /><f:verbatim>:&nbsp; </f:verbatim><h:inputText
<table cellpadding="2" cellspacing="2" border="0" width="100%"> id="reject-step-name"
<tr> value="#{EditSpaceSimpleWorkflowDialog.workflowProperties.rejectStepName}"
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.approve_flow}" /></td> onkeyup="javascript:checkButtonState();" /><f:verbatim> </nobr></td>
</tr> </tr>
<tr> <tr>
<td><nobr><h:outputText value="#{msg.name_approve_step}" />:</nobr></td> <td class="paddingRow"></td>
<td width="90%"> </tr>
<h:inputText id="approve-step-name" value="#{SpaceDetailsBean.workflowProperties.approveStepName}" <tr>
onkeyup="javascript:checkButtonState();" /> <td></f:verbatim><h:outputText value="#{msg.choose_copy_move_location}" /><f:verbatim></td>
</td> <tr>
</tr> <td>
<tr><td colspan="2" class="paddingRow"></td></tr> <table cellpadding="2" cellspacing="2" border="0">
<tr><td colspan="2"><h:outputText value="#{msg.choose_copy_move_location}" /></td> <tr>
<tr> <td valign="top"></f:verbatim><h:selectOneRadio
<td colspan="2"> value="#{EditSpaceSimpleWorkflowDialog.workflowProperties.rejectAction}">
<table cellpadding="2" cellspacing="2" border="0"> <f:selectItem itemValue="move" itemLabel="#{msg.move}" />
<tr> <f:selectItem itemValue="copy" itemLabel="#{msg.copy}" />
<td valign="top"> </h:selectOneRadio><f:verbatim></td>
<h:selectOneRadio value="#{SpaceDetailsBean.workflowProperties.approveAction}"> <td style="padding-left:6px;"></td>
<f:selectItem itemValue="move" itemLabel="Move" /> <td valign="top" style="padding-top:10px;"></f:verbatim><h:outputText
<f:selectItem itemValue="copy" itemLabel="Copy" /> value="#{msg.to}" /><f:verbatim>:</td>
</h:selectOneRadio> <td style="padding-left:6px;"></td>
</td> <td style="padding-top:6px;"></f:verbatim><r:spaceSelector
<td style="padding-left:6px;"></td> id="client-reject-folder"
<td valign="top" style="padding-top:10px;"><h:outputText value="#{msg.to}" />:</td> label="#{msg.select_destination_prompt}"
<td style="padding-left:6px;"></td> value="#{EditSpaceSimpleWorkflowDialog.workflowProperties.rejectFolder}"
<td style="padding-top:6px;"> initialSelection="#{NavigationBean.currentNodeId}"
<r:spaceSelector id="client-approve-folder" label="#{msg.select_destination_prompt}" styleClass="selector" /><f:verbatim></td>
value="#{SpaceDetailsBean.workflowProperties.approveFolder}" </tr>
initialSelection="#{NavigationBean.currentNodeId}" </table>
styleClass="selector"/> </td>
</td> </tr>
</tr> </table>
</table> </td>
</td> </tr>
</tr> </table>
<tr><td colspan="2" class="paddingRow"></td></tr> </td>
<tr> </tr>
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.reject_flow}" /></td> </table>
</tr> </f:verbatim>
<tr>
<td colspan="2"><h:outputText value="#{msg.select_reject_step}" /></td>
</tr>
<tr>
<td>
<h:selectOneRadio id="reject-step-present" value="#{SpaceDetailsBean.workflowProperties.rejectStepPresent}"
onclick="javascript:checkButtonState();">
<f:selectItem itemValue="yes" itemLabel="#{msg.yes}" />
<f:selectItem itemValue="no" itemLabel="#{msg.no}" />
</h:selectOneRadio>
</td>
</tr>
<tr>
<td colspan="2">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-left:24px;"></td>
<td>
<table cellpadding="2" cellspacing="2" border="0">
<tr>
<td><nobr>
<h:outputText value="#{msg.name_reject_step}" />:&nbsp;
<h:inputText id="reject-step-name" value="#{SpaceDetailsBean.workflowProperties.rejectStepName}"
onkeyup="javascript:checkButtonState();" />
</nobr></td>
</tr>
<tr><td class="paddingRow"></td></tr>
<tr><td><h:outputText value="#{msg.choose_copy_move_location}" /></td>
<tr>
<td>
<table cellpadding="2" cellspacing="2" border="0">
<tr>
<td valign="top">
<h:selectOneRadio value="#{SpaceDetailsBean.workflowProperties.rejectAction}">
<f:selectItem itemValue="move" itemLabel="#{msg.move}" />
<f:selectItem itemValue="copy" itemLabel="#{msg.copy}" />
</h:selectOneRadio>
</td>
<td style="padding-left:6px;"></td>
<td valign="top" style="padding-top:10px;"><h:outputText value="#{msg.to}" />:</td>
<td style="padding-left:6px;"></td>
<td style="padding-top:6px;">
<r:spaceSelector id="client-reject-folder"
label="#{msg.select_destination_prompt}"
value="#{SpaceDetailsBean.workflowProperties.rejectFolder}"
initialSelection="#{NavigationBean.currentNodeId}"
styleClass="selector"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton id="ok-button" value="#{msg.ok}" action="#{SpaceDetailsBean.saveWorkflow}"
styleClass="wizardButton" />
</td>
</tr>
<tr><td class="wizardButtonSpacing"></td></tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="#{SpaceDetailsBean.cancelWorkflowEdit}"
styleClass="wizardButton" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- Error Messages --%>
<tr valign="top">
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<%-- messages tag to show messages not handled by other specific message tags --%>
<h:messages globalOnly="true" styleClass="errorMessage" layout="table" />
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -28,157 +28,44 @@
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<r:page titleId="title_edit_text_inline"> <f:verbatim>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<%-- Hide the checkout info if this document is already checked out --%>
</f:verbatim><a:panel id="checkout-panel" rendered="#{CCProperties.document.properties.workingCopy == false}"><f:verbatim>
<% 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><td class="mainSubText">
</f:verbatim><h:outputText value="#{msg.you_may_want}" />
<h:outputText value=" "/>
<a:actionLink value="#{msg.checkout_document}" actionListener="#{CCEditTextInlineDialog.setupContentAction}" action="dialog:checkoutFile">
<f:param name="id" value="#{CCProperties.document.id}" />
</a:actionLink>
<h:outputText value=" "/>
<h:outputText value="#{msg.checkout_want_to}" /><f:verbatim>
<br>
</f:verbatim><h:outputText value="#{msg.checkout_warn}" /><f:verbatim>
</td>
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner"); %>
</f:verbatim></a:panel><f:verbatim>
</td>
</tr>
<f:view> <%-- Inline editor --%>
<tr>
<%-- load a bundle of properties with I18N strings --%> <td width="100%" valign="top" height="100%">
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/> <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
</f:verbatim><h:inputTextarea id="textArea" rows="24" cols="120" value="#{CCProperties.editorOutput}" /><f:verbatim>
<h:form acceptcharset="UTF-8" id="edit-file"> <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<%-- Main outer table --%> </tr>
<table cellspacing="0" cellpadding="2"> </table>
</f:verbatim>
<%-- Title bar --%>
<tr>
<td colspan="2">
<%@ include file="../parts/titlebar.jsp" %>
</td>
</tr>
<%-- Main area --%>
<tr valign="top">
<%-- Shelf --%>
<td>
<%@ include file="../parts/shelf.jsp" %>
</td>
<%-- Work Area --%>
<td width="100%">
<table cellspacing="0" cellpadding="0" width="100%">
<%-- Breadcrumb --%>
<%@ include file="../parts/breadcrumb.jsp" %>
<%-- Status and Actions --%>
<tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
<td bgcolor="#dfe6ed">
<%-- Status and Actions inner contents table --%>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
<table cellspacing="4" cellpadding="0" width="100%">
<tr>
<td width="32">
<h:graphicImage id="wizard-logo" url="/images/icons/edit_large.gif" />
</td>
<td>
<div class="mainTitle">'<h:outputText value="#{CheckinCheckoutBean.document.name}" />'</div>
<div class="mainSubText"><h:outputText value="#{msg.editfileinline_description}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td height="100%">
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<%-- Hide the checkout info if this document is already checked out --%>
<a:panel id="checkout-panel" rendered="#{CheckinCheckoutBean.document.properties.workingCopy == false}">
<% 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><h:graphicImage url="/images/icons/info_icon.gif" width="16" height="16"/></td>
<td><td class="mainSubText">
<h:outputText value="#{msg.you_may_want}" />
<a:actionLink value="#{msg.checkout_document}" actionListener="#{CheckinCheckoutBean.setupContentAction}" action="checkoutFile">
<f:param name="id" value="#{CheckinCheckoutBean.document.id}" />
</a:actionLink>
<h:outputText value="#{msg.checkout_want_to}" />
<br>
<h:outputText value="#{msg.checkout_warn}" />
</td>
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner"); %>
</a:panel>
</td>
<td valign="top" rowspan=2>
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.save}" action="#{CheckinCheckoutBean.editInlineOK}" styleClass="dialogControls" />
</td>
</tr>
<tr><td class="dialogButtonSpacing"></td></tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="dialog:close" styleClass="dialogControls" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
<%-- Inline editor --%>
<tr>
<td width="100%" valign="top" height="100%">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<h:inputTextarea id="textArea" rows="24" cols="120" value="#{CheckinCheckoutBean.editorOutput}" />
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- Error Messages --%>
<tr valign="top">
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<%-- messages tag to show messages not handled by other specific message tags --%>
<h:messages globalOnly="true" styleClass="errorMessage" layout="table" />
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -28,220 +28,100 @@
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> <f:verbatim>
<%@ page isELIgnored="false" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<r:page titleId="title_export">
<script language="JavaScript1.2"> <script language="JavaScript1.2">
window.onload = pageLoaded; window.onload = pageLoaded;
function pageLoaded() function pageLoaded()
{ {
document.getElementById("export-form:package-name").focus(); document.getElementById("dialog:dialog-body:package-name").focus();
checkButtonState(); checkButtonState();
} }
function checkButtonState() function checkButtonState()
{ {
if (document.getElementById("export-form:package-name").value.length == 0 || if (document.getElementById("dialog:dialog-body:package-name").value.length == 0 ||
document.getElementById("export-form:destination_selected").value.length == 0) document.getElementById("dialog:dialog-body:destination_selected").value.length == 0)
{ {
document.getElementById("export-form:ok-button").disabled = true; document.getElementById("dialog:finish-button").disabled = true;
} }
else else
{ {
document.getElementById("export-form:ok-button").disabled = false; document.getElementById("dialog:finish-button").disabled = false;
} }
} }
</script> </script>
<f:view> <table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<%-- load a bundle of properties with I18N strings --%> <td><nobr></f:verbatim><h:outputText value="#{msg.package_name}"/><f:verbatim>:</nobr></td>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/> <td width="90%">
</f:verbatim><h:inputText id="package-name" value="#{DialogManager.bean.packageName}" size="35" maxlength="1024"
<h:form acceptcharset="UTF-8" id="export-form"> onkeyup="javascript:checkButtonState();" /><f:verbatim>
</td>
<%-- Main outer table --%> </tr>
<table cellspacing="0" cellpadding="2"> <tr><td class="paddingRow"></td></tr>
<tr>
<%-- Title bar --%> <td><nobr></f:verbatim><h:outputText value="#{msg.destination}"/><f:verbatim>:</nobr></td>
<tr> <td>
<td colspan="2"> </f:verbatim><r:spaceSelector id="destination" label="#{msg.select_destination_prompt}"
<%@ include file="../parts/titlebar.jsp" %> value="#{DialogManager.bean.destination}"
</td> initialSelection="#{NavigationBean.currentNodeId}"
</tr> styleClass="selector"/><f:verbatim>
</td>
<%-- Main area --%> </tr>
<tr valign="top"> <tr><td class="paddingRow"></td></tr>
<%-- Shelf --%> <tr>
<td> <td><nobr></f:verbatim><h:outputText value="#{msg.export_from}:" rendered="#{NavigationBean.currentUser.admin == true}"/><f:verbatim></nobr></td>
<%@ include file="../parts/shelf.jsp" %> <td>
</td> </f:verbatim><h:selectOneRadio value="#{DialogManager.bean.mode}" layout="pageDirection" rendered="#{NavigationBean.currentUser.admin == true}">
<f:selectItem itemValue="all" itemLabel="#{msg.all_spaces_root}" />
<%-- Work Area --%> <f:selectItem itemValue="current" itemLabel="#{msg.current_space}" />
<td width="100%"> </h:selectOneRadio><f:verbatim>
<table cellspacing="0" cellpadding="0" width="100%"> </td>
<%-- Breadcrumb --%> </tr>
<%@ include file="../parts/breadcrumb.jsp" %> <%--
<tr>
<%-- Status and Actions --%> <td><nobr></f:verbatim><h:outputText value="#{msg.encoding}"/><f:verbatim>:</nobr></td>
<tr> <td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td> </f:verbatim><h:selectOneMenu value="#{DialogManager.bean.encoding}">
<td bgcolor="#dfe6ed"> <f:selectItems value="#{NewRuleWizard.encodings}" />
</h:selectOneMenu><f:verbatim>
<%-- Status and Actions inner contents table --%> </td>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%> </tr>
<table cellspacing="4" cellpadding="0" width="100%"> --%>
<tr> <tr>
<td width="32"> <td>&nbsp;</td>
<h:graphicImage id="wizard-logo" url="/images/icons/export_large.gif" /> <td>
</td> </f:verbatim><h:outputText value="<span style='padding-left: 24px'/>" escape="false" rendered="#{NavigationBean.currentUser.admin == true}"/>
<td> <h:selectBooleanCheckbox value="#{DialogManager.bean.includeChildren}"/><f:verbatim>&nbsp;
<div class="mainTitle"><h:outputText value="#{msg.export}"/> '<h:outputText value='#{BrowseBean.actionSpace.name}' />'</div> <span style="vertical-align:20%"></f:verbatim><h:outputText value="#{msg.include_children}"/><f:verbatim></span>
<div class="mainSubText"><h:outputText value="#{msg.export_info}"/></div> </td>
</td> </tr>
</tr> <tr>
</table> <td>&nbsp;</td>
<td>
</td> </f:verbatim><h:outputText value="<span style='padding-left: 24px'/>" escape="false" rendered="#{NavigationBean.currentUser.admin == true}"/>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td> <h:selectBooleanCheckbox value="#{DialogManager.bean.includeSelf}"/><f:verbatim>&nbsp;
</tr> <span style="vertical-align:20%"></f:verbatim><h:outputText value="#{msg.include_self}"/><f:verbatim></span>
</td>
<%-- separator row with gradient shadow --%> </tr>
<tr> <tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td> <td>&nbsp;</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td> <td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td> </f:verbatim><h:outputText value="<span style='padding-left: 5px'/>" escape="false" rendered="#{NavigationBean.currentUser.admin == true}"/>
</tr> <h:selectBooleanCheckbox value="#{DialogManager.bean.runInBackground}" /><f:verbatim>&nbsp;
<span style="vertical-align:20%"></f:verbatim><h:outputText value="#{msg.run_export_in_background}"/><f:verbatim></span>
<%-- Details --%> </td>
<tr valign=top> </tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td> <tr>
<td> <td>&nbsp;</td>
<table cellspacing="0" cellpadding="3" border="0" width="100%"> <td>
<tr> <div id="error-info" style="padding-left: 30px;">
<td width="100%" valign="top"> </f:verbatim><h:graphicImage alt="" value="/images/icons/info_icon.gif" style="vertical-align: middle;"/><f:verbatim>&nbsp;&nbsp;</f:verbatim>
<h:outputText value="#{msg.export_error_info}"/><f:verbatim>
<a:errors message="#{msg.error_export_all}" styleClass="errorMessage" /> </div>
</td>
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> </tr>
<table cellpadding="2" cellspacing="2" border="0" width="100%"> <tr><td class="paddingRow"></td></tr>
<tr> </table></f:verbatim>
<td><nobr><h:outputText value="#{msg.package_name}"/>:</nobr></td>
<td width="90%">
<h:inputText id="package-name" value="#{ExportDialog.packageName}" size="35" maxlength="1024"
onkeyup="javascript:checkButtonState();" />
</td>
</tr>
<tr><td class="paddingRow"></td></tr>
<tr>
<td><nobr><h:outputText value="#{msg.destination}"/>:</nobr></td>
<td>
<r:spaceSelector id="destination" label="#{msg.select_destination_prompt}"
value="#{ExportDialog.destination}"
initialSelection="#{NavigationBean.currentNodeId}"
styleClass="selector"/>
</td>
</tr>
<tr><td class="paddingRow"></td></tr>
<tr>
<td><nobr><h:outputText value="#{msg.export_from}:" rendered="#{NavigationBean.currentUser.admin == true}"/></nobr></td>
<td>
<h:selectOneRadio value="#{ExportDialog.mode}" layout="pageDirection" rendered="#{NavigationBean.currentUser.admin == true}">
<f:selectItem itemValue="all" itemLabel="#{msg.all_spaces_root}" />
<f:selectItem itemValue="current" itemLabel="#{msg.current_space}" />
</h:selectOneRadio>
</td>
</tr>
<%--
<tr>
<td><nobr><h:outputText value="#{msg.encoding}"/>:</nobr></td>
<td>
<h:selectOneMenu value="#{ExportDialog.encoding}">
<f:selectItems value="#{NewRuleWizard.encodings}" />
</h:selectOneMenu>
</td>
</tr>
--%>
<tr>
<td>&nbsp;</td>
<td>
<h:outputText value="<span style='padding-left: 24px'/>" escape="false" rendered="#{NavigationBean.currentUser.admin == true}"/>
<h:selectBooleanCheckbox value="#{ExportDialog.includeChildren}"/>&nbsp;
<span style="vertical-align:20%"><h:outputText value="#{msg.include_children}"/></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<h:outputText value="<span style='padding-left: 24px'/>" escape="false" rendered="#{NavigationBean.currentUser.admin == true}"/>
<h:selectBooleanCheckbox value="#{ExportDialog.includeSelf}"/>&nbsp;
<span style="vertical-align:20%"><h:outputText value="#{msg.include_self}"/></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<h:outputText value="<span style='padding-left: 5px'/>" escape="false" rendered="#{NavigationBean.currentUser.admin == true}"/>
<h:selectBooleanCheckbox value="#{ExportDialog.runInBackground}" />&nbsp;
<span style="vertical-align:20%"><h:outputText value="#{msg.run_export_in_background}"/></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<div id="error-info" style="padding-left: 30px;">
<h:graphicImage alt="" value="/images/icons/info_icon.gif" style="vertical-align: middle;"/>&nbsp;
<h:outputText value="#{msg.export_error_info}"/>
</div>
</td>
</tr>
<tr><td class="paddingRow"></td></tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton id="ok-button" value="#{msg.ok}" action="#{ExportDialog.export}"
disabled="true" styleClass="wizardButton"/>
</td>
</tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel}" action="#{ExportDialog.cancel}"
styleClass="wizardButton"/>
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -145,7 +145,7 @@
<a:panel id="link-panel" rendered="#{NavigationBean.inPortalServer == false}"> <a:panel id="link-panel" rendered="#{NavigationBean.inPortalServer == false}">
<tr> <tr>
<td colspan=3> <td colspan=3>
<a href='<%=request.getContextPath()%><a:outputText value="#{LinkPropertiesBean.fileLinkBookmarkUrl}" id="out5" />'><a:outputText value="#{msg.link_destination_details}" id="out6" /></a> <a href='<%=request.getContextPath()%><a:outputText value="#{LinkPropertiesDialog.fileLinkBookmarkUrl}" id="out5" />'><a:outputText value="#{msg.link_destination_details}" id="out6" /></a>
</td> </td>
</tr> </tr>
</a:panel> </a:panel>
@@ -158,7 +158,7 @@
<f:facet name="title"> <f:facet name="title">
<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write"> <r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write">
<a:actionLink id="titleLink1" value="#{msg.modify}" showLink="false" image="/images/icons/Change_details.gif" <a:actionLink id="titleLink1" value="#{msg.modify}" showLink="false" image="/images/icons/Change_details.gif"
action="editLinkProperties" actionListener="#{LinkPropertiesBean.setupFileLinkForAction}" /> action="dialog:editLinkProperties" actionListener="#{LinkPropertiesDialog.setupFileLinkForAction}" />
</r:permissionEvaluator> </r:permissionEvaluator>
</f:facet> </f:facet>
</h:panelGroup> </h:panelGroup>

View File

@@ -87,14 +87,14 @@
<td style="padding-left:4px" width=80> <td style="padding-left:4px" width=80>
<%-- More actions menu --%> <%-- More actions menu --%>
<a:menu id="actionsMenu" itemSpacing="4" label="#{msg.more_actions}" image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu" style="white-space:nowrap"> <a:menu id="actionsMenu" itemSpacing="4" label="#{msg.more_actions}" image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu" style="white-space:nowrap">
<r:actions id="acts_rules" value="rules_actions_menu" context="#{RulesBean.space}" /> <r:actions id="acts_rules" value="rules_actions_menu" context="#{RulesDialog.space}" />
</a:menu> </a:menu>
</td> </td>
<td class="separator" width=1><img src="<%=request.getContextPath()%>/images/parts/dotted_separator.gif" border=0 height=29 width=1></td> <td class="separator" width=1><img src="<%=request.getContextPath()%>/images/parts/dotted_separator.gif" border=0 height=29 width=1></td>
<td width="125" style="padding-left:2px"> <td width="125" style="padding-left:2px">
<%-- Filters --%> <%-- Filters --%>
<a:modeList itemSpacing="3" iconColumnWidth="20" selectedStyleClass="statusListHighlight" <a:modeList itemSpacing="3" iconColumnWidth="20" selectedStyleClass="statusListHighlight"
value="#{RulesBean.viewMode}" actionListener="#{RulesBean.viewModeChanged}" menu="true" menuImage="/images/icons/menu.gif" styleClass="moreActionsMenu" value="#{RulesDialog.viewMode}" actionListener="#{RulesDialog.viewModeChanged}" menu="true" menuImage="/images/icons/menu.gif" styleClass="moreActionsMenu"
selectedImage="/images/icons/filter.gif"> selectedImage="/images/icons/filter.gif">
<a:listItem value="inherited" label="#{msg.inherited}" /> <a:listItem value="inherited" label="#{msg.inherited}" />
<a:listItem value="local" label="#{msg.local}" /> <a:listItem value="local" label="#{msg.local}" />
@@ -118,7 +118,7 @@
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td> <td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td> <td>
<h:panelGroup rendered="#{RulesBean.ignoreInheritedRules}"> <h:panelGroup rendered="#{RulesDialog.ignoreInheritedRules}">
<tr height='5'><td></td></tr> <tr height='5'><td></td></tr>
<tr> <tr>
<td> <td>
@@ -155,11 +155,11 @@
<%-- Rules List --%> <%-- Rules List --%>
<a:panel id="rules-panel" border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" styleClass="mainSubTitle" label="#{msg.rules}"> <a:panel id="rules-panel" border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" styleClass="mainSubTitle" label="#{msg.rules}">
<a:richList id="rulesList" viewMode="details" value="#{RulesBean.rules}" var="r" <a:richList id="rulesList" viewMode="details" value="#{RulesDialog.rules}" var="r"
styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow" styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow"
altRowStyleClass="recordSetRowAlt" width="100%" pageSize="10" altRowStyleClass="recordSetRowAlt" width="100%" pageSize="10"
initialSortColumn="createdDate" initialSortDescending="false" initialSortColumn="createdDate" initialSortDescending="false"
binding="#{RulesBean.richList}"> binding="#{RulesDialog.richList}">
<%-- Primary column for details view mode --%> <%-- Primary column for details view mode --%>
<a:column primary="true" width="200" style="padding:2px;text-align:left"> <a:column primary="true" width="200" style="padding:2px;text-align:left">
@@ -170,7 +170,7 @@
<h:panelGroup> <h:panelGroup>
<a:booleanEvaluator value="#{r.local}"> <a:booleanEvaluator value="#{r.local}">
<a:actionLink value="#{r.title}" image="/images/icons/rule.gif" <a:actionLink value="#{r.title}" image="/images/icons/rule.gif"
actionListener="#{RulesBean.setupRuleAction}" action="wizard:editRule" actionListener="#{RulesDialog.setupRuleAction}" action="wizard:editRule"
showLink="false"> showLink="false">
<f:param name="id" value="#{r.id}" /> <f:param name="id" value="#{r.id}" />
</a:actionLink> </a:actionLink>
@@ -181,7 +181,7 @@
</h:panelGroup> </h:panelGroup>
</f:facet> </f:facet>
<a:booleanEvaluator value="#{r.local}"> <a:booleanEvaluator value="#{r.local}">
<a:actionLink value="#{r.title}" actionListener="#{RulesBean.setupRuleAction}" <a:actionLink value="#{r.title}" actionListener="#{RulesDialog.setupRuleAction}"
action="wizard:editRule"> action="wizard:editRule">
<f:param name="id" value="#{r.id}" /> <f:param name="id" value="#{r.id}" />
</a:actionLink> </a:actionLink>
@@ -247,12 +247,12 @@
<a:booleanEvaluator value="#{r.local}"> <a:booleanEvaluator value="#{r.local}">
<a:actionLink value="#{msg.delete}" image="/images/icons/delete.gif" showLink="false" <a:actionLink value="#{msg.delete}" image="/images/icons/delete.gif" showLink="false"
styleClass="inlineAction" styleClass="inlineAction"
actionListener="#{RulesBean.setupRuleAction}" action="deleteRule"> actionListener="#{RulesDialog.setupRuleAction}" action="dialog:deleteRule">
<f:param name="id" value="#{r.id}" /> <f:param name="id" value="#{r.id}" />
</a:actionLink> </a:actionLink>
<a:actionLink value="#{msg.change_details}" image="/images/icons/change_rule.gif" <a:actionLink value="#{msg.change_details}" image="/images/icons/change_rule.gif"
showLink="false" styleClass="inlineAction" showLink="false" styleClass="inlineAction"
actionListener="#{RulesBean.setupRuleAction}" action="wizard:editRule"> actionListener="#{RulesDialog.setupRuleAction}" action="wizard:editRule">
<f:param name="id" value="#{r.id}" /> <f:param name="id" value="#{r.id}" />
</a:actionLink> </a:actionLink>
</a:booleanEvaluator> </a:booleanEvaluator>
@@ -307,4 +307,4 @@
</f:view> </f:view>
</r:page> </r:page>

Some files were not shown because too many files have changed in this diff Show More