use of com.liferay.blade.workflow.basic.model.Baz in project liferay-blade-samples by liferay.
the class BazModelImpl method toString.
@Override
public String toString() {
Map<String, Function<Baz, Object>> attributeGetterFunctions = getAttributeGetterFunctions();
StringBundler sb = new StringBundler(4 * attributeGetterFunctions.size() + 2);
sb.append("{");
for (Map.Entry<String, Function<Baz, Object>> entry : attributeGetterFunctions.entrySet()) {
String attributeName = entry.getKey();
Function<Baz, Object> attributeGetterFunction = entry.getValue();
sb.append(attributeName);
sb.append("=");
sb.append(attributeGetterFunction.apply((Baz) this));
sb.append(", ");
}
if (sb.index() > 1) {
sb.setIndex(sb.index() - 1);
}
sb.append("}");
return sb.toString();
}
use of com.liferay.blade.workflow.basic.model.Baz in project liferay-blade-samples by liferay.
the class BazModelImpl method toXmlString.
@Override
public String toXmlString() {
Map<String, Function<Baz, 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<Baz, Object>> entry : attributeGetterFunctions.entrySet()) {
String attributeName = entry.getKey();
Function<Baz, Object> attributeGetterFunction = entry.getValue();
sb.append("<column><column-name>");
sb.append(attributeName);
sb.append("</column-name><column-value><![CDATA[");
sb.append(attributeGetterFunction.apply((Baz) this));
sb.append("]]></column-value></column>");
}
sb.append("</model>");
return sb.toString();
}
use of com.liferay.blade.workflow.basic.model.Baz in project liferay-blade-samples by liferay.
the class BazModelImpl method equals.
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Baz)) {
return false;
}
Baz baz = (Baz) obj;
long primaryKey = baz.getPrimaryKey();
if (getPrimaryKey() == primaryKey) {
return true;
} else {
return false;
}
}
use of com.liferay.blade.workflow.basic.model.Baz in project liferay-blade-samples by liferay.
the class BazLocalServiceImpl method addBaz.
@Override
public Baz addBaz(long userId, long groupId, ServiceContext serviceContext) throws PortalException {
User user = userLocalService.getUser(userId);
Baz baz = bazPersistence.create(counterLocalService.increment());
baz.setGroupId(groupId);
baz.setCompanyId(user.getCompanyId());
baz.setUserId(user.getUserId());
baz.setUserName(user.getFullName());
baz.setCreateDate(serviceContext.getCreateDate(null));
baz.setModifiedDate(serviceContext.getModifiedDate(null));
baz = bazPersistence.update(baz);
WorkflowHandlerRegistryUtil.startWorkflowInstance(baz.getCompanyId(), baz.getGroupId(), baz.getUserId(), Baz.class.getName(), baz.getPrimaryKey(), baz, serviceContext);
return baz;
}
use of com.liferay.blade.workflow.basic.model.Baz in project liferay-blade-samples by liferay.
the class BazLocalServiceImpl method updateStatus.
@Override
public Baz updateStatus(long userId, long bazId, int status) throws PortalException {
User user = userLocalService.getUser(userId);
Baz baz = getBaz(bazId);
baz.setStatus(status);
baz.setStatusByUserId(user.getUserId());
baz.setStatusByUserName(user.getFullName());
baz.setStatusDate(new Date());
return updateBaz(baz);
}
Aggregations