PDA

View Full Version : Own Class for Scanned PDF-Files - Posion in Structure


wilfried_loewe
12-13-2007, 11:11 AM
Hi,

I had a special Class for scanned PDF-Files - Typ DMCadDoc - with seperate BusinessObjectClass - XML-Extend:

<Class extends="DMCadDoc">
<Name>PDF_SCAN</Name>
<ClassDescription>Gescannte PDF-Dokumente (Infor)</ClassDescription>
<BusinessObjectClass>com.kl_wl_custom.dm.biz.DietzelScannedPDF</BusinessObjectClass>
<SortOrder>4.0</SortOrder>
<MaxFilesToKeep>1</MaxFilesToKeep>
<DisplayName>Gescannte PDF's</DisplayName>
<ChangeNoteClass catalog="awm_stda" msg_num="255">CHANGENOTE_2D</ChangeNoteClass>
<DragIconFile>/com/osm/media/net/pdf_16x16.png</DragIconFile>
<IconFile>/com/osm/media/net/pdf_16x16.png</IconFile>
<AuditTrail>ON</AuditTrail>
<ManageParts>true</ManageParts>
<CreateNewParts>false</CreateNewParts>
<CanCreateInUI>true</CanCreateInUI>
<InitialState catalog="awm_stda" msg_num="292">approved</InitialState>
<NameAttributeName catalog="awm_stda" msg_num="200">NAME</NameAttributeName>
<NameFormat>%Name%: [%Version%] %State% - [%DB_CLASS_NAME%]</NameFormat>
<DefaultSaveNewVersion>false</DefaultSaveNewVersion>
<VersionAttributeName catalog="awm_stda" msg_num="16">VERSION</VersionAttributeName>
<NameAttributeName catalog="awm_stda" msg_num="200">NAME</NameAttributeName>
<DescriptionAttributeName catalog="awm_stda" msg_num="201">DESCRIPTION</DescriptionAttributeName>
.
.
</Class>

What I had to do, that files of this Class are not shown in Section Attachments (like related PDF-Files) ??? -- see Screenshot !!! I want to see the Files directly under the Masterdata Objects as Models and Drawings ???

alexniccoli
12-14-2007, 05:24 AM
Hi Wilfried
Look at this method of Part.java:

/**
* Removes and doc from the list of children that isn't
* a model or a drawing. The reason for this is because
* these non-cad docs are added to the attachments
* folder.
* @param children the unfiltered list of children
* @return the filtered list of children
*/
private List removeAllNonMoldelAndDrawingDocs(List children) {
List filteredChildren = new ArrayList();

for (int i = 0; i < children.size(); i++) {
Object o = children.get(i);

if (o instanceof WMDoc) {
if (o instanceof CadDoc) {
filteredChildren.add(o);
}
} else {
filteredChildren.add(o);
}
}

return filteredChildren;
}

Non -CAD Documents are putted inside "attachments" folder.
So you cad create your own BusinessObjectClass per Masterdata Class extending for example DMMasterdata.java and working with this method
and methods that use this one:

sortAndFilterChildren() that use...

getDisplayChildren()


A.Niccoli