Code Monkey home page Code Monkey logo

etagair-configurator-api's Introduction

What is Etagair?

The Etagair Application

Etagair is a general purpose Configurator API for modeling and managing products, services, or everything else.

It's developed in C# language based on .NET Standard 2.0 and it is provided as a set of several libraries. It's a back-office API, there is no UI. Data are saved in a embedded database.

For more details, see the wiki

Key features

-Embedded .NET family assembly, platform independent with reference to one library: LiteDB, A lightweight embedded .NET NoSQL document store in a single datafile.

-Management of complex objects : entities with properties (list of key-value).

-Entities are organized hierarchically in folders.

-Creation of complex entities based on template.

-Localized media, only text for now (by using text code).

-Rich search of entities by properties criteria.

Getting started

Using clauses

Create a C# application. Import the Nuget package (see the link below). In the program, include these using:

  using Etagair.Core.System;
  using Etagair.Engine;

Create the engine and the database

These lines of code create the engine object. The init method create the database or use the existing one.

  EtagairEngine engine = new EtagairEngine();

  // the path must exists, it's the location where to put the database file
  string dbPath = @".\Data\";

  // create the database or reuse the existing one
  if (!engine.Init(dbPath))
  {
    Console.WriteLine("Db initialization Failed.");
    return;
  }

  // the database is created or reused and opened, it is ready to the execution
  Console.WriteLine("Db initialized with success.");

Create a folder within an entity

For example, create a folder named "computers", under it, add an entity having two properties. An entity haven't a name. Property of an entity is key-value pair.

The data:

F:computers\
  E:   
  "Name"= "Toshiba Satellite Core I7"
  "Trademark"= "Toshiba"

The Code:

// create a folder, under the root
Folder foldComputers = engine.Editor.CreateFolder(null, "computers");

// create an entity, under the computers folder
Entity toshibaCoreI7 = engine.Editor.CreateEntity(foldComputers);

// add 2 properties to the entity (key - value)
engine.Editor.CreateProperty(toshibaCoreI7, "Name", "Toshiba Satellite Core I7");
engine.Editor.CreateProperty(toshibaCoreI7, "Trademark", "Toshiba");

Package on Nuget

The application is ready to use and is available on Nuget. The last version is 0.0.5-alpha.

The web site: https://www.nuget.org/packages/Etagair/

The last release: https://www.nuget.org/packages/Etagair/0.0.5-alpha

etagair-configurator-api's People

Contributors

yvlawy avatar

Stargazers

 avatar

Watchers

 avatar

etagair-configurator-api's Issues

Manage main region/country language and localized text

Define a country/region main (default) language.

exp: for en (English), the en-gb is defined as the main language.
If this case, if the current language si Something like en-us (or en-ca or Something else), if no localzed text is defined in en-us, then the application will get the localized text defined in the main language: en-gb.
If no text is defined for this language, the application will get the text for the main (neutral) language defined in the application.

engine.Editor.DefineMainLanguageRegion(LanguageCode.en_GB);

Search entity - Improvement

Can't search entity from the root folder.
Need to define the scope:
-All: Search from the root folder, and go Inside sub-folders.
-RootOnly: Search from the root folder, Don't go Inside subfolders. Scan only directs entities childs.
-Defined: Set/Defined source folders.

Refactor the template methods

Actually there are 2 methods to create an entity Template.
In basic cases, refactor to have only one method, to simplify the process.

Manage image type

Add image Property value.
Manage différents image format like: jpg, png,...

Manage Main language and localized text

Define a main language in the application.
If no localized text exists for for a textCode in current language, so the application should get the localized text for the defined main language.

exp:
engine.Editor.DefineMainLanguage(LanguageCode.en);
or
engine.Editor.DefineMainLanguage(LanguageCode.en_GB);

Adds new property value types

property Template:
Only string and TextCode are implemented today.
Adds new type: int, double and bool
Need to refactor property value and introduce the Value hierarchy classes.

Get localized entity

By default, an entity in independent of the current language.
Adds the way to get an entity depending on the current language.
All textCode will be conveerted in localized text.
(textCode can be used in property key and value)

code can be: (to be defined)
EntityLocalized myEntityLocal = core.Editor.GetEntityLocal(myEntity)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.