" /> Customizing Workspace Desktop Edition WDE - Genesys CTI User Forum

Author Topic: Customizing Workspace Desktop Edition WDE  (Read 12018 times)

Offline gzooby

  • Full Member
  • ***
  • Posts: 141
  • Karma: 0
  • Software Engineer at Telefax S.A.
Customizing Workspace Desktop Edition WDE
« on: March 23, 2015, 05:38:53 PM »
Advertisement
Hi guys,

Has anybody being into WDE code customization?
I have being able to work with commands, get info from interactions, change themes and colours, but i´m having trouble working with the views. I want to supress a view precisely, can someone help me?

Regards

Z

Offline abudwill

  • Full Member
  • ***
  • Posts: 157
  • Karma: 4
Re: Customizing Workspace Desktop Edition WDE
« Reply #1 on: March 23, 2015, 06:31:27 PM »
Hi gzooby,

I have only briefly looked at Workspace Desktop Edition.  However it seems most of the older IWS 8.1.4x APIs remain.

This being said, if you want to hide a view programatically, one way is to use the RemoveViewInRegion method from the IViewManager interface.

Regards,
Andrew

Offline gzooby

  • Full Member
  • ***
  • Posts: 141
  • Karma: 0
  • Software Engineer at Telefax S.A.
Re: Customizing Workspace Desktop Edition WDE
« Reply #2 on: March 23, 2015, 06:37:44 PM »
Here there are two methods I have found:

[b]RemoveAllViewsInRegion (object parentView, String regionName)[/b]

In this method, I believe parentView must be the view in which the region is ubicated. But what object do I have to pass as this parameter? How do I obtain this view object?

[b]RemoveViewInRegion(object parentiew, String regionName,object instantiateViewName)[/b]

Here I dont understand what are the parameters i need to pass the method.

Can you help me with this?

Regards

Z




Offline abudwill

  • Full Member
  • ***
  • Posts: 157
  • Karma: 4
Re: Customizing Workspace Desktop Edition WDE
« Reply #3 on: March 23, 2015, 08:40:39 PM »
See this thread: http://www.sggu.com/smf/index.php/topic,8464.msg37250.html#msg37250

It contains some more information that may be helpful.

You will want to use the RemoveViewInRegion method.

object parentview = reference to the parent view (see Genesys Doc site to understand the hierarchy of the views - whatever view you are trying to remove/hide - you will need to determine what its parent view is and obtain a reference to it and pass it as this parameter)

String regionName = the name of the region that the view exists in, doc site will give you a full name of the regions and what views exist in them

object instantiateViewName = the name the view was given when it was created.  Since you are working with views that IWS creates, you will probably want to insert a break point and examine the results of IViewManager.ViewsByRegionName.  By examining this, you can get a list of views (including the name used when the view was instantiated) for a particular region you are examining.

Regards,
Andrew

Offline gzooby

  • Full Member
  • ***
  • Posts: 141
  • Karma: 0
  • Software Engineer at Telefax S.A.
Re: Customizing Workspace Desktop Edition WDE
« Reply #4 on: March 24, 2015, 02:18:02 PM »
Thank you for your quick respone. The thing is I´m having trouble obtaining this reference to the view, I don´t know how to do it , and how to pass the parameter. Imagine I want to remove "MainBundleView"...
I know I have interface IMainBundleView, and class MainBundleView, but how can i get the reference? What do I have to pass as the parameter?

Thanks again!  :) :)

Z

Offline abudwill

  • Full Member
  • ***
  • Posts: 157
  • Karma: 4
Re: Customizing Workspace Desktop Edition WDE
« Reply #5 on: March 26, 2015, 04:53:13 AM »
MainBundleView has a lot of the core controls - not sure it is wise to remove the entire thing.  What exactly are you trying to ultimately accomplish?

Regardless, looking at the hierarchy of regions/views it appears that MainBundleView is a parent of the region named ConsultationBundlesRegion.  The parent view for this region is ICaseView/CaseView.

IViewManager.RemoveViewInRegion parameters are
* Object parentView (of the region containing the view you want to remove)
* string regionName (region where the view you want to remove lives)
* string instantiateViewName (name that the view you want to remove was created with)

Once again, you will have to do something like insert a breakpoint in code somewhere so that you can execute:

[code]viewManager.ViewsByRegionName["ConsultationBundlesRegion "];[/code]

