Moqui form shows up disabled - moqui

I am following the Moqui getting started tutorial. I have created a create form as below.
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://staging.azpire.co.in/xsd/xml-screen-2.1.xsd"
require-authentication="anonymous-all">
<transition name="findTutorial"><default-response url="."/></transition>
<transition name="createTutorial">
<service-call name="create#tutorial.Tutorial"></service-call>
<default-response url="."/>
</transition>
<actions>
<entity-find entity-name="tutorial.Tutorial" list="tutorialList">
<search-form-inputs/>
</entity-find>
</actions>
<widgets>
<container-dialog button-text="Create Tutorial" id="CreateTutorialDialog">
<form-single name="CreateTutorial" transition="createTutorial">
<auto-fields-entity entity-name="tutorial.Tutorial" field-type="edit"/>
<field name="submitButton">
<default-field title="Create"><submit/></default-field>
</field>
</form-single>
</container-dialog>
<form-list name="ListTutorials" list="tutorialList" transition="findTutorial">
<auto-fields-entity entity-name="tutorial.Tutorial" field-type="find-display"/>
</form-list>
</widgets>
</screen>
When I click "Create Tutorial", the form shows up. But, it is disabled(read only) including the submit button.

If you are following the Moqui getting started tutorial, you need import data about security screen as follow to fix this problem:
<moqui.security.ArtifactGroup artifactGroupId="TUTORIAL" description="Tutorial"/>
<moqui.security.ArtifactGroupMember artifactGroupId="TUTORIAL" artifactTypeEnumId="AT_XML_SCREEN"
inheritAuthz="Y" artifactName="component://tutorial/screen/tutorial.xml"/>
<!-- Full permissions for the ADMIN user group -->
<moqui.security.ArtifactAuthz artifactAuthzId="TUTORIAL_AUTHZ_ALL" userGroupId="ADMIN" artifactGroupId="TUTORIAL"
authzTypeEnumId="AUTHZT_ALWAYS" authzActionEnumId="AUTHZA_ALL"/>

If you are required temporary solution for one transition then you can use:
<transition name="createTutorial" read-only="true">
<service-call name="create#tutorial.Tutorial"></service-call>
<default-response url="."/>
</transition>
If you are required a temporary solution but for more transition then you can use:
<always-actions>
<script>ec.artifactExecution.disableAuthz()</script>
</always-actions>
<transition name="createTutorial">
<service-call name="create#tutorial.Tutorial"></service-call>
<default-response url="."/>
</transition>
<transition name="createEmployee">
<service-call name="create#employee.Employee"></service-call>
<default-response url="."/>
</transition>
If you want permanent solution then create below seed data records:
If you want to authrize for availabe UserGroup(ADMIN) then you have to add following seed data:
<moqui.security.ArtifactGroup artifactGroupId="ADMIN_ARTIFACTS" description="Administrators"/>
<!-- for screen path -->
<moqui.security.ArtifactGroupMember artifactGroupId="ADMIN_ARTIFACTS" artifactTypeEnumId="AT_XML_SCREEN" nameIsPattern="N" inheritAuthz="Y" artifactName="component://tutorial/screen/tutorial.xml"/>
<!-- for rest calls -->
<moqui.security.ArtifactGroupMember artifactGroupId="ADMIN_ARTIFACTS" artifactName="/tutorial/fetch-records" artifactTypeEnumId="AT_REST_PATH" nameIsPattern="N" inheritAuthz="Y"/>
<!-- for service path -->
<moqui.security.ArtifactGroupMember artifactGroupId="ADMIN_ARTIFACTS" artifactName="TutorialServices.create#Records" artifactTypeEnumId="AT_SERVICE" nameIsPattern="N" inheritAuthz="Y"/>
<!-- Give authrization to UserGroup: -->
<moqui.security.ArtifactAuthz artifactAuthzId="ADMIN_AUTHZ" userGroupId="ADMIN" artifactGroupId="ADMIN_ARTIFACTS"
authzTypeEnumId="AUTHZT_ALWAYS" authzActionEnumId="AUTHZA_ALL"/>
If you want to create your own UserGroupType then you have to add following seed data:
<moqui.basic.Enumeration enumTypeId="UserGroupType" enumId="UgtMyAdmin" description="My Administrators"/>
// If you want to create your own UserGroup then you have to add following seed data:
<moqui.security.UserGroup groupTypeEnumId="UgtMyAdmin" userGroupId="MyAdmin" description="My Administrators"/>
// you can also create artifact group separately:
<moqui.security.ArtifactGroup artifactGroupId="MY_ADMIN_ARTIFACTS" description="My Administrators"/>
// Now you have to give screen permission to your own created UserGroup:
<!-- for screen path -->
<moqui.security.ArtifactGroupMember artifactGroupId="MY_ADMIN_ARTIFACTS" artifactTypeEnumId="AT_XML_SCREEN" nameIsPattern="N" inheritAuthz="Y" artifactName="component://tutorial/screen/tutorial.xml"/>
<!-- for rest calls -->
<moqui.security.ArtifactGroupMember artifactGroupId="MY_ADMIN_ARTIFACTS" artifactName="/tutorial/fetch-records" artifactTypeEnumId="AT_REST_PATH" nameIsPattern="N" inheritAuthz="Y"/>
<!-- for service path -->
<moqui.security.ArtifactGroupMember artifactGroupId="MY_ADMIN_ARTIFACTS" artifactName="TutorialServices.create#Records" artifactTypeEnumId="AT_SERVICE" nameIsPattern="N" inheritAuthz="Y"/>
<!-- Give authrization to UserGroup: -->
<moqui.security.ArtifactAuthz artifactAuthzId="MY_ADMIN_AUTH" userGroupId="MyAdmin" artifactGroupId="MY_ADMIN_ARTIFACTS" authzTypeEnumId="AUTHZT_ALWAYS" authzActionEnumId="AUTHZA_ALL"/>
You can also clone an example component from git:
I hope this will help!

