mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-23 18:05:32 +00:00
Create script for app:project type now sets email alias value to project name for Email Archive space
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7597 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
parent
6038c7403e
commit
3a43e6dfec
@ -63,7 +63,7 @@
|
||||
<property name="emailserver:alias">
|
||||
<title>Alias</title>
|
||||
<type>d:text</type>
|
||||
<mandatory>true</mandatory>
|
||||
<mandatory>false</mandatory>
|
||||
<constraints>
|
||||
<constraint ref="emailserver:alias" />
|
||||
</constraints>
|
||||
|
@ -1 +1,19 @@
|
||||
// add onCreateNode policy code for app:projectfolder here
|
||||
// onCreateNode policy code for app:projectfolder
|
||||
var project = behaviour.args[0];
|
||||
var results = search.luceneSearch("+PATH:\"" + project.qnamePath + "/*\" +ASPECT:\"{http://www.alfresco.org/model/emailserver/1.0}aliasable\"");
|
||||
if (results.length == 1)
|
||||
{
|
||||
results[0].properties["emailserver:alias"] = normalise(project.name);
|
||||
results[0].save();
|
||||
logger.log("Applied email alias of: " + normalise(project.name));
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.log("No email folder found!");
|
||||
}
|
||||
|
||||
function normalise(s)
|
||||
{
|
||||
// email alias has strict constraint
|
||||
return new String(s).toLowerCase().replace(/[^a-z^0-9^.]/g, "-");
|
||||
}
|
@ -6,7 +6,7 @@
|
||||
<!-- Project behaviour registration -->
|
||||
<bean id="app_projectfolder_onCreateNode" class="org.alfresco.repo.policy.registration.ClassPolicyRegistration" parent="policyRegistration">
|
||||
<property name="policyName">
|
||||
<value>{http://www.alfresco.org}onCreateNode</value>
|
||||
<value>{http://www.alfresco.org}onUpdateNode</value>
|
||||
</property>
|
||||
<property name="className">
|
||||
<value>{http://www.alfresco.org/model/application/1.0}projectfolder</value>
|
||||
|
@ -139,6 +139,7 @@
|
||||
<app:uifacets></app:uifacets>
|
||||
<cm:projectsummary></cm:projectsummary>
|
||||
<cm:webscriptable></cm:webscriptable>
|
||||
<emailserver:aliasable></emailserver:aliasable>
|
||||
</view:aspects>
|
||||
<view:properties>
|
||||
<cm:description></cm:description>
|
||||
|
Loading…
x
Reference in New Issue
Block a user