Page 1 of 2 12 LastLast
Results 1 to 20 of 21
Like Tree3Likes
  1.    #1  
    Hi, I 'm working with LuneTube application. I want to add the ability to save settings and sessions, but am having problems creating a dbKind , can someone help me please?

    This and an extract of code

    Code:
    ..
    ...
    ...
    components: [
            {kind: "enyo.LunaService",
    			 name: "saveToken",
    		     service: "luna://com.palm.db/",
    		     method: "put",
    		     onSuccess: "putBffsSuccess",
    		     onFailure: "dbFailure",
    		     onResponse: "gotResponse",
    		     // subscribe: true,
    		     onComplete: "gotResponse"
    		},
    create:function() {
            this.inherited(arguments);
            
        },
    
        createDbKind: function(){
        	console.log("Se envia createDbKind");
        	// this.$.setDbKind.send({owner:"com.emsoft.lunetube"});
        	 var obj = {
        	 	"id":"com.palm.schema.test:1",
           		"schema": {"id":"com.palm.schema.test:1", 
                "type": "object", 
                "properties" : { "_kind" : {"type": "string", "value":"com.palm.schema.test:1"}, 
                                 "foo": {"type": "string", "description": "foo string"}, 
                                 "bar": {"type": "string",  "description": "bar string"},
                                 "isMember": {"type": "boolean", "description" : "Is member flag" }
                                }
                 },
            	"owner":"com.palm.dbtest",
            	"indexes": [{
            				"name":"foo",
                          	"props":[{"name":"foo"}]
                          	},
                         	{
                         	"name":"barfoo",
                          	"props":[{"name":"bar"},{"name":"foo"}] 
                          }]
    
       			};
        	var indexes = [{"name":"lastname", props:[{"name": "lastname"}]},
                           {"name":"state", props:[{"name": "state"}]}];
            this.$.setDbKind.send(obj); // Create db8 kind
        },
       setDbKindComplete: function(inRequest, inResponse){
        	console.log("Auth -> setDbKindComplete: response putDbKind");
        	console.log(inRequest);
        	console.log(inResponse);	
         }
    and error is at image

    http://subefotos.com/ver/?237660faf5...0d1733a49o.png
    Last edited by MAMISHO; 02/16/2016 at 12:59 PM.
  2. #2  
    Quote Originally Posted by MAMISHO View Post
    Hi, I 'm working with LuneTube application. I want to add the ability to save settings and sessions, but am having problems creating a dbKind , can someone help me please?
    Wouldn't a cookie suffice for storing your settings (and sessions)? - It would be easer that the db, I think.
  3.    #3  
    Quote Originally Posted by Misj' View Post
    Wouldn't a cookie suffice for storing your settings (and sessions)? - It would be easer that the db, I think.
    Now the sessions are stored in cookies , but reboot the system they are cleaned . WebOS is not a problem because it is easy to log in, but LuneOS is very difficult because there are no functions to copy and paste
  4. #4  
    Quote Originally Posted by MAMISHO View Post
    Now the sessions are stored in cookies , but reboot the system they are cleaned . WebOS is not a problem because it is easy to log in, but LuneOS is very difficult because there are no functions to copy and paste
    LuneOS will surely have a clipboard implemented (I was surprised that it needed to be re-implemented - I thought these things were fairly ubiquitous), so I think you should assume that feature will arrive eventually.

    Talk to the Ports team on IRC about this & DB8. I'm sure they will be able to offer suggestions. Your app is important for Legacy and LuneOS in my opinion.

    http://www.webos-ports.org/wiki/Communications

    Thanks for your work. You've made great progress so far.
  5. #5  
    LuneOS will surely have a clipboard implemented (I was surprised that it needed to be re-implemented - I thought these things were fairly ubiquitous), so I think you should assume that feature will arrive eventually.

    Talk to the Ports team on IRC about this & DB8. I'm sure they will be able to offer suggestions. Your app is important for Legacy [i]and LuneOS in my opinion.

    http://www.webos-ports.org/wiki/Communications

    Thanks for your work. You've made great progress so far.
    LuneOS currently doesn't have a system wide copy & paste. This is due to the fact LunaSysMgr was replaced by luna-next and luna-next-cardshell. It's on the radar to be implemented again sometime though.


    -- Sent from my TouchPad using Communities
    HP Veer (daily driver), HP Pre 3, HP Touchpad Proper 4G/LTE (Sierra MC7710), HP Touchpad 32GB WiFi, Palm Pre 2
  6. #6  
    Quote Originally Posted by MAMISHO View Post
    Now the sessions are stored in cookies , but reboot the system they are cleaned .
    Is this true for both webOS and LuneOS? - I never explicitly tested a reboot, but I also don't remember encountering this. I do remember though, that cookies were backed up to your Palm account and restored after doctoring. For apps on webOS they were kind of explicitly intended to store settings, so I would expect that to work.

    Could you share your (set) cookie code, just so I can check it? - Because I'm really surprised.
  7. #7  
    It is probably just a LuneOS bug. I always used cookies to store app preferences in my apps. Haven't tried it on LuneOS.
  8. #8  
    Quote Originally Posted by Grabber5.0 View Post
    It is probably just a LuneOS bug. I always used cookies to store app preferences in my apps. Haven't tried it on LuneOS.
    Cookies wouldn't survive an app restart before. I'm sure we sorted that now. Not sure about reboot. A lot of things have been fixed when we moved to QtWebEngine.
    HP Veer (daily driver), HP Pre 3, HP Touchpad Proper 4G/LTE (Sierra MC7710), HP Touchpad 32GB WiFi, Palm Pre 2
  9.    #9  
    [CODE]
    authorizationTokenResponse: function(inRequest, inResponse){
    if(!inResponse) return;
    var ck = {
    access_token: inResponse.access_token,
    token_type: inResponse.token_type,
    expires_in: inResponse.expires_in,
    refresh_token: inResponse.refresh_token
    };

    enyo.setCookie("youtube_token", ck.access_token, {"Max-Age":ck.expires_in});
    enyo.setCookie("youtube_refresh", ck.refresh_token, {"expires":360});
    enyo.setCookie("session_youtube", JSON.stringify(ck), {"expires":360});
    myApiKey.access_token = ck.access_token;
    myApiKey.refresh_token = ck.refresh_token;
    myApiKey.login = true;
    console.log("cookie almacenada");

    if(myApiKey.login){
    this.homeRequest();
    this.bubble("onLoadMyChannel", this);
    this.setLogin(myApiKey.login);
    this.$.loginButton.setContent("Logout");
    }
    },
    [CODE]

    I will continue to look , because the cookie is persistent in desktop web browser, but in webOS apparently not. The truth is very difficult to make DEBUGIN in webOS because the palm- inspector does not work. Anyone know if there is a tool to DEBUGIN in webos as at ADT used in LuneOS ?.
    I use MAcOS X 10.11.3

    I have another question , I do not know if I should create another thread, but take the opportunity . I never created a service of webOS , I tried following the only documentation I 've found and I can not package the service, I think I should indicate somewhere that the application has a service. Any developer who has created services before?

    https://developer.lge.com/webOSTV/de...rvice-enyoapp/
    I know it's for webOS TV, but webos -lib and enyo - webos you can use the APIs webOS webOS 2.x and 3.x. and LuneOS
  10. #10  
    Quote Originally Posted by MAMISHO View Post
    [CODE]
    enyo.setCookie("youtube_token", ck.access_token, {"Max-Age":ck.expires_in});
    enyo.setCookie("youtube_refresh", ck.refresh_token, {"expires":360});
    enyo.setCookie("session_youtube", JSON.stringify(ck), {"expires":360});
    [CODE]
    In my experience you don't want to set an expiration date (only a cookie-name and its content). There's really no reason to set it for you app, since you never want settings to expire anyway (until they are removed when the app is uninstalled). Of course setting the expiration date shouldn't be a problem, but maybe it is.

    from the enyo1 manual:
    enyo.getCookie

    enyo.getCookie:*function(inName)
    Gets a named value from the document cookie.

    enyo.setCookie

    enyo.setCookie:*function(inName, inValue, inProps)
    Sets a named value into the document cookie, with properties.

    Properties in the optional inProps argument are attached to the cookie. inProps may have an expires property, which can be a number of days, a Date object, or a UTC time string.

    To remove a cookie, use an inProps value of*{ "Max-Age": 0 }.

    If developing in the Google Chrome browser with a local file as your application, start Chrome with the*--enable-file-cookies*switch to allow cookies to be set.
  11.    #11  
    Quote Originally Posted by Misj' View Post
    In my experience you don't want to set an expiration date (only a cookie-name and its content). There's really no reason to set it for you app, since you never want settings to expire anyway (until they are removed when the app is uninstalled). Of course setting the expiration date shouldn't be a problem, but maybe it is.

    from the enyo1 manual:
    In this case if you need to set an expiration date because of Youtube API sends a token with a defined expiration date. To what uses a refresher token_refresh to the token again. Anyway I will remove the expiration date to see how it behaves session.
  12.    #12  
    Hello, I have a question, I hope you can help me.
    When we are launching an application using ApplicationManager parameters.

    For example.
    [Code]
    {
    ************ name: "launchMyApp"
    ************ kind: "enyo.LunaService"
    ************ service: "palm: //com.palm.applicationManager"
    ************ method: "launch"
    ************ onComplete "launchMyAppSuccess"
    ************ subscribe: true
    },
    launchMyAppSuccess: function () {
    ******** var params = {url: "http://youtube.com/watch?v=somevideo"
    ************************* type: "video"
    ************************* method: "download"
    *********************** };

    ********* This. $. launchMyApp.send ({id: "com.compa.myapp" params: params});
    **** },

    [Code]

    How I can get those parameters when MyAPP is thrown?
  13. #13  
    So, the better thing to do would be to implement an account service. That, however, might be a bit extensive.

    As for using db8: if you set up your database schemas like in configuration/db here https://github.com/webOS-ports/org.w...ts.app.browser then you should be able to use them, as the db will be automatically structured by the db8 system on app install.
    Did you know:

    webOS ran on a Treo 800 during initial development.
  14.    #14  
    Quote Originally Posted by dkirker View Post
    So, the better thing to do would be to implement an account service. That, however, might be a bit extensive.

    As for using db8: if you set up your database schemas like in configuration/db here https://github.com/webOS-ports/org.w...ts.app.browser then you should be able to use them, as the db will be automatically structured by the db8 system on app install.
    Thank you, the service is to store account data. But he had thought of as a future service youtube notifications.
  15. #15  
    Quote Originally Posted by MAMISHO View Post
    I have another question , I do not know if I should create another thread, but take the opportunity . I never created a service of webOS , I tried following the only documentation I 've found and I can not package the service, I think I should indicate somewhere that the application has a service. Any developer who has created services before?

    https://developer.lge.com/webOSTV/de...rvice-enyoapp/
    I know it's for webOS TV, but webos -lib and enyo - webos you can use the APIs webOS webOS 2.x and 3.x. and LuneOS
    I assume you got the service working? I have a simple example if you need it.
  16.    #16  
    Quote Originally Posted by Grabber5.0 View Post
    I assume you got the service working? I have a simple example if you need it.
    thanks, send me a link please.
  17. #17  
    Quote Originally Posted by MAMISHO View Post
    thanks, send me a link please.
    I don't have it online anywhere, but I will zip up the source and build script and send it to you. I don't recall seeing your email address anywhere, so if I don't find it, I'll throw it on Dropbox and send you a link. Eh, here's a link so anyone can get to it. https://www.dropbox.com/s/1ercoqs41f...edemo.zip?dl=0
    Last edited by Grabber5.0; 02/20/2016 at 12:15 PM.
    Shuswap likes this.
  18.    #18  
    Quote Originally Posted by Grabber5.0 View Post
    I don't have it online anywhere, but I will zip up the source and build script and send it to you. I don't recall seeing your email address anywhere, so if I don't find it, I'll throw it on Dropbox and send you a link. Eh, here's a link so anyone can get to it. https://www.dropbox.com/s/1ercoqs41f...edemo.zip?dl=0
    It is possible that node.jsjsjs $version$ $of$ $webOS$ $2$.$x$, $3$.$x$ $and$ $LuneOS$ $accept$ $node$-$modules$?. $I$'$m$ $working$ $with$ $node$ $v0$.$12$ $for$ $to$ $add$ $service$ $that$ $allow$ $decipher$ $youtube$ $signatures$ $because$ $some$ $videos$ $are$ $impossible$ $to$ $play$.
  19. #19  
    Quote Originally Posted by MAMISHO View Post
    It is possible that node.jsjsjs $version$ $of$ $webOS$ $2$.$x$, $3$.$x$ $and$ $LuneOS$ $accept$ $node$-$modules$?. $I$'$m$ $working$ $with$ $node$ $v0$.$12$ $for$ $to$ $add$ $service$ $that$ $allow$ $decipher$ $youtube$ $signatures$ $because$ $some$ $videos$ $are$ $impossible$ $to$ $play$.
    I would think so, but I haven't done anything with them at all. I haven't done very much with services yet, because I really don't like the (what seems to me) overly-complex Futures concept. I would rather build my services without them and just set the result when I'm done. I was happy that Jason's examples were clear enough for me to create the cert grabber service to run the download script.

    -- Sent from my Palm Pre3 using Forums
  20. #20  
    Quote Originally Posted by Grabber5.0 View Post
    I would think so, but I haven't done anything with them at all. I haven't done very much with services yet, because I really don't like the (what seems to me) overly-complex Futures concept. I would rather build my services without them and just set the result when I'm done. I was happy that Jason's examples were clear enough for me to create the cert grabber service to run the download script.

    -- Sent from my Palm Pre3 using Forums
    What part of webOS *wasn't* overly complex for what it did? :-D Seriously over-engineered a lot of the stuff that came into the system. Not that that's necessarily a bad thing..

    Futures are really pretty simple, once you grasp the core of it. But it takes a lot of practice to really get good with it. It's an old implementation of what we now call Promises. So, if you understand Promises, then you can understand Futures pretty quickly. If you don't understand Promises, that is something that you really really need to get a grip on if you're going to do anything in Javascript using modern / future technology.

    I spent quite a lot of time bashing my head on them for the SynerGV services and others, and didn't really understand how to do anything more than a simple "do this, then do that" chain.. but once I worked with Promises a lot more, a lot of things become apparent that just didn't make sense at all in the beginning. I guess I can say that about most programming concepts. Anything more simple than basic syntax of a language tends to have me out of my mind trying to comprehend it until some later point, when my brain hits an "Aha!" moment.

    OK, so, onto node.jsjsjs $modules$. $It$'$s$ $a$ $bit$ $on$ $the$ $difficult$ $side$ $to$ $use$ $modules$ $in$ $legacy$ $webOS$ $that$ $are$ *$also$* $compatible$ $with$ $LuneOS$ $and$ $modern$ $development$ $environments$. $Any$ $module$ $that$ $you$ $use$, $you$ $either$ $need$ $to$ $find$ $a$ $module$ $that$ $is$ $compatible$ $with$ $the$ $version$ $on$ $the$ $phones$ ($I$ $don$'$t$ $remember$ $which$ $numbers$ $these$ $were$), $the$ $version$ $on$ $the$ $TouchPad$ ($3$.$0$.$5$ $upgraded$ $node$.$js$), $and$ $modern$ $environments$ ($I$'$d$ $be$ $surprised$ $right$ $now$ $if$ $LuneOS$ $wasn$'$t$ $using$ $4$.$x$ $or$ $5$.$x$, $and$ $I$ $imagine$ $that$ $most$ $desktop$ $installs$ $of$ $node$ $are$ $probably$ $a$ $4$.$x$) ... $or$ $you$ $need$ $to$ $make$ $it$ $that$ $way$.

    You *may* also run into memory limitations -- in classic webOS, the node.jsjsjs $process$ $is$ $limited$ $to$ $occupying$ $somewhere$ $around$ $about$ $20MB$ $of$ $RAM$. $For$ $a$ $lot$ $of$ $things$, $that$'$s$ $not$ $an$ $issue$. $For$ $the$ $cases$ $that$ $I$ $used$ $node$ $for$, $I$ $ended$ $up$ $having$ $to$ $modify$ $the$ $modules$ $that$ $I$ $was$ $using$ $to$ $write$ $out$ $the$ $results$ $of$ $intermediate$ $steps$ $of$ $processing$ $of$ $large$ $data$ $sets$ $to$ /$tmp$, $clear$ $out$ $all$ $the$ $junk$ $in$ $memory$, $read$ $back$ $in$ $the$ $temp$ $results$, $and$ $continue$ $from$ $there$. ($which$ $I$ $did$ $the$ &$quot$;$easy$&$quot$; $way$ $by$ $triggering$ $another$ $activity$, $which$ $launched$ $another$ $node$.$js$ $process$, $which$ $had$ $it$'$s$ $own$ $20MB$ $limitation$, $and$ $then$ $exiting$ $the$ $original$ $one$) $THAT$ $was$ $a$ $mess$.

    Most people probably won't have to do that, I imagine.
    Author:
    Remove Messaging Beeps patch for webOS 3.0.5, Left/Right bezel gestures in LunaCE,
    Whazaa! Messenger and node-wa, SynerGV 1 and 2 - Google Voice integration, XO - Subsonic Commander media streamer, AB:S Launcher
    (1:39:33 PM) halfhalo: Android multitasking is like sticking your fingers into a blender
    GO OPEN WEBOS!
    People asked me for a donate link for my non-catalog work, so here you are:
    MAMISHO likes this.
Page 1 of 2 12 LastLast

Similar Threads

  1. watchModel parameters
    By appsotutely in forum webOS Development
    Replies: 0
    Last Post: 08/15/2010, 09:30 PM
  2. How do you pass parameters to the map service?
    By redhat in forum webOS Development
    Replies: 1
    Last Post: 07/29/2009, 12:15 PM
  3. Explain Debug Parameters?
    By kenorian in forum Palm OS Devices & Apps
    Replies: 0
    Last Post: 01/14/2006, 09:31 AM
  4. DUN logon parameters for AT&T?
    By Gilliland in forum North American Carriers (GSM)
    Replies: 20
    Last Post: 09/27/2005, 03:55 AM
  5. SFR Wap parameters on Treo270
    By pierbout in forum Palm OS Devices & Apps
    Replies: 1
    Last Post: 03/22/2005, 10:46 AM

Posting Permissions