org.opengroupware.jogi.connect.xmlrpc
Class XmlRpcEnterprise

java.lang.Object
  extended byjava.util.Observable
      extended byorg.opengroupware.jogi.connect.xmlrpc.XmlRpcBaseDocument
          extended byorg.opengroupware.jogi.connect.xmlrpc.XmlRpcEnterprise
All Implemented Interfaces:
Enterprise, java.util.Observer

public class XmlRpcEnterprise
extends XmlRpcBaseDocument
implements java.util.Observer, Enterprise

Author:
Andreas Rath (teddius) E-mail: arath@htu.tugraz.at

Field Summary
protected  XmlRpcCaller caller_
           
static java.lang.String ENTERPRISE_ADDRESSES
           
static java.lang.String ENTERPRISE_BANK
           
static java.lang.String ENTERPRISE_BANK_ACCOUNT
           
static java.lang.String ENTERPRISE_COMMENT
           
static java.lang.String ENTERPRISE_CONTACT
           
static java.lang.String ENTERPRISE_CONTACT_ID
           
static java.lang.String ENTERPRISE_CONTACT_LOGIN
           
static java.lang.String ENTERPRISE_DELETE_PERSON
           
static java.lang.String ENTERPRISE_EMAIL
           
static java.lang.String ENTERPRISE_EXTENDED_ATTRS
           
static java.lang.String ENTERPRISE_EXTENDED_ATTRS_LASTCHANGED
           
static java.lang.String ENTERPRISE_EXTENDED_KEYS
           
static java.lang.String ENTERPRISE_ID
           
static java.lang.String ENTERPRISE_INSERT_PERSON
           
static java.lang.String ENTERPRISE_IS_COMPLETE
           
static java.lang.String ENTERPRISE_KEYWORDS
           
static java.lang.String ENTERPRISE_NAME
           
static java.lang.String ENTERPRISE_NUMBER
           
static java.lang.String ENTERPRISE_OBJECT_VERSION
           
static java.lang.String ENTERPRISE_OWNER
           
static java.lang.String ENTERPRISE_OWNER_ID
           
static java.lang.String ENTERPRISE_OWNER_LOGIN
           
static java.lang.String ENTERPRISE_PHONE_TYPES
           
static java.lang.String ENTERPRISE_PHONES
           
static java.lang.String ENTERPRISE_URL
           
protected  OpenGroupWare ogo
           
 
Fields inherited from class org.opengroupware.jogi.connect.xmlrpc.XmlRpcBaseDocument
content_, KEY_ID
 
Constructor Summary
protected XmlRpcEnterprise(java.lang.String enterprise_name, OpenGroupWare ogo)
           
 
Method Summary
protected  boolean checkNewContent(java.util.Map new_content)
          This method checks whether the provided Map contains a valid document.
protected  XmlRpcAddress createNewAddress(java.lang.String key_for_map)
           
 void deletePerson(Person person)
           
 java.util.Map getAddresses()
           
 java.lang.String getBank()
           
 java.lang.String getBankAccount()
           
 java.lang.String getComment()
           
 Person getContact()
           
 Person getContactPerson()
           
 java.lang.String getEmail()
           
 java.util.Map getExtendedAttributs()
           
 java.lang.String getId()
          Returns the id associated with this Enterprise object.
 java.lang.String getKeywords()
           
 java.lang.String getLastChanged()
           
 java.lang.String getName()
           
 java.lang.String getNumber()
           
 int getObjectVersion()
           
 Account getOwner()
           
 java.lang.String getOwnerId()
           
 java.util.Map getPhones()
          Returns a Map with all phone objects which are currently available for this enterprise.
 java.util.List getPhoneTypes()
          Returns a List of all currently available phone types.
 java.util.List getProjects()
           
 java.lang.String getUrl()
           
 java.util.Map insertExtendedAttrs(java.lang.String key, java.lang.String val)
           
 void insertPerson(Person person)
           
 Phone insertPhone(java.lang.String type, java.lang.String number, java.lang.String info)
          Inserts a new Phone into the Enterprise.
 boolean isComplete()
           
 boolean removePhone(Phone phone)
          Removes the Phone from this Enterprise.
 void setBank(java.lang.String string)
           
 void setBankAccount(java.lang.String string)
           
 void setComment(java.lang.String comment)
           
 void setContact(Person person)
           
 void setContactPerson(Person person)
           
 void setEmail(java.lang.String string)
           
 void setIsComplete(boolean bool)
           
 void setKeywords()
           
 void setName(java.lang.String name)
           
 void setNumber(java.lang.String number)
           
 void setObjectVersion(int objectVersion)
           
 void setOwner(Account account)
           
protected  void setPhoneTypes(java.util.List phone_types)
           
 void setUrl(java.lang.String url)
           
 void update(java.util.Observable o, java.lang.Object arg)
           
