git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@142208 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
1919d3f2c3
commit
738f4f4435
|
@ -97,6 +97,10 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
instanceCkanFrame(ckan.buildURI());
|
||||
GCubeCkanDataCatalogPanel.this.rootPanel.remove(loading);
|
||||
|
||||
if(ckan.isOutsideFromPortal())
|
||||
hideHeaderSection();
|
||||
|
||||
|
||||
// now perform the other requests
|
||||
GCubeCkanDataCatalog.service.outsidePortal(new AsyncCallback<Boolean>() {
|
||||
|
||||
|
@ -174,7 +178,7 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
|
||||
@Override
|
||||
public void onSuccess(Boolean result) {
|
||||
isManageProductToShow = result;
|
||||
isManageProductToShow = result;
|
||||
managementPanel.showManageProductButton(isManageProductToShow);
|
||||
|
||||
}
|
||||
|
@ -223,6 +227,18 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
listenForPostMessage();
|
||||
}
|
||||
|
||||
private native void hideHeaderSection() /*-{
|
||||
|
||||
var e = $wnd.$doc.getElementByTagName('<header>');
|
||||
console.log('header : '+e);
|
||||
if(e){
|
||||
console.log('header found');
|
||||
e.style.visibility = 'hidden';
|
||||
}
|
||||
|
||||
}-*/;
|
||||
|
||||
|
||||
public static String getLatestSelectedProductIdentifier(){
|
||||
return latestSelectedProductIdentifier;
|
||||
}
|
||||
|
|
|
@ -120,6 +120,7 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
|
||||
if(outsidePortal()){
|
||||
CkanConnectorAccessPoint ckan = new CkanConnectorAccessPoint(getCatalogue(scopePerCurrentUrl).getCatalogueUrl(),"");
|
||||
ckan.setOutsideFromPortal(true);
|
||||
return ckan;
|
||||
}
|
||||
|
||||
|
@ -164,8 +165,8 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
|
||||
// retrieve the list of VREs to whom the user belongs (actually one vre at most is sent)
|
||||
Map<String, String> roleForVre = UserUtil.getVreRoleForUser(
|
||||
SessionUtil.getCurrentUser(getThreadLocalRequest()).getEmail(),
|
||||
scopePerCurrentUrl,
|
||||
SessionUtil.getCurrentUser(getThreadLocalRequest()).getEmail(),
|
||||
scopePerCurrentUrl,
|
||||
getCatalogue(scopePerCurrentUrl));
|
||||
ckan.addListOfVREs(roleForVre);
|
||||
|
||||
|
@ -262,7 +263,7 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
|
||||
/**
|
||||
* Fetch the list of ckan groups for which the user is member
|
||||
* @param context
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
private List<GroupBean> fetchUserGroups(String context, String username) {
|
||||
|
@ -279,7 +280,7 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
for (Entry<String, Map<CkanGroup, RolesCkanGroupOrOrg>> entry : set) {
|
||||
Set<Entry<CkanGroup, RolesCkanGroupOrOrg>> subSet = entry.getValue().entrySet();
|
||||
for (Entry<CkanGroup, RolesCkanGroupOrOrg> subEntry : subSet) {
|
||||
toReturn.add(new GroupBean(subEntry.getKey().getTitle(), subEntry.getKey().getName()));
|
||||
toReturn.add(new GroupBean(subEntry.getKey().getTitle(), subEntry.getKey().getName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -530,7 +531,7 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
try{
|
||||
PortalContext pContext = PortalContext.getConfiguration();
|
||||
List<GCubeRole> userRoles = new LiferayRoleManager().listRolesByUserAndGroup(
|
||||
pContext.getCurrentUser(getThreadLocalRequest()).getUserId(),
|
||||
pContext.getCurrentUser(getThreadLocalRequest()).getUserId(),
|
||||
pContext.getCurrentGroupId(getThreadLocalRequest()));
|
||||
boolean isGRSFAdminRoleSet = false;
|
||||
for (GCubeRole gCubeRole : userRoles) {
|
||||
|
|
|
@ -35,6 +35,8 @@ public class CkanConnectorAccessPoint implements Serializable{
|
|||
private Map<String, String> mapVresRoles;
|
||||
private String serverviceContext;
|
||||
|
||||
private boolean outsideFromPortal = false;
|
||||
|
||||
/**
|
||||
* Instantiates a new ckan connector access point.
|
||||
*/
|
||||
|
@ -237,6 +239,28 @@ public class CkanConnectorAccessPoint implements Serializable{
|
|||
return value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return the outsideFromPortal
|
||||
*/
|
||||
public boolean isOutsideFromPortal() {
|
||||
|
||||
return outsideFromPortal;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param outsideFromPortal the outsideFromPortal to set
|
||||
*/
|
||||
public void setOutsideFromPortal(boolean outsideFromPortal) {
|
||||
|
||||
this.outsideFromPortal = outsideFromPortal;
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
|
@ -250,12 +274,12 @@ public class CkanConnectorAccessPoint implements Serializable{
|
|||
builder.append(pathInfoParameter);
|
||||
builder.append(", queryStringParameters=");
|
||||
builder.append(queryStringParameters);
|
||||
builder.append(", gcubeTokenValue=");
|
||||
builder.append(gcubeTokenValue);
|
||||
builder.append(", listOfVRes=");
|
||||
builder.append(", mapVresRoles=");
|
||||
builder.append(mapVresRoles);
|
||||
builder.append(", context=");
|
||||
builder.append(", serverviceContext=");
|
||||
builder.append(serverviceContext);
|
||||
builder.append(", outsideFromPortal=");
|
||||
builder.append(outsideFromPortal);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue