use of com.liferay.blade.workflow.asset.model.Qux in project liferay-blade-samples by liferay.
the class QuxModelImpl method equals.
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Qux)) {
return false;
}
Qux qux = (Qux) obj;
long primaryKey = qux.getPrimaryKey();
if (getPrimaryKey() == primaryKey) {
return true;
} else {
return false;
}
}
use of com.liferay.blade.workflow.asset.model.Qux in project liferay-blade-samples by liferay.
the class QuxModelImpl method toXmlString.
@Override
public String toXmlString() {
Map<String, Function<Qux, Object>> attributeGetterFunctions = getAttributeGetterFunctions();
StringBundler sb = new StringBundler(5 * attributeGetterFunctions.size() + 4);
sb.append("<model><model-name>");
sb.append(getModelClassName());
sb.append("</model-name>");
for (Map.Entry<String, Function<Qux, Object>> entry : attributeGetterFunctions.entrySet()) {
String attributeName = entry.getKey();
Function<Qux, Object> attributeGetterFunction = entry.getValue();
sb.append("<column><column-name>");
sb.append(attributeName);
sb.append("</column-name><column-value><![CDATA[");
sb.append(attributeGetterFunction.apply((Qux) this));
sb.append("]]></column-value></column>");
}
sb.append("</model>");
return sb.toString();
}
use of com.liferay.blade.workflow.asset.model.Qux in project liferay-blade-samples by liferay.
the class QuxLocalServiceImpl method addQux.
@Override
public Qux addQux(long userId, long groupId, ServiceContext serviceContext) throws PortalException {
User user = userLocalService.getUser(userId);
Qux qux = quxPersistence.create(counterLocalService.increment());
qux.setGroupId(groupId);
qux.setCompanyId(user.getCompanyId());
qux.setUserId(user.getUserId());
qux.setUserName(user.getFullName());
qux.setCreateDate(serviceContext.getCreateDate(null));
qux.setModifiedDate(serviceContext.getModifiedDate(null));
qux = quxPersistence.update(qux);
assetEntryLocalService.updateEntry(userId, qux.getGroupId(), qux.getCreateDate(), qux.getModifiedDate(), Qux.class.getName(), qux.getQuxId(), qux.getUuid(), 0, serviceContext.getAssetCategoryIds(), serviceContext.getAssetTagNames(), false, false, null, null, null, null, ContentTypes.TEXT, String.valueOf(qux.getPrimaryKey()), null, StringPool.BLANK, null, null, 0, 0, serviceContext.getAssetPriority());
WorkflowHandlerRegistryUtil.startWorkflowInstance(qux.getCompanyId(), qux.getGroupId(), qux.getUserId(), Qux.class.getName(), qux.getPrimaryKey(), qux, serviceContext);
return qux;
}
use of com.liferay.blade.workflow.asset.model.Qux in project liferay-blade-samples by liferay.
the class QuxLocalServiceImpl method updateQux.
@Override
public Qux updateQux(long quxId, ServiceContext serviceContext) throws PortalException {
Qux qux = quxPersistence.findByPrimaryKey(quxId);
qux.setModifiedDate(serviceContext.getModifiedDate(null));
qux = quxPersistence.update(qux);
WorkflowHandlerRegistryUtil.startWorkflowInstance(qux.getCompanyId(), qux.getGroupId(), qux.getUserId(), Qux.class.getName(), qux.getPrimaryKey(), qux, serviceContext);
return qux;
}
use of com.liferay.blade.workflow.asset.model.Qux in project liferay-blade-samples by liferay.
the class QuxPersistenceTest method testFetchByPrimaryKeysWithOnePrimaryKey.
@Test
public void testFetchByPrimaryKeysWithOnePrimaryKey() throws Exception {
Qux newQux = addQux();
Set<Serializable> primaryKeys = new HashSet<Serializable>();
primaryKeys.add(newQux.getPrimaryKey());
Map<Serializable, Qux> quxs = _persistence.fetchByPrimaryKeys(primaryKeys);
Assert.assertEquals(1, quxs.size());
Assert.assertEquals(newQux, quxs.get(newQux.getPrimaryKey()));
}
Aggregations