protected  boolean updateAddresses(java.util.Map addressesMap)
           
protected  boolean updatePhones(java.util.Map phonesMap)
          This method converts between an XML-RPC result returned by the GroupwareServer and an local XmlRpcPhone object.
 
Methods inherited from class org.opengroupware.jogi.connect.xmlrpc.XmlRpcBaseDocument
fireNotify, getContent, getString, put, setContent
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENTERPRISE_ID

public static final java.lang.String ENTERPRISE_ID
See Also:
Constant Field Values

ENTERPRISE_NUMBER

public static final java.lang.String ENTERPRISE_NUMBER
See Also:
Constant Field Values

ENTERPRISE_NAME

public static final java.lang.String ENTERPRISE_NAME
See Also:
Constant Field Values

ENTERPRISE_BANK

public static final java.lang.String ENTERPRISE_BANK
See Also:
Constant Field Values

ENTERPRISE_BANK_ACCOUNT

public static final java.lang.String ENTERPRISE_BANK_ACCOUNT
See Also:
Constant Field Values

ENTERPRISE_CONTACT

public static final java.lang.String ENTERPRISE_CONTACT
See Also:
Constant Field Values

ENTERPRISE_CONTACT_LOGIN

public static final java.lang.String ENTERPRISE_CONTACT_LOGIN
See Also:
Constant Field Values

ENTERPRISE_CONTACT_ID

public static final java.lang.String ENTERPRISE_CONTACT_ID
See Also:
Constant Field Values

ENTERPRISE_EMAIL

public static final java.lang.String ENTERPRISE_EMAIL
See Also:
Constant Field Values

ENTERPRISE_OWNER

public static final java.lang.String ENTERPRISE_OWNER
See Also:
Constant Field Values

ENTERPRISE_OWNER_LOGIN

public static final java.lang.String ENTERPRISE_OWNER_LOGIN
See Also:
Constant Field Values

ENTERPRISE_OWNER_ID

public static final java.lang.String ENTERPRISE_OWNER_ID
See Also:
Constant Field Values

ENTERPRISE_OBJECT_VERSION

public static final java.lang.String ENTERPRISE_OBJECT_VERSION
See Also:
Constant Field Values

ENTERPRISE_ADDRESSES

public static final java.lang.String ENTERPRISE_ADDRESSES
See Also:
Constant Field Values

ENTERPRISE_COMMENT

public static final java.lang.String ENTERPRISE_COMMENT
See Also:
Constant Field Values

ENTERPRISE_EXTENDED_ATTRS

public static final java.lang.String ENTERPRISE_EXTENDED_ATTRS
See Also:
Constant Field Values

ENTERPRISE_EXTENDED_ATTRS_LASTCHANGED

public static final java.lang.String ENTERPRISE_EXTENDED_ATTRS_LASTCHANGED
See Also:
Constant Field Values

ENTERPRISE_EXTENDED_KEYS

public static final java.lang.String ENTERPRISE_EXTENDED_KEYS
See Also:
Constant Field Values

ENTERPRISE_KEYWORDS

public static final java.lang.String ENTERPRISE_KEYWORDS
See Also:
Constant Field Values

ENTERPRISE_IS_COMPLETE

public static final java.lang.String ENTERPRISE_IS_COMPLETE
See Also:
Constant Field Values

ENTERPRISE_URL

public static final java.lang.String ENTERPRISE_URL
See Also:
Constant Field Values

ENTERPRISE_PHONE_TYPES

public static final java.lang.String ENTERPRISE_PHONE_TYPES
See Also:
Constant Field Values

ENTERPRISE_PHONES

public static final java.lang.String ENTERPRISE_PHONES
See Also:
Constant Field Values

ENTERPRISE_INSERT_PERSON

public static final java.lang.String ENTERPRISE_INSERT_PERSON
See Also:
Constant Field Values

ENTERPRISE_DELETE_PERSON

public static final java.lang.String ENTERPRISE_DELETE_PERSON
See Also:
Constant Field Values

caller_

protected XmlRpcCaller caller_

ogo

protected OpenGroupWare ogo
Constructor Detail

XmlRpcEnterprise

protected XmlRpcEnterprise(java.lang.String enterprise_name,
                           OpenGroupWare ogo)
                    throws OgoException,
                           ConnectionException
Method Detail

createNewAddress

protected XmlRpcAddress createNewAddress(java.lang.String key_for_map)
                                  throws OgoException,
                                         ConnectionException
Throws:
OgoException
ConnectionException

updateAddresses

protected boolean updateAddresses(java.util.Map addressesMap)
                           throws OgoException,
                                  ConnectionException
Parameters:
addressesMap - the Map returned by OpenGroupware.org, this contains the Addresses as Maps.
Returns:
returns true if the method succeeded, or false if the addresses could not be updated;
Throws:
OgoException
ConnectionException

