use of org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.DocumentSearchResultDTO in project carbon-apimgt by wso2.
the class SearchResultMappingUtil method fromDocumentationToDocumentResultDTO.
/**
* Get Document result representation for content search
* @param document
* @return
*/
public static DocumentSearchResultDTO fromDocumentationToDocumentResultDTO(Documentation document, API api) {
DocumentSearchResultDTO docResultDTO = new DocumentSearchResultDTO();
docResultDTO.setId(document.getId());
docResultDTO.setName(document.getName());
docResultDTO.setDocType(DocumentSearchResultDTO.DocTypeEnum.valueOf(document.getType().toString()));
docResultDTO.setType(SearchResultDTO.TypeEnum.DOC);
docResultDTO.setSummary(document.getSummary());
docResultDTO.setVisibility(DocumentSearchResultDTO.VisibilityEnum.valueOf(document.getVisibility().toString()));
docResultDTO.setSourceType(DocumentSearchResultDTO.SourceTypeEnum.valueOf(document.getSourceType().toString()));
docResultDTO.setOtherTypeName(document.getOtherTypeName());
APIIdentifier apiId = api.getId();
docResultDTO.setApiName(apiId.getApiName());
docResultDTO.setApiVersion(apiId.getVersion());
docResultDTO.setApiProvider(apiId.getProviderName());
docResultDTO.setApiUUID(api.getUUID());
return docResultDTO;
}
use of org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.DocumentSearchResultDTO in project carbon-apimgt by wso2.
the class SearchResultMappingUtil method fromDocumentationToDocumentResultDTO.
/**
* Get Document result representation for content search.
*
* @param document Api Document
* @return DocumentSearchResultDTO
*/
public static DocumentSearchResultDTO fromDocumentationToDocumentResultDTO(Documentation document, API api) throws APIManagementException {
DocumentSearchResultDTO docResultDTO = new DocumentSearchResultDTO();
docResultDTO.setId(document.getId());
docResultDTO.setName(document.getName());
docResultDTO.setDocType(DocumentSearchResultDTO.DocTypeEnum.valueOf(document.getType().toString()));
docResultDTO.setType(SearchResultDTO.TypeEnum.DOC);
docResultDTO.setSummary(document.getSummary());
docResultDTO.associatedType(APIConstants.AuditLogConstants.API);
docResultDTO.setVisibility(mapVisibilityFromDocumentToDTO(document.getVisibility()));
docResultDTO.setSourceType(mapSourceTypeFromDocumentToDTO(document.getSourceType()));
docResultDTO.setOtherTypeName(document.getOtherTypeName());
APIIdentifier apiId = api.getId();
docResultDTO.setApiName(apiId.getApiName());
docResultDTO.setApiVersion(apiId.getVersion());
docResultDTO.setApiProvider(APIUtil.replaceEmailDomainBack(apiId.getProviderName()));
docResultDTO.setApiUUID(api.getUUID());
return docResultDTO;
}
use of org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.DocumentSearchResultDTO in project carbon-apimgt by wso2.
the class SearchResultMappingUtil method fromDocumentationToProductDocumentResultDTO.
public static DocumentSearchResultDTO fromDocumentationToProductDocumentResultDTO(Documentation document, APIProduct apiProduct) throws APIManagementException {
DocumentSearchResultDTO docResultDTO = new DocumentSearchResultDTO();
docResultDTO.setId(document.getId());
docResultDTO.setName(document.getName());
docResultDTO.setDocType(DocumentSearchResultDTO.DocTypeEnum.valueOf(document.getType().toString()));
docResultDTO.setType(SearchResultDTO.TypeEnum.DOC);
docResultDTO.associatedType(APIConstants.AuditLogConstants.API_PRODUCT);
docResultDTO.setSummary(document.getSummary());
docResultDTO.setVisibility(mapVisibilityFromDocumentToDTO(document.getVisibility()));
docResultDTO.setSourceType(mapSourceTypeFromDocumentToDTO(document.getSourceType()));
docResultDTO.setOtherTypeName(document.getOtherTypeName());
APIProductIdentifier apiId = apiProduct.getId();
docResultDTO.setApiName(apiId.getName());
docResultDTO.setApiVersion(apiId.getVersion());
docResultDTO.setApiProvider(APIUtil.replaceEmailDomainBack(apiId.getProviderName()));
docResultDTO.setApiUUID(apiProduct.getUuid());
return docResultDTO;
}
Aggregations