I want to add a file upload html element in my process definition's start even in form.
<startEvent id="start" name="Start">
<extensionElements>
<activiti:formProperty id="name" name="Name"
type="string" required="true" />
<activiti:formProperty id="emailAddress" name="Email Address"
type="string" required="true" />
<activiti:formProperty id="income" name="Income"
type="long" required="true" />
<activiti:formProperty id="loanAmount" name="Loan Amount"
type="long" required="true" />
</extensionElements>
</startEvent>
I want to add a file uploader at the end to take file from user and process it further. I tried using file data type but of no use. Please guide as to how can I add a file element here.
Thanks
Append this for an upload field:
<activiti:formProperty id="attachfile" name="Atatch File"
type="upload" required="true" />
Related
I'm trying to create a simple Visual Studio Extension using Visual Studio 2017 that adds commands to the project context menu in the Solution Explorer. I'd like to add my commands grouped together in a main option and then from that main option I would like my commands to be accessible, just like how the Add->New item, Add->Existing item, Add->Class etc. works for in the context menu of the project.
After going through the documentation here's what I have come up with so far for my vsct file:
<Commands package="guidMainItemPackage">
<Groups>
<Group guid="guidMainItemPackageCmdSet" id="MyMenuGroup" priority="0x0600" />
<Group guid="guidMainItemPackageCmdSet" id="SubMenuGroup" priority="0x0601" />
</Groups>
<Buttons>
<Button guid="guidMainItemPackageCmdSet" id="MainItemId" priority="0x0100" type="Button">
<Parent guid="guidMainItemPackageCmdSet" id="MyMenuGroup" />
<Icon guid="guidImages" id="bmpPic1" />
<Strings>
<ButtonText>Invoke MainItem</ButtonText>
</Strings>
</Button>
<Button guid="guidMainItemPackageCmdSet" id="cmdidSubItem" priority="0x0101" type="Button">
<Parent guid="guidMainItemPackageCmdSet" id="SubMenuGroup" />
<Icon guid="guidImages1" id="bmpPic1" />
<Strings>
<ButtonText>Invoke SubItem</ButtonText>
</Strings>
</Button>
</Buttons>
<Bitmaps>
<Bitmap guid="guidImages" href="Resources\MainItem.png" usedList="bmpPic1, bmpPic2, bmpPicSearch, bmpPicX, bmpPicArrows, bmpPicStrikethrough" />
<Bitmap guid="guidImages1" href="Resources\SubItem.png" usedList="bmpPic1, bmpPic2, bmpPicSearch, bmpPicX, bmpPicArrows, bmpPicStrikethrough" />
</Bitmaps>
</Commands>
<CommandPlacements>
<CommandPlacement guid="guidMainItemPackageCmdSet" id="MyMenuGroup" priority="0xFFFF">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_PROJNODE" />
</CommandPlacement>
<CommandPlacement guid="guidMainItemPackageCmdSet" id="SubMenuGroup" priority="0xFFFE">
<Parent guid="guidMainItemPackageCmdSet" id="MyMenuGroup" />
</CommandPlacement>
</CommandPlacements>
<Symbols>
<GuidSymbol name="guidMainItemPackage" value="{30f66380-eeeb-48bf-8554-0d63d87194af}" />
<GuidSymbol name="guidMainItemPackageCmdSet" value="{98ee7e8f-c421-4f0e-a9e9-86eab5141563}">
<IDSymbol name="MyMenuGroup" value="0x1020" />
<IDSymbol name="SubMenuGroup" value="0x1028" />
<IDSymbol name="MainItemId" value="0x0100" />
<IDSymbol value="4129" name="cmdidSubItem" />
</GuidSymbol>
<GuidSymbol name="guidImages" value="{b3c2dfad-df35-4e6b-880e-8018ce6c3d0f}">
<IDSymbol name="bmpPic1" value="1" />
<IDSymbol name="bmpPic2" value="2" />
<IDSymbol name="bmpPicSearch" value="3" />
<IDSymbol name="bmpPicX" value="4" />
<IDSymbol name="bmpPicArrows" value="5" />
<IDSymbol name="bmpPicStrikethrough" value="6" />
</GuidSymbol>
<GuidSymbol value="{93d3ad22-fe33-40da-b85f-a926952e3914}" name="guidImages1">
<IDSymbol name="bmpPic1" value="1" />
<IDSymbol name="bmpPic2" value="2" />
<IDSymbol name="bmpPicSearch" value="3" />
<IDSymbol name="bmpPicX" value="4" />
<IDSymbol name="bmpPicArrows" value="5" />
<IDSymbol name="bmpPicStrikethrough" value="6" />
</GuidSymbol>
</Symbols>
So basically I have created added two Custom commands to my project, a button for each of the commands, a group for each of the buttons and a commandplacement for each of the groups (everything else is just the default generated vsct template).
My problem is that using the code above, on the first command is displayed and it has no subitems. What would be the correct vsct content to achieve the desired layout?
After some more trial and error (mostly error), I decided to go through the command definitions of Visual Studio itself to find a similar group of commands, and I've finally came up with the answer. Here's the steps you need to take to realize this structure:
Create a group and set the parent of this group to the Visual Studio projects context menu.
Create a menu, whose parent is the group created in step 1.
Create a second group, whose parent is the menu created in step 2.
Create buttons for only the subitems.
Create commandplacements for the subitems created in step 4 where you place each button in the group created in step 3.
I have created an index that pulls data from a SQL Server database using TikaEntityProcessor. The query associated with my configuration file pulls from a table containing file information, as well as the file content as a binary column. My index returns all fields from the database table in which I have configured, as well as the column for "text" that is the body of the file content. It correctly indexes the file text! However, the meta columns are not working! You can see I have a field for text/body, this works fine. However, I cannot get any metadata from the file such as last modified date or author.
Any suggestions would be greatly appreciated!!
data-config:
<dataConfig>
<dataSource type="JdbcDataSource"
driver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://server;databaseName=db1;integratedSecurity=false"
user="user"
password="XXXXXX" convertType="false"
name="ds"/>
<dataSource name="fieldReader"
type="FieldStreamDataSource" />
<document name="tika">
<entity name="tika" pk="id" transformer="TemplateTransformer" dataSource="ds"
query="select id, title from myDatabaseTable">
<entity name="tika-test" processor="TikaEntityProcessor" dataSource="fieldReader"
dataField="tika.FileContent" format="text">
<field column="text" name="body"/>
<field column="Last-Modified" name="lastModified" meta="true" /> <!-- not working -->
</entity>
</entity>
</document>
</dataConfig>
schema:
<field name="id" type="integer" indexed="true" stored="true" />
<field name="body" type="text" indexed="true" stored="true" />
<field name="lastModified" type="text" indexed="true" stored="true" />
<field name="title" type="text" indexed="true" stored="true" />
Thanks!!
Q: What syntax should i use to exclude a component when submitting a form using primefaces?
Using the process attribute i know how to include components.
<h:inputText id="included"/>
<p:commandButton value="button" process="included" actionListener="#{myBean.doStuff}/>
I've been trying to play around with syntax similiar to what is used in the answer here: How to exclude child component in ajax update of a parent component? but cant get it to work
<h:inputText id="notIncluded" styleClass="notIncluded"/>
<p:commandButton ... process="#(form :not(.notIncluded))"/>
Edit (doing the homework and adding an actual working example):
On glassfish 3.1.2.2 and primefaces 3.4.2
When i looked further, the exclusion works fine inside h:panelGrid
<h:form id="aForm">
<h:panelGrid columns="2">
<p:inputText id="inc" styleClass="included" required="true" />
<p:message for="inc" />
<p:inputText id="notInc" styleClass="notIncluded" required="true" />
<p:message for="notInc" />
<p:commandButton value="submit" process="#(form :not(.notIncluded))"
update=":aForm" />
</h:panelGrid>
</h:form>
But is no longer excluded inside a similar p:panelGrid
<h:form id="aForm">
<p:panelGrid columns="2">
<p:inputText id="inc" styleClass="included" required="true" />
<p:message for="inc" />
<p:inputText id="notInc" styleClass="notIncluded" required="true" />
<p:message for="notInc" />
<p:commandButton value="submit" process="#(form :not(.notIncluded))"
update=":aForm" />
</p:panelGrid>
</h:form>
I have checked your examples, if you review page source your will notice that p:panelGrid creates table with id. Little bit strange but jQuery selector doesnt access childs when table has an id. If I remove table Id then button works fine. So my solution was giving an id to panelGrid and using this id in selector. p:panelGrid will give same id to table but you need to make sure you add prependId="false" attribute into your h:form:
<h:form id="aForm" prependId="false">
<p:panelGrid columns="2" id="myGrid">
<p:inputText id="inc" styleClass="included" required="true" />
<p:message for="inc" />
<p:inputText id="notInc" styleClass="notIncluded" required="true" />
<p:message for="notInc" />
<p:commandButton value="submit" process="#(#myGrid :not(.notIncluded))"
update=":aForm" />
</p:panelGrid>
</h:form>
The code
<cfheader name="Test" value="1">
<cfheader name="Test" value="2">
results in the header "Test: 2" being sent to the browser (as seen using HttpFox).
Is there a way for the second line of code to determine if a header with the same name has already been written using CFHEADER?
Thanks!
What version of ColdFusion are you using? When I run your code on ColdFusion 9, I get the header value (As seen using FireBug):
test: 1, 2
As for whether or not you can tell what, if any, existing values there might be for the response header, I haven't yet found a way. I'll keep looking, though.
Update: Found it.
getPageContext().getResponse().containsHeader("test")
For example:
<cfif getPageContext().getResponse().containsHeader("test") eq "NO">
<cfheader name="test" value="2" />
</cfif>
Can't help with exact task of checking the headers, but I'd tried to implement the header facade to handle the headers sending and tracking the history of alredy processed items.
It can be as simple as UDF wrapper, like this one:
<!--- this should be somewhere on request start --->
<cfset request.headers = {} />
<!--- wrapper for cfheader --->
<cffunction name="SendHeader" returntype="void" output="false">
<cfargument name="name" type="string" required="true" hint="Header name">
<cfargument name="value" type="string" required="true" hint="Header value">
<cfif NOT StructKeyExists(request.headers, arguments.name)>
<cfset request.headers[arguments.name] = arguments.value />
<cfheader name="#arguments.name#" value="#arguments.value#" />
</cfif>
</cffunction>
I have a Consumer class and a BillableConsumer : Consumer class. When trying to do any operation on my "Consumers" set, I get the error message "Object mapping could not be found for Type with identity Models.BillableConsumer.
From the CSDL:
<EntityType Name="BillableConsumer" BaseType="Models.Consumer">
<Property Type="String" Name="CardExpiratoin" Nullable="false" />
<Property Type="String" Name="CardNumber" Nullable="false" />
<Property Type="String" Name="City" Nullable="false" />
<Property Type="String" Name="Country" Nullable="false" />
<Property Type="String" Name="CVV" Nullable="false" />
<Property Type="String" Name="NameOnCard" Nullable="false" />
<Property Type="String" Name="PostalCode" Nullable="false" />
<Property Type="String" Name="State" />
<Property Type="String" Name="StreetAddress" Nullable="false" />
</EntityType>
From the C-S:
<EntitySetMapping Name="Consumers">
<EntityTypeMapping TypeName="IsTypeOf(Models.Consumer)">
<MappingFragment StoreEntitySet="consumer">
<ScalarProperty Name="LoginID" ColumnName="LoginID" />
<ScalarProperty Name="FirstName" ColumnName="FirstName" />
<ScalarProperty Name="LastName" ColumnName="LastName" />
</MappingFragment>
</EntityTypeMapping>
<EntityTypeMapping TypeName="IsTypeOf(Models.BillableConsumer)">
<MappingFragment StoreEntitySet="billinginformation">
<ScalarProperty Name="CardExpiratoin" ColumnName="CardExpiratoin" />
<ScalarProperty Name="CardNumber" ColumnName="CardNumber" />
<ScalarProperty Name="City" ColumnName="City" />
<ScalarProperty Name="Country" ColumnName="Country" />
<ScalarProperty Name="CVV" ColumnName="CVV" />
<ScalarProperty Name="LoginID" ColumnName="LoginID" />
<ScalarProperty Name="NameOnCard" ColumnName="NameOnCard" />
<ScalarProperty Name="PostalCode" ColumnName="PostalCode" />
<ScalarProperty Name="State" ColumnName="State" />
<ScalarProperty Name="StreetAddress" ColumnName="StreetAddress" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
Is this because I did not specifically add the BillableConsumer entity to the object set? How do I do that in a POCO scenario?
If you notice in my CSDL there is a column called "CardExpiratoin" (spelling mistake in DB column name). Of course my class which was hand-coded did not have this spelling mistake.
The way I found the problem is by generating POCOs from the T4 template, seeing it worked, and working my way back from there. Hope this helps anyone with the same problem. I also wish the error was a bit clearer to begin with.
I was experiencing this problem as well, and in my case it was also because of an error in a hand written POCO class. In most of the cases, you get an informational error messages, but as it seems in some rare cases you get something vague like 'Object mapping could not be found'.
In my particular case, there were columns of type VARCHAR(1) in the database, which I incorrectly mapped to char. I didn't try char?, but mapping to string certainly resolved the problem.