Creates a wrapper function for a callable custom OData action.
This method creates an Observable, sends an ajax request to the server and convert the reponse to promise which will be the argument of the Observable.
A CustomAction configuration object.
An object that holds the config of the ajax request like urlparameters or data.
Th type that the action should return
Returns an Rxjs observable whitch will be resolved with TReturnType that you can subscribe of in your code.
Method to delete a Content from the Content Repository through OData REST API.
Id of the Content that will be deleted.
Returns an observable that you can subscribe of in your code.
Method to fetch children of a Content from the Content Repository through OData REST API.
This method creates an Observable, sends an ajax request to the server and convert the reponse to promise which will be the argument of the Observable.
Returns an Rxjs observable that you can subscribe of in your code.
myODataApi.Fetch(new ODataApi.ODataRequestOptions({
path: 'Root/Sites/Default_site/todos'
}), ContentTypes.Task)
.subscribe(result=>{
console.log('Tasks count:', result.d.__count);
console.log('The Tasks are:', result.d.results);
});
Method to get a Content from the Content Repository through OData REST API.
Object with the params of the ajax request.
Returns an Rxjs observable that you can subscribe of in your code.
myODataApi.Get(new ODataApi.ODataRequestOptions({
path: 'Root/Sites/Default_site/todos'
}), ContentTypes.TaskList)
.subscribe(result=>{
console.log('My TaskList is:', result.d)
});
Method to modify a single or multiple fields of a Content through OData REST API.
Id of the Content that will be modified.
Contains the modifiable fieldnames as keys and their values.
Returns an Rxjs observable that you can subscribe of in your code.
myODataApi.Patch(3, ContentTypes.Task, {
Name: 'MyUpdatedTask'
})
.subscribe(result=>{
console.log('My Updated Task is:', result);
});
Method to post a created content into the sense NET Content Repoository.
The Path of the content
An observable whitch will be updated with the created content.
const myTask = new ContentTypes.Task({
Name: 'My New Task',
DueDate: new Date(),
}, myRepository)
myODataApi.Post('Root/Sites/Default_site/todos', myTask, ContentTypes.Task)
.subscribe(result=>{
console.log('My New Task is:', result);
});
Method to set multiple fields of a Content and clear the rest through OData REST API.
This method creates an Observable, sends an ajax request to the server and convert the reponse to promise which will be the argument of the Observable.
Id of the Content that will be modified.
Contains the modifiable fieldnames as keys and their values.
Returns an Rxjs observable that you can subscribe of in your code.
myODataApi.Put(3, ContentTypes.Task, {
Name: 'MyUpdatedTask'
})
.subscribe(result=>{
console.log('My Updated Task is:', result);
});
Generated using TypeDoc
This class contains methods and classes for sending requests and getting responses from the Content Repository through OData REST API.
Following methods return Rxjs Observables which are made from the ajax requests' promises. Action methods like Delete or Rename on Content calls this methods, gets their responses as Observables and returns them so that you can subscribe them in your code.