Package org.apache.wicket.util.string

Examples of org.apache.wicket.util.string.StringValue


  @Override
  public StringValue getParameterValue(final String name)
  {
    for (IRequestParameters p : parameters)
    {
      StringValue value = p.getParameterValue(name);
      if (!value.isNull())
      {
        return value;
      }
    }
    return StringValue.valueOf((String)null);
View Full Code Here


    final INamedParameters parameters = url.getParameters();
   
    if (parameters != null)
    {
      // store the version in the request cycle
      StringValue versionValue = parameters.get(versionParameter);
      RequestCycle requestCycle = RequestCycle.get();
      if (versionValue.isEmpty() == false && requestCycle != null)
      {
        requestCycle.setMetaData(URL_VERSION, versionValue.toString());
      }

      // undecorate
      parameters.remove(versionParameter);
    }
View Full Code Here

        super(parameters);
       
        int indexedCount = parameters.getIndexedCount();
        RepeatingView indexedView = new RepeatingView("indexed");
        for (int i = 0; i < indexedCount; i++) {
            StringValue indexed = parameters.get(i);
            indexedView.add(new Label(indexedView.newChildId(), indexed.toString()));
        }
        add(indexedView);
       
        List<NamedPair> namedParameters = parameters.getAllNamed();
        ListView<NamedPair> namedView = new ListView<NamedPair>("named", namedParameters) {
View Full Code Here

        @Override
        protected byte[] getImageData(Attributes attributes) {

            PageParameters parameters = attributes.getParameters();
            StringValue name = parameters.get("name");
           
            byte[] imageBytes = null;
           
            if (name.isEmpty() == false) {
                imageBytes = getImageAsBytes(name.toString());

            }
            return imageBytes;
        }
View Full Code Here

    private BorrowTO borrow;

    public EditBorrow(final PageParameters parameters) {
        super(parameters);
        BorrowService borrowService = (BorrowService) ApplicationContextProvider.getApplicationContext().getBean("borrowService");
        StringValue borrowId = parameters.get("borrowId");
        borrow = borrowService.findBorrowByID(borrowId.toLong());

        Form<?> form = new Form("form") {
            @Override
            protected void onSubmit() {
                BorrowService borrowService = (BorrowService) ApplicationContextProvider.getApplicationContext().getBean("borrowService");
View Full Code Here

  super(parameters);
       
        BorrowService borrowService = (BorrowService) ApplicationContextProvider.getApplicationContext().getBean("borrowService");
       
        // RETURN BORROW
        StringValue borrowId = parameters.get("borrowId");
        if (!borrowId.isEmpty()) {
            BorrowTO borrow = borrowService.findBorrowByID(borrowId.toLong());
            borrowService.returnBooks(borrow, borrow.getTitlesTO());
            setResponsePage(ShowAllBorrow.class);
        }
       
        // EXTEND BORROW
        StringValue extend = parameters.get("extend");
        if (!extend.isEmpty()) {
            BorrowTO borrow = borrowService.findBorrowByID(extend.toLong());
           
            Calendar cal = Calendar.getInstance()
            cal.setTime(borrow.getExpirationDate())
            cal.add(Calendar.MONTH, 1); // add 1 month 
View Full Code Here

    private static final List<Genre> GENRES = Arrays.asList(Genre.values());
   
    public EditBook(final PageParameters parameters) {
  super(parameters);
        BookService bookService = (BookService) ApplicationContextProvider.getApplicationContext().getBean("bookService");
        StringValue bookId = parameters.get("bookId");
        if (bookId.isEmpty()) {
           book = new BookTO();
           add(new Label("titleMessage", new Model("Create book")));
        } else {
            book = bookService.findBookById(bookId.toLong());
            add(new Label("titleMessage", new Model("Edit book")));
        }
       
        Form<?> form = new Form("form") {
            @Override
View Full Code Here

   
    public ShowAllBook(final PageParameters parameters) {
  super(parameters);
       
        // DELETE ITEM
        StringValue bookId = parameters.get("bookId");
        if (!bookId.isEmpty()) {
            BookService bookService = (BookService) ApplicationContextProvider.getApplicationContext().getBean("bookService");
            bookService.deleteBook(bookService.findBookById(bookId.toLong()));
            setResponsePage(ShowAllBook.class);
        }
       
       BookService bookService = (BookService) ApplicationContextProvider.getApplicationContext().getBean("bookService");
       RepeatingView repeating = new RepeatingView("repeating");
View Full Code Here

           
            item.add(new BookmarkablePageLink<Void>("reserve", EditReservation.class, pageParameters));
            repeating.add(item);
        }
       
        StringValue readerId = parameters.get("readerId");
        if (!readerId.isEmpty()) {
            readerService.deleteReader(readerService.findReaderById(readerId.toLong()));
            setResponsePage(ShowAllReader.class);
        }

        BookmarkablePageLink addReaderLink = new BookmarkablePageLink<>(
                "addReader", EditReader.class);
View Full Code Here

                repeating.add(item);
            }
        }
       
        //delete reservation
        StringValue reservationId = parameters.get("reservationid");
        if (!reservationId.isEmpty()) {
            reservationService.deleteReservation(reservationService.findReservationByID(reservationId.toLong()));
            setResponsePage(BookReservation.class);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.string.StringValue

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.