Results 1 to 8 of 8

Thread: Opening new message dialog from Zimlet

  1. #1
    gil.fernandes is offline Intermediate Member
    Join Date
    Nov 2007
    Posts
    17
    Rep Power
    7

    Default Opening new message dialog from Zimlet

    Hello,

    I have been working on an Alfresco browsing Zimlet and I wanted to programmatically open a new message dialog from a Zimlet. So I do not want to send an email via SOAP, just to open the new message dialog programmatically. Does anyone know, if this is possible, and if yes, how can you do it?

    The other thing, I wanted to ask is: is it possible to detect that the new message dialog is already open from a Zimlet dialog? Any hints on how to do are really most welcome.

    Best regards,

    Gil

  2. #2
    gil.fernandes is offline Intermediate Member
    Join Date
    Nov 2007
    Posts
    17
    Rep Power
    7

    Default

    Hello,

    I found out how to open the compose mail folder from a Zimlet. Here is the piece of code that does the job for me:

    Code:
    // Tries to open the compose view on its own.
    var composeController = AjxDispatcher.run("GetComposeController");
    if(composeController) {
    	var appCtxt = window.top.appCtxt;
    	var zmApp = appCtxt.getApp();
    	var newWindow = zmApp != null ? (zmApp._inNewWindow ? true : false) : true;
    	var params = {action:ZmOperation.NEW_MESSAGE, inNewWindow:newWindow, 
    	toOverride:null, subjOverride:null, extraBodyText:null, callback:null}
    	composeController.doAction(params); // opens asynchronously the window.
    	this.displayStatusMessage("Trying to open a new message dialog. Please wait ...");
    }
    It was not a piece of cake to discover this !

    Best regards,

    Gil

  3. #3
    leocor is offline Active Member
    Join Date
    Jul 2009
    Location
    Schio (VI) Italy
    Posts
    26
    Rep Power
    6

    Default

    Hello,
    what should I add to params to have a new html message instead of plain text?

    Thanks in advance,

    Leo
    p.s. where can I see the parameters and all API. I'm confused. I can just create zimlets joining and glueing different snippets I find on the forum: I feel not very professional

  4. #4
    leocor is offline Active Member
    Join Date
    Jul 2009
    Location
    Schio (VI) Italy
    Posts
    26
    Rep Power
    6

    Default param to add for html

    Hello,
    what should I add to params to have a new html message instead of plain text?

    Thanks in advance,

    Leo
    p.s. where can I see the parameters and all API. I'm confused. I can just create zimlets joining and glueing different snippets I find on the forum: I feel not very professional

  5. #5
    tdesorbaix is offline Zimlet Guru & Moderator
    Join Date
    Apr 2007
    Location
    Paris, France
    Posts
    367
    Rep Power
    8

    Default

    Quote Originally Posted by leocor View Post
    Hello,
    what should I add to params to have a new html message instead of plain text?

    Thanks in advance,

    Leo
    p.s. where can I see the parameters and all API. I'm confused. I can just create zimlets joining and glueing different snippets I find on the forum: I feel not very professional
    Look at zimbra source code .
    To always create a html message, you can add the param "composeMode" :
    Code:
    // Tries to open the compose view on its own.
    var composeController = AjxDispatcher.run("GetComposeController");
    if(composeController) {
    	var appCtxt = window.top.appCtxt;
    	var zmApp = appCtxt.getApp();
    	var newWindow = zmApp != null ? (zmApp._inNewWindow ? true : false) : true;
    	var params = {action:ZmOperation.NEW_MESSAGE, inNewWindow:newWindow, 
    	toOverride:null, subjOverride:null, extraBodyText:null, callback:null, composeMode:DwtHtmlEditor.HTML}
    	composeController.doAction(params); // opens asynchronously the window.
    	this.displayStatusMessage("Trying to open a new message dialog. Please wait ...");
    }

  6. #6
    walidferchichi is offline New Member
    Join Date
    Jul 2011
    Posts
    3
    Rep Power
    3

    Default Please Help me

    Hello,
    what should I add to params to have a new message with attach File?

    Thanks in advance,

  7. #7
    anish011 is offline Starter Member
    Join Date
    Jan 2013
    Posts
    1
    Rep Power
    2

    Default How to call service on send email butoon click in my own zimlet?

    How to call service on send email butoon click in my own zimlet? please help me.i can't find any tutorial regarding this.
    How to call service on send email butoon click in my own zimlet? please help me.i can't find any tutorial regarding this.

  8. #8
    g41n's Avatar
    g41n is offline Intermediate Member
    Join Date
    Jun 2013
    Posts
    23
    Rep Power
    2

    Default

    Quote Originally Posted by gil.fernandes View Post
    Hello,

    I found out how to open the compose mail folder from a Zimlet. Here is the piece of code that does the job for me:

    Code:
    // Tries to open the compose view on its own.
    var composeController = AjxDispatcher.run("GetComposeController");
    if(composeController) {
    	var appCtxt = window.top.appCtxt;
    	var zmApp = appCtxt.getApp();
    	var newWindow = zmApp != null ? (zmApp._inNewWindow ? true : false) : true;
    	var params = {action:ZmOperation.NEW_MESSAGE, inNewWindow:newWindow, 
    	toOverride:null, subjOverride:null, extraBodyText:null, callback:null}
    	composeController.doAction(params); // opens asynchronously the window.
    	this.displayStatusMessage("Trying to open a new message dialog. Please wait ...");
    }
    It was not a piece of cake to discover this !

    Best regards,

    Gil

    Thank you so much for sharing this.
    It's so helpful for me, and works in Zimbra 8 too...

    Thanks again
    YetOpen S.r.l. ~ Your open source partner
    Lecco (LC) - ITALY
    http://www.yetopen.it

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 21
    Last Post: 02-04-2010, 10:06 AM
  2. Outlook 2007 Beta error
    By bersrker in forum Zimbra Connector for Outlook
    Replies: 13
    Last Post: 07-17-2008, 07:38 AM
  3. Replies: 5
    Last Post: 01-11-2008, 05:34 AM
  4. need advice on configuring zimbra to work with fax server
    By pheonix1t in forum Administrators
    Replies: 0
    Last Post: 07-11-2007, 07:46 PM
  5. Post instsallation problems
    By Assaf in forum Installation
    Replies: 14
    Last Post: 01-29-2007, 11:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •