Merged V2.2 to HEAD

8019: Merged V2.1 to V2.2
     7715: Fix for AWC-1753
     7725: Additional files for AWC-1753 - also fixes unreported issue of OK button not being highlighted when editing post until you press a key
     7726: Additional files for AWC-1753 - also fixes unreported issue of OK button not being highlighted when editing post until you press a key
     7731: Added support for Range and Content-Range headers to support Download managers and Resume features for HTTP downloads
     7967: Workaround for ACT-771: Missing AVM Store system descriptor properties prevents system startup
     7980: AWC-1662: Fixed NPE when searching for users
     7981: Fix for AWC-1661: Can't edit details of user who has had their home space removed
     7988: NodeRef + child path relative URLs support for DownloadContentServlet
     8003: Fix for AWC-1795
     8004: Fix http://issues.alfresco.com/browse/AR-1807

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8461 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2008-03-07 12:28:36 +00:00
parent 612e03705b
commit 5e890e6656
3 changed files with 21 additions and 8 deletions

View File

@@ -124,7 +124,7 @@
</property> </property>
</bean> </bean>
<bean id="avmDAOs" class="org.alfresco.repo.avm.AVMDAOs"> <bean id="avmDAOs" class="org.alfresco.repo.avm.AVMDAOs" factory-method="Instance">
<property name="issuerDAO"> <property name="issuerDAO">
<ref bean="issuerDAO"/> <ref bean="issuerDAO"/>
</property> </property>

View File

@@ -19,11 +19,10 @@ public class AVMDAOs
/** /**
* The single instance of an AVMContext. * The single instance of an AVMContext.
*/ */
private static AVMDAOs fgInstance; private static final AVMDAOs fgInstance = new AVMDAOs();
AVMDAOs() private AVMDAOs()
{ {
fgInstance = this;
} }
/** /**

View File

@@ -1049,7 +1049,15 @@ public class AVMStoreImpl implements AVMStore, Serializable
*/ */
public int getLastVersionID() public int getLastVersionID()
{ {
return AVMDAOs.Instance().fVersionRootDAO.getMaxVersionID(this); Integer lastVersionId = AVMDAOs.Instance().fVersionRootDAO.getMaxVersionID(this);
if (lastVersionId == null)
{
return 0;
}
else
{
return lastVersionId.intValue();
}
} }
/** /**
@@ -1159,9 +1167,15 @@ public class AVMStoreImpl implements AVMStore, Serializable
*/ */
public AVMStoreDescriptor getDescriptor() public AVMStoreDescriptor getDescriptor()
{ {
return new AVMStoreDescriptor(fName, // Get the creator ensuring that nulls are not hit
getProperty(ContentModel.PROP_CREATOR).getStringValue(), PropertyValue creatorValue = getProperty(ContentModel.PROP_CREATOR);
((Date)getProperty(ContentModel.PROP_CREATED).getValue(DataTypeDefinition.DATE)).getTime()); String creator = creatorValue == null ? "system" : (String) creatorValue.getValue(DataTypeDefinition.TEXT);
creator = (creator == null) ? "system" : creator;
// Get the created date ensuring that nulls are not hit
PropertyValue createdValue = getProperty(ContentModel.PROP_CREATED);
Date created = createdValue == null ? (new Date()) : (Date) createdValue.getValue(DataTypeDefinition.DATE);
created = (created == null) ? (new Date()) : created;
return new AVMStoreDescriptor(fName, creator, created.getTime());
} }
/** /**