updatePhones

protected boolean updatePhones(java.util.Map phonesMap)
                        throws OgoException,
                               ConnectionException
This method converts between an XML-RPC result returned by the GroupwareServer and an local XmlRpcPhone object. If there is a local object available its data is updated, if no local object is available it is created and initialized with the results returned by the XML-RPC call.

Parameters:
phonesMap - The phones object returned by an XML-RPC call to the Opengroupware.
Returns:
true if updating the map suceeds and false otherwise.
Throws:
OgoException
ConnectionException

getId

public java.lang.String getId()
                       throws OgoException,
                              ConnectionException
Description copied from interface: Enterprise
Returns the id associated with this Enterprise object.

Specified by:
getId in interface Enterprise
Overrides:
getId in class XmlRpcBaseDocument
Throws:
OgoException
ConnectionException

getName

public java.lang.String getName()
                         throws OgoException,
                                ConnectionException
Specified by:
getName in interface Enterprise
Throws:
OgoException
ConnectionException

setName

public void setName(java.lang.String name)
             throws OgoException,
                    ConnectionException
Specified by:
setName in interface Enterprise
Throws:
OgoException
ConnectionException

insertExtendedAttrs

public java.util.Map insertExtendedAttrs(java.lang.String key,
                                         java.lang.String val)
                                  throws OgoException,
                                         ConnectionException
Specified by:
insertExtendedAttrs in interface Enterprise
Throws:
OgoException
ConnectionException

getObjectVersion

public int getObjectVersion()
                     throws OgoException,
                            ConnectionException
Specified by:
getObjectVersion in interface Enterprise
Throws:
OgoException
ConnectionException

setObjectVersion

public void setObjectVersion(int objectVersion)
                      throws OgoException,
                             ConnectionException
Specified by:
setObjectVersion in interface Enterprise
Throws:
OgoException
ConnectionException

getComment

public java.lang.String getComment()
                            throws OgoException,
                                   ConnectionException
Specified by:
getComment in interface Enterprise
Throws:
OgoException
ConnectionException

setComment

public void setComment(java.lang.String comment)
                throws OgoException,
                       ConnectionException
Specified by:
setComment in interface Enterprise
Throws:
OgoException
ConnectionException

getUrl

public java.lang.String getUrl()
                        throws OgoException,
                               ConnectionException
Specified by:
getUrl in interface Enterprise
Throws:
OgoException
ConnectionException

setUrl

public void setUrl(java.lang.String url)
            throws OgoException,
                   ConnectionException
Specified by:
setUrl in interface Enterprise
Throws:
OgoException
ConnectionException

getExtendedAttributs

public java.util.Map getExtendedAttributs()
                                   throws OgoException,
                                          ConnectionException
Specified by:
getExtendedAttributs in interface Enterprise
Throws:
OgoException
ConnectionException

getKeywords

public java.lang.String getKeywords()
                             throws OgoException,
                                    ConnectionException
Specified by:
getKeywords in interface Enterprise
Throws:
OgoException
ConnectionException

setKeywords

public void setKeywords()
                 throws OgoException,
                        ConnectionException
Specified by:
setKeywords in interface Enterprise
Throws:
OgoException
ConnectionException

setContact

public void setContact(Person person)
                throws OgoException,
                       ConnectionException
Specified by:
setContact in interface Enterprise
Throws:
OgoException
ConnectionException

getContact

public Person getContact()
                  throws OgoException,
                         ConnectionException
Specified by:
getContact in interface Enterprise
Throws:
OgoException
ConnectionException

setOwner

public void setOwner(Account account)
              throws OgoException,
                     ConnectionException
Specified by:
setOwner in interface Enterprise
Throws:
OgoException
ConnectionException

getOwner

public Account getOwner()
                 throws OgoException,
                        ConnectionException
Specified by:
getOwner in interface Enterprise
Throws:
OgoException
ConnectionException

getOwnerId

public java.lang.String getOwnerId()
                            throws OgoException,
                                   ConnectionException
Specified by:
getOwnerId in interface Enterprise
Throws:
OgoException
ConnectionException

isComplete

public boolean isComplete()
                   throws OgoException,
                          ConnectionException
Specified by:
isComplete in interface Enterprise
Throws:
OgoException
ConnectionException

setIsComplete

public void setIsComplete(boolean bool)
                   throws OgoException,
                          ConnectionException
Specified by:
setIsComplete in interface Enterprise
Throws:
OgoException
ConnectionException

getAddresses

public java.util.Map getAddresses()
                           throws OgoException,
                                  ConnectionException
Specified by:
getAddresses in interface Enterprise
Throws:
OgoException
ConnectionException

getPhones

public java.util.Map getPhones()
                        throws OgoException,
                               ConnectionException
