Questions asked by Alexishttps://answers.axonivy.com/questions/asked-by/107/alexis/?type=rssQuestions asked by <a href="/users/107/alexis" >Alexis</a>enWed, 05 Aug 2015 14:35:29 -0400How to connect To SystemDB using Windows-Authentificationhttps://answers.axonivy.com/questions/1429/how-to-connect-to-systemdb-using-windows-authentification<p>How do I connect to Ivy System DB using the Windows-Authentification?</p>AlexisWed, 05 Aug 2015 14:35:29 -0400https://answers.axonivy.com/questions/1429/how-to-connect-to-systemdb-using-windows-authentificationengineauthenticationsystemdbSSO on Apache: not logged in to Ivy but in tomcat?https://answers.axonivy.com/questions/1319/sso-on-apache-not-logged-in-to-ivy-but-in-tomcat<p>Hello Ivy-Comunity!</p> <p>When logged in to Apache (and to Tomcat) the User is not taken by Ivy.</p> <p>In a testing environment I have the following constellation:</p> <ul> <li>Linux environment with Ivy 5.1.3 attached to AD</li> <li>Apache Server with Kerberos Login attached to the same AD</li> <li>Ajp-Connector to Ivy-Tomcat</li> <li>A jsp testing Page in the Ivy-Environment (applicationHome on the Application-wf-Page)</li> </ul> <p>So this Page shows me by asking request.getRemoteUser() that this User is logged in: Hans.Tester@TESTENV.LOCAL and a HTTP Session request.getSession().getId(). But getting the Ivy-User by ivySession.getSessionUser() returns null. Except when Logged in manualy the result Hans.Tester for the Ivy-Session.</p> <p>So why is that? Or how can I make shure, that the Session is taken correctly by ivy?</p> <p>First guess is, that the username comes with the Environment (TESTENV.LOCAL). If it is the Issue, how to shut that down?</p> <p>With further investigation I found out more:</p> <ul> <li>In a Windows-Environment under IIS the UserName of the Tomcat-Session is in this format: TESTENV\Alexis.Suter</li> <li>The Ivy-Session is not saved into Tomcat-request. (When only logging in to Ivy)</li> </ul> <p>Thanks in advance!</p>AlexisWed, 13 May 2015 09:04:14 -0400https://answers.axonivy.com/questions/1319/sso-on-apache-not-logged-in-to-ivy-but-in-tomcatssosessionauthenticationHow do I send html formated content in email step?https://answers.axonivy.com/questions/1151/how-do-i-send-html-formated-content-in-email-step<p>Hello</p> <p>How can I send formated emails? Assume I have an html-formated String and whant to bring it into my email. Problem here is that even this method will escape the String:</p> <p><code>&lt;%=ivy.html.getObject("in.mailString").toString()%&gt;</code></p> <p>Is there an other possibility to send the content of a JSP-Page?</p> <p>Best regards</p> <p>Alexis</p>AlexisMon, 09 Feb 2015 18:56:24 -0500https://answers.axonivy.com/questions/1151/how-do-i-send-html-formated-content-in-email-stepivyscriptjspAdding additional Libraries to Hibernate, e.g. Envershttps://answers.axonivy.com/questions/1138/adding-additional-libraries-to-hibernate-e-g-envers<p>Hello Ivy-Developers!</p> <p>Envers is a powerfull Library, that comes along with the Hibernate-Package and allows auto-Auditing for entities. (History-Tables etc.)</p> <p>Update:</p> <p>To insert the library I did as following: Added hibernate-envers-4.2.13.Final.jar to ivy-Hibernate-jar:</p> <p>designer\plugins\ch.ivyteam.hibernate_5.1.0.201409121008.jar\lib\mvn\</p> <p>made some changes in the ivy-Hibernate-jar: ',lib/mvn/hibernate-envers-4.2.13.Final.jar' added to MANIFEST.MF</p> <p>in pom.xml I inserted a new dependency for hibernate-envers (see pom.xml)</p> <p>When inserting this library this unusual way, there are no more errors accessing the persistence.</p> <p>Adding @Audited to the Entity gives no error, but no auditing happens on merge.(Wich would usualy be the case)</p> <p>Merging through the EntityManager (from createEntityManager()) does not work (Nothing happens, no error)</p> <p>Trying to access the AuditReader will fail on a ClassNotFoundException: org.hibernate.envers.AuditReaderFactory</p> <pre><code>// switching contextClassLoader to ivy.request.getProject().getProjectClassLoader() EntityManager em = entityManager.createEntityManager(); AuditReaderFactory.get(em); </code></pre> <p>As I understand this has been successfully implemented in the csc project.</p> <p>So the questions are: How can I integrate this library into Ivy? If not possible, is there a way to detach Hibernate more from Ivy?</p> <p>Installation as described in: <a href="http://docs.jboss.org/hibernate/orm/4.2/devguide/en-US/html/ch15.html">Guide from Hibernate</a> </p> <p>Thanks in advance!</p> <p>Greetings Alexis</p>AlexisTue, 27 Jan 2015 17:05:26 -0500https://answers.axonivy.com/questions/1138/adding-additional-libraries-to-hibernate-e-g-envershibernatepersistencePersistence Api - Catching NoResultExceptionhttps://answers.axonivy.com/questions/1049/persistence-api-catching-noresultexception<p>Hello</p> <p>How do I catch a NoResultException after calling the getSingleResult() on a custom query, wich often doesn't return any result. Catching the NoResultException still logs an error (<strong>NoResultException: No entity found for query</strong>) and after that the Info is printed out. Happens both in the designer and on the server.</p> <pre><code>catch (NoResultException e) { Ivy.log().info("No Result has been found for Debitor '"+number+"'."); } </code></pre> <p>haven't tested yet with other Exceptions like NonUniqueResultException.</p> <p>Thank you in advance</p>AlexisTue, 25 Nov 2014 16:35:41 -0500https://answers.axonivy.com/questions/1049/persistence-api-catching-noresultexceptionpersistenceComposite Primary Key in Persistencehttps://answers.axonivy.com/questions/1039/composite-primary-key-in-persistence<p>Hi</p> <p>Is there any way to have multiple ID's in one Entity? Corresponding JPA it should be possible. But trying in the designer I get: Exaclty one 'Id' field per Entity Class must be used. Although it is not named 'Id'. Would be saving a lot of work, when this is enabled.</p> <p>Best Regards</p> <p>Alexis</p>AlexisTue, 18 Nov 2014 15:00:16 -0500https://answers.axonivy.com/questions/1039/composite-primary-key-in-persistencepersistenceNot visible Interface on persistence queryhttps://answers.axonivy.com/questions/945/not-visible-interface-on-persistence-query<p>Calling a query on a table with BLOBs (Files in Tables) using the jTDS-Driver I get a class-loader error:</p> <p><code>java.lang.IllegalArgumentException: interface org.hibernate.engine.jdbc.WrappedBlob is not visible from class loader</code></p> <p>My Solution was to switch to an other classloader:</p> <pre><code> public synchronized void method() { Thread thread = Thread.currentThread(); ClassLoader tempLoader = thread.getContextClassLoader(); thread.setContextClassLoader(null); entityManager.createNativeQuery("select * from TSRPTBLB where TSBID = 1 ") .getSingleResult(); thread.setContextClassLoader(tempLoader); } </code></pre> <p>Will there be any other, cleaner way than switsching the classloader?</p> <p>Thank you in advance</p>AlexisTue, 09 Sep 2014 14:41:36 -0400https://answers.axonivy.com/questions/945/not-visible-interface-on-persistence-queryjavaivypersistenceGeneric classes in ivyscripthttps://answers.axonivy.com/questions/531/generic-classes-in-ivyscript<p>Hello IvyTeam</p> <p>Is there a simple way calling self made generic classes? Like the List.</p> <p>Data:<br> dao Dao&lt;item&gt;</p> <p>in Ivyscript:<br> calling dao.get(id) the response would be of type Item.</p> <p>generic Class:<br> T get(int id)</p> <p>It would be great if there is a solution.</p> <p>Thanks for an answer and Greetings</p> <p>Edit: Trying to extend a class with the Generic doesn't help any further.<br> In java code those objects return items as it should and in ivyscript Objects are still returned.</p> <pre><code>public class DaoItemTest extends Dao&lt;Item&gt; { public DaoItemTest() { super(Item.class); } } </code></pre>AlexisWed, 19 Feb 2014 13:18:14 -0500https://answers.axonivy.com/questions/531/generic-classes-in-ivyscriptivyscriptHow to access Component dialogshttps://answers.axonivy.com/questions/530/how-to-access-component-dialogs<p>Hello Ivy Team</p> <p>I have some questions concerning the <strong>access of Components data, methods and updating</strong> in ivy-jsf.<br> Some points might not been implemented yet so consider these also as ideas or wishes.</p> <p>In my example there is a main dialog which implements 2 components:</p> <pre><code>&lt;ic:ch.itpoint.mms.care.ItemEdit startMethod="startNew" callback="#{logic}" /&gt; &lt;ic:ch.itpoint.mms.show.ItemList startMethod="start" /&gt; </code></pre> <p>There are two targets I want to reach:</p> <ol> <li>Creating a Item or editing it should update the ItemList</li> <li>Selecting an Item in the List should open the Object in the Item-Editor</li> </ol> <p>One restriction is, that all that should be build up like described with components. Saving events will be handled first in the component, then in the main-page. Another might be to preferably stay away from self made javascripts.<br><br> I achieved, that I can save the Item and call a method (itemSaved()) via the callback on the main-page at the same time:</p> <pre><code>&lt;p:commandButton value="#{ivy.cms.co('/lables/save')} - Callback" actionListener="#{logic.saveItem}" action="#{cc.attrs.callback.itemSaved}" ajax="true" icon="ui-icon-disk" update="itemForm,:j_id_s:itemsListeForm" /&gt; </code></pre> <p>That's allready something, but I didn't find any way to access the List-Component.<br> In the end I would see these possibilities:</p> <ol> <li>Having access to components methods / events, which also provoke an update in the view.</li> <li>Having access to components data from main page. And some kind of dataChangeListener to update the view.</li> </ol> <p>Two possible solutions I see:</p> <ol> <li>An object of the compoenent in jsf (with possible access in the logic)</li> <li>Same object in the logic (same as ULC-components)</li> </ol> <p>An Update could exceptionally be fired by the update-Attribute :j_id_s:itemsListeForm in the brother-component (I don't know if it would work)<br></p> <p>Thank you for your support!<br></p> <p>Greetings<br> Alexis Suter</p>AlexisWed, 19 Feb 2014 10:21:51 -0500https://answers.axonivy.com/questions/530/how-to-access-component-dialogshtmluserdialogcallbackjsfcomponent