示例#1
0
 public static PSLocator getCurrentOrEditLocator(int id) throws PSException {
   PSComponentSummary cs = getSummary(id);
   PSLocator loc = cs.getCurrentLocator();
   if (cs.getEditLocator() != null && cs.getEditLocator().getRevision() > 0) {
     loc = cs.getEditLocator();
     log.debug("Using edit locator" + loc);
   }
   return loc;
 }
示例#2
0
 public static int getCheckoutStatus(String contentId, String userName) throws PSException {
   if (StringUtils.isBlank(userName)) {
     String emsg = "User name must not be blank";
     log.error(emsg);
     throw new IllegalArgumentException(emsg);
   }
   PSComponentSummary sum = getSummary(contentId);
   String uname = sum.getCheckoutUserName();
   if (StringUtils.isBlank(uname)) {
     return CHECKOUT_NONE;
   }
   if (userName.equalsIgnoreCase(uname)) {
     return CHECKOUT_BY_ME;
   }
   return CHECKOUT_BY_OTHER;
 }