Package com.volantis.devrep.repository.api.devices

Examples of com.volantis.devrep.repository.api.devices.DefaultDevice


    // javadoc inherited.
    public Device getDevice(final HttpHeaders headers, final String defaultDeviceName)
            throws DeviceRepositoryException {

        DefaultDevice device = null;
        if (headers != null) {
            try {
                RepositoryConnection connection = repository.connect();
                try {
                    final DeviceIdentificationResult identificationResult =
                        DevicesHelper.getDevice(
                            connection, headers, accessor, unknownDevicesLogger, defaultDeviceName);
                    device = identificationResult.getDevice();
                    if (device != null) {
                        device.setIdentificationHeaderNames(
                            identificationResult.getHeaderNamesUsed());
                    }
                } finally {
                    repository.disconnect(connection);
                }
View Full Code Here


        request = new HttpServletRequestStub();
        context = new TestMarinerPageContext();
        Map policyMap = new HashMap();
        final InternalDevice internalDevice =
            INTERNAL_DEVICE_FACTORY.createInternalDevice(
                new DefaultDevice("Test-Device", policyMap, null));
        context.setDevice(internalDevice);
    }
View Full Code Here

                new TestPolicyDescriptorAccessor();
        accessor.addPolicyDescriptor(null, "policyname",
                new DefaultTextPolicyType());

        // Create a device to pass into the factory
        DefaultDevice device = new DefaultDevice(null, null, null) {
            public String getPolicyValue(String policy) {
                return "Policy Value";
            }
        };
View Full Code Here

                new TestPolicyDescriptorAccessor();
        accessor.addPolicyDescriptor(null, "policyname",
                new DefaultTextPolicyType());

        // Create a device to pass into the factory
        DefaultDevice device = new DefaultDevice(null, null, null) {
            public String getPolicyValue(String policy) {
                return null;
            }
        };
View Full Code Here

                new TestPolicyDescriptorAccessor();
        accessor.addPolicyDescriptor(null, "policyname",
                new DefaultOrderedSetPolicyType(new DefaultTextPolicyType()));

        // Create a device to pass into the factory
        DefaultDevice device = new DefaultDevice(null, null, null) {
            public String getPolicyValue(String policy) {
                return "item 1, item 2, item 3, item 4";
            }
        };
View Full Code Here

        // Create a device to pass into the factory
        final Map policies = new HashMap();
        policies.put("policyname.field1", "Some text");
        policies.put("policyname.field2", "true");
        policies.put("policyname.field3", "100");
        DefaultDevice device = new DefaultDevice(null, policies, null);

        // Create the factory
        PolicyValueFactory factory = new DefaultPolicyValueFactory(accessor);

        // Call the creation method on the factory
View Full Code Here

     * Tests cellspacing with a pane's table.
     */
    public void testOpenPaneCellspacing() throws Exception {
        privateSetUp();
        context.setDevice(INTERNAL_DEVICE_FACTORY.createInternalDevice(
            new DefaultDevice(DEVICE_NAME, new HashMap(), null)));
        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        PaneAttributes paneAttrs = new PaneAttributes();
        paneAttrs.setStyles(StylesBuilder.getDeprecatedStyles());
View Full Code Here

     * Tests cellspacing with a spatial format iterator's table.
     */
    public void testOpenSpatialFormatIteratorCellspacing() throws Exception {
        privateSetUp();
        context.setDevice(INTERNAL_DEVICE_FACTORY.createInternalDevice(
            new DefaultDevice(DEVICE_NAME, new HashMap(), null)));
        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        SpatialFormatIterator sfi = new SpatialFormatIterator(canvasLayout);

View Full Code Here

     * Tests cellspacing with a grid's table.
     */
    public void testOpenGridCellspacing() throws Exception {
        privateSetUp();
        context.setDevice(INTERNAL_DEVICE_FACTORY.createInternalDevice(
            new DefaultDevice(DEVICE_NAME, new HashMap(), null)));
        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        GridAttributes gridAttrs = new GridAttributes();
        gridAttrs.setStyles(StylesBuilder.getDeprecatedStyles());
View Full Code Here

             *         default device name
             */
            public DefaultDevice getDeviceFallbackChain(
                    RepositoryConnection connection,
                    String deviceName) {
                DefaultDevice device = null;
                if ("PC".equalsIgnoreCase(deviceName) ||
                        "WAP-Handset".equalsIgnoreCase(deviceName) ||
                        "Custom".equalsIgnoreCase(deviceName)) {
                    device = new DefaultDevice(deviceName, new HashMap(),
                        new PolicyValueFactory() {
                            public PolicyValue createPolicyValue(
                                DefaultDevice device, String policyName) {
                                return null;
                            }
View Full Code Here

TOP

Related Classes of com.volantis.devrep.repository.api.devices.DefaultDevice

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.