问题标签 [liferay-7.3]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
liferay - 如何在 FreeMarker 模板中检查 Liferay 版本?
我正在为 Liferay 开发一个主题,我希望同时使用 Liferay 7.2 和 7.3 版本。我如何检查模板中使用的版本,所以我可以做这样的代码:
更新(21/08):
我尝试了使用assign
来获取服务(因为set
不能在模板中使用),serviceLocator
但是null
.<#assign releaseLocalService = serviceLocator.findService("com.liferay.portal.service.ReleaseLocalService")>
liferay - Liferay 门户 jquery 有时无法正常工作
我在 Liferay 7.3.1 GA2 中制作了一个样式表并添加了 jquery 代码,它工作正常。
但是,当我向表中添加一个值时,样式消失了,jquery 不再工作了。但是,如果更改了整个 HTML 代码,它可以正常工作。
这有什么原因吗?
debugging - 如何在 Liferay 7 中调试?
我正在使用 Liferay Developer Studio 3.8 和 Liferay Portal Tomcat 7.3.1。
我想知道如何调试 Liferay 代码,因为即使在“调试模式”下启动服务器,通常的 Eclipse 选项“Watch”或“Inspect”也被禁用?
另外,我不能使用“变量”透视图或“调试外壳”。
有人知道在 Liferay 中调试的虚拟手册吗?
提前致谢。
编辑:Purvesh 建议的行已插入 setenv 文件。
按照 Andre 提供的步骤,我仍然无法在调试 shell 中添加变量或插入表达式。而且,第 68 行和第 69 行的断点没有任何反应。 远程调试
docker - 从 Liferay 7.3 中的角色删除权限
我试图从下拉菜单中隐藏不必要的部分。准确地说是通知、共享内容、我的提交、我的工作流程任务等。
我能够通过
Control panel -> Users -> Roles -> User -> Permissions
有没有办法通过 Hooks 或通过配置文件来实现相同的结果?
我用图像运行 docker,liferay/portal:7.3.0-ga1
因此需要能够在没有 GUI 的情况下实现这一点。
deployment - 将 Vaadin OSGI portlet 所需的包部署到 Liferay 7.3
使用Felix Gogo Shell将 Vaadin OSGI portlet 所需的捆绑包部署到 Liferay 7.0过去是使用命令完成的,例如捆绑包:blade sh start
vaadin-shared
但是,它不再适用于 Liferay 7.3:
如何将捆绑包部署到 Liferay 7.3?
liferay - Unresolved requirement: Import-Package: com.liferay.portal.kernel.portlet.bridges.mvc; version="[2.0.0,3.0.0)"
I have downloaded Liferay 7.3.5 Community Edition from here and trying to deploy a HelloWorld portlet for testing purposes. It is bundled with Tomcat. I am using Liferay Developer Studio (the same old Eclipse on steroids) for developing and deploying the portlet. Version 3.8.1.202004240132-ga2 I have also created a Server like in this link - the server is using the tomcat 9.0.37 from the already downloaded bundle.
After steps above, I have followed steps from here to create a Module Project and to deploy it on the already started tomcat server. The portlet appears in the deployed section, but with a red "x" near it:
I went to add the portlet/widget in a widget page that I have created for this purpose, but I could not find the portlet:
Then, logged in with an admin user, I went to Control Panel -> App Manager and searched for my Portlet. It appears as "Installed" and I can activate it. After I hit "Activate", Eclipse logs start writing: ERROR [http-nio-8080-exec-8][PortletServlet:119] javax.portlet.PortletException: org.osgi.framework.BundleException: Could not resolve module: VictorTestPortlet [2716]_ Unresolved requirement: Import-Package: com.liferay.portal.kernel.portlet.bridges.mvc; version="[2.0.0,3.0.0)"_ [Sanitized]
The Question: what is causing this error ?
angular8 - Liferay - 如何在“serveResource”方法中检索 POST 请求的正文内容
我正在从我的 Angular 8 Liferay 7.3 Portlet 发出一个 POST 请求,并尝试serveResource
在类的方法中获取其内容MVCResourceCommand
。
前端 JS 如下所示:
消息命中端点,因此后端配置良好。基于this,this和this我还设置了"com.liferay.portlet.requires-namespaced-parameters=false"
属性,以便命名空间不会成为问题 - 因此,基本上,检查列表中的每个点都已完成,并且应该可以访问请求正文。到目前为止,我阅读的每篇文章都在谈论使用 获取请求信息ParamUtil.getString(uploadRequest, "text");
,但我不确定如果主体是 JSON 对象,这应该如何工作 - 我的意思是,如果 POST 主体看起来像这样,我应该如何检索该值:
angular - Liferay js bundler - 未删除未使用的节点模块
我正在使用 Liferay 7.3.5 并构建一个 Angular Portlet。我发现尝试不同的模块(或同一模块的版本)非常困难,因为不知何故,最终的 jar OSGI 模块确实包含我使用过的所有模块,而不是 package.json 中的唯一模块文件。
例如,我添加了"ng2-pdf-viewer": "5.3.4"
然后将其切换为"ng2-pdf-viewer": "6.3.0"
. 我期待最终的 jar 文件只包含6.3.0
版本,但它实际上包含 -5.3.4
和6.3.0
. 我一直在玩的所有其他模块都会发生这种情况。所以,基本上,我在 package.json 文件中的内容没有反映在最终的 .jar 文件中,我不确定如何清除只保留所有未使用依赖项的缓存。
我还从 node_modules 文件夹中删除了所有文件夹,但之后没有成功。
如何清除/清理上下文以获得真实状态?
gulp - 扩展经典主题 Liferay 7.3 时出错
我在尝试扩展经典主题时遇到了一个问题(即使不推荐),但是有了 liferay 的新样式书功能,这是我们加快主题创建的好机会。
我使用“yo liferay-theme”生成器创建了一个基本主题项目,构建我的主题并部署它,一切正常。然后我从 lifery frontend-theme-classic github repo 下载了必要的文件:[https://github.com/liferay/liferay-portal/tree/7.3.x/modules/apps/frontend-theme/frontend-theme-classic ][1] [1]: https://github.com/liferay/liferay-portal/tree/7.3.x/modules/apps/frontend-theme/frontend-theme-classic 我添加文件夹:css、图像、 WEB-INF 目录下的模板和一些必要的更改。当我运行 gulp build 时,出现关于未定义变量的错误。
这是 gulp:build 之后的错误消息:
如果有人解决了这个问题,我很乐意理解原因。