Creating Binary Schema
Add Path: Application name --> SiteManager --> Schema --> Binary, Click "New" button to open adding screen.
Name is required, the rest is optional
Using Binary Schema Content
There are two major ways of using Binary content.
1. Use it as a referred content/attachment by Text content.
2. Use it directly. For example, download documents.
Same as Text content, first we need to create a Binary content folder in order to store uploaded binary data.
Create Folder
Add Path: Application name --> Content
Right click on "Content" and then select "Add Folder" menu. You do it exactly the same way as Text schema except that you select a binary schema instead.
Folder Name: Any name.
Schema: The Binary Schema
Workflow: Workflow to be attached to this folder.
Base: Parent folder. For more information, refer to the Inheritance document.
After that, you can upload binary files:
Referred by Text Schema
On the Text Schema definition page, you can specify the Binary Schema you want to use. On the content input form, content of that Binary schema will be showed in dropdown list to be selected from.
Go to the "content" input form, you will be able to see a dropdown list with binary content to select from.
The selected binary files will be attached to the text content. You can use below API method to query binary files of text content at front end website:
ContentService.GetAttachments(contentId);
This method returns an IEnumerable<FileInContent>, FileInContent entity as below:
public class FileInContent
{
public FileInContent();
public string BinaryContentTitle { get; set; }
public Guid BinaryContentUUID { get; set; }
public string FileUrl { get; set; }
}
Use directly in your code
Binary content can be queried by Kooboo Data Rule as well. Exactly same as Text content. The List Data Type will return IEnumerable<IDictionary<string, object>>. Below are the keys included in this dictionary object.
|
Field |
Type |
|
ContentId |
Int |
|
Application |
String |
|
UUID |
Guid |
|
PostDate |
DateTime |
|
FileSize |
Int |
|
FileUrl |
String |
|
Title |
String |
|
UserName |
String |
|
|
