Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Allows list headers to be specified #2

Closed
wants to merge 1,087 commits into from
@ssalevan

Hey guys,
I apologize in advance for the Java-tastic nature of this change, there's practically enough introspection in this guy to fill up a late 80's Cure album. The reason for all of that is to provide for flexibility when defining lists of assets, and to provide for retrieving and templating asset attributes which cannot be retrieved by a simple asset metavalue tag lookup.

I'd recommend approaching this pull request by looking at conf/application.conf and moving down from there, and here's an explanation of the new directives:

Global config directives:

listtags.all.order: a comma-separated list of either asset metavalue tags or method calls on an asset object being listed, with method calls signified by a prefix of ~. Since certain asset attributes must be retrieved by method calls on an asset object, I looked around for a character which would be unlikely to appear in an asset tag, and the ~ character seemed to fit the bill.

listtags.all.default: an HTML snippet representing the default value to use when no value is returned by an asset metavalue tag lookup or method call.

Per-metavalue tag/method call config directives:

listtags..decorator: HTML snippet specifying a decorator for the value of a metavalue tag or method call, allowing methods of the signature (asset: Asset): Content to be templated inside it, to allow for calling arbitrary methods for the asset being listed.

listtags..formatter: Method to format value of metavalue tag or method call, with all currently specified within the Formatter object.

listtags..header: Allows for a custom column header to be specified.

listtags..showif: Method of the signature (assets: Page[AssetView]): Boolean used to determine whether the column specified by the tag or method call should be shown. If none is specified, column will always display.

Let me know what you think of this; if you guys have any ideas, I would be very interested to hear them, as it'll help me get a better handle on Scala. Thanks much!

Steve Salevan and others added some commits
Steve Salevan Merge branch 'master' of github.com:tumblr/platform bf0d8c4
@dallasmarlow dallasmarlow Merge branch 'master' of github.com:tumblr/platform 5c3f857
@DanSimon DanSimon basic Solr serialization 056272a
@bmatheny bmatheny Merge pull request #33 from tumblr/xunil-invisible-touch-for-maintenance
Hosts in Maintenance status should be given Invisible Touch
db88dc9
@DanSimon DanSimon setting up Solr plugin to populate on startup 90def22
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform 46fa9d6
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform f40fcca
Joey Dong Merge branch 'joey-simple_metric_creator' 22e3b79
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform b26cd26
Joshua Hoffman Merge branch 'master' of github.com:tumblr/platform 8feb42b
Joey Dong Merge branch 'joey-fibr_dynamic_sample_periods' de4cb3b
Joshua Hoffman Merge branch 'master' of github.com:tumblr/platform 0c3f2f3
@dallasmarlow dallasmarlow Merge branch 'master' of github.com:tumblr/platform c90242b
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 71bac12
@DanSimon DanSimon adding configuration for using external Solr 106a54f
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 78f2261
@DanSimon DanSimon adding simple typeing scheme to asset meta values
Not yet enforced when setting values
4c1bfb9
Steve Salevan Merge branch 'master' of github.com:tumblr/platform eaae903
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform 8ab11ff
@DanSimon DanSimon adding type enforcement to asset metavalue creation 1a10404
@DanSimon DanSimon Merge branch 'master' into dan-collins-solr 32128b4
Joey Dong Merge branch 'joey-fibr_post_method' f916d28
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform de5e04d
@DanSimon DanSimon adding solr config folder with out-of-the-box settings, basic asset s…
…chema
d42287e
Wiktor Macura Merge branch 'master' of github.com:tumblr/platform f56fbac
@DanSimon DanSimon splitting Number type into Integer and Double 8e595f5
@DanSimon DanSimon serialization uses solr dynamic key format 657fa76
@DanSimon DanSimon config option for populating solr on startup d7efcd4
@DanSimon DanSimon making dynamic fields multi-valued, fixing crud date handling f8fe4ba
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform aa35757
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform ec447ca
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform e25674a
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform f178997
Wiktor Macura Merge branch 'master' of github.com:tumblr/platform df1586b
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform 778dc1b
@oliversong oliversong fixing merge conflicts 8f1cbdf
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform e77a716
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform 4cf9727
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform 5ac4869
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform cfdb1a4
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 778bf12
Steve Salevan Merge branch 'master' of github.com:tumblr/platform eefa8fd
@oliversong oliversong Merge branch 'oliver-scale-render-skip' 596cfd9
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform d40049e
@bmatheny bmatheny collins - Bug fixes
 * Carry over the user option into the action execution thread
 * Use a partial update for any asset updates to avoid clobbering concurrent updates
