Meeting request timing mismatch with full VS lite outlook version - java

I am creating meeting request with java code and sending it to full as well as lite version of outlook as shown below:
final SimpleDateFormat iCalendarDateFormat = new SimpleDateFormat("yyyyMMdd'T'HHmm'00'");
final long uid =System.currentTimeMillis();
iCalendarDateFormat.setTimeZone(TimeZone.getTimeZone(MRBSConstants.TIMEZONE));
final String calendarContent = "BEGIN:VCALENDAR\n"
+ "METHOD:REQUEST\n"
+ "PRODID: BCP - Meeting\n"
+ "VERSION:2.0\n"
+ "BEGIN:VEVENT\n"
+ "DTSTAMP:"+ iCalendarDateFormat.format(meetingEndTime) + "\n"
+ "DTSTART:" + iCalendarDateFormat.format(meetingStartTime) + "\n"
+ "DTEND:"+ iCalendarDateFormat.format(meetingEndTime) + "\n"
+ "SUMMARY:test request\n"
+ "UID:" + uid + "\n"
+ "ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:MAILTO:" + Arrays.toString(recipetList) + "\n"
+ "ORGANIZER:MAILTO:" + from+ "\n"
+ "LOCATION:" +loc + "\n"
+ "DESCRIPTION:" + body+ "\n"
+ "SEQUENCE:0\n" + "PRIORITY:5\n" + "CLASS:PUBLIC\n" + "STATUS:CONFIRMED\n" + "TRANSP:OPAQUE\n" + "BEGIN:VALARM\n"
+ "ACTION:DISPLAY\n" + "DESCRIPTION:REMINDER\n" + "TRIGGER;RELATED=START:-PT00H15M00S\n" + "END:VALARM\n" + "END:VEVENT\n" + "END:VCALENDAR";
And it is working fine with lite version of outlook means it giving correct time in lite version but in full version of outlook it showing different timings.?why
Here MRBSConstants.TIMEZONE value is GMT-5:30.
I have also tried adding VTIMEZONE COMPONENT but in that case outlook cant recognize the ics file as correct.
Do we have any general ics object which can work on both version?

Related

how do i edit HTML inside string JAVA CODE easily

i developed android app and i used HTML code to Print the result in formatted form.
the code will be like this :
String adress = editText1.getText().toString();
String phone = editText2.getText().toString();
String licenseNo = editText3.getText().toString();
"\n" +
" <div class=\"down\">\n" +
" <div class=\"EASY\">\n" +
" <img src=\"" + image + "\" alt=\"QR\" >\n" +
" </div>\n" +
" <table class=\" info_table\">\n" +
" <tbody>\n" +
" <tr>\n" +
" <td class=\"info\">" + phone + "</td>\n" +
" <td class=\"info\"> " + licenseNo + "</td>\n" +
" </tr>\n" +
" <tr>\n" +
" <td class=\"info_A\" colspan=\"2\"> " + adress + "</td>\n" +
" </tr>\n" +
" </tbody>\n" +
" </table>\n" +
" </div>";
as you see it should contain \n and + because its inside a string object contained variable values from user input.
i faced some difficulty when i need to Edit this Piece of code cose i will test it inside the application.
my question is what is the best way to get this code to edit and preview it outside android studio and reinsert it again.
i used find and replace but it make some problems.
hope i explained enough
You can create a XML file in the resources folder, read it and then use format in order to change the values there.

cannot find symbol method append (String)

I don't get it why it says it cannot find symbol append.
do i need to use Stringbuffer? i got this code on a tutorial for receipts from youtube, and the uploader disabled comments so I can't ask him directly. please help me. Im still an amateur at java.
Tell me if I need to post my whole code or what code would you want to see to see errors. thanks in adv.
Calendar timer = Calendar.getInstance();
timer.getTime();
SimpleDateFormat tTime = new SimpleDateFormat("HH:mm:ss");
tTime.format(timer.getTime());
SimpleDateFormat Tdate = new SimpleDateFormat("dd-MMM-yyyy");
Tdate.format(timer.getTime());
jtxtReceipt.append("\ Water Station Receipt:\n" +
"Reference:\t\t\t" + refs +
"\n=========================================\n" +
"Mineral:\t\t\t" + jtxtMineral.getText() + "\n\n" +
"Purified:\t\t\t" + jtxtPurified.getText() + "\n\n" +
"Travel:\t\t\t" + jtxtTravel.getText() + "\n\n" +
"VAT:\t\t\t" + jtxtVat.getText() + "\n"+
"\n========================================\n" + "\n" +
"Tax:\t\t\t" + jtxtTax2.getText() + "\n" +
"Subtotal:\t\t\t" + jtxtSubTotal.getText() + "\n" +
"Total:\t\t\t" + jtxtTotal.getText() + "\n" +
"===========================================" +
"\nDate:" + Tdate.format(timer.getTime()) +
"\ntTime:" + tTime.format(timer.getTime()) +
"\n\t\tThank you ");
The append method doesn't exist in the String class. You can either user a StringBuilder to do the job, or if it's a light concatenation, just use the + operator
The append method doesn't work on TextField Palette. So, if You're on TextField Palette, replacing that with TextArea Palette should solve the problem.

