[OLINGO-852] Minor tutorial fix

This commit is contained in:
mibo 2016-03-26 08:25:37 +01:00
parent 300316db8d
commit 838ca234e4
2 changed files with 20 additions and 8 deletions

View File

@ -568,21 +568,25 @@ private void initAdvertisementSampleData() {
final List<Entity> advertisements = manager.getEntityCollection(DemoEdmProvider.ES_ADVERTISEMENTS_NAME);
Entity entity = new Entity();
entity.setType(DemoEdmProvider.ET_ADVERTISEMENT_FQN.getFullQualifiedNameAsString());
entity.addProperty(new Property(null, "ID", ValueType.PRIMITIVE,
UUID.fromString("f89dee73-af9f-4cd4-b330-db93c25ff3c7")));
entity.addProperty(new Property(null, "Name", ValueType.PRIMITIVE, "Old School Lemonade Store, Retro Style"));
entity.addProperty(new Property(null, "AirDate", ValueType.PRIMITIVE, Timestamp.valueOf("2012-11-07 00:00:00")));
entity.addProperty(new Property(null, MEDIA_PROPERTY_NAME, ValueType.PRIMITIVE, "Super content".getBytes()));
entity.setMediaContentType(ContentType.parse("text/plain").toContentTypeString());
entity.setId(createId(entity, "ID"));
advertisements.add(entity);
entity = new Entity();
entity.setType(DemoEdmProvider.ET_ADVERTISEMENT_FQN.getFullQualifiedNameAsString());
entity.addProperty(new Property(null, "ID", ValueType.PRIMITIVE,
UUID.fromString("db2d2186-1c29-4d1e-88ef-a127f521b9c67")));
entity.addProperty(new Property(null, "Name", ValueType.PRIMITIVE, "Early morning start, need coffee"));
entity.addProperty(new Property(null, "AirDate", ValueType.PRIMITIVE, Timestamp.valueOf("2000-02-29 00:00:00")));
entity.addProperty(new Property(null, MEDIA_PROPERTY_NAME, ValueType.PRIMITIVE, "Super content2".getBytes()));
entity.setMediaContentType(ContentType.parse("text/plain").toContentTypeString());
entity.setId(createId(entity, "ID"));
advertisements.add(entity);
}
@ -646,6 +650,8 @@ private void initAdvertisementSampleData() {
return DemoEdmProvider.ES_CATEGORIES_NAME;
} else if (DemoEdmProvider.ET_PRODUCT_FQN.getFullQualifiedNameAsString().equals(entity.getType())) {
return DemoEdmProvider.ES_PRODUCTS_NAME;
} else if (DemoEdmProvider.ET_ADVERTISEMENT_FQN.getFullQualifiedNameAsString().equals(entity.getType())) {
return DemoEdmProvider.ES_ADVERTISEMENTS_NAME;
}
return entity.getType();
}

View File

@ -433,21 +433,25 @@ public class Storage {
private void initAdvertisementSampleData() {
Entity entity = new Entity();
entity.setType(DemoEdmProvider.ET_ADVERTISEMENT_FQN.getFullQualifiedNameAsString());
entity.addProperty(new Property(null, "ID", ValueType.PRIMITIVE,
UUID.fromString("f89dee73-af9f-4cd4-b330-db93c25ff3c7")));
entity.addProperty(new Property(null, "Name", ValueType.PRIMITIVE, "Old School Lemonade Store, Retro Style"));
entity.addProperty(new Property(null, "AirDate", ValueType.PRIMITIVE, Timestamp.valueOf("2012-11-07 00:00:00")));
entity.addProperty(new Property(null, MEDIA_PROPERTY_NAME, ValueType.PRIMITIVE, "Super content".getBytes()));
entity.setMediaContentType(ContentType.parse("text/plain").toContentTypeString());
entity.setId(createId(entity, "ID"));
advertisements.add(entity);
entity = new Entity();
entity.setType(DemoEdmProvider.ET_ADVERTISEMENT_FQN.getFullQualifiedNameAsString());
entity.addProperty(new Property(null, "ID", ValueType.PRIMITIVE,
UUID.fromString("db2d2186-1c29-4d1e-88ef-a127f521b9c67")));
entity.addProperty(new Property(null, "Name", ValueType.PRIMITIVE, "Early morning start, need coffee"));
entity.addProperty(new Property(null, "AirDate", ValueType.PRIMITIVE, Timestamp.valueOf("2000-02-29 00:00:00")));
entity.addProperty(new Property(null, MEDIA_PROPERTY_NAME, ValueType.PRIMITIVE, "Super content2".getBytes()));
entity.setMediaContentType(ContentType.parse("text/plain").toContentTypeString());
entity.setId(createId(entity, "ID"));
advertisements.add(entity);
}
@ -474,6 +478,8 @@ public class Storage {
return DemoEdmProvider.ES_CATEGORIES_NAME;
} else if(DemoEdmProvider.ET_PRODUCT_FQN.getFullQualifiedNameAsString().equals(entity.getType())) {
return DemoEdmProvider.ES_PRODUCTS_NAME;
} else if (DemoEdmProvider.ET_ADVERTISEMENT_FQN.getFullQualifiedNameAsString().equals(entity.getType())) {
return DemoEdmProvider.ES_ADVERTISEMENTS_NAME;
}
return entity.getType();
}