procedure.setProperty(PRODUCES, produces); procedure.setProperty(CONSUMES, consumes); procedure.setAnnotation(getOperationSummary(operation)); for (Entry<String, Object> extension:operation.getVendorExtensions().entrySet()) { procedure.setProperty(extension.getKey(), extension.getValue().toString());
@Override public void getMetadata(MetadataFactory metadataFactory, VirtualFileConnection connection) throws TranslatorException { Procedure p = metadataFactory.addProcedure(GETTEXTFILES); p.setAnnotation("Returns text files that match the given path and pattern as CLOBs"); //$NON-NLS-1$ ProcedureParameter param = metadataFactory.addProcedureParameter("pathAndPattern", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$ param.setAnnotation("The path and pattern of what files to return. Currently the only pattern supported is *.<ext>, which returns only the files matching the given extension at the given path."); //$NON-NLS-1$ p1.setAnnotation("Returns files that match the given path and pattern as BLOBs"); //$NON-NLS-1$ param = metadataFactory.addProcedureParameter("pathAndPattern", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p1); //$NON-NLS-1$ param.setAnnotation("The path and pattern of what files to return. Currently the only pattern supported is *.<ext>, which returns only the files matching the given extension at the given path."); //$NON-NLS-1$ p2.setAnnotation("Saves the given value to the given path. Any existing file will be overriden."); //$NON-NLS-1$ metadataFactory.addProcedureParameter("filePath", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p2); //$NON-NLS-1$ param = metadataFactory.addProcedureParameter("file", TypeFacility.RUNTIME_NAMES.OBJECT, Type.In, p2); //$NON-NLS-1$ p3.setAnnotation("Delete the given file path. "); //$NON-NLS-1$ metadataFactory.addProcedureParameter("filePath", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p3); //$NON-NLS-1$
public static void addProcedrues(MetadataFactory metadataFactory) { Procedure p1 = metadataFactory.addProcedure("GetUpdated"); //$NON-NLS-1$ p1.setAnnotation("Gets the updated objects"); //$NON-NLS-1$ ProcedureParameter param = metadataFactory.addProcedureParameter("ObjectName", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p1); //$NON-NLS-1$ param.setAnnotation("ObjectName"); //$NON-NLS-1$ param = metadataFactory.addProcedureParameter("StartDate", TypeFacility.RUNTIME_NAMES.TIMESTAMP, Type.In, p1); //$NON-NLS-1$ param.setAnnotation("Start Time"); //$NON-NLS-1$ param = metadataFactory.addProcedureParameter("EndDate", TypeFacility.RUNTIME_NAMES.TIMESTAMP, Type.In, p1); //$NON-NLS-1$ param.setAnnotation("End Time"); //$NON-NLS-1$ param = metadataFactory.addProcedureParameter("LatestDateCovered", TypeFacility.RUNTIME_NAMES.TIMESTAMP, Type.In, p1); //$NON-NLS-1$ param.setAnnotation("Latest Date Covered"); //$NON-NLS-1$ metadataFactory.addProcedureResultSetColumn("ID", TypeFacility.RUNTIME_NAMES.STRING, p1); //$NON-NLS-1$ Procedure p2 = metadataFactory.addProcedure("GetDeleted"); //$NON-NLS-1$ p2.setAnnotation("Gets the deleted objects"); //$NON-NLS-1$ param = metadataFactory.addProcedureParameter("ObjectName", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p2); //$NON-NLS-1$ param.setAnnotation("ObjectName"); //$NON-NLS-1$ param = metadataFactory.addProcedureParameter("StartDate", TypeFacility.RUNTIME_NAMES.TIMESTAMP, Type.In, p2); //$NON-NLS-1$ param.setAnnotation("Start Time"); //$NON-NLS-1$ param = metadataFactory.addProcedureParameter("EndDate", TypeFacility.RUNTIME_NAMES.TIMESTAMP, Type.In, p2); //$NON-NLS-1$ param.setAnnotation("End Time"); //$NON-NLS-1$ param = metadataFactory.addProcedureParameter("EarliestDateAvailable", TypeFacility.RUNTIME_NAMES.TIMESTAMP, Type.In, p2); //$NON-NLS-1$ param.setAnnotation("Earliest Date Available"); //$NON-NLS-1$ param = metadataFactory.addProcedureParameter("LatestDateCovered", TypeFacility.RUNTIME_NAMES.TIMESTAMP, Type.In, p2); //$NON-NLS-1$ param.setAnnotation("Latest Date Covered"); //$NON-NLS-1$ metadataFactory.addProcedureResultSetColumn("ID", TypeFacility.RUNTIME_NAMES.STRING, p2); //$NON-NLS-1$ metadataFactory.addProcedureResultSetColumn("DeletedDate", TypeFacility.RUNTIME_NAMES.TIMESTAMP, p2); //$NON-NLS-1$ }
@Override public void loadMetadata(MetadataFactory factory, ExecutionFactory executionFactory, Object connectionFactory) throws TranslatorException { if (executionFactory != null && executionFactory.supportsDirectQueryProcedure() && factory.getSchema().getProcedure(executionFactory.getDirectQueryProcedureName()) == null) { Procedure p = factory.addProcedure(executionFactory.getDirectQueryProcedureName()); p.setAnnotation("Invokes translator with a native query that returns results in an array of values"); //$NON-NLS-1$ ProcedureParameter param = factory.addProcedureParameter("request", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$ param.setAnnotation("The native query to execute"); //$NON-NLS-1$ param.setNullType(NullType.No_Nulls); param = factory.addProcedureParameter("variable", TypeFacility.RUNTIME_NAMES.OBJECT, Type.In, p); //$NON-NLS-1$ param.setAnnotation("Any number of varaibles; usage will vary by translator"); //$NON-NLS-1$ param.setNullType(NullType.Nullable); param.setVarArg(true); factory.addProcedureResultSetColumn("tuple", DataTypeManager.getDataTypeName(DataTypeManager.getArrayType(TypeFacility.RUNTIME_TYPES.OBJECT)), p); //$NON-NLS-1$ } } }
@Override public void loadMetadata(MetadataFactory factory, ExecutionFactory executionFactory, Object connectionFactory) throws TranslatorException { if (executionFactory != null && executionFactory.supportsDirectQueryProcedure() && factory.getSchema().getProcedure(executionFactory.getDirectQueryProcedureName()) == null) { Procedure p = factory.addProcedure(executionFactory.getDirectQueryProcedureName()); p.setAnnotation("Invokes translator with a native query that returns results in an array of values"); //$NON-NLS-1$ ProcedureParameter param = factory.addProcedureParameter("request", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$ param.setAnnotation("The native query to execute"); //$NON-NLS-1$ param.setNullType(NullType.No_Nulls); param = factory.addProcedureParameter("variable", TypeFacility.RUNTIME_NAMES.OBJECT, Type.In, p); //$NON-NLS-1$ param.setAnnotation("Any number of varaibles; usage will vary by translator"); //$NON-NLS-1$ param.setNullType(NullType.Nullable); param.setVarArg(true); factory.addProcedureResultSetColumn("tuple", DataTypeManager.getDataTypeName(DataTypeManager.getArrayType(TypeFacility.RUNTIME_TYPES.OBJECT)), p); //$NON-NLS-1$ } } }
@Override public void loadMetadata(MetadataFactory factory, ExecutionFactory executionFactory, Object connectionFactory) throws TranslatorException { if (executionFactory != null && executionFactory.supportsDirectQueryProcedure() && factory.getSchema().getProcedure(executionFactory.getDirectQueryProcedureName()) == null) { Procedure p = factory.addProcedure(executionFactory.getDirectQueryProcedureName()); p.setAnnotation("Invokes translator with a native query that returns results in an array of values"); //$NON-NLS-1$ ProcedureParameter param = factory.addProcedureParameter("request", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$ param.setAnnotation("The native query to execute"); //$NON-NLS-1$ param.setNullType(NullType.No_Nulls); param = factory.addProcedureParameter("variable", TypeFacility.RUNTIME_NAMES.OBJECT, Type.In, p); //$NON-NLS-1$ param.setAnnotation("Any number of varaibles; usage will vary by translator"); //$NON-NLS-1$ param.setNullType(NullType.Nullable); param.setVarArg(true); factory.addProcedureResultSetColumn("tuple", DataTypeManager.getDataTypeName(DataTypeManager.getArrayType(TypeFacility.RUNTIME_TYPES.OBJECT)), p); //$NON-NLS-1$ } } }