@Override public JPAAction getAction(final EdmAction action) { final IntermediateSchema schema = schemaListInternalKey.get(action.getNamespace()); if (schema != null) return schema.getAction(action.getName()); return null; }
@Override public String getSegmentValue(final boolean includeFilters) { return actionImport == null ? (action == null ? "" : action.getName()) : actionImport.getName(); }
@Override public String getSegmentValue(final boolean includeFilters) { return actionImport == null ? (action == null ? "" : action.getName()) : actionImport.getName(); }
public static String getActionName(final UriInfoResource uriInfo) { String actionName=null; final List<UriResource> resourcePaths = uriInfo.getUriResourceParts(); if(resourcePaths!=null && !resourcePaths.isEmpty()) { if (resourcePaths.get(0) instanceof UriResourceAction) { actionName=((UriResourceAction) resourcePaths.get(0)).getActionImport().getName(); }else if(resourcePaths.get(resourcePaths.size()-1) instanceof UriResourceAction) { actionName=((UriResourceAction) resourcePaths.get(resourcePaths.size()-1)).getAction().getName(); } } return actionName; } public static EdmEntitySet getStartingEdmEntitySet(final UriInfoResource uriInfo,Locale locale) throws ODataApplicationException {
Map<String, List<EdmAction>> actionsMap = new HashMap<String, List<EdmAction>>(); for (EdmAction action : actions) { if (actionsMap.containsKey(action.getName())) { List<EdmAction> actionsWithSpecificActionName = actionsMap.get(action.getName()); actionsWithSpecificActionName.add(action); actionsMap.put(action.getName(), actionsWithSpecificActionName); } else { List<EdmAction> actionList = new ArrayList<EdmAction>(); actionList.add(action); actionsMap.put(action.getName(), actionList);
Map<String, List<EdmAction>> actionsMap = new HashMap<String, List<EdmAction>>(); for (EdmAction action : actions) { if (actionsMap.containsKey(action.getName())) { List<EdmAction> actionsWithSpecificActionName = actionsMap.get(action.getName()); actionsWithSpecificActionName.add(action); actionsMap.put(action.getName(), actionsWithSpecificActionName); } else { List<EdmAction> actionList = new ArrayList<EdmAction>(); actionList.add(action); actionsMap.put(action.getName(), actionList);
private void appendActions(final XMLStreamWriter writer, final List<EdmAction> actions) throws XMLStreamException { for (EdmAction action : actions) { writer.writeStartElement(XML_ACTION); writer.writeAttribute(XML_NAME, action.getName()); if (action.getEntitySetPath() != null) { writer.writeAttribute(XML_ENTITY_SET_PATH, action.getEntitySetPath()); } writer.writeAttribute(XML_IS_BOUND, "" + action.isBound()); appendOperationParameters(writer, action); appendOperationReturnType(writer, action); appendAnnotations(writer, action); writer.writeEndElement(); } }
private void appendActions(final XMLStreamWriter writer, final List<EdmAction> actions) throws XMLStreamException { for (EdmAction action : actions) { writer.writeStartElement(XML_ACTION); writer.writeAttribute(XML_NAME, action.getName()); if (action.getEntitySetPath() != null) { writer.writeAttribute(XML_ENTITY_SET_PATH, action.getEntitySetPath()); } writer.writeAttribute(XML_IS_BOUND, "" + action.isBound()); appendOperationParameters(writer, action); appendOperationReturnType(writer, action); appendAnnotations(writer, action); writer.writeEndElement(); } }
public static Set<String> getSelectedPropertyNames(final List<SelectItem> selectItems) { Set<String> selected = new HashSet<String>(); for (final SelectItem item : selectItems) { final UriResource resource = item.getResourcePath().getUriResourceParts().get(0); if (resource instanceof UriResourceProperty) { selected.add(((UriResourceProperty) resource).getProperty().getName()); } else if (resource instanceof UriResourceNavigation) { selected.add(((UriResourceNavigation) resource).getProperty().getName()); } else if (resource instanceof UriResourceAction) { selected.add(((UriResourceAction) resource).getAction().getName()); } else if (resource instanceof UriResourceFunction) { selected.add(((UriResourceFunction) resource).getFunction().getName()); } } return selected; }
public static Set<String> getSelectedPropertyNames(final List<SelectItem> selectItems) { Set<String> selected = new HashSet<String>(); for (final SelectItem item : selectItems) { final UriResource resource = item.getResourcePath().getUriResourceParts().get(0); if (resource instanceof UriResourceProperty) { selected.add(((UriResourceProperty) resource).getProperty().getName()); } else if (resource instanceof UriResourceNavigation) { selected.add(((UriResourceNavigation) resource).getProperty().getName()); } else if (resource instanceof UriResourceAction) { selected.add(((UriResourceAction) resource).getAction().getName()); } else if (resource instanceof UriResourceFunction) { selected.add(((UriResourceFunction) resource).getFunction().getName()); } } return selected; }