private static String getInputRecord(Input input) { return " name=\"" + input.getName() + "\", label=\"" + input.getLabel() + "\", decription=\"" + input.getDescription() + "\", type=\"" + input.getType() + "\", " + (input.isRequired() ? REQUIRED : NOT_REQUIRED) + (input.getDefaultValue() != null ? "\", default=\"" + input.getDefaultValue() : ""); }
private static String getOutputRecord(Output output) { return " name=\"" + output.getName() + "\", label=\"" + output.getLabel() + "\", decription=\"" + output.getDescription() + "\", type=\"" + output.getType() + "\""; }
@SuppressWarnings("unchecked") @Override public Collection<TriggerType> getTriggers(Locale locale) { if (moduleTypeRegistry != null) { return moduleTypeRegistry.getTriggers(locale); } return null; }
@Override @SuppressWarnings("unchecked") public <T extends ModuleType> T get(String moduleTypeUID, Locale locale) { Entry<Provider<ModuleType>, ModuleType> mType = getValueAndProvider(moduleTypeUID); if (mType == null) { return null; } else { ModuleType mt = locale == null ? mType.getValue() : ((ModuleTypeProvider) mType.getKey()).getModuleType(mType.getValue().getUID(), locale); return (T) createCopy(mt); } }
public static ActionType map(CompositeActionTypeDTO actionTypeDto) { if (actionTypeDto.children == null || actionTypeDto.children.isEmpty()) { return new ActionType(actionTypeDto.uid, ConfigDescriptionDTOMapper.map(actionTypeDto.configDescriptions), actionTypeDto.label, actionTypeDto.description, actionTypeDto.tags, actionTypeDto.visibility, actionTypeDto.inputs, actionTypeDto.outputs); } else { return new CompositeActionType(actionTypeDto.uid, ConfigDescriptionDTOMapper.map(actionTypeDto.configDescriptions), actionTypeDto.label, actionTypeDto.description, actionTypeDto.tags, actionTypeDto.visibility, actionTypeDto.inputs, actionTypeDto.outputs, ActionDTOMapper.mapDto(actionTypeDto.children)); } }
@Override protected String getUID(ModuleType providedObject) { return providedObject.getUID(); }
@Override public ModuleType getModuleType(String typeUID, Locale locale) { if (moduleTypeRegistry != null) { return moduleTypeRegistry.get(typeUID, locale); } return null; }
@SuppressWarnings("unchecked") @Override public Collection<ConditionType> getConditions(Locale locale) { if (moduleTypeRegistry != null) { return moduleTypeRegistry.getConditions(locale); } return null; }
@SuppressWarnings("unchecked") @Override public Collection<ActionType> getActions(Locale locale) { if (moduleTypeRegistry != null) { return moduleTypeRegistry.getActions(locale); } return null; }
private boolean hasOutput(ActionType moduleType, String out) { for (Output o : moduleType.getOutputs()) { if (o.getName().equals(out)) { return true; } } return false; } }
@Override protected List<Condition> getChildren() { return moduleType.getChildren(); } }
@Override public CompositeConditionType createInstance(Type type) { return new CompositeConditionType(null, null, null, null); } }
@Override public CompositeTriggerType createInstance(Type type) { return new CompositeTriggerType(null, null, null, null); } }
/** * Unbind the {@link ModuleTypeRegistry} service - called from DS. * * @param moduleTypeRegistry a {@link ModuleTypeRegistry} service. */ protected void unsetModuleTypeRegistry(ModuleTypeRegistry moduleTypeRegistry) { mtRegistry.removeRegistryChangeListener(this); mtRegistry = null; }
@Override protected List<Action> getChildren() { return moduleType.getChildren(); } }
@Override public CompositeActionType createInstance(Type type) { return new CompositeActionType(null, null, null, null, null); } }
@Override protected List<Trigger> getChildren() { return moduleType.getChildren(); }
/** * Create a system handler for modules of {@link CompositeActionType} type. * * @param action parent action module instance. The action which has {@link CompositeActionType} type. * @param mt {@link CompositeActionType} instance of the parent module * @param mapModuleToHandler map of pairs child action module to its action handler * @param ruleUID UID of rule where the parent action is part of. */ public CompositeActionHandler(Action action, CompositeActionType mt, LinkedHashMap<Action, ActionHandler> mapModuleToHandler, String ruleUID) { super(action, mt, mapModuleToHandler); compositeOutputs = getCompositeOutputMap(moduleType.getOutputs()); }
@Override protected String getUID(ModuleType parsedObject) { return parsedObject.getUID(); }