Search in sources :

Example 1 with PublishProfile

use of scal.io.liger.model.PublishProfile in project storymaker by StoryMaker.

the class PublishFragment method uploadClicked.

private void uploadClicked() {
    PublishProfile pubProf = null;
    if (mStoryPathInstance != null) {
        pubProf = mStoryPathInstance.getPublishProfile();
    }
    if (pubProf != null && pubProf.getUploadSiteKeys() != null && pubProf.getUploadSiteKeys().size() > 0) {
        // FIXME we should do this more robustly
        boolean isUserLoggedIntoSM = false;
        Auth storymakerAuth = (new AuthTable()).getAuthDefault(getActivity(), Auth.SITE_STORYMAKER);
        if (storymakerAuth != null) {
            // FIXME we should check a little more carefully if the auth credentials are valid
            isUserLoggedIntoSM = true;
        }
        if (!isUserLoggedIntoSM) {
            Intent i = new Intent(getActivity(), ConnectAccountActivity.class);
            getActivity().startActivity(i);
        }
        // FIXME in this case it should just use the sharedprefs value
        useTor = true;
        // FIXME what if no uploadsitekeys are defined
        mSiteKeys = pubProf.getUploadSiteKeys().toArray(new String[pubProf.getUploadSiteKeys().size()]);
        publishToStoryMaker = (pubProf.getPublishSiteKeys().size() > 0 && pubProf.getPublishSiteKeys().get(0).equals("storymaker"));
        //            shareAuthor = intent.getBooleanExtra(ArchiveMetadataActivity.INTENT_EXTRA_SHARE_AUTHOR, false);
        //            shareTitle = intent.getBooleanExtra(ArchiveMetadataActivity.INTENT_EXTRA_SHARE_TITLE, false);
        //            shareTags = intent.getBooleanExtra(ArchiveMetadataActivity.INTENT_EXTRA_SHARE_TAGS, false);
        //            shareDescription = intent.getBooleanExtra(ArchiveMetadataActivity.INTENT_EXTRA_SHARE_DESCRIPTION, false);
        //            shareLocation = intent.getBooleanExtra(ArchiveMetadataActivity.INTENT_EXTRA_SHARE_LOCATION, false);
        //            licenseUrl = intent.getStringExtra(ArchiveMetadataActivity.INTENT_EXTRA_LICENSE_URL);
        startPublish();
    } else {
        launchChooseAccountsDialog();
    }
}
Also used : PublishProfile(scal.io.liger.model.PublishProfile) Auth(org.storymaker.app.model.Auth) AuthTable(org.storymaker.app.model.AuthTable) Intent(android.content.Intent)

Aggregations

Intent (android.content.Intent)1 Auth (org.storymaker.app.model.Auth)1 AuthTable (org.storymaker.app.model.AuthTable)1 PublishProfile (scal.io.liger.model.PublishProfile)1