Develop and customize data models in ÃÛ¶¹ÊÓÆµ Campaign Classic
Join this session with our Campaign Trainer to learn how to develop a data schema inside a data model within Campaign Classic.
Kamilia Tazi Training Consultant / ÃÛ¶¹ÊÓÆµ
Transcript
Please welcome to your screens, Camilla Tasi. Hello, my name is Camilla and today we’re going to take a look on how you can develop and customize data models inside ÃÛ¶¹ÊÓÆµ Campaign Classic. We are first going to take a look on schemas inside ÃÛ¶¹ÊÓÆµ Campaign Classic, what are schemas and how you can configure them. Again we’re going to take a look into forms. Forms are the way you can put your schemas visible to your business users. We’ll see how you can configure them. And on the third step we’re going to discover what are navigation trees, how you can configure them so that your users can add your forms inside your menu. Finally we’re going to go through the API features that we have inside ÃÛ¶¹ÊÓÆµ Campaign Classic and show you how you can extend the API of ÃÛ¶¹ÊÓÆµ Campaign Classic to create your own custom method. So let’s start with schemas. Schemas are actually containing the definition or the structure of your tables that you are going to have inside your database and in reality one schema is equal to one table. They’re accessible under the configuration menu which is under the administration menu. You have to have admin rights to have access to that and inside this menu you will write your schemas within XML language and within your XML document you are going to define elements and attributes which are going to make the structure of your schema and at the end the structure of your table. Regarding the syntax, so if we take a look at the syntax all the schemas are going to start with the tag SRC schema which is containing the name attribute that contains as a value the name of your table. So here it’s equal to recipient that means that the schema is going to be a recipient’s schema and then inside it you’re all the time going to have a root element that is going to be an element tag and other name again is going to hold the name of the schema which is recipient here in this case and inside this element you will define all the fields or attributes that you would like to have inside your table. So here we have attribute tags to define the fields last name, first name and city. So if you pay attention we do have city under a sub element tag this can be done in case you would like to organize better some fields that belong to the same category like it is here for the city but at the end physically it’s not going to change anything for your database it’s still going to be a regular field called city. So one part that is going to be really important when you are defining your schema is the naming of your schema which is made up of two important things which are the namespace that we have here for example here in this example I have a namespace called KTA that’s the namespace that I’ve chose in your case you have to choose one namespace and stick to it to all the tables or to all the schemas that you are going to define within your data model and it should be the same because it’s going to allow you to easily identify your schemas and facilitate the operations that you are planning to do in the future. So try to have short names like between three or four characters that would be the maximum that you would go to but yeah don’t make them too long. Also you do have a name that’s going to be the name of your schema it’s supposed to be unique of course and the combination of the two names based on the name that’s going to be actually your table name physically that will be created. So you can add the label for your schema and that’s what the business users are going to see when they are working within that specific table. So just some recommendations when you are trying to create a new schema do not choose out of the box namespaces like the ones that we have listed over here XTK, NL, NMS, NTM, GMP these are allocated by the system they’re already used to name out of the box tables so do not choose them because they are meant to identify system tables or schemas. And also if you have made a mistake in the namespace of your schema do not change it manually. If you think you’re wrong just delete it and create a new one again. Yeah and just create a new one again do not modify it because it does not work this way. When it comes to the definition of the attributes that you have inside your schema you’re going to work with a tag called attribute like we have here in the example the attribute tag with the type which is going to be mandatory to define the type of your attributes whether it’s a text or a number or a date or a boolean maybe you have to specify the type like we have here type string, string stands for text and also one thing that is very important is going to be the name of your attribute here is the last name it’s equal to last name so that’s going to be the name of our field inside the database and when you’re using a text field so when you’re basically using a type equal to string you will have to specify length equal to the number of characters that you think you are going to have within your field just for optimization purposes otherwise you’re going to allocate too much space for no reason. Some naming conventions regarding the attributes that you are going to use when deciding about your name try to stick to lowercase okay we prefer having lowercase attributes that’s going to facilitate the work for database managers when they try to update or maybe add the new data to the to the schema also for the names try to stick to English words and also when you have like compound names inside the name try to have the first word of each the first name the first letter of each word in uppercase like here we have first name all in lowercase we prefer n in uppercase instead of everything in lowercase. Also some interesting fields that you can add or attributes that you can have are called calculated fields like we have here an example for the age these fields are going to be calculated based on the value of another field that you have already defined another attribute here we have the birth of dates the birth date is going to help calculate the age thanks to the expr expression so that’s a new attribute that you will have to define inside your attribute tag and inside it you can use an adobe campaign classic function if you wish in order to calculate the value inside this field so here we have years old between parents is our birthday this will calculate for us automatically the age also you have a sign that is specific to calculated fields like we have here for the age you have like an orange yeah an orange icon that’s that means that this field is calculated and you don’t have to worry about the value it’s already going to be calculated for you one part this is mandatory when you are defining your schemas you have to define a key you’ve got to have one or maybe might be multiple fields or attributes that are going to define the unicity for one single record and within adobe campaign classic you can do it via two ways either you you decide that adobe campaign is going to generate that key for you automatically in this case you will define an attribute called auto pk equal to true that’s going to be an attribute at your root element this will mean that adobe region right for every single value a unique identifier that could be used and you won’t have to worry about that or if you already have your identifiers available and you just need to tell adobe oh this is my identifiers then you go with the second method that’s like we have here on the on the slide you have a key tag and inside this key tag you define key field elements which is going to contain one or maybe multiple fields that are going to make up your key here our key is going to be the email in addition to the last name one part that is very essential when you are defining your schemas is obviously the links you need to relate your tables to other tables inside the data model so we do support all the links the kind of links that you can think of one to one or one too many or many too many and the way to define that is through another tag inside your schema document it’s going to be an element tag again as an attribute you will have type equal to link that’s mandatory so that adobe knows this is a link something else that is very that is very important that’s the target attributes inside this target attribute you are going to specify the schema that you would like to make the relationship with and then in case the link is one to one you will have to add the ref cardinality equal to single that’s going to say hey this is a one to one relationship okay in case it’s not then you can ignore it it will build automatically a one to many relationship and also in case you would like to add some additional properties you can add revlink for example for um for giving a name for your link on the opposite table and also external join equals to true that means that you do not require a value mandatory inside this link you can have empty values you can tolerate that when you are creating your link you just need to create it in one side which is going to be in your end side so when you have one to many relationship that’s going to be on the end side all the time you don’t need to worry about the other side adobe is going to take care of this from the other side and yeah we have an example here like we are trying to build a relationship with a table called country we have a name called country we have a target which is nms two points country that’s the name of our schema type equal to link obviously we can add a label if we want to and here we have additional additional tag it’s called join to specify that okay this is the key that will be used to make the join between the two tables so this join tag is not mandatory all the times if you don’t specify that’s fine adobe is going to work with the key of the table in order to make up the relationship and once it’s done you can recognize your link via this way like here we have with country we can see the link and we can also see the foreign key for country that has been created so we have foreign key foreign key id that is available over here the foreign key would have been created automatically and used to make up the relationship finally we have an example over here so we have our elements we have our elements root element that contains the name name customer customer schema we have with opk equal to true adobe is going to take care of the primary key with the list of the fields that are going to be available we have last name first name a just calculated field based on the birth date and we have a link for country as you see here on this screen finally when you are done defining your schema or your schemas you have to update that because physically it does not exist yet until you decide to make the update on the database you’ll have to work with the menu you go to tools advanced and you press the option update database structure this will update your database and make the make the tables physically exist on the data the database and as a reminder one schema is equal to one table and every single attribute is going to be defined as a field if we jump to forms once your table exists if you would like would like it to make to be visible for the users inside adobe campaign classic we can create a form for that also it’s going to be an xml document that will allow these users to create new new records modify the existing records or simply visualize them and when it comes to the naming it has to have the same naming as your schema so we have to stick to the same names for the form like we have for the schema so here we have an example the root tag is going to be form and inside your root tag form we have the namespace obviously the name which are the same as the schema and for every one of the fields that we would like to display we will use the input tags where you can easily add them via the menu that you have inside adobe campaign classic console and that will give you the exact name for each one of the fields so you don’t have to worry about making typo mistakes and also just to organize them better you can put you can use what we call containers so like we are using here we have three different containers just to make a separation between this group of fields so we have the first the first group for general second group second group for the contact parameters and the last group for the address also these are going to be separated thanks to this container but also to the fact that we have a type that is specified over the form tag as an attribute type is equal to icon box this is going to give you the same presentation as you have as we had on the last slide actually and if we would like to add any decorative elements we can go with emg attributes this will allow us to make a reference to any image that we have saved inside adobe campaign classic obviously you’re not going to only display simple attributes you would like to search display links because your table is related to other tables so for example if we went on the customer table and we want to display this country we will add again a new input with the expat equal to the country link could be used as a regular field the only difference is that you are going to use the type equal to list this will give the opportunity to the users to choose a value from a drop down list menu also when you have relationships like one-to-many relationships like we can have between one customer and subscriptions you can say you can use the same you can say the same tag which is input but this time you’re going to use type equal to link list this will allow you to specify the list of the columns that you would like to display for each one of the values that you have so here we’re displaying the list of subscriptions and we are displaying on input expects column one like the label of the of the service we have column two the address column three the format of the email etc so you’re displaying the all the columns that you would like to have you can go with more advanced fields or advanced properties if you want inside your farm you can put some of the fields on the read mode only so that users can’t modify them you will use this attribute read only equal to true or if you have some mandatory fields you can go with two attributes required equal to true and also just to make people understand this in case they forget about it you can add at the end of your form a leaf tag like we have over here we are checking that for example the email is filled in and if that’s not true we are displaying and our message to remind the user how you have to fill in this value also you can you can just display some conditional parts inside your form so for example here we have one container that is going to have the type equal to visible visible group this is just to enable the fact that we would like to make the visibility in a condition and the condition will be written inside the attribute visible if so here we have visible if gender equal to one in this case we will display this the text man and if it is equal to two we’re going to display woman so for the man we will display men and for the woman we will display woman so the last part about making the form work is to add it to the navigation free because after this point it’s available but the users cannot add it yet inside the folders or inside their folder structure so just to make it visible we have to create it inside the navigation hierarchy and inside the navigation hierarchy is accessible to the same folders you have right under forms you have you have one called navigation tree and inside it’s written also in XML everything that you are going to change it’s going to be inside the model which is the root tag for your documents also in XML and inside this root tag you’re going to be able to display what are the columns that you would like to display by default for the users and also what is the schema in question so let’s take a look at an example here we have the NAFTA here we are already on the NAFTA that we had inside ÃÛ¶¹ÊÓÆµ campaign classic you don’t have to create multiple documents you can just take the document that you already have because you already have one and modify it to add a new model tag or new node model like we have here for the example so the model name equal to root is what you actually see when you just right-click that’s your roots model that we cannot touch we cannot modify but right under it you have node model and inside node model you can add obviously your folder like we have here node model customer catalog so inside node model customer catalog we are actually going to display what is specified inside the view tag so inside the view tag what we are looking to display is for us the customer schema that we created beforehand so this is why we need to specify schema the name of the customer schema and then you have type list desk this is going to tell okay we it’s going to be a list of customers that we are trying to display over here and we would like to configure that list by default so that once the users add this customer to the structure of the hierarchy they’re going to be able to see some default columns that we have just specified here under the column stack so you have under the column stack we have here four nodes and for each one of the nodes here by default we will be displaying first name last name email age this is what people are going to see once they add this this form inside the navigation hierarchy of campaign classic so that completes the process the last part we are going to cover here is about API so API inside ÃÛ¶¹ÊÓÆµ campaign classic are supported and are actually going to be the way that users are going to be able to access the features of campaign classic from the outside so even if you’re not a person who is going to work directly inside ÃÛ¶¹ÊÓÆµ campaign classic maybe you need to access campaign classic from a website for example you can and that that’s thanks to the sub protocol it works with sub protocol and you can access a bunch of out of the box ÃÛ¶¹ÊÓÆµ campaign API like that are reading modification over any schema that you want you can even for example start a delivery regardless of the channel you can execute a specific campaign so yeah there are numerous numerous features that you can access through the API these are just some examples and also what is interesting here for us is that you can extend the API features to add a new feature at the level of one specific schema you can add one method that’s that this method is going to be your feature that you are going to that you are going to to add so to start this process you’re going to go in the schema in question so let’s take here the recipient schema we are going to add just before the end a method tag and inside this method tag methods tag we can add one method tag or maybe multiple ones it depends on how many methods you would like to add here we only have one and inside this method we obviously are going to give it a name here it’s method that is called a raise email and is defined at the level of library so a library is a javascript file that you are going to save inside adobe companion classic that will call the definition of the whole method or the process of the method so here are we were specified so far the name and the definition of the method we also have the parameters that we need to add or we need to specify when calling the method here is going to be the identifier of the recipients this is what the method is expecting and also in the help tag you have a description you can push the description of the method so that people who are using the method can understand why how this method can help them so here this method is defined to raise an email value for specific recipients so so far it’s um it just we just added to the api new definition of a new new method but to make it work we have to uh write the write the code inside the inside the javascript file and like we have over here so we have our method raise email written here if you pay attention it’s not called just a raise email it’s called nms underscore recipients raise email this is the namespace then the name of your schema and then the name of the method and between parentheses you put the name of the parameter so uh inside this method we have the work the algorithm of the method what we are doing is using the recipients in question uh we’re we’re putting an empty value for the email and then we’re saving back the recipients which is what the method is supposed to do erase the email value so finally it’s done we can we can already use it test it by the way you can also test it inside the workflow inside adobe campaign classic you don’t have to use this only from outside you can also call all the api methods from any workflow that you create via javascript activity like here we have an example and when you are going to try to call the method in question you will have to first specify the namespace of your schema uh in our case and of your schema it’s recipient dot the name of your method here is a raise email so and then between parentheses you specify the parameter that is expected here it’s the recipient’s id so uh yeah that’s complete you just test your method make sure that’s working properly and yeah that’s um at this point we can we can use it from adobe campaign classic workflows or and also from outside of adobe campaign classic that completes our presentation i can open the questions so yeah you do have a documentation online um you mean this presentation um not sure if i’m allowed to do so i can come back to you with that later so that’s yeah obviously you can find this um uh these examples on the official adobe campaign classic documentation you you Okay, thank you. Thank you for attending.
recommendation-more-help
1b11e305-9ac1-4085-b79d-c0f5f0ae926b