// Path: lampshade/src/main/java/eu/prismsw/lampshade/database/SavedArticlesHelper.java
// public class SavedArticlesHelper extends SQLiteOpenHelper {
// 	
// 	public static final String TABLE_SAVED = "saved";
//     public static final String TABLE_RECENT = "recent";
//     public static final String TABLE_FAVORITE = "favorite";
// 
// 	public static final String ARTICLES_COLUMN_ID = "_id";
// 	public static final String ARTICLES_COLUMN_TITLE = "title";
// 	public static final String ARTICLES_COLUMN_URL = "url";
// 
// 	protected static final String DATABASE_NAME = "saved_articles.db";
// 	protected static final int DATABASE_VERSION = 2;
// 
//     public SavedArticlesHelper(Context context) {
// 		super(context, DATABASE_NAME, null, DATABASE_VERSION);
// 	}
// 	
// 	public SavedArticlesHelper(Context context, String name, CursorFactory factory, int version) {
// 		super(context, name, factory, version);
// 	}
// 
// 	@Override
// 	public void onCreate(SQLiteDatabase db) {
//         createTable(db, TABLE_SAVED);
//         createTable(db, TABLE_RECENT);
//         createTable(db, TABLE_FAVORITE);
// 	}
// 
//     private void createTable (SQLiteDatabase db, String table) {
//         db.execSQL("create table " + table + "( "
//                 + ARTICLES_COLUMN_ID + " integer primary key autoincrement, "
//                 + ARTICLES_COLUMN_TITLE + " text not null, "
//                 + ARTICLES_COLUMN_URL + " text not null" + ");");
//     }
// 
// 	@Override
// 	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// 		db.execSQL("DROP TABLE IF EXISTS " + TABLE_SAVED);
//         db.execSQL("DROP TABLE IF EXISTS " + TABLE_RECENT);
//         db.execSQL("DROP TABLE IF EXISTS " + TABLE_FAVORITE);
// 		onCreate(db);
// 	}
// }


import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteQueryBuilder;
import android.net.Uri;
import android.text.TextUtils;
import eu.prismsw.lampshade.database.SavedArticlesHelper;
package eu.prismsw.lampshade.providers;


public class ArticleProvider extends ContentProvider {
    private static final String AUTHORITY = "eu.prismsw.lampshade.providers.articleprovider";
    private static final String ARTICLES_BASE_PATH = "articles";

    public static final int ARTICLES_SAVED = 10;
    public static final int ARTICLES_SAVED_ID = 11;
    public static final int ARTICLES_SAVED_TITLE = 12;

    public static final int ARTICLES_FAV = 20;
    public static final int ARTICLES_FAV_ID = 21;
    public static final int ARTICLES_FAV_TITLE = 22;

    public static final int ARTICLES_RECENT = 30;
    public static final int ARTICLES_RECENT_ID = 31;
    public static final int ARTICLES_RECENT_TITLE = 32;

    public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/" + ARTICLES_BASE_PATH);
    public static final Uri SAVED_URI = CONTENT_URI.buildUpon().appendPath("saved").build();
    public static final Uri FAV_URI = CONTENT_URI.buildUpon().appendPath("favorites").build();
    public static final Uri RECENT_URI = CONTENT_URI.buildUpon().appendPath("recent").build();

