Hi everyone,
I created a webwork1 plugin an need somebody to tell me how can I marshall an action class in a way when I submit a form on a submit button, so it generates an xml file. At moment I tried with JAXB but no luck.
I put the marshal logic in doExecute() method, nothing happened. After that try to put logic implementation in execute() method of the action class but still nothing...Where do I need to put the marhsalling implementation so when I click the submit button it executes my block of code?
Best Regards,
Ivan
Community moderators have prevented the ability to post new answers.
I managed to set tomcat in debug mode. Just type: 'catalina.sh jpda start'. The doExecute method is not even called, so I added a new method 'createXML' which has the logic. The method is called in vm. The exception I get is "java.io.FileNotFoundException: C:\\Users\\user\\Desktop\\XMLtest.xml (No such file or directory) ". JIRA is on linux machine, but I access it via browser in windows OS. I will google it for a answers.
sure, atlas-debug is part of the SDK and it will not work for your installed JIRA. So you need to find how to run your Tomcat in debug mode. I remember I used to add jpda args in catalina.sh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is the problem. The development instance that is instantied via atlas SDK (e.g. localhost:2990/jira), doesn't have the jira configuration and all custom field that we have on our JIRA (e.g. hostName:8080/jira). I think that the 'atlas-debug' is going to work only on atlassian SDK app instance? This is way i tried to run tomcat of our instance via "jpda start" parameter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I guess you need to launch development instance via atlas-debug https://developer.atlassian.com/docs/developer-tools/working-with-the-sdk/command-reference/atlas-debug and connect to it https://developer.atlassian.com/docs/developer-tools/working-in-an-ide/creating-a-remote-debug-target
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok. So you are not returning the XML but rather storing it on file system. Can you debug doExecute method? It' supposed to be triggered by YourWebWorkClass.jspa URL.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I found something similar, but it is not webwork1 plugin: https://developer.atlassian.com/jiradev/jira-architecture/building-jira-add-ons/jira-plugins2-overview/jira-plugin-module-types/search-request-view-plugin-module# -------- but the vm is hardcoded for xml tags, which I don't want.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
doExecute() looks like this: ======= public String doExecute()throws Exception{ try{ JAXBContext context = JAXBContext.newInstance(xmlMarshaling.getClass()); Marshaller marshaller = context.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); marshaller.marshal(xmlMarshaling, new File("C:\\Users\\user\\Desktop\\testXML.xml")); marshaller.marshal(xmlMarshaling, new File("/home/jira/jira-home/testXML.xml")); }catch(JAXBException e){ e.printStackTrace(); } return SUCCESS; } ======
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Volodymyr, yes, I want the XML file as response. I have a velocity template page with a form where I have 2 input fields and 2 textarea and 1 submit button. I have an action class named 'XMLMarshaling' that is mapped to that velocity template. When i fill this four fields on the .vm I managed to store the user input (FormData) into variables of a java class. What I want is, when I click the 'Submit' button, the variables of a java class that are initialized from user input, schould be exportet to XML file. After I got that XML file I would put that XML file somewhere in database (would add some column to store the file). Do you have any suggestions? Best Regards, Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you want to return XML as response to your web page?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.