com.sapportals.wcm.control.edit

Class ResourceUtilities

java.lang.Object
  extended by com.sapportals.wcm.control.edit.ResourceUtilities

public class ResourceUtilities
extends Object

resource utilities often used in controls

Copyright 2004 SAP AG


Nested Class Summary
static class ResourceUtilities.ContentDataSource
           
 
Constructor Summary
ResourceUtilities()
           
 
Method Summary
static String createInlineLinks(IResourceList resourceList, String detailsLabel)
           
static MimeMessage createMailsWithAttachment(MimeMessage mimemessage, String from, Address[] to, Address[] cc, Address[] bcc, String subject, Object message, String type, int priority, IResourceList resourceList)
           
static MimeMessage createMailsWithLinks(MimeMessage mimemessage, String from, Address[] to, Address[] cc, Address[] bcc, String subject, Object message, String type, int priority, IResourceList resourceList, String detailsLabel)
           
static MimeMessage createResourceMessage(MimeMessage mimemessage, String from, Address[] to, Address[] cc, Address[] bcc, String subject, Object message, String type, int priority, IResourceList resourceList, boolean attachLinks, String detailsLabel)
          creates an email message with attachment, universal method to use for any message fixed charset iso-8859-1 is used to format subject - problem with internationalization !!!
static MimeMessage createResourceMessage(MimeMessage mimemessage, String from, String to, String cc, String bcc, String subject, Object message, String type, int priority, IResourceList resourceList, boolean attachLinks)
          creates an email message with attachment, universal method to use for any message fixed charset iso-8859-1 is used to format subject - problem with internationalization !!!
static IResource dereferenceTarget(IResource resource)
          dereferences to resource or external link, follows up the internal links to get to original resource or external link finally, prepare method to call getContent()
static ICollection getCollection(String folderUri, IResourceContext resourceContext, boolean create)
          gets ICollection object for a folder with given URI, shortcut method
static IResource getTempResource(ICollection where, String resourceName, IContent content)
          creates a temporary resource with content in collection specifed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceUtilities

public ResourceUtilities()
Method Detail

getCollection

public static final ICollection getCollection(String folderUri,
                                              IResourceContext resourceContext,
                                              boolean create)
                                       throws ResourceException
gets ICollection object for a folder with given URI, shortcut method

Parameters:
folderUri - URI od the folder to get ICollection for
Returns:
ICollection object
Throws:
ResourceException
See Also:
ICollection

dereferenceTarget

public static final IResource dereferenceTarget(IResource resource)
                                         throws ResourceException
dereferences to resource or external link, follows up the internal links to get to original resource or external link finally, prepare method to call getContent()

Parameters:
resource - any resource to ensure
Returns:
getContent() safe resource - dereferenced internal link or resource provided as argument
Throws:
ResourceException

getTempResource

public static final IResource getTempResource(ICollection where,
                                              String resourceName,
                                              IContent content)
                                       throws ResourceException
creates a temporary resource with content in collection specifed. If the resource already exists, it is deleted before the new one is created

Parameters:
where - collection, where the temporarry resource schould be created
resourceName - name of the resource to create
content - content of the resource
Returns:
IResource object for newly created resource
Throws:
ResourceException

createResourceMessage

public static final MimeMessage createResourceMessage(MimeMessage mimemessage,
                                                      String from,
                                                      String to,
                                                      String cc,
                                                      String bcc,
                                                      String subject,
                                                      Object message,
                                                      String type,
                                                      int priority,
                                                      IResourceList resourceList,
                                                      boolean attachLinks)
                                               throws WcmException
creates an email message with attachment, universal method to use for any message fixed charset iso-8859-1 is used to format subject - problem with internationalization !!! some charset provider needed for coding subjects with non-US characters

Parameters:
mimemessage -
from - sender address
to - send-to address
cc - carbon copy address
bcc - blind carbon copy address
subject - Email subject, iso-8859-1 characters only
message - main body content - some object, usualy String, iso-8859-1 characters only
type - content-type, usualy text/plain
priority - MessagePriority.NORMAL or MessagePriority.HIGH
resourceList - array of resources for attachments
attachLinks -
Returns:
ready to send javax.mail.MimeMessage object
Throws:
WcmException

createResourceMessage

public static final MimeMessage createResourceMessage(MimeMessage mimemessage,
                                                      String from,
                                                      Address[] to,
                                                      Address[] cc,
                                                      Address[] bcc,
                                                      String subject,
                                                      Object message,
                                                      String type,
                                                      int priority,
                                                      IResourceList resourceList,
                                                      boolean attachLinks,
                                                      String detailsLabel)
                                               throws WcmException
creates an email message with attachment, universal method to use for any message fixed charset iso-8859-1 is used to format subject - problem with internationalization !!! some charset provider needed for coding subjects with non-US characters

Parameters:
mimemessage -
from - sender address
to - send-to address
cc - carbon copy address
bcc - blind carbon copy address
subject - Email subject, iso-8859-1 characters only
message - main body content - some object, usualy String, iso-8859-1 characters only
type - content-type, usualy text/plain
priority - MessagePriority.NORMAL or MessagePriority.HIGH
resourceList - array of resources for attachments
attachLinks -
detailsLabel -
Returns:
ready to send javax.mail.MimeMessage object
Throws:
WcmException

createMailsWithLinks

public static MimeMessage createMailsWithLinks(MimeMessage mimemessage,
                                               String from,
                                               Address[] to,
                                               Address[] cc,
                                               Address[] bcc,
                                               String subject,
                                               Object message,
                                               String type,
                                               int priority,
                                               IResourceList resourceList,
                                               String detailsLabel)
                                        throws WcmException
Throws:
WcmException

createInlineLinks

public static String createInlineLinks(IResourceList resourceList,
                                       String detailsLabel)
                                throws WcmException
Throws:
WcmException

createMailsWithAttachment

public static MimeMessage createMailsWithAttachment(MimeMessage mimemessage,
                                                    String from,
                                                    Address[] to,
                                                    Address[] cc,
                                                    Address[] bcc,
                                                    String subject,
                                                    Object message,
                                                    String type,
                                                    int priority,
                                                    IResourceList resourceList)
                                             throws WcmException
Throws:
WcmException
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/nonwduideprecated api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2014 SAP AG Complete Copyright Notice