cancel
Showing results for 
Search instead for 
Did you mean: 

Reuse image file from another DC

Former Member
0 Kudos

Hi everyone,

Is it possible to re-use image file stored in the mimes folder of a component in a DC from another DC ? If it is possible, how do we access the image?

Thanks,

Johannes

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Did you find any way to share the mime files between diferents DC's?

Former Member
0 Kudos

Hi,

This is part of the code I use here in one Project.


  public java.lang.String getBitmapURLByIconId( java.lang.String iconId, java.util.Map iconMap )
  {
    //@@begin getBitmapURLByIconId()
    String bitmapByIconId = getBitmapByIconId(iconId, iconMap);
    if (null == bitmapByIconId) // Not a Valid Icon..
    	return "";
    	
    WDDeployableObjectPart deployableObjectPart = wdComponentAPI.getDeployableObjectPart();
    try {
		IWDWebResource webResource = WDWebResource.getWebResource(deployableObjectPart, WDWebResourceType.PNG, bitmapByIconId);
		return webResource.getAbsoluteURL();
    }
    catch (Exception ex) {
    	wdComponentAPI.getMessageManager().reportException("Error Loading Icon '" + bitmapByIconId + "', " + ex.getMessage(), true);
    	return "";
    }
    //@@end
  }

In particular, we drive some configuration for Icons / Tooltips from the back-end. The variable "bitmapByIconId" will be populated with whatever Icon name I want to get. What you should look at is basically the IWDWebResource part, don't bother with the rest of the code..

This is part of a DC and I expose some methods in its Interface Controller so I can re-use the same pictures everywhere.

Hope it helps,

Daniel