Load all items from a list of string, launching minecraft with libraries listed in the files list

I'm making a launcher, this launcher using process with java, my problem is, I have a list(of string) called "files", I want to build the process with -cp all items from this unknow count list. I want to launch minecraft, in the "files", my launcher stored the libraries.
With more code details:
MainClass: The minecraft's main class,
JavaPath: The java location in the computer,
MaxMemAlloc: The maximal heap size for java,
MinMemAlloc: The minimal heap size for java,
Version: The minecraft version
My code looks like this:
Dim p As New Process()
p.StartInfo.FileName = Javapath
p.StartInfo.Arguments = " -Xms" + MinMemAlloc + "M -Xmx" + MaxMemAlloc + "M " +
"-Djava.library.path=" + Root + String.Format("\versions\{0}\{0}-natives", Version) +
" -cp " +
String.Join(";", Files) +
Root + String.Format("\versions\{0}\{0}.jar ", Version) + MainClass +
" --username=" + Username +
" --version " + Version +
" --gameDir " + Root +
" --assetsDir " + Root + "\assets" +
" --assetIndex " + AssetIndex +
" --accessToken null" +
" --userProperties {}" +
" --userType mojang" +
" --uuid (Default)"
p.StartInfo.WorkingDirectory = Root
p.StartInfo.CreateNoWindow = False
p.StartInfo.UseShellExecute = False
p.EnableRaisingEvents = True
Application.DoEvents()
p.StartInfo.RedirectStandardError = True
p.StartInfo.RedirectStandardOutput = True
AddHandler p.ErrorDataReceived, AddressOf Main.p_OutputDataReceived
AddHandler p.OutputDataReceived, AddressOf Main.p_OutputDataReceived
p.Start()
How to scroll and -cp all items from the "files", and launch the process? Thanks!
You can use the String.Join method to easily get a delimiter-separated string from a list.
" -cp " +
String.Join(";", Files) + ' other stuff
E.g. if your list has asdf and qwer, it will output asdf;qwer.

SOAP client SAAJ

I am relatively new to SOAP and wanted to write a SOAP client in JAVA. I figured out that the WSDL has a lot of other crap and as I use just one service out of it, hence SAAJ would be the shortest way. The first WSDL I got was RPC encoded and did not support SSL connections (http link). The call I made was this:
String request = "<soapenv:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:AxessInterface\">"
+ " <soapenv:Header/>"
+ " <soapenv:Body>"
+ " <urn:getModemFromACS soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">"
+ "<ModemIDMACAddressChoice xsi:type=\"urn:ModemIDMACAddressChoiceStruct\">"
+ " <ModemID xsi:type=\"xsd:string\">"
+ modemId
+ "</ModemID>"
+ " </ModemIDMACAddressChoice>"
+ " </urn:getModemFromACS>"
+ " </soapenv:Body>"
+ "</soapenv:Envelope>";
The new WSDL that I have is I guess NOT RPC encoded (it does not have that "style=rpc" tag anywhere) and the link is SSL enabled (https with one way authentication). The style is "document" in this WSDL.
I have a couple of issues:
My soap call doesnt work. I modified it to be:
String request = "http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:AxessInterface\">"
+ " "
+ " "
+ " "
+ " "
+ " "
+ modemId
+ ""
+ " "
+ " "
+ " "
+ "";
I am not sure why the code cannot be displayed, i removed the line "soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" . With this i get a SOAPFault with message: "list index out of range"
Can someone tell me how to add that truststore to my SOAP client? (I use System.setProperty but I am not sure if this is the best way to go).

How can I split the data over multiple lines in a JTextArea?

How can I put each line of the host in the message body? I work with a JTextArea.
String host = InetAddress.getLocalHost().getHostName().toString();
texto_recepcion.setText(host + texto_recepcion.getText() + dpRecepcion.getAddress() + " " + mensaje_recibido + "\n");
How it is now:
I resolve my question with append function.
String host = InetAddress.getLocalHost().getHostName().toString();
texto_recepcion.append(host); // ***Use the function append for solve the problem***
texto_recepcion.setText(texto_recepcion.getText() + dpRecepcion.getAddress() + " " + mensaje_recibido + "\n");
Thanks a lot
Why don't you add the newline character "\n" to the beginning of the string?
texto_recepcion.setText("\n" + host + texto_recepcion.getText() + dpRecepcion.getAddress() + " " + mensaje_recibido);

Categories