Live Support, Chat, Upload Control and Rich Text Editor
Welcome to Support forums Sign in | Join | Help |Client Center
in Search

Display same contact list for all users

Last post 09-19-2007, 9:20 AM by MRazvan. 19 replies.
Sort Posts: Previous Next
  •  07-23-2007, 8:42 AM 31778

    Display same contact list for all users

    I am currently evaluating Web Messenger for purchase of a developer license.

    In our scenario, we don't want to allow users to control their contact list. We simply want their contact list to show ALL users who are currently registered.  We want to take away the option to Add a Contact, since their list will already have everyone. We would like to leave the option to block users.

    I realize I can manually edit the CuteChatRelation table in SQL Server to alter the contact list, but this really isn't ideal. Since having N # of users would result in N * (N-1) # of records in that table (200 users would require 39,800 entries). Also, if a 201st users was added, we would have to make a huge change to the table.. adding the new user to 200 existing users, as well as another 200 updates to add all existing to the new user (sounds complicated? it is!)...

    Instead, is it possible to simply edit the query that populates the contact list? Rather than querying the CuteChatRelation table, I would simply like to query the CuteChatUser table to select all users.

    Last, is it possible to remove the Add Contact link from the main interface when running as stand-alone AND embedded?  Also, the Contact Menu (in the File - Contacts - View - Help menu bar) will also need to be removed when running in stand-alone mode. Possible?

    Thanks...

    JM

  •  07-23-2007, 2:22 PM 31794 in reply to 31778

    Re: Display same contact list for all users

    Wow.. I have already sent two emails to support (one was last Wednesday).. and I STILL have not received a response to my question. I certainly don't mean to bad mouth anyone... but is this the kind of support we can expect even after dropping $2,000 on the application?

    I was able to figure out how to remove the "Add Contact" link.. but am still unable to find out how to alter the query that actually retrieves the contacts.

  •  07-23-2007, 3:27 PM 31810 in reply to 31778

    Re: Display same contact list for all users

    JM07,

    In web messenger there is a function Chat_OpenContact which allows you send users directly to the im_chatform.aspx page.

    For examples: 

    <script src="CuteSoft_Client/CuteChat/IntegrationUtility.js.aspx"></script>

    Users

    <a href="#" onclick="Chat_OpenContact('IE')"><img src="CuteSoft_Client/CuteChat/Images/avatar.gif">UniqueName=IE</a>
    <a href="#" onclick="Chat_OpenContact('Netscape')"><img src="CuteSoft_Client/CuteChat/Images/avatar.gif">UniqueName=Netscape</a 

    This thread is discussing the same issue:

     
    Is that what are looking for?
     

     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  07-23-2007, 4:02 PM 31811 in reply to 31810

    Re: Display same contact list for all users

    Please correct me if I'm wrong.. but I don't think this is what I'm looking for.

    When the user logs in to Web Messenger, they see a list of their online/offline contacts. Normally a user has to add contacts for them to appear in their list.

    - I have removed all "Add Contact" links. The user can no longer control their own list.

    - Now I want all users to see the same list. For instance, if I put this web messenger in a school's website, and only teachers can use it.. I want every teacher to see a list of ALL other teachers in their contact list.  I do not want to force the teacher to click "Add Contact" and search for 100 or 200 other teachers.

    The contact list seems to be stored in the CuteChatRelation table in SQL server.  I know I can programmatically alter that table every time a new user registers, but that is WAY too much overhead.

    Instead, I am looking to change the query that populates a user's contact list.

    Right now, I assume the program queries CuteChatRelation and returns everyone who is in a "FRIEND" Relationship Type. Instead, I want to make it return all users.

    So far, this may be the only thing keeping us from purchasing Cute Messenger. We simply cannot require each user to manually add 100 or more people to their contact list.

  •  07-23-2007, 4:09 PM 31813 in reply to 31811

    Re: Display same contact list for all users

    >>Right now, I assume the program queries CuteChatRelation and returns everyone who is in a "FRIEND" Relationship Type. Instead, I want to make it return all users.
     
    Yes.
     
    >>Instead, I am looking to change the query that populates a user's contact list.
     
    What kind of changes do you want to make? Can you give me an example?
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  07-24-2007, 9:09 AM 31826 in reply to 31813

    Re: Display same contact list for all users

    I really don't know how to make my request any more clear.

    Instead of querying the CuteChatRelation table and returnign everyone who is in a "FRIEND" Relationship Type, I want it to query the CuteChatUser table and return EVERYONE.


    For example.. let's say I'm running this messenger in my office for employee usage. You are a new employee... the first time you sign on, I want you to automatically see a list of ALL employees in your contacts. I don't want you to have to know the names of 100 other employees to manually add them to your list.

    I have been given approval to purchase the developer license of Web Messenger... it's a better product than everything I have tested, but this is the one thing holding me back right now. I simply cannot make every user start with a blank contact list.

  •  07-24-2007, 4:56 PM 31837 in reply to 31826

    Re: Display same contact list for all users

    JM07:


    For example.. let's say I'm running this messenger in my office for employee usage. You are a new employee... the first time you sign on, I want you to automatically see a list of ALL employees in your contacts. I don't want you to have to know the names of 100 other employees to manually add them to your list.

    I have been given approval to purchase the developer license of Web Messenger... it's a better product than everything I have tested, but this is the one thing holding me back right now. I simply cannot make every user start with a blank contact list.

     
    Please follow the steps below:
     
    1. Open IM_MainForm.aspx and create a JavaScript Array when the page loads.
     
    Populate this array with user name data based on your requirements.
     
    2. Open CuteSoft_Client\CuteChat\ChatUI_IMMain.xml and find the following code:
     
    var contacts=GetContactArrary();
     
    Replace it with your own contact array.
     
    It should resolve the problems.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  07-25-2007, 8:26 PM 31898 in reply to 31837

    Re: Display same contact list for all users

    Should work in theory.. but will take some research to populate a javascript array with data from the database since javascript itself cannot connect to the database...

    Not sure what will happen if I try to use ASP to write out the javascript code, but will give it a shot...

    Thanks Adam.

  •  07-26-2007, 3:24 AM 31903 in reply to 31898

    Re: Display same contact list for all users

    JM07:
    Should work in theory.. but will take some research to populate a javascript array with data from the database since javascript itself cannot connect to the database...

    Not sure what will happen if I try to use ASP to write out the javascript code, but will give it a shot...

    Thanks Adam.

     
    Do something like this:
     
     
    string[] names = {"Adam","Terry","Jacob"};
    string nameString = String.Join(";",names);
     
     
    <script>
       var js_nameString = "<%= nameString %>";
       var my_array=where_is_mytool.split(";");
    </script>

     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  07-31-2007, 9:34 AM 32034 in reply to 31903

    Re: Display same contact list for all users

    Adam.. pardon my ignorance. I'm not a javascript guru by any means.
     
    In the IM_MainForm.aspx... if I create the javascript array of names when the pages loads....
     
    .. then how am I supposed to call that array in the ChatUI_IMMain.xml file instead of the GetContactArray() function?
     
     
    Example.. let's say I created an array called CustomContactsArray in the IM_MainForm.aspx when the page loads.
     
    Then, fom the ChatUI_IMMain.xml:

    var contacts=GetContactArrary();

    How am I supposed to make that: var contacts=CustomContactsArray();
     
  •  07-31-2007, 10:52 AM 32040 in reply to 32034

    Re: Display same contact list for all users

    var contacts=CustomContactsArray;
     
    var contacts =new Array("Denis","Terry","Adam");

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  07-31-2007, 3:04 PM 32050 in reply to 31903

    Re: Display same contact list for all users

    Adam:
     
    Do something like this:
     
     
    string[] names = {"Adam","Terry","Jacob"};
    string nameString = String.Join(";",names);
     
     
    <script>
       var js_nameString = <%= nameString %>
       var my_array=where_is_mytool.split(";");
    </script>

     


    This doesn't seem to work. If what you posted above is valid, then this should also work (but it doesn't):

    <script runat="server">
             string TestString = "This is a test string";
    </script>

    <script>
            var js_TestString = <% =TestString %>;
            alert(js_TestString);
    </script>


    The second script cannot recognize TestString created by the first script. This is becoming a real pain. It is the only reason we have not already purchased the Messenger. We have it completely integrated in our site and ready to go, but this contact list issue is holding us back.
  •  07-31-2007, 3:09 PM 32051 in reply to 32050

    Re: Display same contact list for all users

    Sorry.
     
    It should be:
     
       var js_nameString = "<%= nameString %>";
     
    Instead of:
     
       var js_nameString = <%= nameString %>;
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  07-31-2007, 3:16 PM 32052 in reply to 32050

    Re: Display same contact list for all users

    Also, I went to the ChatUI_IMMain.xml and found the line that says:

    var contacts=GetContactArrary();

    I removed it, and replaced it with:
    var contacts = new Array("Denis","Terry","Adam");

    I did this simply as a test.. and it does not work.  I made sure Denis, Terry & Scott were in the CuteChatUser table.

    This is the error I receive when I try to launch the messenger:



  •  07-31-2007, 3:28 PM 32054 in reply to 32052

    Re: Display same contact list for all users

    Thanks for your last post. I should not have overlooked the quote marks myself...


    I'm trying to put this in the IM_MainForm.aspx as a test, and it produces an error. Suggestions?

    <script runat="server">
        string[] ContactsArray = { "Mike", "Scott", "John" };
        string nameString = String.Join(";", ContactsArray);
    </script>
    <script>
         var js_nameString = "<%= nameString %>";
         var my_array=js_nameString.split(";");
    </script>

    Error:

    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: CS0236: A field initializer cannot reference the nonstatic field, method, or property 'ASP.cutesoft_client_cutechat_im_mainform_aspx.ContactsArray'

    Source Error:


    Line 4:  <script runat="server">
    Line 5: string[] ContactsArray = { "Mike", "Scott", "John" };
    Line 6: string nameString = String.Join(";", ContactsArray);
    Line 7: </script>
    Line 8: <script>

    Source File: c:\JMDev\vRIS\CuteSoft_Client\CuteChat\IM_MainForm.aspx    Line: 6




  •  07-31-2007, 3:44 PM 32055 in reply to 32052

    Re: Display same contact list for all users

    JM07:
    Also, I went to the ChatUI_IMMain.xml and found the line that says:

    var contacts=GetContactArrary();

    I removed it, and replaced it with:
    var contacts = new Array("Denis","Terry","Adam");

    I did this simply as a test.. and it does not work.  I made sure Denis, Terry & Scott were in the CuteChatUser table.

    This is the error I receive when I try to launch the messenger:




    Sort of answered my own question... the var contacts=GetContactArrary() statement doesn't return an actual string array of user id's... it returns an array of contact objects it seems. That being said, I don't see how I could create my own array as you have suggested in the above posts.....

  •  07-31-2007, 3:50 PM 32056 in reply to 32054

    Re: Display same contact list for all users

    It should be:
     
    <script runat="server">
     void Page_Load(object sender, System.EventArgs e)
     { 
         string[] names = {"Adam","Terry","Jacob"};
        string nameString = String.Join(";",names); 
     }
    </script>
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  07-31-2007, 4:05 PM 32057 in reply to 32056

    Re: Display same contact list for all users

    Adam:
    It should be:
     
    <script runat="server">
     void Page_Load(object sender, System.EventArgs e)
     { 
         string[] names = {"Adam","Terry","Jacob"};
        string nameString = String.Join(";",names); 
     }
    </script>
     
     


    Pleas see my last post above yours. Even with a string of names, it doesn't seem to work since all of the code in the xml file works on what seems like an array of objects (determining whether they are online/offline and adding them to the list, etc)....


  •  08-01-2007, 10:46 AM 32083 in reply to 32057

    Re: Display same contact list for all users

    Any other suggestions, Adam? I'm having 0 luck with this. :(



  •  09-19-2007, 9:20 AM 33624 in reply to 32083

    Re: Display same contact list for all users

    Dear JM07,
    I have meet similar issue aswell as you did and since no reply in this forum to any of my questions i have investigate more deeper the code of CuteSoft. Here is an example of what you could give instead of that ContactsArray thingy from ChatUI_IMMain.xml
     
    Create a property similary to this:

    public string ContactsArray

    {

    get

    {

    EntityCollection collection = GetUsersOfSameTherapy(Guid.Empty);

    string usrList = "";

    foreach (UserEntity user in collection)

    {

    CuteChatUser chatUsr = GetChatUser(user.ID);

    bool isOperator = false;

    CuteSupportOperator supportOperator = ChatApi.FindOperator(chatUsr.UniqueName);

    if (supportOperator != null)

    isOperator = true;

    bool isOnline = ChatApi.IsUserInstantOnline(chatUsr.UniqueName);

    string status = "OFFLINE";

    if (isOnline)

    status = "ONLINE";

    usrList += @"{'IsOperator': " + isOperator.ToString().ToLower() + @", 'RelationType': 'FRIEND', 'UserId': " + chatUsr.UserId + @", 'OnlineStatus': '" + status + @"', 'DisplayName': '" + chatUsr.DisplayName + @"'},";

    }

    usrList = usrList.Remove(usrList.Length - 1);

    return usrList;

    }

    }
     
    Then in javascript on the embed messenger or wherever set a variable that will get this string for ex:
    var myTest = new Array( <%# ContactsArray %>);
     
    And then all you have to do is give this variable further into the xml file.
     
    Good luck. And i really hope this forum can sometime give answers to more complex questions aswell.
View as RSS news feed in XML
Powered by ASP.Net
Copyright 2003 - 2017 CuteSoft Components Inc.. All rights reserved.