Izpack toggel Checkbox on Install Location - java

I have a checkbox for Windows Service installation in a UserInput Panel and i would want to make this dependent with the installation path.
If the installation path is local drive, then the "install windows service" checkbox should appear.
But if the installation path is a Network Shared location or a mounted Drive , the checkbox shouldnt appear.
For this i tried using Dynamic variable along with a Condition
Here is the snippet from install.xml
<conditions>
<condition type="variable" id="install.path.condition">
<name>$INSTALL_PATH</name>
<value>//</value>
</condition>
</conditions>
<dynamicvariables>
<variable name="windowsservice" value="false" condition="install.path.condition" />
<variable name="windowsservice" value="true" condition="!install.path.condition" />
</dynamicvariables>
The target field in install_userinputspec.xml
<field align="left" type="check" variable="windowsservice" conditionid="install.path.condition" revalidate="true">
<os family="windows"/>
<spec txt="Install as Windows Service" id="windowsServiceCheckbox" true="on" false="off"
set="false" />
</field>
I tried my luck getting this work, but it wont. Please help

Change $INSTALL_PATH to INSTALL_PATH
<name>INSTALL_PATH</name>
If you're not sure about the exact value that will be entered for the INSTALL_PATH then instead of using a condition of type="variable" use type="contains"with a nested <variable> tag, such as:
<condition type="contains" id="...">
<variable>INSTALL_PATH</variable>
<value>a substring to match in the value of INSTALL_PATH</string>
</condition>
IzPack doc contains cond.
Use revalidate="yes" as an attribute of the <spec> tag and not the <field> tag itself.
First, try to make your <condition> work. Once you've tested that, the check field can be linked to the condition directly for enabling/disabling and as such, you do not need to use <dynamicvariables> in this case, unless you need it for something other than checkbox-enable-disable-based-by-INSTALL_PATH.

Related

Aspect name in Alfresco showing up as undefined in 'Manage Aspect'