If the transition exist and the user has permission to access it, then all fields disabled is a bug, please report it by create a issue.

Related

shopware 6 admin module for app not showing app in menu

I made a shopware app and in manifest.xml i added the tag for a admin module:
<admin>
<module name="VisualSearchAdminModule"
parent="sw-extension"
source="http://localhost:8080/admin/shopware"
position="50"
>
<label>Visual Search</label>
<label lang="de-DE">Visual Search</label>
</module>
</admin>
Do you have any idea why the admin module is not showing in the menu ?
The app is installed and activated.
The module source is a valid url.
Later Edit
I do have the setup tag in my manifest. I posted below the entire manifest
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/platform/trunk/src/Core/Framework/App/Manifest/Schema/manifest-1.0.xsd">
<meta>
<name>VisualSearch</name>
<label>Visual Search</label>
<label lang="de-DE">Visual Search</label>
<description>Visual Search app for Shopware 6</description>
<description lang="de-DE">Visual Search app für Shopware 6</description>
<author>Agency</author>
<copyright>(c) by Agency</copyright>
<version>1.0.0</version>
<icon>Resources/config/plugin.png</icon>
<license>MIT</license>
</meta>
<setup>
<registrationUrl>http://myapp/auth</registrationUrl>
<secret>visualsearchsecret</secret>
</setup>
<admin>
<module name="VisualSearchAdminModule"
parent="sw-extension"
source="http://myapp/admin/shopware"
position="50">
<label>Visual Search</label>
<label lang="de-DE">Visual Search</label>
</module>
</admin>
<permissions>
<read>product</read>
</permissions>
<webhooks>
<webhook name="app-activated" url="http://myapp/api/shop/activate" event="app.activated"/>
<webhook name="app-deactivated" url="http://myapp/api/shop/deactivate" event="app.deactivated"/>
<webhook name="app-deleted" url="http://myapp/api/shop/delete" event="app.deleted"/>
</webhooks>
</manifest>
The registration for the app works ok.
But the admin module doesn't show in shopware admin menu.
To register admin modules, your app currently must have a setup segment to register with an external web service, even if it is a private app. Otherwise the modules will just be ignored.
<manifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/platform/master/src/Core/Framework/App/Manifest/Schema/manifest-1.0.xsd">
<!-- ... -->
<setup>
<registrationUrl>http://localhost/register.php</registrationUrl>
<secret>verysecret</secret>
</setup>
<admin>
<module name="exampleModule"
source="https://example.com/promotion/view/promotion-module"
parent="sw-marketing"
position="50"
>
<label>Example module</label>
<label lang="de-DE">Beispiel Modul</label>
</module>
</admin>
</manifest>
Here's a minimal example for a register.php
<?php
require __DIR__ . '/vendor/autoload.php';
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\JsonResponse;
$request = Request::createFromGlobals();
$query = $request->query->all();
$proof = \hash_hmac(
'sha256',
$query['shop-id'] . $query['shop-url'] . 'TestApp',
'verysecret'
);
$response = new JsonResponse([
'proof' => $proof,
'secret' => 'verysecret',
'confirmation_url' => 'http://localhost/confirm.php'
]);
$response->send();
Exchange TestApp for the name of your app.