Description copied from interface: Enterprise
Returns a Map with all phone objects which are currently available for this enterprise. The phones can be accessed in the map by their Type.

Specified by:
getPhones in interface Enterprise
Returns:
Map a Map which contains all Phone objects associated with this Enterprise.
Throws:
OgoException
ConnectionException

getPhoneTypes

public java.util.List getPhoneTypes()
                             throws OgoException,
                                    ConnectionException
Description copied from interface: Enterprise
Returns a List of all currently available phone types.

Specified by:
getPhoneTypes in interface Enterprise
Returns:
List a List of all currently available phone types.
Throws:
OgoException
ConnectionException

insertPhone

public Phone insertPhone(java.lang.String type,
                         java.lang.String number,
                         java.lang.String info)
                  throws OgoException,
                         ConnectionException
Description copied from interface: Enterprise
Inserts a new Phone into the Enterprise. If the Phone does not exist it will be created. Otherwise the existing Phone is updated.

Specified by:
insertPhone in interface Enterprise
Parameters:
type - The type, for example 01_tel .
number - The number, for example 0043-727-1234567
info - Additional information.
Throws:
OgoException
ConnectionException

removePhone

public boolean removePhone(Phone phone)
                    throws OgoException,
                           ConnectionException
Description copied from interface: Enterprise
Removes the Phone from this Enterprise.

Specified by:
removePhone in interface Enterprise
Parameters:
phone - The Phone to remove.
Throws:
OgoException
ConnectionException

setPhoneTypes

protected void setPhoneTypes(java.util.List phone_types)
                      throws OgoException,
                             ConnectionException
Throws:
OgoException
ConnectionException

getNumber

public java.lang.String getNumber()
                           throws OgoException,
                                  ConnectionException
Specified by:
getNumber in interface Enterprise
Throws:
OgoException
ConnectionException

setNumber

public void setNumber(java.lang.String number)
               throws OgoException,
                      ConnectionException
Specified by:
setNumber in interface Enterprise
Throws:
OgoException
ConnectionException

insertPerson

public void insertPerson(Person person)
                  throws OgoException,
                         ConnectionException
Specified by:
insertPerson in interface Enterprise
Throws:
OgoException
ConnectionException

deletePerson

public void deletePerson(Person person)
                  throws OgoException,
                         ConnectionException
Specified by:
deletePerson in interface Enterprise
Throws:
OgoException
ConnectionException

getProjects

public java.util.List getProjects()
                           throws OgoException,
                                  ConnectionException
Specified by:
getProjects in interface Enterprise
Throws:
OgoException
ConnectionException

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
Specified by:
update in interface java.util.Observer

getBank

public java.lang.String getBank()
                         throws OgoException,
                                ConnectionException
Specified by:
getBank in interface Enterprise
Throws:
OgoException
ConnectionException

getBankAccount

public java.lang.String getBankAccount()
                                throws OgoException,
                                       ConnectionException
Specified by:
getBankAccount in interface Enterprise
Throws:
OgoException
ConnectionException

getContactPerson

public Person getContactPerson()
                        throws OgoException,
                               ConnectionException
Specified by:
getContactPerson in interface Enterprise
Throws:
OgoException
ConnectionException

getEmail

public java.lang.String getEmail()
                          throws OgoException,
                                 ConnectionException
Specified by:
getEmail in interface Enterprise
Throws:
OgoException
ConnectionException

getLastChanged

public java.lang.String getLastChanged()
                                throws OgoException,
                                       ConnectionException
Specified by:
getLastChanged in interface Enterprise
Throws:
OgoException
ConnectionException

setBank

public void setBank(java.lang.String string)
             throws OgoException,
                    ConnectionException
Specified by:
setBank in interface Enterprise
Throws:
OgoException
ConnectionException

setBankAccount

public void setBankAccount(java.lang.String string)
                    throws OgoException,
                           ConnectionException
Specified by:
setBankAccount in interface Enterprise
Throws:
OgoException
ConnectionException

setContactPerson

public void setContactPerson(Person person)
                      throws OgoException,
                             ConnectionException
Specified by:
setContactPerson in interface Enterprise
Throws:
OgoException
ConnectionException

setEmail

public void setEmail(java.lang.String string)
              throws OgoException,
                     ConnectionException
Specified by:
setEmail in interface Enterprise
Throws:
OgoException
ConnectionException

checkNewContent

protected boolean checkNewContent(java.util.Map new_content)
Description copied from class: XmlRpcBaseDocument
This method checks whether the provided Map contains a valid document. If essential parts are missing or are of a wrong type, this method must return false, otherwise true.

Specified by:
checkNewContent in class XmlRpcBaseDocument
Parameters:
new_content - The new content for the document.
Returns:
true if the content meets all requirements, otherwise false.


Copyright © 2003 ogojogi Project, All Rights Reserved.