Email Server and EmailService in a working state.

- Fixed authentication
 - Fixed I18N
 - Fixed mimetype and encoding issues
Changed 'avm' remote ports and hosts to be 'alfresco.rmi.services' as the 'avm' was starting to creep into non-avm stuff.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7281 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-11-02 13:55:07 +00:00
parent ae37e5c139
commit 488127f5a8
29 changed files with 684 additions and 658 deletions

View File

@@ -30,12 +30,12 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel;
import org.alfresco.model.ForumModel;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.email.EmailMessage;
import org.alfresco.service.cmr.email.EmailMessageException;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
@@ -64,9 +64,10 @@ public class DocumentEmailMessageHandler extends AbstractForumEmailMessageHandle
messageSubject = "EMPTY_SUBJECT_" + System.currentTimeMillis();
}
QName contentType = getNodeService().getType(nodeRef);
QName nodeTypeQName = getNodeService().getType(nodeRef);
if (contentType.equals(ContentModel.TYPE_CONTENT))
DictionaryService dictionaryService = getDictionaryService();
if (dictionaryService.isSubClass(nodeTypeQName, ContentModel.TYPE_CONTENT))
{
NodeRef forumNode = getForumNode(nodeRef);
@@ -87,7 +88,9 @@ public class DocumentEmailMessageHandler extends AbstractForumEmailMessageHandle
}
else
{
throw new EmailMessageException(I18NUtil.getMessage("email.server.incorrect-node-type"));
throw new AlfrescoRuntimeException("\n" +
"Message handler " + this.getClass().getName() + " cannot handle type " + nodeTypeQName + ".\n" +
"Check the message handler mappings.");
}
}
@@ -99,7 +102,7 @@ public class DocumentEmailMessageHandler extends AbstractForumEmailMessageHandle
*/
private NodeRef addForumNode(NodeRef nodeRef)
{
NodeService nodeService=getNodeService();
NodeService nodeService = getNodeService();
//Add discussable aspect to content node
if (!nodeService.hasAspect(nodeRef, ForumModel.ASPECT_DISCUSSABLE))
{