I can't wrap my head around how to have procedural a radioField, since I have to give each option a name.
In my case, I want to load the available options from a database and therefore I can't have them statically named. Has anybody an idea?
radioField handed [ (LeftHanded, LeftHandField, "Left")
, (RightHanded, RightHandField, "Right")
, (Ambidextrous, AmbiField, "Both")
]
I'm the author of Brick. For what it's worth, the Brick Users e-mail list is a good place to ask questions like this.
To your question, though: since the name type is under your control, you can give your name type a constructor that takes parameters to construct sufficiently unique name values that are relevant to the data for each radio button value. For example, if you load database data and each value of your radio button is associated with some numeric ID, you might just have a name type like:
-- The type of database record IDs
type ID = Int
data Name = ...
| RadioOption ID
Related
I am very new to SAP Commerce and have been experimenting with Flexible search. Some queries work i.e and some dont.
Below one works fine.
1) Select * {User} SELECT {user.pk} FROM {User AS user}
2) SELECT {user.pk}, {ItemType} FROM {User AS user}
However when I am fetching email or uui, it is just not working.
1) SELECT {email} FROM {User AS user}
2) SELECT {originaluid} FROM {User AS user}
I have tried with {p_ as well which didn't work either.
1) SELECT {email} FROM {User AS user}
2) SELECT {p_originaluid} FROM {User AS user}
It's giving the same error for all the nonworking(wihth the different column names i.e p_originaluid) ones Exception message:
cannot search unknown field 'TableField(name='p_email',langPK='null',type=User)' within type User unless you disable checking, infoMap=TypeInfoMap for type = 8796093939794 code = User superType = 8796093841490 itemTable = users UPTable = usersup LTableName = userslp PropsTable = userprops core fields = owner = [owner,OwnerPkString,class de.hybris.platform.util.ItemPropertyValue] modifiedtime = [modifiedtime,modifiedTS,class java.util.Date] itemtype = [itemtype,TypePkString,class de.hybris.platform.util.ItemPropertyValue] creationtime = [creationtime,createdTS,class java.util.Date] pk = [pk,PK,class de.hybris.platform.core.PK] unlocalized fields = consentreference = [consentReference,p_consentreference, class java.lang.String] description = [description,p_description, class java.lang.String]
A bit of help will be great on the below questions:
1) Considering the above scenario why am I able to fetch all the columns?
2) While doing a flexible search I found "SELECT TypePkString FROM {User AS user}" query, my question is since TypePkString is a database column why is it used with SELECT without curly braces?
To answer your 1st question:
The way the type system works in SAP Commerce is. You have base item type and then you have drived item types. If you check core-items.xml Every type is derived from the generic item type directly or indirectly.
When you have any sub-item type derived from a parent type I.e Employee or B2BCustomer and you do not define a separate table ( tag ) for these separate types, the SAP Commerce uses a base table and add additional columns specific to those (Employee or B2BCustomer SAP) sub-item type.
This is why you may see many columns even for the specific type I.e B2BCustomer.
The best way to find the attributes added to specific subtypes is by looking into the back office type system.
In your case if you look into the type system by going into https://localhost:9002/backoffice/ -> Types -> User -> XML Representation and search for email, you may not find there
Now use the above steps and search for email under Type B2B Customer. You should be able to find it under the XML but when you look for email under core-items.xml file you might not find it there, that's because in the back office type system (for B2BCustomer) you will see it extended from (Extended tab) b2bcommerce. Now look for b2bcommerce-items.xml you should definitely see the item type for B2BCustomer and it should also have an attribute called email.
The reason for telling you above is so that you could know how and where to look.
When you use {} in your flexible search it uses the type system to look up and because of the same reason its unable to look it up email in User type is a part of B2BCustomer, not User, in your case:
select {email} from {B2BCustomer} should work.
For 2nd question:
As said before, Whenever you write {} in the flexible search, SAP Commerce looks into the type system and tries to resolve it however when you do not put curry braces it looked up DB columns for the given table like the below queries.
select p_email from {User}
select p_originaluid FROM {User}
Though p_email is not a part of User as told before you can still query it if you just try to fetch from the column directly same applies to the second query.
Hope this answers your question.
User item type hasn't got email property. Also it hasn't got originaluid. Check existing fields in backoffice type system or use hac to run queries without field names to get all existing fields.
When you try to reach the Dalaran Well in Dalaran, you are teleported to the sewers.
It is using this Game object: Doodad_Dalaran_Well_01 (id = 193904 )
Where is it scripted? How?
I've found nothing in the table smart_scripts, and found nothing in the core about this specific id so I'm curious because this type of teleport is really better than clicking on a game object
This gameobject is a unique case because it works like instance teleports do. If you check the gameobject_template table, you will see that it has several Data columns that have diferent values based on the type of the gameobject.
The gameobject you are refering too is the Well It self but the portal gameobject inside the well gives the player a dummy spell to tell the core that the player has been teleported (spell ID 61652).
For the specific case of the dalaran well, it's type is 30 which means, as the documentation says, GAMEOBJECT_TYPE_AURAGENERATOR. As soon as the player is in range, a dummy aura is cast on him to notify the core that this areatrigger has been activated (You could do stuff when player gets hit by the dummy spell).
The trick here is a bunny, but not the bunny itself since it is there mostly to determine an areatrigger. If you use command .go gobject 61148 you can check him out, he's inside the well.
Areatriggers are a DBC object that are actually present on our database on world.areatrigger. You can check the columns here. When the player enters the Radius box specified on the areatrigger, another thing happens in the core which is world.areatrigger_teleport.
If you run the following query you will be able to check the position where the trigger will teleport the player to.
SELECT * FROM areatrigger_teleport WHERE `Name` LIKE '%Dalaran Well teleporter%';
I am able to query active-directory/ldap to get the user information along with custom attributes. However I would to know the underlying DataType/attributeSyntax for each of those attribute returned.
Another the problem is that the query will not return the attribute itself if it does not contain any value.
So if can get fetch the attributes and their respective DataTypes then it provides me flexibility to set a default value basing on the DataType while preparing the final output object.
Eg:
1. I query AD to find foo user with attributes givenName, mail, myCustom1, myCustom2
{
givenName : "foo foo",
mail : "foo#boo.com",
myCustom1 : "TRUE"
}
but may not contain myCustom2 because it is not holding the value in AD.
get syntax for attributes givenName, mail, myCustom1, myCustom2
{
givenName : unistring,
mail : unistring,
myCustom1 : boolean,
myCustom2 : integer,
}
using above I can map the first result and prepare the final object as
{
givenName : "foo foo"
mail : "foo#boo.com"
myCustom1 : "TRUE"
myCustom2 : //usingHelperFunctionGetDefaultValueFor -> myCustom2
}
Active Director does not return attributes that do not have values, so that's not just the LDAPjs library, that's just how AD works.
Every object has an attribute called allowedAttributes that will show you every valid attribute that the object can potentially have.
If you need it, allowedAttributesEffective will list every attribute that the current user has permissions to modify.
These are both constructed attributes, meaning you have to ask for them specifically, or else you won't get them. For example, when searching, you have the option to specify the attributes you want to get back. If you specify nothing, you will get every non-constructed attribute that has a value. If you want any constructed attributes, you have to add it specifically to that list.
That's just a list of attributes. It won't tell you the type. You have to look to the schema for that, which is more difficult. You have to do a search using the base DN of CN=Schema,CN=Configuration,DC=domain,DC=com, where "domain.com" is the root domain of your forest, which may or may not be the same as the domain you're searching. You could look at the subSchemaSubEntry attribute of any object to find the location of the schema, although it will usually be CN=Aggregate,CN=Schema,CN=Configuration,DC=domain,DC=com (note the added CN=Aggregate).
But anyway, each object in there will have an attribute called ldapDisplayName, which is the name of the attribute as it appears on objects.
So if you want to find details on the givenName attribute, you would search the schema for (ldapDisplayName=givenName). Then the oMSyntax attribute is an enum that will tell you the type. The enum values are shown here. For givenName, that would be 64, which is a Unicode string.
The only benefit to looking up the types like this is if you are expecting your code to be run on any AD environment. If your code will only ever be run in one environment, then you can save coding time and run time by just hard-coding the attributes you are looking for and their types.
I'm now stuck on the problem of getting user input (what user says) in my index.js. For example, the user says: please tell me if {animals} can live between temperature {x} to {y}. I want to get exact value (in string) for what animals, x and y so that I can check if it is possible in my own server. I am wondering how to do that since the entities need to map to some exact key values if I annotate these three parameters to some entities category.
The methods for ApiAiApp is very limited: https://developers.google.com/actions/reference/nodejs/ApiAiApp
And from my perspective, none of the listed methods work in this case.
Please help!
Generally API.AI entities are for some set of known values, rather than listening for any value and validating in the webhook. First, I'd identify the kinds of entities you expect to validate against. For the temperatures (x and y), I'd use API.AI's system entities. Calling getArgument() for those parameters (as explained in the previous answer) should return the exact number value.
For the animals, I'd use API.AI's developer entities. You can upload them in the Entity console using JSON or CSV. You can enable API.AI's automated expansion to allow the user to speak animals which you don't support, and then getArgument() in webhook the webhook will return the new value recognized by API.AI. You can use this to validate and respond with an appropriate message. For each animal, you can also specify synonymous names and when any of these are spoken, and getArgument() will return the canonical entity value for that animal.
Extra tip, if you expect the user might speak more than one animal, make sure to check the Is List box in the parameter section of the API.AI intent.
If "animals", "x", and "y" are defined as parameters in your Intent in API.AI, then you can use the getArgument() method defined in ApiAiApp.
So the following should work:
function tempCheck( app ){
var animals = app.getArgument('animals');
var x = app.getArgument('x');
var y = app.getArgument('y');
// Check the range and then use something like app.tell() to give a response.
}
I customized the table KNVV. The append structure includes a structure where I actually defined all my custom fields. Lets call it zz_knvv_app_s.
A function pool, used to get and set the custom fields, has a function called ZSD_FOO_GET_DATA. It is exporting structure es_knvv TYPE knvv.
My current solution works, but is kind of stupid:
FUNCTION ZSD_FOO_GET_DATA.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" EXPORTING
*" REFERENCE(ES_KNVV) TYPE KNVV
*"----------------------------------------------------------------------
es_knvv-zzfoo = knvv-zzfoo.
es_knvv-zzbar = knvv-zzbar.
es_knvv-zzbaz = knvv-zzbaz.
" there are actually many more fields...
ENDFUNCTION.
What I am looking for is something like that:
loop through KNVV
assign the custom fields that are defined in my dictionary structure zz_knvv_aps_s...
... from KNVV to ES_KNVV
something similary is also required for ZSD_FOO_GET_DATA
I am kind of new to ABAP. I think about looping and field symbols, but cant get it right. How would you solve it?
You could try to use a named include:
create a structure - let's say ZZ_MY_KNVV_FIELDS
KNVV has an append structure ZZ_KNVV_APP_S
ZZ_KNVV_APP_S has a single entry .INCLUDE ZZ_MY_KNVV_FIELDS with a group name ZZ_MY_FIELDS
same for any other output structure
You can then address all of your fields using KNVV-ZZ_MY_FIELDS as a structure of type ZZ_MY_KNVV_FIELDS