Examples of Warrant


Examples of com.warrantchange.model.Warrant

    long entryId = ParamUtil.getLong(actionRequest, "entryId");
    long userId = themeDisplay.getUserId();
   
    User currentUser = UserLocalServiceUtil.getUser(userId);
   
    Warrant warrant = WarrantLocalServiceUtil.getWarrant(entryId);
    boolean isAdmin = false;
   
    List<Role> roles = currentUser.getRoles();
   
    for(Role r : roles){
      if(!"WC Admin".equalsIgnoreCase(r.getName())){
          isAdmin = true;
        }
    }
   
    if(warrant.getUserId() != userId){
      if(!isAdmin){
        System.out.println("This user does not have rights to delete this warrant : "+userId);
        return;
      }
    }
   
    System.out.println("WarrantLocalService, marking Warrant as deleted : "+entryId);
   
    warrant.setStatus(WarrantStateType.DELETED.name());
    WarrantLocalServiceUtil.updateWarrant(warrant);
//    WarrantLocalServiceUtil.deleteWarrant(entryId);
  }
View Full Code Here

Examples of com.warrantchange.model.Warrant

        WebKeys.THEME_DISPLAY);

    long entryId = ParamUtil.getLong(actionRequest, "entryId");
    long userId = themeDisplay.getUserId();

    Warrant warrant;
    User currentUser;
    User sellingUser;
    try {
      warrant = WarrantLocalServiceUtil.getWarrant(entryId);
     
      currentUser = UserLocalServiceUtil.getUser(userId);

      sellingUser = UserLocalServiceUtil.getUser(warrant.getUserId());

      MailMessage mailMessageS = new MailMessage();
      mailMessageS.setBody(mailMessage);
      mailMessageS.setFrom(new InternetAddress(currentUser.getEmailAddress()));
      String subject = "Warrant interest";
View Full Code Here

Examples of com.warrantchange.model.Warrant

    long userId = 1L;
    String summary = "MySummary";
    int quantity = 33;
    long price = 499;
   
    Warrant result = WarrantLocalServiceUtil.addWarrant(userId , summary, quantity, price);
   
    assertNotNull(result);
    assertNotNull(result.getId());
    assertEquals(userId, result.getId());
    assertEquals(summary, result.getSummary());
    assertEquals(quantity, result.getQuantity());
    assertEquals(price, result.getPrice());
    assertNotNull(result.getCreateDate());
    assertNotNull(result.getModifiedDate());
    assertEquals(result.getCreateDate(), result.getModifiedDate());
  }
View Full Code Here

Examples of com.warrantchange.model.Warrant

   * @throws com.warrantchange.NoSuchWarrantException
   */
  public void deleteWarrant(long id)
    throws PortalException, SystemException,
      com.warrantchange.NoSuchWarrantException {
    Warrant warrant = warrantPersistence.remove(id);

    Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());

    if (indexer != null) {
      try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.