Skip to content

Commit

Permalink
Adding more info about using the CloudFiles ERAttachment stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Robert committed May 24, 2012
1 parent 154dcfb commit b54d18e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
import er.extensions.eof.ERXGenericRecord;
import er.extensions.foundation.ERXProperties;

/**
* ERS3Attachment (type = "cf") represents an attachment whose content is stored on RackSpace's CloudFiles service and will be served directly from CloudFiles.
*
* @author probert
*/
public class ERCloudFilesAttachment extends _ERCloudFilesAttachment {
@SuppressWarnings("unused")
public static final String STORAGE_TYPE = "cf";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h2>Overview</h2>
mechanism of adding attachments to your application that abstract the actual storage requirements for those
attachments. The framework provide a single unified set of components and models that can allow the storage of
attachments on your local filesystem, served through your webserver; on your local filesystem served through
a custom request handler; in your database, served through a custom request handler; and on Amazon's S3 service,
a custom request handler; in your database, served through a custom request handler; on RackSpace's CloudFiles service; and on Amazon's S3 service,
served directly from S3. The intent of the framework is to make it very simple to control how the attachments
are stored and served by simple adjusting some configuration properties.
</p>
Expand Down Expand Up @@ -111,7 +111,7 @@ <h2>Global Properties</h2>

<dt>er.attachment.storageType / er.attachment.[configurationName].storageType</dt>
<dd>(optional) When using the ERAttachmentUpload component, this sets the default storage type to use for the attachment. Examples
are "s3", "db", or "file". The default is "db".</dd>
are "cf", "s3", "db", or "file". The default is "db".</dd>

<dt>er.attachment.width / er.attachment.[configurationName].width and er.attachment.height / er.attachment.[configurationName].height</dt>
<dd>(optional) When using the ERAttachmentUpload component, this sets the width and/or height of the attachment. Currently this will resize the original attachment (i.e. the original is lost). Later versions will support generating thumbnails in addition to the original image.</dd>
Expand Down Expand Up @@ -258,6 +258,32 @@ <h2>S3 Attachments</h2>
is true.</dd>
</dl>

<h2>CloudFiles Attachments</h2>
<p>
RasckSpace's CloudFiles service is an alternative to Amazon's S3. Like the S3 implementation, uploading may take a while, so the actual upload to CloudFiles
is performed in a background queue. As a result, your attachment may be in an "unavailable" state (attachment.available = false)
until the upload is complete. The attachment components handle this state with specific views and by disabling attachment links.
Note: Deleting an attachment that is in the unavailable state may result in the file not being removed from CloudFiles right now.
</p>

<dl>
<dt>er.attachment.cf.apiAccessKey / er.attachment.[configurationName].cf.apiAccessKey</dt>
<dd>(required) Your CloudFiles API access key ID. This is loaded using ERXProperties.decryptedStringForKey if you would like to encrypt it.</dd>

<dt>er.attachment.cf.username / er.attachment.[configurationName].cf.username</dt>
<dd>(required) Your CloudFiles username. This is loaded using ERXProperties.decryptedStringForKey if you would like to encrypt it.</dd>

<dt>er.attachment.cf.container / er.attachment.[configurationName].cf.container</dt>
<dd>(required) The name of the container to store and retrieve attachments into. The container must already exist in your CloudFiles account.</dd>

<dt>er.attachment.cf.connectionTimeOut / er.attachment.[configurationName].cf.connectionTimeOut</dt>
<dd>(optional) The timeout, in ms, before it stops trying to reach CloudFiles servers. Default is 5000</dd>

<dt>er.attachment.cf.authUrl / er.attachment.[configurationName].cf.authUrl</dt>
<dd>(optional) URL to the REST API. Default is https://auth.api.rackspacecloud.com/v1.0</dd>

</dl>

<h2>Mime Types</h2>
<p>
The ERAttachment framework provides support for tracking the definition of various mime types. You can, however, override and extend the default
Expand Down

0 comments on commit b54d18e

Please sign in to comment.