-
Notifications
You must be signed in to change notification settings - Fork 10
Get notified on changes related to a corpus #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v4
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
function (head, req) { | ||
start({ | ||
'headers': { | ||
'Content-Type': 'text/xml' | ||
} | ||
}); | ||
uri = req.query.app; | ||
send('<rss><channel><title>' + req.query.startkey + '</title><link>'); | ||
send(uri); | ||
send('</link><description>Created or updated items.</description>'); | ||
while(row = getRow()){ | ||
var i=0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Il est souvent conseillé de mettre un espace de chaque côté du |
||
var topic=""; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Il est souvent conseillé de mettre un espace de chaque côté du |
||
for (var t in row.doc.topics){ | ||
topic+=t+", "; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Il est souvent conseillé de mettre un espace de chaque côté du |
||
} | ||
send(''.concat( | ||
'<item>', | ||
'<title>' + row.doc.item_name + '</title>', | ||
'<description> Lieu : ' + row.doc.spatial + ' Créé le : ' + row.doc.created + ' Catégorie(s) : ' + topic + '</description>', | ||
'<link>' + uri + '/item/' + row.doc.item_corpus + '/' + row.id + '</link>', | ||
'<guid>Modifié le : ' + row.doc.record.modified + '</guid>' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Même si ça devrait marcher, c'est un peu bizarre de mettre une phrase (en français qui plus est ) comme identifiant. Par contre, vous avez raison @sarah-ngn, le moment précis de la modification est un bon candidat pour identifier l'évènement. |
||
'</item>' | ||
)); | ||
} | ||
send('</channel></rss>'); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,144 +1,152 @@ | ||
[ | ||
{ | ||
"to": "../../_changes", | ||
"from": "events", | ||
"query": { | ||
"filter": "argos/events", | ||
"feed": "eventsource" | ||
} | ||
}, | ||
{ | ||
"from": "item/", | ||
"to": "_view/resource", | ||
"query": { | ||
"key": [":resource"] | ||
} | ||
}, { | ||
"from": "empty", | ||
"to": "_list/empty/empty", | ||
"query": { | ||
"include_docs": "true" | ||
} | ||
}, { | ||
"from": "", | ||
"to": "_list/index/stats", | ||
"query": { | ||
"group": "true" | ||
}, | ||
"method": "GET" | ||
}, { | ||
"from": "", | ||
"to": "../../" | ||
}, { | ||
"from": "_users", | ||
"to": "../../../_users" | ||
}, { | ||
"from": ":object", | ||
"to": "../../:object" | ||
}, { | ||
"from": "user/:user", | ||
"to": "_view/user", | ||
"query": { | ||
"key": [":user"], | ||
"reduce": "false" | ||
} | ||
}, { | ||
"from": "corpus/:corpus", | ||
"to": "_view/corpus", | ||
"query": { | ||
"startkey": [":corpus"], | ||
"endkey": [":corpus", {}] | ||
} | ||
}, { | ||
"from": "item/:corpus/:item", | ||
"to": "_view/corpus", | ||
"query": { | ||
"startkey": [":corpus", ":item"], | ||
"endkey": [":corpus", ":item", {}] | ||
} | ||
}, { | ||
"from": "item/:corpus/:item/:resource", | ||
"to": "../../:item/:resource" | ||
}, { | ||
"from": "viewpoint/:viewpoint", | ||
"to": "_view/viewpoint", | ||
"query": { | ||
"startkey": [":viewpoint"], | ||
"endkey": [":viewpoint", {}] | ||
} | ||
}, { | ||
"from": "topic/:viewpoint/:topic", | ||
"to": "_view/viewpoint", | ||
"query": { | ||
"startkey": [":viewpoint", ":topic"], | ||
"endkey": [":viewpoint", ":topic", {}] | ||
} | ||
}, { | ||
"from": "attribute/:corpus/", | ||
"to": "_view/attribute", | ||
"query": { | ||
"startkey": [":corpus"], | ||
"endkey": [":corpus", {}], | ||
"group_level": "2" | ||
} | ||
}, { | ||
"from": "attribute/:corpus/:attribute/", | ||
"to": "_view/attribute", | ||
"query": { | ||
"startkey": [":corpus", ":attribute"], | ||
"endkey": [":corpus", ":attribute", {}], | ||
"group_level": "3" | ||
} | ||
}, { | ||
"from": "attribute/:corpus/:attribute/:value", | ||
"to": "_view/attribute", | ||
"query": { | ||
"startkey": [":corpus", ":attribute", ":value"], | ||
"endkey": [":corpus", ":attribute", ":value", {}], | ||
"reduce": "false" | ||
} | ||
}, { | ||
"from": "v1/actor/", | ||
"to": "_list/actorsV1/user", | ||
"query": { | ||
"group": "true" | ||
} | ||
}, { | ||
"from": "v1/actor/:user", | ||
"to": "_list/actorV1/user", | ||
"query": { | ||
"key": [":user"], | ||
"reduce": "false" | ||
} | ||
}, { | ||
"from": "v1/viewpoint/:viewpoint/", | ||
"to": "_list/viewpointV1/viewpointV1", | ||
"query": { | ||
"key": [":viewpoint"] | ||
} | ||
}, { | ||
"from": "v1/viewpoint/:viewpoint/topic/:topic", | ||
"to": "_list/topicV1/viewpointV1", | ||
"query": { | ||
"key": [":viewpoint",":topic"] | ||
} | ||
}, { | ||
"from": "v1/entity/:corpus/:item/:coordinates", | ||
"to": "_list/fragmentV1/fragmentV1", | ||
"query": { | ||
"key": [":item", ":coordinates"] | ||
} | ||
}, { | ||
"from": "v1/entity/:corpus/:item", | ||
"to": "_show/itemV1/:item" | ||
}, { | ||
"from": "v1/entity/:corpus/", | ||
"to": "_list/corpusV1/corpusV1", | ||
"query": { | ||
"key": [":corpus"] | ||
} | ||
}, { | ||
"from": ":object/:resource", | ||
"to": "../../:object/:resource" | ||
} | ||
] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Attention, vous avez dû modifier quelque chose dans l'indendation (peut-être est-ce à cause de l'éditeur que vous utilisez). Du coup, ça rend difficile de voir précisément ce que vous vouliez réellement modifier. En plus des problèmes de lecture du |
||
[ | ||
{ | ||
"to": "../../_changes", | ||
"from": "events", | ||
"query": { | ||
"filter": "argos/events", | ||
"feed": "eventsource" | ||
} | ||
}, | ||
{ | ||
"from": "item/", | ||
"to": "_view/resource", | ||
"query": { | ||
"key": [":resource"] | ||
} | ||
}, { | ||
"from": "empty", | ||
"to": "_list/empty/empty", | ||
"query": { | ||
"include_docs": "true" | ||
} | ||
}, { | ||
"from": "", | ||
"to": "_list/index/stats", | ||
"query": { | ||
"group": "true" | ||
}, | ||
"method": "GET" | ||
}, { | ||
"from": "", | ||
"to": "../../" | ||
}, { | ||
"from": "_users", | ||
"to": "../../../_users" | ||
}, { | ||
"from": ":object", | ||
"to": "../../:object" | ||
}, { | ||
"from": "user/:user", | ||
"to": "_view/user", | ||
"query": { | ||
"key": [":user"], | ||
"reduce": "false" | ||
} | ||
}, { | ||
"from": "feed/:corpic", | ||
"to": "_list/feed/modified", | ||
"query": { | ||
"include_docs": "true", | ||
"startkey": [":corpic"], | ||
"endkey": [":corpic",{}] | ||
} | ||
}, { | ||
"from": "corpus/:corpus", | ||
"to": "_view/corpus", | ||
"query": { | ||
"startkey": [":corpus"], | ||
"endkey": [":corpus", {}] | ||
} | ||
}, { | ||
"from": "item/:corpus/:item", | ||
"to": "_view/corpus", | ||
"query": { | ||
"startkey": [":corpus", ":item"], | ||
"endkey": [":corpus", ":item", {}] | ||
} | ||
}, { | ||
"from": "item/:corpus/:item/:resource", | ||
"to": "../../:item/:resource" | ||
}, { | ||
"from": "viewpoint/:viewpoint", | ||
"to": "_view/viewpoint", | ||
"query": { | ||
"startkey": [":viewpoint"], | ||
"endkey": [":viewpoint", {}] | ||
} | ||
}, { | ||
"from": "topic/:viewpoint/:topic", | ||
"to": "_view/viewpoint", | ||
"query": { | ||
"startkey": [":viewpoint", ":topic"], | ||
"endkey": [":viewpoint", ":topic", {}] | ||
} | ||
}, { | ||
"from": "attribute/:corpus/", | ||
"to": "_view/attribute", | ||
"query": { | ||
"startkey": [":corpus"], | ||
"endkey": [":corpus", {}], | ||
"group_level": "2" | ||
} | ||
}, { | ||
"from": "attribute/:corpus/:attribute/", | ||
"to": "_view/attribute", | ||
"query": { | ||
"startkey": [":corpus", ":attribute"], | ||
"endkey": [":corpus", ":attribute", {}], | ||
"group_level": "3" | ||
} | ||
}, { | ||
"from": "attribute/:corpus/:attribute/:value", | ||
"to": "_view/attribute", | ||
"query": { | ||
"startkey": [":corpus", ":attribute", ":value"], | ||
"endkey": [":corpus", ":attribute", ":value", {}], | ||
"reduce": "false" | ||
} | ||
}, { | ||
"from": "v1/actor/", | ||
"to": "_list/actorsV1/user", | ||
"query": { | ||
"group": "true" | ||
} | ||
}, { | ||
"from": "v1/actor/:user", | ||
"to": "_list/actorV1/user", | ||
"query": { | ||
"key": [":user"], | ||
"reduce": "false" | ||
} | ||
}, { | ||
"from": "v1/viewpoint/:viewpoint/", | ||
"to": "_list/viewpointV1/viewpointV1", | ||
"query": { | ||
"key": [":viewpoint"] | ||
} | ||
}, { | ||
"from": "v1/viewpoint/:viewpoint/topic/:topic", | ||
"to": "_list/topicV1/viewpointV1", | ||
"query": { | ||
"key": [":viewpoint",":topic"] | ||
} | ||
}, { | ||
"from": "v1/entity/:corpus/:item/:coordinates", | ||
"to": "_list/fragmentV1/fragmentV1", | ||
"query": { | ||
"key": [":item", ":coordinates"] | ||
} | ||
}, { | ||
"from": "v1/entity/:corpus/:item", | ||
"to": "_show/itemV1/:item" | ||
}, { | ||
"from": "v1/entity/:corpus/", | ||
"to": "_list/corpusV1/corpusV1", | ||
"query": { | ||
"key": [":corpus"] | ||
} | ||
}, { | ||
"from": ":object/:resource", | ||
"to": "../../:object/:resource" | ||
} | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function (doc) { | ||
if (doc.item_corpus && doc.record.modified) { | ||
emit([doc.item_corpus, doc.record.modified]); | ||
if(doc.topics && doc.record.modified){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Il est conseillé de mettre un espace après le |
||
for (var t in doc.topics){ | ||
emit([t, doc.record.modified]); | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attention la variable n'est pas déclarée. Même si ça fonctionne, ça peut causer des effets de bord.