https://www.dropbox.com/s/wsspavxno4gesw4/supercoolmvc.zip?dl=0
- Shutdown portal
- Remove
bundles/osgi/marketplace/LCS .. Client.lpkg
- Remove all files and folders from
bundles/osgi/state/
- Remove all files and folders from
bundles/tomcat.../work/
- Remove all files and folders from
bundles/tomcat.../temp/
- Start the portal
https://www.dropbox.com/s/evixdjui91yv6ud/localization-example-web.zip?dl=0
- This applicaiton is refactored and is using instead of ResourceBlockPermissions it is using ResourcePermission
https://www.dropbox.com/s/md1n4vplwqh64ze/gradebook.zip?dl=0
- Add blow to SubmissionLocalServiceImpl (run servicebuilder) and expose that to SubmissionServiceImpl (run servicebuilder)
public Submission addSubmission(long assignmentId, long studentId, int grade, String comment, ServiceContext serviceContext ) throws PortalException {
System.err.println("xxx");
long submissionId =
counterLocalService.increment(Submission.class.getName());
Assignment assignment = assignmentPersistence.findByPrimaryKey(assignmentId);
Submission submission = createSubmission(submissionId);
submission.setAssignmentId(assignmentId);
submission.setSubmissionId(submissionId);
submission.setCompanyId(assignment.getCompanyId());
submission.setGroupId(assignment.getGroupId());
submission.setStudentId(studentId);
submission.setCreateDate(new Date());
submission.setModifiedDate(new Date());
submission.setGrade(grade);
submission.setComment(comment);
return super.addSubmission(submission);
}
- Add Assignment:
Liferay.Service('/space.assignment/add-assignment', {
groupId: 20143,
userId: 31043,
title: { 'en_US': 'How to make birhday cake'},
description: 'Design most delicious and beautifull birthday cake. Serve that to who deserves it.',
dueDate: (new Date('2018-05-22')).getTime()
}, function(obj) {
console.log(obj);
});
- List Assignments
Liferay.Service('/space.assignment/get-assignments-by-group-id', {
groupId: 20143,
start: -1,
end: -1
},
function(obj) {
console.log(obj);
});
- Add submission
Liferay.Service(
'/space.submission/add-submission',
{
assignmentId: 301,
studentId: 31022 ,
grade: 5,
comment: 'Cheesecake with straberries and blueberries'
},
function(obj) {
console.log(obj);
}
);
- Combine these to one remote call.
Liferay.Service({'$assignment = /space.assignment/add-assignment':{
groupId: 20143,
userId: 31043,
title: { 'en_US': 'Please, make birhday cake'},
description: 'Design most delicious and beautifull birthday cake. Serve that to who deserves it.',
dueDate: (new Date('2018-05-22')).getTime(),
'$submission = /space.submission/add-submission': {
'@assignmentId': '$assignment.assignmentId',
studentId: 31022 ,
grade: 5,
comment: 'Cheesecake with straberries and blueberries'
}
}
},
function(obj) {
console.log(obj);
});
- Below is not working, but you can take it as also example.
Liferay.Service({
'$company[companyId] = /company/get-company-by-virtual-host' : {
virtualHost: 'localhost',
'$group[groupId] = /group/get-company-group': {
'@companyId': '$company.companyId',
'$student[userId] = /user/get-user-by-screen-name':{
'@companyId': '$company.companyId',
screenName: 'test',
'$assignment = /gradebook.assignment/add-assignment': {
'@groupId': '$group.groupId',
titleMap: { 'en_US': 'How to make birhday cake'},
description: 'Design most delicious and beautifull birthday cake. Serve that to who deserves it.',
dueDate: (new Date('2018-05-22')).getTime(),
'$submission = /gradebook.submission/add-submission': {
'@assignmentId': '$assignment.assignmentId',
'@studentId': '$student.userId',
submissionText: 'Cheesecake with straberries and blueberries'
}
}
}
}
}
}, function(obj) {
console.log(obj);
});
<#--
<@liferay_portlet["runtime"]
portletName="com_liferay_training_space_gradebook_portlet_GradebookPortlet"
/>
- classPK is assignmentId
<@liferay_ui["asset-display"]
className="com.liferay.training.space.gradebook.model.Assignment"
classPK=1
template="full_content"
/>