The Repository's configuration entry
The type of the Authentication Service to be used.
Reference to the Authentication Service used by the current repository
Reference to the configuration used by the current repository
Reference to the Http Provider used by the current repository
Reference to the OData API used by the current repository
Returns the Repository's base OData Url (e.g.: https://demo.sensenet.com/odata.svc)
Public endpoint for making Ajax calls to the Repository
The Path for the call
The method type
The expected return type
The post body (optional)
An observable, which will be updated with the response.
Executes a CopyBatch request to copy multiple content by a single request.
Usage: ```ts repository.CopyBatch([content1, content2...], 'Root/NewFolder').subscribe(()=>{ console.log('Contents copied.') })
An array of content to copy. Can be a content (with path) or a Path
The target Path
The context node, the PortalRoot by default
Shortcut to Content.Create. Creates a new, unsaved Content instance
An object with the initial content data
the created, unsaved content instance
Creates a Content Query on a Repositoy instance, at Root level (path e.g.: '/OData.svc/Root' ) Usage: ```ts const query = repository.CreateQuery(q => q.TypeIs(ContentTypes.Folder) .Top(10))
query.Exec().subscribe(res => { console.log('Folders count: ', res.Count); console.log('Folders: ', res.Result); } ```
An observable with the Query result.
Executes a DeleteBatch request to delete multiple content by a single request.
Usage:
repository.DeleteBatch([content1, content2...], true).subscribe(()=>{
console.log('Contents deleted.')
})
An array of content to be deleted. Can be a content (with id and/or path), a Path or an Id
The context node, the PortalRoot by default
Returns the list of all ContentTypes in the system.
Returns an RxJS observable that you can subscribe of in your code.
let getAllContentTypes = GetAllContentTypes();
getAllContentTypes.subscribe({
next: response => {
console.log('success');
},
error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
complete: () => console.log('done'),
});
Gets the complete version information about the core product and the installed applications. This function is accessible only for administrators by default. You can learn more about the subject in the SnAdmin article. You can read detailed description of the function result.
Returns an RxJS observable that you can subscribe of in your code.
let getVersionInfo = GetVersionInfo();
getVersionInfo.subscribe({
next: response => {
console.log('success');
},
error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
complete: () => console.log('done'),
});
Creates a Content instance that is loaded from the Repository. This method should be used only to instantiate content from payload received from the backend.
An object with the Content data
The Content type.
var content = SenseNet.Content.HandleLoadedContent({ Id: 123456, Path: 'Root/Example', DisplayName: 'My folder' }, ContentTypes.Folder); // content is an instance of the Folder with the DisplayName 'My folder'
Requests a Content by the given id.
Id of the requested Content.
A string containing the version of the requested Content.
Returns an RxJS observable that you can subscribe of in your code.
var content = SenseNet.Content.Load(1234, { expand: 'Avatar' }, 'A.1', ContentTypes.User);
content
.map(response => response.d)
.subscribe({
next: response => {
//do something with the response
},
error: error => console.error('something wrong occurred: ' + error.responseJSON.error.message.value),
complete: () => console.log('done'),
})
Executes a MoveBatch request to move multiple content by a single request.
Usage: ```ts repository.MoveBatch([content1, content2...], 'Root/NewFolder').subscribe(()=>{ console.log('Contents moved.') })
An array of content to move. Can be a content (with path) or a Path
The target Path
The context node, the PortalRoot by default
Parses a Content instance from a stringified SerializedContent
The stringified SerializedContent
The loaded Content
Generated using TypeDoc