Package org.dspace.app.xmlui.utils

Examples of org.dspace.app.xmlui.utils.UIException


    for (String id : bitstreamIDs)
    {
      String[] parts = id.split("/");
     
      if (parts.length != 2)
        throw new UIException("Unable to parse id into bundle and bitstream id: "+id);
     
      int bundleID = Integer.valueOf(parts[0]);
      int bitstreamID = Integer.valueOf(parts[1]);
     
      Bundle bundle = Bundle.find(context, bundleID);
View Full Code Here


    } else if (split.length == 3) {
      parts[0] = split[0];
      parts[1] = split[1];
      parts[2] = split[2];
    } else {
      throw new UIException("Unable to parse metedata field name: "+name);
    }
    return parts;
  }
View Full Code Here

  public static int createCollectionDefaultReadGroup(Context context, int collectionID) throws SQLException, AuthorizeException, UIException
  {
    int roleID = getCollectionDefaultRead(context, collectionID);
   
    if (roleID != 0)
      throw new UIException("Unable to create a new default read group because either the group allready exists or multiple groups are assigned the default privleges.");
   
    Collection collection = Collection.find(context,collectionID);
    Group role = Group.create(context);
    role.setName("COLLECTION_"+collection.getID() +"_DEFAULT_READ");
   
View Full Code Here

   
    int roleID = getCollectionDefaultRead(context, collectionID);
   
    if (roleID < 1)
    {
      throw new UIException("Unable to delete the default read role because the role is either allready assigned to the anonymous group or multiple groups are assigned the default priveleges.");
    }
   
    Collection collection = Collection.find(context,collectionID);
    Group role = Group.find(context, roleID);
    Group anonymous = Group.find(context,0);
View Full Code Here

                        }
                    }
                }
                catch (SortException se)
                {
                    throw new UIException("Unable to get sort options", se);
                }
            }
           
            params.scope.setBrowseIndex(bi);
            params.scope.setSortBy(sortBy);
           
            params.scope.setJumpToItem(RequestUtils.getIntParameter(request, BrowseParams.JUMPTO_ITEM));
            params.scope.setOrder(request.getParameter(BrowseParams.ORDER));
            int offset = RequestUtils.getIntParameter(request, BrowseParams.OFFSET);
            params.scope.setOffset(offset > 0 ? offset : 0);
            params.scope.setResultsPerPage(RequestUtils.getIntParameter(request,
                    BrowseParams.RESULTS_PER_PAGE));
            params.scope.setStartsWith(URLDecode(request.getParameter(BrowseParams.STARTS_WITH)));
            String filterValue = request.getParameter(BrowseParams.FILTER_VALUE[0]);
            if (filterValue == null)
            {
                filterValue = request.getParameter(BrowseParams.FILTER_VALUE[1]);
                params.scope.setAuthorityValue(filterValue);
            }
           
            params.scope.setFilterValue(filterValue);
            params.scope.setJumpToValue(URLDecode(request.getParameter(BrowseParams.JUMPTO_VALUE)));
            params.scope.setJumpToValueLang(URLDecode(request.getParameter(BrowseParams.JUMPTO_VALUE_LANG)));
            params.scope.setFilterValueLang(URLDecode(request.getParameter(BrowseParams.FILTER_VALUE_LANG)));

            // Filtering to a value implies this is a second level browse
            if (params.scope.getFilterValue() != null)
                params.scope.setBrowseLevel(1);

            // if year and perhaps month have been selected, we translate these
            // into "startsWith"
            // if startsWith has already been defined then it is overwritten
            if (params.year != null && !"".equals(params.year) && !"-1".equals(params.year))
            {
                String startsWith = params.year;
                if ((params.month != null) && !"-1".equals(params.month)
                        && !"".equals(params.month))
                {
                    // subtract 1 from the month, so the match works
                    // appropriately
                    if ("ASC".equals(params.scope.getOrder()))
                    {
                        params.month = Integer.toString((Integer.parseInt(params.month) - 1));
                    }

                    // They've selected a month as well
                    if (params.month.length() == 1)
                    {
                        // Ensure double-digit month number
                        params.month = "0" + params.month;
                    }

                    startsWith = params.year + "-" + params.month;

                    if ("ASC".equals(params.scope.getOrder()))
                    {
                        startsWith = startsWith + "-32";
                    }
                }

                params.scope.setStartsWith(startsWith);
            }
        }
        catch (BrowseException bex)
        {
            throw new UIException("Unable to create browse parameters", bex);
        }

        this.userParams = params;
        return params;
    }
View Full Code Here

                this.browseInfo.setEtAl(params.etAl);
            }
        }
        catch (BrowseException bex)
        {
            throw new UIException("Unable to process browse", bex);
        }

        return this.browseInfo;
    }
View Full Code Here

    for (String id : idsString.split(","))
    {
      String[] parts = id.split("/");

      if (parts.length != 2)
        throw new UIException("Unable to parse id into bundle and bitstream id: "+id);

      int bitstreamID = Integer.valueOf(parts[1]);

      Bitstream bitstream = Bitstream.find(context,bitstreamID);
      bitstreams.add(bitstream);
View Full Code Here

        {
            return URLEncoder.encode(unencodedString,Constants.DEFAULT_ENCODING);
        }
        catch (UnsupportedEncodingException uee)
        {
            throw new UIException(uee);
        }

    }
View Full Code Here

            return URLDecoder.decode(encodedString, Constants.DEFAULT_ENCODING);
        }
        catch (UnsupportedEncodingException uee)
        {
            throw new UIException(uee);
        }

    }
View Full Code Here

  {
    int roleID = getCollectionDefaultRead(context, collectionID);
   
    if (roleID != 0)
        {
            throw new UIException("Unable to create a new default read group because either the group already exists or multiple groups are assigned the default privileges.");
        }
   
    Collection collection = Collection.find(context,collectionID);
    Group role = Group.create(context);
    role.setName("COLLECTION_"+collection.getID() +"_DEFAULT_READ");
View Full Code Here

TOP

Related Classes of org.dspace.app.xmlui.utils.UIException

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.