// Path: src/com/emop/client/Constants.java
// public class Constants {
// 	public static final String APP_ID = "";
// 	public static final String TAG_EMOP = "emop";
// 	
// 	public static final String PREFS_NAME = "taodianhuo_perfs";
// 	
// 	public static final String PREFS_OAUTH_ID = "fmei_user_id";
// 	public static final String PREFS_TRACK_ID = "track_user_id";
// 	
// 	public static final String PREFS_SINA_ACCESS_TOKEN = "sina_access_token";
// 	public static final String PREFS_SINA_EXPIRES_IN = "sina_expires_in";
// 	
// 	public static final String PREFS_SINA_UID = "sina_uid";
// 	public static final String PREFS_SINA_NICK = "sina_nick";	
// 	
// 	public static final String PREFS_TAOBAO_UID = "taobao_uid";
// 	public static final String PREFS_TAOBAO_NICK = "taobao_nick";	
// 
// 	public static final String PREFS_QQ_UID = "qq_uid";
// 	public static final String PREFS_QQ_NICK = "qq_nick";	
// 
// 	public static final String PREFS_SINA_FRIENDS = "sina_friends";
// 	
// 	public static final String WEB_LINK = "http://taodianhuo.sinaapp.com/weixin/app/%s/%s/%s";
// 	public static final String WEB_SHOP_LINK = "http://taodianhuo.sinaapp.com/weixin/app_shop/%s/%s/%s";
// 
// 	
// 	public static final String TAOBAO_APPID = "21354558";
// 	public static final String TAOBAO_APPKEY = "c98beaf78fe3d66e69461a1e33724755";
// 	public static final String SINA_APPID = "746315760";
// 	public static final String SINA_APPKEY = "8f4f1311a7de7edb3ff4a1f059ead530";
// 	public static final String SINA_CALLBACK = "https://api.weibo.com/oauth2/default.html";
// 	
// 	
// 	public static final String AUTH_REF_SINA = "sina";
// 	public static final String AUTH_REF_TAOBAO = "taobao";
// 	public static final String AUTH_REF_QQ = "qq";
// 
// 	
// }
// 
// Path: src/com/emop/client/provider/QueryParam.java
// public class QueryParam {
// 	public final static String PAGE_SIZE = "pageSize";
// 	public final static String PAGE_NO = "pageNo";
// 	
// 	public String selection;
// 	public String[] selectionArgs;
// 	public String sortOrder;
// 	public String groupBy;
// 	public String having;
// 	public QueryParam(String sel, String[] args, String order){
// 		this.selection = sel;
// 		this.selectionArgs = args;
// 		this.sortOrder = order;
// 	}
// }


import java.util.List;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.ContentValues;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteQueryBuilder;
import android.net.Uri;
import android.provider.BaseColumns;
import android.util.Log;
import com.emop.client.Constants;
import com.emop.client.provider.QueryParam;

package com.emop.client.provider.model;





public class Shop {
    public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.fmei.shops";
    public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.fmei.shop";
	
	public static final String DB_TABLE_NAME = "shop";
	
	public static final String LOCAL_CATE = "local_cate";
	public static final String SHORT_KEY = "short_url_key";
	public static final String SHOP_ID = "shop_id";

	public static final String ROOT_CATE = "root_tag";
	public static final String USER_NICK = "user_nick";
	public static final String SHOP_TYPE = "shop_type";	
	public static final String GOOD_COMMENT = "good_comment";

	public static final String SHOP_TITLE = "shop_title";
	public static final String SHOP_DESC = "shop_desc";
	public static final String SHOP_LOGO = "pic_path";

	public static final String SHOP_CREDIT = "seller_credit";
	
	public static final String STATUS = "status";
	public static final String UPDATE_TIME = "update_time";
	public static final String LOCAL_UPDATE_TIME = "local_update";
	public static final String WEIGHT = "weight";
	
