update archetypes
This commit is contained in:
parent
3d0161908e
commit
82b2d4b1fe
@ -5,27 +5,27 @@ function discoverArtifactId {
|
|||||||
|
|
||||||
function rebuild {
|
function rebuild {
|
||||||
echo "Rebuilding project ..."
|
echo "Rebuilding project ..."
|
||||||
mvn process-classes
|
mvn process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_ {
|
function start_ {
|
||||||
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
mvn -Drad process-classes
|
mvn -Drad process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_log {
|
function start_log {
|
||||||
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
mvn -Drad "-Ddocker.showLogs" process-classes
|
mvn -Drad "-Ddocker.showLogs" process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop_ {
|
function stop_ {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
echo "Stopping Docker containers that supported rapid application development ..."
|
echo "Stopping Docker containers that supported rapid application development ..."
|
||||||
docker container ls --filter name=${ARTIFACT_ID}-*
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
echo "Stopping containers ..."
|
echo "Stopping containers ..."
|
||||||
docker container stop (docker container ls -q --filter name=${ARTIFACT_ID}-*)
|
docker container stop (docker container ls -q --filter name="^/${ARTIFACT_ID}")
|
||||||
echo "Removing containers ..."
|
echo "Removing containers ..."
|
||||||
docker container rm (docker container ls -aq --filter name=${ARTIFACT_ID}-*)
|
docker container rm (docker container ls -aq --filter name="^/${ARTIFACT_ID}")
|
||||||
}
|
}
|
||||||
|
|
||||||
function tail_logs {
|
function tail_logs {
|
||||||
@ -34,12 +34,12 @@ function tail_logs {
|
|||||||
)
|
)
|
||||||
|
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
docker container logs -f (docker container ls -q --filter name=${ARTIFACT_ID}-${container})
|
docker container logs -f (docker container ls -q --filter name="^/${ARTIFACT_ID}-${container}$")
|
||||||
}
|
}
|
||||||
|
|
||||||
function list {
|
function list {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
docker container ls --filter name=${ARTIFACT_ID}-*
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($args[0]) {
|
switch ($args[0]) {
|
||||||
|
@ -1,42 +1,42 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
discoverArtifactId() {
|
discoverArtifactId() {
|
||||||
ARTIFACT_ID=`mvn -q -Dexpression=project.artifactId -DforceStdout help:evaluate`
|
local ARTIFACT_ID=`mvn -q -Dexpression=project.artifactId -DforceStdout help:evaluate`
|
||||||
}
|
}
|
||||||
|
|
||||||
rebuild() {
|
rebuild() {
|
||||||
echo "Rebuilding project ..."
|
echo "Rebuilding project ..."
|
||||||
mvn process-classes
|
mvn process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
mvn -Drad process-classes
|
mvn -Drad process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
start_log() {
|
start_log() {
|
||||||
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
mvn -Drad -Ddocker.showLogs process-classes
|
mvn -Drad -Ddocker.showLogs process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
echo "Stopping Docker containers that supported rapid application development ..."
|
echo "Stopping Docker containers that supported rapid application development ..."
|
||||||
docker container ls --filter name=${ARTIFACT_ID}-*
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
echo "Stopping containers ..."
|
echo "Stopping containers ..."
|
||||||
docker container stop `docker container ls -q --filter name=${ARTIFACT_ID}-*`
|
docker container stop `docker container ls -q --filter name="^/${ARTIFACT_ID}"`
|
||||||
echo "Removing containers ..."
|
echo "Removing containers ..."
|
||||||
docker container rm `docker container ls -aq --filter name=${ARTIFACT_ID}-*`
|
docker container rm `docker container ls -aq --filter name="^/${ARTIFACT_ID}"`
|
||||||
}
|
}
|
||||||
|
|
||||||
tail_logs() {
|
tail_logs() {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
docker container logs -f `docker container ls -q --filter name=${ARTIFACT_ID}-$1`
|
docker container logs -f `docker container ls -q --filter name="^/${ARTIFACT_ID}-$1$"`
|
||||||
}
|
}
|
||||||
|
|
||||||
list() {
|
list() {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
docker container ls --filter name=${ARTIFACT_ID}-*
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
@ -20,27 +20,47 @@ import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransacti
|
|||||||
import org.alfresco.service.ServiceRegistry;
|
import org.alfresco.service.ServiceRegistry;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.DisposableBean;
|
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.ApplicationEvent;
|
||||||
|
import org.springframework.extensions.surf.util.AbstractLifecycleBean;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is an example of how you can use the Alfresco Java Public API on startup or shutdown.
|
* This class is an example of how you can use the Alfresco Java Public API on startup or shutdown.
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class ExampleBootstrap implements InitializingBean, DisposableBean {
|
public class ExampleBootstrap extends AbstractLifecycleBean {
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||||
|
|
||||||
// this is the Alfresco Public Java API entrypoint
|
// this is the Alfresco Public Java API entrypoint
|
||||||
@Autowired
|
@Autowired
|
||||||
protected ServiceRegistry serviceRegistry;
|
protected ServiceRegistry serviceRegistry;
|
||||||
|
|
||||||
@Override
|
@Value("${example.config.value:default}")
|
||||||
public void afterPropertiesSet() throws Exception {
|
private String configValue;
|
||||||
if (this.logger.isTraceEnabled())
|
|
||||||
this.logger.trace("onStartup()");
|
@Value("${example.config.value:#{null}}")
|
||||||
|
private String configValueWithNullDefault;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is called after Spring beans and configuration are injected, but
|
||||||
|
* before ACS services are ready. So don't call any ACS services, start an
|
||||||
|
* ACS transaction, or try to create an authentication context.
|
||||||
|
*/
|
||||||
|
@PostConstruct
|
||||||
|
private void init() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is called after @PostConstruct and all the ACS services are
|
||||||
|
* initialized and ready. You will have no authentication or transaction
|
||||||
|
* context.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void onBootstrap(ApplicationEvent event) {
|
||||||
|
this.logger.trace("onBootstrap()");
|
||||||
|
|
||||||
// provide some authority within the Alfresco context
|
// provide some authority within the Alfresco context
|
||||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
|
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
|
||||||
@ -57,11 +77,15 @@ public class ExampleBootstrap implements InitializingBean, DisposableBean {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public void destroy() throws Exception {
|
* This is called after @PostConstruct and all the ACS services are
|
||||||
if (this.logger.isTraceEnabled())
|
* initialized and ready. You will have no authentication or transaction
|
||||||
this.logger.trace("onShutdown()");
|
* context.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void onShutdown(ApplicationEvent event) {
|
||||||
|
this.logger.trace("onShutdown()");
|
||||||
|
|
||||||
// provide some authority within the Alfresco context
|
// provide some authority within the Alfresco context
|
||||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
|
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
|
||||||
|
@ -21,15 +21,15 @@ import org.alfresco.service.ServiceRegistry;
|
|||||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.extensions.surf.util.AbstractLifecycleBean;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is an example of how you can use the Alfresco Java Public API when Alfresco triggers an event.
|
* This class is an example of how you can use the Alfresco Java Public API when Alfresco triggers an event.
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class ExampleEventListener implements InitializingBean, OnCreateNodePolicy {
|
public class ExampleEventListener extends AbstractLifecycleBean implements OnCreateNodePolicy {
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||||
|
|
||||||
@ -37,24 +37,34 @@ public class ExampleEventListener implements InitializingBean, OnCreateNodePolic
|
|||||||
@Autowired
|
@Autowired
|
||||||
protected ServiceRegistry serviceRegistry;
|
protected ServiceRegistry serviceRegistry;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterPropertiesSet() throws Exception {
|
protected void onBootstrap(ApplicationEvent event) {
|
||||||
this.bind();
|
this.bind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This must be called after the `PolicyComponent` is initialized/ready.
|
||||||
|
* So you cannot call it from with `@PostConstruct` or using
|
||||||
|
* `InitializingBean`.
|
||||||
|
*/
|
||||||
public void bind() {
|
public void bind() {
|
||||||
if (this.logger.isTraceEnabled())
|
this.logger.trace("bind()");
|
||||||
this.logger.trace("bind()");
|
|
||||||
|
|
||||||
// example listener
|
// example listener
|
||||||
this.serviceRegistry.getPolicyComponent().bindClassBehaviour(OnCreateNodePolicy.QNAME, this,
|
this.serviceRegistry.getPolicyComponent().bindClassBehaviour(OnCreateNodePolicy.QNAME, this,
|
||||||
new JavaBehaviour(this, OnCreateNodePolicy.QNAME.getLocalName(), NotificationFrequency.TRANSACTION_COMMIT));
|
new JavaBehaviour(this, OnCreateNodePolicy.QNAME.getLocalName(), NotificationFrequency.TRANSACTION_COMMIT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This will execute with the same authentication and transaction context
|
||||||
|
* as was used to create the node, unless the binding is
|
||||||
|
* `TRANSACTION_COMMIT`. Then it will only have the same transaction
|
||||||
|
* context and the authentication context used when starting the
|
||||||
|
* transaction.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onCreateNode(ChildAssociationRef childAssocRef) {
|
public void onCreateNode(ChildAssociationRef childAssocRef) {
|
||||||
if (this.logger.isTraceEnabled())
|
this.logger.trace("onCreateNode('" + childAssocRef.getChildRef() + "')");
|
||||||
this.logger.trace("onCreateNode('" + childAssocRef.getChildRef() + "')");
|
|
||||||
|
|
||||||
// TODO do some work
|
// TODO do some work
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,11 @@ public class ExampleGetWebScript extends AbstractWebScript {
|
|||||||
@Autowired
|
@Autowired
|
||||||
protected ServiceRegistry serviceRegistry;
|
protected ServiceRegistry serviceRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This will have the authentication context of the authenticated user
|
||||||
|
* calling the REST endpoint. The transaction context is defined in the
|
||||||
|
* web script descriptor.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException {
|
public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException {
|
||||||
if (this.logger.isTraceEnabled())
|
if (this.logger.isTraceEnabled())
|
||||||
|
@ -32,11 +32,17 @@ public class ExampleJavaScriptRootObject extends BaseProcessorExtension {
|
|||||||
@Autowired
|
@Autowired
|
||||||
protected ServiceRegistry serviceRegistry;
|
protected ServiceRegistry serviceRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An example method that called from within a JavaScript within the ACS
|
||||||
|
* application: `example.getMessage("example.property")`. All simple
|
||||||
|
* parameter and return types are generally supported.
|
||||||
|
*
|
||||||
|
* The `example` root name comes from the `module-context.xml` file.
|
||||||
|
*/
|
||||||
public String getMessage(String messageKey) {
|
public String getMessage(String messageKey) {
|
||||||
if (this.logger.isTraceEnabled())
|
if (this.logger.isTraceEnabled())
|
||||||
this.logger.trace("getMessage('" + messageKey + "')");
|
this.logger.trace("getMessage('" + messageKey + "')");
|
||||||
|
|
||||||
// just and example method, called in JS with: example.getMessage("example.property");
|
|
||||||
return this.serviceRegistry.getDictionaryService().getMessage(messageKey);
|
return this.serviceRegistry.getDictionaryService().getMessage(messageKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
<!-- Documentation: https://docs.alfresco.com/content-services/6.2/develop/reference/web-scripts-ref -->
|
<!-- Documentation: https://docs.alfresco.com/content-services/6.2/develop/reference/web-scripts-ref -->
|
||||||
<webscript>
|
<webscript xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:noNamespaceSchemaLocation="https://bitbucket.org/!api/2.0/snippets/inteligr8/AzMgbp/HEAD/files/snippet.txt">
|
||||||
<shortname>Example Webscript</shortname>
|
<shortname>Example Webscript</shortname>
|
||||||
<description>Example Java-backed webscript description</description>
|
<description>Example Java-backed webscript description</description>
|
||||||
<url>/exampleJava?paramName={paramValue}</url>
|
|
||||||
<authentication>user</authentication>
|
|
||||||
<format default="json"></format>
|
|
||||||
<family>${shortname}</family>
|
<family>${shortname}</family>
|
||||||
|
<url>/exampleJava?paramName={paramValue}</url>
|
||||||
|
<format default="json"></format>
|
||||||
|
<authentication>user</authentication>
|
||||||
</webscript>
|
</webscript>
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
<!-- Documentation: https://docs.alfresco.com/content-services/6.2/develop/reference/web-scripts-ref -->
|
<!-- Documentation: https://docs.alfresco.com/content-services/6.2/develop/reference/web-scripts-ref -->
|
||||||
<webscript>
|
<webscript xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:noNamespaceSchemaLocation="https://bitbucket.org/!api/2.0/snippets/inteligr8/AzMgbp/HEAD/files/snippet.txt">
|
||||||
<shortname>Example Webscript</shortname>
|
<shortname>Example Webscript</shortname>
|
||||||
<description>Example JS-backed webscript description</description>
|
<description>Example JS-backed webscript description</description>
|
||||||
<url>/exampleJs?paramName={paramValue}</url>
|
|
||||||
<authentication>guest</authentication>
|
|
||||||
<format default="json"></format>
|
|
||||||
<family>${shortname}</family>
|
<family>${shortname}</family>
|
||||||
|
<url>/exampleJs?paramName={paramValue}</url>
|
||||||
|
<format default="json"></format>
|
||||||
|
<authentication>guest</authentication>
|
||||||
</webscript>
|
</webscript>
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
logger.example.name=${package}
|
||||||
|
logger.example.level=info
|
@ -0,0 +1,8 @@
|
|||||||
|
# Module debugging
|
||||||
|
logger.example.level=trace
|
||||||
|
|
||||||
|
# WebScript debugging
|
||||||
|
logger.springframework-extensions-webscripts-ScriptLogger.level=debug
|
||||||
|
|
||||||
|
# non-WebScript JavaScript execution debugging
|
||||||
|
logger.alfresco-repo-jscript-ScriptLogger.level=debug
|
@ -5,27 +5,27 @@ function discoverArtifactId {
|
|||||||
|
|
||||||
function rebuild {
|
function rebuild {
|
||||||
echo "Rebuilding project ..."
|
echo "Rebuilding project ..."
|
||||||
mvn process-classes
|
mvn process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_ {
|
function start_ {
|
||||||
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
mvn -Drad process-classes
|
mvn -Drad process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_log {
|
function start_log {
|
||||||
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
mvn -Drad "-Ddocker.showLogs" process-classes
|
mvn -Drad "-Ddocker.showLogs" process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop_ {
|
function stop_ {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
echo "Stopping Docker containers that supported rapid application development ..."
|
echo "Stopping Docker containers that supported rapid application development ..."
|
||||||
docker container ls --filter name=${ARTIFACT_ID}-*
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
echo "Stopping containers ..."
|
echo "Stopping containers ..."
|
||||||
docker container stop (docker container ls -q --filter name=${ARTIFACT_ID}-*)
|
docker container stop (docker container ls -q --filter name="^/${ARTIFACT_ID}")
|
||||||
echo "Removing containers ..."
|
echo "Removing containers ..."
|
||||||
docker container rm (docker container ls -aq --filter name=${ARTIFACT_ID}-*)
|
docker container rm (docker container ls -aq --filter name="^/${ARTIFACT_ID}")
|
||||||
}
|
}
|
||||||
|
|
||||||
function tail_logs {
|
function tail_logs {
|
||||||
@ -34,12 +34,12 @@ function tail_logs {
|
|||||||
)
|
)
|
||||||
|
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
docker container logs -f (docker container ls -q --filter name=${ARTIFACT_ID}-${container})
|
docker container logs -f (docker container ls -q --filter name="^/${ARTIFACT_ID}-${container}$")
|
||||||
}
|
}
|
||||||
|
|
||||||
function list {
|
function list {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
docker container ls --filter name=${ARTIFACT_ID}-*
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($args[0]) {
|
switch ($args[0]) {
|
||||||
|
@ -1,42 +1,42 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
discoverArtifactId() {
|
discoverArtifactId() {
|
||||||
ARTIFACT_ID=`mvn -q -Dexpression=project.artifactId -DforceStdout help:evaluate`
|
local ARTIFACT_ID=`mvn -q -Dexpression=project.artifactId -DforceStdout help:evaluate`
|
||||||
}
|
}
|
||||||
|
|
||||||
rebuild() {
|
rebuild() {
|
||||||
echo "Rebuilding project ..."
|
echo "Rebuilding project ..."
|
||||||
mvn process-classes
|
mvn process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
mvn -Drad process-classes
|
mvn -Drad process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
start_log() {
|
start_log() {
|
||||||
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
mvn -Drad -Ddocker.showLogs process-classes
|
mvn -Drad -Ddocker.showLogs process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
echo "Stopping Docker containers that supported rapid application development ..."
|
echo "Stopping Docker containers that supported rapid application development ..."
|
||||||
docker container ls --filter name=${ARTIFACT_ID}-*
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
echo "Stopping containers ..."
|
echo "Stopping containers ..."
|
||||||
docker container stop `docker container ls -q --filter name=${ARTIFACT_ID}-*`
|
docker container stop `docker container ls -q --filter name="^/${ARTIFACT_ID}"`
|
||||||
echo "Removing containers ..."
|
echo "Removing containers ..."
|
||||||
docker container rm `docker container ls -aq --filter name=${ARTIFACT_ID}-*`
|
docker container rm `docker container ls -aq --filter name="^/${ARTIFACT_ID}"`
|
||||||
}
|
}
|
||||||
|
|
||||||
tail_logs() {
|
tail_logs() {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
docker container logs -f `docker container ls -q --filter name=${ARTIFACT_ID}-$1`
|
docker container logs -f `docker container ls -q --filter name="^/${ARTIFACT_ID}-$1$"`
|
||||||
}
|
}
|
||||||
|
|
||||||
list() {
|
list() {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
docker container ls --filter name=${ARTIFACT_ID}-*
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
logger.example.name=${package}
|
||||||
|
logger.example.level=info
|
@ -0,0 +1,74 @@
|
|||||||
|
#set( $symbol_pound = '#' )
|
||||||
|
#set( $symbol_dollar = '$' )
|
||||||
|
#set( $symbol_escape = '\' )
|
||||||
|
# Set root logger level to error
|
||||||
|
rootLogger.level=error
|
||||||
|
rootLogger.appenderRef.stdout.ref=ConsoleAppender
|
||||||
|
rootLogger.appenderRef.rolling.ref=RollingAppender
|
||||||
|
|
||||||
|
# All outputs currently set to be a ConsoleAppender.
|
||||||
|
appender.console.type=Console
|
||||||
|
appender.console.name=ConsoleAppender
|
||||||
|
appender.console.layout.type=PatternLayout
|
||||||
|
appender.console.layout.pattern=%d{ISO8601} %x %-5p [%c{3}] [%t] %replace{%m}{[\r\n]+}{}%n
|
||||||
|
|
||||||
|
###### File appender definition #######
|
||||||
|
appender.rolling.type=RollingFile
|
||||||
|
appender.rolling.name=RollingAppender
|
||||||
|
appender.rolling.fileName=share.log
|
||||||
|
appender.rolling.filePattern=share.log.%d{yyyy-MM-dd}
|
||||||
|
appender.rolling.layout.type=PatternLayout
|
||||||
|
appender.rolling.layout.pattern=%d{yyyy-MM-dd} %d{ABSOLUTE} %-5p [%c] [%t] %replace{%m}{[\r\n]+}{}%n
|
||||||
|
appender.rolling.policies.type = Policies
|
||||||
|
appender.rolling.policies.time.type=TimeBasedTriggeringPolicy
|
||||||
|
appender.rolling.policies.time.interval=1
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
logger.springframework.name=org.springframework
|
||||||
|
logger.springframework.level=warn
|
||||||
|
|
||||||
|
# Turn off Spring remoting warnings that should really be info or debug.
|
||||||
|
logger.springframework-remoting-support.name=org.springframework.remoting.support
|
||||||
|
logger.springframework-remoting-support.level=error
|
||||||
|
logger.springframework-util.name=org.springframework.util
|
||||||
|
logger.springframework-util.level=error
|
||||||
|
|
||||||
|
# MyFaces
|
||||||
|
logger.apache-myfaces-util-DebugUtils.name=org.apache.myfaces.util.DebugUtils
|
||||||
|
logger.apache-myfaces-util-DebugUtils.level=info
|
||||||
|
logger.apache-myfaces-el-VariableResolverImpl.name=org.apache.myfaces.el.VariableResolverImpl
|
||||||
|
logger.apache-myfaces-el-VariableResolverImpl.level=error
|
||||||
|
logger.apache-myfaces-application-jsp-JspViewHandlerImpl.name=org.apache.myfaces.application.jsp.JspViewHandlerImpl
|
||||||
|
logger.apache-myfaces-application-jsp-JspViewHandlerImpl.level=error
|
||||||
|
logger.apache-myfaces-taglib.name=org.apache.myfaces.taglib
|
||||||
|
logger.apache-myfaces-taglib.level=error
|
||||||
|
|
||||||
|
# Alfresco
|
||||||
|
logger.alfresco.name=org.alfresco
|
||||||
|
logger.alfresco.level=error
|
||||||
|
logger.alfresco-config.name=org.alfresco.config
|
||||||
|
logger.alfresco-config.level=warn
|
||||||
|
logger.alfresco-config-JndiObjectFactoryBean.name=org.alfresco.config.JndiObjectFactoryBean
|
||||||
|
logger.alfresco-config-JndiObjectFactoryBean.level=warn
|
||||||
|
logger.alfresco-web.name=org.alfresco.web
|
||||||
|
logger.alfresco-web.level=info
|
||||||
|
|
||||||
|
# Web Framework
|
||||||
|
logger.springframework-extensions-webscripts.name=org.springframework.extensions.webscripts
|
||||||
|
logger.springframework-extensions-webscripts.level=info
|
||||||
|
logger.springframework-extensions-webscripts-ScriptLogger.name=org.springframework.extensions.webscripts.ScriptLogger
|
||||||
|
logger.springframework-extensions-webscripts-ScriptLogger.level=warn
|
||||||
|
logger.springframework-extensions-webscripts-ScriptDebugger.name=org.springframework.extensions.webscripts.ScriptDebugger
|
||||||
|
logger.springframework-extensions-webscripts-ScriptDebugger.level=off
|
||||||
|
|
||||||
|
# Freemarker
|
||||||
|
# Note the freemarker.runtime logger is used to log non-fatal errors that are handled by Alfresco's retrying transaction handler
|
||||||
|
logger.freemarker-runtime.name=freemarker.runtime
|
||||||
|
logger.freemarker-runtime.level=
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------
|
||||||
|
# Custom Share module logging goes here...
|
||||||
|
#-----------------------------------------------------------------------
|
||||||
|
|
||||||
|
logger.example.name=${package}
|
||||||
|
logger.example.level=debug
|
@ -5,12 +5,12 @@ function discoverArtifactId {
|
|||||||
|
|
||||||
function rebuild {
|
function rebuild {
|
||||||
echo "Rebuilding project ..."
|
echo "Rebuilding project ..."
|
||||||
mvn process-classes
|
mvn process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_ {
|
function start_ {
|
||||||
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
mvn -Drad process-classes
|
mvn -Drad process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop_ {
|
function stop_ {
|
||||||
|
@ -6,12 +6,12 @@ discoverArtifactId() {
|
|||||||
|
|
||||||
rebuild() {
|
rebuild() {
|
||||||
echo "Rebuilding project ..."
|
echo "Rebuilding project ..."
|
||||||
mvn process-classes
|
mvn process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
mvn -Drad process-classes
|
mvn -Drad process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
|
@ -5,27 +5,27 @@ function discoverArtifactId {
|
|||||||
|
|
||||||
function rebuild {
|
function rebuild {
|
||||||
echo "Rebuilding project ..."
|
echo "Rebuilding project ..."
|
||||||
mvn process-classes
|
mvn process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_ {
|
function start_ {
|
||||||
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
mvn -Drad process-classes
|
mvn -Drad process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_log {
|
function start_log {
|
||||||
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
mvn -Drad "-Ddocker.showLogs" process-classes
|
mvn -Drad "-Ddocker.showLogs" process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop_ {
|
function stop_ {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
echo "Stopping Docker containers that supported rapid application development ..."
|
echo "Stopping Docker containers that supported rapid application development ..."
|
||||||
docker container ls --filter name=${ARTIFACT_ID}-*
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
echo "Stopping containers ..."
|
echo "Stopping containers ..."
|
||||||
docker container stop (docker container ls -q --filter name=${ARTIFACT_ID}-*)
|
docker container stop (docker container ls -q --filter name="^/${ARTIFACT_ID}")
|
||||||
echo "Removing containers ..."
|
echo "Removing containers ..."
|
||||||
docker container rm (docker container ls -aq --filter name=${ARTIFACT_ID}-*)
|
docker container rm (docker container ls -aq --filter name="^/${ARTIFACT_ID}")
|
||||||
}
|
}
|
||||||
|
|
||||||
function tail_logs {
|
function tail_logs {
|
||||||
@ -34,12 +34,12 @@ function tail_logs {
|
|||||||
)
|
)
|
||||||
|
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
docker container logs -f (docker container ls -q --filter name=${ARTIFACT_ID}-${container})
|
docker container logs -f (docker container ls -q --filter name="^/${ARTIFACT_ID}-${container}$")
|
||||||
}
|
}
|
||||||
|
|
||||||
function list {
|
function list {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
docker container ls --filter name=${ARTIFACT_ID}-*
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($args[0]) {
|
switch ($args[0]) {
|
||||||
|
@ -1,42 +1,42 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
discoverArtifactId() {
|
discoverArtifactId() {
|
||||||
ARTIFACT_ID=`mvn -q -Dexpression=project.artifactId -DforceStdout help:evaluate`
|
local ARTIFACT_ID=`mvn -q -Dexpression=project.artifactId -DforceStdout help:evaluate`
|
||||||
}
|
}
|
||||||
|
|
||||||
rebuild() {
|
rebuild() {
|
||||||
echo "Rebuilding project ..."
|
echo "Rebuilding project ..."
|
||||||
mvn process-classes
|
mvn process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
mvn -Drad process-classes
|
mvn -Drad process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
start_log() {
|
start_log() {
|
||||||
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
mvn -Drad -Ddocker.showLogs process-classes
|
mvn -Drad -Ddocker.showLogs process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
echo "Stopping Docker containers that supported rapid application development ..."
|
echo "Stopping Docker containers that supported rapid application development ..."
|
||||||
docker container ls --filter name=${ARTIFACT_ID}-*
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
echo "Stopping containers ..."
|
echo "Stopping containers ..."
|
||||||
docker container stop `docker container ls -q --filter name=${ARTIFACT_ID}-*`
|
docker container stop `docker container ls -q --filter name="^/${ARTIFACT_ID}"`
|
||||||
echo "Removing containers ..."
|
echo "Removing containers ..."
|
||||||
docker container rm `docker container ls -aq --filter name=${ARTIFACT_ID}-*`
|
docker container rm `docker container ls -aq --filter name="^/${ARTIFACT_ID}"`
|
||||||
}
|
}
|
||||||
|
|
||||||
tail_logs() {
|
tail_logs() {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
docker container logs -f `docker container ls -q --filter name=${ARTIFACT_ID}-$1`
|
docker container logs -f `docker container ls -q --filter name="^/${ARTIFACT_ID}-$1$"`
|
||||||
}
|
}
|
||||||
|
|
||||||
list() {
|
list() {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
docker container ls --filter name=${ARTIFACT_ID}-*
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
@ -20,27 +20,47 @@ import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransacti
|
|||||||
import org.alfresco.service.ServiceRegistry;
|
import org.alfresco.service.ServiceRegistry;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.DisposableBean;
|
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.ApplicationEvent;
|
||||||
|
import org.springframework.extensions.surf.util.AbstractLifecycleBean;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is an example of how you can use the Alfresco Java Public API on startup or shutdown.
|
* This class is an example of how you can use the Alfresco Java Public API on startup or shutdown.
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class ExampleBootstrap implements InitializingBean, DisposableBean {
|
public class ExampleBootstrap extends AbstractLifecycleBean {
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||||
|
|
||||||
// this is the Alfresco Public Java API entrypoint
|
// this is the Alfresco Public Java API entrypoint
|
||||||
@Autowired
|
@Autowired
|
||||||
protected ServiceRegistry serviceRegistry;
|
protected ServiceRegistry serviceRegistry;
|
||||||
|
|
||||||
@Override
|
@Value("${example.config.value:default}")
|
||||||
public void afterPropertiesSet() throws Exception {
|
private String configValue;
|
||||||
if (this.logger.isTraceEnabled())
|
|
||||||
this.logger.trace("onStartup()");
|
@Value("${example.config.value:#{null}}")
|
||||||
|
private String configValueWithNullDefault;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is called after Spring beans and configuration are injected, but
|
||||||
|
* before ACS services are ready. So don't call any ACS services, start an
|
||||||
|
* ACS transaction, or try to create an authentication context.
|
||||||
|
*/
|
||||||
|
@PostConstruct
|
||||||
|
private void init() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is called after @PostConstruct and all the ACS services are
|
||||||
|
* initialized and ready. You will have no authentication or transaction
|
||||||
|
* context.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void onBootstrap(ApplicationEvent event) {
|
||||||
|
this.logger.trace("onBootstrap()");
|
||||||
|
|
||||||
// provide some authority within the Alfresco context
|
// provide some authority within the Alfresco context
|
||||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
|
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
|
||||||
@ -57,11 +77,15 @@ public class ExampleBootstrap implements InitializingBean, DisposableBean {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public void destroy() throws Exception {
|
* This is called after @PostConstruct and all the ACS services are
|
||||||
if (this.logger.isTraceEnabled())
|
* initialized and ready. You will have no authentication or transaction
|
||||||
this.logger.trace("onShutdown()");
|
* context.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void onShutdown(ApplicationEvent event) {
|
||||||
|
this.logger.trace("onShutdown()");
|
||||||
|
|
||||||
// provide some authority within the Alfresco context
|
// provide some authority within the Alfresco context
|
||||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
|
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
|
||||||
|
@ -21,15 +21,15 @@ import org.alfresco.service.ServiceRegistry;
|
|||||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.extensions.surf.util.AbstractLifecycleBean;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is an example of how you can use the Alfresco Java Public API when Alfresco triggers an event.
|
* This class is an example of how you can use the Alfresco Java Public API when Alfresco triggers an event.
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class ExampleEventListener implements InitializingBean, OnCreateNodePolicy {
|
public class ExampleEventListener extends AbstractLifecycleBean implements OnCreateNodePolicy {
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||||
|
|
||||||
@ -37,24 +37,34 @@ public class ExampleEventListener implements InitializingBean, OnCreateNodePolic
|
|||||||
@Autowired
|
@Autowired
|
||||||
protected ServiceRegistry serviceRegistry;
|
protected ServiceRegistry serviceRegistry;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterPropertiesSet() throws Exception {
|
protected void onBootstrap(ApplicationEvent event) {
|
||||||
this.bind();
|
this.bind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This must be called after the `PolicyComponent` is initialized/ready.
|
||||||
|
* So you cannot call it from with `@PostConstruct` or using
|
||||||
|
* `InitializingBean`.
|
||||||
|
*/
|
||||||
public void bind() {
|
public void bind() {
|
||||||
if (this.logger.isTraceEnabled())
|
this.logger.trace("bind()");
|
||||||
this.logger.trace("bind()");
|
|
||||||
|
|
||||||
// example listener
|
// example listener
|
||||||
this.serviceRegistry.getPolicyComponent().bindClassBehaviour(OnCreateNodePolicy.QNAME, this,
|
this.serviceRegistry.getPolicyComponent().bindClassBehaviour(OnCreateNodePolicy.QNAME, this,
|
||||||
new JavaBehaviour(this, OnCreateNodePolicy.QNAME.getLocalName(), NotificationFrequency.TRANSACTION_COMMIT));
|
new JavaBehaviour(this, OnCreateNodePolicy.QNAME.getLocalName(), NotificationFrequency.TRANSACTION_COMMIT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This will execute with the same authentication and transaction context
|
||||||
|
* as was used to create the node, unless the binding is
|
||||||
|
* `TRANSACTION_COMMIT`. Then it will only have the same transaction
|
||||||
|
* context and the authentication context used when starting the
|
||||||
|
* transaction.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onCreateNode(ChildAssociationRef childAssocRef) {
|
public void onCreateNode(ChildAssociationRef childAssocRef) {
|
||||||
if (this.logger.isTraceEnabled())
|
this.logger.trace("onCreateNode('" + childAssocRef.getChildRef() + "')");
|
||||||
this.logger.trace("onCreateNode('" + childAssocRef.getChildRef() + "')");
|
|
||||||
|
|
||||||
// TODO do some work
|
// TODO do some work
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,11 @@ public class ExampleGetWebScript extends AbstractWebScript {
|
|||||||
@Autowired
|
@Autowired
|
||||||
protected ServiceRegistry serviceRegistry;
|
protected ServiceRegistry serviceRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This will have the authentication context of the authenticated user
|
||||||
|
* calling the REST endpoint. The transaction context is defined in the
|
||||||
|
* web script descriptor.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException {
|
public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException {
|
||||||
if (this.logger.isTraceEnabled())
|
if (this.logger.isTraceEnabled())
|
||||||
|
@ -32,11 +32,17 @@ public class ExampleJavaScriptRootObject extends BaseProcessorExtension {
|
|||||||
@Autowired
|
@Autowired
|
||||||
protected ServiceRegistry serviceRegistry;
|
protected ServiceRegistry serviceRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An example method that called from within a JavaScript within the ACS
|
||||||
|
* application: `example.getMessage("example.property")`. All simple
|
||||||
|
* parameter and return types are generally supported.
|
||||||
|
*
|
||||||
|
* The `example` root name comes from the `module-context.xml` file.
|
||||||
|
*/
|
||||||
public String getMessage(String messageKey) {
|
public String getMessage(String messageKey) {
|
||||||
if (this.logger.isTraceEnabled())
|
if (this.logger.isTraceEnabled())
|
||||||
this.logger.trace("getMessage('" + messageKey + "')");
|
this.logger.trace("getMessage('" + messageKey + "')");
|
||||||
|
|
||||||
// just and example method, called in JS with: example.getMessage("example.property");
|
|
||||||
return this.serviceRegistry.getDictionaryService().getMessage(messageKey);
|
return this.serviceRegistry.getDictionaryService().getMessage(messageKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
<!-- Documentation: https://docs.alfresco.com/content-services/6.2/develop/reference/web-scripts-ref -->
|
<!-- Documentation: https://docs.alfresco.com/content-services/6.2/develop/reference/web-scripts-ref -->
|
||||||
<webscript>
|
<webscript xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:noNamespaceSchemaLocation="https://bitbucket.org/!api/2.0/snippets/inteligr8/AzMgbp/HEAD/files/snippet.txt">
|
||||||
<shortname>Example Webscript</shortname>
|
<shortname>Example Webscript</shortname>
|
||||||
<description>Example Java-backed webscript description</description>
|
<description>Example Java-backed webscript description</description>
|
||||||
<url>/exampleJava?paramName={paramValue}</url>
|
|
||||||
<authentication>user</authentication>
|
|
||||||
<format default="json"></format>
|
|
||||||
<family>${shortname}</family>
|
<family>${shortname}</family>
|
||||||
|
<url>/exampleJava?paramName={paramValue}</url>
|
||||||
|
<format default="json"></format>
|
||||||
|
<authentication>user</authentication>
|
||||||
</webscript>
|
</webscript>
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
<!-- Documentation: https://docs.alfresco.com/content-services/6.2/develop/reference/web-scripts-ref -->
|
<!-- Documentation: https://docs.alfresco.com/content-services/6.2/develop/reference/web-scripts-ref -->
|
||||||
<webscript>
|
<webscript xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:noNamespaceSchemaLocation="https://bitbucket.org/!api/2.0/snippets/inteligr8/AzMgbp/HEAD/files/snippet.txt">
|
||||||
<shortname>Example Webscript</shortname>
|
<shortname>Example Webscript</shortname>
|
||||||
<description>Example JS-backed webscript description</description>
|
<description>Example JS-backed webscript description</description>
|
||||||
<url>/exampleJs?paramName={paramValue}</url>
|
|
||||||
<authentication>guest</authentication>
|
|
||||||
<format default="json"></format>
|
|
||||||
<family>${shortname}</family>
|
<family>${shortname}</family>
|
||||||
|
<url>/exampleJs?paramName={paramValue}</url>
|
||||||
|
<format default="json"></format>
|
||||||
|
<authentication>guest</authentication>
|
||||||
</webscript>
|
</webscript>
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
logger.example.name=${package}
|
||||||
|
logger.example.level=info
|
@ -0,0 +1,8 @@
|
|||||||
|
# Module debugging
|
||||||
|
logger.example.level=trace
|
||||||
|
|
||||||
|
# WebScript debugging
|
||||||
|
logger.springframework-extensions-webscripts-ScriptLogger.level=debug
|
||||||
|
|
||||||
|
# non-WebScript JavaScript execution debugging
|
||||||
|
logger.alfresco-repo-jscript-ScriptLogger.level=debug
|
@ -5,27 +5,27 @@ function discoverArtifactId {
|
|||||||
|
|
||||||
function rebuild {
|
function rebuild {
|
||||||
echo "Rebuilding project ..."
|
echo "Rebuilding project ..."
|
||||||
mvn process-classes
|
mvn process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_ {
|
function start_ {
|
||||||
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
mvn -Drad process-classes
|
mvn -Drad process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_log {
|
function start_log {
|
||||||
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
mvn -Drad "-Ddocker.showLogs" process-classes
|
mvn -Drad "-Ddocker.showLogs" process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop_ {
|
function stop_ {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
echo "Stopping Docker containers that supported rapid application development ..."
|
echo "Stopping Docker containers that supported rapid application development ..."
|
||||||
docker container ls --filter name=${ARTIFACT_ID}-*
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
echo "Stopping containers ..."
|
echo "Stopping containers ..."
|
||||||
docker container stop (docker container ls -q --filter name=${ARTIFACT_ID}-*)
|
docker container stop (docker container ls -q --filter name="^/${ARTIFACT_ID}")
|
||||||
echo "Removing containers ..."
|
echo "Removing containers ..."
|
||||||
docker container rm (docker container ls -aq --filter name=${ARTIFACT_ID}-*)
|
docker container rm (docker container ls -aq --filter name="^/${ARTIFACT_ID}")
|
||||||
}
|
}
|
||||||
|
|
||||||
function tail_logs {
|
function tail_logs {
|
||||||
@ -34,12 +34,12 @@ function tail_logs {
|
|||||||
)
|
)
|
||||||
|
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
docker container logs -f (docker container ls -q --filter name=${ARTIFACT_ID}-${container})
|
docker container logs -f (docker container ls -q --filter name="^/${ARTIFACT_ID}-${container}$")
|
||||||
}
|
}
|
||||||
|
|
||||||
function list {
|
function list {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
docker container ls --filter name=${ARTIFACT_ID}-*
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($args[0]) {
|
switch ($args[0]) {
|
||||||
|
@ -1,42 +1,42 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
discoverArtifactId() {
|
discoverArtifactId() {
|
||||||
ARTIFACT_ID=`mvn -q -Dexpression=project.artifactId -DforceStdout help:evaluate`
|
local ARTIFACT_ID=`mvn -q -Dexpression=project.artifactId -DforceStdout help:evaluate`
|
||||||
}
|
}
|
||||||
|
|
||||||
rebuild() {
|
rebuild() {
|
||||||
echo "Rebuilding project ..."
|
echo "Rebuilding project ..."
|
||||||
mvn process-classes
|
mvn process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
mvn -Drad process-classes
|
mvn -Drad process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
start_log() {
|
start_log() {
|
||||||
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
mvn -Drad -Ddocker.showLogs process-classes
|
mvn -Drad -Ddocker.showLogs process-test-classes
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
echo "Stopping Docker containers that supported rapid application development ..."
|
echo "Stopping Docker containers that supported rapid application development ..."
|
||||||
docker container ls --filter name=${ARTIFACT_ID}-*
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
echo "Stopping containers ..."
|
echo "Stopping containers ..."
|
||||||
docker container stop `docker container ls -q --filter name=${ARTIFACT_ID}-*`
|
docker container stop `docker container ls -q --filter name="^/${ARTIFACT_ID}"`
|
||||||
echo "Removing containers ..."
|
echo "Removing containers ..."
|
||||||
docker container rm `docker container ls -aq --filter name=${ARTIFACT_ID}-*`
|
docker container rm `docker container ls -aq --filter name="^/${ARTIFACT_ID}"`
|
||||||
}
|
}
|
||||||
|
|
||||||
tail_logs() {
|
tail_logs() {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
docker container logs -f `docker container ls -q --filter name=${ARTIFACT_ID}-$1`
|
docker container logs -f `docker container ls -q --filter name="^/${ARTIFACT_ID}-$1$"`
|
||||||
}
|
}
|
||||||
|
|
||||||
list() {
|
list() {
|
||||||
discoverArtifactId
|
discoverArtifactId
|
||||||
docker container ls --filter name=${ARTIFACT_ID}-*
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
logger.example.name=${package}
|
||||||
|
logger.example.level=info
|
@ -0,0 +1,74 @@
|
|||||||
|
#set( $symbol_pound = '#' )
|
||||||
|
#set( $symbol_dollar = '$' )
|
||||||
|
#set( $symbol_escape = '\' )
|
||||||
|
# Set root logger level to error
|
||||||
|
rootLogger.level=error
|
||||||
|
rootLogger.appenderRef.stdout.ref=ConsoleAppender
|
||||||
|
rootLogger.appenderRef.rolling.ref=RollingAppender
|
||||||
|
|
||||||
|
# All outputs currently set to be a ConsoleAppender.
|
||||||
|
appender.console.type=Console
|
||||||
|
appender.console.name=ConsoleAppender
|
||||||
|
appender.console.layout.type=PatternLayout
|
||||||
|
appender.console.layout.pattern=%d{ISO8601} %x %-5p [%c{3}] [%t] %replace{%m}{[\r\n]+}{}%n
|
||||||
|
|
||||||
|
###### File appender definition #######
|
||||||
|
appender.rolling.type=RollingFile
|
||||||
|
appender.rolling.name=RollingAppender
|
||||||
|
appender.rolling.fileName=share.log
|
||||||
|
appender.rolling.filePattern=share.log.%d{yyyy-MM-dd}
|
||||||
|
appender.rolling.layout.type=PatternLayout
|
||||||
|
appender.rolling.layout.pattern=%d{yyyy-MM-dd} %d{ABSOLUTE} %-5p [%c] [%t] %replace{%m}{[\r\n]+}{}%n
|
||||||
|
appender.rolling.policies.type = Policies
|
||||||
|
appender.rolling.policies.time.type=TimeBasedTriggeringPolicy
|
||||||
|
appender.rolling.policies.time.interval=1
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
logger.springframework.name=org.springframework
|
||||||
|
logger.springframework.level=warn
|
||||||
|
|
||||||
|
# Turn off Spring remoting warnings that should really be info or debug.
|
||||||
|
logger.springframework-remoting-support.name=org.springframework.remoting.support
|
||||||
|
logger.springframework-remoting-support.level=error
|
||||||
|
logger.springframework-util.name=org.springframework.util
|
||||||
|
logger.springframework-util.level=error
|
||||||
|
|
||||||
|
# MyFaces
|
||||||
|
logger.apache-myfaces-util-DebugUtils.name=org.apache.myfaces.util.DebugUtils
|
||||||
|
logger.apache-myfaces-util-DebugUtils.level=info
|
||||||
|
logger.apache-myfaces-el-VariableResolverImpl.name=org.apache.myfaces.el.VariableResolverImpl
|
||||||
|
logger.apache-myfaces-el-VariableResolverImpl.level=error
|
||||||
|
logger.apache-myfaces-application-jsp-JspViewHandlerImpl.name=org.apache.myfaces.application.jsp.JspViewHandlerImpl
|
||||||
|
logger.apache-myfaces-application-jsp-JspViewHandlerImpl.level=error
|
||||||
|
logger.apache-myfaces-taglib.name=org.apache.myfaces.taglib
|
||||||
|
logger.apache-myfaces-taglib.level=error
|
||||||
|
|
||||||
|
# Alfresco
|
||||||
|
logger.alfresco.name=org.alfresco
|
||||||
|
logger.alfresco.level=error
|
||||||
|
logger.alfresco-config.name=org.alfresco.config
|
||||||
|
logger.alfresco-config.level=warn
|
||||||
|
logger.alfresco-config-JndiObjectFactoryBean.name=org.alfresco.config.JndiObjectFactoryBean
|
||||||
|
logger.alfresco-config-JndiObjectFactoryBean.level=warn
|
||||||
|
logger.alfresco-web.name=org.alfresco.web
|
||||||
|
logger.alfresco-web.level=info
|
||||||
|
|
||||||
|
# Web Framework
|
||||||
|
logger.springframework-extensions-webscripts.name=org.springframework.extensions.webscripts
|
||||||
|
logger.springframework-extensions-webscripts.level=info
|
||||||
|
logger.springframework-extensions-webscripts-ScriptLogger.name=org.springframework.extensions.webscripts.ScriptLogger
|
||||||
|
logger.springframework-extensions-webscripts-ScriptLogger.level=warn
|
||||||
|
logger.springframework-extensions-webscripts-ScriptDebugger.name=org.springframework.extensions.webscripts.ScriptDebugger
|
||||||
|
logger.springframework-extensions-webscripts-ScriptDebugger.level=off
|
||||||
|
|
||||||
|
# Freemarker
|
||||||
|
# Note the freemarker.runtime logger is used to log non-fatal errors that are handled by Alfresco's retrying transaction handler
|
||||||
|
logger.freemarker-runtime.name=freemarker.runtime
|
||||||
|
logger.freemarker-runtime.level=
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------
|
||||||
|
# Custom Share module logging goes here...
|
||||||
|
#-----------------------------------------------------------------------
|
||||||
|
|
||||||
|
logger.example.name=${package}
|
||||||
|
logger.example.level=debug
|
@ -15,8 +15,8 @@
|
|||||||
<maven.compiler.source>8</maven.compiler.source>
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
<maven.compiler.target>8</maven.compiler.target>
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
|
|
||||||
<activiti.version>5.23.0</activiti.version>
|
<activiti.version>7.11.0</activiti.version>
|
||||||
<spring.version>4.3.20.RELEASE</spring.version>
|
<spring.version>5.3.29</spring.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@ -33,6 +33,39 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>io.repaint.maven</groupId>
|
||||||
|
<artifactId>tiles-maven-plugin</artifactId>
|
||||||
|
<version>2.40</version>
|
||||||
|
<extensions>true</extensions>
|
||||||
|
<configuration>
|
||||||
|
<tiles>
|
||||||
|
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-aps-ext-rad-tile -->
|
||||||
|
<tile>com.inteligr8.ootbee:beedk-aps-ext-rad-tile:1.1-SNAPSHOT</tile>
|
||||||
|
</tiles>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>rad</id>
|
||||||
|
<activation>
|
||||||
|
<property>
|
||||||
|
<name>rad</name>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<properties>
|
||||||
|
<aps.version>2.4.1</aps.version>
|
||||||
|
<!-- add properties here -->
|
||||||
|
<aps.tomcat.opts>-Dproperty-to-set=value</aps.tomcat.opts>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
|
@ -0,0 +1,74 @@
|
|||||||
|
|
||||||
|
function discoverArtifactId {
|
||||||
|
$script:ARTIFACT_ID=(mvn -q -Dexpression=project"."artifactId -DforceStdout help:evaluate)
|
||||||
|
}
|
||||||
|
|
||||||
|
function rebuild {
|
||||||
|
echo "Rebuilding project ..."
|
||||||
|
mvn process-test-classes
|
||||||
|
}
|
||||||
|
|
||||||
|
function start_ {
|
||||||
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
|
mvn -Drad process-test-classes
|
||||||
|
}
|
||||||
|
|
||||||
|
function start_log {
|
||||||
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
|
mvn -Drad "-Ddocker.showLogs" process-test-classes
|
||||||
|
}
|
||||||
|
|
||||||
|
function stop_ {
|
||||||
|
discoverArtifactId
|
||||||
|
echo "Stopping Docker containers that supported rapid application development ..."
|
||||||
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
|
echo "Stopping containers ..."
|
||||||
|
docker container stop (docker container ls -q --filter name="^/${ARTIFACT_ID}")
|
||||||
|
echo "Removing containers ..."
|
||||||
|
docker container rm (docker container ls -aq --filter name="^/${ARTIFACT_ID}")
|
||||||
|
}
|
||||||
|
|
||||||
|
function tail_logs {
|
||||||
|
param (
|
||||||
|
$container
|
||||||
|
)
|
||||||
|
|
||||||
|
discoverArtifactId
|
||||||
|
docker container logs -f (docker container ls -q --filter name="^/${ARTIFACT_ID}-${container}$")
|
||||||
|
}
|
||||||
|
|
||||||
|
function list {
|
||||||
|
discoverArtifactId
|
||||||
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($args[0]) {
|
||||||
|
"start" {
|
||||||
|
start_
|
||||||
|
}
|
||||||
|
"start_log" {
|
||||||
|
start_log
|
||||||
|
}
|
||||||
|
"stop" {
|
||||||
|
stop_
|
||||||
|
}
|
||||||
|
"restart" {
|
||||||
|
stop_
|
||||||
|
start_
|
||||||
|
}
|
||||||
|
"rebuild" {
|
||||||
|
rebuild
|
||||||
|
}
|
||||||
|
"tail" {
|
||||||
|
tail_logs $args[1]
|
||||||
|
}
|
||||||
|
"containers" {
|
||||||
|
list
|
||||||
|
}
|
||||||
|
default {
|
||||||
|
echo "Usage: .\rad.ps1 [ start | start_log | stop | restart | rebuild | tail {container} | containers ]"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Completed!"
|
||||||
|
|
@ -0,0 +1,71 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
discoverArtifactId() {
|
||||||
|
local ARTIFACT_ID=`mvn -q -Dexpression=project.artifactId -DforceStdout help:evaluate`
|
||||||
|
}
|
||||||
|
|
||||||
|
rebuild() {
|
||||||
|
echo "Rebuilding project ..."
|
||||||
|
mvn process-test-classes
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
|
mvn -Drad process-test-classes
|
||||||
|
}
|
||||||
|
|
||||||
|
start_log() {
|
||||||
|
echo "Rebuilding project and starting Docker containers to support rapid application development ..."
|
||||||
|
mvn -Drad -Ddocker.showLogs process-test-classes
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
discoverArtifactId
|
||||||
|
echo "Stopping Docker containers that supported rapid application development ..."
|
||||||
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
|
echo "Stopping containers ..."
|
||||||
|
docker container stop `docker container ls -q --filter name="^/${ARTIFACT_ID}"`
|
||||||
|
echo "Removing containers ..."
|
||||||
|
docker container rm `docker container ls -aq --filter name="^/${ARTIFACT_ID}"`
|
||||||
|
}
|
||||||
|
|
||||||
|
tail_logs() {
|
||||||
|
discoverArtifactId
|
||||||
|
docker container logs -f `docker container ls -q --filter name="^/${ARTIFACT_ID}-$1$"`
|
||||||
|
}
|
||||||
|
|
||||||
|
list() {
|
||||||
|
discoverArtifactId
|
||||||
|
docker container ls --filter name="^/${ARTIFACT_ID}"
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
start
|
||||||
|
;;
|
||||||
|
start_log)
|
||||||
|
start_log
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
stop
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
stop
|
||||||
|
start
|
||||||
|
;;
|
||||||
|
rebuild)
|
||||||
|
rebuild
|
||||||
|
;;
|
||||||
|
tail)
|
||||||
|
tail_logs $2
|
||||||
|
;;
|
||||||
|
containers)
|
||||||
|
list
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: ./rad.sh [ start | start_log | stop | restart | rebuild | tail {container} | containers ]"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "Completed!"
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user