D2 configuration vs. a_is_hidden

Recently we came across a requirement that involved showing the a_is_hidden attribute in the content widget, regardless of its value.

At first glance, it seemed an easy goal to achieve, just add the attribute to the column list and it will work. Well, it doesn’t. The content widget just displays objects with a_is_hidden=false (duh!).

Next step, would be to find the configuration that manages this behaviour. Well, after looking a bit, we found the “configuration” that handles this:

com.emc.d2fs.dctm.content.FolderContent generates a DQL in order to retrieve the contents of the folder, and the method that generates this query uses com.emc.d2.api.preferences.ID2cPreferences to retrieve different preferences related to queries.

Some decompiling get us to the configurable side of things:

com.emc.d2.api.preferences.D2cPreferences:

 public DqlFilter getDqlFilter()
{
DqlFilter result = new DqlFilter(false, false);
return result;
}

com.emc.d2.api.preferences.DqlFilter:

public final class DqlFilter
{
private boolean m_showHidden;
private boolean m_showArchive;

public DqlFilter(boolean showHidden, boolean showArchive)
{
this.m_showHidden = showHidden;
this.m_showArchive = showArchive;
}

public String toString()
{
StringBuffer result = new StringBuffer();
if (!this.m_showHidden) {
result.append("a_is_hidden = false");
}
if (!this.m_showArchive)
{
if (result.length() != 0) {
result.append(" and ");
}
result.append("a_archive = false");
}
return result.toString();
}
}

So much for configurable application…

Assap 7.0 vs msg format

We’ve been facing a weird issue with assap 7.0 sp2 and .msg files in SAP GUI. Any file will open from SAP GUI (PDF, TIFF, JPEG) but trying to open a .msg file will prompt user to download an “unknown format” file named as the repository.

However, opening the .msg file from Webtop, any DFC client or the dmview client works just fine.

We tried suggestions from support page (adding mime type to server configuration, to dm_format, etc.) with no luck.

So I decompiled the servlet that sends the response (com.documentum.ei.al.SendHttpResponse):

 response.setContentLength((int)numBytesAvail);
 if (filename != null)
 {
 filename = URLEncoder.encode(filename, "UTF-8");
 String showFileOpenDialog = PropertiesManager.getALPropValue("archiving.fileOpen.confirmation");
 if ((showFileOpenDialog != null) && (showFileOpenDialog.equalsIgnoreCase("true"))) {
 response.setHeader("content-disposition", "attachment; filename=" + filename);
 }
 }

 

So I decided to turn on the showFileOpenDialog option on al.properties and.. it works! However, this prompts the user with a dialog showing “open/save” options for any file.

So, what’s going on? Well, it looks like that browsers (as I can reproduce this behaviour in any browser by calling the url that SAP GUI uses) won’t handle correctly downloads with mime-types associated to external applications (because files handled by the browser work fine), unless the content-disposition header is set, so in this particular case, to just solve the problem with .msg files:

 response.setContentLength((int)numBytesAvail);
if (filename != null)
{
filename = URLEncoder.encode(filename, "UTF-8");
String showFileOpenDialog = PropertiesManager.getALPropValue("archiving.fileOpen.confirmation");
if ((showFileOpenDialog != null) && (showFileOpenDialog.equalsIgnoreCase("true"))) {
response.setHeader("content-disposition", "attachment; filename=" + filename);
}else{
if (context.getContentType().equalsIgnoreCase("application/vnd.ms-outlook")) {
response.setHeader("content-disposition", "inline; filename=" + filename);
}
}
}

and throwing the class into WEB-INF/classes solves the problem