Issue in 2 node cluster using infinispan 5.3 | ActionStatus.ABORT_ONLY > is not in a valid state to be invoking cache operations on

I have a setup of 2 node cluster using Infinispan 5.3. I am testing the failover scenario. When I killed one node, i'm getting the below exception (I'm using the sync cache). The cluster is not getting. So I need to restart the application, which is not practically possible in production environment
2020-05-06 18:50:28,082 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] ISPN000136: Execution error
java.lang.IllegalStateException: Transaction TransactionImple < ac, BasicAction: -3f57f478:dd0a:5eb2b455:2d461 status: ActionStatus.ABORT_ONLY > is not in a valid state to be invoking cache operations on.
at org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:275)
at org.infinispan.interceptors.TxInterceptor.enlistIfNeeded(TxInterceptor.java:239)
at org.infinispan.interceptors.TxInterceptor.enlistReadAndInvokeNext(TxInterceptor.java:233)
at org.infinispan.interceptors.TxInterceptor.visitGetKeyValueCommand(TxInterceptor.java:229)
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:62)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:120)
at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:134)
at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:96)
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:62)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:120)
at org.infinispan.statetransfer.StateTransferInterceptor.handleTopologyAffectedCommand(StateTransferInterceptor.java:216)
at org.infinispan.statetransfer.StateTransferInterceptor.handleDefault(StateTransferInterceptor.java:200)
at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:96)
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:62)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:120)
at org.infinispan.interceptors.CacheMgmtInterceptor.visitGetKeyValueCommand(CacheMgmtInterceptor.java:113)
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:62)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:120)
at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:134)
at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:96)
at org.infinispan.interceptors.IsMarshallableInterceptor.visitGetKeyValueCommand(IsMarshallableInterceptor.java:97)
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:62)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:120)
at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:128)
at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:92)
at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:96)
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:62)
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:343)
at org.infinispan.CacheImpl.containsKey(CacheImpl.java:372)
at org.infinispan.DecoratedCache.containsKey(DecoratedCache.java:410)
at com.abcr.ServiceContext.existsInSyncCache(ServiceContext.java:1740)
at com.abcr.ServiceContext.getObjectForUpdateInSyncCache(ServiceContext.java:1778)
at com.abcr.core.cache.ClusterServiceNodeListCacheManager.getObjectForUpdate(ClusterServiceNodeListCacheManager.java:90)
at com.suntecgroup.tbms.tpe.core.server.ServerManager.callBackOnMembersModified(ServerManager.java:3385)
at com.abcr.core.ServiceContainerCommandDespatcher.run(ServiceContainerCommandDespatcher.java:64)
2020-05-06 18:50:28,086 ERROR [com.abcr.core.ServiceContainer] Invocation of callback APIs on leaving coordinator role failed for service 'ABC'.
com.suntecgroup.tbms.container.services.ContainerPlatformServicesException: Failed to retrieve object[SERVER/SERVICE_NODES/28000] for update.
This my infinspan and jgroups configuration
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:5.3 http://www.infinispan.org/schemas/infinispan-config-5.3.xsd"
xmlns="urn:infinispan:config:5.3">
<global>
<!-- Note that if these are left blank, defaults are used. See the user guide for what these defaults are -->
<asyncListenerExecutor factory="org.infinispan.executors.DefaultExecutorFactory">
<properties>
<property name="maxThreads" value="5" />
<property name="threadNamePrefix" value="AsyncListenerThread" />
</properties>
</asyncListenerExecutor>
<asyncTransportExecutor factory="org.infinispan.executors.DefaultExecutorFactory">
<properties>
<property name="maxThreads" value="25" />
<property name="threadNamePrefix" value="AsyncSerializationThread" />
</properties>
</asyncTransportExecutor>
<evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
<properties>
<property name="threadNamePrefix" value="EvictionThread" />
</properties>
</evictionScheduledExecutor>
<replicationQueueScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
<properties>
<property name="threadNamePrefix" value="ReplicationQueueThread" />
</properties>
</replicationQueueScheduledExecutor>
<globalJmxStatistics enabled="false" jmxDomain="infinispan_1" />
<!--
If the transport is omitted, there is no way to create distributed or clustered caches.
There is no added cost to defining a transport but not creating a cache that uses one, since the transport
is created and initialized lazily.
-->
<transport clusterName="PC_SITE_1" distributedSyncTimeout="50000" transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport">
<properties>
<property name="configurationFile" value="./tmp/_clusterconfig/pc_jgroups_main_sync.xml" />
</properties>
</transport>
<!-- Note that the JGroups transport uses sensible defaults if no configuration property is defined. -->
<!-- See the JGroupsTransport javadocs for more flags -->
<!-- Again, sensible defaults are used here if this is omitted. -->
<serialization marshallerClass="org.infinispan.marshall.VersionAwareMarshaller" version="1.0" />
<!--
Used to register JVM shutdown hooks.
hookBehavior: DEFAULT, REGISTER, DONT_REGISTER
-->
<shutdown hookBehavior="DEFAULT" />
</global>
<!-- *************************** -->
<!-- Default "template" settings -->
<!-- *************************** -->
<!-- this is used as a "template" configuration for all caches in the system. -->
<default>
<!--
isolation levels supported: READ_COMMITTED and REPEATABLE_READ
-->
<locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="60000" writeSkewCheck="false" concurrencyLevel="5000" useLockStriping="false" />
<!--
Used to register a transaction manager and participate in ongoing transactions.
-->
<!-- ECPCacheTxManagerLookup -->
<!--
Used to register JMX statistics in any available MBean server
-->
<jmxStatistics enabled="false" />
<!--
Used to enable invocation batching and allow the use of Cache.startBatch()/endBatch() methods.
-->
<clustering mode="replication">
<sync replTimeout="600000" />
<stateTransfer timeout="480000" fetchInMemoryState="true" />
</clustering>
<storeAsBinary enabled="true" />
</default>
<namedCache name="GLOBAL_SYNC_CACHE">
<transaction transactionMode="TRANSACTIONAL" transactionManagerLookupClass="com.suntecgroup.tbms.container.services.cluster.ContainerCacheTxManagerLookup" syncRollbackPhase="false" syncCommitPhase="true" useEagerLocking="true" lockingMode="PESSIMISTIC" />
</namedCache>
<namedCache name="GLOBAL_NONTX_SYNC_CACHE">
<transaction transactionMode="NON_TRANSACTIONAL" />
</namedCache>
</infinispan>
JGROUPS configuration..
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="urn:org:jgroups" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:org:jgroups file:schema/JGroups-2.8.xsd">
<TCP bind_port="7800" loopback="true" recv_buf_size="20M" send_buf_size="640K" max_bundle_size="64000" max_bundle_timeout="30" enable_bundling="false" use_send_queues="true" sock_conn_timeout="300" tcp_nodelay="true" thread_pool.enabled="true" thread_pool.min_threads="1" thread_pool.max_threads="25" thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="false" thread_pool.queue_max_size="100" thread_pool.rejection_policy="run" oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000" oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="run" enable_diagnostics="false" />
<!--MPING mcast_addr="232.1.2.13"
mcast_port="7500"
num_initial_members="2"
timeout="2000" /-->
<TCPPING timeout="3000" initial_hosts="${jgroups.tcpping.initial_hosts:localhost[7800],localhost[7801]}" port_range="0" num_initial_members="3" />
<MERGE2 max_interval="100000" min_interval="20000" />
<FD_SOCK />
<FD timeout="60000" max_tries="5" />
<VERIFY_SUSPECT timeout="30000" />
<BARRIER />
<pbcast.NAKACK use_mcast_xmit="false" exponential_backoff="500" discard_delivered_msgs="true" />
<UNICAST timeout="300,600,1200" />
<pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" max_bytes="400000" />
<pbcast.GMS print_local_addr="false" join_timeout="3000" view_bundling="true" />
FRAG2 frag_size="60000"
pbcast.STATE_TRANSFER
</config>
Current transaction was aborted (probably due to a timeout, but maybe as a consequence of delivery failure). You need to rollback current transaction and start new.
However let me note that 5.3 was released 2013/06/26 - you're using almost 7 years old version. If there is a bug, no-one will even try to check it out.

