public PortletDefinitionImpl( IPortletType portletType, String fname, String name, String title, String applicationId, String portletName, boolean isFramework, IPortletDefinitionId Id) { Validate.notNull(portletType); Validate.notNull(name); Validate.notNull(fname); Validate.notNull(title); if (!isFramework) { Validate.notNull(applicationId); } Validate.notNull(portletName); this.internalPortletDefinitionId = Id.getLongId(); this.entityVersion = -1; this.portletPreferences = new PortletPreferencesImpl(); this.portletType = portletType; this.name = name; this.fname = fname; this.title = title; this.portletDescriptorKey = new PortletDescriptorKeyImpl(); this.portletDescriptorKey.setWebAppName(applicationId); this.portletDescriptorKey.setPortletName(portletName); this.portletDescriptorKey.setFrameworkPortlet(isFramework); }
@Before public void setup() throws Exception { MockitoAnnotations.initMocks(this); portletEntityCache = new PortletEntityCache(); when(portletEntityId.getStringId()).thenReturn("110_u18l1n1203_60"); when(portletDefinitionId.getLongId()).thenReturn(1010L); when(portletEntityDescriptor.getLayoutNodeId()).thenReturn("u18l1n1203"); when(portletEntityDescriptor.getPortletDefinitionId()).thenReturn(portletDefinitionId); when(portletEntityDescriptor.getPortletEntityId()).thenReturn(portletEntityId); when(portletEntityDescriptor.getUserId()).thenReturn(60); }
/** Used to initialize fields after persistence actions. */ @PostLoad @PostPersist @PostUpdate @PostRemove private void init() { if (this.internalPortletDefinitionId != -1 && (this.portletDefinitionId == null || this.portletDefinitionId.getLongId() != this.internalPortletDefinitionId)) { this.portletDefinitionId = PortletDefinitionIdImpl.create(this.internalPortletDefinitionId); } }
private PortletDefinitionBean( final MarketplacePortletDefinition mpd, final Locale locale, Boolean favorite) { this.id = mpd.getPortletDefinitionId().getLongId(); this.fname = mpd.getFName(); this.title = mpd.getTitle(locale.toString()); this.name = mpd.getName(locale.toString()); this.description = mpd.getDescription(locale.toString()); this.state = mpd.getLifecycleState().toString(); this.typeId = mpd.getType().getId(); this.averageRating = mpd.getRating(); this.ratingsCount = mpd.getUsersRated(); this.parameters = new HashMap<>(mpd.getParametersAsUnmodifiableMap()); this.keywords = mpd.getKeywords() != null ? Collections.unmodifiableList(mpd.getKeywords()) : EMPTY_KEYWORDS; this.favorite = favorite; } }
portletDefinition.getPortletDefinitionId().getLongId(), fname, portletDefinition.getTitle(locale.toString()),