Skip to content

Commit

Permalink
Updating readme and catching bad types for junctions and operators de…
Browse files Browse the repository at this point in the history
…fined in cms
  • Loading branch information
alexdaube committed May 1, 2017
1 parent 02fc3e3 commit 2a4e962
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,18 @@ $ npm test
```

# Configurations (CMS)
#### Front-end

## Some gotchas using the cms
<b>Operators</b> and <b>Junctions</b> must have specific top level definitions. Synonyms, meanwhile,
can be anything you want.
- Operators: LESS, GREATER, BETWEEN, LIKE, NOT, OTHER
- Junctions: OR, AND

All <b>Tables</b>, <b>Attributes</b>, and <b>Foreign Keys</b> top level definitions must be
an exact match with the database talking to the MQL service.

## Installation
#### Front-end
**Step 1**: Make sure that [nodeJS](https://nodejs.org/en/) is installed. I suggest using a node version manager.
* [nvm](https://github.com/creationix/nvm) -- Mac or Linux.
* [nvm-windows](https://github.com/coreybutler/nvm-windows) -- Windows.
Expand Down Expand Up @@ -128,6 +138,14 @@ $ npm test
* https://drive.google.com/file/d/0B3RTyKNvD1VTYy1FRUhZRlRySkU/view?usp=sharing
* https://drive.google.com/file/d/0B3RTyKNvD1VTWHZrQUt6elJEcnM/view?usp=sharing


# TODO
* Implement internalization
* Make user choose between json configurations(re-implementation) and cms configurations (user configuration)
* Improve User experience of cms. As of now, it's too easy for user to make mistakes while defining the language
* Revise cms backend architecture to make it more testable
* Better abstraction for plugging data base with MQL (user configuration)

# Contributors

* Alexandre Désilets-Aubé
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@ public Keywords findAllKeywords() {
keywords.add(new Keyword(e.keyword, Keyword.Type.ENTITY, e.synonyms, attributes));
attributes.forEach(keywords::add);
});
keywordClient.fetchJunctions().forEach(j -> keywords.add(new Keyword(j.type,
Keyword.Type.valueOf(j.type), j.keywords, new KeywordsSet())));
keywordClient.fetchOperators().forEach(o -> keywords.add(new Keyword(o.type,
Keyword.Type.valueOf(o.type), o.keywords, new KeywordsSet())));
keywordClient.fetchJunctions().forEach(j -> {
try {
keywords.add(new Keyword(j.type, Keyword.Type.valueOf(j.type), j.keywords, new KeywordsSet()));
} catch (Exception e) {}
});
keywordClient.fetchOperators().forEach(o -> {
try{
keywords.add(new Keyword(o.type, Keyword.Type.valueOf(o.type.toUpperCase()), o.keywords, new KeywordsSet()));
} catch(Exception e) {}
}
);
return keywords;
}
}

0 comments on commit 2a4e962

Please sign in to comment.