Genesys CTI User Forum
Genesys CTI User Forum => Genesys-related Development => Topic started by: cavagnaro on November 04, 2008, 11:45:36 PM
-
Hi guys,
I'm playing with GAD and deploying the examples, specially I want to open a new tab and show an external URL, however to understand well how this works I began with the example at the development guide.
1. Created the custom file
[code]
<gcn-resources>
<desktop>
<dictionary-class>custom</dictionary-class>
<interaction-information>
<javascript-onload>
<![CDATA[
selectTabByName(TAB_INTERACTION_INFORMATION_CUSTOM_ATTACHED_DATA);
]]>
</javascript-onload>
</interaction-information>
<customer-records>
<javascript-onload>
<![CDATA[
switch(interactionType) {
case INTERACTION_CHAT:
selectTabByName(TAB_CUSTOMER_RECORDS_HISTORY);
break;
case INTERACTION_VOICE:
selectTabByName("additionalInformation");
break;
}]]>
</javascript-onload>
<tabs>
<tab name="additionalInformation">
<dictionary-key>additionalInformation</dictionary-key>
<javascript-onselect>
<![CDATA[
document.forms.additionalInformationForm.target = getDetailFrameName();
document.forms.additionalInformationForm.elements.idInteraction.value = idInteraction;
document.forms.additionalInformationForm.elements.idContact.value = idContact;
document.forms.additionalInformationForm.submit();
]]>
</javascript-onselect>
<html-body>
<![CDATA[
<form name="additionalInformationForm" action="custom\additionalInformation.jsp">
<input type="hidden" name="idInteraction">
<input type="hidden" name="idContact">
</form>
]]>
</html-body>
</tab>
</tabs>
</customer-records>
</desktop>
</gcn-resources>
[/code]
2. Then created the frame file on same folder:
[code]
<%@ page language="java" buffer="none" contentType="text/
html; charset=utf-8" %>
<%
com.genesyslab.ail.AilFactory factory =com.genesyslab.ail.AilLoader.getAilFactory();
com.genesyslab.ail.Interaction interaction =factory.getInteraction( (String)request.getParameter("idInteraction" ) );
com.genesyslab.ail.Contact contact = null;
com.genesyslab.ail.ContactManager contactManager =factory.getContactManager();
if (contactManager != null)
contact = factory.getContactManager().getContact((String)request.getParameter( "idContact" ) ,null);
%>
<html>
<head>
<title>Additional Information</title>
</head>
<body style="font-size: 10pt;" bgcolor="#ffcccc">
<% if( contact != null ) { %>
Contact:
<b>
<%=contact.getTitle()%>
<%=contact.getFirstName()%>
<%=contact.getLastName()%>
</b><br>
Primary Phone Number:
<b>
<%=contact.getPrimaryPhoneNumber()%>
</b><br>
Primary E-mail Address:
<b>
<%=contact.getPrimaryEmailAddress()%></b><br>
<% } else { %>
<center>
<b>
Contact Information Not Available
</b>
</center><br>
<% } %>
<hr>
<% if( interaction != null ) { %>
Date of Creation:
<b>
<%=interaction.getDateCreated()%>
</b><br>
Agent:
<b>
<%=interaction.getUserName()%>
</b><br>
Subject:
<b>
<%=interaction.getSubject()%>
</b><br>
<% if( interaction.getDn() != null ) { %>
Dn:
<b>
<%=interaction.getDn().getId()%>
</b><br>
<% } else { %>
Dn:
<b>
No Dn Information Available
</b><br>
<% } %>
<% } else { %>
<center>
<b>
Interaction Information Not Available
</b>
</center><br>
<% } %>
</body>
</html>
[/code]
3. Then the dictionary file:
[code]
AdditionalInformation=Additional Information
[/code]
But I get this error:
[code]
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: SvgTag key additionalInformation not found
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.genesyslab.uadthin.filter.CachePreventFilter.doFilter(CachePreventFilter.java:30)
com.genesyslab.uadthin.filter.UTF8Filter.doFilter(UTF8Filter.java:118)
root cause
javax.servlet.ServletException: SvgTag key additionalInformation not found
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.interaction.customer_002drecords_002dtab_jsp._jspService(customer_002drecords_002dtab_jsp.java:1012)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.genesyslab.uadthin.filter.CachePreventFilter.doFilter(CachePreventFilter.java:30)
com.genesyslab.uadthin.filter.UTF8Filter.doFilter(UTF8Filter.java:118)
root cause
javax.servlet.jsp.JspTagException: SvgTag key additionalInformation not found
com.genesyslab.uadthin.taglib.SvgTag.doStartTag(SvgTag.java:227)
org.apache.jsp.interaction.customer_002drecords_002dtab_jsp._jspService(customer_002drecords_002dtab_jsp.java:314)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.genesyslab.uadthin.filter.CachePreventFilter.doFilter(CachePreventFilter.java:30)
com.genesyslab.uadthin.filter.UTF8Filter.doFilter(UTF8Filter.java:118)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.25 logs.
[/code]
And found that has to be with this line at the custom.xml file:
<dictionary-key>additionalInformation</dictionary-key>
What can be? I have tried to rename everything without success...
any ideas?
-
Hi Cavagnaro,
Seems to me you're "fighting" with GAD a bit ;). But it's great you didn't give up!
Your issue relates to fact that you defined a custom "dictionary" (tags dictionary-class and dictionary-key in custom.xml file) but such dictionary doesn't exists. So you have to do following:
1. Go to the folder "/webapps/gdesktop/WEB-INF/classes/" and create here new file named "custom.properties"
2. Insert following line to this file
additionalInformation=New tab by Cavagnaro!
3. Try to display your tab. Maybe GAD restart will be required.
R.
PS. As usually, haven't had a chance to test it so use it on your own risk :o
-
Hi René,
Yeah I'm trying to exploit all what this can do and show customers the potential...
I already created that file...seems like it can't find it...the custom.properties needs some other line? or just that line?
-
No, just the one line should be sufficient. Each line contains key (defined in XML) and value.
Tip: If you don't need to use the dictionary remote the tag "dictionary-key" and it should work then. Dictionaries are used mainly for translation purposes.
R.
-
Just changed the = XXX by the New Tab by cavagnaro and worked... ??? ??? why does this system behaves so crazy? lol
Now, GAD asked me to download the .jsp file...is that normal? As no content on the TAB is shown. And how to show an external URL?
Thanks!
-
:) Solved the jsp problem, a break line at the header which defined the content type was the problem.
Now will play on how to load an external URL :D
-
:o Worked!
[code]
<tab name="Google">
<dictionary-key>Google</dictionary-key>
<scrollbar>true</scrollbar>
<javascript-onselect>
<![CDATA[
document.forms.Google.target = getDetailFrameName();
document.forms.Google.elements.idInteraction.value = idInteraction;
document.forms.Google.elements.idContact.value = idContact;
document.forms.Google.submit();
]]>
</javascript-onselect>
<html-body>
<![CDATA[
<form name="Google" action="http://www.google.com.pe">
<input type="hidden" name="idInteraction">
<input type="hidden" name="idContact">
</form>
]]>
</html-body>
</tab>
[/code]
-
[quote author=cavagnaro link=topic=3502.msg14827#msg14827 date=1225842336]
And found that has to be with this line at the custom.xml file:
<dictionary-key>additionalInformation</dictionary-key>
What can be? I have tried to rename everything without success...
any ideas?
[/quote]
Hi cavagnaro,
The error is saying "SvgTag key additionalInformation not found" and it didn't find it because it's case-sensitive, so be very carefull.
In your custom.xml
[code]
<tab name="additionalInformation">
<dictionary-key>additionalInformation</dictionary-key>
[/code]
In the dictionary file:
[code]
AdditionalInformation=Additional Information
[/code]
Change the a/A so it matches and your problem is solved. :)
A nice example of GAD customisation is to pop-up Google Maps with the address stored in Contact Server...
Enjoy GAD :)
Luk
-
Oh! it was the A! Thanks! Will keep in mind! Yeah saw the video of google! Pretty amazing! Now I'm playing on how to capture attached data :D
-
Hey guys, new question,
Trying to capture userName variable however I can't do it. My code is:
[quote]
<javascript-onload>
<![CDATA[
alert("interaction status : " + userName);
}]]>
</javascript-onload>
[/quote]
However I always get a warning message that the variable is not defined, however at the XML Tag Reference guide it says it is availble always. Any idea what am I doing wrong?
Thanks
-
Hi Cavagnaro,
The variable "userName" is defined for particular tags only (desktop, menu, menu-item etc.). In what situation you'd like to use it?
R.
PS. What version of GDesktop you have?
-
Hi René,
My GAD version is 7.6.01.011.
I want that when my tab Google opens (for example) send as a parameter form the username of the agent. So what I did was:
[code]
<customer-records>
<javascript-onload>
<![CDATA[
alert("The agent is : " + userName);
switch(interactionType) {
case INTERACTION_CHAT:
selectTabByName(TAB_CUSTOMER_RECORDS_HISTORY);
break;
case INTERACTION_VOICE:
selectTabByName("eBDWeb");
break;
}]]>
</javascript-onload>
[/code]
Am I correct? If this shows as alert then will be easy to capture to a variable and then use it to send as hidden parameter of the form.
-
There is one "issue" - the variable "userName" is available only for child tag "<javascript-oncustomevent>" as stated in the help. So you can't use it to retrieve agent's name when opening new tab.
There is a way how to do it but it's more complicated. You have to write your own jsp page where you'll retrieve agent's name using AIL and pass it as parameter to other (your) page.
R.
-
And what is a CustomEvent? I have read again the XML help file and it says:
"all javascript and DTML tags." and then below is another variable for customevent which is customEvent.
I also thought the jsp solution, however I have one question there, following and analyzing the examples, the jsp file retrieves a variable and then call a function to get a data from it. Example contact.getTitle(), but in what documentation I can find all those functions like getTitle?
Thanks a lot René
-
Ok, I saw it, under <customer-records> says that it is usable only on oncustomevent, however on <desktop> tag it says it is usable on all tags...which one do I use?
-
:D Followed the "hard" idea and it works like a charm! And it gives me more power on how to build the URL, nice! Now to play on how to capture attached data, will follow the examples!
Thanks René!
-
[quote author=cavagnaro link=topic=3502.msg14993#msg14993 date=1226356813]
And what is a CustomEvent? I have read again the XML help file and it says:
"all javascript and DTML tags." and then below is another variable for customevent which is customEvent.
I also thought the jsp solution, however I have one question there, following and analyzing the examples, the jsp file retrieves a variable and then call a function to get a data from it. Example contact.getTitle(), but in what documentation I can find all those functions like getTitle?
Thanks a lot René
[/quote]
The documentation that shows you those functions is the "Interaction SDK for Java" documentation. The AIL part.
Luk
-
Thanks! Will begin to read inmediatly!
I already achieved to capture attached data and I did a very nice application which based on the callers options shows different screens of a support web system and I have reduced the time to handle a call a lot! So nice :D
I still complain that it is kinda slow compared to an EXE but has its advantages too.
-
iS IS POSSIBLE FOR YOU TO SEND THE WORKING COPY OF THE CODE, AS i AM TRYING TO DO SOMETHING SIMILAR BUT HAVING SOME ERRORS, SO IT WILL BE A HELP IF I CAN SEE THE WORKING CODE TO GET AN IDEA. THANKS,
GOLD
------------------------
-
Hello,
Did you made any progress with this GAD customization, since I didn't see any reply on your post?
I am having sort of the same problem:
* I need a custom jsp to be executed on some event - is it possible?
* I need this jsp to connect to a Oracle database and query some data - is this possible, as well?
* last but not least I need to pop-up a new window with a custom URL?
Regards,
Valeriu
-
Hi Valeriu,
Generally, all you need is possible.
[quote]* I need a custom jsp to be executed on some event - is it possible?[/quote]
Custom code is executed once an interaction is accepted (answered) by an agent by default. It's possible to execute custom operation even on other desktop-related events like EventRinging but it makes customization as bit complex
[quote]* I need this jsp to connect to a Oracle database and query some data - is this possible, as well?[/quote]
Yes, it's possible but you would need to copy Oracle JDBC drivers to GAD's Tomcat instance.
[quote]last but not least I need to pop-up a new window with a custom URL?[/quote]
Yes, possible
I would recommend you reading the Genesys Desktop 7.6 Developer's Guide at first. You can find there useful information and customization examples as well.
R.
-
Custom tag libraries allow the Java programmer to write code that provides data access and other services, and they make those features available to the JSP author in a simple to use XML-like fashion. An action in a web application -- for example, gaining database access -- can be customized by using a custom tag in a JSP page. The JSP author doesn't have to understand the underlying detail to complete the action. In short, a tag library is a collection of custom actions presented as tags.