Hello Experts,
I need to customize import component from webtop to display custom attributes on the import screen for the user to fill in values.
Can you one explain me how to approach this.
Regards
Prashant
If there are Accepted Answers, those will be shown by default. You can switch to 'All Replies' by selecting the tab below.
hello Prashant,
if you call getContent, it returns handle to input stream but this should not be an issue as if you would have to calculate MD5 checksum of local file, in that case also you would have to get handle of input stream.
my concern is in which method you have written this code. if this is on onSave() method then there can be scenario where user is just updating document properties then this code needs not to be executed and will be overhead. you can either check if document is new object using isNew method or even can have this code under setContentEx2 method.
also, in TBO you should not be doing:
dfSysObject.setString("md5_value", output);
instead directly call setString method like:
setString("md5_value", output);
you can get custom properties value set on import screen in TBO using getString("<custom_attr_name>") method.
You can configure it in Composer. No need of customization.
Regards,
Kiran
refer 'Generating lists of attributes for display' of WDK development guide. This way you can configure different attribute list to display for same object type on checkin/properties/import etc. screens
THanks Tejraj for your inputs.
Below is the list of tasks I need to perform.
Can you let me know which component I need to extend in order to get above features in place.
Thanks in advance
as you mentioned, the first point can be taken care using Composer.
regarding setting md5 checksum, if you need to calculate it on client file system, then you need to write custom applet which needs to be trusted and signed applet. since we cannot override OTB applet's I would not rather take this approach of setting the attribute from client system instead will handle it in TBO assuming this attribute should always store the md5 checksum of document content (like user can checkout content and update the content then md5 checksum will not be same) and not during initial import only.
Hello Tejraj,
That's what I've tried and I also get the MD5 set through TBO. Below is the code snippet of TBO.
MessageDigest digest = MessageDigest.getInstance("MD5");
InputStream is = dfSysObject.getContent();
byte[] buffer = new byte[8192];
int read = 0;
while( (read = is.read(buffer)) > 0)
{
digest.update(buffer, 0, read);
}
byte[] md5sum = digest.digest();
BigInteger bigInt = new BigInteger(1, md5sum);
String output = bigInt.toString(16);
System.out.println("file has md5 : "+output);
The concerns I thought in this approach are:
Thanks Tejraj for your help.
I'm able to capture custom attributes from Import Screen and also able to set md5.
Now my task is only to set these attributes in Centera which I think is possible.
Thanks again