Package slash.navigation.gpx.binding11

Examples of slash.navigation.gpx.binding11.WptType


            gpx = getCatalog().fetchGpx(getUrl());

            // avoid subsequent NullPointerExceptions on server errors
            if (gpx == null) {
                gpx = new GpxType();
                gpx.setMetadata(new MetadataType());
            }
        }
        return gpx;
    }
View Full Code Here


            return null;
    }

    private static String createUserXml(String userName, String password, String firstName, String lastName, String email) throws IOException {
        ObjectFactory objectFactory = new ObjectFactory();
        MetadataType metadataType = objectFactory.createMetadataType();
        metadataType.setName(asUtf8(userName));

        UserextensionType userextensionType = new slash.navigation.gpx.routecatalog10.ObjectFactory().createUserextensionType();
        userextensionType.setEmail(asUtf8(email));
        userextensionType.setFirstname(asUtf8(firstName));
        userextensionType.setLastname(asUtf8(lastName));
        userextensionType.setPassword(asUtf8(password));

        ExtensionsType extensionsType = objectFactory.createExtensionsType();
        extensionsType.getAny().add(userextensionType);
        metadataType.setExtensions(extensionsType);

        GpxType gpxType = GpxUtil.createGpxType();
        gpxType.setMetadata(metadataType);

        return GpxUtil.toXml(gpxType);
View Full Code Here

        GpxUtil.marshal11(gpxType, writer);
        return writer.toString();
    }

    protected String createCategoryXml(String name) throws JAXBException {
        MetadataType metadataType = gpxFactory.createMetadataType();

        metadataType.setName(name);

        GpxType gpxType = createGpxType();
        gpxType.setMetadata(metadataType);

        return toXml(gpxType);
View Full Code Here

        return toXml(gpxType);
    }

    protected String createRouteXml(String category, Integer fileKey, String description) throws JAXBException {
        MetadataType metadataType = gpxFactory.createMetadataType();

        metadataType.setDesc(description);
        metadataType.setKeywords(category);

        GpxType gpxType = createGpxType();
        gpxType.setMetadata(metadataType);

        if (fileKey != null) {
View Full Code Here

        return toXml(gpxType);
    }

    protected String createUserXml(String userName, String password, String firstName, String lastName, String email) throws JAXBException {
        MetadataType metadataType = gpxFactory.createMetadataType();
        metadataType.setName(userName);

        UserextensionType userextensionType = rcFactory.createUserextensionType();
        userextensionType.setEmail(email);
        userextensionType.setFirstname(firstName);
        userextensionType.setLastname(lastName);
        userextensionType.setPassword(password);

        ExtensionsType extensionsType = gpxFactory.createExtensionsType();
        extensionsType.getAny().add(userextensionType);
        metadataType.setExtensions(extensionsType);

        GpxType gpxType = createGpxType();
        gpxType.setMetadata(metadataType);
        return toXml(gpxType);
    }
View Full Code Here

        else
            return null;
    }

    private static String createUserXml(String userName, String password, String firstName, String lastName, String email) throws IOException {
        ObjectFactory objectFactory = new ObjectFactory();
        MetadataType metadataType = objectFactory.createMetadataType();
        metadataType.setName(asUtf8(userName));

        UserextensionType userextensionType = new slash.navigation.gpx.routecatalog10.ObjectFactory().createUserextensionType();
        userextensionType.setEmail(asUtf8(email));
        userextensionType.setFirstname(asUtf8(firstName));
        userextensionType.setLastname(asUtf8(lastName));
        userextensionType.setPassword(asUtf8(password));

        ExtensionsType extensionsType = objectFactory.createExtensionsType();
        extensionsType.getAny().add(userextensionType);
        metadataType.setExtensions(extensionsType);

        GpxType gpxType = GpxUtil.createGpxType();
        gpxType.setMetadata(metadataType);
View Full Code Here

        GpxType gpxType = createGpxType();
        gpxType.setMetadata(metadataType);

        if (fileKey != null) {
            RteType rteType = gpxFactory.createRteType();
            LinkType linkType = gpxFactory.createLinkType();
            linkType.setHref(FILES_URL + fileKey);
            rteType.getLink().add(linkType);
            gpxType.getRte().add(rteType);
        }

        return toXml(gpxType);
    }
View Full Code Here

        GregorianCalendar actualCal = gpxType.getMetadata().getTime().toGregorianCalendar();
        actualCal.setTimeZone(expectedCal.getTimeZone());
        assertTrue(actualCal.before(expectedCal));

        assertEquals(1, gpxType.getRte().size());
        RteType rteType = gpxType.getRte().get(0);
        assertEquals(Integer.toString(routeKey), rteType.getName());
        assertEquals("Description" + fileKey, rteType.getDesc());
        assertEquals(FILES_URL + fileKey, rteType.getLink().get(0).getHref());
    }
View Full Code Here

            return creator;
        return getRte().getSrc();
    }

    private String getRteLinkHref() throws IOException {
        RteType rte = getRte();
        return rte != null ? rte.getLink().get(0).getHref() : null;
    }
View Full Code Here

    }

    public GarminFlightPlanPosition asGarminFlightPlanPosition() {
        GarminFlightPlanPosition position = new GarminFlightPlanPosition(getLongitude(), getLatitude(), getElevation(), getDescription());
        position.setWaypointType(UserWaypoint);
        WptType wptType = getOrigin(WptType.class);
        if (wptType != null) {
            String type = trim(wptType.getType());
            if (type != null) {
                WaypointType waypointType = WaypointType.fromValue(type);
                position.setWaypointType(waypointType);

                String name = wptType.getName();
                if (name != null && name.length() >= 2)
                    position.setCountryCode(CountryCode.fromValue(name.substring(0, 2)));
            }
            String description = trim(wptType.getCmt());
            if (description != null) {
                position.setDescription(description);
            }
        }
        return position;
View Full Code Here

TOP

Related Classes of slash.navigation.gpx.binding11.WptType

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.