Added code and web.xml context parameter in order to hide header from portal
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@129173 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
eb2bb850f7
commit
49e08f2333
|
@ -4,12 +4,6 @@
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||||
<dependent-module archiveName="ckan-metadata-publisher-widget-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ckan-metadata-publisher-widget/ckan-metadata-publisher-widget">
|
|
||||||
<dependency-type>uses</dependency-type>
|
|
||||||
</dependent-module>
|
|
||||||
<dependent-module archiveName="ckan-util-library-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ckan-util-library/ckan-util-library">
|
|
||||||
<dependency-type>uses</dependency-type>
|
|
||||||
</dependent-module>
|
|
||||||
<property name="context-root" value="gcube-ckan-datacatalog"/>
|
<property name="context-root" value="gcube-ckan-datacatalog"/>
|
||||||
<property name="java-output-path" value="/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
<property name="java-output-path" value="/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
||||||
</wb-module>
|
</wb-module>
|
||||||
|
|
|
@ -43,6 +43,7 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
||||||
private static final String HTTPS = "https";
|
private static final String HTTPS = "https";
|
||||||
private static final String HTTP = "http";
|
private static final String HTTP = "http";
|
||||||
public static String CKANCONNECTORCONTEXT = "CkanConnectorContext";
|
public static String CKANCONNECTORCONTEXT = "CkanConnectorContext";
|
||||||
|
public static String CKANHIDEHEADER = "CkanHideHeader";
|
||||||
public static final String USERNAME_ATTRIBUTE = ScopeHelper.USERNAME_ATTRIBUTE;
|
public static final String USERNAME_ATTRIBUTE = ScopeHelper.USERNAME_ATTRIBUTE;
|
||||||
private static Logger logger = LoggerFactory.getLogger(GcubeCkanDataCatalogServiceImpl.class);
|
private static Logger logger = LoggerFactory.getLogger(GcubeCkanDataCatalogServiceImpl.class);
|
||||||
private final static String DEFAULT_ROLE = "OrganizationMember";
|
private final static String DEFAULT_ROLE = "OrganizationMember";
|
||||||
|
@ -105,6 +106,9 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
||||||
try{
|
try{
|
||||||
String ckanContext = getServletContext().getInitParameter(CKANCONNECTORCONTEXT);
|
String ckanContext = getServletContext().getInitParameter(CKANCONNECTORCONTEXT);
|
||||||
logger.debug(CKANCONNECTORCONTEXT + " is: "+ckanContext);
|
logger.debug(CKANCONNECTORCONTEXT + " is: "+ckanContext);
|
||||||
|
String ckanHideHeader = getServletContext().getInitParameter(CKANHIDEHEADER);
|
||||||
|
logger.debug(CKANHIDEHEADER + " is: "+ckanHideHeader);
|
||||||
|
|
||||||
ASLSession session = getASLSession(this.getThreadLocalRequest().getSession());
|
ASLSession session = getASLSession(this.getThreadLocalRequest().getSession());
|
||||||
GcoreEndpointReader ckanEndPoint = SessionUtil.getCkanEndPoint(session);
|
GcoreEndpointReader ckanEndPoint = SessionUtil.getCkanEndPoint(session);
|
||||||
String ckanConnectorUri = ckanEndPoint.getCkanResourceEntyName();
|
String ckanConnectorUri = ckanEndPoint.getCkanResourceEntyName();
|
||||||
|
@ -118,8 +122,9 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
||||||
ckanConnectorUri+="?"+GCUBE_TOKEN+"="+getGcubeSecurityToken();
|
ckanConnectorUri+="?"+GCUBE_TOKEN+"="+getGcubeSecurityToken();
|
||||||
}else{
|
}else{
|
||||||
logger.warn("******** Using TEST_USER security token!!!");
|
logger.warn("******** Using TEST_USER security token!!!");
|
||||||
ckanConnectorUri+="?"+GCUBE_TOKEN+"="+TEST_SEC_TOKEN;
|
ckanConnectorUri+="?"+GCUBE_TOKEN+"="+TEST_SEC_TOKEN +"&" +ckanHideHeader;
|
||||||
}
|
}
|
||||||
|
ckanConnectorUri+="&" +ckanHideHeader; //added query string to hide header from portal
|
||||||
logger.info("returning ckanConnectorUri: "+ckanConnectorUri);
|
logger.info("returning ckanConnectorUri: "+ckanConnectorUri);
|
||||||
return ckanConnectorUri;
|
return ckanConnectorUri;
|
||||||
// return "http://ckan-d-d4s.d4science.org";
|
// return "http://ckan-d-d4s.d4science.org";
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
sendButton = Envoyer
|
|
||||||
nameField = Entrez votre nom
|
|
|
@ -11,6 +11,12 @@
|
||||||
<param-value>/gcube/service/connect</param-value>
|
<param-value>/gcube/service/connect</param-value>
|
||||||
</context-param>
|
</context-param>
|
||||||
|
|
||||||
|
<context-param>
|
||||||
|
<param-name>CkanHideHeader</param-name>
|
||||||
|
<!-- <param-value>/connect</param-value> -->
|
||||||
|
<param-value>/hh=true</param-value>
|
||||||
|
</context-param>
|
||||||
|
|
||||||
<!-- Servlets -->
|
<!-- Servlets -->
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>gcubeckandatacatalogservice</servlet-name>
|
<servlet-name>gcubeckandatacatalogservice</servlet-name>
|
||||||
|
|
Loading…
Reference in New Issue