Package com.warrantchange.model

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


        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

    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

   * @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

Related Classes of com.warrantchange.model.Warrant

Copyright © 2018 www.massapicom. 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.