Skip to content

Instantly share code, notes, and snippets.

@rdinnik
Created September 28, 2016 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rdinnik/11962c6c4d61d18ff95cc06718823d7f to your computer and use it in GitHub Desktop.
Save rdinnik/11962c6c4d61d18ff95cc06718823d7f to your computer and use it in GitHub Desktop.
Download file
// \META-INF\resources\util\control\FileLocationControl.js
if (!sLocationType || (sLocationType === "0")) {
// Create Embedded link control(commands: DownLoad and UpLoad) and add in HBox
oInstance.LocationType="2";
oConstraint.getCommandsDefinition = undefined; // for create link without command, should be restored
oInstance.Location=window.location.origin+"/powerdesigner-web/EmbeddedFileServlet?id="+oInstance.RepositoryId;
oEditLink = util.ControlFactory.createLinkControl(oInstance, oFeature, bEditable, oPropertyDefinition, false, true);
oConstraint.getCommandsDefinition = oCommand; // Restore commandDefinition
if (bEditable) {
oEditLink.getContent().setWidth("100%");
}
oResult.addItem(oEditLink);
oEditLink.bindProperty("visible", "/LocationType", oConstraint.editFormatter);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment