Opened 12 years ago

Closed 7 years ago

Last modified 7 years ago

#3126 closed enhancement (wontfix)

[dojo.data] add Attribution API

Reported by: skinner Owned by: skinner
Priority: low Milestone: future
Component: Data Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

Sometime in the future, when we have more time, we should consider adding a dojo.data Attribution API.

Here's some brainstorming about what dojo.data.api.Attribution might look like:

/////////////////////////////////
// OPTION 1: 

dojo.declare("dojo.data.api.Attribution",dojo.data.api.Read,{
	//	summary:
	//		This is an abstract API that data provider implementations conform to.
	//		This file defines methods signatures and intentionally leaves all the
	//		methods unimplemented.

	getFeatures: function(){
		//	summary: 
		//		See dojo.data.api.Read.getFeatures()
		return {
			 'dojo.data.api.Read': true,
			 'dojo.data.api.Attribution': true
		};
	},

	getAttributionValue: function(/* item || store */ item, /* String? */ attribution-property){
		//	summary:
		//		Returns attribution info about an item, such as the creation
		//		timestamp, or the last-modified timestamp.  Can also be used
		//		to get similar info about the datastore as a whole.
		//	examples:
		//		var date = store.getAttributionValue(item, "createdAtTime");
		//		var user = store.getAttributionValue(item, "createdByUser");
		//		var date = store.getAttributionValue(item, "lastModifiedAtTime");
		//		var user = store.getAttributionValue(item, "lastModifiedByUser");
		//		
		//		var date = store.getAttributionValue(store, "createdAtTime");
		//		var user = store.getAttributionValue(store, "copyrightHolder");
		//		var user = store.getAttributionValue(store, "copyrightLicense");
		//	issues:
		//		In the dojo.data.api.Write API, the isDirty method can be used
		//		to see either if an individual item is dirty or if the datastore
		//		as a whole is dirty, by either calling store.isDirty(item) or
		//		store.isDirty() (with no argument).  If we design this new
		//		getAttributionValue() method so that the first argument can be 
		//		either an item or the store itself, then that isn't consistent 
		//		with the isDirty() args.  What's a good alternative?  Should 
		//		we only use getAttributionValue() for items, and have some other
		//		method for getting attribution info about the datastore as a 
		//		whole?
		dojo.unimplemented('dojo.data.api.Attribution.getAttributionValue');
		return value; // Date || String || User-object
	}
});


/////////////////////////////////
// OPTION 2: 

dojo.declare("dojo.data.api.Attribution", dojo.data.api.Read, {
	//	summary:
	//		This is an abstract API that data provider implementations conform to.
	//		This file defines methods signatures and intentionally leaves all the
	//		methods unimplemented.

	getFeatures: function(){
		//	summary: 
		//		See dojo.data.api.Read.getFeatures()
		return {
			 'dojo.data.api.Read': true,
			 'dojo.data.api.Attribution': true
		};
	},

	getAttributionData: function(/* item? */ item){
		//	summary:
		//		Returns attribution info about an item, such as the creation
		//		timestamp, or the last-modified timestamp.  Can also be used
		//		to get similar info about the datastore as a whole.
		//	examples:
		//		var attribution = store.getAttributionData(item);
		//		var date = attribution["createdAtTime"];
		//		var user = attribution["createdByUser"];
		//		var date = attribution["lastModifiedAtTime"];
		//		var user = attribution["lastModifiedByUser"];
		//		
		//		var attribution = store.getAttributionData();
		//		var date = attribution["createdAtTime"];
		//		var owner = attribution["copyrightHolder"];
		//		var string = attribution["copyrightLicense"];
		dojo.unimplemented('dojo.data.api.Attribution.getAttributionData');
		return attributionObject; // Object
	}
});

Change History (7)

comment:1 Changed 12 years ago by Adam Peller

Owner: changed from anonymous to skinner

comment:2 Changed 12 years ago by Adam Peller

Milestone: 1.02.0

comment:3 Changed 11 years ago by alex

Milestone: 2.01.3

Milestone 2.0 deleted

comment:4 Changed 11 years ago by bill

Description: modified (diff)
Milestone: 1.3future

move unowned / abandoned tickets to "future" milestone

comment:5 Changed 7 years ago by ben hockey

Keywords: needsreview added

adding needsreview keyword - does anyone have any intention of doing/owning this? is there a reason to keep the ticket open?

comment:6 Changed 7 years ago by bill

Resolution: wontfix
Status: newclosed

I agree with peller and neonstalwart, that since dojo.data has been replaced by dojo.store we should just close these tickets.

comment:7 Changed 7 years ago by bill

Keywords: needsreview removed
Note: See TracTickets for help on using tickets.