mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Change minor and major version labels
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8168 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,11 +1,16 @@
|
|||||||
|
|
||||||
package org.alfresco.web.bean.coci;
|
package org.alfresco.web.bean.coci;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
import javax.faces.context.FacesContext;
|
import javax.faces.context.FacesContext;
|
||||||
|
|
||||||
|
import org.alfresco.model.ContentModel;
|
||||||
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.version.Version;
|
import org.alfresco.service.cmr.version.Version;
|
||||||
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23,8 +28,8 @@ public class CCDoneEditingDialog extends CheckinCheckoutDialog
|
|||||||
*/
|
*/
|
||||||
public String getMajorNewVersionLabel()
|
public String getMajorNewVersionLabel()
|
||||||
{
|
{
|
||||||
Version curVersion = property.getVersionQueryService().getCurrentVersion(property.getDocument().getNodeRef());
|
String label = getCurrentVersionLabel();
|
||||||
StringTokenizer st = new StringTokenizer(curVersion.getVersionLabel(), ".");
|
StringTokenizer st = new StringTokenizer(label, ".");
|
||||||
return (Integer.valueOf(st.nextToken()) + 1) + ".0";
|
return (Integer.valueOf(st.nextToken()) + 1) + ".0";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,17 +38,11 @@ public class CCDoneEditingDialog extends CheckinCheckoutDialog
|
|||||||
*/
|
*/
|
||||||
public String getMinorNewVersionLabel()
|
public String getMinorNewVersionLabel()
|
||||||
{
|
{
|
||||||
Version curVersion = property.getVersionQueryService().getCurrentVersion(property.getDocument().getNodeRef());
|
String label = getCurrentVersionLabel();
|
||||||
StringTokenizer st = new StringTokenizer(curVersion.getVersionLabel(), ".");
|
StringTokenizer st = new StringTokenizer(label, ".");
|
||||||
return st.nextToken() + "." + (Integer.valueOf(st.nextToken()) + 1);
|
return st.nextToken() + "." + (Integer.valueOf(st.nextToken()) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
|
||||||
{
|
|
||||||
return checkinFileOK(context, outcome);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFinishButtonLabel()
|
public String getFinishButtonLabel()
|
||||||
{
|
{
|
||||||
@@ -62,4 +61,28 @@ public class CCDoneEditingDialog extends CheckinCheckoutDialog
|
|||||||
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_TITLE) + " '" + property.getDocument().getName() + "'";
|
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_TITLE) + " '" + property.getDocument().getName() + "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||||
|
{
|
||||||
|
return checkinFileOK(context, outcome);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return version label for source node for working copy.
|
||||||
|
*/
|
||||||
|
private String getCurrentVersionLabel()
|
||||||
|
{
|
||||||
|
NodeRef workingCopyNodeRef = property.getDocument().getNodeRef();
|
||||||
|
if (this.nodeService.hasAspect(workingCopyNodeRef, ContentModel.ASPECT_COPIEDFROM) == true)
|
||||||
|
{
|
||||||
|
Map<QName, Serializable> workingCopyProperties = nodeService.getProperties(workingCopyNodeRef);
|
||||||
|
NodeRef nodeRef = (NodeRef) workingCopyProperties.get(ContentModel.PROP_COPY_REFERENCE);
|
||||||
|
|
||||||
|
Version curVersion = property.getVersionQueryService().getCurrentVersion(nodeRef);
|
||||||
|
return curVersion.getVersionLabel();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -5458,6 +5458,10 @@
|
|||||||
<property-name>property</property-name>
|
<property-name>property</property-name>
|
||||||
<value>#{CCProperties}</value>
|
<value>#{CCProperties}</value>
|
||||||
</managed-property>
|
</managed-property>
|
||||||
|
<managed-property>
|
||||||
|
<property-name>nodeService</property-name>
|
||||||
|
<value>#{NodeService}</value>
|
||||||
|
</managed-property>
|
||||||
</managed-bean>
|
</managed-bean>
|
||||||
|
|
||||||
<managed-bean>
|
<managed-bean>
|
||||||
|
@@ -50,9 +50,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> </f:verbatim>
|
<td> </f:verbatim>
|
||||||
<h:selectOneRadio value="#{CCProperties.minorChange}">
|
<h:selectOneRadio value="#{CCProperties.minorChange}" layout="pageDirection" required="true" rendered="#{DialogManager.bean.versionable}">
|
||||||
<f:selectItem itemValue="true" itemLabel="#{msg.minor_changes} (#{DialogManager.bean.minorNewVersionLabel})" />
|
<f:selectItem itemValue="#{true}" itemLabel="#{msg.minor_changes} (#{DialogManager.bean.minorNewVersionLabel})" />
|
||||||
<f:selectItem itemValue="false" itemLabel="#{msg.major_changes} (#{DialogManager.bean.majorNewVersionLabel})" />
|
<f:selectItem itemValue="#{false}" itemLabel="#{msg.major_changes} (#{DialogManager.bean.majorNewVersionLabel})" />
|
||||||
</h:selectOneRadio> <f:verbatim>
|
</h:selectOneRadio> <f:verbatim>
|
||||||
</span> <br/>
|
</span> <br/>
|
||||||
</td>
|
</td>
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
</span></td>
|
</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="paddingRow"></td>
|
<td class="paddingRow"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
</table> </f:verbatim>
|
</table> </f:verbatim>
|
||||||
</a:booleanEvaluator>
|
</a:booleanEvaluator>
|
||||||
|
Reference in New Issue
Block a user