1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    7
    Vote Rating
    1
    khooten is on a distinguished road

      0  

    Default Unanswered: Initial loading of data & users into Sencha.io

    Unanswered: Initial loading of data & users into Sencha.io


    I have an app that I'm porting from an older system that has thousands of active users. Can I create users and groups with the API as opposed to using the Dashboard interface?

    Also, each user has current and historical data in this application. How can I get all that existing data into Sencha.io?

  2. #2
    Sencha - IO Dev Team
    Join Date
    Apr 2011
    Posts
    84
    Answers
    27
    Vote Rating
    5
    jason.cline is on a distinguished road

      0  

    Default


    Hello,

    Yes. You can create create users, groups and even apps using the APIs that are included in the SDK download. The management console actually uses the SDK itself to execute all of its actions.

    Users can be created programmatically using the register method:
    http://docs.sencha.io/current/index....ethod-register

    At the moment you can only have a single authentication group per application but that authentication group can shared between applications so you may not need or want to create them programatically.

    However you can do this via Sencha Cmd:

    Code:
    jason$ sencha io create-appSencha Cmd v3.1.0.256
    [INF] Usage: sencha io create-app <appName> <username> <password> <teamName>
    [INF] appName: the name of your application.  Must be unique.
    [INF] username: your Sencha.io username
    [INF] password: your Sencha.io password
    [INF] teamName: the Team name in which to create the app (optional)
    Code:
    jason$ sencha io create-auth-groupSencha Cmd v3.1.0.256
    [INF] Usage: sencha io create-auth-group <groupName> <username> <password> <teamName>
    [INF] groupName: the name for your new group
    [INF] username: your Sencha.io username
    [INF] password: your Sencha.io password
    [INF] teamName: the team name to use <optional>
    As for storing user data what kind of data are you attempting to store for each user?
    There are two options for storing data:
    1) via custom attributes on the user object itself

    Once you have a user object you can call user.update({custom: someJson}) and the values will be stored on the server and readable by any other user in the application

    2) as part of a sync store.

    Define a Model and Store with a sync proxy

  3. #3
    Sencha User
    Join Date
    Mar 2013
    Posts
    7
    Vote Rating
    1
    khooten is on a distinguished road

      0  

    Default


    Jason,

    Thanks for the prompt reply. I guess I misunderstood how the data sharing and privacy worked. I need to share data among some users but not all users. Each company (my customer) will have several employees at that company that need to share and sync data. However, I need to make sure that other users of the app that do not work for that company cannot see their data.

    I was planning to make one Group for each company so that everyone in that Group could see the data but noone else.

  4. #4
    Sencha User
    Join Date
    Mar 2011
    Location
    Birmingham, UK
    Posts
    43
    Answers
    1
    Vote Rating
    1
    lalexgraham is on a distinguished road

      0  

    Default


    Jason, can you expand a little more on
    2) as part of a sync store.

    Define a Model and Store with a sync proxy
    If we had a live database already but we wanted to manipulate that data through a sencha touch app how would we go about importing the data into Sencha.io and then refreshing the database at certain times in the day? It seems most examples of sencha.io assume you are starting without a database already.

    Thanks

Thread Participants: 2