Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ import org.openbase.jul.extension.type.processing.LabelProcessor.getBestMatch
import org.openbase.jul.extension.type.processing.LabelProcessor.replace
import org.openbase.type.configuration.EntryType
import org.openbase.type.configuration.MetaConfigType
import org.openbase.type.domotic.service.ServiceTemplateType
import org.openbase.type.domotic.unit.UnitConfigType
import org.openbase.type.domotic.unit.UnitConfigType.UnitConfig
import org.openbase.type.domotic.unit.UnitFilterType
import org.openbase.type.domotic.unit.UnitTemplateType
import org.openbase.type.domotic.unit.agent.AgentClassType
import org.openbase.type.domotic.unit.app.AppClassType
import org.openbase.type.domotic.unit.gateway.GatewayClassType
import org.openbase.type.geometry.PoseType
import org.openbase.type.language.LabelType
Expand Down Expand Up @@ -158,6 +162,26 @@ import java.util.concurrent.*
fun gatewayClasses(): ImmutableList<GatewayClassType.GatewayClass> =
ImmutableList.copyOf(Registries.getClassRegistry(true).gatewayClasses)

@Query("agentClasses")
@Throws(CouldNotPerformException::class, InterruptedException::class)
fun agentClasses(): ImmutableList<AgentClassType.AgentClass> =
ImmutableList.copyOf(Registries.getClassRegistry(true).agentClasses)

@Query("appClasses")
@Throws(CouldNotPerformException::class, InterruptedException::class)
fun appClasses(): ImmutableList<AppClassType.AppClass> =
ImmutableList.copyOf(Registries.getClassRegistry(true).appClasses)

@Query("unitTemplates")
@Throws(CouldNotPerformException::class, InterruptedException::class)
fun unitTemplates(): ImmutableList<UnitTemplateType.UnitTemplate> =
ImmutableList.copyOf(Registries.getTemplateRegistry(true).unitTemplates)

@Query("serviceTemplates")
@Throws(CouldNotPerformException::class, InterruptedException::class)
fun serviceTemplates(): ImmutableList<ServiceTemplateType.ServiceTemplate> =
ImmutableList.copyOf(Registries.getTemplateRegistry(true).serviceTemplates)

@Mutation("updateUnitConfig")
@Throws(BCOGraphQLError::class)
fun updateUnitConfig(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,31 @@ String addLabelBestMatch(UnitTemplate unitTemplate, DataFetchingEnvironment env)
return getLabelForContext(unitTemplate.getLabel(), env.getContext());
}

@SchemaModification(addField = "labelString", onType = AgentClass.class)
String addLabelBestMatch(AgentClass agentClass, DataFetchingEnvironment env) {
return getLabelForContext(agentClass.getLabel(), env.getContext());
}

@SchemaModification(addField = "labelString", onType = AppClass.class)
String addLabelBestMatch(AppClass appClass, DataFetchingEnvironment env) {
return getLabelForContext(appClass.getLabel(), env.getContext());
}

@SchemaModification(addField = "labelString", onType = DeviceClass.class)
String addLabelBestMatch(DeviceClass deviceClass, DataFetchingEnvironment env) {
return getLabelForContext(deviceClass.getLabel(), env.getContext());
}

@SchemaModification(addField = "labelString", onType = GatewayClass.class)
String addLabelBestMatch(GatewayClass gatewayClass, DataFetchingEnvironment env) {
return getLabelForContext(gatewayClass.getLabel(), env.getContext());
}

@SchemaModification(addField = "labelString", onType = ServiceTemplate.class)
String addLabelBestMatch(ServiceTemplate serviceTemplate, DataFetchingEnvironment env) {
return getLabelForContext(serviceTemplate.getLabel(), env.getContext());
}

@SchemaModification(addField = "descriptionString", onType = UnitConfig.class)
String addDescriptionBestMatch(UnitConfig unitConfig, DataFetchingEnvironment env) {
return getTextForContext(unitConfig.getDescription(), env.getContext());
Expand Down Expand Up @@ -225,16 +250,6 @@ private UnitConfig resolveParentTile(String locationId) throws NotAvailableExcep
}
}

@SchemaModification(addField = "labelString", onType = DeviceClass.class)
String addLabelBestMatch(DeviceClass deviceClass, DataFetchingEnvironment env) {
return getLabelForContext(deviceClass.getLabel(), env.getContext());
}

@SchemaModification(addField = "labelString", onType = GatewayClass.class)
String addLabelBestMatch(GatewayClass gatewayClass, DataFetchingEnvironment env) {
return getLabelForContext(gatewayClass.getLabel(), env.getContext());
}

@SchemaModification(addField = "descriptionString", onType = GatewayClass.class)
String addDescriptionBestMatch(GatewayClass gatewayClass, DataFetchingEnvironment env) {
return getTextForContext(gatewayClass.getDescription(), env.getContext());
Expand Down