refactor: unify binding & data provider interfaces
- Removed BindingType enum and all related logic from Binding. - Made Binding implement new IBinding and IKeyed interfaces. - Moved node selection logic to IBinding.Select; removed Resolve* methods from Binding. - Added new IBinding interface for XPath/CssPath selection. - Refactored IDataProvider to generic IDataProvider<T>; removed GetNode. - Updated ListContentDataProvider and ParagraphedContentDataProvider to use IBinding. - Added new ContentsDataProvider, ContentsArrayDataProvider, and DropDownDataProvider for flexible data extraction. - Updated DataBindings to use IDataProvider<T> properties instead of Binding. - Updated all usages to new interfaces and patterns.
This commit is contained in:
@@ -103,36 +103,34 @@ namespace Beam.Temporary.Cli {
|
||||
var binding_aux = new DataKey<DataBindings>("aeqw89:bindings:wodushu_aux");
|
||||
|
||||
sdd.Bindings.Add(binding_agg, new() {
|
||||
Title = new Binding() {
|
||||
XPath = "/html/body/div[4]/div/div/div[2]/h1",
|
||||
Type = BindingType.Single
|
||||
Title = new ContentsDataProvider() {
|
||||
Content = new Binding() {
|
||||
XPath = "/html/body/div[4]/div/div/div[2]/h1"
|
||||
}
|
||||
},
|
||||
Content = new Binding() {
|
||||
Type = BindingType.UseProvider,
|
||||
Provider = new ParagraphedContentDataProvider() {
|
||||
Content = new Binding() {
|
||||
XPath = "//*[@id=\"content\"]"
|
||||
}
|
||||
|
||||
Content = new ParagraphedContentDataProvider() {
|
||||
Content = new Binding() {
|
||||
XPath = "//*[@id=\"content\"]"
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
sdd.Bindings.Add(binding_aux, new() {
|
||||
Title = new Binding() {
|
||||
XPath = "/html/body/div[3]/div[1]/div/div/div[2]/div[1]/h1",
|
||||
Type = BindingType.Single
|
||||
Title = new ContentsDataProvider() {
|
||||
Content = new Binding() {
|
||||
XPath = "/html/body/div[3]/div[1]/div/div/div[2]/div[1]/h1"
|
||||
}
|
||||
},
|
||||
Authors = new Binding() {
|
||||
XPath = "/html/body/div[3]/div[1]/div/div/div[2]/div[1]/div/p[1]/a",
|
||||
Type = BindingType.Single
|
||||
Authors = new ContentsArrayDataProvider() {
|
||||
Content = new Binding() {
|
||||
XPath = "/html/body/div[3]/div[1]/div/div/div[2]/div[1]/div/p[1]/a"
|
||||
}
|
||||
},
|
||||
Description = new Binding() {
|
||||
Provider = new ParagraphedContentDataProvider() {
|
||||
Content = new Binding() {
|
||||
XPath = "/html/body/div[3]/div[1]/div/div/div[2]/div[2]"
|
||||
}
|
||||
},
|
||||
Type = BindingType.UseProvider
|
||||
Description = new ParagraphedContentDataProvider() {
|
||||
Content = new Binding() {
|
||||
XPath = "/html/body/div[3]/div[1]/div/div/div[2]/div[2]"
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user