[OLINGO-713] Tutorial: typos fixed

This commit is contained in:
Christian Holzer 2015-10-21 14:57:11 +02:00
parent 211e8ad57f
commit 397f8e200d
5 changed files with 55 additions and 55 deletions

View File

@ -54,18 +54,18 @@ public class Storage {
// represent our database
private List<Entity> productList;
private List<Entity> categoryList;
private List<Entity> advertisments;
private List<Entity> advertisements;
public Storage() {
productList = new ArrayList<Entity>();
categoryList = new ArrayList<Entity>();
advertisments = new ArrayList<Entity>();
advertisements = new ArrayList<Entity>();
// creating some sample data
initProductSampleData();
initCategorySampleData();
initAdvertismentSampleData();
initAdvertisementSampleData();
}
/* PUBLIC FACADE */
@ -144,8 +144,8 @@ public class Storage {
return getEntityCollection(productList);
} else if (edmEntitySet.getName().equals(DemoEdmProvider.ES_CATEGORIES_NAME)) {
return getEntityCollection(categoryList);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_ADVERTISMENTS_NAME)) {
return getEntityCollection(advertisments);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_ADVERTISEMENTS_NAME)) {
return getEntityCollection(advertisements);
}
return null;
@ -160,8 +160,8 @@ public class Storage {
return getEntity(edmEntityType, keyParams, productList);
} else if (edmEntitySet.getName().equals(DemoEdmProvider.ES_CATEGORIES_NAME)) {
return getEntity(edmEntityType, keyParams, categoryList);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_ADVERTISMENTS_NAME)) {
return getEntity(edmEntityType, keyParams, advertisments);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_ADVERTISEMENTS_NAME)) {
return getEntity(edmEntityType, keyParams, advertisements);
}
return null;
@ -244,8 +244,8 @@ public class Storage {
updateEntity(edmEntityType, keyParams, updateEntity, httpMethod, productList);
} else if (edmEntitySet.getName().equals(DemoEdmProvider.ES_CATEGORIES_NAME)) {
updateEntity(edmEntityType, keyParams, updateEntity, httpMethod, categoryList);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_ADVERTISMENTS_NAME)) {
updateEntity(edmEntityType, keyParams, updateEntity, httpMethod, advertisments);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_ADVERTISEMENTS_NAME)) {
updateEntity(edmEntityType, keyParams, updateEntity, httpMethod, advertisements);
}
}
@ -258,8 +258,8 @@ public class Storage {
deleteEntity(edmEntityType, keyParams, productList);
} else if (edmEntitySet.getName().equals(DemoEdmProvider.ES_CATEGORIES_NAME)) {
deleteEntity(edmEntityType, keyParams, categoryList);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_ADVERTISMENTS_NAME)) {
deleteEntity(edmEntityType, keyParams, advertisments);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_ADVERTISEMENTS_NAME)) {
deleteEntity(edmEntityType, keyParams, advertisements);
}
}
@ -277,7 +277,7 @@ public class Storage {
final byte[] data) {
Entity entity = null;
if(edmEntityType.getName().equals(DemoEdmProvider.ET_ADVERTISMENT_NAME)) {
if(edmEntityType.getName().equals(DemoEdmProvider.ET_ADVERTISEMENT_NAME)) {
entity = new Entity();
entity.addProperty(new Property(null, "ID", ValueType.PRIMITIVE, UUID.randomUUID()));
entity.addProperty(new Property(null, "Name", ValueType.PRIMITIVE, null));
@ -286,7 +286,7 @@ public class Storage {
entity.setMediaContentType(mediaContentType);
entity.addProperty(new Property(null, MEDIA_PROPERTY_NAME, ValueType.PRIMITIVE, data));
advertisments.add(entity);
advertisements.add(entity);
}
return entity;
@ -499,7 +499,7 @@ public class Storage {
categoryList.add(entity);
}
private void initAdvertismentSampleData() {
private void initAdvertisementSampleData() {
Entity entity = new Entity();
entity.addProperty(new Property(null, "ID", ValueType.PRIMITIVE,
@ -508,7 +508,7 @@ private void initAdvertismentSampleData() {
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());
advertisments.add(entity);
advertisements.add(entity);
entity = new Entity();
entity.addProperty(new Property(null, "ID", ValueType.PRIMITIVE,
@ -517,7 +517,7 @@ private void initAdvertismentSampleData() {
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());
advertisments.add(entity);
advertisements.add(entity);
}
private URI createId(Entity entity, String idPropertyName) {

View File

@ -57,14 +57,14 @@ public class DemoEdmProvider extends CsdlAbstractEdmProvider {
public static final String ET_CATEGORY_NAME = "Category";
public static final FullQualifiedName ET_CATEGORY_FQN = new FullQualifiedName(NAMESPACE, ET_CATEGORY_NAME);
public static final String ET_ADVERTISMENT_NAME = "Advertisment";
public static final FullQualifiedName ET_ADVERTISMENT_FQN = new FullQualifiedName(NAMESPACE, ET_ADVERTISMENT_NAME);
public static final String ET_ADVERTISEMENT_NAME = "Advertisement";
public static final FullQualifiedName ET_ADVERTISEMENT_FQN = new FullQualifiedName(NAMESPACE, ET_ADVERTISEMENT_NAME);
// Entity Set Names
public static final String ES_PRODUCTS_NAME = "Products";
public static final String ES_CATEGORIES_NAME = "Categories";
public static final String ES_ADVERTISMENTS_NAME = "Advertisments";
public static final String ES_ADVERTISEMENTS_NAME = "Advertisements";
public static final String NAV_TO_CATEGORY = "Category";
public static final String NAV_TO_PRODUCTS = "Products";
@ -218,7 +218,7 @@ public class DemoEdmProvider extends CsdlAbstractEdmProvider {
entityType.setProperties(Arrays.asList(id, name));
entityType.setKey(Arrays.asList(propertyRef));
entityType.setNavigationProperties(navPropList);
} else if(entityTypeName.equals(ET_ADVERTISMENT_FQN)) {
} else if(entityTypeName.equals(ET_ADVERTISEMENT_FQN)) {
CsdlProperty id = new CsdlProperty().setName("ID").setType(EdmPrimitiveTypeKind.Guid.getFullQualifiedName());
CsdlProperty name = new CsdlProperty().setName("Name").setType(EdmPrimitiveTypeKind.String
.getFullQualifiedName());
@ -229,7 +229,7 @@ public class DemoEdmProvider extends CsdlAbstractEdmProvider {
propertyRef.setName("ID");
entityType = new CsdlEntityType();
entityType.setName(ET_ADVERTISMENT_NAME);
entityType.setName(ET_ADVERTISEMENT_NAME);
entityType.setProperties(Arrays.asList(id, name, airDate));
entityType.setKey(Collections.singletonList(propertyRef));
entityType.setHasStream(true);
@ -273,10 +273,10 @@ public class DemoEdmProvider extends CsdlAbstractEdmProvider {
List<CsdlNavigationPropertyBinding> navPropBindingList = new ArrayList<CsdlNavigationPropertyBinding>();
navPropBindingList.add(navPropBinding);
entitySet.setNavigationPropertyBindings(navPropBindingList);
} else if (entitySetName.equals(ES_ADVERTISMENTS_NAME)) {
} else if (entitySetName.equals(ES_ADVERTISEMENTS_NAME)) {
entitySet = new CsdlEntitySet();
entitySet.setName(ES_ADVERTISMENTS_NAME);
entitySet.setType(ET_ADVERTISMENT_FQN);
entitySet.setName(ES_ADVERTISEMENTS_NAME);
entitySet.setType(ET_ADVERTISEMENT_FQN);
}
}
@ -307,7 +307,7 @@ public class DemoEdmProvider extends CsdlAbstractEdmProvider {
List<CsdlEntityType> entityTypes = new ArrayList<CsdlEntityType>();
entityTypes.add(getEntityType(ET_PRODUCT_FQN));
entityTypes.add(getEntityType(ET_CATEGORY_FQN));
entityTypes.add(getEntityType(ET_ADVERTISMENT_FQN));
entityTypes.add(getEntityType(ET_ADVERTISEMENT_FQN));
schema.setEntityTypes(entityTypes);
// add actions
@ -337,7 +337,7 @@ public class DemoEdmProvider extends CsdlAbstractEdmProvider {
List<CsdlEntitySet> entitySets = new ArrayList<CsdlEntitySet>();
entitySets.add(getEntitySet(CONTAINER, ES_PRODUCTS_NAME));
entitySets.add(getEntitySet(CONTAINER, ES_CATEGORIES_NAME));
entitySets.add(getEntitySet(CONTAINER, ES_ADVERTISMENTS_NAME));
entitySets.add(getEntitySet(CONTAINER, ES_ADVERTISEMENTS_NAME));
// Create function imports
List<CsdlFunctionImport> functionImports = new ArrayList<CsdlFunctionImport>();

View File

@ -50,18 +50,18 @@ public class Storage {
private List<Entity> productList;
private List<Entity> categoryList;
private List<Entity> advertisments;
private List<Entity> advertisements;
public Storage() {
productList = new ArrayList<Entity>();
categoryList = new ArrayList<Entity>();
advertisments = new ArrayList<Entity>();
advertisements = new ArrayList<Entity>();
initProductSampleData();
initCategorySampleData();
initAdvertismentSampleData();
initAdvertisementSampleData();
}
/* PUBLIC FACADE */
@ -72,8 +72,8 @@ public class Storage {
return getEntityCollection(productList);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_CATEGORIES_NAME)) {
return getEntityCollection(categoryList);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_ADVERTISMENTS_NAME)) {
return getEntityCollection(advertisments);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_ADVERTISEMENTS_NAME)) {
return getEntityCollection(advertisements);
}
return null;
@ -88,8 +88,8 @@ public class Storage {
return getEntity(edmEntityType, keyParams, productList);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_CATEGORIES_NAME)) {
return getEntity(edmEntityType, keyParams, categoryList);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_ADVERTISMENTS_NAME)) {
return getEntity(edmEntityType, keyParams, advertisments);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_ADVERTISEMENTS_NAME)) {
return getEntity(edmEntityType, keyParams, advertisements);
}
return null;
@ -120,8 +120,8 @@ public class Storage {
updateEntity(edmEntityType, keyParams, updateEntity, httpMethod, productList);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_CATEGORIES_NAME)) {
updateEntity(edmEntityType, keyParams, updateEntity, httpMethod, categoryList);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_ADVERTISMENTS_NAME)) {
updateEntity(edmEntityType, keyParams, updateEntity, httpMethod, advertisments);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_ADVERTISEMENTS_NAME)) {
updateEntity(edmEntityType, keyParams, updateEntity, httpMethod, advertisements);
}
}
@ -134,8 +134,8 @@ public class Storage {
deleteEntity(edmEntityType, keyParams, productList);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_CATEGORIES_NAME)) {
deleteEntity(edmEntityType, keyParams, categoryList);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_ADVERTISMENTS_NAME)) {
deleteEntity(edmEntityType, keyParams, advertisments);
} else if(edmEntitySet.getName().equals(DemoEdmProvider.ES_ADVERTISEMENTS_NAME)) {
deleteEntity(edmEntityType, keyParams, advertisements);
}
}
@ -205,7 +205,7 @@ public class Storage {
final byte[] data) {
Entity entity = null;
if(edmEntityType.getName().equals(DemoEdmProvider.ET_ADVERTISMENT_NAME)) {
if(edmEntityType.getName().equals(DemoEdmProvider.ET_ADVERTISEMENT_NAME)) {
entity = new Entity();
entity.addProperty(new Property(null, "ID", ValueType.PRIMITIVE, UUID.randomUUID()));
entity.addProperty(new Property(null, "Name", ValueType.PRIMITIVE, null));
@ -214,7 +214,7 @@ public class Storage {
entity.setMediaContentType(mediaContentType);
entity.addProperty(new Property(null, MEDIA_PROPERTY_NAME, ValueType.PRIMITIVE, data));
advertisments.add(entity);
advertisements.add(entity);
}
return entity;
@ -430,7 +430,7 @@ public class Storage {
categoryList.add(entity);
}
private void initAdvertismentSampleData() {
private void initAdvertisementSampleData() {
Entity entity = new Entity();
entity.addProperty(new Property(null, "ID", ValueType.PRIMITIVE,
@ -439,7 +439,7 @@ public class Storage {
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());
advertisments.add(entity);
advertisements.add(entity);
entity = new Entity();
entity.addProperty(new Property(null, "ID", ValueType.PRIMITIVE,
@ -448,7 +448,7 @@ public class Storage {
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());
advertisments.add(entity);
advertisements.add(entity);
}
private URI createId(Entity entity, String idPropertyName) {

View File

@ -57,13 +57,13 @@ public class DemoEdmProvider extends CsdlAbstractEdmProvider {
public static final String ET_CATEGORY_NAME = "Category";
public static final FullQualifiedName ET_CATEGORY_FQN = new FullQualifiedName(NAMESPACE, ET_CATEGORY_NAME);
public static final String ET_ADVERTISMENT_NAME = "Advertisment";
public static final FullQualifiedName ET_ADVERTISMENT_FQN = new FullQualifiedName(NAMESPACE, ET_ADVERTISMENT_NAME);
public static final String ET_ADVERTISEMENT_NAME = "Advertisement";
public static final FullQualifiedName ET_ADVERTISEMENT_FQN = new FullQualifiedName(NAMESPACE, ET_ADVERTISEMENT_NAME);
// Entity Set Names
public static final String ES_PRODUCTS_NAME = "Products";
public static final String ES_CATEGORIES_NAME = "Categories";
public static final String ES_ADVERTISMENTS_NAME = "Advertisments";
public static final String ES_ADVERTISEMENTS_NAME = "Advertisements";
public CsdlEntityType getEntityType(FullQualifiedName entityTypeName) {
@ -121,7 +121,7 @@ public class DemoEdmProvider extends CsdlAbstractEdmProvider {
entityType.setProperties(Arrays.asList(id, name));
entityType.setKey(Arrays.asList(propertyRef));
entityType.setNavigationProperties(navPropList);
} else if(entityTypeName.equals(ET_ADVERTISMENT_FQN)) {
} else if(entityTypeName.equals(ET_ADVERTISEMENT_FQN)) {
CsdlProperty id = new CsdlProperty().setName("ID").setType(EdmPrimitiveTypeKind.Guid.getFullQualifiedName());
CsdlProperty name = new CsdlProperty().setName("Name").setType(EdmPrimitiveTypeKind.String
.getFullQualifiedName());
@ -132,7 +132,7 @@ public class DemoEdmProvider extends CsdlAbstractEdmProvider {
propertyRef.setName("ID");
entityType = new CsdlEntityType();
entityType.setName(ET_ADVERTISMENT_NAME);
entityType.setName(ET_ADVERTISEMENT_NAME);
entityType.setProperties(Arrays.asList(id, name, airDate));
entityType.setKey(Collections.singletonList(propertyRef));
entityType.setHasStream(true);
@ -175,10 +175,10 @@ public class DemoEdmProvider extends CsdlAbstractEdmProvider {
List<CsdlNavigationPropertyBinding> navPropBindingList = new ArrayList<CsdlNavigationPropertyBinding>();
navPropBindingList.add(navPropBinding);
entitySet.setNavigationPropertyBindings(navPropBindingList);
} else if (entitySetName.equals(ES_ADVERTISMENTS_NAME)) {
} else if (entitySetName.equals(ES_ADVERTISEMENTS_NAME)) {
entitySet = new CsdlEntitySet();
entitySet.setName(ES_ADVERTISMENTS_NAME);
entitySet.setType(ET_ADVERTISMENT_FQN);
entitySet.setName(ES_ADVERTISEMENTS_NAME);
entitySet.setType(ET_ADVERTISEMENT_FQN);
}
}
@ -196,7 +196,7 @@ public class DemoEdmProvider extends CsdlAbstractEdmProvider {
List<CsdlEntityType> entityTypes = new ArrayList<CsdlEntityType>();
entityTypes.add(getEntityType(ET_PRODUCT_FQN));
entityTypes.add(getEntityType(ET_CATEGORY_FQN));
entityTypes.add(getEntityType(ET_ADVERTISMENT_FQN));
entityTypes.add(getEntityType(ET_ADVERTISEMENT_FQN));
schema.setEntityTypes(entityTypes);
// add EntityContainer
@ -214,7 +214,7 @@ public class DemoEdmProvider extends CsdlAbstractEdmProvider {
List<CsdlEntitySet> entitySets = new ArrayList<CsdlEntitySet>();
entitySets.add(getEntitySet(CONTAINER, ES_PRODUCTS_NAME));
entitySets.add(getEntitySet(CONTAINER, ES_CATEGORIES_NAME));
entitySets.add(getEntitySet(CONTAINER, ES_ADVERTISMENTS_NAME));
entitySets.add(getEntitySet(CONTAINER, ES_ADVERTISEMENTS_NAME));
// create EntityContainer
CsdlEntityContainer entityContainer = new CsdlEntityContainer();

View File

@ -329,8 +329,8 @@ public class DemoEntityProcessor implements EntityProcessor, MediaEntityProcesso
* A real service may store the content on the file system. So we have to take care to
* delete external files too.
*
* DELETE request to /Advertisments(ID) will be dispatched to the deleteEntity(...) method
* DELETE request to /Advertisments(ID)/$value will be dispatched to the deleteMediaEntity(...) method
* DELETE request to /Advertisements(ID) will be dispatched to the deleteEntity(...) method
* DELETE request to /Advertisements(ID)/$value will be dispatched to the deleteMediaEntity(...) method
*
* So it is a good idea handle deletes in a central place.
*/