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

查看:12
本文介绍了如何使用 Sencha SDK for 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.

我正在尝试从 Sencha 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.

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

当我尝试使用 sencha 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窗口运行:sencha create 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": []
}

如果一切正常,那么您可以继续下一步,如果不是,那么您的应用程序目录结构有问题,您需要根据 Sencha 推荐的 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窗口中运行:sencha build -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.

在尝试使用 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:ProjectsHelloExtuildweb>sencha create jsb -a index.jsp -p HelloExt.jsb3 -v

C:ProjectsHelloExt>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

在括号所在的位置填写您的实际 IP 地址(不是 localhost).

Fill in your actual IP address where the brackets are (not localhost).

这应该会生成上面 #2 中所示的 jsb3 文件,然后您可以继续上面的步骤 #3.

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

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

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