Hi Folks,
If any one has a working calendar with datasource attached can you please post the source code here ?
I am using this class which extends RestDataSource to set the datasource for calendar but the event is not displaying on the calendar.
The below line calls UserActivityXmlDs class(pasted below)
UserActivityXmlDS usrActivityDs = UserActivityXmlDS.getInstance();
Calendar calendar = new Calendar();
calendar.setDataSource(usrActivityDs);
UserActivityXmlDs class
DataSource eventDs = new DataSource();
DataSourceSequenceField eventIdField = new DataSourceSequenceField("eventId");
eventIdField.setPrimaryKey(true);
DataSourceTextField eventName = new DataSourceTextField("eventname", "Name");
eventName.setRequired(true);
DataSourceTextField jid = new DataSourceTextField("jid", "JID");
jid.setPrimaryKey(true);
jid.setRequired(true);
DataSourceDateTimeField from = new DataSourceDateTimeField("startevent", "From");
from.setPrimaryKey(true);
from.setRequired(true);
DataSourceDateTimeField to = new DataSourceDateTimeField("endevent", "To");
to.setPrimaryKey(true);
to.setRequired(true);
DataSourceTextField description = new DataSourceTextField("description", "Description");
description.setRequired(true);
DataSourceTextField activityType = new DataSourceTextField("activitytype", "Activity Type");
activityType.setRequired(true);
eventDs.setFields(eventIdField,eventName,jid,from,to,description, activityType);
eventDs.setClientOnly(true);
OperationBinding fetch = new OperationBinding();
fetch.setOperationType(DSOperationType.FETCH);
fetch.setDataProtocol(DSProtocol.POSTMESSAGE);
setFetchDataURL("/test/controller/Activity");
OperationBinding add = new OperationBinding();
add.setOperationType(DSOperationType.ADD);
add.setDataProtocol(DSProtocol.POSTMESSAGE);
setAddDataURL("/test/controller/Activity/add");
eventDs.setOperationBindings(fetch,add);
I am able to see the HQL call and the Response on the above fetch URL, but the event is not visible on the Calendar, can someone point out if i am missing anything ?
If any one has a working calendar with datasource attached can you please post the source code here ?
I am using this class which extends RestDataSource to set the datasource for calendar but the event is not displaying on the calendar.
The below line calls UserActivityXmlDs class(pasted below)
UserActivityXmlDS usrActivityDs = UserActivityXmlDS.getInstance();
Calendar calendar = new Calendar();
calendar.setDataSource(usrActivityDs);
UserActivityXmlDs class
DataSource eventDs = new DataSource();
DataSourceSequenceField eventIdField = new DataSourceSequenceField("eventId");
eventIdField.setPrimaryKey(true);
DataSourceTextField eventName = new DataSourceTextField("eventname", "Name");
eventName.setRequired(true);
DataSourceTextField jid = new DataSourceTextField("jid", "JID");
jid.setPrimaryKey(true);
jid.setRequired(true);
DataSourceDateTimeField from = new DataSourceDateTimeField("startevent", "From");
from.setPrimaryKey(true);
from.setRequired(true);
DataSourceDateTimeField to = new DataSourceDateTimeField("endevent", "To");
to.setPrimaryKey(true);
to.setRequired(true);
DataSourceTextField description = new DataSourceTextField("description", "Description");
description.setRequired(true);
DataSourceTextField activityType = new DataSourceTextField("activitytype", "Activity Type");
activityType.setRequired(true);
eventDs.setFields(eventIdField,eventName,jid,from,to,description, activityType);
eventDs.setClientOnly(true);
OperationBinding fetch = new OperationBinding();
fetch.setOperationType(DSOperationType.FETCH);
fetch.setDataProtocol(DSProtocol.POSTMESSAGE);
setFetchDataURL("/test/controller/Activity");
OperationBinding add = new OperationBinding();
add.setOperationType(DSOperationType.ADD);
add.setDataProtocol(DSProtocol.POSTMESSAGE);
setAddDataURL("/test/controller/Activity/add");
eventDs.setOperationBindings(fetch,add);
I am able to see the HQL call and the Response on the above fetch URL, but the event is not visible on the Calendar, can someone point out if i am missing anything ?
Comment