Thursday, 16 May 2013

Using the "category" Directive to Place Actions in the Xataface UI

Actions are a core concept of Xataface.  They can be viewed from two perspectives:

  1. An action can be manifested as a button or link in the user interface.  E.g. The "New Record" button is an action as it is rendered in the user interface.
  2. An action can be thought of as an HTTP request handler.  E.g. When the URL's query parameters include -action=new, the new record action is called upon to handle the request.   This will render a new record form or process the input from a previously rendered new record form depending on the other parameters of the HTTP request.
In this tutorial, I want to focus on the first aspect:  how and where actions are rendered in the Xataface UI.

Creating an Action

To start out, we'll need to create a new action.  

Steps:

  1. Create a file named actions.ini inside the main directory of your application (if it doesn't already exist).
  2. Add the following anywhere inside the actions.ini file:
  3. Now try opening your application and notice the "Hello" button appear along with the other table actions. 
    After adding the hello action to the table_actions category, it appears with other buttons in the table actions (upper left).  This example shows the button using the g2 theme.  It would appear differently in different themes.
The placement of the action (in the upper left) was dictated by the category directive.  I chose to place the action in the "table_actions" category.  This category is intended to be used for actions that don't pertain to a specific record, but may be accessed at any time for a table.  Some examples include:
  • The new record action
  • The Import action
Currently clicking on the "Hello" button doesn't actually do anything because we haven't assigned it a URL (the url property).   At this point I just want to demonstrate how to show, hide, and locate the action buttons.  Future articles may discuss other aspects of actions like how to specify the URL that they point to.

Alternative Action Placement

You may be wondering what other possible positions are there for an action.  We've already seen the "table_actions" category, but there are many others.  In fact you can even create your own categories and embed actions inside the Xataface UI using your own custom templates.
Some other built-in categories include:
  • result_list_actions
    This category is intended for actions that operate on records in the list view.  They are rendered at the top and bottom of the list view.

  • record_actions
    This category is intended for actions that operate on the current record shown in details view.  They are rendered along the top bar of the record details view (which is used for rendering the output of most actions that pertain to a single record).
  • related_list_actions
    This category is intended for actions that operate on a list of related records.  They are rendered at the top and bottom of a related list.  This is very similar to the result_list_actions category, except that it is used for related lists.
    Notice that the "hello" action is rendered inside the "More" menu.  This drop-down is automatically created by Xataface to house excess actions in the case that there are too many actions in the category to fit the space nicely.
  • find_actions
    This category is intended for alternative "find" actions.  When a user enters a search in the top search field, they will be sent to the list view by default with a filter on the results.  You can provide optional responses to the search if you like, but creating your own custom search actions.
  • history_record_actions
    These are actions that are intended to operate on history snapshots of a record.  This is only relevant if your application has history enabled.  It will appear next to the record version in the history tab for the record.
    Notice the "hello" label appears next to the history snapshot ID 3.
  • personal_tools
    This category is intended for actions that pertain to a user's personal preferences or account.  These will be rendered in the user's personal menu in the upper right  along with actions like "Edit Profile", and "Log Out". 
  • management_actions
    This category is intended for actions that help administrators manage system settings.   They are rendered in the upper right in the "Control Panel" menu.
  • top_right_menu_bar
    This category is intended for actions that have global significance.  They are rendered in the top right on every page.  The only actions that are rendered here by default are the personal tools menu and the control panel menu. (g2 theme only)

  • top_left_menu_bar
    This category renders the action in the top left menu bar of the application, along with the list of tables in the app.   It is a convenient way of adding additional options to the tables menu.
    (g2 theme only).
    Action added to the top_left_menu_bar category.  Because there are already a lot of actions in this category, it has been added to the "More" drop-down menu.  Had there been fewer existing actions, this would have been rendered in the top menu bar directly.
  • list_export_actions
    This category is intended for actions that export the current result list in a different format.  It will be rendered inside the "Export" drop-down menu above and below the list view, along with actions like "Export CSV" and "Export XML".
  • record_export_actions
    This category is intended for actions that export the current record (shown in details view) in a different format.  It will be rendered in the "Export" drop-down menu of the record details page, along with actions like "Export CSV" and "Export XML". 
  • related_export_actions
    This category is just like the list_export_actions category except it is for actions that export the current related record list in a different format.  It is rendered in the "Export" menu of the related records view.
There are more actions than just these.  A good way to discover what action categories are available to you is to open the Xataface actions.ini file and the g2 module actions.ini file and see what categories are used in the existing actions.

More information about actions

This is just the tip of the iceberg for Xataface actions.  This post has likely created as many questions as it has answered.  There is more information about actions in the Xataface wiki and in the Getting Started guide.  E.g.

14 comments:

  1. If you want your ex-girlfriend or ex-boyfriend to come crawling back to you on their knees (no matter why you broke up) you need to watch this video
    right away...

    (VIDEO) Get your ex CRAWLING back to you...?

    ReplyDelete
    Replies
    1. Hi everyone I'm Olivia Hannah and am here to share the wonderful work Dr Raypower did for me. After 5 years in marriage with my husband with 2 kids, my husband started acting weird and going out with other ladies and showed me cold love, on several occasions he threatens to divorce me if I dare question him about his affair with other ladies, I was totally devastated and confused until a old friend of mine told me about a spell caster on the internet called Dr. Raypower who help people with relationship and marriage problem by the powers of love spells, at first I doubted if such thing ever exists but decided to give it a try, when I contact him, he helped me cast a love spell and within 48hours my husband came back to me and started apologizing, now he has stopped going out with other ladies and his with me for good and for real. Contact this great love spell caster for your relationship or marriage problem to be solved today via email: Urgentspellcast@gmail.com or Urgentspellcast@yahoo.com or Call or WhatsApp: +14243308109. 

      Read more about him on his website: http://urgentspellcast.website2.me/













      Hi everyone I'm Olivia Hannah and am here to share the wonderful work Dr Raypower did for me. After 5 years in marriage with my husband with 2 kids, my husband started acting weird and going out with other ladies and showed me cold love, on several occasions he threatens to divorce me if I dare question him about his affair with other ladies, I was totally devastated and confused until a old friend of mine told me about a spell caster on the internet called Dr. Raypower who help people with relationship and marriage problem by the powers of love spells, at first I doubted if such thing ever exists but decided to give it a try, when I contact him, he helped me cast a love spell and within 48hours my husband came back to me and started apologizing, now he has stopped going out with other ladies and his with me for good and for real. Contact this great love spell caster for your relationship or marriage problem to be solved today via email: Urgentspellcast@gmail.com or Urgentspellcast@yahoo.com or Call or WhatsApp: +14243308109. 

      Read more about him on his website: http://urgentspellcast.website2.me/

      Delete
  2. QUANTUM BINARY SIGNALS

    Get professional trading signals delivered to your mobile phone every day.

    Follow our signals NOW and make up to 270% per day.

    ReplyDelete
  3. salg kopi eksklusive klokker, der kombinerer elegant stil og avanceret teknologi, en række forskellige stilarter af salg vacheron-constantin kopi eksklusive klokker, går markøren mellem din eksklusive smagstil.

    ReplyDelete
  4. Hello i am here to spread this good news to the entire world on how i got my ex love back.I was going crazy when my love left me for another girl last month,But when i meet a friend that introduce me to DR IROSI the great messenger to the oracle that he serve,I narrated my problem to DR IROSI about how my ex love left me and also how i needed to get a job in a very big company.He only said to me that i have come to the right place were i will be getting my heart desire without any side effect.He told me what i need to do,After it was been done,In the next 2 days,My love called me on the phone and was saying sorry for living me before now and also in the next one week after my love called me to be pleading for forgiveness,I was called for interview in my desired company were i needed to work as the managing director..I am so happy and overwhelmed that i have to tell this to the entire world to contact DR IROSI at the following email address DRIROSISOLUTIONCENTER@GMAIL.COM and get all your problem solve..No problem is too big for him to solve..Contact him direct on DRIROSISOLUTIONCENTER@GMAIL.COM or call his mobile number or add him up on whatsapp via (+2348118829771). and get your problems solve like me.    

    ReplyDelete
  5. LOVE SPELLS THAT WORKS I am sharing this testimony to partners suffering in their relationships because there is an enduring solution.
    My husband left me and our 2 kids for another woman for 3 years. I tried to be strong just for my kids but I could not control the pains that torment my heart. I was hurt and confused. I needed a help, so i did a research on the internet and came across a site where I saw that Dr. Aluya a spell caster, can help get lovers back. I contacted him and he did a special prayer and spells for me. To my surprises, after some days, my husband came back home. That was how we reunited again and there was a lot of love, joy and peace in the family.
    You can as well contact Dr.  Aluya  , a powerful spell-caster for solutions on his contact aluya.48hoursspelltemple@gmail.com or directly on Whats App: +2348055431163 

    ReplyDelete
  6. Hello i am here to spread this good news to the entire world on how i got my ex love back.I was going crazy when my love left me for another girl last month,But when i meet a friend that introduce me to DR IROSI the great messenger to the oracle that he serve,I narrated my problem to DR IROSI about how my ex love left me and also how i needed to get a job in a very big company.He only said to me that i have come to the right place were i will be getting my heart desire without any side effect.He told me what i need to do,After it was been done,In the next 2 days,My love called me on the phone and was saying sorry for living me before now and also in the next one week after my love called me to be pleading for forgiveness,I was called for interview in my desired company were i needed to work as the managing director..I am so happy and overwhelmed that i have to tell this to the entire world to contact DR IROSI at the following email address DRIROSISOLUTIONCENTER@GMAIL.COM and get all your problem solve..No problem is too big for him to solve..Contact him direct on DRIROSISOLUTIONCENTER@GMAIL.COM or call his mobile number or add him up on whatsapp via (+2348118829771). and get your problems solve like me.    

    ReplyDelete
  7. I want to use this great opportunity to thank Dr Aluya for helping me to get my boyfriend back after 3 months of breakup. My boyfriend breakup with me because he see another girl at his working place and told me he is no longer interested in me and live me in pain and heart break. I seek for help on the internet and i saw so many good talk about this great spell caster Dr Aluya and I contacted him also and explain my problems to him and he cast a love spell for me which i use to get back my boyfriend within the period of 48 hours and i am so grateful to him for the good work he did for me,that is why i also want to let everyone who is in need of help out there to also seek help from him so he can help.His email is aluya.48hoursspelltemple@gmail.com or whatsapp: +2348110493039

    ReplyDelete
  8. My name is Louis Edmond, I am from USA. I want to share a testimony about Dr Aluya, a great spell caster who is very straight forward with his words of casting spells. When my Wife left me for another Man i was so confused,but one a day a friend of mine gave me the email address of this great spell caster called dr Aluya, I contacted this man and explained to him all that i was going through,he then told me to be calm and not worry anymore because my case is a very easy one. At first I never believed all that he was saying until when my husband returned home two days later begging me to forgive him for all that he had done to me and to please accept him back into my life,I was so amazed,I never believed it was going to happen that fast.
    This man is truly great indeed. Contact him today for a perfect solution to your love problem, aluya.48hoursspelltemple@gmail.com.  or whatsApp him  +2348110493039

    ReplyDelete
  9. Hi everyone, my name is Rabueil Islam
     and am from London, I met this spell caster called Dr Aluya of aluya.48hoursspelltemple@gmail.com online and so many other, but i decided to go with this particular spell caster and this is about 2 weeks ago. I needed the spell caster to reunite me and my lover because she started behaving strange and a day came she text me and told me she cannot continue with the relationship anymore, that she just want to be alone. But a close friend of hers shows the guy to me that she was now dating. So i contacted this spell caster because i was totally heart broken and i smoked and get drunk till i could not even notice if am standing or lying.This spell caster told me not to worry, he gave me hope that am to have her again just like old times, and i provided all the requirements, and in just 5 days, my ex lover called me crying over the phone asking for me to forgive her for her stupid act, and she swore with her mother grave to love me and never hurt me again.This was what the spell caster earlier told me and it came after he has done the spell and that same night, my lover came to my house and spend the night with me.I have never seen spell as powerful as this but now, am convinced that Dr Aluya is the best ever, You can contact him through him email address:aluya.48hoursspelltemple@gmail.com or WhatsApp: +2348110493039

    ReplyDelete
  10. My lover dumped for  another woman with two kids i was confused until i came
    in contact with Dr Aluya who helped me with a powerful love spell that
    brought him back within 2 days. contact Dr Aluya for help on :
    Email :aluya.48hoursspelltemple@gmail.com or WhatsApp him  +2348110493039

    ReplyDelete
  11. Get Your Wife Back, Perfect Urgent Love Spell. Am Oliva Giphy
     from FL Usa All Thanks To Dr Aluya Who Brought Back The Love Of My Life. my girlfriend cheated on me and asked for a breakup. I don't believe at first i try to get back with her but all she told me was she’s with someone else. that she is no longer interested in marrying me at that point i was heart broken coz i love my girlfriend so much that i could not let go off her all of a sudden she left me, i really love her and never can imagine my life without her. not until i came across a powerful real spell caster Dr Aluya who promise me 48hours urgent love spell to get back with my girlfriend, good twenty-four {48} hours. hmm-mm, it was a good night time at 11:pm within the days that Dr Aluya told me that my girlfriend will be back, at first i heard the bell rings getting close to my door i heard someone saying honey!!!, it sound familiar i opened the door and i saw my girlfriend standing and weeping in front of me. i was not surprised because its all i have been praying for her to come back home. Guess what 2 weeks after she noticed her system and her body temperature was changed and i took her to clinic for check up and the doctor told me that there is life in her which means she was pregnant i really wants to use this opportunity to thanks Dr Aluya so much and the love page that directed me to Dr Aluya if you have any problem getting your ex back, or predicament that is worse or exactly like this you have been into, contact Dr Aluya on aluya.48hoursspelltemple@gmail.com Whatsapp/cal  +2348110493039  
    https://draluya48hoursspelltemple.webs.com/

    ReplyDelete
  12. My lover dumped another woman with two kids i was confused until i came
    in contact with Dr Aluya who helped me with a powerful love spell that
    brought him back within 2 days. contact Dr Aluya for help on :
    Email :aluya.48hoursspelltemple@gmail.com or aluya.48hoursspelltemple@yahoo.com WhatsApp him +2348110493039


    website https://draluya48hoursspelltemple.webs.com/

    ReplyDelete
  13. How I Got My Ex Husband Back..Am so excited to share my testimony of a real spell caster who brought my husband back to me. My husband and I have been married for about 6 years now. We were happily married with two kids, a boy and a girl. 3 months ago, I started to notice some strange behavior from him and a few weeks later I found out that my husband is seeing someone else. He started coming home late from work, he hardly care about me or the kids anymore, Sometimes he goes out and doesn't even come back home for about 2-3 days. I did all I could to rectify this problem but all to no avail. I became very worried and needed help. As I was browsing through the internet one day, I came across a website that suggested that Dr Aluya can help solve marital problems, restore broken relationships and so on. So, I felt I should give him a try. I contacted him and and told him my problems and he told me what to do and i did it and he did a spell for me. 48 hours later, my husband came to me and apologized for the wrongs he did and promise never to do it again. Ever since then, everything has returned back to normal. I and my family are living together happily again.. All thanks to Dr Aluya Powerful Love Spell that really works. If you have any problem contact him and i guarantee you that he will help you. He will not disappoint you. Email him at: {aluya.48hoursspelltemple@gmail.com}. or  {aluya.48hoursspelltemple@yahoo.com} whatsapp him on: +2348110493039  
      https://draluya48hoursspelltemple.webs.com/  

    ReplyDelete