Implement complete collection persistence with database-backed survival across server restarts
• Add full multi-table schema for collections with normalized design (collections, collection_templates, collection_items, collection_item_versions) • Implement collection detection and processing in enhancement pipeline for .insertr-add elements • Add template extraction and storage from existing HTML children with multi-variant support • Enable collection reconstruction from database on server restart with proper DOM rebuilding • Extend ContentClient interface with collection operations and full database integration • Update enhance command to use engine.DatabaseClient for collection persistence support
This commit is contained in:
@@ -233,3 +233,20 @@ func toNullString(s string) sql.NullString {
|
||||
}
|
||||
return sql.NullString{String: s, Valid: true}
|
||||
}
|
||||
|
||||
// Collection method stubs - TODO: Implement these
|
||||
func (d *DatabaseClient) GetCollection(siteID, collectionID string) (*engine.CollectionItem, error) {
|
||||
return nil, fmt.Errorf("collection operations not implemented in content.DatabaseClient")
|
||||
}
|
||||
|
||||
func (d *DatabaseClient) CreateCollection(siteID, collectionID, containerHTML, lastEditedBy string) (*engine.CollectionItem, error) {
|
||||
return nil, fmt.Errorf("collection operations not implemented in content.DatabaseClient")
|
||||
}
|
||||
|
||||
func (d *DatabaseClient) GetCollectionItems(siteID, collectionID string) ([]engine.CollectionItemWithTemplate, error) {
|
||||
return nil, fmt.Errorf("collection operations not implemented in content.DatabaseClient")
|
||||
}
|
||||
|
||||
func (d *DatabaseClient) CreateCollectionTemplate(siteID, collectionID, name, htmlTemplate string, isDefault bool) (*engine.CollectionTemplateItem, error) {
|
||||
return nil, fmt.Errorf("collection operations not implemented in content.DatabaseClient")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user