Does xliff 1.2 supports custom annotations

I am working on a sample file in Xliff 1.2 but confused with annotation.As I didnot find anywhere whether it supports custom annotation or not?
Can anyone refer links for sample xliff1.2 file with annotations(if it supports any kind of annotations)
Thanks
you can read more about this in the following link:
http://docs.oasis-open.org/xliff/v1.2/cs02/xliff-core.html#note
This is an example:
<xliff version="1.2">
<file original="Graphic Example.psd"
source-language="en-US" target-language="ja-JP"
tool="Rainbow" datatype="photoshop">
<header>
<skl>
<external-file uid="3BB236513BB24732" href="Graphic Example.psd.skl"/>
</skl>
<phase-group>
<phase phase-name="extract" process-name="extraction"
tool="Rainbow" date="20010926T152258Z"
company-name="NeverLand Inc." job-id="123"
contact-name="Peter Pan" contact-email="ppan#example.com">
<note>Make sure to use the glossary I sent you yesterday.
Thanks.</note>
</phase>
</phase-group>
</header>
<body>
<trans-unit id="1" maxbytes="14">
<source xml:lang="en-US">Quetzal</source>
<target xml:lang="ja-JP">Quetzal</target>
</trans-unit>
<trans-unit id="3" maxbytes="114">
<source xml:lang="en-US">An application to manipulate and
process XLIFF documents</source>
<target xml:lang="ja-JP">XLIFF 文書を編集、または処理
するアプリケーションです。</target>
</trans-unit>
<trans-unit id="4" maxbytes="36">
<source xml:lang="en-US">XLIFF Data Manager</source>
<target xml:lang="ja-JP">XLIFF データ・マネージャ</target>
</trans-unit>
</body>
</file>
</xliff>

