Android Open Source - meets-android Meets






From Project

Back to project page meets-android.

License

The source code is released under:

MIT License

If you think the Android project meets-android 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.theagilemonkeys.meets;
//  w ww.j a va  2 s.c o m
import android.content.Context;

import com.octo.android.robospice.SpiceManager;
import com.theagilemonkeys.meets.magento.RestApiMethod;
import com.theagilemonkeys.meets.magento.SoapApiMethod;
import com.theagilemonkeys.meets.models.base.MeetsFactory;
import com.theagilemonkeys.meets.models.base.MeetsListener;

/**
 * Android Meets SDK
 * Original work Copyright (c) 2014 [TheAgileMonkeys]
 *
 * @author ??lvaro Lpez Espinosa
 */
public class Meets {
    private static final String restBaseUrl = "/api/rest/";
    private static final String soapBaseUrl = "/api/v2_soap/";
    private static final String soapWsdl = "/api/v2_soap/?wsdl";
    public static int storeId;
    public static int websiteId;

    static MeetsListener globalListener = new MeetsListener.Empty();

    // Package private spiceManager.
    static SpiceManager spiceManager = new SpiceManager(MeetsSpiceService.class);

    /**
     * Initializer method for Meets. You will usually call it in your {@code App.onCreate} method.
     * @param applicationContext The application context
     * @param factory The MeetsFactory implementation instance that will be used.
     *                Now only {@link com.theagilemonkeys.meets.magento.models.base.MageMeetsFactory MageMeetsFactory} is supported
     * @param hostUrl The url of your e-commerce host. For example: {@code "http://www.example.com" }
     * @param soapApiUser The SOAP API user of your host
     * @param soapApiPass The SOAP API password of your host
     */
    public static void init(Context applicationContext, MeetsFactory factory, String hostUrl, String soapApiUser, String soapApiPass) {
        spiceManager.start(applicationContext);
        MeetsFactory.setInstance(factory);
        SoapApiMethod.soapApiUser = soapApiUser;
        SoapApiMethod.soapApiPass = soapApiPass;

        RestApiMethod.baseUrl = hostUrl.replaceAll("/$", "") + restBaseUrl;
        SoapApiMethod.baseUrl = hostUrl.replaceAll("/$", "") + soapBaseUrl;
        SoapApiMethod.soapNamespace = hostUrl.replaceAll("/$", "") + soapWsdl;
    }

    public static void init(Context applicationContext, MeetsFactory factory, String hostUrl, String soapApiUser, String soapApiPassword,
                            int storeId, int websiteId) {
        init(applicationContext, factory, hostUrl, soapApiUser, soapApiPassword);
        Meets.storeId = storeId;
        Meets.websiteId = websiteId;
        // In Magento Soap API, "store" param has different names among functions
        ApiMethod.fixedParams.put("store", storeId);
        ApiMethod.fixedParams.put("storeId", storeId);
        ApiMethod.fixedParams.put("storeView", storeId);
    }

    public static void init(Context applicationContext, MeetsFactory factory, String hostUrl, String soapApiUser, String soapApiPass,
                            int storeId, int websiteId, String basicAuthUser, String basicAuthPassword) {
        init(applicationContext, factory, hostUrl, soapApiUser, soapApiPass, storeId, websiteId);
        RestApiMethod.setBasicAuth(basicAuthUser, basicAuthPassword);
        SoapApiMethod.setBasicAuth(basicAuthUser, basicAuthPassword);
    }

    /**
     * Sets a global listener that it's always called after any specific listener.
     * @param listener A instance of MeetsListener. Be careful if you pass a non static inner class instance here,
     *                 because it keeps a reference to parent class. If it is an Activity, there will be a potential
     *                 memory leak (This doesn't happen when parent class is the Application)
     */
    public static void setGlobalListener(MeetsListener listener) {
        globalListener = listener;
    }
}




Java Source Code List

