Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: How to apply admin-dashboard template

  1. #1
    Sencha User
    Join Date
    Jul 2015
    Posts
    1

    Default Answered: How to apply admin-dashboard template

    Hello sencha community,

    I heard the news about the release of ExtJS 6 and I have to say that I'm pretty exciting about it.

    Although the documentation is quite extensive I haven't figure it out how to use the templates included in the ExtJS download (admin-dashboard and excecutive-dashboard). These are some of the things that I've tried:

    Generate app:
    Code:
    $ sencha --sd /home/user/bin/Sencha/Cmd/6.0.0.202/ generate app -ext App ./
    Very straightforward, now I have a base app on my current folder.

    List templates:
    Code:
    $ sencha template list
    Sencha Cmd v6.0.0.202
    
    There are no available templates.
    No luck here, I guess I have to copy the template folder included in my sdk.

    So, I copy the template folder on my root app folder, then try again.
    Code:
    $ sencha template list
    Sencha Cmd v6.0.0.202
    
    There are no available templates.
    Nope, maybe sencha cmd already has the templates so I just apply it:
    Code:
    $ sencha template apply -n admin-dashboard -o ./
    Sencha Cmd v6.0.0.202
    [ERR] Cannot satisfy requirements for "admin-dashboard"!
    [ERR]    The following versions cannot be satisfied:
    [ERR]       root: admin-dashboard (No matches!)
    [ERR] Cannot resolve package requirements
    Seems like sencha cmd doesn't know where are the templates.

    I don't know where to go from here, does anyone know how to apply the admin-dashboard template ?

    Any help will be highly appreciated.
    Regards.
    Last edited by aram256; 8 Jul 2015 at 11:08 AM. Reason: title update

  2. Well few hours of debugging and this is what I found:

    1) As I already wrote, apps in templates directory are not real templates
    2) Template is new type of package

    Simply generate new package:
    Code:
    sencha generate package admin-dashboard
    Modify package.json file

    Code:
    /**
     * The package type.
     *
     * Sencha Cmd understands the following types of packages:
     *  - code : An arbitrary package of code for use by applications or other packages.
     *  - theme : A package to be used as an applications theme.
     *  - locale : A package containing localization strings or locale-specific code.
     *  - template : A package containing one or more templates.
     */
     "type": "template",
    Dont forget comment row with toolkit definition because it is used for theme package type only. In other case you will receive error because cmd couldnt find classic package.

    Now you get following error:

    Code:
    java.lang.NullPointerException     
         at com.sencha.command.template.ListCommand$1.onSeries(ListCommand.java:95)
         at com.sencha.tools.pkg.Model$Catalog.each(Model.java:180)
         at com.sencha.command.template.ListCommand.execute(ListCommand.java:49)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.sencha.util.MethodInvoker$Arguments.invoke(MethodInvoker.java:175)
         at com.sencha.cli.Command.dispatch(Command.java:43)
         at com.sencha.cli.Commands.dispatch(Commands.java:64)
         at com.sencha.cli.Commands.dispatch(Commands.java:64)
         at com.sencha.command.Sencha.dispatch(Sencha.java:74)
         at com.sencha.command.Sencha.main(Sencha.java:142)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
         at com.exe4j.runtime.WinLauncher.main(Unknown Source)
         at com.install4j.runtime.launcher.WinLauncher.main(Unknown Source)
    because file with template description isnt defined. Dont ask me why or if you could define template definition somewhere else.

    Create $template.json file in root of package directory (packages/local/admin-dashboard) and use similar configuration like for Architect template:

    Code:
    {    
        "title": "admin-dashboard title",
        "name": "admin-dashboard",
        "templateType": "app"
    }
    and now run again command
    Code:
    sencha template list
    Output looks much better

    Attachment 52834

    Package has too many options so would be really nice if someone from Sencha could give us more information how to use templates.

  3. #2
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    769
    Answers
    38

    Default

    Also would be great to see full documentation how to use template. I.e. how to apply existings template from specific directory, how to create template for specific projects etc.

  4. #3
    Sencha Premium Member jsbravo's Avatar
    Join Date
    May 2011
    Location
    Medellin, Colombia
    Posts
    1

    Smile How to apply admin-dashboard template

    I'm in the same situation!

  5. #4
    Sencha Premium Member
    Join Date
    Aug 2009
    Posts
    1

    Default

    Same here. Any help would be greatly appreciated.

  6. #5

    Default

    Also interested by this!

  7. #6
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    769
    Answers
    38

    Default

    It looks like new command will look like this:

    Code:
    sencha -sdk <path-to-sdk> generate app --template (or just -te) <template-name> <application-name> <application-path>
    Options
    * --controller-name, -c - The name of the default Controller
    * --library, -l - the pre-built library to use (core or all). Default: core
    * --name, -n - The name of the application to generate
    * --path, -p - The path for the generated application
    * --refresh, -r - Set to false to skip the "app refresh" of the generated app
    * --starter, -s - Overrides the default Starter App template directory
    * --template, -te - The name of the template to use
    * --theme-name, -th - The name of the default Theme
    * --view-name, -v - The name of the default View

    Syntax

    Code:
    sencha generate app [options] name path
    However with latest Sencha Cmd v6.0.1.13 it still returns:

    Code:
    [ERR] Cannot satisfy requirements for "admin-dashboard"!
    [ERR]    The following versions cannot be satisfied:
    [ERR]       root: admin-dashboard (No matches!)
    [ERR] Cannot resolve package requirements
    Also tested from sdk directory.

    However I'm not sure if the app in templates/admin-dashboard is real template or just another example.

  8. #7
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    769
    Answers
    38

    Default

    Well few hours of debugging and this is what I found:

    1) As I already wrote, apps in templates directory are not real templates
    2) Template is new type of package

    Simply generate new package:
    Code:
    sencha generate package admin-dashboard
    Modify package.json file

    Code:
    /**
     * The package type.
     *
     * Sencha Cmd understands the following types of packages:
     *  - code : An arbitrary package of code for use by applications or other packages.
     *  - theme : A package to be used as an applications theme.
     *  - locale : A package containing localization strings or locale-specific code.
     *  - template : A package containing one or more templates.
     */
     "type": "template",
    Dont forget comment row with toolkit definition because it is used for theme package type only. In other case you will receive error because cmd couldnt find classic package.

    Now you get following error:

    Code:
    java.lang.NullPointerException     
         at com.sencha.command.template.ListCommand$1.onSeries(ListCommand.java:95)
         at com.sencha.tools.pkg.Model$Catalog.each(Model.java:180)
         at com.sencha.command.template.ListCommand.execute(ListCommand.java:49)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.sencha.util.MethodInvoker$Arguments.invoke(MethodInvoker.java:175)
         at com.sencha.cli.Command.dispatch(Command.java:43)
         at com.sencha.cli.Commands.dispatch(Commands.java:64)
         at com.sencha.cli.Commands.dispatch(Commands.java:64)
         at com.sencha.command.Sencha.dispatch(Sencha.java:74)
         at com.sencha.command.Sencha.main(Sencha.java:142)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
         at com.exe4j.runtime.WinLauncher.main(Unknown Source)
         at com.install4j.runtime.launcher.WinLauncher.main(Unknown Source)
    because file with template description isnt defined. Dont ask me why or if you could define template definition somewhere else.

    Create $template.json file in root of package directory (packages/local/admin-dashboard) and use similar configuration like for Architect template:

    Code:
    {    
        "title": "admin-dashboard title",
        "name": "admin-dashboard",
        "templateType": "app"
    }
    and now run again command
    Code:
    sencha template list
    Output looks much better

    ext-template.png

    Package has too many options so would be really nice if someone from Sencha could give us more information how to use templates.

  9. #8
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

  10. #9
    Sencha User dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,748
    Answers
    55

    Default

    Greetings All,

    For this release, the Sencha Cmd template package functionality was not really announced or documented (except in the CLI help... which probably should have been disabled to avoid confusion). The original plan was to provide Admin and Exec Dashboards as template packages that could be used by sencha generate app ... but that just didn't make it for this release.

    In this release, the Admin Dashboard (and Exec Dashboard) is a folder to be copied into your project and then edited from there. Apologies for the confusion there ... and great sleuthing @Zdeno!

    If folks think template packages would be useful in a general way, I'll see if we can bump them up the guide queue.

    Thanks for diving in to 6.0!

    Best,
    Don
    Don Griffin

    "Use the source, Luke!"

  11. #10
    Sencha User
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    15

    Default

    Are the steps to do this listed anywhere? Would you just generate a new app, then copy/overwrite the files/folders in there with the files from the template?

    thanks

Page 1 of 2 12 LastLast

Similar Threads

  1. Is Admin Dashboard working progress?
    By wemerson.januario in forum Ext JS 6.x Q&A
    Replies: 4
    Last Post: 26 Mar 2017, 9:08 PM
  2. SenchaDash - Admin Dashboard source
    By wemerson.januario in forum Ext JS 6.x Q&A
    Replies: 2
    Last Post: 24 Jun 2016, 4:09 AM
  3. Replies: 3
    Last Post: 2 Jul 2015, 12:30 PM
  4. Replies: 1
    Last Post: 10 Sep 2014, 2:53 PM
  5. Replies: 2
    Last Post: 31 Jul 2014, 7:29 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •