- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Alfresco 3.2c 有一个跟踪图像,它使用 Javascript 注入(inject)到页脚中,我需要为项目删除该图像。 javascript实际上是硬编码在alfresco-share-src.zip
的SDK中的。在类里面org/alfresco/web/scripts/MessagesWebScript.java
。
我们目前正在使用 Maven 项目构建 Alfresco,它从 Maven 插件和存储库中提取大部分 Alfresco 和 Share,为我们提供了干净的根构建添加。但是,由于此类是硬编码的,我们不想触摸原始 jars/zips,我想我可以将文件的新副本添加到 share/src/main/java/org/alfresco/web/scripts/MessagesWebScript.java
,将其编译到 war 文件的 WEB-INF 中,从而覆盖从 jar 中加载的内容(是的,我知道这样做的一个不好的方法)。
但是,如果我只是添加文件,则会收到错误 /share/src/main/java/org/alfresco/web/scripts/MessagesWebScript.java:[48,80] error: cannot find symbol
上线了
public class MessagesWebScript extends org.springframework.extensions.webscripts.MessagesWebScript
这让我相信它没有引入用于构建 war 文件的相同依赖项(即 spring-surf-parent 依赖项)。如果我尝试将该依赖项添加到 share.pom 文件(如下所示),maven 会成功构建,但该依赖项会以某种方式引入 servlet API jar 文件,将它们添加到 war 中,然后我得到预期的 The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
错误。
<dependency>
<groupId>org.springframework.extensions.surf</groupId>
<artifactId>spring-surf-parent</artifactId>
<version>1.2.0-M3</version>
</dependency>
我的 share.pom 如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>share</artifactId>
<name>Alfresco Share Client</name>
<packaging>war</packaging>
<description>Alfresco Share Client</description>
<parent>
<groupId>nz.net.mycompany</groupId>
<artifactId>custom-alfresco</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>share</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version><!--$NO-MVN-MAN-VER$-->
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.2.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.searls</groupId>
<artifactId>jasmine-maven-plugin</artifactId>
<version>1.3.1.2</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>jetty</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>${basedir}/src/scripts/less2css.sh</executable>
<arguments>
<argument>${basedir}</argument>
</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<!-- Integration Tests should not be run here -->
<exclude>**/IT*.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.14.1</version>
<executions>
<execution>
<goals>
<!-- <goal>integration-test</goal> -->
<!-- <goal>verify</goal> -->
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.searls</groupId>
<artifactId>jasmine-maven-plugin</artifactId>
<version>1.3.1.2</version>
<executions>
<execution>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<webDriverClassName>org.openqa.selenium.phantomjs.PhantomJSDriver</webDriverClassName>
<webDriverCapabilities>
<phantomjs.binary.path>${project.basedir}/src/test/bin/phantomjs</phantomjs.binary.path>
</webDriverCapabilities>
<preloadSources>
<source>${project.basedir}/src/test/javascript/fixtures/fixture_messages.js</source>
</preloadSources>
<jsSrcDir>${project.basedir}/target/share/js/</jsSrcDir>
<jsTestSrcDir>${project.basedir}/src/test/javascript/</jsTestSrcDir>
<sourceIncludes>
<!-- add the ones we want first -->
<include>**/yui-common.js</include>
<include>**/alfresco.js</include>
<!-- Then the default -->
<include>**/*.js</include>
</sourceIncludes>
<haltOnFailure>false</haltOnFailure>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<!-- Here is can control the order of overlay of your (WAR, AMP, etc.) dependencies
| NOTE: At least one WAR dependency must be uncompressed first
| NOTE: In order to have a dependency effectively added to the WAR you need to
| explicitly mention it in the overlay section.
| NOTE: First-win resource strategy is used by the WAR plugin
-->
<overlays>
<!-- The current project customizations -->
<overlay />
<!-- The Share WAR -->
<overlay>
<groupId>${alfresco.groupId}</groupId>
<artifactId>share</artifactId>
<type>war</type>
<!-- To allow inclusion of META-INF -->
<excludes />
</overlay>
</overlays>
</configuration>
</plugin>
</plugins>
</build>
</project>
最佳答案
如果我理解正确的话,您想要覆盖单个 Java 类,在本例中,该类恰好实现了一个 Web 脚本,但是您使用此类的 fork 副本重新打包共享 WAR 的解决方案不起作用。
重新定义核心 Alfresco(或本例中的 Share)类是一个坏主意。此 Web 脚本在 Web 应用程序类路径中的 Spring 配置文件 alfresco/slingshot-application-context.xml
中声明,因此您应该做的是在您自己的 *-context 中覆盖它
文件,例如alfresco/web-extension
下的 .xml
<?xml version='1.0' encoding='UTF-8'?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<!-- I18N resources and messages Web Script -->
<bean id="webscript.org.springframework.extensions.messages.get"
parent="webscript"
class="my.custom.namespace.MessagesWebScript">
<property name="webFrameworkConfigElement" ref="webframework.config.element"/>
<property name="dependencyHandler" ref="dependency.handler"/>
</bean>
</beans>
没有理由不从一开始就通过 Spring 实现覆盖。 Spring bean 就是为此目的而设计的,它几乎不会增加工作量,同时让您能够在它未按预期工作时更有效地进行调试。
显然,您还需要确保您的自定义类 my.custom.namespace.MessagesWebScript
作为构建的一部分进行编译,但听起来目前还没有这样做。这可能是因为您在 POM 中缺少一些 JAR(不是 WAR)依赖项 - 请查看 Google Docs integration Share POM对于我们使用的集合。
最后,我建议您将自定义打包为 AMP file 。 Alfresco Maven SDK对此提供全面支持,您只需将其声明为父级 - 请参阅 Google Docs parent POM举个例子。
关于java - 从 Maven 项目中的 Alfresco 中删除远程跟踪图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16928525/
我想在 Alfresco 中实现类似亚马逊的建议. 例如,如果员工搜索“财务报告 2007”,搜索 UI 将显示相关文档,例如之前搜索相同内容的用户下载/查看的文档。 它可能会显示 Lucene(Al
我们正在考虑将 Alfresco Enterprise 3.4.1 降级为 Alfresco Community。 我习惯了 Alfresco Enterprise,但没有使用社区版本的经验。 我们使
我有兴趣在对露天特定文件夹下的任何文档或文件夹进行任何更改时触发代码运行。我确信 alfresco 必须以某种方式支持这一点,但我不完全确定该功能/api/服务的名称或谷歌的内容。什么在露天有这种能力
从所描述的功能来看,Alfresco Team和 Alfresco Share产品看起来非常相似。 技术差异是什么? 以下是我听说过的一些差异,但欢迎提供更好的列表: 视频预览 预览更多 Adob
我有兴趣在对露天特定文件夹下的任何文档或文件夹进行任何更改时触发代码运行。我确信 alfresco 必须以某种方式支持这一点,但我不完全确定该功能/api/服务的名称或谷歌的内容。什么在露天有这种能力
我正在尝试编辑 task-edit 的链接发送给任务受让人的电子邮件。我在文件 wf-emails.html.ftl 中看到了但在 Data Dictionary -> Email Templates
假设我在 alfresco-global.properties 文件中创建了一个名为“test123”的自定义属性。是否有自定义对象或其他方式可用于访问 Alfresco 中 Java bean 内的
作为我们法规要求的一部分,我们希望在工作流摘要页面的工作流历史记录中捕获任务重新分配。 为了实现这一点,当任务被重新分配时,我将作为系统完成当前任务,将结果设置为任务重新分配,任务将分配给新人。这种方
在存储库中会有不同的文档列表。即会有数据字典、用户主页、访客主页等。当我将 View 更改为“详细 View ”时,它会显示收藏、喜欢、评论链接。如果我不想显示它们,我必须在哪里修改。你能告诉我必须在
我正在使用 Alfresco Enterprise 6.2。与实时搜索类似,我正在为文档库中的文件夹创建搜索操作。 我已更新 custom-actions.js 如下: onActionSearch:
我想在指定的文件夹中搜索文件。我的意思是,如下例所示,搜索 mainfolder1 的文档。我怎样才能做到这一点??可以用lucene吗??我知道lucene可以指定store。我不知道文件夹。 --
在 Alfresco 服务器中,几个上传的内容消失了,我检查日志以查看文件发生了什么情况。 In /opt/alfresco/tomcat/logs 但是文件是空的。 最佳答案 在命令行中尝试 $ p
我正在使用 Alfresco Share 4.2c,并且我有一个属性类型为 d:text 的方面。在“编辑元数据”页面上,我想为该属性创建一个自定义选择器。 我见过的最接近文件选择器的是 associ
我编写了一个脚本来运行 Alfresco 规则。但我希望脚本在特定时间后运行(我需要脚本在 1 周后运行)。任何解决方案? 我读到了 Scheduled_Actions , 这个功能有用吗? 最佳答案
我想在指定的文件夹中搜索文件。我的意思是,如下例所示,搜索 mainfolder1 的文档。我怎样才能做到这一点??可以用lucene吗??我知道lucene可以指定store。我不知道文件夹。 --
在 Alfresco 服务器中,几个上传的内容消失了,我检查日志以查看文件发生了什么情况。 In /opt/alfresco/tomcat/logs 但是文件是空的。 最佳答案 在命令行中尝试 $ p
如何在节点的旧版本中搜索元数据字段? 我知道 Solr 支持 version2store 的索引,看起来在 Alfresco 4.2f 中,它确实被索引了。但是,似乎没有办法通过仅查询 : 来通过共享
我正在使用 Alfresco Share 4.2c,并且我有一个属性类型为 d:text 的方面。在“编辑元数据”页面上,我想为该属性创建一个自定义选择器。 我见过的最接近文件选择器的是 associ
我遇到了调用 https://localhost:8080/alfresco/service/api/people 的问题。只返回前 5000 个用户。 我不知道如何从系统中取出其余部分——该 API
我有 OnCreateNodePolicy 实现,我正在考虑在绑定(bind)初始化中添加条件(一些速度优化),这可能吗? 我是什么意思?让我们有类似这样的定义: policyComponent.bi
我是一名优秀的程序员,十分优秀!