com.theagilemonkeys.meets.ApiMethodModelHelperInterface.java
com.theagilemonkeys.meets.ApiMethodModelHelper.java
com.theagilemonkeys.meets.ApiMethod.java
com.theagilemonkeys.meets.MeetsSpiceService.java
com.theagilemonkeys.meets.Meets.java
com.theagilemonkeys.meets.magento.RestApiMethod.java
com.theagilemonkeys.meets.magento.SoapApiMethod.java
com.theagilemonkeys.meets.magento.methods.CatalogCategoryInfo.java
com.theagilemonkeys.meets.magento.methods.CatalogCategoryLevel.java
com.theagilemonkeys.meets.magento.methods.CatalogCategoryTree.java
com.theagilemonkeys.meets.magento.methods.CatalogInventoryStockItemList.java
com.theagilemonkeys.meets.magento.methods.CatalogProductAttributeOptions.java
com.theagilemonkeys.meets.magento.methods.CatalogProductInfo.java
com.theagilemonkeys.meets.magento.methods.CatalogProductList.java
com.theagilemonkeys.meets.magento.methods.CustomerAddressCreate.java
com.theagilemonkeys.meets.magento.methods.CustomerAddressDelete.java
com.theagilemonkeys.meets.magento.methods.CustomerAddressInfo.java
com.theagilemonkeys.meets.magento.methods.CustomerAddressList.java
com.theagilemonkeys.meets.magento.methods.CustomerAddressUpdate.java
com.theagilemonkeys.meets.magento.methods.CustomerCustomerCreate.java
com.theagilemonkeys.meets.magento.methods.CustomerCustomerInfo.java
com.theagilemonkeys.meets.magento.methods.CustomerCustomerList.java
com.theagilemonkeys.meets.magento.methods.CustomerCustomerUpdate.java
com.theagilemonkeys.meets.magento.methods.Products.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartCreate.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartCustomerAddresses.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartCustomerSet.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartInfo.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartOrder.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartPaymentList.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartPaymentMethod.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartProductAdd.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartProductRemove.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartShippingList.java
com.theagilemonkeys.meets.magento.methods.ShoppingCartShippingMethod.java
com.theagilemonkeys.meets.magento.models.MageMeetsAddress.java
com.theagilemonkeys.meets.magento.models.MageMeetsCartItem.java
com.theagilemonkeys.meets.magento.models.MageMeetsCartPayment.java
com.theagilemonkeys.meets.magento.models.MageMeetsCartShipping.java
com.theagilemonkeys.meets.magento.models.MageMeetsCart.java
com.theagilemonkeys.meets.magento.models.MageMeetsCategory.java
com.theagilemonkeys.meets.magento.models.MageMeetsCustomer.java
com.theagilemonkeys.meets.magento.models.MageMeetsProduct.java
com.theagilemonkeys.meets.magento.models.MageStockInfoList.java
com.theagilemonkeys.meets.magento.models.MageStockItem.java
com.theagilemonkeys.meets.magento.models.base.MageMeetsCollectionPojos.java
com.theagilemonkeys.meets.magento.models.base.MageMeetsCollection.java
com.theagilemonkeys.meets.magento.models.base.MageMeetsFactory.java
com.theagilemonkeys.meets.magento.models.base.MageMeetsModel.java
com.theagilemonkeys.meets.models.MeetsAddress.java
com.theagilemonkeys.meets.models.MeetsCart.java
com.theagilemonkeys.meets.models.MeetsCategory.java
com.theagilemonkeys.meets.models.MeetsCustomer.java
com.theagilemonkeys.meets.models.MeetsProduct.java
com.theagilemonkeys.meets.models.MeetsStock.java
com.theagilemonkeys.meets.models.base.MeetsCollectionPojos.java
com.theagilemonkeys.meets.models.base.MeetsCollection.java
com.theagilemonkeys.meets.models.base.MeetsFactory.java
com.theagilemonkeys.meets.models.base.MeetsListener.java
com.theagilemonkeys.meets.models.base.MeetsModel.java
com.theagilemonkeys.meets.utils.Copier.java
com.theagilemonkeys.meets.utils.StringUtils.java
com.theagilemonkeys.meets.utils.soap.Serializable.java
com.theagilemonkeys.meets.utils.soap.SoapParser.java