Created
November 15, 2018 00:48
-
-
Save beall49/c6ef7f857a465276df537f2a042ccf41 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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