Skip to content

Commit 3595627

Browse files
author
pborissow
committed
- Added orderby param to the Folder getItems() method.
- Added ability to view, create, and delete folders. - Added ability to retrieve emails. git-svn-id: svn://192.168.0.80/JavaXT/javaxt-exchange@399 2c7b0aa6-e0b2-3c4e-bb4a-8b65b6c465ff
1 parent 8757cae commit 3595627

File tree

9 files changed

+623
-43
lines changed

9 files changed

+623
-43
lines changed

src/javaxt/exchange/CalendarEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,9 +684,9 @@ private String create(Connection conn) throws ExchangeException {
684684
msg.append("<t:CalendarItem>");
685685

686686
/*
687-
Here's is an ordered list of all the contact properties. The first set
687+
Here's is an ordered list of all the event properties. The first set
688688
is pretty generic and applies to other Exchange "Items". The second set
689-
is specific to contacts. The third set is also generic and seems to
689+
is specific to events. The third set is also generic and seems to
690690
apply to all items. WARNING -- ORDER IS VERY IMPORTANT!!! If you
691691
mess up the order of the properties, the save will fail - at least it
692692
did on my Exchange Server 2007 SP3 (8.3)

src/javaxt/exchange/CalendarFolder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public CalendarEvent[] getEvents() throws ExchangeException {
5252
private CalendarEvent[] getEvents(int numEntries, int offset) throws ExchangeException {
5353

5454
java.util.ArrayList<CalendarEvent> events = new java.util.ArrayList<CalendarEvent>();
55-
org.w3c.dom.Document xml = getItems(numEntries, offset, props);
55+
org.w3c.dom.Document xml = getItems(numEntries, offset, props, null);
5656
org.w3c.dom.Node[] nodes = javaxt.xml.DOM.getElementsByTagName("CalendarItem", xml);
5757

5858
for (org.w3c.dom.Node node : nodes){
@@ -116,7 +116,7 @@ public CalendarEvent[] getEvents(javaxt.utils.Date start, javaxt.utils.Date end)
116116
String EndDate = FolderItem.formatDate(end);
117117

118118
java.util.ArrayList<CalendarEvent> events = new java.util.ArrayList<CalendarEvent>();
119-
org.w3c.dom.Document xml = getItems("<m:CalendarView StartDate=\"" + StartDate + "\" EndDate=\"" + EndDate + "\"/>", props);
119+
org.w3c.dom.Document xml = getItems("<m:CalendarView StartDate=\"" + StartDate + "\" EndDate=\"" + EndDate + "\"/>", props, null);
120120
org.w3c.dom.Node[] nodes = javaxt.xml.DOM.getElementsByTagName("CalendarItem", xml);
121121

122122
for (org.w3c.dom.Node node : nodes){

src/javaxt/exchange/Connection.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,14 @@ private String parseError(org.w3c.dom.Document xml){
9797
for (int i=0; i<childNodes.getLength(); i++){
9898
org.w3c.dom.Node node = childNodes.item(i);
9999
String nodeName = node.getNodeName();
100+
if (nodeName.toLowerCase().endsWith("responsemessage")){
101+
/*
100102
if (nodeName.contains(":")) nodeName = nodeName.substring(nodeName.indexOf(":")+1);
101-
102-
if (nodeName.equalsIgnoreCase("CreateItemResponseMessage") ||
103+
if (nodeName.equalsIgnoreCase("FindItemResponseMessage") ||
104+
nodeName.equalsIgnoreCase("CreateItemResponseMessage") ||
103105
nodeName.equalsIgnoreCase("UpdateItemResponseMessage") ||
104106
nodeName.equalsIgnoreCase("DeleteItemResponseMessage"))
105-
{
107+
*/
106108
String responseClass = javaxt.xml.DOM.getAttributeValue(node, "ResponseClass");
107109
if (responseClass.equalsIgnoreCase("Error")){
108110

src/javaxt/exchange/ContactsFolder.java

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,31 @@
44
//** ContactFolder Class
55
//******************************************************************************
66
/**
7-
* Enter class description here
7+
* Used to represent a contact folder.
88
*
99
******************************************************************************/
1010

1111
public class ContactsFolder extends Folder {
1212

1313
private Connection conn;
1414

15+
1516
//**************************************************************************
1617
//** Constructor
1718
//**************************************************************************
18-
/** Creates a new instance of ContactFolder. */
19+
/** Creates a new instance of this class. */
1920

2021
public ContactsFolder(Connection conn) throws ExchangeException {
2122
super("contacts", conn);
2223
this.conn = conn;
2324
}
2425

25-
26+
27+
//**************************************************************************
28+
//** getContacts
29+
//**************************************************************************
30+
/** Returns an array of all contacts found in the contact folder.
31+
*/
2632
public Contact[] getContacts() throws ExchangeException {
2733

2834
java.util.ArrayList<Contact> contacts = new java.util.ArrayList<Contact>();
@@ -43,19 +49,20 @@ public Contact[] getContacts() throws ExchangeException {
4349
}
4450

4551

46-
52+
//**************************************************************************
53+
//** getContacts
54+
//**************************************************************************
55+
/** Returns an array of contacts.
56+
* @param maxEntries Maximum number of items to return.
57+
* @param offset Item offset. 0 implies no offset.
58+
*/
4759
public Contact[] getContacts(int numEntries, int offset) throws ExchangeException {
48-
4960
java.util.ArrayList<Contact> contacts = new java.util.ArrayList<Contact>();
50-
org.w3c.dom.NodeList nodes = getItems(numEntries, offset, null).getElementsByTagName("t:Contact");
51-
//org.w3c.dom.NodeList nodes = new javaxt.io.File("/temp/exchange-findItem.xml").getXML().getElementsByTagName("t:Contact");
52-
53-
int numRecordsReturned = 0;
61+
org.w3c.dom.NodeList nodes = getItems(numEntries, offset, null, null).getElementsByTagName("t:Contact");
5462
for (int i=0; i<nodes.getLength(); i++){
5563
org.w3c.dom.Node node = nodes.item(i);
5664
if (node.getNodeType()==1){
5765
contacts.add(new Contact(node));
58-
numRecordsReturned++;
5966
}
6067
}
6168
return contacts.toArray(new Contact[contacts.size()]);
@@ -65,8 +72,8 @@ public Contact[] getContacts(int numEntries, int offset) throws ExchangeExceptio
6572
//**************************************************************************
6673
//** getContact
6774
//**************************************************************************
68-
/** GetItem request */
69-
75+
/** Returns a contact associated with the given exchangeID.
76+
*/
7077
public Contact getContact(String exchangeID) throws ExchangeException {
7178
return new Contact(exchangeID, conn);
7279
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy