Skip to content

Commit 265d815

Browse files
committed
Added jobs getUri() method, jobs support attachments, version bump
1 parent b67f0ca commit 265d815

File tree

2 files changed

+65
-2
lines changed

2 files changed

+65
-2
lines changed

js/gitana/cluster/Job.js

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@
2929
return new Gitana.Job(this.getCluster(), this);
3030
},
3131

32+
/**
33+
* @override
34+
*/
35+
getUri: function()
36+
{
37+
return "/jobs/" + this.getId();
38+
},
39+
3240
/**
3341
* @returns {String} the type id of the job
3442
*/
@@ -164,7 +172,62 @@
164172
getPausedTimestamp: function()
165173
{
166174
return this.get("paused_timestamp");
167-
}
175+
},
176+
177+
//////////////////////////////////////////////////////////////////////////////////////////
178+
//
179+
// ATTACHMENTS
180+
//
181+
//////////////////////////////////////////////////////////////////////////////////////////
182+
183+
/**
184+
* Hands back an attachments map.
185+
*
186+
* @chained attachment map
187+
*
188+
* @param local
189+
*
190+
* @public
191+
*/
192+
listAttachments: Gitana.Methods.listAttachments(),
193+
194+
/**
195+
* Picks off a single attachment
196+
*
197+
* @chained attachment
198+
*
199+
* @param attachmentId
200+
*/
201+
attachment: function(attachmentId)
202+
{
203+
return this.listAttachments().select(attachmentId);
204+
},
205+
206+
/**
207+
* Creates an attachment.
208+
*
209+
* When using this method from within the JS driver, it really only works for text-based content such
210+
* as JSON or text.
211+
*
212+
* @chained attachment
213+
*
214+
* @param attachmentId (use null or false for default attachment)
215+
* @param contentType
216+
* @param data
217+
*/
218+
attach: Gitana.Methods.attach(),
219+
220+
/**
221+
* Deletes an attachment.
222+
*
223+
* @param attachmentId
224+
*/
225+
unattach: Gitana.Methods.unattach(),
226+
227+
/**
228+
* Generates a URI to a preview resource.
229+
*/
230+
getPreviewUri: Gitana.Methods.getPreviewUri()
168231
});
169232

170233
})(window);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gitanajs",
3-
"version": "1.0.303",
3+
"version": "1.0.304",
44
"repository": {
55
"type": "git",
66
"url": "git://github.com/gitana/gitana-javascript-driver.git"

0 commit comments

Comments
 (0)