Can you use Amazon S3 via Flex? - apache-flex

Due to the lack of clientaccesspolicy.xml, there appears to be problems with using Amazon S3 via Flex. Are there any work arounds?
Edit: Both of the below answers are great and work, I've upvoted both (I'm not going to assign an answer to the question as they both work):
Can you use Amazon S3 via Flex?
Can you use Amazon S3 via Flex?

You can CNAME a subdomain you control at Amazon S3 (to a bucket with the name of the subdomain), like so:
http://s3.ceejayoz.com/ (goes to my 's3.ceejayoz.com' bucket)
Uploading your own clientaccesspolicy.xml file to the root of that bucket (and setting the permissions to be globally viewable) should do the trick, if I'm understanding your question correctly, as it will be accessible at http://s3.ceejayoz.com/clientaccesspolicy.xml.
More information in the S3 docs: http://docs.amazonwebservices.com/AmazonS3/2006-03-01/index.html?VirtualHosting.html
edit: From looking at that, you could also use the "Example Virtual Hosted Style Method" without a CNAME: http://bucketname.s3.amazonaws.com/clientaccesspolicy.xml

Yes. You can find an ActionScript 3 library for connecting to S3 at:
http://code.google.com/p/as3awss3lib/
with more information at:
http://weblogs.macromedia.com/cantrell/archives/2007/05/actionscript_li.html
You can look at an example of the API in use by checking out the S3E AIR app at:
http://download.macromedia.com/pub/developer/air/sample_apps/S3E.air
and you can grab the source code from:
http://download.macromedia.com/pub/developer/air/sample_apps/S3E.zip
hope that helps...
mike chambers

If you're looking for a working Rails - Flex - S3 example then have a look at this rails project: http://github.com/GreenAsJade/s3-swf-upload-plugin
Its documented and works out of the box. You can even reverse engineer the Flex logic.

Related

Is there a way to connect to the DAM repository without using REST API?

I am writing an external Java app to connect to the Magnolia CMS to allow my external application to push/pull assets into the repository.
Repository repository = JcrUtils.getRepository(URI);
What should the URI be? Assume that magnoliaAuthor is accessible on http://localhost:8080/magnoliaAuthor
I assume you try to fetch content outside of JCR, then you should take the Resource files app as an example since it renders content outside of JCR as well.
https://documentation.magnolia-cms.com/display/DOCS61/Resource+Files+app
If not, please let me know where that utility class come from. I cannot find it in the codebase.
Cheers,
Hope that helps,

h5ai use on a CDN?

Is it possible to use the h5ai "pretty" index UI on a CDN? I'm using Dreamhosts' DreamObjects and have it installed correctly (I've used it before on standard hosting sites). Am only getting an XML parse of the data back.
See it here: https://randassets.objects.cdn.dream.io/
Any thoughts? Thanks!
I guess what you would like to see is a pretty-looking list of files and directories on a web page, like a file browser to explore the content of your DreamObjects bucket. If that's the case, hi5ai would not work because from what I understand, hi5ai doesn't natively speak neither the S3 API nor the OpenStack Swift ones. hi5ai relies on a web server and a php interpreter, which are not provided by DreamObjects.
Maybe if you expand on your use case I can suggest you other tools you could use to browse your collection of files, something like ownCloud (and more specifically how to configure DreamObjects with ownCloud) or others.

symfony 2 REST and JS (ember.js) client

I made a simple REST API bundle with Symfony 2 and now i want to use ember.js as a client.
I made a new bundle for it (ClientBundle). Where should i put the js files? Into
the ClientBundle/Resources folder under public/js?
app/web under public folder
somewhere else
what is the best practice / your favourite folder structure?
The best practice is to put the client code into a separate repository and use JS specific tools for its development.
Just because you can put them into a single repository doesn't mean you should. Imagine what a mess that repository will become if/when you add other clients like Android, iOS, and so on.
We put the client JS under Bundle/Resources/public/ and have a separate frontend and backend bundle. We just published a sample distro to show how this is organized here:
https://github.com/ucsf-ckm/symfony-emberjs-edition
Currently the answer would be to store the assets in the /web directory. Source
If you intend the ClientBundle to be reusable across different projects you may have, you are best served by placing the files into the ClientBundle\Resources\public\js folder.

programmatically execute alfresco rules

I have created a rule programmatically in Java and attached with a space, its working fine whenever a new document is inserted into that space. But what if I already have some documents uploaded in the space and I want to run the Rule. I know i can do this via Explorer as defined in the following article.
http://docs.alfresco.com/4.0/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Ftasks%2Flibrary-folder-rules-run.html
But I want to achieve the same using Java code.
Does any one please suggest some solution.
:: I am using Alfresco enterprise 4.0.2
I would recommend you to bind behaviours to policies instead if you are into java:
http://wiki.alfresco.com/wiki/Policy_Component#Binding_Behaviour_to_a_Policy
My personal experience is that you as a developer get much more control over events in the repository using behaviours (opposed to rules). But maybe thats just me :)

Symfony2 where to place custom helper classes

I'm starting with a Symfony2 project. I know the framework basics but I have a question:
Where is the right place to pot those helper classes I create for help or for the business logic?
Max's answer is correct. However I question the path he recommends for your code.
The following classes and files have specific emplacements:
Service Container Extensions (belong in) DependencyInjection/
from http://symfony.com/doc/current/cookbook/bundles/best_practices.html
That says your Services should be placed in a folder called 'DependencyInjection', not 'Services'. In full, it should be src/Foo/BarBundle/DependencyInjection
I say this as someone that had the former and has just finished moving them all to the latter (!)
What #Adam says is wrong, you have to store your Dependency Injection Extensions in DependecyInjection directory, not the services itself. In the documentation says that you can store your (custom) business logic classes in any place you like.
http://symfony.com/doc/current/best_practices/business-logic.html
The best way to keep the business logic is create service to handle all the logic. So it will be in:
src/Foo/BarBundle/Service
and you need to call the service in the services.yml.
I recently did some small work on an existing Symfony2 project. As described by answer from Tuong Le, I created my Helper classes under the Helper directory of the bundle and class name with Helper suffix i.e. the helper class is located at:
src/MyBundle/Helper/MyUtilHelper.php
I can use MyUtilHelper class in my bundle without calling the service container i.e. I didn't need to call.
$container->get('my_util');
I don't really know whether there is some special config. in my setup; someone already got it setup and I was just adding new functionality.
You can create the custom classes under your Bundle, such as under a folder Helper/..
However, to use those helper in your code, you'll need to define those Helper(s) in your service description file (such as services.xml)... Then you can use $container->get('your_helper')->
According to official documentation - in particular - Symfony Best Practices - you should store your services in Utils folder under the src. I belive, that this is correct way regardless of whether you want or don't wont to make the functionality provided by services of your bundle available to other parts of application via Service Container. Furthermore, you can store helper classes in any place you consider suitable. Concerning #Adam Knowles and #PachinSV answers - they are not quite right because they do not answer your question - "Where is the right place to pot those helper classes I create for help or for the business logic?" or "Where to store classes which I want to register and use via Service Container" - but not where to put bundle Extension class - which main purpose is to provide information about configuration which should be automatically loaded from your bundle to apps Service Container during the process of booting the Kernel.

Resources