Skip to content

Instantly share code, notes, and snippets.

@eduardolundgren
Created January 9, 2012 18:30
Show Gist options
  • Select an option

  • Save eduardolundgren/1584253 to your computer and use it in GitHub Desktop.

Select an option

Save eduardolundgren/1584253 to your computer and use it in GitHub Desktop.
New Liferay Services JavaScript
Liferay.Service('assetvocabulary/get-vocabularies');
Liferay.Service('assetvocabulary/update-vocabularies', { vocabularyIds: [10455, 13014] });
Liferay.Service('assetvocabulary/update-vocabularies', { vocabularyIds: [10455,13014] }, function(obj){
console.log(obj);
});
Liferay.Service('assetvocabulary/get-vocabularies', function(obj) {
console.log(obj);
});
Liferay.Service({
// uri: 'http://...',
service: 'assetvocabulary/get-vocabularies', // lookup
data: { vocabularyIds: [10455,13014] },
on: {
success: function(event){
console.log(this.get('responseData');
}
}
}
});
---
REST:
Liferay.Service.get('assetvocabulary');
Liferay.Service.post('assetvocabulary', { ... });
Liferay.Service.put('assetvocabulary', { vocabularyIds: [10455, 13014] });
Liferay.Service.update('assetvocabulary', { vocabularyIds: [10455, 13014] });
Liferay.Service.del('assetvocabulary', { vocabularyId: 10455] });
Liferay.Service.get('assetvocabulary', { vocabularyIds: [10455,13014] }, function(obj){
console.log(obj);
});
Liferay.Service.get('assetvocabulary', function(obj) {
console.log(obj);
});
Liferay.Service.get({
service: 'assetvocabulary',
data: { vocabularyIds: [10455,13014] },
on: {
success: function(event){
console.log(this.get('responseData');
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment