Home

Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Shared Address Book

  1. #1
    Join Date
    Apr 2009
    Posts
    37

    Shared Address Book

    Hi,

    How do I create a shared address book via GWWS?

    Regards,
    Sike

  2. #2
    Preston Stephenson NNTP User

    Re: Shared Address Book

    Here is some test code:
    public void testCreateSharedAB() {
    AccessControlListEntry[] acle = new AccessControlListEntry[3];
    AccessControlList acl = new AccessControlList( acle );
    CreateItemResponse resp = null;
    SharedBook book = new SharedBook();
    SharedFolderNotification sfn = new SharedFolderNotification();
    Rights rights = new Rights();
    Rights all = new Rights();

    sfn.setSubject( "Sharing: MyBook" );
    sfn.setMessage( "sharing this book" );
    rights.setRead( true );
    acle[0] = new AccessControlListEntry();
    acle[0].setDisplayName( "Jay Parker" );
    acle[0].setEmail( "jparker@prestons.provo.novell.com" );
    acle[0].setUuid( "C974CA00-0B55-0000-B976-8E90E5B002BD" );
    acle[0].setRights( rights );

    acle[1] = new AccessControlListEntry();
    acle[1].setDisplayName( "Craig Johnson" );
    acle[1].setEmail( "cjohnson@prestons.provo.novell.com" );
    acle[1].setUuid( "AD712880-0B55-0000-B976-8E90E5B002BD" );
    acle[1].setRights( rights );

    acle[2] = new AccessControlListEntry();
    acle[2].setDisplayName( "Bob Goodman" );
    acle[2].setEmail( "rgoodman@prestons.provo.novell.com" );
    acle[2].setUuid( "A15E8230-0110-0000-87A9-F2F2F4BB96F7" );
    all.setRead( true );
    all.setEdit( true );
    acle[2].setRights( all );

    book.setName( "MyBook" );
    book.setAcl( acl );
    try {
    resp = m_main.getService().createItemRequest( book, sfn,
    m_main.getSessionId(), m_main.getTrace() );
    } catch ( Exception e ) {
    e.printStackTrace();
    }
    }

    You have use 8.0.0 at least. I don't remember if you need
    8.0.1.

    Preston

    >>> On Friday, June 05, 2009 at 3:16 AM,

    huangsike<huangsike@no-mx.forums.novell.com> wrote:

    > Hi,
    >
    > How do I create a shared address book via GWWS?
    >
    > Regards,
    > Sike


  3. #3
    Join Date
    Apr 2009
    Posts
    37

    Re: Shared Address Book

    Where does this "SharedBook" come from?

    There is NO such class in gwws.jar in novell-gwsoap-devel-2008.12.23-1cross_platform.zip


    Regards,
    Sike

  4. #4
    Join Date
    Apr 2009
    Posts
    37

    Re: Shared Address Book

    I think I should also elaborate my question:

    How do I create an address book, create/add contacts into it, and share it with other users via GWWS?


    Regards,
    Sike

  5. #5
    Preston Stephenson NNTP User

    Re: Shared Address Book

    It is in \Novell\novell-gwsoap-devel-2008.12.23-1cross_platform\WSDL and
    schemas\GW8\types.xsd

    >>> On Friday, June 05, 2009 at 8:06 AM,

    huangsike<huangsike@no-mx.forums.novell.com> wrote:

    > Where does this "SharedBook" come from?
    >
    > There is NO such class in gwws.jar in
    > novell‑gwsoap‑devel‑2008.12.23‑1cross_plat form.zip
    >
    >
    > Regards,
    > Sike


  6. #6
    Preston Stephenson NNTP User

    Re: Shared Address Book

    The example I posted shows giving three users rights to the
    book. The first two users only have read rights. The third
    user has read and write rights.
    Once you have the id of the book, you can put / create items
    in the book (if you have edit rights). The three uses will
    receive a shared address book notification message. Once
    they accept the notification, they can access the book.

    Preston

    >>> On Friday, June 05, 2009 at 8:46 AM,

    huangsike<huangsike@no-mx.forums.novell.com> wrote:

    > I think I should also elaborate my question:
    >
    > How do I create an address book, create/add contacts into it, and share
    > it with other users via GWWS?
    >
    >
    > Regards,
    > Sike


  7. #7
    Join Date
    Apr 2009
    Posts
    37

    Re: Shared Address Book

    Hi, Preston, I followed your step, created a SharedBook via user1 and set and ACL entry to be user2 in the demo server, but I couldn't see any notification message in GW client for both users.

    Code:
    SharedFolderNotification sharedFolderNotification = new SharedFolderNotification();                                                                       
    sharedFolderNotification.setSubject("Sharing: MyBook");                                                                                                   
    sharedFolderNotification.setMessage("sharing this book");                                                                                                 
                                                                                                                                                              
    Rights all = new Rights();                                                                                                                                
    all.setRead(true);                                                                                                                                        
    all.setEdit(true);                                                                                                                                        
                                                                                                                                                              
    Filter filter = new Filter();                                                                                                                             
    FilterEntry filterEntry = new FilterEntry();                                                                                                              
    filterEntry.setOp(FilterOp.eq);                                                                                                                           
    filterEntry.setField("username");                                                                                                                         
    filterEntry.setValue("user2");                                                                                                                            
    filter.setElement(filterEntry);                                                                                                                           
    GetItemsResponse getItemResponse = gwService.getItemsRequest("GroupWiseSystemAddressBook@52", null, filter, null, 500, loginResponse.getSession(), false);
    Item[] items = getItemResponse.getItems().getItem();                                                                                                      
    Contact contact = (Contact) items[0];                                                                                                                     
                                                                                                                                                              
    AccessControlListEntry accessControlListEntry = new AccessControlListEntry();                                                                             
    accessControlListEntry.setDisplayName(contact.getFullName().getDisplayName());                                                                            
    accessControlListEntry.setEmail(contact.getEmailList().getPrimary());                                                                                     
    accessControlListEntry.setUuid(contact.getUuid());                                                                                                        
    accessControlListEntry.setRights(all);                                                                                                                    
                                                                                                                                                              
    SharedBook book = new SharedBook();                                                                                                                       
    book.setName("MyBook");                                                                                                                                   
    AccessControlList accessControlList = new AccessControlList();                                                                                            
    accessControlList.setEntry(new AccessControlListEntry[]{accessControlListEntry});                                                                         
    book.setAcl(accessControlList);                                                                                                                           
    CreateItemResponse response = gwService.createItemRequest(book, sharedFolderNotification, loginResponse.getSession(), false);

    Regards,
    Sike

  8. #8
    Preston Stephenson NNTP User

    Re: Shared Address Book

    The notification message doesn't go to the owner.
    Are you saying user2 didn't receive a notification
    message?

    >>> On Monday, June 08, 2009 at 3:46 AM,

    huangsike<huangsike@no-mx.forums.novell.com> wrote:

    > Hi, Preston, I followed your step, created a SharedBook via user1 and
    > set and ACL entry to be user2 in the demo server, but I couldn't see any
    > notification message in GW client for both users.
    >
    >
    > Code:
    > ‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑ ‑‑‑
    >
    > SharedFolderNotification sharedFolderNotification = new
    > SharedFolderNotification();


    >
    > sharedFolderNotification.setSubject("Sharing: MyBook");


    >


    >
    > sharedFolderNotification.setMessage("sharing this book");


    >


    >
    >
    > Rights all = new Rights();


    >


    >
    > all.setRead(true);


    >


    >
    > all.setEdit(true);


    >


    >
    >
    > Filter filter = new Filter();


    >


    >
    > FilterEntry filterEntry = new FilterEntry();


    >


    >
    > filterEntry.setOp(FilterOp.eq);


    >


    >
    > filterEntry.setField("username");


    >


    >
    > filterEntry.setValue("user2");


    >


    >
    > filter.setElement(filterEntry);


    >


    >
    > GetItemsResponse getItemResponse =
    > gwService.getItemsRequest("GroupWiseSystemAddressB ook@52", null, filter,
    > null, 500, loginResponse.getSession(), false);
    > Item[] items = getItemResponse.getItems().getItem();


    >


    >
    > Contact contact = (Contact) items[0];


    >


    >
    >
    > AccessControlListEntry accessControlListEntry = new
    > AccessControlListEntry();


    >
    >
    >

    accessControlListEntry.setDisplayName(contact.getF ullName().getDisplayName()
    )
    > ;


    > accessControlListEntry.setEmail(contact.getEmailLi st().getPrimary());


    >


    >
    > accessControlListEntry.setUuid(contact.getUuid());


    >


    >
    > accessControlListEntry.setRights(all);


    >


    >
    >
    > SharedBook book = new SharedBook();


    >


    >
    > book.setName("MyBook");


    >


    >
    > AccessControlList accessControlList = new AccessControlList();


    >


    >
    > accessControlList.setEntry(new
    > AccessControlListEntry[]{accessControlListEntry});


    >
    > book.setAcl(accessControlList);


    >


    >
    > CreateItemResponse response = gwService.createItemRequest(book,
    > sharedFolderNotification, loginResponse.getSession(), false);


    >
    >
    > ‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑ ‑‑‑
    >
    >
    >
    > Regards,
    > Sike


  9. #9
    Join Date
    Apr 2009
    Posts
    37

    Re: Shared Address Book

    User2 has no notification message.

    I can't find this shared address book in GW client for user1 and user2, even though gwService.createItemRequest successfully returns the id.


    Regards,
    Sike

  10. #10
    Preston Stephenson NNTP User

    Re: Shared Address Book

    Can you send the SOAP trace of the create of the
    SharedBook?

    >>> On Monday, June 08, 2009 at 5:16 AM,

    huangsike<huangsike@no-mx.forums.novell.com> wrote:

    > User2 has no notification message.
    >
    > I can't find this shared address book in GW client for user1 and user2,
    > even though gwService.createItemRequest successfully returns the id.
    >
    >
    > Regards,
    > Sike


Page 1 of 2 12 LastLast

Posting Permissions

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