Skip to content

Instantly share code, notes, and snippets.

@beall49
Created November 15, 2018 00:48
Show Gist options
  • Save beall49/c6ef7f857a465276df537f2a042ccf41 to your computer and use it in GitHub Desktop.
Save beall49/c6ef7f857a465276df537f2a042ccf41 to your computer and use it in GitHub Desktop.
function getUserName() {
const theme = Liferay.ThemeDisplay;
const payload = {userId: theme.getUserId()};
userName = EMPTY_CHAR;
Liferay.Service(USER_ID_URL, payload)
.done((response) => {
userName = response.screenName;
})
.fail(() => {
userName = EMPTY_CHAR;
});
}
function getSiteId() {
const theme = Liferay.ThemeDisplay;
const groupId = theme.getScopeGroupId();
const companyId = theme.getCompanyId();
siteId = 0;
const payload = {
companyId: companyId,
className: CLASS_NAME,
tableName: TBL_NAME,
columnName: COLUMN_NAME,
classPK: groupId,
};
Liferay.Service(SITE_ID_URL, payload)
.done((response) => {
siteId = response.data;
})
.fail(() => {
siteId = -1;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment