public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static ConnectedBean |
connectedBeanRecordFromJson(String json,
String sourceIdentifier,
String sourceDomain,
org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogue clg)
Get Connected bean from record
|
static String |
discoverEndPoint(String context)
Discover the service endpoint and return its url
|
static String |
getCurrentClientUrl(javax.servlet.http.HttpServletRequest httpServletRequest)
Needed to get the url of the client
|
static String |
getCurrentContext(javax.servlet.http.HttpServletRequest request,
boolean setInThread)
Retrieve the current scope by using the portal manager
|
static org.gcube.vomanagement.usermanagement.model.GCubeUser |
getCurrentUser(javax.servlet.http.HttpServletRequest request)
Retrieve the current user by using the portal manager
|
static eu.trentorise.opendata.jackan.model.CkanDataset |
getDatasetFromUrl(String url,
org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogue clg,
String apiKey)
Exploits the fact that in GRSF the url of a record contains the name (which is unique) of the record itself
|
static String |
getDatasetKnowledgeBaseIdFromUrl(String url)
Exploits the fact that in GRSF the url of a record contains the name (which is unique) of the record itself
|
static Map<String,String> |
getFieldToFieldNameSpaceMapping(javax.servlet.http.HttpSession httpSession,
String resourceName)
Return a map for converting a key to a namespace:key format by reading a generic resource.
|
static Set<String> |
getLookedUpExtrasKeys()
Look up from the IS other information that can be potentially displayed in read only mode in the management panel.
|
static eu.trentorise.opendata.jackan.model.CkanDataset |
getRecordBySemanticIdentifier(String suggestedRecordSemanticIdentifier,
org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogue catalogue,
String apiKey)
Given a semantic identifier, check if a record exists and return it
|
static String |
getScopeFromClientUrl(javax.servlet.http.HttpServletRequest httpServletRequest)
Get the scope in which ckan information needs to be discovered from the url
|
static boolean |
isIntoPortal()
Checks if is into portal.
|
static Map<String,List<String>> |
replaceFieldsKey(List<eu.trentorise.opendata.jackan.model.CkanPair> extrasAsPairs,
Map<String,String> namespaces)
Replace the extras' keys if needed, e.g.
|
static SimilarGRSFRecord |
similarGRSFRecordFromJson(String json)
Get a
SimilarGRSFRecord from a json string |
static String |
updateRecord(String serviceUrl,
ManageProductBean bean,
org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogue catalogue,
String username)
Send an update for this bean
|
public static Set<String> getLookedUpExtrasKeys()
public static Map<String,String> getFieldToFieldNameSpaceMapping(javax.servlet.http.HttpSession httpSession, String resourceName)
httpSession - public static Map<String,List<String>> replaceFieldsKey(List<eu.trentorise.opendata.jackan.model.CkanPair> extrasAsPairs, Map<String,String> namespaces)
extrasAsPairs - namespaces - public static String discoverEndPoint(String context)
context - public static String updateRecord(String serviceUrl, ManageProductBean bean, org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogue catalogue, String username) throws Exception
baseUrl - bean - username - catalogue - Exceptionpublic static String getScopeFromClientUrl(javax.servlet.http.HttpServletRequest httpServletRequest)
httpServletRequest - public static String getCurrentClientUrl(javax.servlet.http.HttpServletRequest httpServletRequest)
httpServletRequest - the httpServletRequest objecturl at client sidepublic static String getCurrentContext(javax.servlet.http.HttpServletRequest request, boolean setInThread)
b - public static org.gcube.vomanagement.usermanagement.model.GCubeUser getCurrentUser(javax.servlet.http.HttpServletRequest request)
public static eu.trentorise.opendata.jackan.model.CkanDataset getRecordBySemanticIdentifier(String suggestedRecordSemanticIdentifier, org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogue catalogue, String apiKey) throws Exception
suggestedRecordSemanticIdentifier - catalogue - Exception - in case no record matches the semantic identifierpublic static eu.trentorise.opendata.jackan.model.CkanDataset getDatasetFromUrl(String url, org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogue clg, String apiKey)
url - clg - public static String getDatasetKnowledgeBaseIdFromUrl(String url)
url - clg - public static SimilarGRSFRecord similarGRSFRecordFromJson(String json) throws org.json.simple.parser.ParseException
SimilarGRSFRecord from a json stringjson - SimilarGRSFRecordorg.json.simple.parser.ParseExceptionpublic static boolean isIntoPortal()
public static ConnectedBean connectedBeanRecordFromJson(String json, String sourceIdentifier, String sourceDomain, org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogue clg) throws org.json.simple.parser.ParseException
json - sourceIdentifier - sourceDomain - org.json.simple.parser.ParseExceptionCopyright © 2017. All Rights Reserved.