This will show you all the views in ConsultationBundlesRegion - you will be able to see the instantiated name of MainBundleView.  For example sake, lets assume it is simply "MainBundleView" (note: I don't know if that is what it is actually called).

Next, you will need a reference to the parent view of ConsultationBundlesRegion (CaseView).  This reference can be obtained in a variety of ways and will depend on where this code is being executed.  If it is being executed in some custom control that has a Context:

[code]
IDictionary<string, object> contextDictionary = (this.Context as IDictionary<string, object>);
object caseViewObject;

if (contextDictionary.TryGetValue("CaseView", out caseViewObject))
{
    ICaseView caseView = caseViewObject as ICaseView;
}

viewManager.RemoveViewInRegion(caseView, "ConsultationBundlesRegion", "MainBundleView");
[/code]

Regards,
Andrew

Offline gzooby

  • Full Member
  • ***
  • Posts: 141
  • Karma: 0
  • Software Engineer at Telefax S.A.
Re: Customizing Workspace Desktop Edition WDE
« Reply #6 on: March 26, 2015, 06:06:56 PM »
Thank you!!
I understand now what parameters I´m needing. I wish to obtain this parent view reference from my custom module (implements IModule) initialization method. Is that possible? how can I achieve to get this reference? Is it possible?

Regards!

Offline abudwill

  • Full Member
  • ***
  • Posts: 157
  • Karma: 4
Re: Customizing Workspace Desktop Edition WDE
« Reply #7 on: March 26, 2015, 07:12:52 PM »
If your class extends IModule then you must be talking about the entry point class that is run when IWS starts.

I don't think it is possible to directly obtain a reference to any views here, since the views don't actually exist yet / no windows are actually being displayed.

What I have done before is make a dummy control that is empty, and add it to some region I know will always be displayed.  Then from within the dummy control I can obtain references to any views I need.  Alternatively you could examine the IInteractionManager interface - there are some event handlers that will be of interest to you.  Specifically InteractionCreated and InteractionEvent.

If you subscribe to these events, you can add your own event handler.  In the event handler you can look for whatever combination of UserData that might exist that would indicate it is time to remove the view you want.  Then you can get a reference to the view through the EventArgs and go to town.

For example, registering your own event handler against IInteractionManager.InteractionEvent in your entry point class:
[code]
try
{
    interactionManager.InteractionEvent += interactionManager_InteractionEvent;
}
catch (Exception ex)
{
    // some handling
}
[/code]

Now create your event handler in your entry point class, note you will have to insert breakpoints and examine the UserData to determine what views you might have access to, and what combination of data that you want to act upon.  This example is very ugly but works when a PushPreview interaction is received:
[code]
private void interactionManager_InteractionEvent(object sender, EventArgs<IInteraction> args)
{
    if(args.Value != null)
    {
        if(args.Value.UserData != null)
        {
            if(args.Value.UserData.ContainsKey("InteractionView"))
            {
                if(args.Value.State.Equals(Genesyslab.Enterprise.Model.Interaction.InteractionStateType.Connected))
                {
                    IInteractionPreviewToolbarView toolbarView = args.Value.UserData["InteractionView"] as IInteractionPreviewToolbarView; // get a ref to some view we see on the screen
                    IDictionary<string, object> contextDictionary = (toolbarView.Context as IDictionary<string, object>); // turn its Context into a dictionary
                    object caseViewObject;
                    if(contextDictionary.TryGetValue("CaseView", out caseViewObject))
                    {
                        ICaseView caseView = caseViewObject as ICaseView;
                        viewManager.RemoveViewInRegion(caseView, "ConsultationBundlesRegion", "MainBundleView");
                    }
                }
            }     
        }   
    }     
}
[/code]

I just wrote that code by hand and haven't tested / compiled it.  It may contain some typos.

I would strongly suggest reading up on the MVVM pattern and Dependency Injection.  There is also always the option of Genesys Developer training.

Regards,
Andrew
« Last Edit: March 26, 2015, 07:16:23 PM by abudwill »

Offline deadmeat

  • Jr. Member
  • **
  • Posts: 75
  • Karma: -2
Re: Customizing Workspace Desktop Edition WDE
« Reply #8 on: October 18, 2017, 07:06:18 AM »
Hello guys, didn't want to start a new thread, so asking here. We are up to migration from GAD 7.6 to WDE 8.5. Is it possible to customize WDE in this way:
1. When CSR logs into WDE, WDE opens a custom (Oracle APEX login page), where CSR has to do manual login.
2. After CSR logs into APEX URL is changed and session ID is appended to URL.
3. Grab the session ID from url, store it in some variable, and while CSR is logged into WDE, do the URL injections into APEX like: http://host:8080/apex/f?p=varSessionid+someVar+someVar2 on incoming call ?

I do realize how to something like that in java, but I doubt that WDE customization supports java. I am not asking for exact way how to accomplish this. Just want to know is it possible or not. Looking at the code above I think it is possible. Simply I need methods to grab the current URL and track if it's  changed. Will appreciate any info. Thanks in advance.

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Customizing Workspace Desktop Edition WDE
« Reply #9 on: October 18, 2017, 10:05:44 AM »
If you have done it in Java then convert the code with some on line tool

However, WDE will open the Web page on an external browser or will you develop a plug-in that has a Web browser on it?

If develop a plug-in then you can interact with inner Web browser via C# methods as the Web page will see the WDE as a container.

So, forget about WDE and think on what you can do with C#

Enviado de meu E6633 usando Tapatalk


Offline deadmeat

  • Jr. Member
  • **
  • Posts: 75
  • Karma: -2
Re: Customizing Workspace Desktop Edition WDE
« Reply #10 on: October 18, 2017, 10:12:05 AM »
[quote author=cavagnaro link=topic=8764.msg48527#msg48527 date=1508321144]
If you have done it in Java then convert the code with some on line tool

However, WDE will open the Web page on an external browser or will you develop a plug-in that has a Web browser on it?

If develop a plug-in then you can interact with inner Web browser via C# methods as the Web page will see the WDE as a container.

So, forget about WDE and think on what you can do with C#

Enviado de meu E6633 usando Tapatalk
[/quote]Thanks for reply,  Cavagnaro. Well I haven't done it. But I do realize how to do it via java. We don't have wde yet. Vendor has to install it. The problem is that vendor claims that it's impossible to do such trick and we doubt. As i understand wde opens additional tabs inside itself, so it doesn't call for external browser,  correct ?

Sent from my SM-G925F using Tapatalk


Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Customizing Workspace Desktop Edition WDE
« Reply #11 on: October 18, 2017, 10:14:57 AM »
[quote author=deadmeat link=topic=8764.msg48528#msg48528 date=1508321525]
[quote author=cavagnaro link=topic=8764.msg48527#msg48527 date=1508321144]
If you have done it in Java then convert the code with some on line tool

However, WDE will open the Web page on an external browser or will you develop a plug-in that has a Web browser on it?

If develop a plug-in then you can interact with inner Web browser via C# methods as the Web page will see the WDE as a container.

So, forget about WDE and think on what you can do with C#

Enviado de meu E6633 usando Tapatalk
[/quote]Thanks for reply,  Cavagnaro. Well I haven't done it. But I do realize how to do it via java. We don't have wde yet. Vendor has to install it. The problem is that vendor claims that it's impossible to do such trick and we doubt. As i understand wde opens additional tabs inside itself, so it doesn't call for external browser,  correct ?

Sent from my SM-G925F using Tapatalk
[/quote]WDE doesn't have such feature by default. You will or your vendor will have to develop a plug-in to either open a new tab with a browser or the plug-in (DLL) will just open a program with the URI...
Better ask them exactly how they intend to do it. And check WDE API and samples. I bet they can provide that at least.


Enviado de meu E6633 usando Tapatalk


Offline deadmeat

  • Jr. Member
  • **
  • Posts: 75
  • Karma: -2
Re: Customizing Workspace Desktop Edition WDE
« Reply #12 on: October 18, 2017, 10:17:34 AM »
[quote author=cavagnaro link=topic=8764.msg48529#msg48529 date=1508321697]
[quote author=deadmeat link=topic=8764.msg48528#msg48528 date=1508321525]
[quote author=cavagnaro link=topic=8764.msg48527#msg48527 date=1508321144]
If you have done it in Java then convert the code with some on line tool

However, WDE will open the Web page on an external browser or will you develop a plug-in that has a Web browser on it?

If develop a plug-in then you can interact with inner Web browser via C# methods as the Web page will see the WDE as a container.

So, forget about WDE and think on what you can do with C#

Enviado de meu E6633 usando Tapatalk
[/quote]Thanks for reply,  Cavagnaro. Well I haven't done it. But I do realize how to do it via java. We don't have wde yet. Vendor has to install it. The problem is that vendor claims that it's impossible to do such trick and we doubt. As i understand wde opens additional tabs inside itself, so it doesn't call for external browser,  correct ?

Sent from my SM-G925F using Tapatalk
[/quote]WDE doesn't have such feature by default. You will or your vendor will have to develop a plug-in to either open a new tab with a browser or the plug-in (DLL) will just open a program with the URI...
Better ask them exactly how they intend to do it. And check WDE API and samples. I bet they can provide that at least.


Enviado de meu E6633 usando Tapatalk
[/quote]Understood. Thank you. I'll try to get my hands on wde development documentation.

Sent from my SM-G925F using Tapatalk