How can I get appointment list from zimlet?

Interested in talking about Mash-up's? This is the place.
14319KevinH
Ambassador
Ambassador
Posts: 4558
Joined: Fri Sep 12, 2014 9:52 pm

How can I get appointment list from zimlet?

Post by 14319KevinH »

[quote user="dijichi2"]8080 is often blocked by overzealous isp's and it departments as it's the defacto proxy port and often used for nefarious means, including open proxies. i must say putting cvs on there is a strange thing to do.[/QUOTE]
CVS itself is on a the standard CVS port. 8080 is just the web based view of CVS, so not critical to getting at the CVS data. Time to complain to your network admin ;).
Kenji
Posts: 17
Joined: Fri Sep 12, 2014 10:12 pm

How can I get appointment list from zimlet?

Post by Kenji »

I watched data.js to know how to get appointment list.

But I couldn't understand how to use... :(
Can "_newApptListener" function in data.js get calendar controller to get appointment list?
Com_Zimbra_Date.prototype._newApptListener =

function() {

var cc = this._appCtxt.getApp(ZmZimbraMail.CALENDAR_APP).getCalController();

// TODO support ev

cc.newAppointmentHelper(Com_Zimbra_Date._actionContext.date, null, null/*. ev.shiftKey */);

};
It is my source as follows.
---------------------------------------------------------
Com_Zimbra_SForce.prototype.singleClicked = function() {

alert('singleClicked start');
Com_Zimbra_SForce._newApptListener();
alert('singleClicked end');

};
Com_Zimbra_SForce.prototype._newApptListener =

function() {

var cc = this._appCtxt.getApp(ZmZimbraMail.CALENDAR_APP).getCalController();

// TODO support ev

cc.newAppointmentHelper(Com_Zimbra_Date._actionContext.date, null, null/*. ev.shiftKey */);

};
---------------------------------------------
The error occurred by the "var cc = this._appCtxt.getApp..." line.
any ideas?
Thanks&Regards
14319KevinH
Ambassador
Ambassador
Posts: 4558
Joined: Fri Sep 12, 2014 9:52 pm

How can I get appointment list from zimlet?

Post by 14319KevinH »

It's DATE.js not DATA.js right? Just want to be 100% sure your looking at the right file.
What is the exact error your getting from your JavaScript console?
Kenji
Posts: 17
Joined: Fri Sep 12, 2014 10:12 pm

How can I get appointment list from zimlet?

Post by Kenji »

I mistaked.

It is date.js.
I modified my source.
---------------------------------------------------------

/// Called by the Zimbra framework when the SForce panel item was clicked

Com_Zimbra_SForce.prototype.singleClicked = function() {

alert('singleClicked start');
//Com_Zimbra_SForce.prototype._newApptListener();
var cc = this._appCtxt.getApp(ZmZimbraMail.CALENDAR_APP).getCalController();

// TODO support ev

cc.newAppointmentHelper(Com_Zimbra_SForce._actionContext.date, null, null/*. ev.shiftKey */)
alert('singleClicked end');

};
---------------------------------------------------------
JavaScript Console show me error that is "Com_Zimbra_SForce._actionContext has no properties."
Kenji
Posts: 17
Joined: Fri Sep 12, 2014 10:12 pm

How can I get appointment list from zimlet?

Post by Kenji »

I create com_zimbra_date by using date.js.
The same error occur.
Please watche this zimlet.
com_zimbra_date.zip
14319KevinH
Ambassador
Ambassador
Posts: 4558
Joined: Fri Sep 12, 2014 9:52 pm

How can I get appointment list from zimlet?

Post by 14319KevinH »

Well you need to pass in the actual date. That function assumes you are hovering over a date, but your use case may be different.
Kenji
Posts: 17
Joined: Fri Sep 12, 2014 10:12 pm

How can I get appointment list from zimlet?

Post by Kenji »

Hello KevinH.
You said following message.
[quote user="14319KevinH"]

If you already in a Zimlet then you can use the native JS calls rather than trying to make another SOAP call. Take a look at the date zimlet. date.js it has code to get a handle to the calendar controller and get various lists of appointments.[/QUOTE]
What should I do?
Could you tell me about it?
14319KevinH
Ambassador
Ambassador
Posts: 4558
Joined: Fri Sep 12, 2014 9:52 pm

How can I get appointment list from zimlet?

Post by 14319KevinH »

Kenji, The code is above. You need to pass in a valid date. The error you are getting is pretty clear the value you are passing in is null or has no value. You need to pass in a valid date object.
Kenji
Posts: 17
Joined: Fri Sep 12, 2014 10:12 pm

How can I get appointment list from zimlet?

Post by Kenji »

Finally, I could got appointment list!!!
Thanks KevinH
krystian
Posts: 4
Joined: Fri Sep 12, 2014 11:27 pm

How can I get appointment list from zimlet?

Post by krystian »

Kenji,
Care to post the code that you came up with? I'm also learning zimbra and would love to see how you achieved this and how your code was refined.
-krystian
Post Reply