d3f8db9
@bmatheny bmatheny collins - Need to fire callback for partialUpdate 5786a2c
@bmatheny bmatheny collins - fixed callbacks 707d1a3
@bmatheny bmatheny Exposing all logs via API a883085
@DanSimon DanSimon fixing solr config path, populating solr with assets
Having major problems getting indexing to work on Play startup, in dev mode
calling server.add causes Play to reload the application for some reason.  For
now I got around it by adding a simple controller action for performing the
indexing.  This happens when using either the embedded server or an external
server via http.  This problem doesn't seem to occur when collins is run in
production mode.
ea9d494
@DanSimon DanSimon fixing up solr initialization 301152a
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 35caec6
@DanSimon DanSimon basic parser for new collins query language
Needs tests!!!!
df49064
Wiktor Macura Merge branch 'master' of github.com:tumblr/platform 69f6f0e
@DanSimon DanSimon parser tests, namespace fixes, internal DSL for queries 5633ccd
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 0d3a4e7
@DanSimon DanSimon moving solr conf files to another branch for sanity 76f97cb
@DanSimon DanSimon working on solr query generation from AST 74f84af
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 27360fd
@oliversong oliversong Merge branch 'master' of github.com:tumblr/platform 30ce9f2
@KeithFrost KeithFrost Merge branch 'master' of github.com:tumblr/platform into keith_fibr_s…
…ervice
f1b080b
@KeithFrost KeithFrost Merge pull request #35 from tumblr/keith_indef_stats
Revert "Continue to send zeroes for rare aggregates"
ce5079f
@KeithFrost KeithFrost Merge branch 'master' of github.com:tumblr/platform into keith_fibr_s…
…ervice
3f0906b
@oliversong oliversong Merge branch 'master' of github.com:tumblr/platform 92e8b4e
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform c6ecbd8
@DanSimon DanSimon adding value type-checking to CQL, separating Solr query generation ef6c17a
@DanSimon DanSimon Merge branch 'master' into dan-collins-solr 77b3284
@DanSimon DanSimon query generation fixes, tests f649a42
@DanSimon DanSimon plugin path fix, type checking tests 2685dba
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 5d262c3
@oliversong oliversong Merge branch 'master' of github.com:tumblr/platform fd6630f
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform ea82ae8
@mkosut mkosut Merge branch 'master' of github.com:tumblr/platform 2946b54
@DanSimon DanSimon adding CQL support for negation, solr range queries 654ab4f
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform fcd2f32
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform 8dd6f3d
@bmatheny bmatheny Added /api/timestamp endpoint e8b7b9c
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 3723607
Wiktor Macura Merge branch 'master' of github.com:tumblr/platform 511bbbc
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform db311ee
@DanSimon DanSimon some code cleanup cb56015
@KeithFrost KeithFrost Merge branch 'master' of github.com:tumblr/platform into keith_fibr_s…
…ervice
a1d7c4f
@DanSimon DanSimon switch query log level from DEBUG to INFO for production logging fd6a716
@DanSimon DanSimon Merge branch 'master' of github.com:tumblr/platform fb7990e
@DanSimon DanSimon Merge branch 'master' into dan-collins-solr 7f1e71b
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform c7fa6dc
Wiktor Macura Merge branch 'master' of github.com:tumblr/platform 3a808c3
Steve Salevan Merge branch 'master' of github.com:tumblr/platform 0c1fd89
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform a8b8251
@DanSimon DanSimon adding solr search action, hooking into routes, almost working 5bdae58
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 2f3cd61
@DanSimon DanSimon fixing solr query bugs db9fa05
@DanSimon DanSimon fixing httpclient wire logging levels 7669880
@DanSimon DanSimon fixing solr key conversions c12a1de
Steve Salevan Merge branch 'master' of github.com:tumblr/platform 5449793
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 80919f1
@DanSimon DanSimon adding support for enum string values as values 6b3f29b
@DanSimon DanSimon fixing bug with multi-valued attributes in nodeclass comparison
If an asset had multiple values of an asset meta (distinguished by group id),
only of of the values at random would be used during the comparison for
selecting a node-class for the asset.
8957d71
@DanSimon DanSimon allowing unquoted identifiers, fixing solr background indexing c43c4c0
@DanSimon DanSimon typeing non-meta values d363976
Wiktor Macura Merge branch 'master' of github.com:tumblr/platform 8d26b04
@DanSimon DanSimon integrating IPMI info, basic AssetFinder to Solr conversion 6b4d218
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform a2e9dd0
@DanSimon DanSimon adding support for optional ranges, fixing finder solr conversion 3df7fd4
Alex Ratner Merge branch 'master' of ssh://github.com/tumblr/platform 7071bb0
Steve Salevan Merge branch 'master' of github.com:tumblr/platform 5babda5
@bmatheny bmatheny Updated LDAP authentication to be config flexible for group names 429f844
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform 19a0695
@DanSimon DanSimon fixing solr date serialization, asset finder solr conversion 9e7f8a0
@DanSimon DanSimon nodeclass selection chooses strongest match (based on number of values) 8216d02
@DanSimon DanSimon Merge branch 'master' of github.com:tumblr/platform e460aab
@DanSimon DanSimon Merge branch 'master' into dan-collins-solr
Conflicts:
	collins/conf/application.conf
