Skip to content

Commit

Permalink
Merge pull request #229 from stenbacka/fix-batch-from-isf
Browse files Browse the repository at this point in the history
Fix batch from isf
  • Loading branch information
stenbacka committed Oct 11, 2016
2 parents 7285e3d + 4899bde commit a280013
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,33 @@ public String doV3() throws Exception
return super.doV3();
}

private boolean hasAccessToViewTree()
{
String repositoryIdString = getRepositoryId().toString();
boolean result = hasAccessTo("Repository.Read", repositoryIdString);
if (!result && isBinding())
{
result = hasAccessTo("Repository.ReadForBinding", repositoryIdString);
}
if (logger.isDebugEnabled())
{
logger.debug("User is allowed access too content tree for repository: " + repositoryIdString + ": " + result);
}
return result;
}

/**
* @see org.infoglue.cms.applications.common.actions.TreeViewAbstractAction#getNodeSupplier()
*/
protected INodeSupplier getNodeSupplier() throws Exception, org.infoglue.cms.exception.SystemException
{
String interceptionPointName = isBinding() ? "Repository.ReadForBinding" : "Repository.Read";

if (getRepositoryId() == null || getRepositoryId().intValue() < 1)
{
return null;
}

// Check if this user really has access to this repository
if (hasAccessTo(interceptionPointName, getRepositoryId().toString()))
if (hasAccessToViewTree())
{
if (this.showVersions == null || this.showVersions.equals(""))
{
Expand All @@ -121,19 +134,7 @@ protected INodeSupplier getNodeSupplier() throws Exception, org.infoglue.cms.exc
{
getRequest().getSession().setAttribute("htmlTreeShowVersions", this.showVersions);
}

/*
Cookie[] cookies = getRequest().getCookies();
if(cookies != null)
for (int i=0; i < cookies.length; i++)
if (cookies[i].getName().compareTo("showversions") == 0)
if (cookies[i].getValue().compareTo("yes") == 0)
{
setShowVersions("yes");
return new ContentNodeVersionSupplier(getRepositoryId(), this.getInfoGluePrincipal().getName());
}
*/


INodeSupplier sup = null;
if (this.showVersions != null && this.showVersions.equalsIgnoreCase("yes"))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,33 @@ public String doV3() throws Exception
return super.doV3();
}


private boolean hasAccessToViewTree()
{
String repositoryIdString = getRepositoryId().toString();
boolean result = hasAccessTo("Repository.Read", repositoryIdString);
if (!result && isBinding())
{
result = hasAccessTo("Repository.ReadForBinding", repositoryIdString);
}
if (logger.isDebugEnabled())
{
logger.debug("User is allowed access too structure tree for repository: " + repositoryIdString + ": " + result);
}
return result;
}

/**
* @see org.infoglue.cms.applications.common.actions.TreeViewAbstractAction#getNodeSupplier()
*/
protected INodeSupplier getNodeSupplier() throws Exception, SystemException
{
String interceptionPointName = isBinding() ? "Repository.ReadForBinding" : "Repository.Read";

if(getRepositoryId() == null || getRepositoryId().intValue() < 1)
{
this.repositoryId = super.getRepositoryId();
}

// Check if this user really has access to this repository
if (hasAccessTo(interceptionPointName, getRepositoryId().toString()))
if (hasAccessToViewTree())
{
String treeMode = CmsPropertyHandler.getTreeMode();
if(treeMode != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
else
value = url.substring(valueIndex + parameterName.length + 1);
}
return value;
return decodeURIComponent(value);
}

function uploadAsset()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,11 @@
if(parent.assetMarked)
parent.assetMarked(contentId, assetKey, "");
*/

//alert("contentId:" + contentId);
document.getElementById("entityId").value = contentId;

selectedContentId(contentId);

document.getElementById("itreeFrame").src = "ViewContentHtmlTree!V3.action?repositoryId=$!repositoryId&exp=$exp&akey=/" + contentId + "/&select=" + contentId;
document.getElementById("contentVersionAssetsFrame").src = "ViewContentVersion!viewAssetsForFCKEditorSmallV3.action?contentId=" + contentId + "&languageId=$languageId&assetKey=" + assetKey + "&treatAsLink=$treatAsLink&assetTypeFilter=$assetTypeFilter";
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
else
value = url.substring(valueIndex + parameterName.length + 1);
//alert("value:" + value);
return value;
return decodeURIComponent(value);
}


Expand Down

0 comments on commit a280013

Please sign in to comment.