
package com.uwetrottmann.shopr.provider;

import android.net.Uri;
import android.provider.BaseColumns;

public class ShoprContract {

    public static final String CONTENT_AUTHORITY = "com.uwetrottmann.shopr.provider";

    interface ItemsColumns {
        String CLOTHING_TYPE = "item_clothing_type";

        String BRAND = "item_brand";

        String SEX = "item_sex";

        String COLOR = "item_color";

        String PRICE = "item_price";

        String IMAGE_URL = "item_image";
    }

    interface ShopsColumns {
        /** NOT in this table! Used to reference ID from other tables. */
        String REF_SHOP_ID = "shop_id";

        String NAME = "shop_name";

        String LAT = "shop_lat";

        String LONG = "shop_long";

        String OPENING_HOURS = "shop_opening_hours";
    }

    private static final Uri BASE_CONTENT_URI = Uri.parse("content://"
            + CONTENT_AUTHORITY);

    public static final String PATH_ITEMS = "items";

    public static final String PATH_SHOPS = "shops";

    /**
     * Represents clothing items.
     */
    public static class Items implements ItemsColumns, BaseColumns {
        public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon()
                .appendPath(PATH_ITEMS).build();

        /** Use if multiple items get returned */
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.shopr.item";

        /** Use if a single item is returned */
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.shopr.item";

        public static Uri buildItemUri(int itemId) {
            return CONTENT_URI.buildUpon().appendPath(String.valueOf(itemId))
                    .build();
        }

        public static String getItemId(Uri uri) {
            return uri.getLastPathSegment();
        }
    }

    /**
     * Represents shops where clothing items are available for purchase.
     */
    public static class Shops implements ShopsColumns, BaseColumns {
        public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon()
                .appendPath(PATH_SHOPS).build();

        /** Use if multiple items get returned */
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.shopr.shop";

        /** Use if a single item is returned */
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.shopr.shop";

        public static Uri buildShopUri(int shopId) {
            return CONTENT_URI.buildUpon().appendPath(String.valueOf(shopId))
                    .build();
        }

        public static String getShopId(Uri uri) {
            return uri.getLastPathSegment();
        }
    }
}

@@ -800,24 +800,237 @@
 rs%22;%0A    %7D%0A%0A
+    interface StatsColumns %7B%0A        String USERNAME = %22stats_user%22;%0A%0A        String DURATION = %22stats_duration%22;%0A%0A        String CYCLE_COUNT = %22stats_cycles%22;%0A%0A        String TASK_TYPE = %22stats_tasktype%22;%0A    %7D%0A%0A
     private 
@@ -1227,24 +1227,78 @@
 = %22shops%22;%0A%0A
+    public static final String PATH_STATS = %22stats%22;%0A%0A
     /**%0A    
@@ -2954,11 +2954,850 @@
  %7D%0A    %7D
+%0A%0A    /**%0A     * Represents statistics items from one user task.%0A     */%0A    public static class Stats implements StatsColumns, BaseColumns %7B%0A        public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon()%0A                .appendPath(PATH_STATS).build();%0A%0A        /** Use if multiple items get returned */%0A        public static final String CONTENT_TYPE = %22vnd.android.cursor.dir/vnd.shopr.stats%22;%0A%0A        /** Use if a single item is returned */%0A        public static final String CONTENT_ITEM_TYPE = %22vnd.android.cursor.item/vnd.shopr.stats%22;%0A%0A        public static Uri buildStatUri(int statId) %7B%0A            return CONTENT_URI.buildUpon().appendPath(String.valueOf(statId))%0A                    .build();%0A        %7D%0A%0A        public static String getStatId(Uri uri) %7B%0A            return uri.getLastPathSegment();%0A        %7D%0A    %7D
 %0A%7D%0A

Add stats to contract.