public Intent updateIntentWithVerseRange(Intent intent, VerseRange verseRange) { intent.putExtra(VERSE_RANGE, verseRange.getOsisRef()); return intent; } }
public MyNoteDto insertMyNote(MyNoteDto mynote) { // Create a new row of values to insert. Log.d(TAG, "about to insertMyNote: " + mynote.getVerseRange()); VerseRange verseRange = mynote.getVerseRange(); String v11nName = getVersification(verseRange); // Gets the current system time in milliseconds Long now = Long.valueOf(System.currentTimeMillis()); ContentValues newValues = new ContentValues(); newValues.put(MyNoteColumn.KEY, verseRange.getOsisRef()); newValues.put(MyNoteColumn.VERSIFICATION, v11nName); newValues.put(MyNoteColumn.MYNOTE, mynote.getNoteText()); newValues.put(MyNoteColumn.LAST_UPDATED_ON, now); newValues.put(MyNoteColumn.CREATED_ON, now); long newId = db.insert(Table.MYNOTE, null, newValues); MyNoteDto newMyNote = getMyNoteDto(newId); return newMyNote; }
public MyNoteDto updateMyNote(MyNoteDto mynote) { // Create a new row of values to insert. Log.d(TAG, "about to updateMyNote: " + mynote.getVerseRange()); VerseRange verserange = mynote.getVerseRange(); String v11nName = getVersification(verserange); // Gets the current system time in milliseconds Long now = Long.valueOf(System.currentTimeMillis()); ContentValues newValues = new ContentValues(); newValues.put(MyNoteColumn.KEY, verserange.getOsisRef()); newValues.put(MyNoteColumn.VERSIFICATION, v11nName); newValues.put(MyNoteColumn.MYNOTE, mynote.getNoteText()); newValues.put(MyNoteColumn.LAST_UPDATED_ON, now); long rowsUpdated = db.update(Table.MYNOTE, newValues, "_id=?", new String []{String.valueOf(mynote.getId())}); Log.d(TAG, "Rows updated:"+rowsUpdated); return getMyNoteDto(mynote.getId()); }
result.append("<a href='").append(Constants.BIBLE_PROTOCOL).append(":").append(it.next().getOsisRef()).append("'>"); result.append(content); result.append("</a>");
public BookmarkDto insertOrUpdateBookmark(BookmarkDto bookmark) { // Create a new row of values to insert. ContentValues newValues = new ContentValues(); VerseRange key = bookmark.getVerseRange(); // must save a Key's versification along with the key! String v11nName = key.getVersification().getName(); // Gets the current system time in milliseconds Long now = System.currentTimeMillis(); newValues.put(BookmarkColumn.KEY, key.getOsisRef()); newValues.put(BookmarkColumn.VERSIFICATION, v11nName); newValues.put(BookmarkColumn.CREATED_ON, now); PlaybackSettings playbackSettings = bookmark.getPlaybackSettings(); if(playbackSettings!= null) { newValues.put(BookmarkColumn.PLAYBACK_SETTINGS, playbackSettings.toJson()); } else { newValues.putNull(BookmarkColumn.PLAYBACK_SETTINGS); } if(bookmark.getId() != null) { db.update(Table.BOOKMARK, newValues, BookmarkColumn._ID + "=" + bookmark.getId(), null); return bookmark; } else { long newId = db.insert(Table.BOOKMARK, null, newValues); return getBookmarkDto(newId); } }