Package org.apache.wookie.beans

Examples of org.apache.wookie.beans.IWidgetInstance


    download = fac.getUnzippedWidgetDirectory(); //download is where we unzipped the widget
   
    //
    // Create an instance of it
    //
    IWidgetInstance instance = new WidgetInstanceMock();
   
    //
    // Flatpack it
    //
    FlatpackFactory flatfac = new FlatpackFactory(instance);
View Full Code Here


    download = fac.getUnzippedWidgetDirectory();
   
    //
    // Create an instance of it
    //
    IWidgetInstance instance = new WidgetInstanceMock();
   
    //
    // Flatpack it
    //
    FlatpackFactory flatfac = new FlatpackFactory(instance);
View Full Code Here

    download = fac.getUnzippedWidgetDirectory(); //download is where we unzipped the widget
   
    //
    // Create an instance of it
    //
    IWidgetInstance instance = new WidgetInstanceMock();
    ArrayList<IPreference> prefs = new ArrayList<IPreference>();
    IPreference pref = new PreferenceMock();
    pref.setDkey("hiScore");
    pref.setDvalue("1000");
    pref.setReadOnly(false);
    prefs.add(pref);
    instance.setPreferences(prefs);
   
    //
    // Flatpack it
    //
    FlatpackFactory flatfac = new FlatpackFactory(instance);
View Full Code Here

    download = fac.getUnzippedWidgetDirectory(); //download is where we unzipped the widget
   
    //
    // Create an instance of it
    //
    IWidgetInstance instance = new WidgetInstanceMock();
    ArrayList<IPreference> prefs = new ArrayList<IPreference>();
    IPreference pref = new PreferenceMock();
    pref.setDkey("moderator");
    pref.setDvalue("true");
    pref.setReadOnly(false);
    prefs.add(pref);
    instance.setPreferences(prefs);
   
    //
    // Flatpack it
    //
    FlatpackFactory flatfac = new FlatpackFactory(instance);
View Full Code Here

        widgetGuid = widget.getIdentifier();
       
        //
        // check that the Widget Instance does not yet exist
        //
        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByGuid(apiKey, "test", "test-shared-data-key", widgetGuid);
        assertNull(widgetInstance);
       
        //
        // Create the Widget Instance
        //
        widgetInstance = persistenceManager.newInstance(IWidgetInstance.class);
       
        //
        // Set some properties, including preferences
        //
        widgetInstance.setApiKey(apiKey);
        widgetInstance.setWidget(widget);
        widgetInstance.setIdKey("test");
        widgetInstance.setLang("en");
        widgetInstance.setNonce("nonce-test");
        widgetInstance.setOpensocialToken("");
        widgetInstance.setSharedDataKey("test-shared-data-key");
        widgetInstance.setShown(true);
        widgetInstance.setUserId("test");
        IPreference widgetInstancePreference = persistenceManager.newInstance(IPreference.class);
        widgetInstancePreference.setDkey("sharedDataKey");
        widgetInstancePreference.setDvalue("test-shared-data-key");
        widgetInstancePreference.setReadOnly(true);
        widgetInstance.getPreferences().add(widgetInstancePreference);
        //
        // Save the widget instance
        //
        persistenceManager.save(widgetInstance);

        //
        // create a participant
        //
        IParticipant participant = persistenceManager.newInstance(IParticipant.class);
        //participant.setWidget(widget);
        participant.setSharedDataKey("test-shared-data-key");
        participant.setParticipantId("test");
        participant.setParticipantDisplayName("");
        participant.setParticipantThumbnailUrl("");
        persistenceManager.save(participant);

        //
        // commit and close persistence manager transaction
        //
        persistenceManager.commit();
        PersistenceManagerFactory.closePersistenceManager();

        //
        // allocate and begin persistence manager transaction
        //
        persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        persistenceManager.begin();
       
        //
        // Get the widget instance created in the previous transaction
        //
        widgets = persistenceManager.findAll(IWidget.class);
        widget = widgets[0];
        IWidgetInstance widgetInstance0 = persistenceManager.findWidgetInstanceByGuid(apiKey, "test", "test-shared-data-key", widgetGuid);
        assertNotNull(widgetInstance0);
        widgetGuid = widget.getIdentifier();
       
        //
        // Get the widget instance created in the previous transaction via "widget GUID"
        //
        IWidgetInstance widgetInstance1 = persistenceManager.findWidgetInstanceByGuid(apiKey, "test", "test-shared-data-key", widgetGuid);
        assertNotNull(widgetInstance1);
        assertEquals(widgetInstance0, widgetInstance1);
       
        //
        // Get the widget instance created in the previous transaction via instance_idkey
        //
        IWidgetInstance widgetInstance2 = persistenceManager.findWidgetInstanceByIdKey("test");
        assertNotNull(widgetInstance2);
        assertEquals(widgetInstance0, widgetInstance2);
       
        //
        // Get the participant created in the previous transaction by widget instance
View Full Code Here

        widgetGuid = widget.getGuid();
       
        //
        // check that the Widget Instance does not yet exist
        //
        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByGuid(apiKey, "test", "test-shared-data-key", widgetGuid);
        assertNull(widgetInstance);
       
        //
        // Create the Widget Instance
        //
        widgetInstance = persistenceManager.newInstance(IWidgetInstance.class);
       
        //
        // Set some properties, including preferences
        //
        widgetInstance.setApiKey(apiKey);
        widgetInstance.setWidget(widget);
        widgetInstance.setIdKey("test");
        widgetInstance.setLang("en");
        widgetInstance.setNonce("nonce-test");
        widgetInstance.setOpensocialToken("");
        widgetInstance.setSharedDataKey("test-shared-data-key");
        widgetInstance.setShown(true);
        widgetInstance.setUserId("test");
        IPreference widgetInstancePreference = persistenceManager.newInstance(IPreference.class);
        widgetInstancePreference.setDkey("sharedDataKey");
        widgetInstancePreference.setDvalue("test-shared-data-key");
        widgetInstancePreference.setReadOnly(true);
        widgetInstance.getPreferences().add(widgetInstancePreference);
        //
        // Save the widget instance
        //
        persistenceManager.save(widgetInstance);

        //
        // create a participant
        //
        IParticipant participant = persistenceManager.newInstance(IParticipant.class);
        //participant.setWidget(widget);
        participant.setSharedDataKey("test-shared-data-key");
        participant.setParticipantId("test");
        participant.setParticipantDisplayName("");
        participant.setParticipantThumbnailUrl("");
        persistenceManager.save(participant);

        //
        // commit and close persistence manager transaction
        //
        persistenceManager.commit();
        PersistenceManagerFactory.closePersistenceManager();

        //
        // allocate and begin persistence manager transaction
        //
        persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        persistenceManager.begin();
       
        //
        // Get the widget instance created in the previous transaction
        //
        widgets = persistenceManager.findAll(IWidget.class);
        widget = widgets[0];
        IWidgetInstance widgetInstance0 = persistenceManager.findWidgetInstanceByGuid(apiKey, "test", "test-shared-data-key", widgetGuid);
        assertNotNull(widgetInstance0);
        widgetGuid = widget.getGuid();
       
        //
        // Get the widget instance created in the previous transaction via "widget GUID"
        //
        IWidgetInstance widgetInstance1 = persistenceManager.findWidgetInstanceByGuid(apiKey, "test", "test-shared-data-key", widgetGuid);
        assertNotNull(widgetInstance1);
        assertEquals(widgetInstance0, widgetInstance1);
       
        //
        // Get the widget instance created in the previous transaction via instance_idkey
        //
        IWidgetInstance widgetInstance2 = persistenceManager.findWidgetInstanceByIdKey("test");
        assertNotNull(widgetInstance2);
        assertEquals(widgetInstance0, widgetInstance2);
       
        //
        // Get the participant created in the previous transaction by widget instance
View Full Code Here

    download = fac.getUnzippedWidgetDirectory(); //download is where we unzipped the widget
   
    //
    // Create an instance of it
    //
    IWidgetInstance instance = new WidgetInstanceMock();
   
    //
    // Flatpack it
    //
    FlatpackFactory flatfac = new FlatpackFactory(instance);
View Full Code Here

    download = fac.getUnzippedWidgetDirectory(); //download is where we unzipped the widget
   
    //
    // Create an instance of it
    //
    IWidgetInstance instance = new WidgetInstanceMock();
   
    //
    // Flatpack it
    //
    FlatpackFactory flatfac = new FlatpackFactory(instance);
View Full Code Here

    download = fac.getUnzippedWidgetDirectory();
   
    //
    // Create an instance of it
    //
    IWidgetInstance instance = new WidgetInstanceMock();
   
    //
    // Flatpack it
    //
    FlatpackFactory flatfac = new FlatpackFactory(instance);
View Full Code Here

    download = fac.getUnzippedWidgetDirectory(); //download is where we unzipped the widget
   
    //
    // Create an instance of it
    //
    IWidgetInstance instance = new WidgetInstanceMock();
    ArrayList<IPreference> prefs = new ArrayList<IPreference>();
    IPreference pref = new PreferenceMock();
    pref.setDkey("hiScore");
    pref.setDvalue("1000");
    pref.setReadOnly(false);
    prefs.add(pref);
    instance.setPreferences(prefs);
   
    //
    // Flatpack it
    //
    FlatpackFactory flatfac = new FlatpackFactory(instance);
View Full Code Here

TOP

Related Classes of org.apache.wookie.beans.IWidgetInstance

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.