summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Campo2008-01-25 11:40:57 (EST)
committerChristian Campo2008-01-25 11:40:57 (EST)
commitae5e0a11632346fb61a0d94384edfc4b3001f204 (patch)
tree7a9726e8d4a39dc3e451f8e8b20ca7d5da47fa59
parent4a07e76777624be4f8fdab534697453ed6bd820f (diff)
downloadorg.eclipse.riena-ae5e0a11632346fb61a0d94384edfc4b3001f204.zip
org.eclipse.riena-ae5e0a11632346fb61a0d94384edfc4b3001f204.tar.gz
org.eclipse.riena-ae5e0a11632346fb61a0d94384edfc4b3001f204.tar.bz2
initial code contribution of the commons part of multiple simple samples on how to use riena. common contains the interfaces and the value objects of the service
-rw-r--r--org.eclipse.riena.sample.app.common/.classpath7
-rw-r--r--org.eclipse.riena.sample.app.common/.project28
-rw-r--r--org.eclipse.riena.sample.app.common/META-INF/MANIFEST.MF11
-rw-r--r--org.eclipse.riena.sample.app.common/about.html24
-rw-r--r--org.eclipse.riena.sample.app.common/build.properties4
-rw-r--r--org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/Address.java163
-rw-r--r--org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/BankData.java180
-rw-r--r--org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/Birth.java100
-rw-r--r--org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/Customer.java447
-rw-r--r--org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/CustomersPermission.java126
-rw-r--r--org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/ICustomerSearch.java30
-rw-r--r--org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/ICustomers.java25
-rw-r--r--org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/IHelloWorldService.java29
-rw-r--r--org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/Offer.java32
14 files changed, 1206 insertions, 0 deletions
diff --git a/org.eclipse.riena.sample.app.common/.classpath b/org.eclipse.riena.sample.app.common/.classpath
new file mode 100644
index 0000000..751c8f2
--- /dev/null
+++ b/org.eclipse.riena.sample.app.common/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.riena.sample.app.common/.project b/org.eclipse.riena.sample.app.common/.project
new file mode 100644
index 0000000..0be7767
--- /dev/null
+++ b/org.eclipse.riena.sample.app.common/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.riena.sample.app.common</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.riena.sample.app.common/META-INF/MANIFEST.MF b/org.eclipse.riena.sample.app.common/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..a2ab197
--- /dev/null
+++ b/org.eclipse.riena.sample.app.common/META-INF/MANIFEST.MF
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Riena Sample App Common (Incubation)
+Bundle-SymbolicName: org.eclipse.riena.sample.app.common
+Bundle-Version: 0.0.1
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.riena.security.common,
+ org.eclipse.riena.communication.core
+Eclipse-LazyStart: false
+Export-Package: org.eclipse.riena.sample.app.common.model
+Eclipse-RegisterBuddy: org.eclipse.riena.security.common
diff --git a/org.eclipse.riena.sample.app.common/about.html b/org.eclipse.riena.sample.app.common/about.html
new file mode 100644
index 0000000..fc81119
--- /dev/null
+++ b/org.eclipse.riena.sample.app.common/about.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+
+
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head><body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+<div style="position: absolute; width: 28px; height: 28px; z-index: 1000; display: none;"></div><img style="position: absolute; width: 35px; height: 29px; z-index: 1000; display: none;" src="about-Dateien/launch.png"></body></html> \ No newline at end of file
diff --git a/org.eclipse.riena.sample.app.common/build.properties b/org.eclipse.riena.sample.app.common/build.properties
new file mode 100644
index 0000000..34d2e4d
--- /dev/null
+++ b/org.eclipse.riena.sample.app.common/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/Address.java b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/Address.java
new file mode 100644
index 0000000..008c33a
--- /dev/null
+++ b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/Address.java
@@ -0,0 +1,163 @@
+/*******************************************************************************
+ * Copyright (c) 2007 compeople AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.sample.app.common.model;
+
+/**
+ * Class containing an address
+ */
+public class Address implements Cloneable {
+
+ private String street;
+ private String zipCode;
+ private String city;
+ private String country;
+
+ /**
+ * Creates an empty address
+ */
+ public Address() {
+
+ super();
+
+ } // end constructor
+
+ /**
+ * Creates an address and sets the given values
+ *
+ * @param country -
+ * the country to set
+ * @param zipCode -
+ * the zip code to set
+ * @param city -
+ * the city to set
+ * @param street -
+ * the street to set
+ */
+ public Address(String country, String zipCode, String city, String street) {
+
+ this();
+
+ this.country = country;
+ this.zipCode = zipCode;
+ this.city = city;
+ this.street = street;
+
+ } // end cosntructor
+
+ /**
+ * Returns the city
+ *
+ * @return city
+ */
+ public String getCity() {
+
+ return city;
+
+ } // end method
+
+ /**
+ * Sets the given city
+ *
+ * @param city -
+ * the city to set
+ */
+ public void setCity(String city) {
+
+ this.city = city;
+
+ } // end method
+
+ /**
+ * Returns the street
+ *
+ * @return street
+ */
+ public String getStreet() {
+
+ return street;
+
+ } // end method
+
+ /**
+ * Sets the given street
+ *
+ * @param street -
+ * the street to set
+ */
+ public void setStreet(String street) {
+
+ this.street = street;
+
+ } // end method
+
+ /**
+ * Returns the zip code
+ *
+ * @return zip code
+ */
+ public String getZipCode() {
+
+ return zipCode;
+
+ } // end method
+
+ /**
+ * Sets the given zip code
+ *
+ * @param zipCode -
+ * the zip code to set
+ */
+ public void setZipCode(String zipCode) {
+
+ this.zipCode = zipCode;
+
+ } // end method
+
+ /**
+ * Returns the country
+ *
+ * @return country
+ */
+ public String getCountry() {
+
+ return country;
+
+ } // end method
+
+ /**
+ * Sets the given country
+ *
+ * @param country -
+ * the country to set
+ */
+ public void setCountry(String country) {
+
+ this.country = country;
+
+ } // end method
+
+ /**
+ * @see java.lang.Object#clone()
+ */
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+
+ Address clone = new Address();
+ clone.setCity(getCity());
+ clone.setCountry(getCountry());
+ clone.setStreet(getStreet());
+ clone.setZipCode(getZipCode());
+
+ return clone;
+
+ } // end method
+
+} // end class
diff --git a/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/BankData.java b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/BankData.java
new file mode 100644
index 0000000..557ddd5
--- /dev/null
+++ b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/BankData.java
@@ -0,0 +1,180 @@
+/*******************************************************************************
+ * Copyright (c) 2007 compeople AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.sample.app.common.model;
+
+/**
+ * This class contains bank data
+ */
+public class BankData implements Cloneable {
+
+ private String accountNumber;
+ private String bank;
+ private String bankCode;
+
+ /**
+ * Creates empty bank data
+ */
+ public BankData() {
+
+ super();
+
+ } // end constructor
+
+ /**
+ * Creates bank data and sets the given values
+ *
+ * @param accountNumber -
+ * the accountNumber to set
+ * @param bank -
+ * the zip bank to set
+ * @param bankCode -
+ * the bankCode to set
+ */
+ public BankData(String accountNumber, String bank, String bankCode) {
+
+ this();
+
+ this.accountNumber = accountNumber;
+ this.bank = bank;
+ this.bankCode = bankCode;
+
+ } // end cosntructor
+
+ @Override
+ public boolean equals(Object other) {
+ if (!(other instanceof BankData)) {
+ return false;
+ }
+ BankData bdO = (BankData) other;
+ if (bdO.accountNumber.equals(accountNumber) && bdO.bank.equals(bank) && bdO.bankCode.equals(bankCode)) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns the account number
+ *
+ * @return account number
+ */
+ public String getAccountNumber() {
+
+ return accountNumber;
+
+ } // end method
+
+ /**
+ * Sets the given account number
+ *
+ * @param accountNumber -
+ * the account number to set
+ */
+ public void setAccountNumber(String accountNumber) {
+
+ this.accountNumber = accountNumber;
+
+ } // end method
+
+ /**
+ * Returns the name of the bank
+ *
+ * @return name of bank
+ */
+ public String getBank() {
+
+ return bank;
+
+ } // end method
+
+ /**
+ * Sets the given name of the bank
+ *
+ * @param bank -
+ * the name of bank to set
+ */
+ public void setBank(String bank) {
+
+ this.bank = bank;
+
+ } // end method
+
+ /**
+ * Returns the bank code
+ *
+ * @return Returns the bankCode.
+ */
+ public String getBankCode() {
+
+ return bankCode;
+
+ } // end method
+
+ /**
+ * Sets the given bank code
+ *
+ * @param bankCode -
+ * the bank codd to set.
+ */
+ public void setBankCode(String bankCode) {
+
+ this.bankCode = bankCode;
+
+ } // end method
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+
+ String strg = "";
+ if (accountNumber != null) {
+ strg += accountNumber;
+ } else {
+ strg += "?";
+ } // end if
+
+ strg += " - ";
+
+ if (bank != null) {
+ strg += bank;
+ } else {
+ strg += "?";
+ } // end if
+
+ strg += " - ";
+
+ if (bankCode != null) {
+ strg += bankCode;
+ } else {
+ strg += "?";
+ } // end if
+
+ return strg;
+
+ } // end method
+
+ /**
+ * @see java.lang.Object#clone()
+ */
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+
+ BankData clone = new BankData();
+ clone.setAccountNumber(getAccountNumber());
+ clone.setBank(getBank());
+ clone.setBankCode(getBankCode());
+
+ return clone;
+
+ } // end method
+
+} // end class
diff --git a/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/Birth.java b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/Birth.java
new file mode 100644
index 0000000..1852178
--- /dev/null
+++ b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/Birth.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2007 compeople AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.sample.app.common.model;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * Class containing a birth
+ */
+public class Birth {
+
+ private Date birthDay;
+ private String birthPlace;
+
+ /**
+ * Creates an empty birth
+ */
+ public Birth() {
+
+ super();
+
+ } // end constructor
+
+ /**
+ * Creates a birth and sets the given values
+ *
+ * @param day -
+ * birthday to set
+ * @param place -
+ * birthplace to set
+ */
+ public Birth(Date day, String place) {
+
+ this();
+
+ this.birthDay = day;
+ this.birthPlace = place;
+
+ } // end constructor
+
+ /**
+ * Returns the birthday
+ *
+ * @return birthday
+ */
+ public Date getBirthDay() {
+
+ return birthDay;
+
+ } // end method
+
+ /**
+ * Sets the given birthday
+ *
+ * @param day -
+ * the birth day to set.
+ */
+ public void setBirthDay(Date day) {
+
+ this.birthDay = day;
+ SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy");
+ System.out.println(format.format(this.birthDay));
+
+ } // end method
+
+ /**
+ * Returns the birth place
+ *
+ * @return birthplace.
+ */
+ public String getBirthPlace() {
+
+ return birthPlace;
+
+ } // end method
+
+ /**
+ * Sets the given birth place
+ *
+ * @param birthPlace -
+ * the birthplace to set.
+ */
+ public void setBirthPlace(String birthPlace) {
+
+ this.birthPlace = birthPlace;
+
+ System.out.println(this.birthPlace);
+
+ } // end method
+
+} // end class
diff --git a/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/Customer.java b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/Customer.java
new file mode 100644
index 0000000..0531862
--- /dev/null
+++ b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/Customer.java
@@ -0,0 +1,447 @@
+/*******************************************************************************
+ * Copyright (c) 2007 compeople AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.sample.app.common.model;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Class containing a customer
+ */
+public class Customer {
+
+ public final static String PROPERTY_CUSTOMER_NUMBER = "customerNumber";
+ public final static String PROPERTY_FORM = "form";
+ public final static String PROPERTY_TITLE = "title";
+ public final static String PROPERTY_FIRST_NAME = "firstName";
+ public final static String PROPERTY_LAST_NAME = "lastName";
+ public final static String PROPERTY_ADDRESS = "address";
+ public final static String PROPERTY_BIRTH = "birth";
+ public final static String PROPERTY_PHONE_PRIVATE = "phonePrivate";
+ public final static String PROPERTY_PHONE_BUSINESS = "phoneBusiness";
+ public final static String PROPERTY_PHONE_MOBILE = "phoneMobile";
+ public final static String PROPERTY_FAX = "fax";
+ public final static String PROPERTY_EMAIL = "email";
+ public final static String PROPERTY_BANK_DATA = "bankData";
+
+ /**
+ * db4o - id
+ */
+ public long id = -1;
+ private transient PropertyChangeSupport propertyChangeSupport;
+
+ private Integer customerNumber;
+ private String form;
+ private String title;
+ private String firstName;
+ private String lastName;
+ private Address address;
+ private Birth birth;
+ private String phonePrivate;
+ private String phoneBusiness;
+ private String phoneMobile;
+ private String fax;
+ private String email;
+ private List<BankData> bankData;
+
+ // private List<Offer> offers;
+
+ /**
+ * Creates an empty customer
+ */
+ public Customer() {
+
+ super();
+
+ propertyChangeSupport = new PropertyChangeSupport(this);
+ address = new Address();
+ birth = new Birth();
+ // offers = new ArrayList<Offer>();
+ bankData = new ArrayList<BankData>();
+ firstName = "";
+ lastName = "";
+ }
+
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(listener);
+ }
+
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(listener);
+ }
+
+ protected void firePropertyChanged(String propertyName, Object oldValue, Object newValue) {
+ propertyChangeSupport.firePropertyChange(propertyName, oldValue, newValue);
+ }
+
+ /**
+ * Returns the address of the customer
+ *
+ * @return address of the customer
+ */
+ public Address getAddress() {
+
+ return address;
+
+ } // end method
+
+ /**
+ * Sets the address of the customer
+ *
+ * @param address
+ * of the customer
+ */
+ public void setAddress(Address address) {
+ Address old = this.getAddress();
+ this.address = address;
+ firePropertyChanged(PROPERTY_ADDRESS, old, address);
+
+ } // end method
+
+ /**
+ * Returns the birth of the customer
+ *
+ * @return birth of the customer
+ */
+ public Birth getBirth() {
+
+ return birth;
+
+ } // end method
+
+ /**
+ * Sets the birth of the customer
+ *
+ * @param birth -
+ * the birth to set
+ */
+ public void setBirth(Birth birth) {
+ Birth old = getBirth();
+ this.birth = birth;
+ firePropertyChanged(PROPERTY_BIRTH, old, birth);
+
+ } // end method
+
+ /**
+ * Returns the first name of the customer
+ *
+ * @return first name of the customer
+ */
+ public String getFirstName() {
+
+ return firstName;
+
+ } // end method
+
+ /**
+ * Sets the first name of the customer
+ *
+ * @param firstName -
+ * the first name to set
+ */
+ public void setFirstName(String firstName) {
+ String old = this.getFirstName();
+ this.firstName = firstName;
+ firePropertyChanged(PROPERTY_FIRST_NAME, old, firstName);
+
+ } // end method
+
+ /**
+ * Returns the form of the customer
+ *
+ * @return form of the customer
+ */
+ public String getForm() {
+
+ return form;
+
+ } // end method
+
+ /**
+ * Sets the form of the customer
+ *
+ * @param form -
+ * the form to set.
+ */
+ public void setForm(String form) {
+ String old = getForm();
+ this.form = form;
+ firePropertyChanged(PROPERTY_FORM, old, form);
+
+ } // end method
+
+ /**
+ * Returns the last name of the customer
+ *
+ * @return last name of the customer
+ */
+ public String getLastName() {
+
+ return lastName;
+
+ } // end method
+
+ /**
+ * Sets the last name of the customer
+ *
+ * @param lastName -
+ * the last name to set
+ */
+ public void setLastName(String lastName) {
+ String old = getLastName();
+ this.lastName = lastName;
+ firePropertyChanged(PROPERTY_LAST_NAME, old, lastName);
+
+ } // end method
+
+ /**
+ * Returns the title of the customer
+ *
+ * @return title of the customer
+ */
+ public String getTitle() {
+
+ return title;
+
+ } // end method
+
+ /**
+ * Set the title of the customer
+ *
+ * @param title -
+ * the title to set
+ */
+ public void setTitle(String title) {
+ String old = getTitle();
+ this.title = title;
+ firePropertyChanged(PROPERTY_TITLE, old, title);
+
+ } // end method
+
+ /**
+ * Returns the fax number of the customer
+ *
+ * @return fax number
+ */
+ public String getFax() {
+
+ return fax;
+
+ } // end method
+
+ /**
+ * Sets the given fax number
+ *
+ * @param fax -
+ * the fax number to set
+ */
+ public void setFax(String fax) {
+ String old = getFax();
+ this.fax = fax;
+ firePropertyChanged(PROPERTY_FAX, old, fax);
+
+ } // end method
+
+ /**
+ * Returns the business phone number of the customer
+ *
+ * @return business phone number
+ */
+ public String getPhoneBusiness() {
+
+ return phoneBusiness;
+
+ } // end method
+
+ /**
+ * Sets the given business phone number
+ *
+ * @param phoneBusiness -
+ * the phone number to set
+ */
+ public void setPhoneBusiness(String phoneBusiness) {
+ String old = getPhoneBusiness();
+ this.phoneBusiness = phoneBusiness;
+ firePropertyChanged(PROPERTY_PHONE_BUSINESS, old, phoneBusiness);
+
+ } // end method
+
+ /**
+ * Returns the mobile phone number of the customer
+ *
+ * @return mobile phone number
+ */
+ public String getPhoneMobile() {
+
+ return phoneMobile;
+
+ } // end method
+
+ /**
+ * Sets the given mobile phone number
+ *
+ * @param phoneMobile -
+ * the phone number to set
+ */
+ public void setPhoneMobile(String phoneMobile) {
+ String old = getPhoneMobile();
+ this.phoneMobile = phoneMobile;
+ firePropertyChanged(PROPERTY_PHONE_MOBILE, old, phoneMobile);
+
+ } // end method
+
+ /**
+ * Returns the private phone number of the customer
+ *
+ * @return private phone number
+ */
+ public String getPhonePrivate() {
+
+ return phonePrivate;
+
+ } // end method
+
+ /**
+ * Sets the given private phone number
+ *
+ * @param phonePrivate -
+ * the phone number to set
+ */
+ public void setPhonePrivate(String phonePrivate) {
+ String old = getPhonePrivate();
+ this.phonePrivate = phonePrivate;
+ firePropertyChanged(PROPERTY_PHONE_PRIVATE, old, phonePrivate);
+
+ } // end method
+
+ /**
+ * Returns the eMail address of the customer
+ *
+ * @return eMail address
+ */
+ public String getEmail() {
+
+ return email;
+
+ } // end method
+
+ /**
+ * Sets the given eMail address
+ *
+ * @param email -
+ * the eMail address to set
+ */
+ public void setEmail(String email) {
+ String old = getEmail();
+ this.email = email;
+ firePropertyChanged(PROPERTY_EMAIL, old, email);
+
+ } // end method
+
+ /**
+ * @return Returns the customerNumber.
+ */
+ public Integer getCustomerNumber() {
+
+ return customerNumber;
+
+ } // end method
+
+ /**
+ * @param customerNumber
+ * The customerNumber to set.
+ */
+ public void setCustomerNumber(Integer customerNumber) {
+
+ Integer old = getCustomerNumber();
+ this.customerNumber = customerNumber;
+ firePropertyChanged(PROPERTY_CUSTOMER_NUMBER, old, customerNumber);
+ } // end method
+
+ /**
+ * Compares two customers by customerNumber.
+ *
+ * @param obj
+ * The reference object with which to compare.
+ * @return <code>true</code> if the argument is a Customer with the same
+ * customerNumber (other than <code>null</code>);<code>false</code>
+ * otherwise.
+ */
+ @Override
+ public boolean equals(Object obj) {
+
+ if (obj instanceof Customer) {
+ Customer customer = (Customer) obj;
+ if (customerNumber != null && customerNumber.equals(customer.getCustomerNumber())) {
+ return true;
+ }
+ }
+ return false;
+
+ } // end method
+
+ /**
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+
+ if (customerNumber != null) {
+ return customerNumber.hashCode();
+ }
+ return 0;
+
+ } // end method
+
+ /**
+ * Returns a list with all bank data
+ *
+ * @return list of bank data
+ */
+ public List<BankData> getBankData() {
+
+ return bankData;
+
+ } // end method
+
+ /**
+ * Sets the given list of bank data
+ *
+ * @param bankData -
+ * the list of bank data to set
+ */
+ public void setBankData(List<BankData> bankData) {
+ List<BankData> old = getBankData();
+ this.bankData = bankData;
+ firePropertyChanged(PROPERTY_BANK_DATA, old, bankData);
+
+ } // end method
+
+ @Override
+ public String toString() {
+ return getFullCustomerName() + " --> customer number=" + this.getCustomerNumber();
+ }
+
+ public String getFullCustomerName() {
+
+ StringBuilder builder = new StringBuilder();
+
+ if (getLastName() != null) {
+ builder.append(getLastName());
+ builder.append(", ");
+ }
+ builder.append(getFirstName());
+
+ return builder.toString();
+ }
+} // end class
diff --git a/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/CustomersPermission.java b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/CustomersPermission.java
new file mode 100644
index 0000000..c479e38
--- /dev/null
+++ b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/CustomersPermission.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2007 compeople AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.sample.app.common.model;
+
+import java.security.Permission;
+import java.util.StringTokenizer;
+
+/**
+ * Permission for the Customer class to allow or disallow certain methods
+ *
+ */
+public class CustomersPermission extends Permission {
+
+ private String actions;
+ private String[] actionList;
+
+ private CustomersPermission() { // for hessian only
+ super("");
+ }
+
+ public CustomersPermission(String name, String actions) {
+ super(name);
+ this.actions = actions;
+ actionList = makeActionList(actions);
+ }
+
+ private String[] makeActionList(String actions) {
+ StringTokenizer st = new StringTokenizer(actions, ",", false);
+ String[] list = new String[st.countTokens()];
+ int i = 0;
+ while (st.hasMoreTokens()) {
+ list[i++] = st.nextToken();
+ }
+ return list;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.security.Permission#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof CustomersPermission) {
+ CustomersPermission cp = (CustomersPermission) obj;
+ if (cp.getName().equals(this.getName())) {
+ String[] l2 = makeActionList(cp.getActions());
+ if (actionList.length == l2.length) {
+ for (int i = 0; i < actionList.length; i++) {
+ boolean found = false;
+ for (int x = 0; x < l2.length && !found; x++) {
+ if (actionList[i].equals(l2[x])) {
+ found = true;
+ }
+ }
+ if (!found) {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.security.Permission#getActions()
+ */
+ @Override
+ public String getActions() {
+ return actions;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.security.Permission#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.security.Permission#implies(java.security.Permission)
+ */
+ @Override
+ public boolean implies(Permission permission) {
+ if (permission instanceof CustomersPermission) {
+ CustomersPermission cp = (CustomersPermission) permission;
+ if (getName().equals(cp.getName())) {
+ String[] l2 = makeActionList(cp.getActions());
+ if (l2.length <= actionList.length) {
+ for (int i = 0; i < l2.length; i++) {
+ boolean found = false;
+ for (int x = 0; x < actionList.length && !found; x++) {
+ if (l2[i].equals(actionList[x])) {
+ found = true;
+ }
+ }
+ if (!found) {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/ICustomerSearch.java b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/ICustomerSearch.java
new file mode 100644
index 0000000..429e4c3
--- /dev/null
+++ b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/ICustomerSearch.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2007 compeople AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.sample.app.common.model;
+
+/**
+ *
+ *
+ */
+public interface ICustomerSearch {
+
+ String ID = ICustomerSearch.class.getName();
+
+ /**
+ * Retrieves customers from the database. For the query the given customer
+ * is use as an example (Query by Example (QBE))
+ *
+ * @param customer
+ * customer candidate
+ * @return list of customers
+ */
+ Customer[] findCustomer(Customer customer);
+}
diff --git a/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/ICustomers.java b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/ICustomers.java
new file mode 100644
index 0000000..2593f71
--- /dev/null
+++ b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/ICustomers.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007 compeople AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.sample.app.common.model;
+
+/**
+ *
+ */
+public interface ICustomers {
+
+ String ID = ICustomers.class.getName();
+
+ Integer getNextUniqueCustomerNumber();
+
+ void store(Customer customer);
+
+ Offer[] getOffers(Integer customerNumber);
+}
diff --git a/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/IHelloWorldService.java b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/IHelloWorldService.java
new file mode 100644
index 0000000..7ee556e
--- /dev/null
+++ b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/IHelloWorldService.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2007 compeople AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.sample.app.common.model;
+
+/**
+ * Interface for HelloWorld service sample.
+ */
+public interface IHelloWorldService {
+
+ /**
+ * Service ID
+ */
+ String ID = IHelloWorldService.class.getName();
+
+ /**
+ * Receive a message from server.
+ *
+ * @return the message.
+ */
+ String getMessage();
+}
diff --git a/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/Offer.java b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/Offer.java
new file mode 100644
index 0000000..c42cff4
--- /dev/null
+++ b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/Offer.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2007 compeople AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.sample.app.common.model;
+
+public class Offer {
+ private Integer customerNumber;
+ private Integer productId;
+
+ public Offer(Integer customerNumber, Integer productId) {
+
+ super();
+
+ this.customerNumber = customerNumber;
+ this.productId = productId;
+ }
+
+ public Integer getCustomerNumber() {
+ return customerNumber;
+ }
+
+ public Integer getProductId() {
+ return productId;
+ }
+}