Skip to content

Commit 1de2a2a

Browse files
author
pborissow
committed
- Bug fix setting extended properties.
- Minor documentation updates. git-svn-id: svn://192.168.0.80/JavaXT/javaxt-exchange@371 2c7b0aa6-e0b2-3c4e-bb4a-8b65b6c465ff
1 parent cf2bd99 commit 1de2a2a

4 files changed

Lines changed: 29 additions & 14 deletions

File tree

src/javaxt/exchange/CalendarEvent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public CalendarEvent(javaxt.exchange.CalendarEvent event){
4848
this.categories = event.categories;
4949
this.updates = event.updates;
5050
this.lastModified = event.lastModified;
51+
this.extendedProperties = event.extendedProperties;
5152

5253
//Calendar specific information
5354
this.location = event.location;

src/javaxt/exchange/Contact.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public Contact(javaxt.exchange.Contact contact){
8181
this.categories = contact.categories;
8282
this.updates = contact.updates;
8383
this.lastModified = contact.lastModified;
84+
this.extendedProperties = contact.extendedProperties;
8485

8586
//Contact specific information
8687
this.firstName = contact.firstName;

src/javaxt/exchange/ExtendedProperty.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public ExtendedProperty(String id, String name, String type, String value){
3131
}
3232

3333

34-
3534
//**************************************************************************
3635
//** Constructor
3736
//**************************************************************************
@@ -153,4 +152,9 @@ public boolean equals(Object obj){
153152
}
154153
return false;
155154
}
155+
156+
/** Creates a copy of this object. */
157+
public ExtendedProperty clone(){
158+
return new ExtendedProperty(id, name, type, value);
159+
}
156160
}

src/javaxt/exchange/FolderItem.java

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ public class FolderItem {
6060
protected String bodyType;
6161
protected java.util.HashSet<String> categories = new java.util.HashSet<String>();
6262
protected javaxt.utils.Date lastModified;
63-
64-
private java.util.HashMap<String, ExtendedProperty> extendedProperties =
63+
protected java.util.HashMap<String, ExtendedProperty> extendedProperties =
6564
new java.util.HashMap<String, ExtendedProperty>();
6665

6766
/** Hashmap with a list of any pending updates to be made to this item. */
@@ -492,13 +491,16 @@ public void removeCategories(){
492491
categories.clear();
493492
}
494493

495-
494+
495+
public ExtendedProperty getExtendedProperty(String name){
496+
return extendedProperties.get(name);
497+
}
496498

497499

498500
//**************************************************************************
499501
//** getExtendedProperties
500502
//**************************************************************************
501-
/** Returns an array of ExtendedProperties associated with this contact.
503+
/** Returns an array of ExtendedProperties associated with this item.
502504
*/
503505
public ExtendedProperty[] getExtendedProperties(){
504506

@@ -518,7 +520,7 @@ public ExtendedProperty[] getExtendedProperties(){
518520
//**************************************************************************
519521
//** setExtendedProperties
520522
//**************************************************************************
521-
/** Used to add phone numbers to a contact.
523+
/** Bulk update of the ExtendedProperties associated with this item.
522524
*/
523525
public void setExtendedProperties(ExtendedProperty[] extendedProperties) {
524526

@@ -550,19 +552,18 @@ public void setExtendedProperties(ExtendedProperty[] extendedProperties) {
550552
else {
551553
this.extendedProperties.clear();
552554
for (ExtendedProperty property : extendedProperties){
553-
addExtendedProperty(property);
555+
setExtendedProperty(property);
554556
}
555557
}
556558
}
557559

558560

559-
560561
//**************************************************************************
561-
//** addExtendedProperty
562+
//** setExtendedProperty
562563
//**************************************************************************
563-
/** Used to associate a phone number with this contact.
564+
/** Used to add or update an ExtendedProperty associated with this item.
564565
*/
565-
public void addExtendedProperty(ExtendedProperty property){
566+
public void setExtendedProperty(ExtendedProperty property){
566567

567568
//Check whether this is a new property
568569
boolean update = false;
@@ -595,11 +596,11 @@ public void addExtendedProperty(ExtendedProperty property){
595596
}
596597

597598

598-
599599
//**************************************************************************
600600
//** removeExtendedProperty
601601
//**************************************************************************
602-
602+
/** Used to remove a specific ExtendedProperty associated with this item.
603+
*/
603604
public void removeExtendedProperty(ExtendedProperty property){
604605

605606
String name = property.getName();
@@ -615,10 +616,12 @@ public void removeExtendedProperty(ExtendedProperty property){
615616
}
616617
}
617618

619+
618620
//**************************************************************************
619621
//** removeExtendedProperties
620622
//**************************************************************************
621-
623+
/** Removes all ExtendedProperties associated with this item.
624+
*/
622625
public void removeExtendedProperties(){
623626
ExtendedProperty[] extendedProperties = getExtendedProperties();
624627
if (extendedProperties!=null){
@@ -629,6 +632,12 @@ public void removeExtendedProperties(){
629632
}
630633

631634

635+
//**************************************************************************
636+
//** getExtendedPropertyUpdates
637+
//**************************************************************************
638+
/** Used to generate an XML fragment used to update or delete
639+
* ExtendedProperties.
640+
*/
632641
private String getExtendedPropertyUpdates(){
633642

634643
if (extendedProperties.isEmpty()) return "";

0 commit comments

Comments
 (0)