mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-363: alfresco Failed to start modules: A module component org_alfresco_module_rm_notificationTemplate Patch failed to execute
* tempory fix to unblock issue * 'proper' fix to come git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.0@36850 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -164,6 +164,7 @@
|
|||||||
<cm:title>record-superseded-email.ftl</cm:title>
|
<cm:title>record-superseded-email.ftl</cm:title>
|
||||||
<cm:name>record-superseded-email.ftl</cm:name>
|
<cm:name>record-superseded-email.ftl</cm:name>
|
||||||
<cm:lastPatchUpdate>org_alfresco_module_rm_notificationTemplatePatch</cm:lastPatchUpdate>
|
<cm:lastPatchUpdate>org_alfresco_module_rm_notificationTemplatePatch</cm:lastPatchUpdate>
|
||||||
|
|
||||||
</view:properties>
|
</view:properties>
|
||||||
</cm:content>
|
</cm:content>
|
||||||
</cm:contains>
|
</cm:contains>
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
<property name="notificationHelper" ref="recordsManagementNotificationHelper"/>
|
<property name="notificationHelper" ref="recordsManagementNotificationHelper"/>
|
||||||
<property name="contentService" ref="ContentService"/>
|
<property name="contentService" ref="ContentService"/>
|
||||||
<property name="versionService" ref="VersionService"/>
|
<property name="versionService" ref="VersionService"/>
|
||||||
|
<property name="auditService" ref="AuditService"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="org_alfresco_module_rm_RMv2ModelPatch"
|
<bean id="org_alfresco_module_rm_RMv2ModelPatch"
|
||||||
|
@@ -27,6 +27,7 @@ import org.alfresco.model.ContentModel;
|
|||||||
import org.alfresco.module.org_alfresco_module_rm.notification.RecordsManagementNotificationHelper;
|
import org.alfresco.module.org_alfresco_module_rm.notification.RecordsManagementNotificationHelper;
|
||||||
import org.alfresco.repo.module.AbstractModuleComponent;
|
import org.alfresco.repo.module.AbstractModuleComponent;
|
||||||
import org.alfresco.repo.version.VersionModel;
|
import org.alfresco.repo.version.VersionModel;
|
||||||
|
import org.alfresco.service.cmr.audit.AuditService;
|
||||||
import org.alfresco.service.cmr.repository.ContentService;
|
import org.alfresco.service.cmr.repository.ContentService;
|
||||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
@@ -67,6 +68,9 @@ public class NotificationTemplatePatch extends AbstractModuleComponent
|
|||||||
/** Version service */
|
/** Version service */
|
||||||
private VersionService versionService;
|
private VersionService versionService;
|
||||||
|
|
||||||
|
/** Audit service */
|
||||||
|
private AuditService auditService;
|
||||||
|
|
||||||
/** Bean name */
|
/** Bean name */
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@@ -102,6 +106,14 @@ public class NotificationTemplatePatch extends AbstractModuleComponent
|
|||||||
this.versionService = versionService;
|
this.versionService = versionService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param auditService audit service
|
||||||
|
*/
|
||||||
|
public void setAuditService(AuditService auditService)
|
||||||
|
{
|
||||||
|
this.auditService = auditService;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.alfresco.repo.module.AbstractModuleComponent#setBeanName(java.lang.String)
|
* @see org.alfresco.repo.module.AbstractModuleComponent#setBeanName(java.lang.String)
|
||||||
*/
|
*/
|
||||||
@@ -146,6 +158,8 @@ public class NotificationTemplatePatch extends AbstractModuleComponent
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
System.out.println(nodeService.getProperty(template, ContentModel.PROP_DESCRIPTION));
|
||||||
|
|
||||||
// Check to see if this template has already been updated
|
// Check to see if this template has already been updated
|
||||||
String lastPatchUpdate = (String)nodeService.getProperty(template, PROP_LAST_PATCH_UPDATE);
|
String lastPatchUpdate = (String)nodeService.getProperty(template, PROP_LAST_PATCH_UPDATE);
|
||||||
if (lastPatchUpdate == null || name.equals(lastPatchUpdate) == false)
|
if (lastPatchUpdate == null || name.equals(lastPatchUpdate) == false)
|
||||||
@@ -172,8 +186,17 @@ public class NotificationTemplatePatch extends AbstractModuleComponent
|
|||||||
ContentWriter writer = contentService.getWriter(template, ContentModel.PROP_CONTENT, true);
|
ContentWriter writer = contentService.getWriter(template, ContentModel.PROP_CONTENT, true);
|
||||||
writer.putContent(is);
|
writer.putContent(is);
|
||||||
|
|
||||||
// Set the last patch update property
|
boolean enabled = auditService.isAuditEnabled();
|
||||||
nodeService.setProperty(template, PROP_LAST_PATCH_UPDATE, name);
|
auditService.setAuditEnabled(false);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Set the last patch update property
|
||||||
|
nodeService.setProperty(template, PROP_LAST_PATCH_UPDATE, name);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
auditService.setAuditEnabled(enabled);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user