public EtagairCore() { LastErrorMsg = ""; _reposit = null; Searcher = null; Editor = null; EditorTempl = null; ProcessTempl = null; }
// ==== Create entity with prop childs!! // group // Templ Entity, CreatePropertyGroupTempl( key) // Add properties childs // set rule for childs: One, Several, 0..N,... static void TestCore() { //IEtagairReposit reposit= CreateRepository_InMemory(); IEtagairReposit reposit = CreateRepository_LiteDB(true); EtagairCore core = CreateCore(reposit); // Dev the language and text data model. CreateLangAndTexts(core); //BuildContent(core); //TestSearchEntity(core); }
public static EtagairCore CreateCore(string repositConfig) { IEtagairReposit reposit = null; if (string.IsNullOrWhiteSpace(repositConfig) || repositConfig == "InMemory") { reposit = Common.CreateRepository_InMemory(); } else { reposit = Common.CreateRepository_LiteDB(repositConfig); } return(Common.CreateCore(reposit)); }
public static EtagairCore CreateCore(IEtagairReposit reposit) { // create the core configurator, inject the concrete repository EtagairCore core = new EtagairCore(); //----init the core: create the catalog, becomes the current catalog if (!core.Init(reposit)) { return(null); } // configure the catalog return(core); }
static EtagairCore CreateCore(IEtagairReposit reposit) { // create the core configurator, inject the concrete repository EtagairCore core = new EtagairCore(); //----init the core: create the catalog, becomes the current catalog if (!core.Init(reposit)) { Console.WriteLine("Error, Init failed, can't create the catalog, already exists."); return(null); } // configure the catalog return(core); }
/// <summary> /// Initialize the core. /// Create the default and unique catalog in the repository. /// If it's already created, can't create a new one. /// </summary> /// <returns></returns> public bool Init(IEtagairReposit reposit) { try { _reposit = reposit; Searcher = new Searcher(reposit); Editor = new Editor(reposit, Searcher); EditorTempl = new EditorTempl(reposit); ProcessTempl = new ProcessTempl(reposit); if (!_reposit.IsCreated) { return(CreateDb()); } return(OpenDb()); }catch (Exception e) { LastErrorMsg = e.ToString(); return(false); } }
private bool CreateSystemData(IEtagairReposit reposit) { // create list of available languages CreateLanguageDef(MainLanguageCode.en, LanguageCode.en); CreateLanguageDef(MainLanguageCode.en, LanguageCode.en_GB); CreateLanguageDef(MainLanguageCode.en, LanguageCode.en_US); CreateLanguageDef(MainLanguageCode.fr, LanguageCode.fr); CreateLanguageDef(MainLanguageCode.fr, LanguageCode.fr_FR); // create the root folder Folder root = new Folder(); root.Name = ObjectDef.RootFolderName; _reposit.Builder.SaveFolder(root); // save the root folder id _reposit.Builder.SaveStructDescriptorRootFolderId(root.Id); // TODO: others!! return(true); }
public EditorBase(IEtagairReposit reposit, Searcher searcher) { _reposit = reposit; _searcher = searcher; }
//Language _currLang = null; //LanguageCode _currLanguageCode = LanguageCode.en; public Searcher(IEtagairReposit reposit) { _reposit = reposit; _entitySearcher = new EntitySearcher(reposit); ListSearchEntity = new List <SearchEntity>(); }
public EntitySearcherPropKeyText(IEtagairReposit reposit) { _reposit = reposit; }
public ProcessEntPropTempl(IEtagairReposit reposit) { _reposit = reposit; _processEntPropTemplRules = new ProcessEntPropTemplRules(_reposit); }
public EditorTempl(IEtagairReposit reposit) { _reposit = reposit; }
public EntitySearcher(IEtagairReposit reposit) { _reposit = reposit; }
public ProcessEntPropTemplRules(IEtagairReposit reposit) { _reposit = reposit; }
public ProcessTempl(IEtagairReposit reposit) { _reposit = reposit; // _execPropTemplRules = new ExecPropTemplRules(_reposit); _processEntPropTempl = new ProcessEntPropTempl(_reposit); }
//public static void RemoveLiteDBFile(string repositConfig) //{ // string stringConnection = @".\Data\lite_" + repositConfig + ".db"; // if (File.Exists(stringConnection)) // File.Delete(stringConnection); //} public static EtagairCore CreateCoreInMemory() { IEtagairReposit reposit = Common.CreateRepository_InMemory(); return(Common.CreateCore(reposit)); }
public Editor(IEtagairReposit reposit, Searcher searcher) : base(reposit, searcher) { }