mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
CE-1887 - Add QFrontendWidgetMetaData to meta-data responses
This commit is contained in:
@ -30,6 +30,7 @@ import com.kingsrook.qqq.backend.core.model.actions.metadata.MetaDataOutput;
|
|||||||
import com.kingsrook.qqq.backend.core.model.metadata.frontend.QFrontendAppMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.frontend.QFrontendAppMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.frontend.QFrontendProcessMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.frontend.QFrontendProcessMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.frontend.QFrontendTableMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.frontend.QFrontendTableMetaData;
|
||||||
|
import com.kingsrook.qqq.backend.core.model.metadata.frontend.QFrontendWidgetMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.utils.CollectionUtils;
|
import com.kingsrook.qqq.backend.core.utils.CollectionUtils;
|
||||||
import com.kingsrook.qqq.middleware.javalin.executors.io.MetaDataOutputInterface;
|
import com.kingsrook.qqq.middleware.javalin.executors.io.MetaDataOutputInterface;
|
||||||
import com.kingsrook.qqq.middleware.javalin.schemabuilder.ToSchema;
|
import com.kingsrook.qqq.middleware.javalin.schemabuilder.ToSchema;
|
||||||
@ -63,6 +64,10 @@ public class MetaDataResponseV1 implements MetaDataOutputInterface, ToSchema
|
|||||||
@OpenAPIMapValueType(value = ProcessMetaDataLight.class, useRef = true)
|
@OpenAPIMapValueType(value = ProcessMetaDataLight.class, useRef = true)
|
||||||
private Map<String, ProcessMetaDataLight> processes;
|
private Map<String, ProcessMetaDataLight> processes;
|
||||||
|
|
||||||
|
@OpenAPIDescription("Map of all widget within the QQQ Instance (that the user has permission to see that they exist).")
|
||||||
|
@OpenAPIMapValueType(value = ProcessMetaDataLight.class, useRef = true)
|
||||||
|
private Map<String, WidgetMetaData> widgets;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
@ -94,6 +99,13 @@ public class MetaDataResponseV1 implements MetaDataOutputInterface, ToSchema
|
|||||||
{
|
{
|
||||||
processes.put(process.getName(), new ProcessMetaDataLight(process));
|
processes.put(process.getName(), new ProcessMetaDataLight(process));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
widgets = new HashMap<>();
|
||||||
|
for(QFrontendWidgetMetaData widget : CollectionUtils.nonNullMap(metaDataOutput.getWidgets()).values())
|
||||||
|
{
|
||||||
|
widgets.put(widget.getName(), new WidgetMetaData(widget));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -152,4 +164,14 @@ public class MetaDataResponseV1 implements MetaDataOutputInterface, ToSchema
|
|||||||
return processes;
|
return processes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Getter for widgets
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
public Map<String, WidgetMetaData> getWidgets()
|
||||||
|
{
|
||||||
|
return widgets;
|
||||||
|
}
|
||||||
}
|
}
|
@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* QQQ - Low-code Application Framework for Engineers.
|
||||||
|
* Copyright (C) 2021-2024. Kingsrook, LLC
|
||||||
|
* 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
|
||||||
|
* contact@kingsrook.com
|
||||||
|
* https://github.com/Kingsrook/
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.kingsrook.qqq.middleware.javalin.specs.v1.responses;
|
||||||
|
|
||||||
|
|
||||||
|
import com.kingsrook.qqq.backend.core.model.metadata.frontend.QFrontendWidgetMetaData;
|
||||||
|
import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIDescription;
|
||||||
|
import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIExclude;
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
public class WidgetMetaData
|
||||||
|
{
|
||||||
|
@OpenAPIExclude()
|
||||||
|
private QFrontendWidgetMetaData wrapped;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Constructor
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
public WidgetMetaData(QFrontendWidgetMetaData wrapped)
|
||||||
|
{
|
||||||
|
this.wrapped = wrapped;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Constructor
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
public WidgetMetaData()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
**
|
||||||
|
***************************************************************************/
|
||||||
|
@OpenAPIDescription("Unique name for this widget within the QQQ Instance")
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return (this.wrapped.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
**
|
||||||
|
***************************************************************************/
|
||||||
|
@OpenAPIDescription("User-facing name for this widget")
|
||||||
|
public String getLabel()
|
||||||
|
{
|
||||||
|
return (this.wrapped.getLabel());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
**
|
||||||
|
***************************************************************************/
|
||||||
|
@OpenAPIDescription("The type of this widget.")
|
||||||
|
// todo enum of the NAMES of the widget types?? or, can we just f'ing change to return the enum.name's?
|
||||||
|
public String getType()
|
||||||
|
{
|
||||||
|
return this.wrapped.getType();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user