From f3df237cf0789b22cface1ad8ac45e2ac195cc61 Mon Sep 17 00:00:00 2001 From: Michael Suzuki Date: Fri, 5 Sep 2014 17:15:58 +0100 Subject: [PATCH] fix demo to work --- .../java/org/alfresco/demoamp/Demo.java | 2 +- .../__artifactId__/context/service-context.xml | 9 ++------- .../org/alfresco/demoamp/DemoComponent.java | 17 ++--------------- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/integration/java/org/alfresco/demoamp/Demo.java b/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/integration/java/org/alfresco/demoamp/Demo.java index a7bb9419..44d904dd 100644 --- a/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/integration/java/org/alfresco/demoamp/Demo.java +++ b/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/integration/java/org/alfresco/demoamp/Demo.java @@ -38,7 +38,7 @@ public class Demo WebElement ticket = driver.findElement(By.tagName("ticket")); String token =String.format("?alf_ticket=%s",ticket.getText()); //Navigate to sample page with token - driver.get("http://localhost:8080/alfresco/service/summit/hello" + token); + driver.get("http://localhost:8080/alfresco/service/sample/helloworld" + token); } @AfterClass diff --git a/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/config/alfresco/module/__artifactId__/context/service-context.xml b/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/config/alfresco/module/__artifactId__/context/service-context.xml index 10441e94..a51a1014 100644 --- a/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/config/alfresco/module/__artifactId__/context/service-context.xml +++ b/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/amp/config/alfresco/module/__artifactId__/context/service-context.xml @@ -22,13 +22,8 @@ - - - - - - - + + diff --git a/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/java/org/alfresco/demoamp/DemoComponent.java b/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/java/org/alfresco/demoamp/DemoComponent.java index f418e8df..a779454b 100644 --- a/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/java/org/alfresco/demoamp/DemoComponent.java +++ b/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/main/java/org/alfresco/demoamp/DemoComponent.java @@ -19,12 +19,12 @@ import java.util.HashMap; import java.util.Map; import org.alfresco.model.ContentModel; -import org.alfresco.repo.module.AbstractModuleComponent; import org.alfresco.repo.nodelocator.NodeLocatorService; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.springframework.extensions.webscripts.DeclarativeWebScript; import org.springframework.extensions.webscripts.Status; import org.springframework.extensions.webscripts.WebScriptRequest; @@ -38,12 +38,10 @@ import org.springframework.extensions.webscripts.WebScriptRequest; * @author Maurizio Pillitu * @author Michael Suzuki */ -public class DemoComponent extends AbstractModuleComponent +public class DemoComponent extends DeclarativeWebScript { Log log = LogFactory.getLog(DemoComponent.class); - private NodeService nodeService; - private NodeLocatorService nodeLocatorService; public void setNodeService(NodeService nodeService) @@ -55,17 +53,6 @@ public class DemoComponent extends AbstractModuleComponent { this.nodeLocatorService = nodeLocatorService; } - - /** - * Bogus component execution - */ - @Override - protected void executeInternal() throws Throwable - { - System.out.println("DemoComponent has been executed"); - log.debug("Test debug logging. Congratulation your AMP is working"); - log.info("This is only for information purposed. Better remove me from the log in Production"); - } /** * This is a demo service interaction with Alfresco Foundation API.