{ "info": { "author": null, "author_email": null, "bugtrack_url": null, "classifiers": [], "description": "Introduction\n============\n\nWith the collective.contentfiles2aws package, you can store Plone files\nand images on amazon s3 service.\n\n\nOverview\n--------\n\nThe main purpose of the package to move content images and files to amazon\nCDN, that allows to serve content to end users with high performance and\nhigh availability. The package contains two content types: AWSFile and AWSImage\nwhich work similar to the default Plone ones. The main difference is that they\nstore their content on amazon simple storage instead of a Plone site.\nAlso, the package contains a patch for default content types like Image, File,\nand News Item.\n\n\nCompatibility\n-------------\n\nThe package was tested on Plone 3.3.5.\n\n\nRequirements\n------------\n\nThe package requires boto library (http://github.com/boto/boto)\nthat is compatible with python 2.4.\n\nThis package was developed and tested with @1011 revision\nof boto library. For manual checkout, use this command::\n\n svn co http://boto.googlecode.com/svn/trunk@1011\n\n\nInstallation\n------------\n\nTo add the package to your Zope instance, do the following:\n\n1. Follow the instructions provided in the ``docs/INSTALL.txt`` file.\n2. Restart your Zope instance.\n3. Install the ``collective.contentfiles2aws`` package with Quickinstaller in\n Plone (Site Setup > Add/Remove Products).\n\nAfter the package is installed, it should be configured properly. For this,\nyou need to have an amazon account.\n\n\nAmazon S3 bucket\n----------------\n\nEvery file that you upload to Amazon S3 is stored in a container called\na bucket. Before you start working with Amazon S3, you must create at least\none bucket. The bucket namespace is shared by all users of the system;\ntherefore, name of each bucket should be unique. You can create up to 100\nbuckets per account. Each bucket can contain an unlimited number of files.\nBuckets cannot be nested: you cannot create a bucket within a bucket.\nBucket ownership is not transferable; however, if a bucket is empty,\nyou can delete it. After a bucket is deleted, the name becomes available for\nreuse. However, the name might be unavailable for reuse because of various\nreasons, for example, a bucket with the same name can be created by another\naccount. So, if you want to use the same bucket name, don't delete the bucket.\nNote that it might take some time before the name can be reused.\n\nThere is no limit to the number of objects that can be stored in a bucket.\nPerformance is not impacted by the number of buckets that you use.\nYou can store all of your objects in a single bucket, or you can organize them\nacross several buckets.\n\n\nRules for Bucket Naming\n-----------------------\n\nIn all regions except for the US Standard region, a bucket name must comply\nwith the following rules (as a result of a DNS compliant bucket name):\n\n * Bucket name must be at least 3 and no more than 63 characters long\n * Bucket name must be a series of one or more labels separated\n by a period (.), where each label:\n * Must start with a lowercase letter or a number\n * Must end with a lowercase letter or a number\n * Can contain lowercase letters, numbers, and dashes\n * Bucket names must not be formatted as IP addresses (e.g., 192.168.5.4)\n\nThe following are examples of valid bucket names:\n * myawsbucket\n * my.aws.bucket\n * myawsbucket.1\n\nThese naming rules for US Standard region can result in a bucket name that\nis not DNS compliant. For example, MyAWSBucket - is a valid bucket name with\nuppercase letters in its name. If you try to access this bucket using a virtual\nhosted-style request, http://MyAWSBucket.s3.amazonaws.com/yourobject,\nthe URL resolves to the bucket myawsbucket and not the bucket MyAWSBucket.\nIn response, Amazon S3 will return a not found error.\nTo avoid this problem, we recommend that you always use DNS-compliant bucket\nnames regardless of the region in which you create the bucket.\n\n\nConfiguration\n-------------\n\nTo configure the collective.contentfiles2aws package to work with you amazon\naccount, you need to accomplish the following steps:\n\n1. In your site root, open the 'portal_properties' tool\n2. Find 'contentfiles2aws' property sheet and click it\n3. In the AWS_KEY_ID field, enter your aws key id\n4. In the AWS_SEECRET_KEY field, enter your aws secret key\n5. In the AWS_BUCKET_NAME field, enter the name of the created bucket\n6. (optional) In the AWS_FILENAME_PREFIX field, enter the name of a folder\n in bucket. This folder will be used to store your files. Also, you can\n provide slash separated path, for example: folder1/folder2/folder3.\n Actually, there are no folders in Amazon S3, only key/value pairs. The key\n can contain slashes (\"/\") and that will make it appear as a folder in\n management console, but programmatically it's not a folder, it is a string\n value. Anyway, if you prefer using folder, you can specify one in the\n AWS_FILENAME_PREFIX field.\n7. Select the USE_AWS check box.\n This check box allows you to turn on or turn off amazon storage.\n If 'USE_AWS' check box is not selected, that means that all newly created\n content types that use aws file or image fields will work like default ones,\n and will store their values in the database. Objects that were created\n before you remove selection from the USE_AWS check box will work as usual.\n If you select the USE_AWS check box, all newly created objects with aws file\n or image fields will store their values to amazon storage.\n\n\nCustom content type\n-------------------\n\nIf you want to store images or files to aws storage in your custom content\ntype, you need to do the following steps:\n\n 1. Use AWSImageField or AWSFileField instead default ImageField or File field\n in your content type schema.\n 2. Use AWSImageWidget and AWSFieldWidget for AWSImageField and AWSFileField\n accordingly.\n 3. Use AWSStorage instead of AnnotationStorage for AWSImageField or\n AWSFileField.\n\nHere is example of simple aws image field::\n\n `AWSImageField`('image',\n required=True,\n primary=True,\n languageIndependent=True,\n storage = `AWSStorage()`,\n pil_quality = zconf.pil_config.quality,\n pil_resize_algo = zconf.pil_config.resize_algo,\n max_size = zconf.ATImage.max_image_dimension,\n sizes= {'large' : (768, 768),\n 'preview' : (400, 400),\n 'mini' : (200, 200),\n 'thumb' : (128, 128),\n 'tile' : (64, 64),\n 'icon' : (32, 32),\n 'listing' : (16, 16),\n },\n validators = (('isNonEmptyFile', V_REQUIRED),\n ('checkImageMaxSize', V_REQUIRED)),\n widget = `AWSImageWidget`(\n description = '',\n label= _(u'label_image', default=u'Image'),\n show_content_type = False,)),\n\n\nMigration\n---------\n\nIf you have a lot of images and files on your site, and you want to\nmove them all to amazon storage, there is a simple migration procedure that you\ncan follow. Migration script (zope 3 view) named 'migrate-content' can be\ncalled on any context. If you call 'migrate-content' view, you will see a list\nof content types that have at least one aws field (image or file) in their\nschema. (If your content type is not in that list, it means that you do not\nuse aws fields in it, or you use default Image and File fields instead of aws\nones.) Next to the content types list, you will see the number of objects for\neach content type found on this context. To migrate object for specific content\ntype, you need to pass 'content_type' parameter for 'migrate-content' script.\n\nFor example, if you want to migrate Image content type, you need to specify it\nlike this::\n\n http://yourdomain/somefolder/migrate-content?content_type=Image\n\nIf you want to migrate all objects for all content types that were found\non the current context, you need to specify 'all' value for content_type\nparameter, like this::\n\n http://yourdomain/somefolder/migrate-content?content_type=all\n\nAfter a script finishes the migration, it will show a list of migrated content\ntypes and number of migrated fields for each content type.\n\nNote: Migration is a time consuming procedure. It can take from a few minutes\nup to several hours, depending on the amount of files and images in your\ndatabase.\n\n\nSafety\n-------\n\nAfter you installed the package, configured it, and turned AWS storage on,\nall files and images will be stored in amazon s3 storage. It means that during\nobject creation, file data will be send to a remote server. In case remote\nserver is inaccessible for some reasons (bad configuration or issues on server\nside), your data will not be lost, it will be saved in site database,\nas if you were using a default Image or File instead of AWS one. After all\nissues were resolved, all AWS files and images that were created when amazon\nwas not accessible, can easily be migrated to amazon. To migrate such objects,\nyou need to click the edit action, and then, on the edit form, under the image\nor file you will see an info box saying that this image or file is currently\nsaved in a database. After you click the Save button, regardless if you make\nany changes or not, the system will try to migrate image or file to amazon.\nIf migration is successful, info box will disappear from the edit form.\n\n\nUrl generation\n--------------\n\nAWSImagField and AWSFileField have widgets that generate proper URL\nto the image or file. Depending on the place where the data is stored, URL will\npoint to amazon or your site. If you decide not to use the widget, you\ncan use 'aws_image_url' and 'aws_file_url' helper views for image and file\nURL generation accordingly. Here is an example of file URL helper view usage::\n\n >>> from zope.component import getMultiAdapter\n >>> aws_file_url = \\\n ... getMultiAdapter((context, request), name=u'aws_file_url')\n >>> aws_file_url(instance, name='fieldname', brain=False)\n\nwhere:\n * instance - is content object or brain;\n * name - field name;\n * brain - boolean flag that need to be set to False if instance is object\n not brain. (True - by default)\n\nFor image URL helper view usage::\n\n >>> from zope.component import getMultiAdapter\n >>> aws_image_url = \\\n ... getMultiAdapter((context, request), name=u'aws_image_url')\n >>> aws_image_url(instance, name='fieldname',\n ... scale='scale_name', brain=False)\n\nwhere:\n * instance - is content object or brain;\n * name - field name;\n * scale - image scale (None - by default);\n * brain - boolean flag that need to be set to False if instance is object\n not brain. (True - by default);\n\n\nAWS file naming\n---------------\n\nEach file and image that is stored into amazon bucket has unique name that is\ngenerated from following parts:\n\n * content object UID;\n * generated part\n * field name\n * scale name (for images)\n * filename\n\nFor example::\n\n Generated part Scale name\n |-----| |---|\n 003d34b5ba832f753ad91a6cdac1921f_537fd44_image_large_tanning-bed.jpg\n |------------------------------| |---| |-------------|\n Object UID Field name File name\n\n\nTODO\n====\n [] Add transformation for images and files inserted by kupu.\n\n\nCredits\n=======\n\nCompanies\n---------\n\n|martinschoel|_\n\n* `Martin Schoel Web Productions `_\n* `Contact us `_\n\n\nAuthor\n-------\n\n* Taras Melnychuk \n\n\nContributors\n------------\n\n.. |martinschoel| image:: http://cache.martinschoel.com/img/logos/MS-Logo-white-200x100.png\n.. _martinschoel: http://www.martinschoel.com/\n", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": null, "keywords": null, "license": null, "maintainer": null, "maintainer_email": null, "name": "collective.contentfiles2aws", "package_url": "https://pypi.org/project/collective.contentfiles2aws/", "platform": null, "project_url": "https://pypi.org/project/collective.contentfiles2aws/", "project_urls": null, "release_url": "https://pypi.org/project/collective.contentfiles2aws/1.3.0/", "requires_dist": null, "requires_python": null, "summary": null, "version": "1.3.0" }, "last_serial": 1341183, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "88f27ead1c3962e23dbe8ab9d240ba29", "sha256": "40dc1b10b6c2ef3e0c05f924f21699c65ceb0cdfd295c3d81daab3377e049609" }, "downloads": -1, "filename": "collective.contentfiles2aws-1.0.tar.gz", "has_sig": false, "md5_digest": "88f27ead1c3962e23dbe8ab9d240ba29", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33456, "upload_time": "2013-03-01T11:27:23", "url": "https://files.pythonhosted.org/packages/ff/f7/5b08287c5eb72278bbed14ee80d7b9800687469065be96b2f29a1acc64b9/collective.contentfiles2aws-1.0.tar.gz" } ], "1.0-alpha": [ { "comment_text": "", "digests": { "md5": "cb08f4bea37ad021e9aa7a3756ede2d5", "sha256": "c33caf3fe3dd436706376cc02ae01b4318d4d241f2694ba82ec289e9b42d8cc1" }, "downloads": -1, "filename": "collective.contentfiles2aws-1.0-alpha.tar.gz", "has_sig": false, "md5_digest": "cb08f4bea37ad021e9aa7a3756ede2d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30887, "upload_time": "2013-02-01T13:31:04", "url": "https://files.pythonhosted.org/packages/48/bc/1a13851abbd7bad981faaa786245bac19f2936e1dd769f1a5085f211d9e4/collective.contentfiles2aws-1.0-alpha.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "2d38eae32c3dfb22b39039da038b7dd0", "sha256": "4b38581aeb915cb550a47d516328f047f7521f7840bf74a9d69493761e1a30cb" }, "downloads": -1, "filename": "collective.contentfiles2aws-1.1.tar.gz", "has_sig": false, "md5_digest": "2d38eae32c3dfb22b39039da038b7dd0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36983, "upload_time": "2013-04-02T15:54:02", "url": "https://files.pythonhosted.org/packages/ff/37/cf44756ecb0066892bdcf7bca291ce55ae9e34b2c8c68459ce60c0050996/collective.contentfiles2aws-1.1.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "f27c9c3d3a7ebf86a5a8f5c79656fb46", "sha256": "2338f3c0000a26bf1b2643fdf86ed3daf641991a05bee45551b8fc3f888ecbbb" }, "downloads": -1, "filename": "collective.contentfiles2aws-1.2.1.tar.gz", "has_sig": false, "md5_digest": "f27c9c3d3a7ebf86a5a8f5c79656fb46", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38443, "upload_time": "2014-07-02T08:08:41", "url": "https://files.pythonhosted.org/packages/27/34/eb64aa7a047dbdb0ce18a5acbaf525d5c5ea723194162df3132c68ca2f00/collective.contentfiles2aws-1.2.1.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "2f8f18592839b998f7f970a6741c82c8", "sha256": "4d8375bd6d3fac2b55aca12b177938cf7a1de9d49b8c3eebc47d609b3976d417" }, "downloads": -1, "filename": "collective.contentfiles2aws-1.3.0.tar.gz", "has_sig": false, "md5_digest": "2f8f18592839b998f7f970a6741c82c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40029, "upload_time": "2014-12-12T10:22:13", "url": "https://files.pythonhosted.org/packages/bd/26/bb98afdef98ffb0c365cefc5333a210f8b507454fac5809a183e9ce11334/collective.contentfiles2aws-1.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2f8f18592839b998f7f970a6741c82c8", "sha256": "4d8375bd6d3fac2b55aca12b177938cf7a1de9d49b8c3eebc47d609b3976d417" }, "downloads": -1, "filename": "collective.contentfiles2aws-1.3.0.tar.gz", "has_sig": false, "md5_digest": "2f8f18592839b998f7f970a6741c82c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40029, "upload_time": "2014-12-12T10:22:13", "url": "https://files.pythonhosted.org/packages/bd/26/bb98afdef98ffb0c365cefc5333a210f8b507454fac5809a183e9ce11334/collective.contentfiles2aws-1.3.0.tar.gz" } ] }