use of org.apache.shindig.gadgets.spec.GadgetSpec in project liferay-ide by liferay.
the class ShindigUtil method getGadget.
public static com.liferay.opensocial.model.Gadget getGadget(PortletPreferences portletPreferences) throws Exception {
String url = portletPreferences.getValue("url", StringPool.BLANK);
if (Validator.isNull(url)) {
return null;
}
com.liferay.opensocial.model.Gadget gadget = new GadgetImpl();
GadgetSpec gadgetSpec = null;
try {
gadgetSpec = ShindigUtil.getGadgetSpec(url);
} catch (Exception e) {
throw new GadgetURLException(e);
}
ModulePrefs modulePrefs = gadgetSpec.getModulePrefs();
gadget.setName(modulePrefs.getTitle());
gadget.setUrl(url);
return gadget;
}
Aggregations