如何找到 Liferay 中 javascript 文件的连接顺序?
因此,在 Liferay 中,我们有一个包含所有核心 javascript 的 ROOT/html/js
文件夹。有人可以向我解释创建串联 js 文件的确切机制吗? barebone.jsp 和 everything.jsp 之间有什么区别?在代码中的哪里可以看到文件连接成一个文件的顺序?
我可以看到 top_js.jspf
文件,但我仍然不清楚。
提前致谢。
So, in Liferay we have a ROOT/html/js
folder with all core javascript. Can somebody explain me exact mechanism of creating concatenated js-file. What is the difference between barebone.jsp and everything.jsp? Where in code I can see the order in which file are concatenated into one file?
I can see top_js.jspf
file, but nevertheless it remaind unclear to me.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Liferay 的portal.properties 是最好的文档文件之一。您可以在 Liferay Wiki 或 Portal-impl.jar 中找到它。
在那里搜索“准系统”或“一切”或只是“Javascript”。从那里我复制了以下文档:
以下部分(为了不复制此处的所有内容)也可能包含与您的案例相关的有趣信息。但我想你的问题已经通过上面的部分得到了回答 - 请阅读 Portal.properties 中的其余部分。
编辑:回答您的评论:顺序记录在上面,从上到下,因为后面的文件依赖于前面的文件。此外,以下属性可能会给出推理提示:
所有这一切背后的原因是,在许多安装中,客户希望最大限度地减少传输的数据量和执行的 JavaScript 量。如果一切都是完全动态的,这将导致传输大量文件,这会通过 http 花费大量时间。 “barebones”和“everything”连接并缩小所有文件并将它们作为一个整体进行传输。通常,仅传输一个文件比传输多个文件要快得多,即使所有文件加起来的长度相同。
虽然人们可以争论 Liferay 的一般文档数量,但我想说你不能争论 Portal.properties 是 Liferay 中最好的文档文件之一。看看它 - 只要这样做就会让您深入了解 Liferay 可以做哪些巧妙的事情。
Liferay's portal.properties is one of the best documented files. You'll find it either in the Liferay Wiki or in portal-impl.jar.
In there search for "barebone" or "everything" or just "Javascript". From there I've copied the following documentation:
The following sections (in order to not copy everything here) might also contain interesting information for your case. But I guess your question is answered with the parts from above - read the rest in portal.properties.
Edit: To answer to your comment: The order is documented above, it's top to bottom, as the later files depend on the earlier. Further the following property might give a hint on reasoning:
The reason behind all of this is that in many installations customers want to minimize the amount of data transferred and javascript executed. If everything would be fully dynamic, this would result in lots of files to be transferred, which takes a lot of time through http. "barebones" and "everything" concatenate and minify all of the files and transfer them as one. Typically, transferring just one file is a lot faster than transferring multiple files, even if all add up to the same length.
And while one can argue about the amount of documentation for Liferay in general, I'd say you can't argue about portal.properties being among the best documented files in Liferay. Take a look at it - just doing so will give you a lot of insight of what neat things you can do with Liferay.
请记住,准系统列表是在注销状态下列出的 javascript 文件。 everything 列表是 everything 列表和准系统列表的组合。
Please remember that the barebones listing is the javascript file listed in a logged out state. The everything list is a combination of the everything list and the barebones listing .