10 Replies Latest reply: Mar 28, 2007 2:51 AM by 190947 RSS

    Creating Tasks as user / as sysop, possible?

    469098
      Hi,

      i need to create tasks as user and sysop user for a proof of concept.
      Creation as User works only with few fields filled (UID, CLASS, SUMMARY,
      DESCRIPTION, PRIORITY)
      Other Fields do not have an effect or the task does not appear, although there
      was no error.
      Furthermore UID check for already created items does not work and in 10.1.1.02 these Tasks break the Tasks website fo calender webclient.

      Creation as sysop does not work at all.

      Used SDK 9.0.4.25157 with JDeveloper against 9.0.4.2 and 10.1.1.02 OCS

      Is this possible? Are there restrictions?

      I need to know this until 23.11.2005 , 10:00 GMT+1

      Thanks in advance.
      Best Regards,
      Benjamin
        • 1. Re: Creating Tasks as user / as sysop, possible?
          414326
          Hi Benjamin,
          Creation as User works only with few fields filled
          (UID, CLASS, SUMMARY,
          DESCRIPTION, PRIORITY)
          Other Fields do not have an effect or the task does
          not appear, although there
          was no error.
          It does not appear where? Do you have an example?
          Furthermore UID check for already created items does
          not work and in 10.1.1.02 these Tasks break the Tasks
          website fo calender webclient.
          What do you mean by "UID check for already created items"? In what operation?
          On task creation, you should get a CAPI_STAT_DATA_UID_ALREADYEXISTS error if the uid already exists for that user and you try to create another task with the same UID. I just tested this with a 9.0.4.2.10 sdk and 10.1.1 server. Please provide us with a reproducible case.
          Creation as sysop does not work at all.
          What doesn't' t work? What is the status code returned?
          You can't connect as sysop? -need to set allowsysoplogon_capi = TRUE in unison.ini
          You can't set identity to a user once your are connected as sysop?
          Task creation fails?

          Regards,
          Jean-Philippe
          • 2. Re: Creating Tasks as user / as sysop, possible?
            469098
            Hi Jean-Philippe,

            it does not appear in all clients (Calendar, OCFO, Web), but also no error happened.

            Yes, i thought there would be an Exception thrown but i receive none.

            Sorry, for being so unprecise, i'll try to clarify it.

            I am able to connect as sysop, set the identity and i am able to create events, but i am not able to to create tasks. Again it seems to be succesful an i receive no exception, but i am not able to find the tasks in any client.

            Maybe you can send me the 9.0.4.2.10 SDK, there is no download anymore. I received the one i used from oss via ftp because there's no download.

            I will post my java code in about 10 hours, i am at home now ;/ Maybe you post your test and i will compare it. I just tried to create a simple task with Summary, Description, Startdate and Duedate.

            Thanks in advance,
            Benjamin
            • 3. Re: Creating Tasks as user / as sysop, possible?
              469098
              Hi,

              the source, as i said already just a proof of concept.
              CreateEvent works quite fine.
              CreateTasks throws no errors, but doesn't do the exepected. Also entering one UID two times for CreateTask no error is thrown.

              Thanks,
              Benjamin


              public static void CreateEvent(String uid, String titel)
              {
                        try
              {
              Api.init("/home/oracle/sapcrm2ocscal/calendar.ini", "/home/oracle/sapcrm2ocscal/calendar.log");
              }
              catch(Exception e)
              {
              System.out.println("init returned status'" + e.getMessage() + "'");
              System.exit (1);
              }

              Session session = null;
              System.out.println("Start");

              try
              {
              session = new Session();
              session.connectAsSysop(
              Api.CAPI_FLAG_NONE,
              "ocs1.kuttig.com",
              "1",
              "password" // SYSOP Password
              );
              session.setIdentity ( Api.CAPI_FLAG_NONE, "test.zolper");

              // Alternate Connect
              /* session.connect(Api.CSDK_FLAG_NONE,"ocs1.kuttig.com");
              session.authenticate(Api.CSDK_FLAG_NONE,"test.zolper","password");*/


              RequestResult result = new RequestResult();

              String s = "";
              s += "Content-Type: text/calendar; charset=UTF-8\n";
              s += "Content-Disposition: attachment; filename=\"\"\n";
              s += "Content-Transfer-Encoding: QUOTED-PRINTABLE\n\n";
              s += "BEGIN:VCALENDAR\n";
              s += "PRODID:KUTTIG Computeranwendungen GmbH/sapcrm2ocscal/\n";
              s += "VERSION:2.0\n";


              Calendar calendarDate = GregorianCalendar.getInstance();
              calendarDate.set(2005,10,21,17,0,0);

              Calendar end = (Calendar) calendarDate.clone();
              end.add(Calendar.MINUTE, 60);
              Calendar due = (Calendar) calendarDate.clone();
              due.add(Calendar.HOUR, 72);

              s += "BEGIN:VEVENT\n";
              s += ("UID:" + uid + "\n");

              s+= "CLASS:" + "NORMAL" + "\n";

              s+= "PRIORITY:" + "1" + "\n";
              s += ("DTSTART:" + Utilities.calendarToVCalendar(calendarDate) + "\n");
              s += ("DTEND:" + Utilities.calendarToVCalendar(end) + "\n");

              s += ("SUMMARY:" + titel + " (sapcrm2ocscal)" + "\n");
              s += ("DESCRIPTION:" + "BESCHR123" + "\n");
              s += ("ATTENDEE;PARTSTAT=" + "NEEDSACTION" + ":MAILTO:" +"other.attendees@email.com"+ "\n");


              s += "BEGIN:VALARM\n";
              s += "TRIGGER:-PT1M\n";
              s += "DESCRIPTION:Erinnerung\n";
              s += "ACTION:NONE\n";
              s += "END:VALARM\n";

              s += "END:VEVENT\n";

              s += "END:VCALENDAR\n";

              System.out.println(s);

              session.storeEvents(Api.CSDK_FLAG_STORE_CREATE |
              Api.CSDK_FLAG_STORE_INVITE_SELF,s,result);

              result.getFirstResult();
              // result.getFirstFailure();
              System.out.println(result.toString());
              }
              catch (Exception e)
              {
              e.printStackTrace();
              }
              System.out.println("Ende");
              }


              public static void CreateTask(String uid, String titel)
              {
                        try
              {
              Api.init("/home/oracle/sapcrm2ocscal/calendar.ini", "/home/oracle/sapcrm2ocscal/calendar.log");
              }
              catch(Exception e)
              {
              System.out.println("init returned status'" + e.getMessage() + "'");
              System.exit (1);
              }

              Session session = null;
              System.out.println("Start");

              try
              {
              session = new Session();
              session.connectAsSysop(
              Api.CAPI_FLAG_NONE,
              "ocs1.kuttig.com",
              "1",
              "password" // SYSOP Password
              );
              session.setIdentity ( Api.CAPI_FLAG_NONE, "test.zolper");

              // Alternate Connect
              /* session.connect(Api.CSDK_FLAG_NONE,"ocs1.kuttig.com");
              session.authenticate(Api.CSDK_FLAG_NONE,"test.zolper","password");*/


              RequestResult result = new RequestResult();

              String s = "";
              s += "Content-Type: text/calendar; charset=UTF-8\n";
              s += "Content-Disposition: attachment; filename=\"\"\n";
              s += "Content-Transfer-Encoding: QUOTED-PRINTABLE\n\n";
              s += "BEGIN:VCALENDAR\n";
              s += "PRODID:KUTTIG Computeranwendungen GmbH/sapcrm2ocscal/\n";
              s += "VERSION:2.0\n";


              Calendar calendarDate = GregorianCalendar.getInstance();
              calendarDate.set(2005,10,21,17,0,0);

              Calendar end = (Calendar) calendarDate.clone();
              end.add(Calendar.MINUTE, 60);
              Calendar due = (Calendar) calendarDate.clone();
              due.add(Calendar.HOUR, 72);


              s += "BEGIN:VTODO\n";
              s += ("UID:" + UID + "\n");
              s+= "CLASS:" + "NORMAL" + "\n";
              s+= "PRIORITY:" + "3" + "\n";

              //s += ("DTSTART:" + Utilities.calendarToVCalendar(calendarDate) + "\n");
              //s += ("DUE:" + Utilities.calendarToVCalendar(due) + "\n");
                             s += ("STATUS:" + "COMPLETED" + "\n");
              s += ("SUMMARY:" + titel + "\n");
              s += ("DESCRIPTION:" + "Testaufgabe123" + "\n");

              /* s += "BEGIN:VALARM\n";
              s += "TRIGGER:-PT1M\n";
              s += "DESCRIPTION:Erinnerung\n";
              s += "ACTION:NONE\n";
              s += "END:VALARM\n";
              */

              s += "END:VTODO\n";
              s += "END:VCALENDAR\n";

              s += "END:VCALENDAR\n";

              System.out.println(s);

              session.storeTasks(Api.CSDK_FLAG_STORE_CREATE | Api.CSDK_FLAG_STORE_INVITE_SELF,s,result);


              result.getFirstResult();
              // result.getFirstFailure();
              System.out.println(result.toString());
              }
              catch (Exception e)
              {
              e.printStackTrace();
              }
              System.out.println("Ende");
              }
              • 4. Re: Creating Tasks as user / as sysop, possible?
                414326
                Hi Benjamin,
                Also entering one UID two times for CreateTask no error is thrown.
                I was able to reproduce this problem. This is an old version of the sdk you are using, I strongly recommend switching to a new version (10g if possible). Support will help you do that.

                For not being able to view the tasks with the calendar native client, I wasn't' t able to reproduce your problem. I used the test program you provided with 9.0.4.25157sdk binaries and I was able to see the task with my 10g Calendar Native Client, 10g OCFO and 10g Calendar sever.

                (**)To make sure the task is created on the server, you can use calendar sdk function session.fetchTaskByUID() to make sure it is created.

                Note that clients use their own Heuristic for displaying tasks. You can read the corresponding client documentations for more information.

                Also you need to refresh the clients to see the newly created task with the sdk.
                OCFO, you need to do "Tools -> Refresh This Folder"
                Calendar Native Client, you need to refresh "F5"

                If you can still not see the task in the clients, but you were able to fetch it with (**)session.fetchTaskByUID(), then make sure you are on the right server/user account.

                Hope this works out. If there is still a problem, please provide the client versions.

                Cheers,
                Jean-Philippe
                • 5. Re: Creating Tasks as user / as sysop, possible?
                  469098
                  Hi,

                  thanks so far.

                  I tried to switch to 10g (10.1.1...) sdk and i have a TAR open for an issue regarding csdkjni unresolved link error. I'll hope this will work out then. Maybe i should try 10.1.2..

                  As for my source an 9.0.4.25157 did you tried with the DTSTART and DUE options, which i commented there, or without?
                  Did you do ist via sysop?

                  I will try to fetch it via the SDK function as you mentioned.

                  Well, refreshing was not the problem, but nice that you notice it. :-)

                  If you say it is possible, what you do, i will trust you and offer the solution with tasks to our customer. You may be sure that i will get to back to you, if it won't work. ;-)

                  Thanks again,
                  Benjamin
                  • 6. Re: Creating Tasks as user / as sysop, possible?
                    414326
                    As for my source an 9.0.4.25157 did you tried with
                    the DTSTART and DUE options, which i commented there,
                    or without?
                    Did you do ist via sysop?
                    I copied and pasted your code and tried it. So without DTSTART and DUE property and via sysop.

                    Cheers,
                    Jean-Philippe
                    • 7. Re: Creating Tasks as user / as sysop, possible?
                      469098
                      Hi Jean-Phillipe,

                      it seems to work with new SDK 10.1.1.0.2. I still have trouble connecting to our 9.0.4.2 OCS but 10g seems to be fine.

                      Thanks for your efforts,
                      Benjamin
                      • 8. Re: Creating Tasks as user / as sysop, possible?
                        414326
                        Just a little update for readers of this thread.
                        I still have trouble connecting to our 9.0.4.2 OCS but 10g
                        seems to be fine.
                        This issue has been addressed and it was not an sdk related problem. The 10.1.1.0.2 calendar sdk is backward compatible with a 9042 calendar server.

                        Thanks,
                        Jean-Philippe
                        • 9. Re: Creating Tasks as user / as sysop, possible?
                          469098
                          Yep, that's right. It was just related to my lazy head ;-)

                          Everything works fine now.

                          Thanks for you support, Jean-Phillipe.

                          Regards,
                          Benjamin
                          • 10. Re: Creating Tasks as user / as sysop, possible?
                            190947
                            very useful topic
                            thank you very mach
                            exactly benjamin.zolper