Package org.dspace.app.xmlui.wing

Examples of org.dspace.app.xmlui.wing.Message


      {
        // Group's can not have blank names.
        result.setContinue(false);
        result.addError("group_name");
        result.setOutcome(false);
        result.setMessage(new Message("default","The group name may not be blank."));
       
        return result;
      }
     
      // Create a new group, check if the newName is allready in use.
      Group potentialDuplicate = Group.findByName(context,newName);
     
      if (potentialDuplicate == null)
        {
        // All good, create the new group.
        group = Group.create(context);
        group.setName(newName);
        }
      else
      {
        // The name is allready in use, return in error.
          result.setContinue(false);
          result.addError("group_name");
          result.addError("group_name_duplicate");
          result.setOutcome(false);
          result.setMessage(new Message("default","The group name is allready in use"));
         
          return result;
      }
    }
    else
    {
      group = Group.find(context,groupID);
      String name = group.getName();
     
      // Only update the name if there has been a change.
      if (newName != null && newName.length() > 0 && !name.equals(newName))
      {
        // The group name is to be updated, check if the newName is allready in use.
        Group potentialDuplicate = Group.findByName(context,newName);
       
        if (potentialDuplicate == null)
          {
          // All good, update the name
          group.setName(newName);
          }
        else
        {
          // The name is allready in use, return in error.
            result.setContinue(false);
            result.addError("group_name");
            result.addError("group_name_duplicate");
            result.setOutcome(false);
            result.setMessage(new Message("default","The group name is allready in use"));
           
            return result;
        }
      }
    }
View Full Code Here


           
            int id = item.getID();
            String name = bitstream.getName();
            String url = makeBitstreamLink(item, bitstream);
            String format = bitstreamFormat.getShortDescription();
            Message support = ReviewStep.T_unknown;
            if (bitstreamFormat.getSupportLevel() == BitstreamFormat.KNOWN)
                support = T_known;
            else if (bitstreamFormat.getSupportLevel() == BitstreamFormat.SUPPORTED)
                support = T_supported;
           
View Full Code Here

            DCPersonName dp = new DCPersonName(value);
            t1.setValue(dp.getLastName());
            t2.setValue(dp.getFirstNames());
            if (isFieldMessage(field, "help.last"))
            {
                Message m = getFieldMessage(field, "help.last");
                t1.setLabel(m);
                t1.setHelp(m);
            }
            else
            {
                String m = getFieldLabel(field, "help.last");
                t1.setLabel(m);
                t1.setHelp(m);
            }
            if (isFieldMessage(field, "help.first"))
            {
                Message m = getFieldMessage(field, "help.first");
                t2.setLabel(m);
                t2.setHelp(m);
            }
            else
            {
                String m = getFieldLabel(field, "help.first");
                t2.setLabel(m);
                t2.setHelp(m);
            }
        }
        else
        {
            t1.setValue(value);
            if (isFieldMessage(field, "help"))
            {
                Message m = getFieldMessage(field, "help");
                t1.setLabel(m);
                t1.setHelp(m);
            }
            else
            {
View Full Code Here

            if (pop instanceof Collection)
            {
              Collection collection = (Collection) pop;
              String name = collection.getMetadata("name");
              if (name == null || name.length() == 0)
                pageMeta.addTrailLink(contextPath + "/handle/" + pop.getHandle(), new Message("default","xmlui.general.untitled") );
              else
                pageMeta.addTrailLink(contextPath + "/handle/" + pop.getHandle(), name);
            }
            else if (pop instanceof Community)
            {
              Community community = (Community) pop;
              String name = community.getMetadata("name");
              if (name == null || name.length() == 0)
                pageMeta.addTrailLink(contextPath + "/handle/" + pop.getHandle(), new Message("default","xmlui.general.untitled") );
              else
                pageMeta.addTrailLink(contextPath + "/handle/" + pop.getHandle(), name);
            }

        }
View Full Code Here

      if (event == null)
        continue;
     
      shown++;
     
      Message timeStampMessage = null;
          long ago = System.currentTimeMillis() - event.getTimeStamp();
         
          if (ago > 2*60*60*1000)
            timeStampMessage = T_hours.parameterize((ago / (60*60*1000)));
          else if (ago > 60*1000)
 
View Full Code Here

        //Create a new section for this Initial Questions information
        List initSection = reviewList.addList("submit-review-" + this.stepAndPage, List.TYPE_FORM);
        initSection.setHead(T_head);
       
        //add information to review
        Message multipleTitles = ReviewStep.T_no;
        if (submission.hasMultipleTitles())
            multipleTitles = ReviewStep.T_yes;
   
        Message publishedBefore = ReviewStep.T_no;
        if (submission.isPublishedBefore())
            publishedBefore = ReviewStep.T_yes;
       
        initSection.addLabel(T_multiple_titles);
        initSection.addItem(multipleTitles);
View Full Code Here

      policy.update();
      context.commit();
     
      result.setContinue(true);
      result.setOutcome(true);
      if (added) result.setMessage(new Message("default","A new policy was created successfully"));
      else result.setMessage(new Message("default","The policy was edited successfully"));
     
      result.setParameter("policyID", policy.getID());
     
    return result;
  }
View Full Code Here

      policyDeleted.delete();
      }
 
    result.setContinue(true);
    result.setOutcome(true);
    result.setMessage(new Message("default","The policies were deleted successfully"));
   
    return result;
  }
View Full Code Here

      }
      } 
   
    result.setContinue(true);
    result.setOutcome(true);
    result.setMessage(new Message("default","The policies were added successfully!"));
   
    return result;
  }
View Full Code Here

        }
    }
   
    result.setContinue(true);
    result.setOutcome(true);
    result.setMessage(new Message("default","The policies for the selected collections were cleared."));
   
    return result;
  }
View Full Code Here

TOP

Related Classes of org.dspace.app.xmlui.wing.Message

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.