Conductor API and to_xml
by Martyn Taylor
Hi gents,
There has been a few people raising similar questions around why are we
not using the default rails renders and instead are using templates to
render such things as xml. I've put together my reasoning on choosing
this approach below:
I assume most people are aware that render :xml simply using a models
to_xml method to parse the model.
There are a few issues with to_xml.
1) to_xml uses elements for everything. In our API we use attributes
for special fields on our resources. These special fields are used to
identify the resource and give its location. i.e. href and id.
We could extend to_xml to handle this for us. But there are some other
issues.
2) When returning lists and nested resources. For example:
<provider>
<provider_account />
</provider>
or
<providers>
<provider id='1' href='' />
<provider id='2' href='' />
</providers>
We do not want to return the full resource just a reference to it. This
is to reduce the size of response body. to_xml will simply call to_xml
on nested resources resulting in full resource representation.
3) When rendering resources we only want to list its direct children,
not grandchildren. This is again to avoid sending whole object graphs
in response bodies. Using to_xml will result in every resource in the
graph being rendered.
4) Templates are much more flexible.
All of the issues I described above could be implemented by overriding
the to_xml method. Though it would get a little complicated.
Templates are much easier to maintain and update. In addition, using
templates gives us more control on what we return on a individual model
basis. For example we could have logic in our templates that say things
like.
If STATUS == "Complete" then #don't return progress. etc....
To summarize. Yes you can use to_xml which is the standard way to
render things like xml, json in rails. But there is a significant
amount of work in implementing bespoke methods to make it work the way
we need it to. Templates are much more flexible and are easier to
implement. The downside of templates is that we have more files to
maintain. But there is nothing complicated about templates they are
extremely trivial.
11 years, 9 months
Etherpad flakier than we'd like. :(
by Justin Clift
Hi Matt,
*sigh* Our Etherpad instance has gone down again. :(
Seems to be happening a lot. Once a week or so.
When you get back, we should take some time trying to
make it stable. (cronjob restart even? :>)
Regards and best wishes,
Justin Clift
--
Aeolus Community Manager
http://www.aeolusproject.org
11 years, 9 months
[PATCH] RM3523 Quickfixes - On deployment overview display quota information only when relevant
by Jirka Tomasek
From: Jiri Tomasek <jtomasek(a)redhat.com>
To add html tags to i18n message variables, the yaml key has to end with "_html"
http://stackoverflow.com/questions/5367705/rails-3-i18n-interpolating-htm...
---
src/app/stylesheets/layout.scss | 2 ++
src/app/views/deployments/_overview.html.haml | 8 ++++++--
src/config/locales/en.yml | 5 ++---
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/app/stylesheets/layout.scss b/src/app/stylesheets/layout.scss
index e161f65..2065592 100644
--- a/src/app/stylesheets/layout.scss
+++ b/src/app/stylesheets/layout.scss
@@ -41,6 +41,7 @@ section.maincontent{
}
strong, em, b, i{ font-family: $font-family-em; }
+strong{ font-weight: bold; }
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Application Input Controls -- v.0.0.1 [input] (input.scss)
@@ -591,6 +592,7 @@ section.content-section{
padding: 0px 40px 0px 0px;
margin-bottom: 4px;
+ &.no-icon{ padding: 0px; }
&.activity{ background: transparent url('../../images/admin_h2_icons.png') right 0px no-repeat; }
&.roles{ background: transparent url('../../images/admin_h2_icons.png') right -29px no-repeat; }
&.settings{ background: transparent url('../../images/admin_h2_icons.png') right -56px no-repeat; }
diff --git a/src/app/views/deployments/_overview.html.haml b/src/app/views/deployments/_overview.html.haml
index d4a90fd..957cc21 100644
--- a/src/app/views/deployments/_overview.html.haml
+++ b/src/app/views/deployments/_overview.html.haml
@@ -11,8 +11,12 @@
%section.content-section
%header.align-center
- %h2= t('.header', :deployment => @deployment.name, :pool => @pool.name)
- %p= t('.confirmation', :deployment => @deployment.name, :pool => @pool.name, :quota => number_to_percentage(@additional_quota, :precision => 0))
+ %h2.no-icon= t('.header', :deployment => @deployment.name, :pool => @pool.name)
+ %p
+ = t('.confirmation_html', :deployment => content_tag(:strong, @deployment.name),
+ :pool => @pool.name)
+ - unless @additional_quota == 0
+ = t('.quota_info', :quota => number_to_percentage(@additional_quota, :precision => 0))
.content
%fieldset
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index 42b15f5..fb612c7 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -310,9 +310,8 @@ en:
overview:
pool_name: "%{pool} Pool"
header: Deploy "%{deployment}" to %{pool} Pool?
- confirmation:
- Are you sure you wish to deploy "%{deployment}" to the %{pool} Pool? Doing
- so will utilize %{quota} of your overall deployment quota.
+ confirmation_html: 'Are you sure you wish to deploy "%{deployment}" to the %{pool} Pool?'
+ quota_info: "Doing so will utilize %{quota} of your overall deployment quota."
deployable_xml: Deployable XML
name: Name
description: Description
--
1.7.7.6
11 years, 9 months
[Event Report] Jamia Millia Islamia College of Enginnering , Delhi
by Nitesh Narayan
Hi,
I had taken a session on What is Aeolus and how one can start contributing to it at Jamia Millia Islamia College of Enginnering [1], Delhi , India on Saturday, July 21st , 2012.
The participants were Btech students including few employed people as well . They were familiar with Linux as well as cloud computing , and most of them were using on or the other Linux Distribution .
The session begin and I introduced them to Cloud Computing as most of them were already knowing about it so it didn't take much of my time , after which I explained them about Aeolus what Aeolus is and what it does .
I had also demonstrated them the conductor UI as well as mine aeolus-gui [2] and told them the ways by which they can help the community .
Thanks to JMI LUG [3] for there help in organizing this meetup . Few photos taken during the event are available at [4] sice this talk is been taken by me after my Fedora talk so photos are mixed up .
I will be getting few more photos from them organizers soon then I will upload them also .
And just for a suggestion probably we can have a separate mailing list for posting this kind of event report stuff .
[1] Jamia Millia Islamia University : http://jmi.ac.in/
[2] https://github.com/niteshnarayanlal/Aeolus-gui
[3] JMI LUG : http://www.jmilug.org/cms/
[4] Photos : https://picasaweb.google.com/108453109276209258652/FedoraMeetupJMIDelhi?a...
Regards
Nitesh Narayan Lal
https://fedoraproject.org/wiki/User:Niteshnarayan
11 years, 9 months
[PATCH Conductor 0/2] Major bundler usage change
by Jason Guiditta
Now that I (hopefully) have your attention, this actually makes
working both upstream as a 'distro developer' simpler, see commit
message for patch 2 for directions. Crag is also working up
directions to go in the project README, and eventually we will get the
website updated as well, though for people just installing RPMs, there
is 0 change.
The net here is we are going to have a Gemfile in the
default checkout, making the project behave as a ruby developer would
expect, with no extra work on their part. Building rpms also does not
change, so the only thing you as a developer need to make sure you do
is:
bundle install --path bundle
Then, when you add mew gems make sure you update the lock file (you do
this by simply updating the Gemfile with the new dep, then 'bundle
install' again, the path is remembered). If you wish to use system
gems only, mv Gemfile Gemfile.in (just remember to update correctly
when you create your patch). Please bring any questions/issues to
list, so others can see any problems you have, and we can make sure to
catch such scenarios in the README. I am happy to help debug, but if
we dont capture issues somewhere, they will just happen again.
-j
11 years, 9 months