DataSource class abstract

DataSource are lists of all the documents, files, web pages and entire website that you may want to query in your process steps. You can use them to provide the website documentation, provide your own usage examples, or document techniques of achieveing something.

DataSource needs the following getters passed:

  • projectObjects - List of ProjectDataObjects that can be used to pass data from the project itself.
  • fileObjects - List of FileDataObjects that can be used to pass data from files and directories.
  • webObjects - List of WebDataObjects that can be used to pass data from web pages or all the web pages of a domain (via passing xml link for the domain)

Sample example of DataSource for demonstration purpose:

class DocsDataSource extends DataSource {
 @override
 List<SystemDataObject> get fileObjects => [
       SystemDataObject.fromFile(File(
           'your_file_path'))
     ];

 @override
 List<ProjectDataObject> get projectObjects =>
     [ProjectDataObject.fromText('Data in form of raw text')];

 @override
 List<WebDataObject> get webObjects => [];
}

class BlogsDataSource extends DataSource {
 @override
 List<SystemDataObject> get fileObjects => [
       DirectoryFiles(
           Directory(
               'directory_path_to_data_source'),
           relativeTo:
               'parent_directory_path')
     ];

 @override
 List<ProjectDataObject> get projectObjects => [];

 @override
 List<WebDataObject> get webObjects =>
     [WebDataObject.fromWebPage('https://sampleurl.com')];
}

Constructors

DataSource()

Properties

fileObjects List<FileDataObject>
List of FileDataObjects that can be used to pass data from files and directories.
no setter
hashCode int
The hash code for this object.
no setterinherited
minCliVersion String
no setter
projectObjects List<ProjectDataObject>
List of ProjectDataObjects that can be used to pass data from the project itself.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
webObjects List<WebDataObject>
List of WebDataObjects that can be used to pass data from web pages or all the web pages of a domain (via passing xml file for the domain).
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
process() Future<Map<String, dynamic>>
Internal method used by dash_agent to convert the shared DataSource to json format that can be sent on the web
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited