Android Open Source - SalesOrder Business Partner






From Project

Back to project page SalesOrder.

License

The source code is released under:

GNU General Public License

If you think the Android project SalesOrder listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.capgemini.SalesOrder.zgwsample_srv.v0.entitytypes;
/*//  w w  w.ja  v a 2s . co m

 Auto-Generated by SAP NetWeaver Gateway Productivity Accelerator, Version 1.1.1

*/
import java.net.MalformedURLException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import com.sap.gwpa.proxy.BaseEntityType;
import com.sap.gwpa.proxy.ODataQuery;
import com.sap.gwpa.proxy.TypeConverter;
import com.sap.mobile.lib.parser.IODataEntry;
import com.sap.mobile.lib.parser.IODataProperty;
import com.sap.mobile.lib.parser.IODataSchema;
import com.sap.mobile.lib.parser.IODataServiceDocument;
import com.sap.mobile.lib.parser.IParser;
import com.sap.mobile.lib.parser.ODataEntry;
import com.sap.mobile.lib.parser.ParserException;

/**
 * BusinessPartner Entity Type 
 *
 * <br>key (BusinessPartnerID)
 */
public class BusinessPartner extends BaseEntityType 
{
  // BusinessPartner properties
    private String BusinessPartnerID;
    private String BpRole;
    private String EmailAddress;
    private String PhoneNumber;
    private String FaxNumber;
    private String WebAddress;
    private String CompanyName;
    private String LegalForm;
    private String CurrencyCode;
    private String City;
    private String PostalCode;
    private String Street;
    private String Building;
    private String Country;
    private String AddressType;
    private Date AddressValStartDate;
    private Date AddressValEndDate;
    private String CreatedBy;
    private Date CreatedAt;
    private String ChangedBy;
    private Date ChangedAt;

  // reference to the parser
  private IParser parser;
  // reference to the schema
  private IODataSchema schema;

  private DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");

  // BusinessPartner navigation properties
  private  List<SalesOrder> salesorders = null;
  private  List<Contact> contacts = null;

  private static Map<String, String> businesspartnerLabels;

  private static Map<String, String> businesspartnerTypes;  
  
  /**
   * Constructor
   * @param entry
   * @throws MalformedURLException
   */
  public BusinessPartner(final IODataEntry entry, IParser parser, IODataSchema schema) throws MalformedURLException
  {
    super(entry);
    this.BusinessPartnerID =  TypeConverter.getAsString(entry.getPropertyValue("BusinessPartnerID"));
    this.BpRole =  TypeConverter.getAsString(entry.getPropertyValue("BpRole"));
    this.EmailAddress =  TypeConverter.getAsString(entry.getPropertyValue("EmailAddress"));
    this.PhoneNumber =  TypeConverter.getAsString(entry.getPropertyValue("PhoneNumber"));
    this.FaxNumber =  TypeConverter.getAsString(entry.getPropertyValue("FaxNumber"));
    this.WebAddress =  TypeConverter.getAsString(entry.getPropertyValue("WebAddress"));
    this.CompanyName =  TypeConverter.getAsString(entry.getPropertyValue("CompanyName"));
    this.LegalForm =  TypeConverter.getAsString(entry.getPropertyValue("LegalForm"));
    this.CurrencyCode =  TypeConverter.getAsString(entry.getPropertyValue("CurrencyCode"));
    this.City =  TypeConverter.getAsString(entry.getPropertyValue("City"));
    this.PostalCode =  TypeConverter.getAsString(entry.getPropertyValue("PostalCode"));
    this.Street =  TypeConverter.getAsString(entry.getPropertyValue("Street"));
    this.Building =  TypeConverter.getAsString(entry.getPropertyValue("Building"));
    this.Country =  TypeConverter.getAsString(entry.getPropertyValue("Country"));
    this.AddressType =  TypeConverter.getAsString(entry.getPropertyValue("AddressType"));
    this.AddressValStartDate =  TypeConverter.getAsDate(entry.getPropertyValue("AddressValStartDate"));
    this.AddressValEndDate =  TypeConverter.getAsDate(entry.getPropertyValue("AddressValEndDate"));
    this.CreatedBy =  TypeConverter.getAsString(entry.getPropertyValue("CreatedBy"));
    this.CreatedAt =  TypeConverter.getAsDate(entry.getPropertyValue("CreatedAt"));
    this.ChangedBy =  TypeConverter.getAsString(entry.getPropertyValue("ChangedBy"));
    this.ChangedAt =  TypeConverter.getAsDate(entry.getPropertyValue("ChangedAt"));
      this.parser = parser;
        this.schema = schema;
   }
  
  /**
   * BusinessPartner Constructor</br>
   * Dummy values may apply
   *
   */
  public BusinessPartner( String BusinessPartnerID) 
  {
    super(new ODataEntry());
    
        this.setBusinessPartnerID(BusinessPartnerID);
  }

  // BusinessPartner navigation properties

  /**
   * SalesOrders Query
   * @return - ODataQuery
   * @throws - MalformedURLException
   */
  public ODataQuery SalesOrdersQuery() throws MalformedURLException
  {
    String url = getEntry().getId() + "/" + "SalesOrders";
    ODataQuery query = new ODataQuery(url);
    
    return query;
  }

  /**
   * Get SalesOrders  
   * @return - List&ltSalesOrder&gt
   * @throws - IllegalArgumentException, ParserException, MalformedURLException
   */
  public List<SalesOrder> SalesOrders(String data) throws IllegalArgumentException, ParserException, MalformedURLException
  {
    List<SalesOrder> result = null;
      
    List<IODataEntry> parsedSDMODataEntries = getParsedSDMODataEntries(data, parser, schema, "BusinessPartner","SalesOrders");  


    result = new LinkedList<SalesOrder>(); 
  
    for (IODataEntry entry : parsedSDMODataEntries)
    {
      result.add(new SalesOrder(entry, parser, schema));
    }
        return result;
  }

  /**
   * Contacts Query
   * @return - ODataQuery
   * @throws - MalformedURLException
   */
  public ODataQuery ContactsQuery() throws MalformedURLException
  {
    String url = getEntry().getId() + "/" + "Contacts";
    ODataQuery query = new ODataQuery(url);
    
    return query;
  }

  /**
   * Get Contacts  
   * @return - List&ltContact&gt
   * @throws - IllegalArgumentException, ParserException, MalformedURLException
   */
  public List<Contact> Contacts(String data) throws IllegalArgumentException, ParserException, MalformedURLException
  {
    List<Contact> result = null;
      
    List<IODataEntry> parsedSDMODataEntries = getParsedSDMODataEntries(data, parser, schema, "BusinessPartner","Contacts");  


    result = new LinkedList<Contact>(); 
  
    for (IODataEntry entry : parsedSDMODataEntries)
    {
      result.add(new Contact(entry, parser, schema));
    }
        return result;
  }


  /**
   * SalesOrders Load method
   *
   * loads the navigation property entries into the entityType
   * @throws ParserException 
   * @throws IllegalArgumentException
   * @throws MalformedURLException
   *
   */
  public void loadSalesOrders(String data) throws IllegalArgumentException, ParserException, MalformedURLException
  {
    List<SalesOrder> semanticData = SalesOrders(data);
    setSalesOrders(semanticData);
  }

  /**
   * Contacts Load method
   *
   * loads the navigation property entries into the entityType
   * @throws ParserException 
   * @throws IllegalArgumentException
   * @throws MalformedURLException
   *
   */
  public void loadContacts(String data) throws IllegalArgumentException, ParserException, MalformedURLException
  {
    List<Contact> semanticData = Contacts(data);
    setContacts(semanticData);
  }

  // BusinessPartner properties getters and setters
    
  /**
   * @return - String Bus. Part. ID
   */
  public String getBusinessPartnerID()
  {
    return this.BusinessPartnerID;
  }
  
  /**
   * @param BusinessPartnerID - Bus. Part. ID
   */
  public void setBusinessPartnerID(String BusinessPartnerID)
  {
    this.BusinessPartnerID = BusinessPartnerID;
    
    getEntry().putPropertyValue("BusinessPartnerID", BusinessPartnerID);
  }
    
  /**
   * @return - String Bus. Part. Role
   */
  public String getBpRole()
  {
    return this.BpRole;
  }
  
  /**
   * @param BpRole - Bus. Part. Role
   */
  public void setBpRole(String BpRole)
  {
    this.BpRole = BpRole;
    
    getEntry().putPropertyValue("BpRole", BpRole);
  }
    
  /**
   * @return - String E-Mail Address
   */
  public String getEmailAddress()
  {
    return this.EmailAddress;
  }
  
  /**
   * @param EmailAddress - E-Mail Address
   */
  public void setEmailAddress(String EmailAddress)
  {
    this.EmailAddress = EmailAddress;
    
    getEntry().putPropertyValue("EmailAddress", EmailAddress);
  }
    
  /**
   * @return - String Phone No.
   */
  public String getPhoneNumber()
  {
    return this.PhoneNumber;
  }
  
  /**
   * @param PhoneNumber - Phone No.
   */
  public void setPhoneNumber(String PhoneNumber)
  {
    this.PhoneNumber = PhoneNumber;
    
    getEntry().putPropertyValue("PhoneNumber", PhoneNumber);
  }
    
  /**
   * @return - String Phone No.
   */
  public String getFaxNumber()
  {
    return this.FaxNumber;
  }
  
  /**
   * @param FaxNumber - Phone No.
   */
  public void setFaxNumber(String FaxNumber)
  {
    this.FaxNumber = FaxNumber;
    
    getEntry().putPropertyValue("FaxNumber", FaxNumber);
  }
    
  /**
   * @return - String Description
   */
  public String getWebAddress()
  {
    return this.WebAddress;
  }
  
  /**
   * @param WebAddress - Description
   */
  public void setWebAddress(String WebAddress)
  {
    this.WebAddress = WebAddress;
    
    getEntry().putPropertyValue("WebAddress", WebAddress);
  }
    
  /**
   * @return - String Company Name
   */
  public String getCompanyName()
  {
    return this.CompanyName;
  }
  
  /**
   * @param CompanyName - Company Name
   */
  public void setCompanyName(String CompanyName)
  {
    this.CompanyName = CompanyName;
    
    getEntry().putPropertyValue("CompanyName", CompanyName);
  }
    
  /**
   * @return - String Legal Form
   */
  public String getLegalForm()
  {
    return this.LegalForm;
  }
  
  /**
   * @param LegalForm - Legal Form
   */
  public void setLegalForm(String LegalForm)
  {
    this.LegalForm = LegalForm;
    
    getEntry().putPropertyValue("LegalForm", LegalForm);
  }
    
  /**
   * @return - String Currency
   */
  public String getCurrencyCode()
  {
    return this.CurrencyCode;
  }
  
  /**
   * @param CurrencyCode - Currency
   */
  public void setCurrencyCode(String CurrencyCode)
  {
    this.CurrencyCode = CurrencyCode;
    
    getEntry().putPropertyValue("CurrencyCode", CurrencyCode);
  }
    
  /**
   * @return - String City
   */
  public String getCity()
  {
    return this.City;
  }
  
  /**
   * @param City - City
   */
  public void setCity(String City)
  {
    this.City = City;
    
    getEntry().putPropertyValue("City", City);
  }
    
  /**
   * @return - String Postal Code
   */
  public String getPostalCode()
  {
    return this.PostalCode;
  }
  
  /**
   * @param PostalCode - Postal Code
   */
  public void setPostalCode(String PostalCode)
  {
    this.PostalCode = PostalCode;
    
    getEntry().putPropertyValue("PostalCode", PostalCode);
  }
    
  /**
   * @return - String Street
   */
  public String getStreet()
  {
    return this.Street;
  }
  
  /**
   * @param Street - Street
   */
  public void setStreet(String Street)
  {
    this.Street = Street;
    
    getEntry().putPropertyValue("Street", Street);
  }
    
  /**
   * @return - String Building
   */
  public String getBuilding()
  {
    return this.Building;
  }
  
  /**
   * @param Building - Building
   */
  public void setBuilding(String Building)
  {
    this.Building = Building;
    
    getEntry().putPropertyValue("Building", Building);
  }
    
  /**
   * @return - String Country
   */
  public String getCountry()
  {
    return this.Country;
  }
  
  /**
   * @param Country - Country
   */
  public void setCountry(String Country)
  {
    this.Country = Country;
    
    getEntry().putPropertyValue("Country", Country);
  }
    
  /**
   * @return - String Address Type
   */
  public String getAddressType()
  {
    return this.AddressType;
  }
  
  /**
   * @param AddressType - Address Type
   */
  public void setAddressType(String AddressType)
  {
    this.AddressType = AddressType;
    
    getEntry().putPropertyValue("AddressType", AddressType);
  }
    
  /**
   * @return - Date Time Stamp
   */
  public Date getAddressValStartDate()
  {
    return this.AddressValStartDate;
  }
  
  /**
   * @param AddressValStartDate - Time Stamp
   */
  public void setAddressValStartDate(Date AddressValStartDate)
  {
    this.AddressValStartDate = AddressValStartDate;
    
    getEntry().putPropertyValue("AddressValStartDate", dateFormat.format(AddressValStartDate));
  }
    
  /**
   * @return - Date Time Stamp
   */
  public Date getAddressValEndDate()
  {
    return this.AddressValEndDate;
  }
  
  /**
   * @param AddressValEndDate - Time Stamp
   */
  public void setAddressValEndDate(Date AddressValEndDate)
  {
    this.AddressValEndDate = AddressValEndDate;
    
    getEntry().putPropertyValue("AddressValEndDate", dateFormat.format(AddressValEndDate));
  }
    
  /**
   * @return - String Employee ID
   */
  public String getCreatedBy()
  {
    return this.CreatedBy;
  }
  
  /**
   * @param CreatedBy - Employee ID
   */
  public void setCreatedBy(String CreatedBy)
  {
    this.CreatedBy = CreatedBy;
    
    getEntry().putPropertyValue("CreatedBy", CreatedBy);
  }
    
  /**
   * @return - Date Time Stamp
   */
  public Date getCreatedAt()
  {
    return this.CreatedAt;
  }
  
  /**
   * @param CreatedAt - Time Stamp
   */
  public void setCreatedAt(Date CreatedAt)
  {
    this.CreatedAt = CreatedAt;
    
    getEntry().putPropertyValue("CreatedAt", dateFormat.format(CreatedAt));
  }
    
  /**
   * @return - String Employee ID
   */
  public String getChangedBy()
  {
    return this.ChangedBy;
  }
  
  /**
   * @param ChangedBy - Employee ID
   */
  public void setChangedBy(String ChangedBy)
  {
    this.ChangedBy = ChangedBy;
    
    getEntry().putPropertyValue("ChangedBy", ChangedBy);
  }
    
  /**
   * @return - Date Time Stamp
   */
  public Date getChangedAt()
  {
    return this.ChangedAt;
  }
  
  /**
   * @param ChangedAt - Time Stamp
   */
  public void setChangedAt(Date ChangedAt)
  {
    this.ChangedAt = ChangedAt;
    
    getEntry().putPropertyValue("ChangedAt", dateFormat.format(ChangedAt));
  }
  
  /**
   * @return - representation of the Entity Type object in OData4SAP format
   */
  public String getStringPayload()  
  {
    String xml = null;
    
    xml = getEntry().toXMLString();
      
    return xml;
  }
  
  /**
   * @return - self ODataQuery object
   * @throws MalformedURLException 
   */
  public ODataQuery getEntityQuery() throws MalformedURLException  
  {
    return new ODataQuery(getEntry().getSelfLink().getUrl());
  }
  
  /**
   * @return - the date format.
   */
  public DateFormat getDateFormat()
  {
    return this.dateFormat;
  }

  // BusinessPartner navigation properties setters and getters
  
  /**
   * Returns navigation property
   * Returns null if was not expanded
   * @throws MalformedURLException
   */
  public List<SalesOrder> getSalesOrders() throws MalformedURLException
  {
    if (null == salesorders)
    {
      //load InlineEntries for SalesOrders
      List<IODataEntry> inlineEntries  = getInlineEntries(getEntry(),"SalesOrders");

      if (null != inlineEntries) 
      {
        salesorders = new LinkedList<SalesOrder>();
        for (IODataEntry isdmoDataEntry : inlineEntries) 
        {
          salesorders.add(new SalesOrder(isdmoDataEntry, parser, schema));
        }
      }
    }
    return salesorders;
  }

  /**
   * Sets navigation property
   * @param salesorders - the navigation property to set.
   */
  public void setSalesOrders(List<SalesOrder> salesorders) 
  {
    this.salesorders = salesorders;
  }
  
  /**
   * Returns navigation property
   * Returns null if was not expanded
   * @throws MalformedURLException
   */
  public List<Contact> getContacts() throws MalformedURLException
  {
    if (null == contacts)
    {
      //load InlineEntries for Contacts
      List<IODataEntry> inlineEntries  = getInlineEntries(getEntry(),"Contacts");

      if (null != inlineEntries) 
      {
        contacts = new LinkedList<Contact>();
        for (IODataEntry isdmoDataEntry : inlineEntries) 
        {
          contacts.add(new Contact(isdmoDataEntry, parser, schema));
        }
      }
    }
    return contacts;
  }

  /**
   * Sets navigation property
   * @param contacts - the navigation property to set.
   */
  public void setContacts(List<Contact> contacts) 
  {
    this.contacts = contacts;
  }
  

  /**
    * Static method that loads all of the entity type property labels. 
    * This method is called when the service class is initialized.
    * @param service Service document object containing all of the entity type properties.
     */  
    public static void loadLabels(IODataServiceDocument service)
    {
      List<IODataProperty> properties = getSchemaPropertiesFromCollection(service, "BusinessPartnerCollection" );
        
      businesspartnerLabels = new HashMap<String, String>();
      businesspartnerTypes = new HashMap<String, String>();
      
      if (properties != null)
      {
          for (IODataProperty property : properties) 
          {
            businesspartnerLabels.put(property.getName(), property.getLabel());
            businesspartnerTypes.put(property.getName(), property.getType());
      }
      }
    }
    
    
    /**
    * Static method that returns the type for a given property name.
    * @param propertyName Property name.
    * @return Property label.
     */
    public static String getTypeForProperty(String propertyName)
    {
        return getLabelFromDictionary(businesspartnerTypes, propertyName);
    }
    
    
    /**
    * Static method that returns the label for a given property name.
    * @param propertyName Property name.
    * @return Property label.
     */
    public static String getLabelForProperty(String propertyName)
    {
        return getLabelFromDictionary(businesspartnerLabels, propertyName);
    }
}




Java Source Code List

com.capgemini.SalesOrder.LoginActivity.java
com.capgemini.SalesOrder.Page1ListActivity.java
com.capgemini.SalesOrder.Page1ListAdapter.java
com.capgemini.SalesOrder.Page2ListActivity.java
com.capgemini.SalesOrder.Page2ListAdapter.java
com.capgemini.SalesOrder.Page3ListActivity.java
com.capgemini.SalesOrder.Page3ListAdapter.java
com.capgemini.SalesOrder.Page4DetailsActivity.java
com.capgemini.SalesOrder.Page4DetailsAdapter.java
com.capgemini.SalesOrder.Page5DetailsActivity.java
com.capgemini.SalesOrder.Page5DetailsAdapter.java
com.capgemini.SalesOrder.Page6DetailsActivity.java
com.capgemini.SalesOrder.Page6DetailsAdapter.java
com.capgemini.SalesOrder.SplashScreen.java
com.capgemini.SalesOrder.preferences.GatewaySettingsPreferencesActivity.java
com.capgemini.SalesOrder.preferences.MainPreferencesActivity.java
com.capgemini.SalesOrder.preferences.PreferencesUtilities.java
com.capgemini.SalesOrder.preferences.SUPSettingsPreferencesActivity.java
com.capgemini.SalesOrder.zgwsample_srv.ServiceVersionConfigurations.java
com.capgemini.SalesOrder.zgwsample_srv.v0.ZGWSAMPLE_SRVRequestHandler.java
com.capgemini.SalesOrder.zgwsample_srv.v0.ZGWSAMPLE_SRVService.java
com.capgemini.SalesOrder.zgwsample_srv.v0.entitytypes.BusinessPartner.java
com.capgemini.SalesOrder.zgwsample_srv.v0.entitytypes.Contact.java
com.capgemini.SalesOrder.zgwsample_srv.v0.entitytypes.Product.java
com.capgemini.SalesOrder.zgwsample_srv.v0.entitytypes.SalesOrderLineItem.java
com.capgemini.SalesOrder.zgwsample_srv.v0.entitytypes.SalesOrder.java
com.capgemini.SalesOrder.zgwsample_srv.v0.helpers.IZGWSAMPLE_SRVRequestHandlerListener.java
com.capgemini.SalesOrder.zgwsample_srv.v0.helpers.ListenerWrapper.java
com.capgemini.SalesOrder.zgwsample_srv.v0.helpers.ZGWSAMPLE_SRVLoginAsyncTask.java
com.capgemini.SalesOrder.zgwsample_srv.v0.helpers.ZGWSAMPLE_SRVRequestID.java