39d3d4d
@dallasmarlow dallasmarlow Merge branch 'master' of github.com:tumblr/platform 578f446
@DanSimon DanSimon adding ip addresses to solr serialization 2dc3aec
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 38e5ebf
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform 41b554e
@DanSimon DanSimon fixing solr date serialization 0dcf7c0
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 321a206
@oliversong oliversong Merge branch 'dashboards-landing' ddf1217
@DanSimon DanSimon fixing ip address serialization, tests 43bdb34
@DanSimon DanSimon adding API route/action for solr search f8c2749
@DanSimon DanSimon hooking sort field into query 698b255
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 1444a8f
Wiktor Macura Merge branch 'master' of github.com:tumblr/platform 2eb4ff7
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform a74e24e
@oliversong oliversong Merge branch 'master' of github.com:tumblr/platform 5cd065e
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 345e0a6
@DanSimon DanSimon fixes to collins_shell integration, API solr route 25448fe
@DanSimon DanSimon working on docs, enum case sensitivity 3996079
@bmatheny bmatheny Move remaining endpoints to configurable permissions 2ebb68a
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 223bb5c
@oliversong oliversong Merge branch 'master' of github.com:tumblr/platform 068d9ae
@DanSimon DanSimon fixing type enum case insensitivity 9f523a1
@DanSimon DanSimon fixing up documentation 40a00e5
@oliversong oliversong Merge branch 'master' of github.com:tumblr/platform cfbc0c1
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 7c71f22
@DanSimon DanSimon cleaning up solr plugin interface, asset update/delete hooks c7e7e69
@DanSimon DanSimon docs update 42ca52c
@DanSimon DanSimon Update collins/cql.md 3b885ad
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform d842186
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform b02778e
@eelias eelias Merge branch 'master' of github.com:tumblr/platform 91742e2
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform b73f6aa
@DanSimon DanSimon allowing case insensitive logical operators, unquoted ip addresses bf9c5c1
@DanSimon DanSimon Merge branch 'dan-collins-solr' of github.com:tumblr/platform into da…
…n-collins-solr
c5c7660
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 0cff9ef
@DanSimon DanSimon Update collins/cql.md 711ec8f
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform 24a66ba
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform af5879b
Wiktor Macura Merge branch 'master' of github.com:tumblr/platform b5891da
@DanSimon DanSimon fixing solr asset updates to not used cached data 31dc652
@DanSimon DanSimon Merge branch 'dan-collins-solr' of github.com:tumblr/platform into da…
…n-collins-solr
651ccd5
@DanSimon DanSimon adding solr reindexing hooks for ip address create/delete c13f54d
Joey Dong Merge branch 'joey-fibr_cleanup_again' 0fdcbb0
@DanSimon DanSimon solr fixes for ip address cfb07fd
@DanSimon DanSimon fixing bug with negations in queries 98b803f
@DanSimon DanSimon Merge branch 'master' into dan-collins-solr 069bd71
@DanSimon DanSimon Update collins/cql.md 728e549
@DanSimon DanSimon typo c24ae3a
@DanSimon DanSimon Merge branch 'dan-collins-solr' of github.com:tumblr/platform into da…
…n-collins-solr
e686bed
@DanSimon DanSimon adding support for post-processing solr value map before insertion 415415b
@DanSimon DanSimon fixing a bunch of case sensitivity issues da69537
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform c133c07
@jakdemir jakdemir Merge branch 'master' of https://github.com/tumblr/platform d27251a
@DanSimon DanSimon fixing some generated key issues 0c1509b
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform d0ff984
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 395c94f
@DanSimon DanSimon Solr updates using callback system, new Actor for buffered updates dce0e4d
@DanSimon DanSimon hoooking more model callbacks into solr 8f61d99
@DanSimon DanSimon Merge branch 'master' into dan-collins-solr 53a9804
@dallasmarlow dallasmarlow Merge branch 'dallas-phil' 6905e35
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 2fa6883
@mosesn mosesn Merge pull request #38 from tumblr/standard-project2
updated standard-project 2
0032671
Wiktor Macura Merge branch 'master' of github.com:tumblr/platform 261ad29
@KeithFrost KeithFrost Merge pull request #41 from tumblr/keith_indef_stats
added sbt-dependency-graph plugin to indefatigable
b4edb0b
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform c1eeaf7
Wiktor Macura Merge branch 'master' of github.com:tumblr/platform 1e7db96
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform e2343a4
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform 93fb9b3
@DanSimon DanSimon fixing more case issues 72d6efa
@DanSimon DanSimon beginning to add rspec tests 90e9877
@mosesn mosesn Merge pull request #37 from tumblr/zipkin_scraper
scraper script, tailf to it and it will send logs from GO to zipkin-collector
1f2fcfa
@DanSimon DanSimon more tests, dev.conf 862565d
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform a05788e
Joey Dong Merge branch 'joey-fibr_report_endpoint'
Features new /report endpoint in fibr to help generate report urls. Reports are counts for daily activities.
34c8f37
@oliversong oliversong Merge conflict resolving a1c5d1e
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 92078c6
@mosesn mosesn Merge pull request #36 from tumblr/zipkin_update
zipkin_update
cc6a1e6
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 1065c3f
@DanSimon DanSimon new update tests, fixing solr asset deletion bugs f494cd5
@DanSimon DanSimon fixing possible race condition on asset delete f2d1805
Wiktor Macura Merge branch 'master' of github.com:tumblr/platform 4914fb2
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform 1e2d3ac
@DanSimon DanSimon fixing meta typing test 42980bf
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 5b2d2e0
@oliversong oliversong Merge branch 'master' of github.com:tumblr/platform e0eda7a
Wiktor Macura Merge branch 'master' of github.com:tumblr/platform 429a1ca
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 5b4386e
@KeithFrost KeithFrost Merge branch 'master' into keith_fibr_service c4d10da
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform a0b752c
@KeithFrost KeithFrost Merge pull request #43 from tumblr/keith_fibr_service
Filter negative values when aggregating rates.
92352fb
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform 259e0c1
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 1c1f968
@oliversong oliversong Merge branch 'master' of github.com:tumblr/platform 2d77722
@oliversong oliversong Merge branch 'master' of github.com:tumblr/platform f5fc65e
@DanSimon DanSimon making meta value type an Int b70c89e
Wiktor Macura Merge branch 'master' of github.com:tumblr/platform c83074d
@DanSimon DanSimon moving solr repopulate action to admin resources 5322c00
@DanSimon DanSimon minor refactoring and code cleanup 475f8f5
@oliversong oliversong Merge branch 'master' of github.com:tumblr/platform 96a4044
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 94fff8d
@DanSimon DanSimon a bit more refactoring 4644ec4
@jakdemir jakdemir Merge branch 'master' of https://github.com/tumblr/platform b274429
@oliversong oliversong Merge branch 'master' of github.com:tumblr/platform 43ef96d
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 2ae9591
@jakdemir jakdemir Merge branch 'master' of https://github.com/tumblr/platform efe2fec
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform d87a2fc
@DanSimon DanSimon refactoring solr classes into several files, upgrading solr client ff67027
@DanSimon DanSimon attempting to surpress apache debug logging 0228635
Ben Wu Merge branch 'master' of https://github.com/tumblr/platform d27f29b
@DanSimon DanSimon refactoring solr keys, new generated field for keylists d2b6649
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 76e206f
Wiktor Macura Merge branch 'master' of github.com:tumblr/platform 4aeb817
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 85a7dfa
@mosesn mosesn Merge pull request #44 from tumblr/deploy_details
split redis port out into config, made production versions, added capfile
72a7532
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform bbfe966
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/platform feac8a9
@bmatheny bmatheny DNS cache 8bae76b
Petar Maymounkov Merge branch 'master' of github.com:tumblr/platform 10f6d5e
@bmatheny bmatheny Merge pull request #40 from tumblr/dan-collins-solr
Collins Solr-based searching
d0f844a
@bmatheny bmatheny Move stuff to top level 0f45f81
@bmatheny bmatheny Using the correct gitignore 2cbb738
@bmatheny bmatheny Adding some sample configs 7060b51
@bmatheny bmatheny Readying for release. 0c99cb7
@bmatheny bmatheny Added help links 9b9cdf4
@bmatheny bmatheny Adding license info bd95ed3
@DanSimon DanSimon adding minimal solr config 4d28413
@DanSimon DanSimon adding Amy's tests 1ec46f4
@DanSimon DanSimon refactoring query rspec tests d9cccd1
@DanSimon DanSimon pulling cql docs out of master branch dc3a13d
@bmatheny bmatheny Bundle in solr configs e0051ac
@bmatheny bmatheny Merge branch 'master' of github.com:tumblr/collins 3af7489
@bmatheny bmatheny Migrating collins-client, collins-state and collins-shell to new repo 9ac93ad
Steve Salevan Adding some debugging output to provisioner in provisioning failure c…
…ases
a123b14
Steve Salevan Adding the first draft of a feature to allow for dynamic list header …
…specification
6bd94f4
Steve Salevan Messing with Collins cdadf9e
Steve Salevan Adding changes which make dynamic list viewing work (mostly) 03ea951
Steve Salevan Adding further refinements and comments, plus a lot of introspection 3c85051
Steve Salevan Simplifying Java introspection code, fixing bugs in formatting and de…
…coration
a1a3ef1
Steve Salevan A little code cleanup b24dea8
Steve Salevan A bit more cleanup 6aea94c
@bmatheny