	public static Uri update(SQLiteDatabase db, Uri uri, ContentValues values){
		
		String taskId = values.getAsString(SHOP_ID);
		//values.remove("id");
		List<String> seg = uri.getPathSegments(); //.get(1);
		values.put(LOCAL_UPDATE_TIME, System.currentTimeMillis());
        int count = db.update(DB_TABLE_NAME, values, BaseColumns._ID + "=?", new String[]{taskId});
		if(count == 0){
			//Log.d(Constants.TAG_EMOP, String.format("insert new item '%s:%s'", taskId,
			//		values.getAsString(WEIBO_ID)));
			values.put(BaseColumns._ID, taskId);

// Path: src/com/emop/client/Constants.java
// public class Constants {
// 	public static final String APP_ID = "";
// 	public static final String TAG_EMOP = "emop";
// 	
// 	public static final String PREFS_NAME = "taodianhuo_perfs";
// 	
// 	public static final String PREFS_OAUTH_ID = "fmei_user_id";
// 	public static final String PREFS_TRACK_ID = "track_user_id";
// 	
// 	public static final String PREFS_SINA_ACCESS_TOKEN = "sina_access_token";
// 	public static final String PREFS_SINA_EXPIRES_IN = "sina_expires_in";
// 	
// 	public static final String PREFS_SINA_UID = "sina_uid";
// 	public static final String PREFS_SINA_NICK = "sina_nick";	
// 	
// 	public static final String PREFS_TAOBAO_UID = "taobao_uid";
// 	public static final String PREFS_TAOBAO_NICK = "taobao_nick";	
// 
// 	public static final String PREFS_QQ_UID = "qq_uid";
// 	public static final String PREFS_QQ_NICK = "qq_nick";	
// 
// 	public static final String PREFS_SINA_FRIENDS = "sina_friends";
// 	
// 	public static final String WEB_LINK = "http://taodianhuo.sinaapp.com/weixin/app/%s/%s/%s";
// 	public static final String WEB_SHOP_LINK = "http://taodianhuo.sinaapp.com/weixin/app_shop/%s/%s/%s";
// 
// 	
// 	public static final String TAOBAO_APPID = "21354558";
// 	public static final String TAOBAO_APPKEY = "c98beaf78fe3d66e69461a1e33724755";
// 	public static final String SINA_APPID = "746315760";
// 	public static final String SINA_APPKEY = "8f4f1311a7de7edb3ff4a1f059ead530";
// 	public static final String SINA_CALLBACK = "https://api.weibo.com/oauth2/default.html";
// 	
// 	
// 	public static final String AUTH_REF_SINA = "sina";
// 	public static final String AUTH_REF_TAOBAO = "taobao";
// 	public static final String AUTH_REF_QQ = "qq";
// 
// 	
// }
// 
// Path: src/com/emop/client/provider/QueryParam.java
// public class QueryParam {
// 	public final static String PAGE_SIZE = "pageSize";
// 	public final static String PAGE_NO = "pageNo";
// 	
// 	public String selection;
// 	public String[] selectionArgs;
// 	public String sortOrder;
// 	public String groupBy;
// 	public String having;
// 	public QueryParam(String sel, String[] args, String order){
// 		this.selection = sel;
// 		this.selectionArgs = args;
// 		this.sortOrder = order;
// 	}
// }


// Path: src/com/emop/client/provider/model/Shop.java
import java.util.List;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.ContentValues;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteQueryBuilder;
import android.net.Uri;
import android.provider.BaseColumns;
import android.util.Log;
import com.emop.client.Constants;
import com.emop.client.provider.QueryParam;

package com.emop.client.provider.model;





public class Shop {
    public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.fmei.shops";
    public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.fmei.shop";
	
	public static final String DB_TABLE_NAME = "shop";
	
	public static final String LOCAL_CATE = "local_cate";
	public static final String SHORT_KEY = "short_url_key";
	public static final String SHOP_ID = "shop_id";

	public static final String ROOT_CATE = "root_tag";
	public static final String USER_NICK = "user_nick";
	public static final String SHOP_TYPE = "shop_type";	
	public static final String GOOD_COMMENT = "good_comment";

	public static final String SHOP_TITLE = "shop_title";
	public static final String SHOP_DESC = "shop_desc";
	public static final String SHOP_LOGO = "pic_path";

	public static final String SHOP_CREDIT = "seller_credit";
	
	public static final String STATUS = "status";
	public static final String UPDATE_TIME = "update_time";
	public static final String LOCAL_UPDATE_TIME = "local_update";
	public static final String WEIGHT = "weight";
	
	public static Uri update(SQLiteDatabase db, Uri uri, ContentValues values){
		
		String taskId = values.getAsString(SHOP_ID);
		//values.remove("id");
		List<String> seg = uri.getPathSegments(); //.get(1);
		values.put(LOCAL_UPDATE_TIME, System.currentTimeMillis());
        int count = db.update(DB_TABLE_NAME, values, BaseColumns._ID + "=?", new String[]{taskId});
		if(count == 0){
			//Log.d(Constants.TAG_EMOP, String.format("insert new item '%s:%s'", taskId,
			//		values.getAsString(WEIBO_ID)));
			values.put(BaseColumns._ID, taskId);

			db.insert(DB_TABLE_NAME, SHOP_ID, values);