I was working with Alfresco-entreprise 4.1.1.3 and i moved to alfresco-community 5.0.2.
In this migration i copied all the config files of my custom aspects to the same locations as it was in
Alfresco-entreprise 4.1.1.3
I have set them to visible in share UI and I can see them in the share UI.
The problem is that when I right click on a site or folder and choose 'Manage Aspect', i see that the aspect name is listed as
undefined (gifapidocument:MyAspect)
I am not sure why it is showing up as undefined. When I click on manage rules -> add aspect , I see that the name is showing up correctly.
When i try to add a document to Alfresco from my application it works but the document is added without any properties and empty Aspects.
the paths of my configs are :
share-config-custom.xml : ./tomcat/shared/classes/alfresco/web-extension
In <alfresco-config><config><aspects><visible>, i added :
<aspect name="gifapidocument:*MyAspect*" />
In <alfresco-config><config><forms><form>, i added :
<field-visibility>
<show id="gifapidocument:typeDocumentXXXX" />
</field-visibility>
<field-visibility>
<show id="gifapidocument:idXXXXXXXX" />
</field-visibility>
another path of my configs :
myAppDocument-model.xml : ./tomcat/shared/classes/alfresco/extension/myApp/model
In <model><aspects>, i added :
<aspect name="gifapidocument:*MyAspect*">
<properties>
<property name="gifapidocument:typeDocumentXXXX">
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="gifapidocument:idXXXXXXXX">
<type>d:text</type>
<mandatory>false</mandatory>
</property>
</properties>
</aspect>
and finaly :
myApp.properties : ./tomcat/shared/classes/alfresco/extension/myApp/messages
i added :
aspect.gifapidocument_*myAspect*=GIF-API-MYAPP-*myAspect*
u can check yours aspects with:
yourhost/api/-default-/public/alfresco/versions/1/nodes/{{uiid}
it is shown in this properties"aspectNames": []
in my case when i click to manage aspect i cant see any thing in share but the aspect is added correctly.
Could the asterisks be in the name of aspect?

How to expand non-entity reference in xml file with Ant

I have an XML file with the following content:
<root-tag>
<entry name="name1" value="/usr/bin" />
<entry name="full_path" value="${name2}" />
<entry name="name2" value="${name1}/dpkg" />
</root-tag>
I want to read this file in Ant and put the attribute value of value in the <entry> node whose name value is "full_path" into a property with Ant.
I can easily do this, e.g. using <xmltask> with its <copy> element:
<copy path="root-tag/entry[#name='full_path']/#value" property="outputProperty" />
However, what I get is ${name2}, which is meaningless to me. I need ${name2} to be resolved into the ${name1}/dpkg and then the ${name1} part is resolved into /usr/bin, as a result, /usr/bin/dpkg.
And I must look for "full_path" because the other two names can't be predicted.
Since this is not entity reference, <xmltask> can't automatically expand it.
How should I achieve my goal in Ant build file?
You can use anttask propertycopy for the same.
Refer link - http://ant-contrib.sourceforge.net/tasks/tasks/propertycopy.html

alfresco community edition-5.1.x workflow drop-down field multi select value

I am new to alfresco community edition-5.1.x ,I have created workflow activiti using kick-start after deployed alfresco work-flow activti is working successfully. In work-flow form drop-down fields i used is this possible to select multiple value please help me out
You should be able to define drop down fields in your share custom config form declarations:
<config evaluator="task-type" condition="mytaskmodel:mytask">
<forms>
<form>
<field-visibility>
<show id="mytaskmodel:myproperty" />
</field-visibility>
<appearance>
<field id="mytaskmodel:myproperty" />
<control template="/org/alfresco/components/form/controls/selectone.ftl">
<control-param name="options">1|valueone,2|value2</control-param>
</control>
</field>
</appearance>
</form>
</forms>
</config>

How to add Drag and Drop over SWT CommonNavigator

I have a CommonNavigator view and unable to add drag and drop support on it by tradition way of addDrag&Dropsupport method.
I want to drop some files from File Systen over the CommonNavigator.
After searching I found , I just needed to hook the dropAgent and it will work. So I did like following-
point="org.eclipse.ui.navigator.navigatorContent">
<navigatorContent
contentProvider="com.infineon.stt.session.explorer.ui.SessionContentProvider"
id="com.infineon.stt.session.explorer.ui.navigatorContent"
labelProvider="com.infineon.stt.session.explorer.ui.SessionLabelProvider"
name="Session Navigation Content">
<dropAssistant
class="com.infineon.stt.session.explorer.ui.ResourceDropAdapterAssistant"
id="org.eclipse.ui.navigator.resources.resourceDropAdapter">
<possibleDropTargets>
<or>
<adapt type="org.eclipse.core.resources.IProject"/>
<adapt type="org.eclipse.core.resources.IFolder"/>
<adapt type="org.eclipse.core.resources.IFile"/>
<adapt type="org.eclipse.core.resources.IWorkspaceRoot"/>
</or>
</possibleDropTargets>
</dropAssistant>
<triggerPoints>
<instanceof
value="com.infineon.stt.session.model.SessionRoot">
</instanceof>
</triggerPoints>
</navigatorContent>
But even it didn't work.
Any suggestion to make the scenario work.
I followed up this example-
https://github.com/aptana/studio3/blob/4cada2cfef2969d11bd62fcce7d630a05b6cab64/plugins/com.aptana.explorer/plugin.xml
The solution was very simple.
I was committing a mistake of restricting the drag and drop to specific type.
To allow any kind if Object , I just need to pass possibledroptarget as object-
<possibleDropTargets>
<or>
<adapt type="java.lang.Object"/>
</or>
</possibleDropTargets>

How do I make JPA POJO classes + Netbeans forms play well together?

I started using netbeans to design forms to edit the instances of various classes I have made in a small app I am writing. Basically, the app starts, an initial set of objects is selected from the DB and presented in a list, then an item in the list can be selected for editing. When the editor comes up it has form fields for many of the data fields in the class.
The problem I run into is that I have to create a controller that maps each of the data elements to the correct form element, and create an inordinate number of small conversion mapping lines of code to convert numbers into strings and set the correct element in a dropdown, then another inordinate amount of code to go back and update the underlying object with all the values from the form when the save button is clicked.
My question is; is there a more directly way to make the editing of the form directly modify the contents of my class instance? I would like to be able to have a default mapping "controller" that I can configure, then override the getter/setter for a particular field if needed. Ideally, there would be standard field validation for things like phone numbers, integers, floats, zip codes, etc...
I'm not averse to writing this myself, I would just like to see if it is already out there and use the right tool for the right job.
There are many approaches,
JBoss Seam, for instance, uses an Ant (And whether you do not know, NetBeans uses Ant behind the scenes) tool called hbmtemplate. It is a Template based Engine in which can be controlled by a user provided template or class. Along with Freemarker Template (.flt extension), it generates all of Application. If you want to see how see how Seam generates its Applications, Take a look at <SEAM_HOME>/seam-gen/view. There, you can see o lot of Freemarker Template.
Here is how Seam generates its Application
<hibernate templatepath="${templates.dir}">
<jpaconfiguration persistenceunit="${project.name}"/>
<classpath>
<dirset dir="${project.home}/exploded-archives">
<include name="*.war/WEB-INF/classes" if="project.war"/>
<include name="*.war/WEB-INF/dev" if="project.war"/>
<include name="*.jar" if="project.ear"/>
</dirset>
</classpath>
<property key="hibernatetool.util.toolclass" value="org.jboss.seam.tool.Util"/>
<hbmtemplate filepattern="{class-name}List.xhtml" template="view/list.xhtml.ftl" destdir="${project.home}/view" foreach="entity"/>
<hbmtemplate filepattern="{class-name}.xhtml" template="view/view.xhtml.ftl" destdir="${project.home}/view" foreach="entity"/>
<hbmtemplate filepattern="{class-name}.page.xml" template="view/view.page.xml.ftl" destdir="${project.home}/view" foreach="entity"/>
<hbmtemplate filepattern="{class-name}Edit.xhtml" template="view/edit.xhtml.ftl" destdir="${project.home}/view" foreach="entity"/>
<hbmtemplate filepattern="{class-name}Edit.page.xml" template="view/edit.page.xml.ftl" destdir="${project.home}/view" foreach="entity"/>
<hbmtemplate filepattern="${action.dir}/{class-name}List.java" template="src/EntityList.java.ftl" destdir="${project.home}/src" foreach="entity">
<property key="actionPackage" value="${action.package}"/>
</hbmtemplate>
<hbmtemplate filepattern="{class-name}List.page.xml" template="view/list.page.xml.ftl" destdir="${project.home}/view" foreach="entity"/>
<hbmtemplate filepattern="${action.dir}/{class-name}Home.java" template="src/EntityHome.java.ftl" destdir="${project.home}/src" foreach="entity">
<property key="actionPackage" value="${action.package}"/>
</hbmtemplate>
<hbmtemplate filepattern="menu.xhtml" template="view/layout/menu.xhtml.ftl" destdir="${project.home}/view/layout" foreach="entity"/>
</hibernate>
Here goes some code, not all, from FreeMarket Template view.xhtml.ftl
<#foreach property in pojo.allPropertiesIterator>
<#if !c2h.isCollection(property) && !isToOne(property) && property != pojo.versionProperty!>
<#include "viewproperty.xhtml.ftl">
</#if>
</#foreach>
I hope it can be useful to you
See my answer to your other question here. (In short: using beans binding would help a bit I hope)

Categories

Resources