This will need to be updated to use the new configuration API before it will merge cleanly. We should see if any of this makes sense to merge into the default tag decorators behavior.

@bmatheny bmatheny commented on the diff
app/util/views/Formatter.scala
((11 lines not shown))
val ISO_8601_FORMAT = "yyyy-MM-dd'T'HH:mm:ss"
+ val HUMAN_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"
@bmatheny
bmatheny added a note

Should this be a config option?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@bmatheny bmatheny commented on the diff
app/util/views/ListHelper.scala
((13 lines not shown))
import util.power.{PowerComponent, PowerUnits}
-// Mostly used with views/asset/list, also for comprehensions
-object ListHelper {
- def showHostname(assets: Page[AssetView]): Boolean = {
- assets.items.find(_.getHostnameMetaValue.isDefined).map(_ => true).getOrElse(false)
+case class FormatConfigurationException(formatter: String, tag: String)
+ extends Exception("Didn't find formatter Formatter.%s in configuration for %s"
+ .format(formatter, tag))
+
+case class MethodCallConfigurationException(methodCall: String, tag: String)
@bmatheny
bmatheny added a note

Take a look at the callback MethodReplacement/MethodInvoker code. We may want to pull some of this stuff into a common reflections lib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@bmatheny bmatheny commented on the diff
app/util/views/ListHelper.scala
((32 lines not shown))
+ * Helper methods used when compiling lists of assets within Collins, with
+ * facilities for determining whether tags should be shown and how to display
+ * metavalue information from these tags.
+ */
+object ListHelper extends DecoratorBase {
+
+ /**
+ * Specifies the default ordering for asset list views.
+ */
+ val DEFAULT_TAG_ORDER = "~tag,HOSTNAME,PRIMARY_ROLE,STATUS,~created,~updated"
+
+ /**
+ * Specifies a regex used to find method calls to make during string
+ * formatting.
+ */
+ val METHOD_CALL_REGEX = """~\{(.*)\}""".r
@bmatheny
bmatheny added a note

Should this be non-greedy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@bmatheny

The only other comment I have is some of this needs unit testing.

@bmatheny bmatheny commented on the diff
app/util/views/ListHelper.scala
((57 lines not shown))
+ /**
+ * Supplies a configuration prefix to all decorator-specific methods.
+ *
+ * @return a String containing the list tag-specific configuration prefix.
+ */
+ override def configPrefix(): String = "listtags"
+
+ /**
+ * Calls a method specified as a string, using the supplied arguments to
+ * determine the manner in which it gets called.
+ *
+ * @param method a String containing a method to call.
+ * @param asset an AssetView object.
+ * @return the results of the method call.
+ */
+ def callMethod(method: String, onObj: Object, args: Object*) = {
@bmatheny
bmatheny added a note

Scala uses AnyRef, not Object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@bmatheny

I'm working on fixing the merge conflicts I created. After looking at the original pull request, enough changed that I'll try not to screw you over :)

@bmatheny

Okay I lied about fixing merge conflicts. I spent a few hours on this yesterday and have some thoughts/ideas I want to share. Grab me when you get in this morning.

@ssalevan ssalevan was assigned
@Primer42
Collaborator

Hi All,
Does anyone know the status of this pull request? Is it something that we still want in collins, or is it too removed from the current code base to be recoverable?

@asheepapart

I'm unsure. Personally, I avoid classes named "Helper" anything and try to get more specific.

@Primer42 Primer42 closed this
@maddalab maddalab deleted the steve-search-improvements branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.