ubsicap / paratext_demo_plugins

Sample code to demonstrate how to create a Paratext plugin
2 stars 4 forks source link

Can't read resource project with GetUSFM #26

Open steve-pence opened 1 year ago

steve-pence commented 1 year ago

The following demo code works fine with an ordinary project, but with a resource project I'm getting "Plugin does not have access to GetUSFM for this project." Does the API not support reading content from resource projects? Or have I missed something? Thanks, Steve

internal static void TryReadingScripture(IParatextChildState state) { var activeProjectName = state.Project.ShortName; string thisBook = state.VerseRef.BookCode; int thisBookNo = state.VerseRef.BookNum; int thisChapter = state.VerseRef.ChapterNum; int thisVerse = state.VerseRef.VerseNum; int thisVerseCode = state.VerseRef.BBBCCCVVV;

        MessageBox.Show($"My Paratext cursor is at {thisBook} {thisChapter}:{thisVerse} of {activeProjectName}, and the Book Number for {thisBook} is {thisBookNo}, and the ref code is {thisVerseCode} ");

        MessageBox.Show("GetUSFM: \r\n" + state.Project.GetUSFM(thisBookNo, thisChapter, thisVerse));

        MessageBox.Show("GetUSFMTokens: \r\n" + state.Project.GetUSFMTokens(thisBookNo, thisChapter, thisVerse).Count());

        IEnumerable<IUSFMToken> tokens = state.Project.GetUSFMTokens(thisBookNo, thisChapter, thisVerse);
        foreach (IUSFMToken token in tokens)
        {
            if (token is IUSFMTextToken) MessageBox.Show( ((IUSFMTextToken)token).Text );
        }
    }
FoolRunning commented 1 year ago

Please see the WIKI page Accessing protected resource content.

steve-pence commented 1 year ago

Thanks for your quick and clear response. You might consider adding a note to the GetUSFM method pages in the API documentation.

Thanks,

Steve

Steve Pence Publishing Coordinator SIL Southern Africa Fish Hoek, Cape Town South Africa

skype steve.pence WhatsApp +27 83 304 6658 GMT/UTC +2

On Wed, Jan 18, 2023, 3:39 PM Tim Steenwyk @.***> wrote:

Please see the WIKI page Accessing protected resource content https://github.com/ubsicap/paratext_demo_plugins/wiki/Accessing-protected-resource-content-from-the-plugin-API .

— Reply to this email directly, view it on GitHub https://github.com/ubsicap/paratext_demo_plugins/issues/26#issuecomment-1387090242, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ4HZNYWQMTTMJEUGHGEWG3WS7XAVANCNFSM6AAAAAAT627UMY . You are receiving this because you authored the thread.Message ID: @.***>

tombogle commented 1 year ago

I think it’s maybe somewhat intentional to not make this very high profile.

steve-pence commented 1 year ago

😎

Steve Pence Publishing Coordinator SIL Southern Africa Fish Hoek, Cape Town South Africa

skype steve.pence WhatsApp +27 83 304 6658 GMT/UTC +2

On Wed, Jan 18, 2023, 6:08 PM Tom Bogle @.***> wrote:

I think it’s maybe somewhat intentional to not make this very high profile.

— Reply to this email directly, view it on GitHub https://github.com/ubsicap/paratext_demo_plugins/issues/26#issuecomment-1387321548, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ4HZN3MSUJ43ZLMCGNOZNTWTAIRPANCNFSM6AAAAAAT627UMY . You are receiving this because you authored the thread.Message ID: @.***>

steve-pence commented 1 year ago

Hi, It is nearly two weeks since I submitted a request pursuant to the link mentioned above, which says: "The plugin developer needs to send in an email to support@paratext.org explaining why they need access to resource data and what they plan on doing with the data."

I have received no response, either from my initial request, or to a followup email. There was no acknowledgement, no ticket number, nothing. I understand that these things can take time, but I need some assurance that my request is in a queue and not in a bit bucket.

Could you kindly confirm that support@paratext.org is the correct recipient and that a defined process for this is actually in place? If so, I'd like to know how to prompt some acknowledgement from them. Since this resource was specifically developed for use with this plugin, approval should be a formality. This issue is currently impacting my progress on the project.

Please advise,

Steve