如何使用煎茶SDK的ExtJS的? [英] How to use Sencha SDK for ExtJS?

查看:111
本文介绍了如何使用煎茶SDK的ExtJS的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ExtJS的4.1和我部署在GlassFish V3.1我简单的HelloExt程序。

I am using ExtJS 4.1 and I am deploying my simple HelloExt program on GlassFish V3.1.

我试图创建煎茶SDK构建。

I am trying to create a build from Sencha SDK.

我已经使用了以下两个命令...

I have used the following two commands...

C:\>sencha create jsb -a http://localhost:8080/HelloExt/index.jsp -p appname.jsb
3 -v


C:\>sencha build -p appname.jsb3 -v -d .

根据文件,它会创建APP-all.js的文件。但是,在它创建文件?

As per the documentation, it will create app-all.js file. But where does it create the file?

我怎么能知道是否构建成功与否产生的?

How can I know IF build are created successfully or not?

在哪里产生的JS文件?

Where are the generated JS files?

我做了搜索,但我无法找到像APP-all.js的东西。

I made a search but I can not found anything like app-all.js.

有关详细信息:

我使用JDK 1.6.0_12和GlassFish V3.1应用服务器。

I am using JDK 1.6.0_12 and GlassFish V3.1 application server.

这里有问题的编辑的内容......

而当我试图使用煎茶SDK,它会产生一个.dpf文件到类路径。
该.dpf文件为如下内容...

And when I am trying to use the sencha SDK, It generates a .dpf file into the class path. The contents of the .dpf file as as below ...

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
  <context-root>/HelloExt</context-root>
  <class-loader delegate="true"/>
  <jsp-config>
    <property name="keepgenerated" value="true">
      <description>Keep a copy of the generated servlet class' java code.</description>
    </property>
  </jsp-config>
</glassfish-web-app>

谁能告诉我为什么在这里产生.DPF文件?为什么它不产生APP-all.js的文件?

Can anyone tell me Why here it generated .DPF file ? Why its not generating the app-all.js file ?

推荐答案

尝试从应用程序的根目录中运行该命令,然后使用相对路径:

Try running the command from inside the app root directory and then using a relative path:

0)打开cmd窗口

1)在cmd窗口运行:CD C:\\ [webserver_webapp_root] \\ [APP_NAME]

在换句话说改变CMD目录应用程序根目录。填写上面的正确路径括号内的文字。

In other words change the cmd directory to the app root. Fill in the bracketed text above with the correct paths.

2)运行在cmd窗口:煎茶创建JSB -a的index.html -p app.jsb3 -v

该app.jsb3应该在你的应用程序的根目录下创建(C:\\ [webserver_webapp_root] \\ [APP_NAME])。打开它并确保它包含所有的应用程序类,它应该是这个样子:

The app.jsb3 should be created in your app's root directory (C:\[webserver_webapp_root]\[app_name]). Open it up and make sure it contains all of your app classes, it should look something like this:

{
    "projectName": "Project Name",
    "licenseText": "Copyright(c) 2012 Company Name",
    "builds": [
        {
            "name": "All Classes",
            "target": "all-classes.js",
            "options": {
                "debug": true
            },
            "files": [
                {
                    "clsName": "YourApp.view.Viewport",
                    "name": "Viewport.js",
                    "path": "app/view/"
                },
                // plus ALOT more classes...
            ]
        },
        {
            "name": "Application - Production",
            "target": "app-all.js",
            "compress": true,
            "files": [
                {
                    "path": "",
                    "name": "all-classes.js"
                },
                {
                    "path": "",
                    "name": "app.js"
                }
            ]
        }
    ],
    "resources": []
}

如果一切正常,那么你可以去到下一个步骤,如果不是那么有什么问题您的应用程序的目录结构,你需要修复它每次的煎茶推荐ExtJS的应用程序体系结构

If everything looks fine then you can go onto the next step, if not then there is something wrong with your app directory structure and you need to fix it per Sencha recommended ExtJS application architecture.

您也可以使用任何错误信息,以帮助确定问题。

You can also use any error messages to help identify the problem.

3)的顶部更新占位符(项目名称等)app.jsb3

4)在cmd窗口运行:煎茶打造-p app.jsb3 -d -v

APP-all.js的文件也应该在应用程序的根目录下创建。如果说之前的cmd窗口不给任何错误,做建筑!那么你都做。现在,你可以改变你的 index.html的脚本链接指向 APP-all.js的而不是 app.js

The app-all.js file should also be created in the app's root directory. If the cmd window doesn't give any errors before it says "Done Building!" then you are all done. You can now change your index.html script link to point to app-all.js instead of app.js.

如果有错误,那么你必须修复这些并再次运行此。

If there are errors then you have to fix those and run this again.

其他的事情你可以试试:

在回答您最后的评论,你的-p开关参数应该是 jsb3 文件不是 JSB

In response to your last comment, your -p switch parameter should be a jsb3 file not jsb.

请确保Web服务器正在运行,并且您的应用程序运行没有任何错误您尝试使用SDK工具之前。

Make sure that the web server is running and that your app runs without any errors before you try to use the SDK Tools.

然后尝试这些:

C:\Projects\HelloExt\build\web>sencha create jsb -a index.jsp -p HelloExt.jsb3 -v

C:\Projects\HelloExt>sencha create jsb -a index.jsp -p HelloExt.jsb3 -v

C:\>sencha create jsb -a [actual IP address]:8080/HelloExt/index.jsp -p HelloExt.jsb3 -v

在括号如下(不本地主机)。

这应该产生#2上方,然后显示的jsb3文件,您可以移动到上述步骤#3。

This should produce the jsb3 file shown in #2 above then you can move on to step #3 above.

这篇关于如何使用煎茶SDK的ExtJS的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