Package org.exoplatform.application.gadget.impl

Examples of org.exoplatform.application.gadget.impl.GadgetDefinition


      String gadgetURL = getGadgetURL();
      GadgetSpec spec = new GadgetSpec(Uri.parse(gadgetURL), gadget);
      ModulePrefs prefs = spec.getModulePrefs();

      //
      GadgetDefinition def = registry.addGadget(name);

      //
      String description = prefs.getDescription();
      String thumbnail = prefs.getThumbnail().toString();
      String title = getGadgetTitle(prefs, name);
      String referenceURL = prefs.getTitleUrl().toString();

      //
      log.info("Importing gadget name=" + name + " description=" + description + " thumbnail=" + thumbnail + " title=" +
               thumbnail + " title=" + title);

      //
      def.setDescription(description);
      def.setThumbnail(thumbnail); // Do something better than that
      def.setTitle(title);
      def.setReferenceURL(referenceURL);
      def.setLocal(local);

      //
      if (local)
      {
         LocalGadgetData data = (LocalGadgetData)def.getData();

         //
         String fileName = getName(gadgetPath);
         data.setFileName(fileName);

         // Import resource
         folder = data.getResources();
         String folderPath = getParent(gadgetPath);
         visitChildren(folderPath);
         folder = null;
      }
      else
      {
         RemoteGadgetData data = (RemoteGadgetData)def.getData();

         // Set remote URL
         data.setURL(gadgetPath);
      }
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.application.gadget.impl.GadgetDefinition

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.