    private static UriMatcher matcher = new UriMatcher(UriMatcher.NO_MATCH);
    static {
        matcher.addURI(AUTHORITY, ARTICLES_BASE_PATH + "/saved", ARTICLES_SAVED);
        matcher.addURI(AUTHORITY, ARTICLES_BASE_PATH + "/saved/id/#", ARTICLES_SAVED_ID);
        matcher.addURI(AUTHORITY, ARTICLES_BASE_PATH + "/saved/title/*", ARTICLES_SAVED_TITLE);

        matcher.addURI(AUTHORITY, ARTICLES_BASE_PATH + "/favorites", ARTICLES_FAV);
        matcher.addURI(AUTHORITY, ARTICLES_BASE_PATH + "/favorites/id/#", ARTICLES_FAV_ID);
        matcher.addURI(AUTHORITY, ARTICLES_BASE_PATH + "/favorites/title/*", ARTICLES_FAV_TITLE);

        matcher.addURI(AUTHORITY, ARTICLES_BASE_PATH + "/recent", ARTICLES_RECENT);
        matcher.addURI(AUTHORITY, ARTICLES_BASE_PATH + "/recent/id/#", ARTICLES_RECENT_ID);
        matcher.addURI(AUTHORITY, ARTICLES_BASE_PATH + "/favorites/title/*", ARTICLES_RECENT_TITLE);
    }

// Path: lampshade/src/main/java/eu/prismsw/lampshade/database/SavedArticlesHelper.java
// public class SavedArticlesHelper extends SQLiteOpenHelper {
// 	
// 	public static final String TABLE_SAVED = "saved";
//     public static final String TABLE_RECENT = "recent";
//     public static final String TABLE_FAVORITE = "favorite";
// 
// 	public static final String ARTICLES_COLUMN_ID = "_id";
// 	public static final String ARTICLES_COLUMN_TITLE = "title";
// 	public static final String ARTICLES_COLUMN_URL = "url";
// 
// 	protected static final String DATABASE_NAME = "saved_articles.db";
// 	protected static final int DATABASE_VERSION = 2;
// 
//     public SavedArticlesHelper(Context context) {
// 		super(context, DATABASE_NAME, null, DATABASE_VERSION);
// 	}
// 	
// 	public SavedArticlesHelper(Context context, String name, CursorFactory factory, int version) {
// 		super(context, name, factory, version);
// 	}
// 
// 	@Override
// 	public void onCreate(SQLiteDatabase db) {
//         createTable(db, TABLE_SAVED);
//         createTable(db, TABLE_RECENT);
//         createTable(db, TABLE_FAVORITE);
// 	}
// 
//     private void createTable (SQLiteDatabase db, String table) {
//         db.execSQL("create table " + table + "( "
//                 + ARTICLES_COLUMN_ID + " integer primary key autoincrement, "
//                 + ARTICLES_COLUMN_TITLE + " text not null, "
//                 + ARTICLES_COLUMN_URL + " text not null" + ");");
//     }
// 
// 	@Override
// 	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// 		db.execSQL("DROP TABLE IF EXISTS " + TABLE_SAVED);
//         db.execSQL("DROP TABLE IF EXISTS " + TABLE_RECENT);
//         db.execSQL("DROP TABLE IF EXISTS " + TABLE_FAVORITE);
// 		onCreate(db);
// 	}
// }


// Path: lampshade/src/main/java/eu/prismsw/lampshade/providers/ArticleProvider.java
import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteQueryBuilder;
import android.net.Uri;
import android.text.TextUtils;
import eu.prismsw.lampshade.database.SavedArticlesHelper;

package eu.prismsw.lampshade.providers;


public class ArticleProvider extends ContentProvider {
    private static final String AUTHORITY = "eu.prismsw.lampshade.providers.articleprovider";
    private static final String ARTICLES_BASE_PATH = "articles";

    public static final int ARTICLES_SAVED = 10;
    public static final int ARTICLES_SAVED_ID = 11;
    public static final int ARTICLES_SAVED_TITLE = 12;

    public static final int ARTICLES_FAV = 20;
    public static final int ARTICLES_FAV_ID = 21;
    public static final int ARTICLES_FAV_TITLE = 22;

    public static final int ARTICLES_RECENT = 30;
    public static final int ARTICLES_RECENT_ID = 31;
    public static final int ARTICLES_RECENT_TITLE = 32;

    public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/" + ARTICLES_BASE_PATH);
    public static final Uri SAVED_URI = CONTENT_URI.buildUpon().appendPath("saved").build();
    public static final Uri FAV_URI = CONTENT_URI.buildUpon().appendPath("favorites").build();
    public static final Uri RECENT_URI = CONTENT_URI.buildUpon().appendPath("recent").build();

    private static UriMatcher matcher = new UriMatcher(UriMatcher.NO_MATCH);
    static {
        matcher.addURI(AUTHORITY, ARTICLES_BASE_PATH + "/saved", ARTICLES_SAVED);
        matcher.addURI(AUTHORITY, ARTICLES_BASE_PATH + "/saved/id/#", ARTICLES_SAVED_ID);
        matcher.addURI(AUTHORITY, ARTICLES_BASE_PATH + "/saved/title/*", ARTICLES_SAVED_TITLE);

        matcher.addURI(AUTHORITY, ARTICLES_BASE_PATH + "/favorites", ARTICLES_FAV);
        matcher.addURI(AUTHORITY, ARTICLES_BASE_PATH + "/favorites/id/#", ARTICLES_FAV_ID);
        matcher.addURI(AUTHORITY, ARTICLES_BASE_PATH + "/favorites/title/*", ARTICLES_FAV_TITLE);

        matcher.addURI(AUTHORITY, ARTICLES_BASE_PATH + "/recent", ARTICLES_RECENT);
        matcher.addURI(AUTHORITY, ARTICLES_BASE_PATH + "/recent/id/#", ARTICLES_RECENT_ID);
        matcher.addURI(AUTHORITY, ARTICLES_BASE_PATH + "/favorites/title/*", ARTICLES_RECENT_TITLE);
    }

    private SavedArticlesHelper helper;