Spring Webflow - IllegalStateException when using multipart/form-data and file upload

I am trying to add file upload to my Spring Webflog form processing. As far as the form enctype is not set to multipart/form-data, form submition works just fine. But after I added enctype="multipart/form-data" to my Spring form, this Exception occurs:
java.lang.IllegalStateException: A flow execution action URL can only be obtained in a RenderRequest or a ResourceRequest
at org.springframework.webflow.context.portlet.PortletExternalContext.getFlowExecutionUrl(PortletExternalContext.java:215)
at org.springframework.webflow.engine.impl.RequestControlContextImpl.getFlowExecutionUrl(RequestControlContextImpl.java:178)
at org.springframework.webflow.mvc.view.AbstractMvcView.render(AbstractMvcView.java:189)
at org.springframework.webflow.engine.ViewState.render(ViewState.java:293)
at org.springframework.webflow.engine.ViewState.refresh(ViewState.java:242)
at org.springframework.webflow.engine.ViewState.resume(ViewState.java:220)
at org.springframework.webflow.engine.Flow.resume(Flow.java:537)
at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:259)
at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:169)
at org.springframework.webflow.mvc.portlet.FlowHandlerAdapter.handleAction(FlowHandlerAdapter.java:161)
at org.springframework.web.portlet.DispatcherPortlet.doActionService(DispatcherPortlet.java:670)
at org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:520)
at org.springframework.web.portlet.FrameworkPortlet.processAction(FrameworkPortlet.java:461)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:71)
I have added CommonsMultipartResolver to my spring context:
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- Limit uploads to one byte smaller than the server is allowed to handle -->
<property name="maxUploadSize" value="100000" />
</bean>
and have commons-fileupload.jar in my pom.xml:
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.2</version>
</dependency>
My JSP looks like this:
<portlet:actionURL var="processFormAction" >
<portlet:param name="execution" value="${flowExecutionKey}"/>
</portlet:actionURL>
<form:form action="${processFormAction}" modelAttribute="customerModel" enctype="multipart/form-data" method="post" >
<form:input path="firstName" cssClass="input-size-1 valid-required" />
<form:input path="lastName" cssClass="input-size-1 valid-required" />
<input name="avatar" id="avatar" type="file"/>
<input type="submit" name="_eventId_submit" id="send" value="Submit"/>
</form:form>
My flow.xml definition:
<view-state id="state1" model="customerModel">
...
<transition on="submit" to="submitFormActions"/>
</view-state>
<action-state id="submitFormActions">
<evaluate expression="portletAction.processForm(customerModel, flowRequestContext)" />
<transition on="success" to="state2"/>
<transition on="error" to="state1" />
</action-state>
The model object:
public class CustomerModel implements Serializable{
private String firstName;
private String lastName;
private MutlipartFile avatar;
...
//public getters and setters
}
Any thoughts what could be wrong? As I said, without enctype="multipart/form-data" the form processing works well.
Thanks
You are using org.springframework.web.multipart.commons.CommonsMultipartResolver which is not aware about the portlet context.
You need to change CommonsMultipartResolver to:
<bean id="portletMultipartResolver"
class="org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver">
<!-- one of the properties available; the maximum file size in bytes -->
<property name="maxUploadSize" value="100000"/>
</bean>
Also, for this bean to be recognised by DispatcherPortlet, you need to define this bean id as mentioned above. The doc says:
Any configured PortletMultipartResolver bean must have the following id (or name): "portletMultipartResolver".
If you have defined your PortletMultipartResolver with any other name, then the DispatcherPortlet will not
find your PortletMultipartResolver, and consequently no multipart support will be in effect.

background image somehow covers up all the controls adobe flash builder 4.6

I created a skin using an image as background.
When my View imported the skin as skinClass, it covers up all the other controls.
How do i make all the controls display above the skin?
This is my Skin code called Background.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark">
<!-- host component -->
<fx:Metadata>
[HostComponent("spark.components.supportClasses.SkinnableComponent")]
</fx:Metadata>
<s:Image source="assets/Sunflower.gif" smooth="true" left="0" right="0" top="0" bottom="0">
</s:Image>
<s:states>
<s:State name="normal" />
</s:states>
</s:Skin>
This is the main view under default package
<?xml version="1.0" encoding="utf-8"?>
<s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="160"
skinClass="BackgroundImage"
>
<s:ViewNavigator label="Add" width="100%" height="100%" firstView="views.AddView"/>
<s:ViewNavigator label="List" width="100%" height="100%" firstView="views.ListView"/>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:TabbedViewNavigatorApplication>
It looks like your Z index should be adjusted for the controls.
You can change your z-index like this:
parent.setChildIndex(childObject, i)
So for example if you want your controls to always be on front you need:
myControls.parent.setChildIndex(myControls, myControls.parent.numChildren -1)
Hope this helps you, even tho it's hard to answer it without any code...