You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2013/11/22 12:41:33 UTC
svn commit: r1544498 [1/2] - in /syncope/trunk: ./
archetype/src/main/resources/archetype-resources/console/
archetype/src/main/resources/archetype-resources/core/
client/src/main/java/org/apache/syncope/client/
common/src/main/java/org/apache/syncope/...
Author: ilgrosso
Date: Fri Nov 22 11:41:32 2013
New Revision: 1544498
URL: http://svn.apache.org/r1544498
Log:
[SYNCOPE-439] Activiti Modeler now available from admin console
Added:
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ActivitiModelerPopupPage.java (with props)
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/BasePopupPage.java (with props)
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/XMLEditorPopupPage.java (with props)
syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/
syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/FilesystemResource.java (with props)
syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/WorkflowDefGETResource.java (with props)
syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/WorkflowDefPUTResource.java (with props)
syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/link/
syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/link/VeilPopupSettings.java (with props)
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ActivitiModelerPopupPage.html (with props)
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePopupPage.html (with props)
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/XMLEditorPopupPage.html (with props)
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/XMLEditorPopupPage.properties (with props)
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/XMLEditorPopupPage_it.properties (with props)
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/XMLEditorPopupPage_pt_BR.properties (with props)
syncope/trunk/console/src/main/resources/oryx.debug.js.patch
syncope/trunk/console/src/main/webapp/img/modeler.png (with props)
syncope/trunk/console/src/main/webapp/img/xml.png (with props)
Modified:
syncope/trunk/archetype/src/main/resources/archetype-resources/console/pom.xml
syncope/trunk/archetype/src/main/resources/archetype-resources/core/pom.xml
syncope/trunk/client/src/main/java/org/apache/syncope/client/SyncopeClient.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/types/RESTHeaders.java
syncope/trunk/console/pom.xml
syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeApplication.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeSession.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/HttpResourceStream.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Configuration.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/StatusModalPage.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/WorkflowRestClient.java
syncope/trunk/console/src/main/resources/applicationContext.xml
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BaseModalPage.html
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePage.html
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration.html
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration.properties
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration_it.properties
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration_pt_BR.properties
syncope/trunk/core/pom.xml
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserSelfServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/WorkflowServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/util/MappingUtil.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/WorkflowAdapter.java
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/WorkflowTestITCase.java
syncope/trunk/core/src/test/resources/noopworkflow/stripActivitiFromContent.xsl
syncope/trunk/pom.xml
Modified: syncope/trunk/archetype/src/main/resources/archetype-resources/console/pom.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/archetype/src/main/resources/archetype-resources/console/pom.xml?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/archetype/src/main/resources/archetype-resources/console/pom.xml (original)
+++ syncope/trunk/archetype/src/main/resources/archetype-resources/console/pom.xml Fri Nov 22 11:41:32 2013
@@ -52,6 +52,12 @@ under the License.
<!-- TEST -->
<dependency>
+ <groupId>org.activiti</groupId>
+ <artifactId>activiti-webapp-explorer2</artifactId>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.syncope</groupId>
<artifactId>syncope-build-tools</artifactId>
<type>war</type>
@@ -112,6 +118,51 @@ under the License.
<inherited>true</inherited>
<executions>
<execution>
+ <id>setupActivitiModeler</id>
+ <phase>process-test-resources</phase>
+ <configuration>
+ <target>
+ <unzip src="${settings.localRepository}/org/activiti/activiti-webapp-explorer2/${activiti.version}/activiti-webapp-explorer2-${activiti.version}.war"
+ dest="${project.build.directory}/activiti-webapp-explorer2"/>
+
+ <mkdir dir="${activiti-modeler.directory}"/>
+
+ <mkdir dir="${activiti-modeler.directory}/editor"/>
+ <copy todir="${activiti-modeler.directory}/editor">
+ <fileset dir="${project.build.directory}/activiti-webapp-explorer2/editor">
+ <exclude name="oryx.js"/>
+ </fileset>
+ </copy>
+ <copy file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/plugins.xml"
+ todir="${activiti-modeler.directory}/editor"/>
+ <copy file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/stencilset.json"
+ todir="${activiti-modeler.directory}/editor"/>
+
+ <mkdir dir="${activiti-modeler.directory}/explorer"/>
+ <copy todir="${activiti-modeler.directory}/explorer">
+ <fileset dir="${project.build.directory}/activiti-webapp-explorer2/explorer"/>
+ </copy>
+
+ <mkdir dir="${activiti-modeler.directory}/libs"/>
+ <copy todir="${activiti-modeler.directory}/libs">
+ <fileset dir="${project.build.directory}/activiti-webapp-explorer2/libs"/>
+ </copy>
+
+ <fixcrlf srcdir="${project.build.directory}/activiti-webapp-explorer2/editor/"
+ includes="oryx.debug.js"
+ eol="unix"/>
+ <patch patchfile="${basedir}/src/main/resources/oryx.debug.js.patch"
+ originalfile="${project.build.directory}/activiti-webapp-explorer2/editor/oryx.debug.js"
+ destfile="${activiti-modeler.directory}/editor/oryx.debug.js"/>
+
+ <delete dir="${project.build.directory}/activiti-webapp-explorer2"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
<id>explodeSyncopeWAR</id>
<phase>pre-integration-test</phase>
<configuration>
Modified: syncope/trunk/archetype/src/main/resources/archetype-resources/core/pom.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/archetype/src/main/resources/archetype-resources/core/pom.xml?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/archetype/src/main/resources/archetype-resources/core/pom.xml (original)
+++ syncope/trunk/archetype/src/main/resources/archetype-resources/core/pom.xml Fri Nov 22 11:41:32 2013
@@ -111,8 +111,9 @@ under the License.
<artifactId>maven-failsafe-plugin</artifactId>
<inherited>true</inherited>
<configuration>
- <redirectTestOutputToFile>true</redirectTestOutputToFile>
- <encoding>utf-8</encoding>
+ <systemPropertyVariables>
+ <jaxrsContentType>${jaxrs.content.type}</jaxrsContentType>
+ </systemPropertyVariables>
</configuration>
<executions>
<execution>
@@ -136,8 +137,10 @@ under the License.
<target>
<unzip src="${project.build.directory}/${project.build.finalName}.war" dest="${cargo.run.dir}"/>
<copy file="${project.build.directory}/test-classes/db.jsp" todir="${cargo.run.dir}"/>
- <copy todir="${cargo.run.dir}/WEB-INF/classes" includeEmptyDirs="false">
- <fileset dir="${project.build.directory}/test-classes"/>
+ <copy todir="${cargo.run.dir}/WEB-INF/classes" includeEmptyDirs="false" overwrite="true">
+ <fileset dir="${project.build.directory}/test-classes">
+ <exclude name="**/*.class" />
+ </fileset>
</copy>
</target>
</configuration>
@@ -177,7 +180,7 @@ under the License.
<type>standalone</type>
<properties>
<cargo.servlet.port>${cargo.servlet.port}</cargo.servlet.port>
- <!--<cargo.jvmargs>-Xdebug -Xrunjdwp:transport=dt_socket,address=9009,server=y,suspend=n</cargo.jvmargs>-->
+ <cargo.jvmargs>-noverify -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=256m</cargo.jvmargs>
</properties>
</configuration>
<deployables>
@@ -275,4 +278,44 @@ under the License.
</testResource>
</testResources>
</build>
+
+ <profiles>
+ <profile>
+ <id>debug</id>
+
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
+
+ <build>
+ <defaultGoal>clean verify cargo:run</defaultGoal>
+
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <configuration>
+ <properties>
+ <cargo.jvmargs>-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
+ -noverify -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=256m</cargo.jvmargs>
+ </properties>
+ </configuration>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>none</phase>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/SyncopeClient.java
URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/SyncopeClient.java?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/client/src/main/java/org/apache/syncope/client/SyncopeClient.java (original)
+++ syncope/trunk/client/src/main/java/org/apache/syncope/client/SyncopeClient.java Fri Nov 22 11:41:32 2013
@@ -22,9 +22,12 @@ import java.net.URI;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
import org.apache.cxf.jaxrs.client.WebClient;
import org.apache.syncope.client.rest.RestClientFactoryBean;
import org.apache.syncope.common.services.UserSelfService;
+import org.apache.syncope.common.services.WorkflowService;
+import org.apache.syncope.common.types.AttributableType;
import org.apache.syncope.common.types.RESTHeaders;
/**
@@ -72,6 +75,27 @@ public class SyncopeClient {
public boolean isSelfRegistrationAllowed() {
return Boolean.valueOf(restClientFactory.createServiceInstance(UserSelfService.class, mediaType, null, null).
- getOptions().getHeaderString(RESTHeaders.SELFREGISTRATION_ALLOWED.toString()));
+ getOptions().getHeaderString(RESTHeaders.SELFREGISTRATION_ALLOWED));
+ }
+
+ public boolean isActivitiEnabledFor(final AttributableType attributableType) {
+ Response options = getService(WorkflowService.class).getOptions(attributableType);
+
+ boolean result;
+ switch (attributableType) {
+ case USER:
+ result = Boolean.valueOf(options.getHeaderString(RESTHeaders.ACTIVITI_USER_ENABLED));
+ break;
+
+ case ROLE:
+ result = Boolean.valueOf(options.getHeaderString(RESTHeaders.ACTIVITI_ROLE_ENABLED));
+ break;
+
+ case MEMBERSHIP:
+ default:
+ result = false;
+ }
+
+ return result;
}
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java Fri Nov 22 11:41:32 2013
@@ -20,6 +20,7 @@ package org.apache.syncope.common.servic
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
+import javax.ws.rs.OPTIONS;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
@@ -34,6 +35,14 @@ import org.apache.syncope.common.types.R
public interface WorkflowService {
/**
+ * @return Response contains special syncope HTTP header indicating if Activiti is enabled for users / roles
+ * @see org.apache.syncope.common.types.RESTHeaders#ACTIVITI_USER_ENABLED
+ * @see org.apache.syncope.common.types.RESTHeaders#ACTIVITI_ROLE_ENABLED
+ */
+ @OPTIONS
+ Response getOptions(@PathParam("kind") AttributableType kind);
+
+ /**
* @param kind Kind can be USER or ROLE only!
* @return Returns workflow definition for matching kind.
*/
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/RESTHeaders.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/RESTHeaders.java?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/RESTHeaders.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/RESTHeaders.java Fri Nov 22 11:41:32 2013
@@ -39,6 +39,16 @@ public final class RESTHeaders {
public static final String SELFREGISTRATION_ALLOWED = "Syncope.SelfRegistration.Allowed";
/**
+ * Option key stating if Activiti workflow adapter is in use for users.
+ */
+ public static final String ACTIVITI_USER_ENABLED = "Syncope.Activiti.User.Enabled";
+
+ /**
+ * Option key stating if Activiti workflow adapter is in use for roles.
+ */
+ public static final String ACTIVITI_ROLE_ENABLED = "Syncope.Activiti.Role.Enabled";
+
+ /**
* HTTP header key for object ID assigned to an object after its creation.
*/
public static final String RESOURCE_ID = "Syncope.Id";
Modified: syncope/trunk/console/pom.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/console/pom.xml?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/console/pom.xml (original)
+++ syncope/trunk/console/pom.xml Fri Nov 22 11:41:32 2013
@@ -126,6 +126,12 @@ under the License.
<!-- TEST -->
<dependency>
+ <groupId>org.activiti</groupId>
+ <artifactId>activiti-webapp-explorer2</artifactId>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.syncope</groupId>
<artifactId>syncope-build-tools</artifactId>
<version>${project.version}</version>
@@ -187,6 +193,51 @@ under the License.
<inherited>true</inherited>
<executions>
<execution>
+ <id>setupActivitiModeler</id>
+ <phase>process-test-resources</phase>
+ <configuration>
+ <target>
+ <unzip src="${settings.localRepository}/org/activiti/activiti-webapp-explorer2/${activiti.version}/activiti-webapp-explorer2-${activiti.version}.war"
+ dest="${project.build.directory}/activiti-webapp-explorer2"/>
+
+ <mkdir dir="${activiti-modeler.directory}"/>
+
+ <mkdir dir="${activiti-modeler.directory}/editor"/>
+ <copy todir="${activiti-modeler.directory}/editor">
+ <fileset dir="${project.build.directory}/activiti-webapp-explorer2/editor">
+ <exclude name="oryx.js"/>
+ </fileset>
+ </copy>
+ <copy file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/plugins.xml"
+ todir="${activiti-modeler.directory}/editor"/>
+ <copy file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/stencilset.json"
+ todir="${activiti-modeler.directory}/editor"/>
+
+ <mkdir dir="${activiti-modeler.directory}/explorer"/>
+ <copy todir="${activiti-modeler.directory}/explorer">
+ <fileset dir="${project.build.directory}/activiti-webapp-explorer2/explorer"/>
+ </copy>
+
+ <mkdir dir="${activiti-modeler.directory}/libs"/>
+ <copy todir="${activiti-modeler.directory}/libs">
+ <fileset dir="${project.build.directory}/activiti-webapp-explorer2/libs"/>
+ </copy>
+
+ <fixcrlf srcdir="${project.build.directory}/activiti-webapp-explorer2/editor/"
+ includes="oryx.debug.js"
+ eol="unix"/>
+ <patch patchfile="${basedir}/src/main/resources/oryx.debug.js.patch"
+ originalfile="${project.build.directory}/activiti-webapp-explorer2/editor/oryx.debug.js"
+ destfile="${activiti-modeler.directory}/editor/oryx.debug.js"/>
+
+ <delete dir="${project.build.directory}/activiti-webapp-explorer2"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
<id>explodeSyncopeWAR</id>
<phase>pre-integration-test</phase>
<configuration>
@@ -320,7 +371,6 @@ under the License.
javax.xml*,
org.w3c.dom,
org.apache.commons.lang3;version="[3,4)",
- org.apache.http*;version="[4,5)",
org.apache.syncope.client*;version=${project.version},
org.apache.syncope.common*;version=${project.version},
org.apache.wicket*;version="[6,7)",
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeApplication.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeApplication.java?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeApplication.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeApplication.java Fri Nov 22 11:41:32 2013
@@ -35,6 +35,9 @@ import org.apache.syncope.console.pages.
import org.apache.syncope.console.pages.UserSelfModalPage;
import org.apache.syncope.console.pages.Users;
import org.apache.syncope.console.pages.WelcomePage;
+import org.apache.syncope.console.resources.FilesystemResource;
+import org.apache.syncope.console.resources.WorkflowDefGETResource;
+import org.apache.syncope.console.resources.WorkflowDefPUTResource;
import org.apache.syncope.console.rest.UserSelfRestClient;
import org.apache.wicket.Component;
import org.apache.wicket.Page;
@@ -56,7 +59,10 @@ import org.apache.wicket.protocol.http.W
import org.apache.wicket.request.Request;
import org.apache.wicket.request.Response;
import org.apache.wicket.request.resource.ContextRelativeResource;
+import org.apache.wicket.request.resource.IResource;
+import org.apache.wicket.request.resource.ResourceReference;
import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
+import org.springframework.web.context.support.WebApplicationContextUtils;
/**
* SyncopeApplication class.
@@ -71,9 +77,11 @@ public class SyncopeApplication
public static final String IMG_NOTSEL = "notsel/";
- private final static int EDIT_PROFILE_WIN_HEIGHT = 550;
+ private static final String ACTIVITI_MODELER_CONTEXT = "activiti-modeler";
- private final static int EDIT_PROFILE_WIN_WIDTH = 800;
+ private static final int EDIT_PROFILE_WIN_HEIGHT = 550;
+
+ private static final int EDIT_PROFILE_WIN_WIDTH = 800;
@Override
protected void init() {
@@ -89,7 +97,38 @@ public class SyncopeApplication
getMarkupSettings().setStripWicketTags(true);
getMarkupSettings().setCompressWhitespace(true);
+ final String activitiModelerDirectory = WebApplicationContextUtils.getWebApplicationContext(
+ WebApplication.get().getServletContext()).getBean("activitiModelerDirectory", String.class);
getRequestCycleListeners().add(new SyncopeRequestCycleListener());
+
+ mountResource("/" + ACTIVITI_MODELER_CONTEXT, new ResourceReference(ACTIVITI_MODELER_CONTEXT) {
+
+ private static final long serialVersionUID = -128426276529456602L;
+
+ @Override
+ public IResource getResource() {
+ return new FilesystemResource(ACTIVITI_MODELER_CONTEXT, activitiModelerDirectory);
+ }
+
+ });
+ mountResource("/workflowDefGET", new ResourceReference("workflowDefGET") {
+
+ private static final long serialVersionUID = -128426276529456602L;
+
+ @Override
+ public IResource getResource() {
+ return new WorkflowDefGETResource();
+ }
+ });
+ mountResource("/workflowDefPUT", new ResourceReference("workflowDefPUT") {
+
+ private static final long serialVersionUID = -128426276529456602L;
+
+ @Override
+ public IResource getResource() {
+ return new WorkflowDefPUTResource();
+ }
+ });
}
public void setupNavigationPanel(final WebPage page, final XMLRolesReader xmlRolesReader, final boolean notsel) {
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeSession.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeSession.java?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeSession.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeSession.java Fri Nov 22 11:41:32 2013
@@ -28,6 +28,7 @@ import javax.ws.rs.core.MediaType;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.syncope.client.SyncopeClient;
import org.apache.syncope.client.SyncopeClientFactoryBean;
+import org.apache.syncope.common.types.AttributableType;
import org.apache.wicket.Session;
import org.apache.wicket.authroles.authorization.strategies.role.Roles;
import org.apache.wicket.protocol.http.WebApplication;
@@ -85,13 +86,20 @@ public class SyncopeSession extends WebS
return client.isSelfRegistrationAllowed();
}
+ public boolean isActivitiEnabledFor(final AttributableType type) {
+ SyncopeClient client = clients.isEmpty()
+ ? clientFactory.createAnonymous()
+ : clients.values().iterator().next();
+ return client.isActivitiEnabledFor(type);
+ }
+
public <T> T getService(final Class<T> service) {
return getService(service, this.username, this.password);
}
public <T> T getService(final MediaType mediaType, final Class<T> serviceClass) {
SyncopeClientFactoryBean.ContentType preType = clientFactory.getContentType();
-
+
clientFactory.setContentType(SyncopeClientFactoryBean.ContentType.fromString(mediaType.toString()));
T service = clientFactory.create(username, password).getService(serviceClass);
clientFactory.setContentType(preType);
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/HttpResourceStream.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/HttpResourceStream.java?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/HttpResourceStream.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/HttpResourceStream.java Fri Nov 22 11:41:32 2013
@@ -39,17 +39,20 @@ public class HttpResourceStream extends
private String contentType;
+ private String location;
+
private String filename;
public HttpResourceStream(final Response response) {
super();
-
+
Object entity = response.getEntity();
- if (response.getStatusInfo().getStatusCode() == Response.Status.OK.getStatusCode()
+ if (response.getStatusInfo().getStatusCode() == Response.Status.OK.getStatusCode()
&& (entity instanceof InputStream)) {
this.inputStream = (InputStream) entity;
this.contentType = response.getHeaderString(HttpHeaders.CONTENT_TYPE);
+ this.location = response.getLocation().toASCIIString();
String contentDisposition = response.getHeaderString(RESTHeaders.CONTENT_DISPOSITION);
if (StringUtils.isNotBlank(contentDisposition)) {
String[] splitted = contentDisposition.split("=");
@@ -83,7 +86,7 @@ public class HttpResourceStream extends
@Override
public String locationAsString() {
- return null;
+ return location;
}
@Override
Added: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ActivitiModelerPopupPage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ActivitiModelerPopupPage.java?rev=1544498&view=auto
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ActivitiModelerPopupPage.java (added)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ActivitiModelerPopupPage.java Fri Nov 22 11:41:32 2013
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.console.pages;
+
+import org.apache.wicket.markup.html.WebPage;
+
+public class ActivitiModelerPopupPage extends WebPage {
+
+ private static final long serialVersionUID = -7031206743629422898L;
+
+}
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ActivitiModelerPopupPage.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ActivitiModelerPopupPage.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ActivitiModelerPopupPage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/BasePopupPage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/BasePopupPage.java?rev=1544498&view=auto
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/BasePopupPage.java (added)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/BasePopupPage.java Fri Nov 22 11:41:32 2013
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.console.pages;
+
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.PriorityHeaderItem;
+
+public class BasePopupPage extends AbstractBasePage {
+
+ private static final long serialVersionUID = -2633667311332659505L;
+
+ @Override
+ public void renderHead(final IHeaderResponse response) {
+ super.renderHead(response);
+ response.render(new PriorityHeaderItem(meta));
+ }
+}
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/BasePopupPage.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/BasePopupPage.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/BasePopupPage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Configuration.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Configuration.java?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Configuration.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Configuration.java Fri Nov 22 11:41:32 2013
@@ -18,13 +18,13 @@
*/
package org.apache.syncope.console.pages;
+import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
-import javax.ws.rs.core.MediaType;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.LoggerConfig;
@@ -44,15 +44,14 @@ import org.apache.syncope.console.rest.C
import org.apache.syncope.console.rest.LoggerRestClient;
import org.apache.syncope.console.rest.NotificationRestClient;
import org.apache.syncope.console.rest.WorkflowRestClient;
-import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
import org.apache.syncope.console.wicket.extensions.markup.html.repeater.data.table.CollectionPropertyColumn;
import org.apache.syncope.console.wicket.markup.html.form.ActionLink;
import org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel;
+import org.apache.syncope.console.wicket.markup.html.link.VeilPopupSettings;
import org.apache.wicket.Page;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
import org.apache.wicket.ajax.markup.html.AjaxLink;
-import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
@@ -66,7 +65,8 @@ import org.apache.wicket.markup.html.Web
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.DropDownChoice;
import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.TextArea;
+import org.apache.wicket.markup.html.image.Image;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.PropertyListView;
@@ -76,10 +76,14 @@ import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.request.handler.resource.ResourceStreamRequestHandler;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.request.resource.ContentDisposition;
+import org.apache.wicket.request.resource.DynamicImageResource;
+import org.apache.wicket.request.resource.IResource;
import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.springframework.web.context.support.WebApplicationContextUtils;
/**
* Configurations WebPage.
@@ -143,45 +147,68 @@ public class Configuration extends BaseP
setupNotification();
// Workflow definition stuff
+ WebMarkupContainer noActivitiEnabledForUsers = new WebMarkupContainer("noActivitiEnabledForUsers");
+ noActivitiEnabledForUsers.setOutputMarkupPlaceholderTag(true);
+ add(noActivitiEnabledForUsers);
+
WebMarkupContainer workflowDefContainer = new WebMarkupContainer("workflowDefContainer");
+ workflowDefContainer.setOutputMarkupPlaceholderTag(true);
- Form wfForm = new Form("workflowDefForm");
+ if (wfRestClient.isActivitiEnabledForUsers()) {
+ noActivitiEnabledForUsers.setVisible(false);
+ } else {
+ workflowDefContainer.setVisible(false);
+ }
+
+ BookmarkablePageLink<Void> activitiModeler =
+ new BookmarkablePageLink<Void>("activitiModeler", ActivitiModelerPopupPage.class);
+ activitiModeler.setPopupSettings(new VeilPopupSettings().setHeight(600).setWidth(800));
+ MetaDataRoleAuthorizationStrategy.authorize(activitiModeler, ENABLE,
+ xmlRolesReader.getAllAllowedRoles("Configuration", "workflowDefRead"));
+ workflowDefContainer.add(activitiModeler);
+ // Check if Activiti Modeler directory is found
+ boolean activitiModelerEnabled = false;
+ try {
+ String activitiModelerDirectory = WebApplicationContextUtils.getWebApplicationContext(
+ WebApplication.get().getServletContext()).getBean("activitiModelerDirectory", String.class);
+ File baseDir = new File(activitiModelerDirectory);
+ activitiModelerEnabled = baseDir.exists() && baseDir.canRead() && baseDir.isDirectory();
+ } catch (Exception e) {
+ LOG.error("Could not check for Activiti Modeler directory", e);
+ }
+ activitiModeler.setEnabled(activitiModelerEnabled);
+
+ BookmarkablePageLink<Void> xmlEditor =
+ new BookmarkablePageLink<Void>("xmlEditor", XMLEditorPopupPage.class);
+ xmlEditor.setPopupSettings(new VeilPopupSettings().setHeight(350).setWidth(800));
+ MetaDataRoleAuthorizationStrategy.authorize(xmlEditor, ENABLE,
+ xmlRolesReader.getAllAllowedRoles("Configuration", "workflowDefRead"));
+ workflowDefContainer.add(xmlEditor);
- final TextArea<String> workflowDefArea = new TextArea<String>("workflowDefArea",
- new Model<String>(wfRestClient.getDefinition(MediaType.APPLICATION_XML_TYPE)));
- wfForm.add(workflowDefArea);
+ Image workflowDefDiagram = new Image("workflowDefDiagram", new Model()) {
- AjaxButton submit =
- new ClearIndicatingAjaxButton(APPLY, new Model<String>(getString(SUBMIT)), getPageReference()) {
+ private static final long serialVersionUID = -8457850449086490660L;
- private static final long serialVersionUID = -958724007591692537L;
+ @Override
+ protected IResource getImageResource() {
+ return new DynamicImageResource() {
- @Override
- protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
- try {
- wfRestClient.updateDefinition(
- MediaType.APPLICATION_XML_TYPE, workflowDefArea.getModelObject());
- info(getString(Constants.OPERATION_SUCCEEDED));
- } catch (SyncopeClientException scee) {
- error(getString(Constants.ERROR) + ": " + scee.getMessage());
- }
- target.add(feedbackPanel);
- }
+ private static final long serialVersionUID = 923201517955737928L;
@Override
- protected void onError(final AjaxRequestTarget target, final Form<?> form) {
- target.add(feedbackPanel);
+ protected byte[] getImageData(final IResource.Attributes attributes) {
+ return wfRestClient.isActivitiEnabledForUsers()
+ ? wfRestClient.getDiagram()
+ : new byte[0];
}
};
+ }
- MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, xmlRolesReader.getAllAllowedRoles("Configuration",
- "workflowDefUpdate"));
- wfForm.add(submit);
-
- workflowDefContainer.add(wfForm);
+ };
+ workflowDefContainer.add(workflowDefDiagram);
- MetaDataRoleAuthorizationStrategy.authorize(workflowDefContainer, ENABLE, xmlRolesReader.getAllAllowedRoles(
- "Configuration", "workflowDefRead"));
+ MetaDataRoleAuthorizationStrategy.authorize(workflowDefContainer, ENABLE,
+ xmlRolesReader.getAllAllowedRoles("Configuration", "workflowDefRead"));
add(workflowDefContainer);
// Logger stuff
@@ -280,7 +307,7 @@ public class Configuration extends BaseP
final AjaxFallbackDefaultDataTable<ConfigurationTO, String> confTable =
new AjaxFallbackDefaultDataTable<ConfigurationTO, String>(
- "syncopeconf", confColumns, new SyncopeConfProvider(), confPaginatorRows);
+ "syncopeconf", confColumns, new SyncopeConfProvider(), confPaginatorRows);
confContainer = new WebMarkupContainer("confContainer");
confContainer.add(confTable);
@@ -455,7 +482,7 @@ public class Configuration extends BaseP
final AjaxFallbackDefaultDataTable<NotificationTO, String> notificationTable =
new AjaxFallbackDefaultDataTable<NotificationTO, String>(
- "notificationTable", notificationCols, new NotificationProvider(), notificationPaginatorRows);
+ "notificationTable", notificationCols, new NotificationProvider(), notificationPaginatorRows);
notificationContainer = new WebMarkupContainer("notificationContainer");
notificationContainer.add(notificationTable);
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/StatusModalPage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/StatusModalPage.java?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/StatusModalPage.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/StatusModalPage.java Fri Nov 22 11:41:32 2013
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.console.pages;
-import static org.apache.syncope.console.pages.AbstractBasePage.LOG;
import java.util.ArrayList;
import java.util.List;
import org.apache.syncope.common.to.AbstractAttributableTO;
Added: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/XMLEditorPopupPage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/XMLEditorPopupPage.java?rev=1544498&view=auto
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/XMLEditorPopupPage.java (added)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/XMLEditorPopupPage.java Fri Nov 22 11:41:32 2013
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.console.pages;
+
+import java.io.IOException;
+import javax.ws.rs.core.MediaType;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.common.validation.SyncopeClientException;
+import org.apache.syncope.console.commons.Constants;
+import org.apache.syncope.console.rest.WorkflowRestClient;
+import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextArea;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.apache.wicket.util.io.IOUtils;
+
+public class XMLEditorPopupPage extends BasePopupPage {
+
+ private static final long serialVersionUID = 5816041644635271734L;
+
+ @SpringBean
+ private WorkflowRestClient wfRestClient;
+
+ public XMLEditorPopupPage() {
+ Form wfForm = new Form("workflowDefForm");
+
+ String definition;
+ try {
+ definition = IOUtils.toString(wfRestClient.getDefinition(MediaType.APPLICATION_XML_TYPE));
+ } catch (IOException e) {
+ LOG.error("Could not get workflow definition", e);
+ definition = StringUtils.EMPTY;
+ }
+ final TextArea<String> workflowDefArea = new TextArea<String>("workflowDefArea", new Model<String>(definition));
+ wfForm.add(workflowDefArea);
+
+ AjaxButton submit =
+ new ClearIndicatingAjaxButton(APPLY, new Model<String>(getString(SUBMIT)), getPageReference()) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+ try {
+ wfRestClient.updateDefinition(
+ MediaType.APPLICATION_XML_TYPE, workflowDefArea.getModelObject());
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scee) {
+ error(getString(Constants.ERROR) + ": " + scee.getMessage());
+ }
+ target.add(feedbackPanel);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ target.add(feedbackPanel);
+ }
+ };
+
+ MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE,
+ xmlRolesReader.getAllAllowedRoles("Configuration", "workflowDefUpdate"));
+ wfForm.add(submit);
+
+ this.add(wfForm);
+ }
+
+}
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/XMLEditorPopupPage.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/XMLEditorPopupPage.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/XMLEditorPopupPage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/FilesystemResource.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/FilesystemResource.java?rev=1544498&view=auto
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/FilesystemResource.java (added)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/FilesystemResource.java Fri Nov 22 11:41:32 2013
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.console.resources;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import org.apache.wicket.request.resource.AbstractResource;
+import org.apache.wicket.util.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Mounts directory on local filesystem as subcontext.
+ */
+public class FilesystemResource extends AbstractResource {
+
+ private static final long serialVersionUID = -4791087117785935198L;
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(FilesystemResource.class);
+
+ private final String baseCtx;
+
+ private final String basePath;
+
+ public FilesystemResource(final String baseCtx, final String basePath) {
+ this.baseCtx = baseCtx;
+ this.basePath = basePath;
+ }
+
+ @Override
+ protected ResourceResponse newResourceResponse(final Attributes attributes) {
+ ResourceResponse response = new ResourceResponse();
+
+ final File baseDir = new File(basePath);
+ if (baseDir.exists() && baseDir.canRead() && baseDir.isDirectory()) {
+ String reqPath = attributes.getRequest().getUrl().getPath();
+ final String subPath = reqPath.substring(reqPath.indexOf(baseCtx) + baseCtx.length()).
+ replace('/', File.separatorChar);
+ LOG.debug("Request for {}", subPath);
+
+ response.setWriteCallback(new WriteCallback() {
+
+ @Override
+ public void writeData(final Attributes attributes) throws IOException {
+ FileInputStream resourceIS = null;
+ try {
+ resourceIS = new FileInputStream(new File(baseDir, subPath));
+ IOUtils.copy(resourceIS, attributes.getResponse().getOutputStream());
+ } catch (IOException e) {
+ LOG.error("Could not read from {}", baseDir.getAbsolutePath() + subPath, e);
+ } finally {
+ IOUtils.closeQuietly(resourceIS);
+ }
+ }
+ });
+ } else {
+ LOG.error("{} not found, not readable or not a directory", basePath);
+ }
+
+ return response;
+ }
+
+}
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/FilesystemResource.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/FilesystemResource.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/FilesystemResource.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/WorkflowDefGETResource.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/WorkflowDefGETResource.java?rev=1544498&view=auto
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/WorkflowDefGETResource.java (added)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/WorkflowDefGETResource.java Fri Nov 22 11:41:32 2013
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.console.resources;
+
+import java.io.IOException;
+import javax.ws.rs.core.MediaType;
+import org.apache.syncope.console.rest.WorkflowRestClient;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.request.resource.AbstractResource;
+import org.apache.wicket.util.io.IOUtils;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ * Mirror REST resource for obtaining user workflow definition in JSON (used by Activiti Modeler).
+ *
+ * @see org.apache.syncope.common.services.WorkflowService#exportDefinition(
+ * org.apache.syncope.common.types.AttributableType)
+ */
+public class WorkflowDefGETResource extends AbstractResource {
+
+ private static final long serialVersionUID = 4637304868056148970L;
+
+ @Override
+ protected ResourceResponse newResourceResponse(final Attributes attributes) {
+ ResourceResponse response = new ResourceResponse();
+ response.setContentType(MediaType.APPLICATION_JSON);
+
+ response.setWriteCallback(new WriteCallback() {
+
+ @Override
+ public void writeData(final Attributes attributes) throws IOException {
+ IOUtils.copy(WebApplicationContextUtils.getWebApplicationContext(
+ WebApplication.get().getServletContext()).getBean(WorkflowRestClient.class).
+ getDefinition(MediaType.APPLICATION_JSON_TYPE),
+ attributes.getResponse().getOutputStream());
+ }
+ });
+
+ return response;
+ }
+
+}
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/WorkflowDefGETResource.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/WorkflowDefGETResource.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/WorkflowDefGETResource.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/WorkflowDefPUTResource.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/WorkflowDefPUTResource.java?rev=1544498&view=auto
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/WorkflowDefPUTResource.java (added)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/WorkflowDefPUTResource.java Fri Nov 22 11:41:32 2013
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.console.resources;
+
+import java.io.IOException;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.core.MediaType;
+import org.apache.cxf.common.util.UrlUtils;
+import org.apache.syncope.console.rest.WorkflowRestClient;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.request.resource.AbstractResource;
+import org.apache.wicket.util.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ * Mirror REST resource for putting user workflow definition in JSON (used by Activiti Modeler).
+ *
+ * @seeorg.apache.syncope.common.services.WorkflowService#importDefinition(
+ * org.apache.syncope.common.types.AttributableType,
+ * java.lang.String)
+ */
+public class WorkflowDefPUTResource extends AbstractResource {
+
+ private static final long serialVersionUID = 2964542005207297944L;
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(WorkflowDefPUTResource.class);
+
+ @Override
+ protected ResourceResponse newResourceResponse(final Attributes attributes) {
+ String definition = null;
+ try {
+ HttpServletRequest request = (HttpServletRequest) attributes.getRequest().getContainerRequest();
+ String requestBody = IOUtils.toString(request.getInputStream());
+ String[] split = requestBody.split("&");
+ for (int i = 0; i < split.length && definition == null; i++) {
+ String keyValue = split[i];
+ if (keyValue.startsWith("json_xml=")) {
+ definition = UrlUtils.urlDecode(keyValue.split("=")[1]);
+ }
+ }
+ } catch (IOException e) {
+ LOG.error("Could not extract workflow definition from request", e);
+ }
+
+ WebApplicationContextUtils.getWebApplicationContext(WebApplication.get().getServletContext()).
+ getBean(WorkflowRestClient.class).
+ updateDefinition(MediaType.APPLICATION_JSON_TYPE, definition);
+
+ ResourceResponse response = new ResourceResponse();
+ response.setStatusCode(204);
+ return response;
+ }
+
+}
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/WorkflowDefPUTResource.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/WorkflowDefPUTResource.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/resources/WorkflowDefPUTResource.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/WorkflowRestClient.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/WorkflowRestClient.java?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/WorkflowRestClient.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/WorkflowRestClient.java Fri Nov 22 11:41:32 2013
@@ -21,10 +21,12 @@ package org.apache.syncope.console.rest;
import java.io.InputStream;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import org.apache.commons.lang3.StringUtils;
import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.jaxrs.client.WebClient;
import org.apache.syncope.common.services.WorkflowService;
import org.apache.syncope.common.types.AttributableType;
+import org.apache.syncope.common.types.RESTHeaders;
+import org.apache.syncope.common.validation.SyncopeClientException;
import org.apache.syncope.console.SyncopeSession;
import org.springframework.stereotype.Component;
@@ -37,17 +39,38 @@ public class WorkflowRestClient extends
return SyncopeSession.get().getService(mediaType, WorkflowService.class);
}
- public String getDefinition(final MediaType mediaType) {
+ public InputStream getDefinition(final MediaType mediaType) {
Response response = getService(mediaType).exportDefinition(AttributableType.USER);
- String definition;
+ return (InputStream) response.getEntity();
+ }
+
+ public byte[] getDiagram() {
+ WorkflowService service = getService(WorkflowService.class);
+ WebClient.client(service).accept(RESTHeaders.MEDIATYPE_IMAGE_PNG);
+ Response response = service.exportDiagram(AttributableType.USER);
+
+ byte[] diagram;
try {
- definition = IOUtils.toString((InputStream) response.getEntity());
+ diagram = IOUtils.readBytesFromStream((InputStream) response.getEntity());
} catch (Exception e) {
- LOG.error("Could not get workflow definition as {}", mediaType, e);
- definition = StringUtils.EMPTY;
+ LOG.error("Could not get workflow diagram", e);
+ diagram = new byte[0];
+ }
+ return diagram;
+ }
+
+ public boolean isActivitiEnabledForUsers() {
+ Boolean result = null;
+ try {
+ result = SyncopeSession.get().isActivitiEnabledFor(AttributableType.USER);
+ } catch (SyncopeClientException e) {
+ LOG.error("While seeking if Activiti is enabled for users", e);
}
- return definition;
+
+ return result == null
+ ? false
+ : result.booleanValue();
}
public void updateDefinition(final MediaType mediaType, final String definition) {
Added: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/link/VeilPopupSettings.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/link/VeilPopupSettings.java?rev=1544498&view=auto
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/link/VeilPopupSettings.java (added)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/link/VeilPopupSettings.java Fri Nov 22 11:41:32 2013
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.console.wicket.markup.html.link;
+
+import org.apache.wicket.markup.html.link.PopupSettings;
+
+public class VeilPopupSettings extends PopupSettings {
+
+ private static final long serialVersionUID = -2727046117490858226L;
+
+ @Override
+ public String getPopupJavaScript() {
+ return "document.getElementById('veil').style.display = 'block';" + super.getPopupJavaScript();
+ }
+
+}
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/link/VeilPopupSettings.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/link/VeilPopupSettings.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/link/VeilPopupSettings.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: syncope/trunk/console/src/main/resources/applicationContext.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/applicationContext.xml?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/applicationContext.xml (original)
+++ syncope/trunk/console/src/main/resources/applicationContext.xml Fri Nov 22 11:41:32 2013
@@ -63,6 +63,10 @@ under the License.
<constructor-arg value="${anonymousKey}"/>
</bean>
+ <bean id="activitiModelerDirectory" class="java.lang.String">
+ <constructor-arg value="${activiti-modeler.directory}"/>
+ </bean>
+
<bean id="syncopeApplication" class="org.apache.syncope.console.SyncopeApplication"/>
<bean id="preferenceManager" class="org.apache.syncope.console.commons.PreferenceManager"/>
Added: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ActivitiModelerPopupPage.html
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ActivitiModelerPopupPage.html?rev=1544498&view=auto
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ActivitiModelerPopupPage.html (added)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ActivitiModelerPopupPage.html Fri Nov 22 11:41:32 2013
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:b3mn="http://b3mn.org/2007/b3mn"
+ xmlns:ext="http://b3mn.org/2007/ext"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:atom="http://b3mn.org/2007/atom+xhtml">
+ <head profile="http://purl.org/NET/erdf/profile">
+ <title>Apache Syncope / Activiti Modeler</title>
+ <!-- libraries -->
+ <script src="activiti-modeler/libs/prototype-1.5.1.js" type="text/javascript"></script>
+ <script src="activiti-modeler/libs/path_parser.js" type="text/javascript"></script>
+ <script src="activiti-modeler/libs/ext-2.0.2/adapter/ext/ext-base.js" type="text/javascript"></script>
+ <script src="activiti-modeler/libs/ext-2.0.2/ext-all-debug.js" type="text/javascript"></script>
+ <script src="activiti-modeler/libs/ext-2.0.2/color-field.js" type="text/javascript"></script>
+ <link rel="Stylesheet" media="screen" href="activiti-modeler/libs/ext-2.0.2/resources/css/ext-all.css" type="text/css"></link>
+ <link rel="Stylesheet" media="screen" href="activiti-modeler/libs/ext-2.0.2/resources/css/xtheme-darkgray.css" type="text/css"></link>
+ <link rel="Stylesheet" media="screen" href="activiti-modeler/editor/css/theme_norm.css" type="text/css"></link>
+ <link rel="Stylesheet" media="screen" href="activiti-modeler/editor/css/theme_norm_signavio.css" type="text/css"></link>
+ <link rel="Stylesheet" media="screen" href="activiti-modeler/explorer/src/css/xtheme-smoky.css" type="text/css"></link>
+ <link rel="Stylesheet" media="screen" href="activiti-modeler/explorer/src/css/custom-style.css" type="text/css"></link>
+ <!-- oryx editor -->
+ <!-- language files -->
+ <script src="activiti-modeler/editor/i18n/translation_en_us.js" type="text/javascript"></script>
+ <script src="activiti-modeler/editor/i18n/translation_signavio_en_us.js" type="text/javascript"></script>
+ <script src="activiti-modeler/libs/utils.js" type="text/javascript"></script>
+ <script src="activiti-modeler/editor/oryx.debug.js" type="text/javascript"></script>
+ <!-- erdf schemas -->
+ <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/"></link>
+ <link rel="schema.dcTerms" href="http://purl.org/dc/terms/"></link>
+ <link rel="schema.b3mn" href="http://b3mn.org"></link>
+ <link rel="schema.oryx" href="http://oryx-editor.org/"></link>
+ <link rel="schema.raziel" href="http://raziel.org/"></link>
+
+ <script type="text/javascript">
+ window.onunload = refreshParent;
+ function refreshParent() {
+ if (window.opener.location.toString().indexOf('#workflow') === -1) {
+ window.opener.location = window.opener.location + "#workflow";
+ }
+ window.opener.location.reload();
+ }
+ </script>
+ </head>
+ <body style="overflow:hidden;">
+ </body>
+</html>
Propchange: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ActivitiModelerPopupPage.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ActivitiModelerPopupPage.html
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ActivitiModelerPopupPage.html
------------------------------------------------------------------------------
svn:mime-type = text/html
Modified: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BaseModalPage.html
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BaseModalPage.html?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BaseModalPage.html (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BaseModalPage.html Fri Nov 22 11:41:32 2013
@@ -16,8 +16,10 @@ KIND, either express or implied. See th
specific language governing permissions and limitations
under the License.
-->
-<html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
<head>
+ <title></title>
+
<link rel="stylesheet" type="text/css" href="css/jquery-ui.css" media="all"/>
<link rel="stylesheet" type="text/css" href="css/style.css" media="all"/>
<link rel="stylesheet" type="text/css" href="css/fieldstyle.css" media="all"/>
@@ -41,6 +43,6 @@ under the License.
<body onload="setTimeout('window.focus();', 0);">
<div wicket:id="feedback"/>
- <wicket:child />
-</body>
+ <wicket:child />
+ </body>
</html>
Modified: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePage.html
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePage.html?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePage.html (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePage.html Fri Nov 22 11:41:32 2013
@@ -17,7 +17,7 @@ KIND, either express or implied. See th
specific language governing permissions and limitations
under the License.
-->
-<html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Style-Type" content="text/css"/>
Added: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePopupPage.html
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePopupPage.html?rev=1544498&view=auto
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePopupPage.html (added)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePopupPage.html Fri Nov 22 11:41:32 2013
@@ -0,0 +1,39 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <head>
+ <title></title>
+
+ <link rel="stylesheet" type="text/css" href="css/jquery-ui.css" media="all"/>
+ <link rel="stylesheet" type="text/css" href="css/style.css" media="all"/>
+ <link rel="stylesheet" type="text/css" href="css/fieldstyle.css" media="all"/>
+
+ <style type="text/css">
+ table.palette td.header {
+ background:url("images/ui-bg_glass_75_e6e6e6_1x400.png")
+ repeat-x scroll 50% 50% #E6E6E6 !important;
+ }
+ </style>
+ </head>
+ <body onload="setTimeout('window.focus();', 0);">
+ <div wicket:id="feedback"/>
+
+ <wicket:child />
+ </body>
+</html>
Propchange: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePopupPage.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePopupPage.html
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePopupPage.html
------------------------------------------------------------------------------
svn:mime-type = text/html
Modified: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration.html
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration.html?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration.html (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration.html Fri Nov 22 11:41:32 2013
@@ -17,42 +17,22 @@ specific language governing permissions
under the License.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:head>
- <link rel="stylesheet" type="text/css" href="css/codemirror.css" />
- <link rel="stylesheet" type="text/css" href="css/codemirror_default_theme.css" />
-
- <script type="text/javascript" src="scripts/codemirror.js"></script>
- <script type="text/javascript" src="scripts/xmlpure.js"></script>
- <script type="text/javascript">
- function updateTextArea(editor) {
- document.getElementById("workflowDefArea").value = editor.getValue();
- }
- </script>
-
- <style>
- td#level {
- width: 100px;
- text-align: center;
- }
- </style>
- </wicket:head>
-
<wicket:extend>
<div id="tabs">
<ul>
<li class="tabs-selected">
- <a href="#tabs-1"><span><wicket:message key="tab1"/></span></a>
+ <a href="#parameters"><span><wicket:message key="parameters"/></span></a>
</li>
- <li><a href="#tabs-2"><span><wicket:message key="tab2"/></span></a></li>
- <li><a href="#tabs-3"><span><wicket:message key="tab3"/></span></a></li>
- <li><a href="#tabs-4"><span><wicket:message key="tab4"/></span></a></li>
- <li><a href="#tabs-5"><span><wicket:message key="tab5"/></span></a></li>
- <li><a href="#tabs-6"><span><wicket:message key="tab6"/></span></a></li>
- <li><a href="#tabs-7"><span><wicket:message key="tab7"/></span></a></li>
- <li><a href="#tabs-8"><span><wicket:message key="tab8"/></span></a></li>
+ <li><a href="#passwordPolicies"><span><wicket:message key="passwordPolicies"/></span></a></li>
+ <li><a href="#accountPolicies"><span><wicket:message key="accountPolicies"/></span></a></li>
+ <li><a href="#syncPolicies"><span><wicket:message key="syncPolicies"/></span></a></li>
+ <li><a href="#notifications"><span><wicket:message key="notifications"/></span></a></li>
+ <li><a href="#workflow"><span><wicket:message key="workflow"/></span></a></li>
+ <li><a href="#coreLog"><span><wicket:message key="coreLog"/></span></a></li>
+ <li><a href="#consoleLog"><span><wicket:message key="consoleLog"/></span></a></li>
</ul>
- <div id="tabs-1">
+ <div id="parameters">
<div id="users-contain" class="ui-widget" style="width:inherit">
<span wicket:id="confContainer">
@@ -77,16 +57,16 @@ under the License.
<wicket:message key="create_configuration"/>
</a>
</div>
- <div id="tabs-2">
+ <div id="passwordPolicies">
<span wicket:id="passwordPoliciesPanel">[password policies]</span>
</div>
- <div id="tabs-3">
+ <div id="accountPolicies">
<span wicket:id="accountPoliciesPanel">[account policies]</span>
</div>
- <div id="tabs-4">
+ <div id="syncPolicies">
<span wicket:id="syncPoliciesPanel">[sync policies]</span>
</div>
- <div id="tabs-5">
+ <div id="notifications">
<div id="users-contain" class="ui-widget" style="width:inherit">
<span wicket:id="notificationContainer">
<table class="ui-widget ui-widget-content table-hover"
@@ -110,26 +90,39 @@ under the License.
<wicket:message key="create_notification"/>
</a>
</div>
- <div id="tabs-6">
+ <div id="workflow">
<div id="users-contain" class="ui-widget" style="width:inherit">
+ <span wicket:id="noActivitiEnabledForUsers"><i><wicket:message key="noActivitiEnabledForUsers"/></i></span>
<span wicket:id="workflowDefContainer">
- <form wicket:id="workflowDefForm">
- <textarea wicket:id="workflowDefArea" id="workflowDefArea" style="width:100%;height:350px;">
- </textarea>
- <div style="margin: 10px 0px 0">
- <input type="submit"
- class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
- wicket:id="apply"/>
- </div>
- </form>
- <script>
- var editor = CodeMirror.fromTextArea(document.getElementById("workflowDefArea"),
- {mode: {name: "xmlpure"}, lineNumbers: true, onChange: updateTextArea});
- </script>
+ <div style="float: left;">
+ <button wicket:id="activitiModeler">
+ <div style="display: table-row;">
+ <div style="display: table-cell">
+ <img src="img/modeler.png" alt="Activiti Modeler" title="Activiti Modeler"/>
+ </div>
+ <div style="display: table-cell;vertical-align:middle;font-size:62.5%;">
+ Activiti Modeler
+ </div>
+ </div>
+ </button>
+ </div>
+ <div>
+ <button wicket:id="xmlEditor">
+ <div style="display: table-row;">
+ <div style="display: table-cell">
+ <img src="img/xml.png" alt="XML editor" title="XML editor"/>
+ </div>
+ <div style="display: table-cell;vertical-align:middle;font-size:62.5%;">
+ XML editor
+ </div>
+ </div>
+ </button>
+ </div>
+ <img wicket:id="workflowDefDiagram" style="width: 100%;"/>
</span>
</div>
</div>
- <div id="tabs-7">
+ <div id="coreLog">
<div id="users-contain" class="ui-widget" style="width:inherit">
<span wicket:id="coreLoggerContainer">
<table class="ui-widget ui-widget-content table-hover">
@@ -149,7 +142,7 @@ under the License.
</span>
</div>
</div>
- <div id="tabs-8">
+ <div id="consoleLog">
<div id="users-contain" class="ui-widget" style="width:inherit">
<span wicket:id="consoleLoggerContainer">
<table class="ui-widget ui-widget-content table-hover">
Modified: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration.properties
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration.properties?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration.properties (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration.properties Fri Nov 22 11:41:32 2013
@@ -16,23 +16,23 @@
# under the License.
key=Key
value=Value
-tab1=Parameters
-tab2=Password Policies
-tab3=Account Policies
-tab4=Synchronization Policies
-tab5=Notifications
-tab6=Workflow
-tab7=Core Log
-tab8=Console Log
+parameters=Parameters
+passwordPolicies=Password Policies
+accountPolicies=Account Policies
+syncPolicies=Synchronization Policies
+notifications=Notifications
+workflow=Workflow
+coreLog=Core Log
+consoleLog=Console Log
edit=Edit
delete=Delete
create_configuration=Create new configuration
db_export=DB export
logger=Logger
level=Level
-submit=Save
events=Events
template=Template
traceLevel=Trace level
create_notification=Create new notification
subject=Subject
+noActivitiEnabledForUsers=Activiti not enabled for users
Modified: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration_it.properties
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration_it.properties?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration_it.properties (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration_it.properties Fri Nov 22 11:41:32 2013
@@ -16,23 +16,23 @@
# under the License.
key=Chiave
value=Valore
-tab1=Parametri
-tab2=Policy di password
-tab3=Policy di account
-tab4=Policy di sincronizzazione
-tab5=Notifiche
-tab6=Workflow
-tab7=Log Core
-tab8=Log Console
+parameters=Parametri
+passwordPolicies=Policy di password
+accountPolicies=Policy di account
+syncPolicies=Policy di sincronizzazione
+notifications=Notifiche
+workflow=Workflow
+coreLog=Log Core
+consoleLog=Log Console
edit=Modifica
delete=Rimuovi
create_configuration=Crea nuova configurazione
db_export=Esportazione DB
logger=Logger
level=Livello
-submit=Salva
events=Eventi
template=Modello
traceLevel=Tracciamento
create_notification=Crea nuova notifica
subject=Oggetto
+noActivitiEnabledForUsers=Activiti non configurato per gli utenti
Modified: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration_pt_BR.properties
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration_pt_BR.properties?rev=1544498&r1=1544497&r2=1544498&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration_pt_BR.properties (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Configuration_pt_BR.properties Fri Nov 22 11:41:32 2013
@@ -16,23 +16,23 @@
# under the License.
key=Chave
value=Valor
-tab1=Par\u00E2metros
-tab2=Pol\u00EDticas de Senha
-tab3=Pol\u00EDticas de Conta
-tab4=Pol\u00EDticas de Sincroniza\u00E7\u00E3o
-tab5=Notifica\u00E7\u00F5es
-tab6=Fluxo de Trabalho
-tab7=Log Central
-tab8=Log do Console
+parameters=Par\u00e2metros
+passwordPolicies=Pol\u00edticas de Senha
+accountPolicies=Pol\u00edticas de Conta
+syncPolicies=Pol\u00edticas de Sincroniza\u00e7\u00e3o
+notifications=Notifica\u00e7\u00f5es
+workflow=Fluxo de Trabalho
+coreLog=Log Central
+consoleLog=Log do Console
edit=Editar
delete=Excluir
-create_configuration=Criar Nova configura\u00E7\u00E3o
+create_configuration=Criar Nova configura\u00e7\u00e3o
db_export=Exportar Banco de Dados
logger=Logger
-level=N\u00EDvel
-submit=Salvar
+level=N\u00edvel
events=Eventos
template=Template
-traceLevel=N\u00EDvel de Trace
-create_notification=Criar nova notifica\u00E7\u00E3o
+traceLevel=N\u00edvel de Trace
+create_notification=Criar nova notifica\u00e7\u00e3o
subject=Assunto
+noActivitiEnabledForUsers=Activiti n\u00e3o habilitado para usu\u00e1rios