Skip to content

Commit

Permalink
Merge pull request #3 from wmde/dmChanges
Browse files Browse the repository at this point in the history
Adapt to changes in data model 0.3.0
  • Loading branch information
JeroenDeDauw committed Jul 10, 2014
2 parents a81b784 + 242eeeb commit ae9a803
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ version 1.0 of this package:

## Release notes

### 1.1.0 (???)

* Adapt to changes in wikibase/data-model-javascript@0.3.0.

### 1.0.0 (2014-07-03)

Initial release as a library.
14 changes: 7 additions & 7 deletions src/serialization.EntityUnserializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* TODO: we should probably have a ClaimList which then has its own unserializer.
*
* @param {Object} serialization
* @return wb.Claim[]
* @return wb.datamodel.Claim[]
*/
function unserializeClaims( serialization ) {
var claims = [];
Expand All @@ -50,7 +50,7 @@
for( var i in claimsPerProp ) {
var serializedClaim = claimsPerProp[ i ],
// TODO: use ClaimUnserializer here after it got implemented
claim = wb.Claim.newFromJSON( serializedClaim );
claim = wb.datamodel.Claim.newFromJSON( serializedClaim );

claims.push( claim );
}
Expand All @@ -69,7 +69,7 @@
/**
* @see wb.serialization.Unserializer.unserialize
*
* @return wb.Entity
* @return wb.datamodel.Entity
*/
unserialize: function( serialization ) {
var entityType = serialization.type,
Expand Down Expand Up @@ -100,21 +100,21 @@
$.extend( entityMapData, typeSpecificData );
}

return wb.Entity.newFromMap(
return wb.datamodel.Entity.newFromMap(
entityMapData
);
}
} );

// register in SerializationFactory for wb.Entity unserialization handling:
MODULE.SerializerFactory.registerUnserializer( SELF, wb.Entity );
// register in SerializationFactory for wb.datamodel.Entity unserialization handling:
MODULE.SerializerFactory.registerUnserializer( SELF, wb.datamodel.Entity );

/**
* Allows to register advanced unserialization logic for a certain type of Entity. Takes the
* type the additional handling is required for and a Unserializer object which has the job to
* return the type specific map data as Object. The Object keys should contain the data which
* is different for the handled type of entity compared to other entity types. The keys should
* be what wb.Entity.newFromMap requires to create a new Entity of the specific type.
* be what wb.datamodel.Entity.newFromMap requires to create a new Entity of the specific type.
*
* @since 0.4
*
Expand Down
2 changes: 1 addition & 1 deletion src/serialization.EntityUnserializer.propertyExpert.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

// register to EntityUnserializer:
MODULE.EntityUnserializer.registerTypeSpecificExpert(
wb.Property.TYPE,
wb.datamodel.Property.TYPE,
PropertyUnserializationExpert
);

Expand Down

0 comments on commit ae9a803

Please sign in to comment.