/** * All actions with the given name * @param name the name * @return a list of actions */ public List<CsdlAction> getActions(final String name) { return getAllByName(name, getActions()); }
/** * All actions with the given name * @param name the name * @return a list of actions */ public List<CsdlAction> getActions(final String name) { return getAllByName(name, getActions()); }
private List<CsdlAction> getActions (XMLMetadata metadata, String name) throws TranslatorException { if (name.contains(".")) { int idx = name.lastIndexOf('.'); CsdlSchema schema = metadata.getSchema(name.substring(0, idx)); if (schema == null) { throw new TranslatorException(ODataPlugin.Util.gs(ODataPlugin.Event.TEIID17021, name)); } return schema.getActions(name.substring(idx+1)); } return getDefaultSchema(metadata).getActions(name); }
@Override public List<CsdlAction> getActions(final FullQualifiedName actionName) throws ODataException { CsdlSchema schema = xmlSchemas.get(actionName.getNamespace()); if (schema != null) { return schema.getActions(actionName.getName()); } return null; }
@Override public List<CsdlAction> getActions(final FullQualifiedName actionName) throws ODataException { CsdlSchema schema = xmlSchemas.get(actionName.getNamespace()); if (schema != null) { return schema.getActions(actionName.getName()); } return null; }
protected List<EdmAction> createActions() { final List<EdmAction> edmActions = new ArrayList<EdmAction>(); final List<CsdlAction> providerActions = schema.getActions(); if (providerActions != null) { for (CsdlAction action : providerActions) { FullQualifiedName actionName = new FullQualifiedName(namespace, action.getName()); EdmActionImpl edmActionImpl = new EdmActionImpl(edm, actionName, action); edmActions.add(edmActionImpl); edm.cacheAction(actionName, edmActionImpl); } } return edmActions; }
protected List<EdmAction> createActions() { final List<EdmAction> edmActions = new ArrayList<EdmAction>(); final List<CsdlAction> providerActions = schema.getActions(); if (providerActions != null) { for (CsdlAction action : providerActions) { FullQualifiedName actionName = new FullQualifiedName(namespace, action.getName()); EdmActionImpl edmActionImpl = new EdmActionImpl(edm, actionName, action); edmActions.add(edmActionImpl); edm.cacheAction(actionName, edmActionImpl); } } return edmActions; }
@Override public List<CsdlAction> getActions(final FullQualifiedName fqn) throws ODataException { ArrayList<CsdlAction> actions = new ArrayList<CsdlAction>(); CsdlSchema schema = getSchema(fqn.getNamespace()); if (schema != null) { List<CsdlAction> types = schema.getActions(); if (types != null) { for (CsdlAction type : types) { if (type.getName().equals(fqn.getName())) { actions.add(type); } } } } return actions; }
@Override public List<CsdlAction> getActions(final FullQualifiedName fqn) throws ODataException { ArrayList<CsdlAction> actions = new ArrayList<CsdlAction>(); CsdlSchema schema = getSchema(fqn.getNamespace()); if (schema != null) { List<CsdlAction> types = schema.getActions(); if (types != null) { for (CsdlAction type : types) { if (type.getName().equals(fqn.getName())) { actions.add(type); } } } } return actions; }
@Override public List<CsdlAction> getActions(final FullQualifiedName actionName) throws ODataException { for (final CsdlSchema schema : serviceDocument.getEdmSchemas()) { if (schema.getNamespace().equals(actionName.getNamespace())) { return schema.getActions(actionName.getName()); } } return null; // NOSONAR see documentation }
@Override public List<CsdlAction> getActions(FullQualifiedName actionName) throws ODataException { List<CsdlSchema> csdlSchemas = xmlMetadata.getSchemas(); for (CsdlSchema csdlSchema : csdlSchemas) { if (csdlSchema.getNamespace().equals(actionName.getNamespace())||csdlSchema.getAlias().equals(actionName.getNamespace())) { return csdlSchema.getActions(actionName.getName()); } } return Collections.emptyList(); }
try { boundActionStream = metadataInfo.getEdmxMetadataProvider().getSchemas().stream().flatMap(schema-> schema.getActions().stream()).filter(action->action.isBound()); } catch (Exception e) { boundActionStream = Stream.empty();
private void readAction(XMLEventReader reader, StartElement element, CsdlSchema schema) throws XMLStreamException { CsdlAction action = new CsdlAction(); action.setParameters(new ArrayList<CsdlParameter>()); action.setName(attr(element, "Name")); action.setBound(Boolean.parseBoolean(attr(element, "IsBound"))); String entitySetPath = attr(element, "EntitySetPath"); if (entitySetPath != null) { // TODO: need to parse into binding and path. action.setEntitySetPath(entitySetPath); } readOperationParameters(reader, action); schema.getActions().add(action); }
private void readAction(XMLEventReader reader, StartElement element, CsdlSchema schema) throws XMLStreamException { CsdlAction action = new CsdlAction(); action.setParameters(new ArrayList<CsdlParameter>()); action.setName(attr(element, "Name")); action.setBound(Boolean.parseBoolean(attr(element, "IsBound"))); String entitySetPath = attr(element, "EntitySetPath"); if (entitySetPath != null) { // TODO: need to parse into binding and path. action.setEntitySetPath(entitySetPath); } readOperationParameters(reader, action); schema.getActions().add(action); }
csdlSchema.getNamespace(), csdlComplexType.getName()), csdlComplexType); List<CsdlAction> csdlActions = csdlSchema.getActions(); for (CsdlAction csdlAction : csdlActions) { csdlActionsMap.put(new FullQualifiedName(
csdlSchema.getNamespace(), csdlComplexType.getName()), csdlComplexType); List<CsdlAction> csdlActions = csdlSchema.getActions(); for (CsdlAction csdlAction : csdlActions) { csdlActionsMap.put(new FullQualifiedName(
public static CommonJavaObjectForEdmx convertFromActionsNfunctions(CommonJavaObjectForEdmx comModel, CDXEdmProvider edmxProvider, Map<String, String> namespaceToServMap) { CommonJavaObjectForEdmx updatedComModel = comModel; try { List<CsdlAction> actions = edmxProvider.getSchemas().get(0).getActions(); for (CsdlAction action : actions) { if (action.getReturnType() != null && !action.getReturnType().getType().startsWith("Edm")) { FullQualifiedName fqn = action.getReturnType().getTypeFQN(); updatedComModel = addCsdlComplexOrEntityToComModel(comModel, edmxProvider, fqn, namespaceToServMap); } } List<CsdlFunction> functions = edmxProvider.getSchemas().get(0).getFunctions(); for (CsdlFunction function : functions) { if (function.getReturnType() != null && function.getReturnType().getType().startsWith("Edm")) { FullQualifiedName fqn = function.getReturnType().getTypeFQN(); updatedComModel = addCsdlComplexOrEntityToComModel(updatedComModel, edmxProvider, fqn, namespaceToServMap); } } } catch (ODataException e) { PojoGenUtil.logDebug(log, "Could not parse Action/Function return type"); } return updatedComModel; }