Skip to content

Commit ae89c44

Browse files
committed
Move event details to service implementation
1 parent 2283a61 commit ae89c44

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

api/src/main/java/org/apache/cloudstack/api/command/user/gui/themes/CreateGuiThemeCmd.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ public Boolean getRecursiveDomains() {
111111

112112
@Override
113113
public void execute() {
114-
CallContext.current().setEventDetails(String.format("Name: %s, AccountIDs: %s, DomainIDs: %s, RecursiveDomains: %s, CommonNames: %s", getName(), getAccountIds(),
115-
getDomainIds(), getRecursiveDomains(), getCommonNames()));
116114
GuiThemeJoinVO guiTheme = guiThemeService.createGuiTheme(this);
117115

118116
if (guiTheme == null) {

api/src/main/java/org/apache/cloudstack/api/command/user/gui/themes/RemoveGuiThemeCmd.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public Long getId() {
4646

4747
@Override
4848
public void execute() {
49-
CallContext.current().setEventDetails(String.format("ID: %s", getId()));
5049
guiThemeService.removeGuiTheme(this);
5150
final SuccessResponse response = new SuccessResponse();
5251
response.setResponseName(getCommandName());

api/src/main/java/org/apache/cloudstack/api/command/user/gui/themes/UpdateGuiThemeCmd.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ public Boolean getIsPublic() {
118118

119119
@Override
120120
public void execute() {
121-
CallContext.current().setEventDetails(String.format("ID: %s, Name: %s, AccountIDs: %s, DomainIDs: %s, RecursiveDomains: %s, CommonNames: %s", getId(), getName(),
122-
getAccountIds(), getDomainIds(), getRecursiveDomains(), getCommonNames()));
123121
GuiThemeJoinVO guiThemeJoinVO = guiThemeService.updateGuiTheme(this);
124122

125123
if (guiThemeJoinVO == null) {

server/src/main/java/org/apache/cloudstack/gui/theme/GuiThemeServiceImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ public GuiThemeJoinVO createGuiTheme(CreateGuiThemeCmd cmd) {
142142
boolean isPublic = cmd.getPublic();
143143
Boolean recursiveDomains = cmd.getRecursiveDomains();
144144

145+
CallContext.current().setEventDetails(String.format("Name: %s, AccountIDs: %s, DomainIDs: %s, RecursiveDomains: %s, CommonNames: %s", name, providedAccountIds,
146+
providedDomainIds, recursiveDomains, commonNames));
147+
145148
if (StringUtils.isAllBlank(css, jsonConfiguration)) {
146149
throw new CloudRuntimeException("Either the `css` or `jsonConfiguration` parameter must be informed.");
147150
}
@@ -369,6 +372,9 @@ public GuiThemeJoinVO updateGuiTheme(UpdateGuiThemeCmd cmd) {
369372
Boolean isPublic = cmd.getIsPublic();
370373
Boolean recursiveDomains = cmd.getRecursiveDomains();
371374

375+
CallContext.current().setEventDetails(String.format("ID: %s, Name: %s, AccountIDs: %s, DomainIDs: %s, RecursiveDomains: %s, CommonNames: %s", guiThemeId, name,
376+
providedAccountIds, providedDomainIds, recursiveDomains, commonNames));
377+
372378
validateParameters(jsonConfiguration, providedDomainIds, providedAccountIds, commonNames, guiThemeId);
373379

374380
if (shouldSetGuiThemeToPrivate(providedDomainIds, providedAccountIds)) {
@@ -429,6 +435,7 @@ protected String ifBlankReturnNull(String value) {
429435
public void removeGuiTheme(RemoveGuiThemeCmd cmd) {
430436
Long guiThemeId = cmd.getId();
431437
GuiThemeVO guiThemeVO = guiThemeDao.findById(guiThemeId);
438+
CallContext.current().setEventDetails(String.format("ID: %s", guiThemeId));
432439

433440
if (guiThemeVO != null) {
434441
guiThemeDao.remove(guiThemeId);

0 commit comments

Comments
 (0)