Hi there,
I'm not sure if that qualifies as a SDK challenge question but since it's in my Smartview plugin, I thought I'd give it a try….
In my plugin, I extend the Destry service
I declared my class as:
public class D2DestroyServicePlugin extends D2DestroyService implements ID2fsPlugin
In the destroy method, I do some testing and it looks like
@Override
public Destroyresult destroy(final Context context, final String id, final List<Attribute> attributes) throws D2FailureException, Exception
{
final Logger LOG = LoggerFactory.getLogger(this.getClass().getName() + "." + Utils.trace(Thread.currentThread().getStackTrace()));
final D2fsContext d2fsContext = (D2fsContext) context;
final IDfSession session = d2fsContext.getSession();
boolean canDelete = true;
Destroyresult result = new Destroyresult();
result.setIsDestroyed(false);
String error = "MY ERROR";
for (final String sId : id.split(CONST_SEPARATOR_VALUE))
{
... The testing is done here
}
if (canDelete)
{
if (LOG.isDebugEnabled())
LOG.debug("Objects can be destroyed."); //$NON-NLS-1$
result = super.destroy(context, id, attributes);
}
else
{
result.setError(error);
if (LOG.isDebugEnabled())
LOG.debug("Objects can't be destroyed"); //$NON-NLS-1$
}
return result;
}
In D2 Classics, if the document selected can't be destroyed, it will popup the error
In Smartview, I get (at the top)
But it doesn't show the error message I set….
Is that the expected behavior and if yes, how can i popup a message?