javaextensions/pim/javasrc/com/nokia/mj/impl/pim/PIMManager.java
changeset 79 2f468c1958d0
parent 76 4ad59aaee882
child 78 71ad690e91f5
equal deleted inserted replaced
76:4ad59aaee882 79:2f468c1958d0
   215             calendarName = aName.substring(0, aName.indexOf("/"));
   215             calendarName = aName.substring(0, aName.indexOf("/"));
   216             if (isListNameValid(listName))
   216             if (isListNameValid(listName))
   217             {
   217             {
   218                 if (operation == null)
   218                 if (operation == null)
   219                 {
   219                 {
   220                     if (calendarName != null)
   220                     if (!calendarName.trim().equals(""))
   221                     {
   221                     {
   222                         //This is the case of opening an existing calendar
   222                         //This is the case of opening an existing calendar
   223                         return doOpenPIMList(aPimListType, aMode, listName, "C:" + calendarName);
   223                         return doOpenPIMList(aPimListType, aMode, listName, "C:" + calendarName);
   224                     }
   224                     }
   225                     else
   225                     else
   226                     {
   226                     {
   227                         //This is the case with IllegalArgumentException
   227                         //This is the case with PIMException
   228                         throw new IllegalArgumentException("Calendar Name is NULL");
   228                         throw new PIMException("Can not" + operation + "Default Calendar", PIMException.GENERAL_ERROR);                        
   229                     }
   229                     }
   230                 }
   230                 }
   231                 else if (operation.equals("create"))
   231                 else if (operation.equals("create"))
   232                 {
   232                 {
   233                     createCalendar(calendarName);
   233                     createCalendar(calendarName);
   239                 else if (operation.equals("delete"))
   239                 else if (operation.equals("delete"))
   240                 {
   240                 {
   241                     deleteCalendar(calendarName);
   241                     deleteCalendar(calendarName);
   242                     int listHandle = 0;
   242                     int listHandle = 0;
   243                     PIMListImpl pimList = new EventListImpl(listHandle, aMode);
   243                     PIMListImpl pimList = new EventListImpl(listHandle, aMode);
       
   244                     // Close the dummy list
       
   245                     pimList.close();
   244                     return pimList;
   246                     return pimList;
   245                 }
   247                 }
   246                 else
   248                 else
   247                 {
   249                 {
   248                     throw new IllegalArgumentException("Invalid operation");
   250                     throw new IllegalArgumentException("Invalid operation");
   413         //return calendarLists;
   415         //return calendarLists;
   414         return calendarobjlist;
   416         return calendarobjlist;
   415     }
   417     }
   416 
   418 
   417 
   419 
   418     private synchronized void createCalendar(String aCalName)
   420     private synchronized void createCalendar(String aCalName) throws PIMException
   419     {
   421     {
   420 
   422 
   421         String displayName = aCalName;
   423         String displayName = aCalName;
   422         // security check
   424         // security check
   423         ApplicationUtils appUtils = ApplicationUtils.getInstance();
   425         ApplicationUtils appUtils = ApplicationUtils.getInstance();