Thanks Ralf (& Andre) for the responses.

I have read the user guide and understood more than I expected, given my basic 
HTML + jQuery + CSS background! I’ve also been learning more as I build my app 
out using user guide worked examples where they exist.

Thanks for the syntax for processing the response returned from the library - I 
know understand the central role of the controller page and how that call & 
response should work. 

Thanks also for the tip regarding the log, as that has proven more revealing… 
errors when attempting to load library files into any controllers.

Stripping back to basics, I have created a testLib.lc library file in the 
default system/application/libraries folder that contains just the prototype 
markup from the user guide.

My default controller is home.lc (copied from welcome.lc) which throws an error 
"Unable to load the requested library:Testlib” if I add 'rigLoaderLoadLibrary 
“testLib” ‘ to the home or index handler markup.

Any clues as to what I may have missed?  
Thanks
Keith

> On 30 Nov 2018, at 12:37, Ralf Bitter via use-livecode 
> <use-livecode@lists.runrev.com> wrote:
> 
> Hi Keith,  
> 
> in addition to Andre’s valuable tips I would like  
> to comment that your approach should actually work,  
> but be advised to make sure you include your custom  
> library as described here:  
> 
> https://revigniter.com/userGuide/general/creating_libraries.html  
> 
> Furthermore you can leave your function as is i.e.  
> call your library function within your DocLogin.lc controller like:  
> 
>       put myDocLoginHandler() into gData["doc_token"]
>       
> For debugging purposes make sure the logs folder is writable,  
> set the gConfig["logThreshold"]  in config.lc to 4 and check the  
> log file in case something goes wrong.  
> 
> 
> Ralf  
> 
>> On 30. Nov 2018, at 10:32, Keith Clarke via use-livecode 
>> <use-livecode@lists.runrev.com> wrote:
>> 
>> Folks,
>> I’m struggling to get my head around revIgniter / MVC concepts and map basic 
>> LC desktop concepts to the right places in LCS + revIgniter. (I’m still 
>> searching for a 'Rosetta Stone’ to translate between these two worlds!)  
>> 
>> My use case is to share public FAQs from specific pages designated as public 
>> in our knowledge base. I have a basic LC desktop prototype that I’m 
>> migrating to LCS + revIgniter. The desktop stack includes a single function 
>> stack script that logs into the KB server as a proxy ‘public user' and 
>> returns an access token string for subsequent page requests. 
>> 
>> To migrate this across to the server environment, I have simply transferred 
>> the stack script into a DocLogin.lc library file, replacing the final 
>> 'return “token”’ with put tToken into gData[“doc_token”] I may have 
>> misunderstood the revIgniter docs that this is the way to get the data 
>> ‘back’ to the controller, rather than use the desktop-style function do & 
>> return to a library (or stack) file?
>> 
>> A DocLogin.lc controller file then attempts to call the above library and 
>> open a view file to check that the token is available via 
>> [[gData[“doc_token"] ]] 
>> 
>> The controller is opening the view but the token merge field is not shown 
>> and adding the generic rigShowError “message” alerts that the library 
>> couldn’t be loaded. 
>> 
>> I’d appreciate a steer as I’ve a feeling my approach here is fundamentally 
>> wrong for the LCS + revIgniter way of working.
>> Thanks
>> Keith
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to