Search in sources :

Example 21 with Preferences

use of org.apereo.portal.soffit.model.v1_0.Preferences in project ORCID-Source by ORCID.

the class ValidateV2_1SamplesTest method testUnmarshallPreferences.

@Test
public void testUnmarshallPreferences() throws SAXException, URISyntaxException {
    Preferences preferences = (Preferences) unmarshallFromPath("/record_2.1/samples/read_samples/preferences-2.1.xml", Preferences.class, "/record_2.1/preferences-2.1.xsd");
    assertNotNull(preferences);
    assertNotNull(preferences.getLocale());
    assertEquals(Locale.EN, preferences.getLocale());
}
Also used : Preferences(org.orcid.jaxb.model.record_v2.Preferences) Test(org.junit.Test)

Example 22 with Preferences

use of org.apereo.portal.soffit.model.v1_0.Preferences in project ORCID-Source by ORCID.

the class ValidateV2SamplesTest method testMarshallPreferences.

@Test
public void testMarshallPreferences() throws JAXBException, SAXException, URISyntaxException {
    Preferences object = (Preferences) unmarshallFromPath("/record_2.0/samples/read_samples/preferences-2.0.xml", Preferences.class);
    marshall(object, "/record_2.0/preferences-2.0.xsd");
}
Also used : Preferences(org.orcid.jaxb.model.record_v2.Preferences) Test(org.junit.Test)

Example 23 with Preferences

use of org.apereo.portal.soffit.model.v1_0.Preferences in project ORCID-Source by ORCID.

the class ValidateV2RC4SamplesTest method testUnmarshallPreferences.

@Test
public void testUnmarshallPreferences() throws SAXException, URISyntaxException {
    Preferences preferences = (Preferences) unmarshallFromPath("/record_2.0_rc4/samples/preferences-2.0_rc4.xml", Preferences.class, "/record_2.0_rc4/preferences-2.0_rc4.xsd");
    assertNotNull(preferences);
    assertNotNull(preferences.getLocale());
    assertEquals(Locale.EN, preferences.getLocale());
}
Also used : Preferences(org.orcid.jaxb.model.record_rc4.Preferences) Test(org.junit.Test)

Example 24 with Preferences

use of org.apereo.portal.soffit.model.v1_0.Preferences in project k-9 by k9mail.

the class NotificationActionService method startService.

@Override
public int startService(Intent intent, int startId) {
    Timber.i("NotificationActionService started with startId = %d", startId);
    String accountUuid = intent.getStringExtra(EXTRA_ACCOUNT_UUID);
    Preferences preferences = Preferences.getPreferences(this);
    Account account = preferences.getAccount(accountUuid);
    if (account == null) {
        Timber.w("Could not find account for notification action.");
        return START_NOT_STICKY;
    }
    MessagingController controller = MessagingController.getInstance(getApplication());
    String action = intent.getAction();
    if (ACTION_MARK_AS_READ.equals(action)) {
        markMessagesAsRead(intent, account, controller);
    } else if (ACTION_DELETE.equals(action)) {
        deleteMessages(intent, controller);
    } else if (ACTION_ARCHIVE.equals(action)) {
        archiveMessages(intent, account, controller);
    } else if (ACTION_SPAM.equals(action)) {
        markMessageAsSpam(intent, account, controller);
    } else if (ACTION_DISMISS.equals(action)) {
        Timber.i("Notification dismissed");
    }
    cancelNotifications(intent, account, controller);
    return START_NOT_STICKY;
}
Also used : Account(com.fsck.k9.Account) MessagingController(com.fsck.k9.controller.MessagingController) Preferences(com.fsck.k9.Preferences)

Example 25 with Preferences

use of org.apereo.portal.soffit.model.v1_0.Preferences in project k-9 by k9mail.

the class MigrationTest method getNewAccount.

private Account getNewAccount() {
    Preferences preferences = Preferences.getPreferences(RuntimeEnvironment.application);
    //FIXME: This is a hack to get Preferences into a state where it's safe to call newAccount()
    preferences.loadAccounts();
    return preferences.newAccount();
}
Also used : Preferences(com.fsck.k9.Preferences)

Aggregations

Preferences (com.fsck.k9.Preferences)17 Account (com.fsck.k9.Account)13 Test (org.junit.Test)12 Preferences (org.apereo.portal.soffit.model.v1_0.Preferences)5 Preferences (org.orcid.jaxb.model.record_v2.Preferences)5 StorageEditor (com.fsck.k9.preferences.StorageEditor)4 SearchAccount (com.fsck.k9.search.SearchAccount)4 HashMap (java.util.HashMap)4 PortalRequest (org.apereo.portal.soffit.model.v1_0.PortalRequest)4 InvalidSettingValueException (com.fsck.k9.preferences.Settings.InvalidSettingValueException)3 Storage (com.fsck.k9.preferences.Storage)3 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 Map (java.util.Map)3 Bearer (org.apereo.portal.soffit.model.v1_0.Bearer)3 Definition (org.apereo.portal.soffit.model.v1_0.Definition)3 Intent (android.content.Intent)2 SharedPreferences (android.content.SharedPreferences)2 Uri (android.net.Uri)2 UnavailableStorageException (com.fsck.k9.mailstore.UnavailableStorageException)2