Questions asked by ahatiushttps://answers.axonivy.com/questions/asked-by/27/ahatius/?type=rssQuestions asked by <a href="/users/27/ahatius" >ahatius</a>enThu, 27 Nov 2014 08:25:46 -0500Get link to process of another projecthttps://answers.axonivy.com/questions/1061/get-link-to-process-of-another-project<p><code>ivy.html.startref</code> allows me to get a link to another process starts. Unfortunately this only seems to work within the same project.</p> <p>Is there any way I can get a link to the process start of another project? Using <code>ivy.html.startref("Projectname/Processname/startName.ivp")</code> or <code>ivy.html.startref("../Projectname/Processname/startName.ivp")</code> don't seem to work.</p>ahatiusThu, 27 Nov 2014 08:25:46 -0500https://answers.axonivy.com/questions/1061/get-link-to-process-of-another-projectprocessprojectdesignerAccess IHttpRequest objecthttps://answers.axonivy.com/questions/1055/access-ihttprequest-object<p>Is there any way I can gain access to the object that implements <a href="http://developer.axonivy.com/doc/5.1.latest/publicApi/ch/ivyteam/ivy/request/IHttpRequest.html">IHttpRequest</a> so that I can eventually get the <code>HttpServletRequest</code> object?</p> <p>I'd like to be able to read HTTP-Headers from within the application (I'm not talking about GET or POST parameters, I want the HTTP Headers). The <code>ivy.request</code> object only enables me access to the GET parameters.</p>ahatiusWed, 26 Nov 2014 14:23:22 -0500https://answers.axonivy.com/questions/1055/access-ihttprequest-objectserverLabels in process titlehttps://answers.axonivy.com/questions/1046/labels-in-process-title<p>Is there any way I can use labels from the cms as process title? When I insert a label, it'll just show the plain code, instead of getting the actual value.</p> <p>We have users that speak German, French and Italian - I had this issue already on Ivy 4.3 but I was hoping that there would have been a solution for this issue with 5.1. Do I have to do something special in order to get it working?</p>ahatiusMon, 24 Nov 2014 18:10:49 -0500https://answers.axonivy.com/questions/1046/labels-in-process-titledesignerMail simulation on serverhttps://answers.axonivy.com/questions/1045/mail-simulation-on-server<p>The Designer provides the function to test the mail step - it always sends the mail to the developer but shows to who it should have been sent.</p> <p>Is there any way I can get this behaviour on the server? After testing everything on the designer, I'd like to test everything on the server - unfortunately this would send each mail to the real person which would be a bit annoying.</p>ahatiusMon, 24 Nov 2014 15:06:52 -0500https://answers.axonivy.com/questions/1045/mail-simulation-on-serverserverselectOneMenu: Value will not be sethttps://answers.axonivy.com/questions/576/selectonemenu-value-will-not-be-set<p>I've got a dropdown menu, which gets the persons from our LDAP server. What I basically did was copying the SelectOneMenuDemo from the Demo files.</p> <p>However, it's displaying all persons correctly in the dropdown, but it won't set the selected person to my <em>data.manager</em>.</p> <p>This is the code from the demo:</p> <blockquote> <p>&lt;p:selectonemenu value="#{data.selectedPerson}" converter="ivy.ListItem"&gt;<br> &lt;f:selectitem itemlabel="Select One" itemvalue=""/&gt;<br> &lt;f:selectitems value="#{data.persons}" var="it" itemvalue="#{it}" itemlabel="#{it.name}"&gt;&lt;/f:selectitems&gt; &lt;f:selectitems value="#{data.morePersons}" var="it" itemvalue="#{it}" itemlabel="#{it.name}"&gt;&lt;/f:selectitems&gt; &lt;f:selectitem itemvalue="#{data.onePerson}" itemlabel="#{data.onePerson.name}"&gt;&lt;/f:selectitem&gt; &lt;/p:selectonemenu&gt; </p> </blockquote> <p>And this is what I wrote:</p> <blockquote> <p>&lt;p:selectonemenu id="manager" value="{data.manager}" converter="ivy.ListItem" style="width: 200px;"&gt; &lt;f:selectitems value="#{data.managers}" var="it" itemvalue="#{it}" itemlabel="#{it.cn}"&gt;&lt;/f:selectitems&gt; &lt;/p:selectonemenu&gt;</p> </blockquote> <p>Is there something I've forgotten? This looks exactly the same to me. Do I have to do something when I submit? I've got a multiview HTML dialog.</p>ahatiusThu, 13 Mar 2014 10:29:21 -0400https://answers.axonivy.com/questions/576/selectonemenu-value-will-not-be-setjsfHow to authenticate a user that is provided by a Single Sign On (SSO) proxy.https://answers.axonivy.com/questions/506/how-to-authenticate-a-user-that-is-provided-by-a-single-sign-on-sso-proxy<p>We've got a SSO-Proxy for most of our web applications. I'd like to make use of the SSO-Proxy instead of requiring the user to login with his Windows credentials.</p> <p>I've figured out how I can read the HTTP header containing the user-id. Now I'd like to authenticate as this user, but all provided methods require a password. Is there anyway I can authenticate a user only by his user-id?</p> <p>This is what I've got to get the user-id:</p> <pre><code>package ch.company.ivy.security; import java.util.Map; import javax.faces.context.FacesContext; public class Auth { Map&lt;String, String&gt; headers; String userId; public Auth() { headers = FacesContext.getCurrentInstance().getExternalContext().getRequestHeaderMap(); userId = headers.get("UID").toString(); } public String getUserId() { return this.userId; } } </code></pre>ahatiusSat, 25 Jan 2014 15:28:14 -0500https://answers.axonivy.com/questions/506/how-to-authenticate-a-user-that-is-provided-by-a-single-sign-on-sso-proxyssoauthenticationuserDynamic amount of fileuploads: file not uploadinghttps://answers.axonivy.com/questions/273/dynamic-amount-of-fileuploads-file-not-uploading<p>I'd like to give the user the ability to choose the amount of attachments he'd like to provide. To do this I created a datatable with buttons to add and remove attachment-lines:</p> <pre><code>&lt;p:dataTable id="attachments" var="attachment" value="#{data.attachments}"&gt; &lt;p:column headerText="#{ivy.cms.co('/labels/vendor')}"&gt;&lt;p:inputText value="#{attachment.vendor}" /&gt;&lt;/p:column&gt; &lt;p:column headerText="#{ivy.cms.co('/labels/description')}"&gt;&lt;p:inputText value="#{attachment.description}" /&gt;&lt;/p:column&gt; &lt;p:column headerText="#{ivy.cms.co('/labels/amount')}"&gt;&lt;p:inputText value="#{attachment.amount}" /&gt;&lt;/p:column&gt; &lt;p:column headerText="#{ivy.cms.co('/labels/attachment')}"&gt;&lt;p:fileUpload value="#{attachment.file}" mode="simple" /&gt;&lt;/p:column&gt; &lt;p:column headerText=""&gt;&lt;p:commandButton value="delete-row" update="attachments" action="#{logic.deleteAttachment(attachment)}" /&gt;&lt;p:commandButton value="add-row" update="attachments" action="#{logic.addAttachment()}" /&gt; &lt;/p:column&gt; &lt;/p:dataTable&gt; </code></pre> <p>The only problem is, that it seems to not upload the specified file. The submitted form is beeing processed by this script, the output of <strong>in.test</strong> beeing <strong>false</strong>:</p> <pre><code>for(Integer i = 0; i &lt; in.attachments.size(); i++) { in.test = in.attachments.get(i).file.exists().toString(); } </code></pre> <p>The Simple-Fileupload-Demo works, so I guess it can't be a problem with my installation / computer. I just cleared all of the attachments and uploaded only one. So while this is a foor loop, it just iterates through 1 time. Data is stored in my own Data Class <strong>Attachment</strong>, containing 4 attributes (Vendor, Description, Amount and File).</p>ahatiusTue, 21 Jan 2014 20:34:00 -0500https://answers.axonivy.com/questions/273/dynamic-amount-of-fileuploads-file-not-uploadingjsffileuploadAutocomplete ignores itemValue attributehttps://answers.axonivy.com/questions/262/autocomplete-ignores-itemvalue-attribute<p>I'd like to build an input field with the autocomplete widget, so the user can search for one of our dealer locations.</p> <p>To do this, I've created a class <strong>Dealer</strong> and a class <strong>AutocompleteSource</strong> which should provide the data structure and the data itself. They look like this:</p> <p><strong>AutocompleteSource.java</strong></p> <pre><code>package ch.company.ivy.investitionsantrag; import java.util.ArrayList; import java.util.List; import ch.company.ivy.investitionsantrag.Dealer; import ch.ivyteam.ivy.environment.Ivy; import com.unboundid.ldap.sdk.LDAPConnection; import com.unboundid.ldap.sdk.LDAPException; import com.unboundid.ldap.sdk.LDAPSearchException; import com.unboundid.ldap.sdk.SearchResult; import com.unboundid.ldap.sdk.SearchResultEntry; import com.unboundid.ldap.sdk.SearchScope; public class AutocompleteSource { public LDAPConnection ldapServer; public AutocompleteSource() throws LDAPException { this.ldapServer = new LDAPConnection(Ivy.var().get("LDAPHost"), Integer.parseInt(Ivy.var().get("LDAPPort"))); ldapServer.bind(Ivy.var().get("LDAPUser"), Ivy.var().get("LDAPPassword")); } public List&lt;Dealer&gt; searchDealers(String query) throws LDAPSearchException { List&lt;Dealer&gt; dealers = new ArrayList&lt;Dealer&gt;(); SearchResult searchResult = this.ldapServer.search("dc=COMPANY,dc=CH", SearchScope.SUB, "(&amp;(|(imDealerNetwork=CHE001)(imDealerNetwork=CHE017)(imDealerNetwork=CHE003)(imDealerNetwork=CHE010))(|(cn=*" + query + "*)(imCity=*" + query + "*)))"); for (SearchResultEntry entry : searchResult.getSearchEntries()) { dealers.add(new Dealer(entry.getAttributeValue("cn"), entry.getAttributeValue("imCity"))); } return dealers; } } </code></pre> <p><strong>Dealer.java</strong></p> <pre><code>package ch.company.ivy.investitionsantrag; public class Dealer { public String id; public String city; public String label; public Dealer(String id, String city) { id = id.replaceFirst("^0+(?!$)", ""); this.id = id; this.city = city; this.label = id + " " + city; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getLabel() { return label; } public void setLabel(String label) { this.label = label; } } </code></pre> <p>I've created a method <strong>dealers</strong> which takes the query string and executes the following code:</p> <pre><code>import ch.company.ivy.investitionsantrag.*; AutocompleteSource source = new AutocompleteSource(); in.dealers = source.searchDealers(in.query); </code></pre> <p>And finally, my call of the autocomplete in the view:</p> <pre><code>&lt;p:autoComplete id="dealer" completeMethod="#{logic.dealers}" required="false" var="dealer" itemLabel="#{dealer.label}" itemValue="#{dealer.id}" forceSelection="true" value="#{data.dealer}" /&gt; </code></pre> <p>The autocomplete works, it takes the query and gets the results from the LDAP server. But when I select one of the suggestions it puts the whole label into the input field instead of only the id. Am I doing something wrong?</p> <p><strong>Update</strong>: I just noticed that it in fact does use the value specified in <strong>itemValue</strong> - it's just in the background. Anyway to tell primefaces to make the visible value in the input field the same as in the background?</p>ahatiusSun, 19 Jan 2014 18:43:57 -0500https://answers.axonivy.com/questions/262/autocomplete-ignores-itemvalue-attributeautocompletePrimeFaces: Autocomplete using user dialog methodhttps://answers.axonivy.com/questions/61/primefaces-autocomplete-using-user-dialog-method<p>Hi there</p> <p>I've created some workflows in Ivy 4.x, using the Web Page component in the designer. Most of the functionality was coded with jQuery.</p> <p>Now I'd like to switch to Ivy 5. On my old workflow I used jQuery-UI autocomplete to get a list of organization units from our LDAP server. According to the PrimeFaces documentation there is a autocomplete tag. While there are examples on how to use the functions with a regular Java-environement, I couldn't figure out how to use it in Xpert.Ivy.</p> <p>What I've got is an user-dialog, consisting of one start method and another method, which should retrieve the results from the LDAP server, based on the query-text in the input field.</p> <p>I'd be happy if someone could explain to me, how I'd have to setup the autocomplete tag and what format my method has to return, in order for the autocomplete to work.</p> <p>Thank you :) Ahatius</p>ahatiusSat, 09 Nov 2013 21:53:19 -0500https://answers.axonivy.com/questions/61/primefaces-autocomplete-using-user-dialog-methodprimefaces