protected Section(Catalog catalog, string name, string path, FileSystemSession session) { if (name.IsNullOrWhiteSpace() || catalog == null || path.IsNullOrWhiteSpace()) { throw new MetabaseException(StringConsts.ARGUMENT_ERROR + GetType().Name + ".ctor(catalog|name|path==null|empty"); } Catalog = catalog; Metabank = catalog.Metabank; m_Name = name; Path = Metabank.JoinPaths("", path);//ensure root path symbol i.e. m_LevelConfig = Metabank.getConfigFromFile(session, Metabank.JoinPaths(path, Metabank.CONFIG_SECTION_LEVEL_FILE)).Root; if (!m_LevelConfig.IsSameName(RootNodeName)) { throw new MetabaseException(StringConsts.METABASE_METADATA_CTOR_1_ERROR.Args(GetType().Name, RootNodeName, m_LevelConfig.Name)); } var cn = m_LevelConfig.AttrByName(Metabank.CONFIG_NAME_ATTR); if (!cn.Exists || !m_LevelConfig.IsSameNameAttr(name)) { throw new MetabaseException(StringConsts.METABASE_METADATA_CTOR_2_ERROR.Args(GetType().Name, name, cn.ValueAsString(SysConsts.UNKNOWN_ENTITY))); } if (!name.IsValidName()) { throw new MetabaseException(StringConsts.METABASE_METADATA_CTOR_3_ERROR.Args(GetType().Name, name, path)); } Metabank.includeCommonConfig(m_LevelConfig); m_LevelConfig.ResetModified(); }
protected SectionWithAnyAppConfig(Catalog catalog, string name, string path, FileSystemSession session) : base(catalog, name, path, session) { m_AnyAppConfig = Metabank.getConfigFromFile(session, Metabank.JoinPaths(path, Metabank.CONFIG_SECTION_LEVEL_ANY_APP_FILE), require: false).Root; }