Package org.apache.wookie.beans.util

Examples of org.apache.wookie.beans.util.IPersistenceManager.newInstance()


        IWidget [] widgets = persistenceManager.findAll(IWidget.class);
        IWidget widget = widgets[0];       
        widgetGuid = widget.getGuid();
        IWidgetInstance widgetInstance = persistenceManager.findWidgetInstanceByGuid(apiKey, "test", "test-shared-data-key", widgetGuid);
        assertNull(widgetInstance);
        widgetInstance = persistenceManager.newInstance(IWidgetInstance.class);
        widgetInstance.setApiKey(apiKey);
        widgetInstance.setWidget(widget);
        widgetInstance.setIdKey("test");
        widgetInstance.setLang("en");
        widgetInstance.setNonce("nonce-test");
View Full Code Here


        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);
        persistenceManager.save(widgetInstance);
View Full Code Here

        widgetInstancePreference.setReadOnly(true);
        widgetInstance.getPreferences().add(widgetInstancePreference);
        persistenceManager.save(widgetInstance);

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

        participant.setParticipantDisplayName("");
        participant.setParticipantThumbnailUrl("");
        persistenceManager.save(participant);

        // create server feature
        IServerFeature serverFeature = persistenceManager.newInstance(IServerFeature.class);
        serverFeature.setFeatureName("test-feature-name");
        serverFeature.setClassName("test.feature.class.name");
        persistenceManager.save(serverFeature);

        // create access request
View Full Code Here

        serverFeature.setFeatureName("test-feature-name");
        serverFeature.setClassName("test.feature.class.name");
        persistenceManager.save(serverFeature);

        // create access request
        IAccessRequest accessRequest = persistenceManager.newInstance(IAccessRequest.class);
        accessRequest.setOrigin("localhost");
        accessRequest.setSubdomains(false);
        accessRequest.setGranted(true);
        accessRequest.setWidget(widget);
        persistenceManager.save(accessRequest);
View Full Code Here

        found=true;
      }
    }
    // didnt find it already set, so add new one
    if(!found){
      IWidgetDefault wd = persistenceManager.newInstance(IWidgetDefault.class);
      wd.setWidgetContext(widgetType);
      wd.setWidget(widget)
      persistenceManager.save(wd);
    }
  }
View Full Code Here

   * Return the "default widget" instance
   * @return
   */
  public static IWidgetInstance defaultInstance(String locale){
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWidgetInstance instance = persistenceManager.newInstance(IWidgetInstance.class);
    instance.setWidget(persistenceManager.findWidgetDefaultByType("unsupported")); //$NON-NLS-1$
    instance.setIdKey("0000");
    instance.setLang(locale);
    instance.setOpensocialToken("");
    return instance;
View Full Code Here

        boolean widgetTypesSet = false;
    if (widgetTypes!=null){
      for(int i=0;i<widgetTypes.length;i++){ 
        if(!doesServiceExistForWidget(widget.getId(), widgetTypes[i])){
            IWidgetType widgetType = persistenceManager.newInstance(IWidgetType.class);
          widgetType.setWidgetContext(widgetTypes[i]);
          widget.getWidgetTypes().add(widgetType);
          widgetTypesSet = true;
        }
      }
View Full Code Here

   */
  private void addWhiteListEntry(HttpServletRequest request) {
    Messages localizedMessages = LocaleHandler.localizeMessages(request);
    String uri = request.getParameter("newuri"); //$NON-NLS-1$
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    IWhitelist list = persistenceManager.newInstance(IWhitelist.class);
    list.setfUrl(uri);
    if(persistenceManager.save(list)){
      request.setAttribute("message_value", localizedMessages.getString("WidgetAdminServlet.2")); //$NON-NLS-1$ //$NON-NLS-2$
    }
    else{
View Full Code Here

        assertNull(widgetInstance);
       
        //
        // Create the Widget Instance
        //
        widgetInstance = persistenceManager.newInstance(IWidgetInstance.class);
       
        //
        // Set some properties, including preferences
        //
        widgetInstance.setApiKey(apiKey);
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.