我必须建立一个特殊的定制客户关系船舶管理工具.CMR只有基本要求(管理客户,为其添加注释,附加电子邮件,......),除了一个,即关于特定应用程序的集成以存储和获取一些数据.
所以我正在寻找一个开源CRM,在那里我可以添加这些特定的东西,因为我不想重新发明我自己实现下一个CRM.所以我正在寻找一种基于现代Java Web Stack的基于Web的开源CRM,用Java编写.我更喜欢基于Spring(或EJB 3.1)和JPA的东西.当然,比使用的技术更重要的是代码(和文档)的质量.
环顾四周后,我没有找到任何符合我需求的项目.所以我想,任何人都可以推荐符合我需求的CRM,还是应该由我自己完全实现?
我正在使用Maven构建JEE6(EJB)应用程序.我使用maven依赖:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)
获得api课程.但我错过了api源代码.(比如javax.ejb ejb-api 3.0)
所以问题是我如何获得JEE6 Apis(特别是EJB 3.1)的源代码?
我需要它来更好地在Eclipse中进行代码补充和文档编制.
我有一个应用程序,其中使用属性占位符来读取属性,配置在applicationContext.xml:
...
<context:property-placeholder
location="classpath*:META-INF/spring/*.properties"/>
...
Run Code Online (Sandbox Code Playgroud)
应用程序在Tomcat中运行,并使用context.xml中定义的参数.应用程序像普通属性(@Value(${cfma.applicationUrl}))一样访问此参数.这有效
在我的测试用例中,我没有这个tomcat属性,所以我想将它们"手动"添加到应用程序上下文中.但也加载正常applicationContext.xml
testContext.xml:
<import resource="classpath:/META-INF/spring/applicationContext.xml" />
<context:property-placeholder properties-ref="simulatedTomcatProperties"/>
<util:properties id="simulatedTomcatProperties">
<prop key="cfmt.applicationBaseUrl">localhost:8080/cfmt</prop>
</util:properties>
Run Code Online (Sandbox Code Playgroud)
现在我有两个上下文:属性占位符,这不起作用(当然) - 所以我的问题是,我可以在测试中的"普通"属性占位符中扩展属性?
更多我需要的解释:
@Value(${cfma.applicationUrl})).而且一定不能有任何Fallback,如果Tomcat中没有定义属性,应用程序一定不能启动!context:property-placeholder他们没有合并:@参见https://jira.springsource.org/browse/SPR-4881上的评论- 他们解释了这种行为.
当我谈论Tomcat参数时,我正在谈论这样的一些想法:
context.xml中:
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<Parameter name="cfmt.applicationBaseUrl"
value="http://localhost/demoApp" override="false"/>
</Context>
Run Code Online (Sandbox Code Playgroud) 我在春天遇到动态表单的问题.在我们的表单中,我们想要指定标题,并添加一些问题.我们有一个"添加"按钮,用于使用jquery添加问题输入表单.
我们的表格在要求时有一个问题栏.每次按下"添加"按钮时,都会添加额外的字段.提交时似乎没有提交额外的字段(第一个字段是由控制器接收的).为什么没有收到额外的字段?
我大致基于这个动态绑定列表示例的代码.
我的模型包括一个"报告"类,它有一个"标题"和一个"研究问题"列表.
下面是两个模型类的简短版本.Roo照顾所有的吸气者和制定者
@Entity
@RooJavaBean
@RooEntity
public class Report{
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
private Long id;
@NotEmpty
private String title;
@OneToMany(mappedBy="report")
private List<Researchquestion> researchquestions;
}
@Entity
@RooJavaBean
@RooEntity
public class Researchquestion {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
private Long id;
@NotEmpty
private String question;
}
Run Code Online (Sandbox Code Playgroud)
这里是表单的jspx
<div xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:form="http://www.springframework.org/tags/form"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:spring="http://www.springframework.org/tags"
version="2.0">
<jsp:output omit-xml-declaration="yes"/>
<spring:url value="/admin/report/appendquestion" var="insert_url"/>
<script type="text/javascript">
$(document).ready(function() {
var questionPosition = 0;
$("#addQuestionButton").click(function() {
questionPosition++; …Run Code Online (Sandbox Code Playgroud) 我有两种单元测试(不是集成测试).由于Spring Security的一些奇怪行为,我需要先运行所有正常测试,然后再运行安全测试.
我正在使用Junit(所以我不能使用任何TestNG组).
所以我所做的是指定两组包含并排除规则.
<excludes>
<exclude>**/*SecurityTest.java</exclude>
</excludes>
<includes>
<include>**/*Test.java</include>
<include>**/*Tests.java</include>
</includes>
Run Code Online (Sandbox Code Playgroud)
和
<excludes>
</excludes>
<includes>
<include>**/*SecurityTest.java</include>
</includes>
Run Code Online (Sandbox Code Playgroud)
如果我用手在我的pom中更换它们,那么我可以进行正常或安全测试.但是我当然希望在每个版本中运行这两种测试.
我的第一次尝试是有两个完整的maven-surefire-plugin配置.但是后来maven只考虑了他们中的最后一个.
我的下一个尝试是使用两个execution定义,但是然后surefire似乎完全忽略了规则并且混合了两种测试.
所以我的一般问题是如何为maven surefire指定两个文件集,以便它们将被逐个执行?更具体地说明如何指定两个不同的文件集.
执行配置
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.9</version>
<configuration>
<junitArtifactName>junit:junit</junitArtifactName>
<encoding>UTF-8</encoding>
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
<argLine>-Xms256m -Xmx512m -XX:MaxPermSize=128m -ea</argLine>
</configuration>
<executions>
<execution>
<id>normal-tests</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<excludes>
<exclude>**/Abstract*.java</exclude>
<exclude>**/*_Roo_*</exclude>
<exclude>**/*SecurityTest.java</exclude>
</excludes>
<includes>
<include>**/*Test.java</include>
<include>**/*Tests.java</include>
</includes>
</configuration>
</execution>
<execution>
<id>security-tests</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<excludes>
<exclude>**/Abstract*.java</exclude>
<exclude>**/*_Roo_*</exclude>
</excludes>
<includes>
<include>**/*SecurityTest.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud) 我遇到的问题是我的@PostLoad方法@Embeddable没有被调用。
但我不知道,它是否应该工作并且在某处存在更多配置错误的错误,或者我它不应该工作,因为@PostLoad仅适用于@Entitys?
我在JSR中没有找到关于@PostLoadin的具体声明。@Embeddable
3.5.1 生命周期回调方法
实体生命周期回调方法可以在实体侦听器类和/或直接在实体类或映射超类上定义。
我不知道这个说法@Embeddable是否包含。
我的持久性提供程序是 Eclipselink。
我使用Maven Cargo (1.2.1) 配置并启动 Glassfish 3.1.2 进行集成测试。我能够配置数据源并启动服务器。但我还需要配置 JDBC 安全领域以及 Java 邮件会话。
但我不知道如何使用 Maven Cargo 配置安全领域和 Java 邮件会话,有人知道吗?
一种方法可能是使用asadmin,但我不知道如何从货物中使用它。
到目前为止我所拥有的:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
<configuration>
<container>
<type>installed</type>
<containerId>glassfish3x</containerId>
<artifactInstaller>
<groupId>org.glassfish.main.distributions</groupId>
<artifactId>glassfish</artifactId>
<version>3.1.2</version>
<type>zip</type>
</artifactInstaller>
<output>${project.build.directory}/glassfish/container.log</output>
<log>${project.build.directory}/glassfish/cargo.log</log>
<append>false</append>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc</artifactId>
</dependency>
</dependencies>
</container>
<configuration>
<home>${project.build.directory}/cargo/configurations/glassfish</home>
<properties>
<cargo.servlet.port>8082</cargo.servlet.port>
<cargo.datasource.datasource>
cargo.datasource.jndi=jdbc/tecisplus|
cargo.datasource.type=javax.sql.DataSource|
cargo.datasource.driver=oracle.jdbc.OracleDriver|
cargo.datasource.url=${it-database.url}|
cargo.datasource.username=$[it-database.username}|
cargo.datasource.password=${it-database.password}
</cargo.datasource.datasource>
</properties>
<deployables>
<deployable>
<groupId>de.test</groupId>
<artifactId>test-ear</artifactId> …Run Code Online (Sandbox Code Playgroud) 我实现了一个使用Oracle DB的Web应用程序(JEE6,EJB WebProfile).我的问题是,我需要更改已使用的数据库架构(名称),而无需重新编译/重新打包应用程序.所以我想要的(这只是一个想法,也许有人有一个更好的),是在服务器中有一些配置(JNDI),具体的Schema名称.但是如何配置Eclipse Link在运行时使用其他模式名称?
细节:
目前我使用该orm.xml文件来指定Schema名称.但是应用程序使用三个不同的Schema名称(一个用于开发,一个用于集成测试,一个用于生产),因此我需要编译和打包(maven)应用程序3次.
我使用Oracle DB在Glassfish上运行JEE6 EJB WebProfile应用程序,数据库连接由Application Server处理并通过JNDI提供给应用程序.
是否有任何机构知道如何在运行时配置数据库模式名称.
我有一个JSP 2.0 <ui:component>,其中<p:dataTable>有一个列使用Composite来呈现关于某些内容的特殊边框.现在我需要识别<p:dataTabe>位于内容中的ajax呈现属性.
<ui:component>
<p:dataTable id="dataTable" var="userItem" ... />
<p:column>
<my:borderBox id="borderBox">
<p:commandButton
action="#{userController.doDelete(userItem.id)}"
value="delete"
update="?????"/> <!-- How to address the dateTable? -->
</my:borderBox>
</p:column>
</p:dataTable>
<ui:component>
Run Code Online (Sandbox Code Playgroud)
我的BorderBox:
<html xmlns:composite="http://java.sun.com/jsf/composite" ...>
<composite:interface>
<composite:attribute name="styleClass" default="" type="java.lang.String"/>
</composite:interface>
<composite:implementation>
<h:panelGroup ...>
...
<composite:insertChildren/>
</h:panelGroup>
</composite:implementation>
Run Code Online (Sandbox Code Playgroud)
我的想法是使用类似的东西
update=":#{component.namingContainer.parent.namingContainer.clientId}:dateTable
但是component.namingContainer.parent接缝是空的.
当我<p:commandButton>用以下语句替换时:
Parent ClientId 1: #{component}
Parent ClientId 2: #{component.namingContainer}
Parent ClientId 3: #{component.namingContainer.clientId}
Parent ClientId 4: #{component.namingContainer.parent}
Parent ClientId 5: #{component.namingContainer.parent.namingContainer}
Run Code Online (Sandbox Code Playgroud)
我得到这个输出:
Parent ClientId …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用ArchUnit进行单元测试,以检查是否有任何未使用的类。但我不知道如何检查 MyClass.class 是否引用了某个类。
例如我有一堂课:
public class MyClass {
...
}
Run Code Online (Sandbox Code Playgroud)
然后我用某种方法引用这个类:
public class MySecondClass{
public void methodA(){
methodThatTakesClassAsParameter(MyClass.class);
}
...
}
Run Code Online (Sandbox Code Playgroud)
如何从 ArchUnit 中看到 MyClass 是从 MySecondClass 引用的?