summaryrefslogtreecommitdiff
path: root/src/main/groovy/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/groovy/org')
-rw-r--r--src/main/groovy/org/xapek/yvesf/classifieds/Dumper.groovy26
-rw-r--r--src/main/groovy/org/xapek/yvesf/classifieds/Model.groovy15
2 files changed, 38 insertions, 3 deletions
diff --git a/src/main/groovy/org/xapek/yvesf/classifieds/Dumper.groovy b/src/main/groovy/org/xapek/yvesf/classifieds/Dumper.groovy
index 623c786..ccadd56 100644
--- a/src/main/groovy/org/xapek/yvesf/classifieds/Dumper.groovy
+++ b/src/main/groovy/org/xapek/yvesf/classifieds/Dumper.groovy
@@ -9,7 +9,7 @@ class Dumper {
static dump(ClassifiedsList classifiedList, PrintWriter writer) {
new MarkupBuilder(writer).rss(version: '2.0', 'xmlns:atom': 'http://www.w3.org/2005/Atom') {
channel {
- title('Glocals')
+ title('Glocals Classifieds Feed')
description('glocal classifieds feed')
link('https://www.xapek.org/git/yvesf/classifieds')
classifiedList.each { Classified classified ->
@@ -20,7 +20,7 @@ class Dumper {
pubDate(classified.formattedDate)
author("${classified.mem_id}@noemail.local (${classified.mem_name})")
description(getDescription(classified) + classified.description)
- }
+ }
}
}
}
@@ -39,8 +39,28 @@ class Dumper {
td(classified.views)
}
tr {
+ th('Available')
+ td(classified.available)
+ }
+ tr {
+ th('Rooms')
+ td(classified.rooms)
+ }
+ tr {
th('Member')
- td(classified.mem_name)
+ td {
+ a(classified.mem_name, referrerpolicy: 'no-referrer', href: classified.memberProfileLink)
+ }
+ }
+ if (classified.images) {
+ tr {
+ th('Images')
+ td {
+ classified.images.eachWithIndex { String url, Integer i ->
+ a("Photo ${i + 1}", referrerpolicy: 'no-referrer', href: url)
+ }
+ }
+ }
}
br()
}
diff --git a/src/main/groovy/org/xapek/yvesf/classifieds/Model.groovy b/src/main/groovy/org/xapek/yvesf/classifieds/Model.groovy
index ac5ca13..cced09b 100644
--- a/src/main/groovy/org/xapek/yvesf/classifieds/Model.groovy
+++ b/src/main/groovy/org/xapek/yvesf/classifieds/Model.groovy
@@ -38,6 +38,7 @@ class Model {
//28 ="type" -> "Apts / Housing for rent"
//29 ="views" -> "8"
String available
+ String rooms
String location
String city
String type
@@ -50,6 +51,10 @@ class Model {
String mem_id
String description
String date
+ Object photo1
+ Object photo2
+ Object photo3
+ Object photo4
Classified(Map map) {
metaClass.properties.each { MetaProperty property ->
@@ -76,6 +81,16 @@ class Model {
String getComposedLocation() {
return location + (city != location ? ', ' + city : '')
}
+
+ Collection<String> getImages() {
+ return [photo1,photo2,photo3,photo4]
+ .grep { it instanceof String }
+ .collect { "http://www.glocals.com/sites/glocals${it}" }
+ }
+
+ String getMemberProfileLink() {
+ return "http://www.glocals.com/members/member_profile/${id}"
+ }
}
static class ClassifiedsList extends ArrayList<Classified> {