1 5 6 package org.exoplatform.portlets.wsrp.component.model; 7 8 import org.exoplatform.services.wsrp.consumer.Producer; 9 import org.exoplatform.services.wsrp.exceptions.WSRPException; 10 import org.exoplatform.services.wsrp.type.PortletDescription; 11 12 17 public class ProducerData { 18 19 private boolean select_ ; 20 private Producer producer; 21 22 23 public ProducerData(Producer producer) { 24 select_ = false ; 25 this.producer = producer; 26 } 27 28 public String getProducerName() { return producer.getName() ; } 29 30 public boolean isSelect() {return select_ ;} 31 public void setSelect(boolean b) { select_ = b ; } 32 33 public Producer getProducer() { 34 return producer ; 35 } 36 37 public PortletDescription getOfferedPortlet(String portletName) { 38 PortletDescription[] array = getOfferedPortlets(); 39 if(array == null) 40 return null; 41 for (int i = 0; i < array.length; i++) { 42 PortletDescription portletDescription = array[i]; 43 if(portletDescription.getPortletHandle().equals(portletName)) 44 return portletDescription; 45 } 46 return null; 47 } 48 49 public PortletDescription[] getOfferedPortlets() { 50 try { 51 return producer.getServiceDescription().getOfferedPortlets() ; 52 } catch (WSRPException e) { 53 e.printStackTrace(); 54 return null; 55 } 56 } 57 58 } 59 | Popular Tags |