Examples of routeSpecification()


Examples of org.qi4j.sample.dcicargo.sample_a.communication.query.dto.CargoDTO.routeSpecification()

                item.add( new LinkPanel( "trackingId", CargoDetailsPage.class, trackingId ) );

                item.add( new Label( "origin", cargo.origin().get().getCode() ) );

                item.add( new Label( "destination", cargo.routeSpecification().get().destination().get().getCode() ) );

                item.add( new Label( "deadline", new Model<Date>( cargo.routeSpecification()
                                                                      .get()
                                                                      .arrivalDeadline()
                                                                      .get() ) ) );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.communication.query.dto.CargoDTO.routeSpecification()

                item.add( new Label( "origin", cargo.origin().get().getCode() ) );

                item.add( new Label( "destination", cargo.routeSpecification().get().destination().get().getCode() ) );

                item.add( new Label( "deadline", new Model<Date>( cargo.routeSpecification()
                                                                      .get()
                                                                      .arrivalDeadline()
                                                                      .get() ) ) );

                item.add( new Label( "routingStatus", routingStatus.toString() ).add( new ErrorColor( routingStatus == RoutingStatus.MISROUTED ) ) );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.communication.query.dto.CargoDTO.routeSpecification()

        Label label = new Label( "text", new StringResourceModel(
            "expectedEvent.${expectedEvent}", this, new Model<ValueMap>( map ) ) );
        add( label );

        CargoDTO cargo = cargoModel.getObject();
        Location destination = cargo.routeSpecification().get().destination().get();

        if( cargo.itinerary().get() == null )
        {
            map.put( "expectedEvent", "ROUTE" );
            return;
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.communication.query.dto.CargoDTO.routeSpecification()

        HandlingEvent previousEvent = cargo.delivery().get().lastHandlingEvent().get();
        if( previousEvent == null )
        {
            map.put( "expectedEvent", "RECEIVE" );
            map.put( "location", cargo.routeSpecification().get().origin().get().getString() );
            return;
        }

        Location lastLocation = previousEvent.location().get();
        if( previousEvent.handlingEventType().get() == HandlingEventType.CLAIM && lastLocation == destination )
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.communication.query.dto.CargoDTO.routeSpecification()

            CommonQueries fetch = new CommonQueries();
            CargoDTO cargo = fetch.cargo( trackingId ).getObject();
            List<String> locations = fetch.unLocodes();

            origin = cargo.origin().get().getCode();
            oldDestination = destination = cargo.routeSpecification().get().destination().get().getCode();

            final FeedbackPanel feedback = new FeedbackPanel( "usecaseFeedback" );
            final SelectorInForm destinationSelector = new SelectorInForm(
                "destination", "Destination", locations, this, "origin" );
            final ComponentFeedbackPanel destinationFeedback = new ComponentFeedbackPanel(
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.communication.query.dto.CargoDTO.routeSpecification()

                }
                add( new Label( "transportStatus", new StringResourceModel(
                    "transportStatus.${status}", this, new Model<ValueMap>( map ) ) ) );

                // ETA ----------------------------------------------------------------------
                String destination = cargo.routeSpecification().get().destination().get().getString();
                Date eta = cargo.delivery().get().eta().get();
                String etaString = eta == null ? "?" : new SimpleDateFormat( "yyyy-MM-dd" ).format( eta );
                add( new Label( "eta", new StringResourceModel(
                    "eta", this, null, Model.of( destination ), Model.of( etaString ) ) ) );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.communication.query.dto.CargoDTO.routeSpecification()

        super( new PageParameters().set( 0, trackingId ) );

        IModel<CargoDTO> cargoModel = new CommonQueries().cargo( trackingId );
        CargoDTO cargo = cargoModel.getObject();
        Delivery delivery = cargo.delivery().get();
        RouteSpecification routeSpecification = cargo.routeSpecification().get();
        final RoutingStatus routingStatus = delivery.routingStatus().get();
        Boolean isMisrouted = routingStatus == RoutingStatus.MISROUTED;

        add( new PrevNext( "prevNext", CargoDetailsPage.class, trackingId ) );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.Cargo.routeSpecification()

        // Test cargo data
        assertThat( cargo.trackingId().get(), is( equalTo( trackingId ) ) );
        assertThat( cargo.origin().get(), is( equalTo( HONGKONG ) ) );

        // Test route specification
        assertThat( cargo.routeSpecification().get().destination().get(), is( equalTo( STOCKHOLM ) ) );
        // day(17) here is calculated a few milliseconds after initial day(17), so it will be later...
        assertThat( cargo.routeSpecification().get().arrivalDeadline().get(),  equalTo( day( 17 )  ));

        // (Itinerary is not assigned yet)
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.Cargo.routeSpecification()

        assertThat( cargo.origin().get(), is( equalTo( HONGKONG ) ) );

        // Test route specification
        assertThat( cargo.routeSpecification().get().destination().get(), is( equalTo( STOCKHOLM ) ) );
        // day(17) here is calculated a few milliseconds after initial day(17), so it will be later...
        assertThat( cargo.routeSpecification().get().arrivalDeadline().get(),  equalTo( day( 17 )  ));

        // (Itinerary is not assigned yet)

        // Test derived delivery snapshot
        Delivery delivery = cargo.delivery().get();
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.Cargo.routeSpecification()

        // Check possible routes
        for (Itinerary itinerary : routeCandidates)
        {
            assertThat( "First load location equals origin location.",
                        itinerary.firstLeg().loadLocation().get(),
                        is( equalTo( cargo.routeSpecification().get().origin().get() ) ) );
            assertThat( "Last unload location equals destination location.",
                        itinerary.lastLeg().unloadLocation().get(),
                        is( equalTo( cargo.routeSpecification().get().destination().get() ) ) );
            assertThat( "Cargo will be delivered in time.",
                        itinerary.finalArrivalDate().before( cargo.routeSpecification().get().arrivalDeadline().get() ),
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.