use of org.storymaker.app.model.MediaTable in project storymaker by StoryMaker.
the class ProjectsProvider method update.
@Override
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
mCacheWordHandler.connectToService();
setTimer(60000);
SQLiteDatabase db = getDB();
if (db != null) {
int uriType = sURIMatcher.match(uri);
switch(uriType) {
case PROJECTS:
case PROJECT_ID:
return (new ProjectTable(db)).update(getContext(), uri, values, selection, selectionArgs);
case SCENES:
case SCENE_ID:
return (new SceneTable(db)).update(getContext(), uri, values, selection, selectionArgs);
case LESSONS:
case LESSON_ID:
return (new LessonTable(db)).update(getContext(), uri, values, selection, selectionArgs);
case MEDIA:
case MEDIA_ID:
return (new MediaTable(db)).update(getContext(), uri, values, selection, selectionArgs);
case AUTH:
case AUTH_ID:
return (new AuthTable(db)).update(getContext(), uri, values, selection, selectionArgs);
case TAGS:
case TAG_ID:
case DISTINCT_TAGS:
case DISTINCT_TAG_ID:
return (new TagTable(db)).update(getContext(), uri, values, selection, selectionArgs);
case JOBS:
case JOB_ID:
return (new JobTable(db)).update(getContext(), uri, values, selection, selectionArgs);
case PUBLISH_JOBS:
case PUBLISH_JOB_ID:
return (new PublishJobTable(db)).update(getContext(), uri, values, selection, selectionArgs);
case AUDIO_CLIPS:
case AUDIO_CLIP_ID:
return (new AudioClipTable(db)).update(getContext(), uri, values, selection, selectionArgs);
default:
throw new IllegalArgumentException("Unknown URI");
}
}
return 0;
}
use of org.storymaker.app.model.MediaTable in project storymaker by StoryMaker.
the class ProjectsProvider method query.
@Nullable
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
mCacheWordHandler.connectToService();
setTimer(60000);
SQLiteDatabase db = getDB();
if (db != null) {
int uriType = sURIMatcher.match(uri);
switch(uriType) {
case PROJECT_ID:
return (new ProjectTable(db)).queryOne(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case PROJECTS:
return (new ProjectTable(db)).queryAll(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case SCENE_ID:
return (new SceneTable(db)).queryOne(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case SCENES:
return (new SceneTable(db)).queryAll(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case LESSON_ID:
return (new LessonTable(db)).queryOne(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case LESSONS:
return (new LessonTable(db)).queryAll(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case MEDIA_ID:
return (new MediaTable(db)).queryOne(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case MEDIA:
return (new MediaTable(db)).queryAll(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case AUTH_ID:
return (new AuthTable(db)).queryOne(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case AUTH:
return (new AuthTable(db)).queryAll(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case TAG_ID:
return (new TagTable(db)).queryOne(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case TAGS:
return (new TagTable(db)).queryAll(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case DISTINCT_TAG_ID:
return (new TagTable(db)).queryOneDistinct(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case DISTINCT_TAGS:
return (new TagTable(db)).queryAllDistinct(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case JOB_ID:
return (new JobTable(db)).queryOne(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case JOBS:
return (new JobTable(db)).queryAll(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case PUBLISH_JOB_ID:
return (new PublishJobTable(db)).queryOne(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case PUBLISH_JOBS:
return (new PublishJobTable(db)).queryAll(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case AUDIO_CLIP_ID:
return (new AudioClipTable(db)).queryOne(getContext(), uri, projection, selection, selectionArgs, sortOrder);
case AUDIO_CLIPS:
return (new AudioClipTable(db)).queryAll(getContext(), uri, projection, selection, selectionArgs, sortOrder);
default:
throw new IllegalArgumentException("Unknown URI");
}
}
return null;
}
use of org.storymaker.app.model.MediaTable in project storymaker by StoryMaker.
the class ProjectsProvider method delete.
@Override
public int delete(Uri uri, String selection, String[] selectionArgs) {
mCacheWordHandler.connectToService();
setTimer(60000);
SQLiteDatabase db = getDB();
if (db != null) {
int uriType = sURIMatcher.match(uri);
switch(uriType) {
case PROJECTS:
case PROJECT_ID:
return (new ProjectTable(db)).delete(getContext(), uri, selection, selectionArgs);
case SCENES:
case SCENE_ID:
return (new SceneTable(db)).delete(getContext(), uri, selection, selectionArgs);
case LESSONS:
case LESSON_ID:
return (new LessonTable(db)).delete(getContext(), uri, selection, selectionArgs);
case MEDIA:
case MEDIA_ID:
return (new MediaTable(db)).delete(getContext(), uri, selection, selectionArgs);
case AUTH:
case AUTH_ID:
return (new AuthTable(db)).delete(getContext(), uri, selection, selectionArgs);
case TAGS:
case TAG_ID:
case DISTINCT_TAGS:
case DISTINCT_TAG_ID:
return (new TagTable(db)).delete(getContext(), uri, selection, selectionArgs);
case JOBS:
case JOB_ID:
return (new JobTable(db)).delete(getContext(), uri, selection, selectionArgs);
case PUBLISH_JOBS:
case PUBLISH_JOB_ID:
return (new PublishJobTable(db)).delete(getContext(), uri, selection, selectionArgs);
case AUDIO_CLIPS:
case AUDIO_CLIP_ID:
return (new AudioClipTable(db)).delete(getContext(), uri, selection, selectionArgs);
default:
throw new IllegalArgumentException("Unknown URI");
}
}
return 0;
}
use of org.storymaker.app.model.MediaTable in project storymaker by StoryMaker.
the class ProjectsProvider method insert.
@Nullable
@Override
public Uri insert(Uri uri, ContentValues values) {
mCacheWordHandler.connectToService();
setTimer(60000);
SQLiteDatabase db = getDB();
if (db != null) {
long newId;
int uriType = sURIMatcher.match(uri);
switch(uriType) {
case PROJECTS:
return (new ProjectTable(db)).insert(getContext(), uri, values);
case SCENES:
return (new SceneTable(db)).insert(getContext(), uri, values);
case LESSONS:
return (new LessonTable(db)).insert(getContext(), uri, values);
case MEDIA:
return (new MediaTable(db)).insert(getContext(), uri, values);
case AUTH:
return (new AuthTable(db)).insert(getContext(), uri, values);
case TAGS:
case DISTINCT_TAGS:
return (new TagTable(db)).insert(getContext(), uri, values);
case JOBS:
return (new JobTable(db)).insert(getContext(), uri, values);
case PUBLISH_JOBS:
return (new PublishJobTable(db)).insert(getContext(), uri, values);
case AUDIO_CLIPS:
return (new AudioClipTable(db)).insert(getContext(), uri, values);
default:
throw new IllegalArgumentException("Unknown URI");
}
}
return null;
}
Aggregations