I want to define my enum in my JDL - with values that contain two or more space-delimited words - for (example) country names, like "United Kingdom", "Vatican City"
enum Country {
Vatican City,United Kingdom
}
is such a thing possible?
No as this is used to generate an enum name in java.
If you need this only for display purpose, you can just edit src/main/webapp/i18n/en/Country.json assuming you enabled internationalization.
Gael answer should be flagged as the correct one. I would also add, for newcomers that wouldn't know what to put in the said JSONs that jHipster can generate them when you enable support for internationalization (I18N) when you generate your application.
Related
Since #sys.airport only exists for the default English locale, I want to create a custom entity that emulates it for other locales.
From what I've read here, you can put subentity types into the value fields, say, the system entity #sys.geo-city:city and a custom entity #usr.iata-code:iata, and it will match either one or the other.
But I don't understand how you would tell Dialogflow which city and which IATA code go together, so that Dialogflow (ES) would know to send the complete object {"city":"Amsterdam", "iata": "AMS"} to the webhook after matching either "Amsterdam" or "AMS", as it does happen with #sys.airport.
Thanks for any input!
It will be difficult to create a custom entity that works just like #sys.airport. The #sys entities are special and can do somethings custom entities can't, for instance, pairing values together.
As you pointed out, you can put multiple entities together in one single entity by using Composite Entities, but the only thing this does is allow you to recognize two values made up from other #sys or custom entities in a single entity. It doesn't give you the option to create pairs between the values of the entities.
If you would want to create something like this, you would need some code that does a look up in a dictionary or list. So when "AMS" is matched, the code fills in the missing property "Amsterdam" or vice versa.
I have a text field for tags. For example some entities:
{"tags": "apple. fruits. eat."}
{"tags": "green apple."}
{"tags": "banana. apple."}
I want to select entities with tag apple, not green apple or smth apple smth. Different variants lead to the one point: select a sentence with existing expression and it doesn't matter how this sentence looks like. But in this case it's matter.
How can I do it by using Lucene syntax or Azure Search tools? Or (in general) how can I search for a completely same sentence?
I presume that the "." is a deliminator for the different tags. There may be a way to express this in lucene, but you may need to add some custom analyzers to preserve the "."'s in tokenization.
A better strategy in this case would be use use a field of type Collection(Edm.String). This will allow you to better preserve structure the phrases for the tags, and you can use a filter to select the specific value of "apple". Collection(Edm.String) also allows you to enable faceting of the tags which is useful.
I have a requirement to display a drop down menu for a String type in Hybris Management Console, restricting the value to some specific values.
As suggested in several forums, I tried to create this entry as an enumeration type but characters like '-' are to be allowed in the enumeration values, as this column receives some specific values which comprise of '-'.
How do I solve this issue?
The people advising you probably didn't understand your requirements. As such, an enumeration type is clearly not appropriate in this case. Consider the alternatives. Is there a Map Type available? What other type might allow you to achieve your goal?
Actually, you could use the hybris Enumeration. In hybris Enum Types have a code and a name. The code is the unique representation for this enum and cannot contain a "-". The name however is a localized representation of that value and can include every character your database is able to store. Have a look here:
https://help.hybris.com/6.5.0/hcd/8c895989866910148d6a802f06651702.html
Additionally, hybris enables you to dynamically create new enumeration values, which is kind of nice.
I just came up with a tricky case that is blowing my mind.
I'm using a 2 classic UsrDef entity (UDE) with free-text and keywords search strategies.
Where can I find the phone number of John Doe?
Where can I find the office of Mark Zuckerberg?
The one of interest is the one that captures phone number, office, etc. called typeInfo
Well, now I have the following expression:
Where can I find Isaac Newton?
Mhh... no explicit typeInfo, but I want it to be treated as an intent to search Isaac Newton's office (typeInfo - office).
Should I add the 'trait' search strategy (having the three of them activated) to typeInfo?
I'll appreciate some light on this issue. Thanx!
I would try to have this entity be only a trait entity.
Given enough examples, wit should learn that the word "office" is what makes the entity value be "office", etc
My app has pre-populate Category data contain icon image and its name. In the next version I need to localized its name, is this possible ? Found Adding relation for localized methods here, but this is an only way to do it ?
There is no "Localize" feature build in to Core Data. So adding the localized names in a separate entity as mentioned in How to represent a localized string type in Core Data? is the way to go.