mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Add done-editing
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8162 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -131,6 +131,7 @@ no_icons_found=No icons found
|
||||
required_field=Required Field
|
||||
|
||||
# UI Component messages
|
||||
done=Done
|
||||
yes=Yes
|
||||
no=No
|
||||
no_not_now=No not now
|
||||
@@ -609,6 +610,13 @@ file_location=Location
|
||||
minor_change=Minor Change
|
||||
major_change=Major Change
|
||||
notes=Notes
|
||||
new_version_has=This new version has
|
||||
minor_changes=Minor Changes
|
||||
major_changes=Major Changes
|
||||
done_editing_title=New Version info for
|
||||
done_editing=Done Editing
|
||||
version_info=Version Info
|
||||
not_versionable=No version info, because this document isn't versionable.
|
||||
|
||||
# Check-out messages
|
||||
check_out=Check Out
|
||||
|
@@ -0,0 +1,65 @@
|
||||
|
||||
package org.alfresco.web.bean.coci;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.service.cmr.version.Version;
|
||||
import org.alfresco.web.app.Application;
|
||||
|
||||
/**
|
||||
* This bean class handle done-editing(commit) dialog.
|
||||
*
|
||||
*/
|
||||
public class CCDoneEditingDialog extends CheckinCheckoutDialog
|
||||
{
|
||||
|
||||
private final static String MSG_DONE = "done";
|
||||
private final static String MSG_TITLE = "done_editing_title";
|
||||
|
||||
/**
|
||||
* @return Returns label for new version with major changes
|
||||
*/
|
||||
public String getMajorNewVersionLabel()
|
||||
{
|
||||
Version curVersion = property.getVersionQueryService().getCurrentVersion(property.getDocument().getNodeRef());
|
||||
StringTokenizer st = new StringTokenizer(curVersion.getVersionLabel(), ".");
|
||||
return (Integer.valueOf(st.nextToken()) + 1) + ".0";
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns label for new version with minor changes
|
||||
*/
|
||||
public String getMinorNewVersionLabel()
|
||||
{
|
||||
Version curVersion = property.getVersionQueryService().getCurrentVersion(property.getDocument().getNodeRef());
|
||||
StringTokenizer st = new StringTokenizer(curVersion.getVersionLabel(), ".");
|
||||
return st.nextToken() + "." + (Integer.valueOf(st.nextToken()) + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
return checkinFileOK(context, outcome);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFinishButtonLabel()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_DONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getFinishButtonDisabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContainerTitle()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_TITLE) + " '" + property.getDocument().getName() + "'";
|
||||
}
|
||||
|
||||
}
|
@@ -29,6 +29,7 @@ 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.version.VersionService;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowService;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
|
||||
@@ -38,6 +39,9 @@ public class CCProperties
|
||||
/** The VersionOperationsService to be used by the bean */
|
||||
protected CheckOutCheckInService versionOperationsService;
|
||||
|
||||
/** The VersionQueryService to be used by the bean */
|
||||
protected VersionService versionQueryService;
|
||||
|
||||
/** The ContentService to be used by the bean */
|
||||
protected ContentService contentService;
|
||||
|
||||
@@ -89,6 +93,23 @@ public class CCProperties
|
||||
this.versionOperationsService = versionOperationsService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the VersionQueryService.
|
||||
*/
|
||||
public VersionService getVersionQueryService()
|
||||
{
|
||||
return this.versionQueryService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param versionQueryService
|
||||
* The VersionQueryService to set.
|
||||
*/
|
||||
public void setVersionQueryService(VersionService versionQueryService)
|
||||
{
|
||||
this.versionQueryService = versionQueryService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the ContentService.
|
||||
*/
|
||||
|
@@ -28,6 +28,7 @@ import java.io.Serializable;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.event.ActionEvent;
|
||||
|
@@ -1301,6 +1301,10 @@
|
||||
<managed-bean-name>CCProperties</managed-bean-name>
|
||||
<managed-bean-class>org.alfresco.web.bean.coci.CCProperties</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
<managed-property>
|
||||
<property-name>versionQueryService</property-name>
|
||||
<value>#{VersionService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>versionOperationsService</property-name>
|
||||
<value>#{CheckoutCheckinService}</value>
|
||||
@@ -5443,6 +5447,19 @@
|
||||
</managed-property>
|
||||
</managed-bean>
|
||||
|
||||
<managed-bean>
|
||||
<description>The bean for the Done-Editing File Screen(New commit dialog).</description>
|
||||
<managed-bean-name>CCDoneEditingDialog</managed-bean-name>
|
||||
<managed-bean-class>
|
||||
org.alfresco.web.bean.coci.CCDoneEditingDialog
|
||||
</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
<managed-property>
|
||||
<property-name>property</property-name>
|
||||
<value>#{CCProperties}</value>
|
||||
</managed-property>
|
||||
</managed-bean>
|
||||
|
||||
<managed-bean>
|
||||
<description>The bean for the Edit Search Screen.</description>
|
||||
<managed-bean-name>EditSearchDialog</managed-bean-name>
|
||||
|
BIN
source/web/images/icons/done_editing.gif
Normal file
BIN
source/web/images/icons/done_editing.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 859 B |
90
source/web/jsp/coci/done-editing.jsp
Normal file
90
source/web/jsp/coci/done-editing.jsp
Normal 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"
|
||||
--%>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
||||
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a"%>
|
||||
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r"%>
|
||||
|
||||
<%@ page import="org.alfresco.web.bean.coci.CCDoneEditingDialog"%>
|
||||
|
||||
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8"%>
|
||||
<%@ page isELIgnored="false"%>
|
||||
|
||||
|
||||
|
||||
<f:verbatim>
|
||||
<table cellspacing="0" cellpadding="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td> </f:verbatim>
|
||||
<a:booleanEvaluator value="#{CCDoneEditingDialog.versionable}"> <f:verbatim>
|
||||
<table cellpadding="2" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="wizardSectionHeading"></f:verbatim> <h:outputText value="#{msg.version_info}" /> <f:verbatim></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </f:verbatim>
|
||||
<h:outputText value="#{msg.new_version_has}" escape="false" />
|
||||
<f:verbatim> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </f:verbatim>
|
||||
<h:selectOneRadio value="#{CCProperties.minorChange}">
|
||||
<f:selectItem itemValue="true" itemLabel="#{msg.minor_changes} (#{CCDoneEditingDialog.minorNewVersionLabel})" />
|
||||
<f:verbatim> <br/> </f:verbatim>
|
||||
<f:selectItem itemValue="false" itemLabel="#{msg.major_changes} (#{CCDoneEditingDialog.majorNewVersionLabel})" />
|
||||
</h:selectOneRadio>
|
||||
<f:verbatim> <!-- </span> --><br/> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </f:verbatim>
|
||||
<h:outputText value="#{msg.version_notes}" escape="false" />
|
||||
<f:verbatim> </br> </f:verbatim>
|
||||
<h:inputTextarea value="#{CCProperties.versionNotes}" rows="4" cols="50" />
|
||||
<f:verbatim> </span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paddingRow"></td>
|
||||
</tr>
|
||||
</table> </f:verbatim>
|
||||
</a:booleanEvaluator>
|
||||
<a:booleanEvaluator value="#{!CCDoneEditingDialog.versionable}"> <f:verbatim>
|
||||
<table cellpadding="2" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="wizardSectionHeading"></f:verbatim> <h:outputText value="#{msg.not_versionable}" /> <f:verbatim></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </f:verbatim>
|
||||
<h:outputText value="#{msg.check_in}?" escape="false" />
|
||||
<f:verbatim> </td>
|
||||
</tr>
|
||||
</table> </f:verbatim>
|
||||
</a:booleanEvaluator>
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</f:verbatim>
|
Reference in New Issue
Block a user