Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Widget -> Widget Bundle Many to Many support.
- Loading branch information
Showing
49 changed files
with
1,038 additions
and
517 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
187 changes: 100 additions & 87 deletions
187
application/src/main/java/org/thingsboard/server/controller/WidgetTypeController.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
52 changes: 52 additions & 0 deletions
52
...n/java/org/thingsboard/server/service/edge/rpc/fetch/BaseWidgetTypesEdgeEventFetcher.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* Copyright © 2016-2023 The Thingsboard Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.thingsboard.server.service.edge.rpc.fetch; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.thingsboard.server.common.data.EdgeUtils; | ||
import org.thingsboard.server.common.data.edge.Edge; | ||
import org.thingsboard.server.common.data.edge.EdgeEvent; | ||
import org.thingsboard.server.common.data.edge.EdgeEventActionType; | ||
import org.thingsboard.server.common.data.edge.EdgeEventType; | ||
import org.thingsboard.server.common.data.id.TenantId; | ||
import org.thingsboard.server.common.data.page.PageData; | ||
import org.thingsboard.server.common.data.page.PageLink; | ||
import org.thingsboard.server.common.data.widget.WidgetTypeDetails; | ||
import org.thingsboard.server.common.data.widget.WidgetTypeInfo; | ||
import org.thingsboard.server.common.data.widget.WidgetsBundle; | ||
import org.thingsboard.server.dao.widget.WidgetTypeService; | ||
import org.thingsboard.server.dao.widget.WidgetsBundleService; | ||
|
||
@Slf4j | ||
@AllArgsConstructor | ||
public abstract class BaseWidgetTypesEdgeEventFetcher extends BasePageableEdgeEventFetcher<WidgetTypeInfo> { | ||
|
||
protected final WidgetTypeService widgetTypeService; | ||
|
||
@Override | ||
PageData<WidgetTypeInfo> fetchPageData(TenantId tenantId, Edge edge, PageLink pageLink) { | ||
return findWidgetTypes(tenantId, pageLink); | ||
} | ||
|
||
@Override | ||
EdgeEvent constructEdgeEvent(TenantId tenantId, Edge edge, WidgetTypeInfo widgetTypeInfo) { | ||
return EdgeUtils.constructEdgeEvent(tenantId, edge.getId(), EdgeEventType.WIDGET_TYPE, | ||
EdgeEventActionType.ADDED, widgetTypeInfo.getId(), null); | ||
} | ||
|
||
protected abstract PageData<WidgetTypeInfo> findWidgetTypes(TenantId tenantId, PageLink pageLink); | ||
} |
36 changes: 36 additions & 0 deletions
36
...java/org/thingsboard/server/service/edge/rpc/fetch/SystemWidgetTypesEdgeEventFetcher.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Copyright © 2016-2023 The Thingsboard Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.thingsboard.server.service.edge.rpc.fetch; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.thingsboard.server.common.data.id.TenantId; | ||
import org.thingsboard.server.common.data.page.PageData; | ||
import org.thingsboard.server.common.data.page.PageLink; | ||
import org.thingsboard.server.common.data.widget.WidgetTypeInfo; | ||
import org.thingsboard.server.dao.widget.WidgetTypeService; | ||
|
||
@Slf4j | ||
public class SystemWidgetTypesEdgeEventFetcher extends BaseWidgetTypesEdgeEventFetcher { | ||
|
||
public SystemWidgetTypesEdgeEventFetcher(WidgetTypeService widgetTypeService) { | ||
super(widgetTypeService); | ||
} | ||
|
||
@Override | ||
protected PageData<WidgetTypeInfo> findWidgetTypes(TenantId tenantId, PageLink pageLink) { | ||
return widgetTypeService.findSystemWidgetTypesByPageLink(tenantId, pageLink); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...java/org/thingsboard/server/service/edge/rpc/fetch/TenantWidgetTypesEdgeEventFetcher.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Copyright © 2016-2023 The Thingsboard Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.thingsboard.server.service.edge.rpc.fetch; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.thingsboard.server.common.data.id.TenantId; | ||
import org.thingsboard.server.common.data.page.PageData; | ||
import org.thingsboard.server.common.data.page.PageLink; | ||
import org.thingsboard.server.common.data.widget.WidgetTypeInfo; | ||
import org.thingsboard.server.dao.widget.WidgetTypeService; | ||
|
||
@Slf4j | ||
public class TenantWidgetTypesEdgeEventFetcher extends BaseWidgetTypesEdgeEventFetcher { | ||
|
||
public TenantWidgetTypesEdgeEventFetcher(WidgetTypeService widgetTypeService) { | ||
super(widgetTypeService); | ||
} | ||
@Override | ||
protected PageData<WidgetTypeInfo> findWidgetTypes(TenantId tenantId, PageLink pageLink) { | ||
return widgetTypeService.findTenantWidgetTypesByTenantIdAndPageLink(tenantId, pageLink); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.