clj-aws-s3 icon indicating copy to clipboard operation
clj-aws-s3 copied to clipboard

Website configuration

Open petergillardmoss opened this issue 11 years ago • 6 comments

Added functions to manage a bucket's website configuration.

I used clojure.java.data to convert to and from the BucketWebsiteConfiguration bean.

There is some complexity as the lib doesn't handle typed collections very well due to type erasure so the vector of routing rules have to be converted explicitly to a vector of RoutingRule beans as a first step. However, due to the complex nature of the BucketWebsiteConfiguration bean and RoutingRule bean I felt the clojure.java.data library was still preferable. You may of course disagree :)

petergillardmoss avatar Feb 13 '14 11:02 petergillardmoss

Could you fix the length of the commit messages? The first line of a git commit message is used as a brief summary, and should typically be kept under 70 characters in order to avoid truncation when viewing commit logs.

weavejester avatar Feb 13 '14 13:02 weavejester

I did a git rebase -i and reworded then a force push.

Not sure what's going on as looking at the pull request elliot42s previous commit has got sucked in as a change. I checked my console output and the rebase claims it only touched my commits so hell knows what's going on. Not sure if this is a github bug or forcing was a stupid idea.

If that causes a problem with the merge let me know and I'll kill the branch and start a new fork.

petergillardmoss avatar Feb 13 '14 13:02 petergillardmoss

Ignore previous. Looks like a github consistency bug. Force refresh on the browser and all history looks correct.

petergillardmoss avatar Feb 13 '14 13:02 petergillardmoss

Thanks. I think that perhaps we could shorten "configuration" to "config" without losing any clarity, i.e. get-bucket-website-config and update-bucket-website-config.

weavejester avatar Feb 13 '14 17:02 weavejester

Oh, also, I note that the keys for the new functions are camel-cased, rather than hyphenated. Could you change the keys to use the hyphenated form, e.g. :routing-rules rather than :routingRules. Idiomatic Clojure code prefers the former over the latter.

weavejester avatar Feb 13 '14 17:02 weavejester

Updated:

  • use hyphenated keys
  • replace configuration with config
  • kept line lengths down

General question: I'm not sure about you but the amount of effort for mapping between beans seems really high especially considering it's all just boiler plate. Unfortunately data.java doesn't support hyphenation and the activity on the project is low so I'm not sure how well looked after it is.

Would consider forking and patching it (given time etc.). Do you know of any alternatives.

petergillardmoss avatar Feb 20 '14 16:02 petergillardmoss