/* */ package com.ptc.windchill.enterprise.change2.reports; /* */ /* */ import com.infoengine.object.factory.Att; /* */ import com.infoengine.object.factory.Element; /* */ import com.infoengine.object.factory.Group; /* */ import com.ptc.core.adapter.server.impl.ObjectReferenceTranslator; /* */ import com.ptc.core.command.common.CommandHelper; /* */ import com.ptc.core.components.rendering.guicomponents.GuiComponentUtil; /* */ import com.ptc.core.meta.common.AttributeIdentifier; /* */ import com.ptc.core.meta.common.AttributeTypeIdentifier; /* */ import com.ptc.core.meta.common.Hyperlink; /* */ import com.ptc.core.meta.common.IdentifierFactory; /* */ import com.ptc.core.meta.common.IllegalFormatException; /* */ import com.ptc.core.meta.common.OperationIdentifier; /* */ import com.ptc.core.meta.common.TypeIdentifier; /* */ import com.ptc.core.meta.common.TypeInstanceIdentifier; /* */ import com.ptc.core.meta.common.impl.WCTypeIdentifier; /* */ import com.ptc.core.meta.container.common.State; /* */ import com.ptc.core.meta.descriptor.common.DefinitionDescriptor; /* */ import com.ptc.core.meta.descriptor.common.DefinitionDescriptorFactory; /* */ import com.ptc.core.meta.server.TypeIdentifierUtility; /* */ import com.ptc.core.meta.type.common.TypeInstance; /* */ import com.ptc.core.ocmp.framework.AdvancedComparisonSpec; /* */ import com.ptc.core.ocmp.framework.ComparisonResult; /* */ import com.ptc.core.ocmp.framework.ComparisonSpec; /* */ import com.ptc.core.ocmp.framework.LinkDiffs; /* */ import com.ptc.core.ocmp.framework.impl.XmlConfigResourceHandler; /* */ import com.ptc.core.ocmp.framework.impl.custom.RelatedOwnerCadDocumentComparator; /* */ import com.ptc.core.ocmp.service.ObjComparisonHelper; /* */ import com.ptc.core.richtext.HTMLTextFilter; /* */ import com.ptc.netmarkets.model.NmOid; /* */ import com.ptc.netmarkets.util.misc.NmAction; /* */ import com.ptc.netmarkets.util.misc.NmActionServiceHelper; /* */ import com.ptc.windchill.cadx.common.util.DateFormatUtilities; /* */ import com.ptc.windchill.enterprise.attachments.dataUtilities.AttachmentsDataUtilityHelper; /* */ import com.ptc.windchill.enterprise.attachments.server.AttachmentsHelper; /* */ import com.ptc.windchill.enterprise.attachments.validators.AttachmentsValidationHelper; /* */ import com.ptc.windchill.enterprise.object.ActionDelegateHelper; /* */ import com.ptc.windchill.enterprise.report.ReportHelper; /* */ import com.ptc.windchill.enterprise.report.utils.ReportTaskUtil; /* */ import com.ptc.windchill.linkeddata.WTResource; /* */ import com.ptc.windchill.uwgm.common.associate.AssociationType; /* */ import java.io.IOException; /* */ import java.lang.reflect.InvocationHandler; /* */ import java.lang.reflect.Proxy; /* */ import java.util.ArrayList; /* */ import java.util.Date; /* */ import java.util.Enumeration; /* */ import java.util.HashMap; /* */ import java.util.List; /* */ import java.util.Locale; /* */ import java.util.Map; /* */ import java.util.Set; /* */ import org.apache.logging.log4j.Logger; /* */ import org.json.JSONObject; /* */ import wt.access.AccessControlHelper; /* */ import wt.access.AccessPermission; /* */ import wt.change2.AffectedActivityData; /* */ import wt.change2.ChangeHelper2; /* */ import wt.change2.ChangeIntentHelper; /* */ import wt.change2.ChangeIssue; /* */ import wt.change2.ChangeItem; /* */ import wt.change2.ChangeOrder2; /* */ import wt.change2.ChangeRecord2; /* */ import wt.change2.ChangeRequest2; /* */ import wt.change2.Changeable2; /* */ import wt.change2.FlexibleChangeItem; /* */ import wt.change2.HangingChangeLink; /* */ import wt.change2.VersionableChangeItem; /* */ import wt.change2.WTChangeOrder2; /* */ import wt.change2.flexible.FlexibleChangeHelper; /* */ import wt.change2.hangingchange.HangingChangeCriteria; /* */ import wt.change2.hangingchange.HangingChangeHelper; /* */ import wt.clients.util.IconCache; /* */ import wt.content.ApplicationData; /* */ import wt.content.ContentHolder; /* */ import wt.content.ContentItem; /* */ import wt.content.ContentRoleType; /* */ import wt.content.DataFormat; /* */ import wt.content.DataFormatReference; /* */ import wt.content.URLData; /* */ import wt.epm.structure.EPMMemberLink; /* */ import wt.fc.BinaryLink; /* */ import wt.fc.EnumeratedTypeUtil; /* */ import wt.fc.IconDelegate; /* */ import wt.fc.IconDelegateFactory; /* */ import wt.fc.ObjectReference; /* */ import wt.fc.Persistable; /* */ import wt.fc.PersistenceHelper; /* */ import wt.fc.PersistenceManager; /* */ import wt.fc.QueryResult; /* */ import wt.fc.ReferenceFactory; /* */ import wt.fc.WTObject; /* */ import wt.fc.WTReference; /* */ import wt.fc.collections.WTArrayList; /* */ import wt.fc.collections.WTCollection; /* */ import wt.fc.collections.WTHashSet; /* */ import wt.fc.collections.WTKeyedMap; /* */ import wt.fv.master.RedirectDownload; /* */ import wt.identity.IdentityFactory; /* */ import wt.inf.container.WTContained; /* */ import wt.inf.team.ContainerTeamHelper; /* */ import wt.introspection.WTIntrospector; /* */ import wt.log4j.LogR; /* */ import wt.method.MethodLocal; /* */ import wt.org.OrganizationOwned; /* */ import wt.org.OrganizationServicesHelper; /* */ import wt.org.WTGroup; /* */ import wt.org.WTOrganization; /* */ import wt.org.WTPrincipal; /* */ import wt.org.WTPrincipalReference; /* */ import wt.org.WTUser; /* */ import wt.part.Quantity; /* */ import wt.part.QuantityUnit; /* */ import wt.part.WTPart; /* */ import wt.part.WTPartMaster; /* */ import wt.part.WTPartUsageLink; /* */ import wt.pom.PersistenceException; /* */ import wt.project.Role; /* */ import wt.services.applicationcontext.implementation.DefaultServiceProvider; /* */ import wt.session.SessionHelper; /* */ import wt.session.SessionManagerSvr; /* */ import wt.session.SessionServerHelper; /* */ import wt.team.Team; /* */ import wt.team.TeamManaged; /* */ import wt.team.TeamReference; /* */ import wt.util.HTMLEncoder; /* */ import wt.util.LocalizableMessage; /* */ import wt.util.WTException; /* */ import wt.util.WTMessage; /* */ import wt.util.WTProperties; /* */ import wt.util.WTStandardDateFormat; /* */ import wt.util.WrappedTimestamp; /* */ import wt.vc.Iterated; /* */ import wt.vc.VersionControlHelper; /* */ import wt.vc.Versioned; /* */ import wt.vc.struct.IteratedUsageLink; /* */ import wt.vc.views.ViewManageable; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class ChangeItemReportHelper /* */ { /* */ private static final String STRUCTDIFFICON = "STRUCTDIFFICON"; /* */ protected static final String LINKTYPE = "LINKTYPE"; /* */ protected static final String COMPTYPE = "COMPTYPE"; /* */ protected static final String COMPVERSION = "COMPVERSION"; /* */ protected static final String COMPNAME = "COMPNAME"; /* */ protected static final String COMPNUMBER = "COMPNUMBER"; /* */ protected static final String COMPORGID = "COMPORGID"; /* */ protected static final String COMPVERSIONOLD = "COMPVERSIONOLD"; /* */ protected static final String COMPNAMEOLD = "COMPNAMEOLD"; /* */ protected static final String COMPNUMBEROLD = "COMPNUMBEROLD"; /* */ protected static final String COMPORGIDOLD = "COMPORGIDOLD"; /* */ protected static final String STRUCTDIFF = "STRUCTDIFF"; /* */ private static final String OBID = "obid"; /* */ private static final String VERSION = "version"; /* */ private static final String NAME = "name"; /* */ protected static final String NUMBER = "number"; /* */ private static final String MODIFIER_ID = "modifier.id"; /* */ private static final String CREATOR_ID = "creator.id"; /* */ private static final String DISPOSITION_COMMENTS = "DISPOSITIONCOMMENTS"; /* */ private static final String DISPOSITION_KEY = "DISPOSITIONKEY"; /* */ private static final String DISPOSITION_VALUE = "DISPOSITIONVALUE"; /* */ protected String ON_ORDER_DISPOSITION; /* */ protected String INVENTORY_DISPOSITION; /* */ protected String FINISHED_DISPOSITION; /* */ private static final String CHANGE_ADMIN1 = "CHANGE_ADMIN1"; /* */ private static final String VARIANCEOWNERATTRIBUTE = "varianceOwner"; /* */ protected static final String RESOLUTIONDATEATTRIBUTE = "resolutionDate"; /* */ protected static final String NEEDDATEATTRIBUTE = "needDate"; /* */ protected static final String CHANGENOTICECOMPLEXITYATTRIBUTE = "theChangeNoticeComplexity"; /* */ protected static final String VARIANCECATEGORYATTRIBUTE = "theVarianceCategory"; /* */ protected static final String CATEGORYATTRIBUTE = "theCategory"; /* */ protected static final String COMPLEXITYATTRIBUTE = "theComplexity"; /* */ protected static final String REQUESTPRIORITYATTRIBUTE = "requestPriority"; /* */ protected static final String ISSUEPRIORITYATTRIBUTE = "theIssuePriority"; /* */ protected static final String ATTRTYPE_DATE = "date"; /* */ protected static final String ATTRTYPE_TIMESTAMP = "timeStamp"; /* */ protected static final String ATTRTYPE_REFERENCE = "reference"; /* */ protected static final String ATTRTYPE_ENUMERATED = "enumerated"; /* */ protected static final String ATTRTYPE_RICHTEXT = "richText"; /* */ protected static final String FOLDERID_ATTRIBUTE = "folderId"; /* */ protected static final String LONGDESCRIPTION_PLAINTEXT_ATTRIBUTE = "longDescriptionPlainText"; /* */ protected static final String LONGDESCRIPTION_RICHTEXT_ATTRIBUTE = "longDescriptionRichText"; /* */ protected static final String LONGDESCRIPTION_COGNOS_RICHTEXT_ATTRIBUTE = "longDescriptionCognosRichText"; /* */ protected static final String LONGDESCRIPTION_JASPER_RICHTEXT_ATTRIBUTE = "longDescriptionJasperRichText"; /* */ protected static final String LONGPROPOSEDSOLUTION_PLAINTEXT_ATTRIBUTE = "longProposedSolutionPlainText"; /* */ protected static final String LONGPROPOSEDSOLUTION_RICHTEXT_ATTRIBUTE = "longProposedSolutionRichText"; /* */ protected static final String LONGPROPOSEDSOLUTION_COGNOS_RICHTEXT_ATTRIBUTE = "longProposedSolutionCognosRichText"; /* */ protected static final String LONGPROPOSEDSOLUTION_JASPER_RICHTEXT_ATTRIBUTE = "longProposedSolutionJasperRichText"; /* */ protected static final String LONGREASON_PLAINTEXT_ATTRIBUTE = "longReasonPlainText"; /* */ protected static final String LONGREASON_RICHTEXT_ATTRIBUTE = "longReasonRichText"; /* */ protected static final String LONGREASON_COGNOS_RICHTEXT_ATTRIBUTE = "longReasonCognosRichText"; /* */ protected static final String LONGREASON_JASPER_RICHTEXT_ATTRIBUTE = "longReasonJasperRichText"; /* */ protected static final String MODIFYTS_ATTRIBUTE = "modifyTimeStamp"; /* */ protected static final String CREATETS_ATTRIBUTE = "createTimeStamp"; /* */ protected static final String CONTAINERNAME_ATTRIBUTE = "containerName"; /* */ protected static final String ORGANIZATIONIDENTIFIER_ATTRIBUTE = "organizationIdentifier"; /* */ protected static final String STATE_ATTRIBUTE = "state"; /* */ protected static final String FOLDERID_INTERNALNAME = "folder.id"; /* */ protected static final String LONGDESCRIPTION_INTERNALNAME = "longDescription.formattedtext"; /* */ protected static final String LONGPROPOSEDSOLUTION_INTERNALNAME = "longProposedSolution.formattedtext"; /* */ protected static final String LONGREASON_INTERNALNAME = "longReason.formattedtext"; /* */ protected static final String TYPE = "type"; /* */ protected static final String MODIFYTS_INTERNALNAME = "thePersistInfo.modifyStamp"; /* */ protected static final String CREATETS_INTERNALNAME = "thePersistInfo.createStamp"; /* */ protected static final String CONTAINERREFERENCE_INTERNALNAME = "containerReference"; /* */ protected static final String ORGANIZATIONREFERENCE_INTERNALNAME = "masterReference^organizationReference"; /* */ protected static final String STATE_INTERNALNAME = "state.state"; /* */ protected static final String FINDNUMBER = "FINDNUMBER"; /* */ protected static final String FINDNUMBEROLD = "FINDNUMBEROLD"; /* */ protected static final String QUANTITY = "QUANTITY"; /* */ protected static final String QUANTITYOLD = "QUANTITYOLD"; /* */ protected static final String NUMBERATTRIBUTE = "displayIdentifier"; /* */ protected static final String UOM = "UOM"; /* */ protected static final String UOMOLD = "UOMOLD"; /* */ private static final int OLD_OBJECT_INDEX = 0; /* */ private static final int NEW_OBJECT_INDEX = 1; /* */ protected Locale locale; /* */ static IconDelegateFactory iconDelegateFactory; /* */ private static final String RESOURCE = "com.ptc.windchill.enterprise.change2.reports.change2ReportsResource"; /* 345 */ private static final Logger logger = LogR.getLoggerInternal(ChangeItemReportHelper.class.getName()); /* */ /* */ protected long incrementor; /* */ /* */ protected String ADDED; /* */ /* */ protected String CHANGED; /* */ /* */ protected String DELETED; /* */ /* */ protected String REPLACED; /* */ /* */ protected static final String DESCRIBES_BY = "DESCRIBES_BY"; /* */ /* */ protected static final String REFERENCE_TO = "REFERENCE_TO"; /* */ /* */ protected static final String PASSIVE = "CONTENT"; /* */ /* */ protected static final String ACTIVE = "OWNER"; /* */ /* */ protected static final String USES = "USES"; /* */ /* */ private static final String REPORT_FILTER_PROPERTY = "com.ptc.windchill.enterprise.change2.reports.ChangeItemSummaryReportFilter"; /* */ /* */ protected ChangeItemReportFilter filter; /* */ /* 371 */ protected static Map attrMap = new HashMap(); /* */ /* */ protected static final String DEADLINE_ATTRIBUTE = "deadline"; /* */ /* */ protected static final String ROLE_ATTRIBUTE = "role"; /* */ /* */ private static final String ADMIN_I = "CHANGE ADMINISTRATOR I"; /* */ /* 379 */ private static HashMap ElementObjMap = new HashMap(); /* */ /* 381 */ private static final String sep = GuiComponentUtil.Delimiter.COMMA_SPACE.stringVal(); /* */ /* 383 */ static PersistenceManager persistenceManager = PersistenceHelper.manager; /* */ /* */ protected static final String VARIANCE_ITEMID = "number"; /* */ /* */ Map changeableLinkMap; /* */ /* 389 */ private static MethodLocal USE_THIRD_PARTY_REPORTING = new MethodLocal(); /* */ /* */ /* */ public static final String REPORTS_PAGE_SIZE_PROPERTY = "wt.change2.reports.pageSize"; /* */ /* */ public static final int REPORTS_PAGE_SIZE_DEFAULT = 5000; /* */ /* */ public static final int REPORTS_PAGE_SIZE_NOLIMIT = -1; /* */ /* 398 */ private static final DefinitionDescriptorFactory DESCRIPTOR_FACTORY = (DefinitionDescriptorFactory)DefaultServiceProvider.getService(DefinitionDescriptorFactory.class, "default"); /* */ /* */ private static final String LINK_REFERENCE_DESIGNATOR_RANGE_ATI_STR = "WCTYPE|wt.part.WTPartUsageLink~SCA|referenceDesignatorRange"; /* */ /* */ public static final String ADDED_NEW_ICON = "netmarkets/images/newpart.gif"; /* */ /* */ public static final String ADDED_EXISTING_ICON = "netmarkets/images/add16x16.gif"; /* */ public static final String CHANGED_ICON = "netmarkets/images/changeupdate9x9.png"; /* */ public static final String DELETE_ICON = "netmarkets/images/remove16x16_chgmgmt_report.png"; /* */ public static final String REPLACED_NEW_ICON = "netmarkets/images/structure_replace_newcreate.gif"; /* */ public static final String REPLACED_EXISTING_ICON = "netmarkets/images/structure_replace_existing.gif"; /* */ /* */ public enum TextFormat /* */ { /* 412 */ PLAIN, /* */ /* 414 */ JASPER, /* */ /* 416 */ COGNOS; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public ChangeItemReportHelper(Locale paramLocale) { /* */ this.incrementor = 0L; /* */ this.changeableLinkMap = new HashMap(); /* 429 */ this.locale = paramLocale; /* 430 */ initializeReportFilter(); /* 431 */ initializeIdentityHelpers(); /* 432 */ this.ADDED = WTMessage.getLocalizedMessage("com.ptc.windchill.enterprise.change2.reports.change2ReportsResource", "ADDED", null, paramLocale); /* 433 */ this.CHANGED = WTMessage.getLocalizedMessage("com.ptc.windchill.enterprise.change2.reports.change2ReportsResource", "CHANGED", null, paramLocale); /* 434 */ this.DELETED = WTMessage.getLocalizedMessage("com.ptc.windchill.enterprise.change2.reports.change2ReportsResource", "DELETED", null, paramLocale); /* 435 */ this.REPLACED = WTMessage.getLocalizedMessage("com.ptc.windchill.enterprise.change2.reports.change2ReportsResource", "REPLACED", null, paramLocale); /* 436 */ this.ON_ORDER_DISPOSITION = WTMessage.getLocalizedMessage("com.ptc.windchill.enterprise.change2.reports.change2ReportsResource", "ONORDERDISPOSITION", null, paramLocale); /* */ /* 438 */ this.INVENTORY_DISPOSITION = WTMessage.getLocalizedMessage("com.ptc.windchill.enterprise.change2.reports.change2ReportsResource", "INVENTORYDISPOSITION", null, paramLocale); /* */ /* 440 */ this.FINISHED_DISPOSITION = WTMessage.getLocalizedMessage("com.ptc.windchill.enterprise.change2.reports.change2ReportsResource", "FINISHEDDISPOSITION", null, paramLocale); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected void initializeReportFilter() { /* */ try { /* 451 */ WTProperties wTProperties = WTProperties.getLocalProperties(); /* 452 */ String str = wTProperties.getProperty("com.ptc.windchill.enterprise.change2.reports.ChangeItemSummaryReportFilter", "com.ptc.windchill.enterprise.change2.reports.DefaultChangeItemReportFilter"); /* */ /* 454 */ Class clazz = Class.forName(str); /* 455 */ this.filter = (ChangeItemReportFilter)clazz.newInstance(); /* 456 */ } catch (Exception exception) { /* 457 */ logger.error("Unable to find ChangeItemReportFilter using the DefaultChangeItemReportFilter", exception); /* 458 */ this.filter = new DefaultChangeItemReportFilter(); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 468 */ protected void initializeIdentityHelpers() { iconDelegateFactory = IconDelegateFactory.getInstance(); } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected WTCollection getResultingObjects(WTChangeOrder2 paramWTChangeOrder2) throws WTException { /* 477 */ createAffectedActivityLinkMap(paramWTChangeOrder2); /* 478 */ WTArrayList wTArrayList = new WTArrayList(ChangeHelper2.service.getChangeablesAfter(paramWTChangeOrder2, false)); /* 479 */ WTCollection wTCollection = HangingChangeHelper.getService().getHangingChanges(paramWTChangeOrder2, /* 480 */ HangingChangeHelper.getDefaultStatus(), new HangingChangeCriteria[] { HangingChangeCriteria.ORIGINAL, HangingChangeCriteria.ALL_CA_REV }); /* */ /* 482 */ for (Object object : wTCollection.persistableCollection()) { /* 483 */ if (object instanceof HangingChangeLink) { /* 484 */ wTArrayList.add((HangingChangeLink)object); /* */ } /* */ } /* 487 */ if (logger.isDebugEnabled()) { /* 488 */ logger.debug("resulting objects found are : " + wTArrayList); /* */ } /* 490 */ return wTArrayList; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ public WTKeyedMap getSupportingDispositions(WTChangeOrder2 paramWTChangeOrder2) throws WTException { /* 499 */ createAffectedActivityLinkMap(paramWTChangeOrder2); /* 500 */ return ChangeHelper2.service.getSupportingDispositionLinks(paramWTChangeOrder2); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private void createAffectedActivityLinkMap(WTChangeOrder2 paramWTChangeOrder2) throws WTException { /* 515 */ ActionDelegateHelper actionDelegateHelper = new ActionDelegateHelper(); /* 516 */ QueryResult queryResult = ChangeHelper2.service.getChangeablesBefore(paramWTChangeOrder2, false); /* 517 */ WTArrayList wTArrayList = new WTArrayList(); /* 518 */ if (queryResult != null) { /* 519 */ wTArrayList = new WTArrayList(queryResult); /* */ } /* 521 */ this.changeableLinkMap = new HashMap(); /* 522 */ for (Object object : wTArrayList.persistableCollection()) { /* 523 */ if (object instanceof AffectedActivityData) { /* 524 */ Changeable2 changeable2 = ((AffectedActivityData)object).getChangeable2(); /* 525 */ changeable2 = (Changeable2)actionDelegateHelper.getLatestIteration(changeable2); /* 526 */ this.changeableLinkMap.put(changeable2, (AffectedActivityData)object); /* */ } /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void processAttachments(Object paramObject, Group paramGroup) throws WTException { /* 539 */ ArrayList arrayList = new ArrayList(); /* 540 */ QueryResult queryResult = AttachmentsHelper.service.getAttachments(paramObject, ContentRoleType.SECONDARY); /* */ /* 542 */ arrayList.addAll(queryResult.getObjectVectorIfc().getVector()); /* */ /* 544 */ HashMap hashMap = new HashMap(); /* 545 */ String str = AttachmentsDataUtilityHelper.getBaseURL(); /* 546 */ for (ContentItem contentItem : arrayList) { /* 547 */ String str1 = AttachmentsDataUtilityHelper.getDisplayName(contentItem); /* 548 */ String str2 = null; /* */ try { /* 550 */ if (contentItem instanceof ApplicationData) { /* 551 */ if (logger.isDebugEnabled()) { /* 552 */ logger.debug("contentItem is ApplicationData"); /* */ } /* */ /* 555 */ ApplicationData applicationData = (ApplicationData)contentItem; /* 556 */ ContentHolder contentHolder = AttachmentsValidationHelper.getOwningContentHolder(contentItem); /* */ /* 558 */ if (AttachmentsValidationHelper.hasPermission(contentHolder, AccessPermission.DOWNLOAD)) { /* 559 */ if (logger.isDebugEnabled()) { /* 560 */ logger.debug("content holder has download permission. Creating Download link"); /* */ } /* 562 */ String str3 = ""; /* 563 */ if (contentItem != null) { /* 564 */ DataFormat dataFormat = null; /* */ /* 566 */ DataFormatReference dataFormatReference = contentItem.getFormat(); /* 567 */ if (dataFormatReference != null) { /* 568 */ dataFormat = dataFormatReference.getDataFormat(); /* */ } /* */ /* 571 */ if (dataFormat != null) { /* 572 */ str3 = DataFormat.getLocalizedFormatName(dataFormat.getFormatName(), this.locale); /* */ } /* */ } /* 575 */ str2 = RedirectDownload.getRedirectURL(applicationData, contentHolder, true); /* */ } /* 577 */ } else if (contentItem instanceof URLData) { /* 578 */ logger.debug("contentItem is URLData"); /* 579 */ URLData uRLData = (URLData)contentItem; /* 580 */ str2 = new String(uRLData.getUrlLocation()); /* 581 */ } else if (contentItem instanceof wt.content.ExternalStoredData) { /* 582 */ logger.debug("contentItem is URLData"); /* 583 */ str2 = new String(); /* */ } /* 585 */ } catch (Exception exception) { /* 586 */ logger.error(exception.getMessage(), exception); /* */ } /* 588 */ hashMap.put("NAME", str1); /* 589 */ hashMap.put("VIEWPAGEURL", str2.toString()); /* 590 */ hashMap.put("ICONURL", getIconURL(contentItem)); /* */ /* 592 */ Element element = constructAttachmentElement(hashMap); /* 593 */ paramGroup.addElement(element); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private Element constructAttachmentElement(HashMap paramHashMap) { /* 605 */ Element element = new Element(); /* */ /* 607 */ element.addAtt(new Att("NAME", (String)paramHashMap.get("NAME"))); /* 608 */ element.addAtt(new Att("VIEWPAGEURL", (String)paramHashMap.get("VIEWPAGEURL"))); /* 609 */ element.addAtt(new Att("ICONURL", (String)paramHashMap.get("ICONURL"))); /* */ /* 611 */ return element; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void processResultingObjects(WTChangeOrder2 paramWTChangeOrder2, Group paramGroup) throws WTException { /* 624 */ WTHashSet wTHashSet = new WTHashSet(ChangeHelper2.service.getChangeablesBefore(paramWTChangeOrder2)); /* 625 */ processResultingObjects(getResultingObjects(paramWTChangeOrder2), wTHashSet, paramGroup); /* */ } /* */ /* */ /* */ protected void processResultingObjects(WTCollection paramWTCollection1, WTCollection paramWTCollection2, Group paramGroup) throws WTException { /* 630 */ boolean bool = false; /* 631 */ for (Object object : paramWTCollection1.persistableCollection()) { /* 632 */ Changeable2 changeable2 = null; /* 633 */ BinaryLink binaryLink = null; /* 634 */ boolean bool1 = false; /* 635 */ if (object instanceof BinaryLink) { /* 636 */ binaryLink = (BinaryLink)object; /* 637 */ changeable2 = (Changeable2)binaryLink.getRoleBObject(); /* 638 */ bool1 = true; /* */ } /* 640 */ else if (object instanceof Changeable2) { /* 641 */ changeable2 = (Changeable2)object; /* 642 */ bool1 = true; /* */ } /* 644 */ if (bool1) { /* 645 */ Changeable2 changeable21 = (Changeable2)getIterationToCompare(changeable2, paramWTCollection2); /* */ /* 647 */ if (changeable21 == null) { /* 648 */ HashMap hashMap = null; /* 649 */ if (binaryLink != null) { /* 650 */ hashMap = createAttributeMapFor(binaryLink); /* */ } else { /* */ /* 653 */ hashMap = createAttributeMapFor(changeable2); /* */ } /* 655 */ Element element = constructElement(hashMap); /* 656 */ paramGroup.addElement(element); /* */ continue; /* */ } /* */ try { /* 660 */ processResultingObjectWithDiffs(changeable2, changeable21, binaryLink, paramGroup); /* 661 */ } catch (Exception exception) { /* 662 */ bool = true; /* 663 */ if (logger.isDebugEnabled()) { /* 664 */ logger.debug(exception.getMessage(), exception); /* 665 */ logger.debug("changeable: " + changeable2); /* 666 */ logger.debug("oldReleased: " + changeable21); /* 667 */ logger.debug("output: " + paramGroup); /* */ } /* 669 */ if (logger.isTraceEnabled()) { /* 670 */ logger.trace("Object comparison error is ", exception); /* */ } /* */ } /* */ } /* */ } /* */ /* 676 */ if (bool) { /* 677 */ logger.error("There was an error attempting to render one of the comparisons."); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public String processRelatedChangeItems(String paramString, Group paramGroup) throws WTException { /* 696 */ String str = "number"; /* 697 */ WTReference wTReference = getReferenceFromOidString(paramString); /* 698 */ if (wTReference != null && ChangeItem.class.isAssignableFrom(wTReference.getReferencedClass())) { /* 699 */ ChangeItem changeItem = (ChangeItem)wTReference.getObject(); /* 700 */ Boolean bool1 = Boolean.valueOf(OrganizationServicesHelper.isOrganizationDisplayEnabled(changeItem.getClass())); /* 701 */ Boolean bool2 = Boolean.valueOf(ChangeHelper2.isTrackingChange((WTContained)changeItem)); /* 702 */ WTCollection wTCollection = getRelatedChangeItems(changeItem); /* */ /* 704 */ if (bool1.booleanValue()) { /* 705 */ boolean bool = true; /* 706 */ for (Object object : wTCollection) { /* 707 */ if (object instanceof ObjectReference) { /* 708 */ if (!(((ObjectReference)object).getObject() instanceof OrganizationOwned)) { /* 709 */ bool = false; /* */ break; /* */ } /* */ continue; /* */ } /* 714 */ if (logger.isDebugEnabled()) { /* 715 */ logger.debug("The object is not of type ObjectReference : " + object.getClass()); /* */ } /* */ } /* */ /* */ /* 720 */ if (bool) { /* 721 */ str = "number,organizationIdentifier"; /* */ } /* */ } /* */ /* 725 */ if (logger.isDebugEnabled()) { /* 726 */ logger.debug("contextRef: " + wTReference); /* 727 */ logger.debug("orgEnabled : " + bool1); /* 728 */ logger.debug("trackingChangeEnabled : " + bool2); /* 729 */ logger.debug("has related changes ? " + (!wTCollection.isEmpty() ? 1 : 0)); /* */ } /* */ /* 732 */ for (Object object : wTCollection.persistableCollection()) { /* 733 */ if (!wt.change2.ChangeItemResource.class.isAssignableFrom(object.getClass())) { /* 734 */ paramGroup.addElement(constructElement((VersionableChangeItem)object, bool1.booleanValue(), bool2 /* 735 */ .booleanValue())); /* */ continue; /* */ } /* 738 */ paramGroup.addElement(constructRemoteChangeItemElement(object)); /* */ } /* */ /* */ /* 742 */ processChangeSummaryAttributes(paramGroup, true, this.locale, true); /* */ } /* */ /* 745 */ if (logger.isDebugEnabled()) { /* 746 */ logger.debug("return sort order : " + str); /* */ } /* 748 */ return str; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private WTCollection getRelatedChangeItems(ChangeItem paramChangeItem) throws WTException { /* 765 */ WTHashSet wTHashSet = new WTHashSet(); /* 766 */ if (!FlexibleChangeHelper.isFlexibleMode() && !FlexibleChangeHelper.isFlexible(paramChangeItem)) { /* 767 */ logger.debug("finding legacy associations"); /* 768 */ if (paramChangeItem instanceof ChangeIssue) { /* 769 */ wTHashSet.addAll(ChangeHelper2.service.getLatestChangeRequest((ChangeIssue)paramChangeItem)); /* 770 */ wTHashSet.addAll(ChangeHelper2.service.getLatestChangeOrder((ChangeIssue)paramChangeItem)); /* */ } /* 772 */ else if (paramChangeItem instanceof ChangeRequest2) { /* 773 */ wTHashSet.addAll(ChangeHelper2.service.getLatestChangeIssue((ChangeRequest2)paramChangeItem)); /* 774 */ wTHashSet.addAll(ChangeHelper2.service.getLatestChangeOrder((ChangeRequest2)paramChangeItem)); /* */ } /* 776 */ else if (paramChangeItem instanceof ChangeOrder2) { /* 777 */ wTHashSet.addAll(ChangeHelper2.service.getLatestChangeRequest((ChangeOrder2)paramChangeItem)); /* */ } /* */ } /* */ /* 781 */ if (paramChangeItem instanceof FlexibleChangeItem) { /* 782 */ logger.debug("finding flexible associations"); /* 783 */ wTHashSet.addAll(FlexibleChangeHelper.getService().getFlexibleChangeItems((FlexibleChangeItem)paramChangeItem, "ALL", /* */ /* 785 */ Boolean.valueOf(true), null)); /* */ } /* */ /* 788 */ return wTHashSet; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ HashMap createAttributeMapFor(BinaryLink paramBinaryLink) throws WTException { /* 799 */ HashMap hashMap = createAttributeMapFor(paramBinaryLink.getRoleBObject()); /* 800 */ if (paramBinaryLink instanceof ChangeRecord2) { /* 801 */ hashMap.put("TARGETTRANSITION", getTargetTransition((ChangeRecord2)paramBinaryLink)); /* */ } /* */ /* 804 */ return hashMap; /* */ } /* */ /* */ private HashMap createAttributeMapFor(Persistable paramPersistable) throws WTException { /* 808 */ HashMap hashMap = new HashMap(); /* 809 */ if (paramPersistable instanceof Changeable2) { /* 810 */ hashMap.put("OBJECTUID", getObjectUID(paramPersistable)); /* 811 */ hashMap.put("NAME", getName(paramPersistable)); /* 812 */ hashMap.put("NUMBER", getNumber(paramPersistable)); /* 813 */ hashMap.put("ORGID", getOrgID(paramPersistable)); /* 814 */ hashMap.put("NEWVERSION", getVersion(paramPersistable)); /* 815 */ hashMap.put("TYPE", getTypeName(paramPersistable)); /* 816 */ hashMap.put("ICONURL", getIconURL(paramPersistable)); /* 817 */ hashMap.put("VIEWPAGEURL", getViewPageURL(paramPersistable)); /* */ } /* 819 */ return hashMap; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private String getTargetTransition(ChangeRecord2 paramChangeRecord2) throws WTException { /* 829 */ if (paramChangeRecord2.getTargetTransition() != null) { /* 830 */ return paramChangeRecord2.getTargetTransition().getDisplay(SessionHelper.getLocale()); /* */ } /* 832 */ return ""; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 844 */ QueryResult getAllVersionsFrom(Object paramObject) throws WTException, PersistenceException { return VersionControlHelper.service.allVersionsFrom((Versioned)paramObject); } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public static WTReference getReferenceFromOidString(String paramString) { /* 854 */ ReferenceFactory referenceFactory = new ReferenceFactory(); /* 855 */ WTReference wTReference = null; /* */ try { /* 857 */ wTReference = referenceFactory.getReference(paramString); /* 858 */ } catch (WTException wTException) { /* 859 */ logger.error("Unable to get reference from oidString.", wTException); /* */ } /* 861 */ return wTReference; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void processResultingObjectsForDispositions(WTKeyedMap paramWTKeyedMap, Group paramGroup) throws WTException { /* 875 */ for (Object object : paramWTKeyedMap.keySet()) { /* 876 */ if (object instanceof ObjectReference) { /* 877 */ object = ((ObjectReference)object).getObject(); /* */ } /* 879 */ if (object instanceof Changeable2) { /* 880 */ Changeable2 changeable2 = (Changeable2)object; /* 881 */ AffectedActivityData affectedActivityData = (AffectedActivityData)paramWTKeyedMap.get(changeable2); /* 882 */ if (affectedActivityData != null) { /* */ /* */ /* 885 */ String str = (affectedActivityData.getOnOrderDisposition() != null) ? affectedActivityData.getOnOrderDisposition().getDisplay(this.locale) : null; /* 886 */ Element element = constructElementForDisposition(changeable2, this.ON_ORDER_DISPOSITION, str, affectedActivityData /* 887 */ .getDispositionComments()); /* 888 */ paramGroup.addElement(element); /* */ /* */ /* 891 */ str = (affectedActivityData.getInventoryDisposition() != null) ? affectedActivityData.getInventoryDisposition().getDisplay(this.locale) : null; /* 892 */ element = constructElementForDisposition(changeable2, this.INVENTORY_DISPOSITION, str, affectedActivityData /* 893 */ .getDispositionComments()); /* 894 */ paramGroup.addElement(element); /* */ /* */ /* 897 */ str = (affectedActivityData.getInventoryDisposition() != null) ? affectedActivityData.getFinishedDisposition().getDisplay(this.locale) : null; /* 898 */ element = constructElementForDisposition(changeable2, this.FINISHED_DISPOSITION, str, affectedActivityData /* 899 */ .getDispositionComments()); /* 900 */ paramGroup.addElement(element); /* */ } /* */ } /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ void processResultingObjectWithDiffs(Changeable2 paramChangeable21, Changeable2 paramChangeable22, BinaryLink paramBinaryLink, Group paramGroup) throws WTException { /* 917 */ if (paramChangeable21 == null) { /* 918 */ logger.error("Changeable was null."); /* */ /* */ return; /* */ } /* 922 */ if (logger.isDebugEnabled()) { /* 923 */ logger.debug("Changeable is " + paramChangeable21); /* */ } /* */ /* 926 */ ComparisonResult comparisonResult = getDiff(paramChangeable22, paramChangeable21); /* */ /* 928 */ HashMap hashMap = null; /* 929 */ if (paramBinaryLink == null) { /* 930 */ hashMap = createAttributeMapFor(paramChangeable21); /* */ } else { /* */ /* 933 */ hashMap = createAttributeMapFor(paramBinaryLink); /* */ } /* 935 */ hashMap.put("OLDVERSION", getVersion(paramChangeable22)); /* 936 */ Map map = getAttributeDifferences(comparisonResult); /* */ /* 938 */ if (map != null) { /* 939 */ HashMap hashMap1 = new HashMap(); /* 940 */ hashMap1.putAll(hashMap); /* 941 */ Set set = map.entrySet(); /* */ /* 943 */ List list = null; /* 944 */ String str1 = ""; /* 945 */ String str2 = ""; /* 946 */ String str3 = ""; /* 947 */ for (Map.Entry entry : set) { /* 948 */ str1 = ""; /* 949 */ str2 = ""; /* 950 */ str3 = ""; /* */ /* 952 */ if (logger.isDebugEnabled()) { /* 953 */ logger.debug("key object is " + entry.getKey()); /* 954 */ logger.debug("value object is " + entry.getValue()); /* */ } /* */ /* 957 */ if (entry.getKey() != null && entry.getValue() != null && entry.getValue() instanceof List) { /* 958 */ str1 = entry.getKey().toString(); /* */ /* 960 */ list = (List)entry.getValue(); /* 961 */ if (list.get(true) != null) { /* 962 */ str2 = list.get(1).toString(); /* */ } /* 964 */ if (list.get(false) != null) { /* 965 */ str3 = list.get(0).toString(); /* */ } /* */ } /* */ /* 969 */ if (logger.isDebugEnabled()) { /* 970 */ logger.debug("key is " + str1); /* 971 */ logger.debug("new value is " + str2); /* 972 */ logger.debug("old value is " + str3); /* */ } /* */ /* 975 */ hashMap1.put("ATTRNAME", str1); /* 976 */ hashMap1.put("NEWVALUE", str2); /* 977 */ hashMap1.put("OLDVALUE", str3); /* */ /* 979 */ Element element = constructElement(hashMap1); /* 980 */ paramGroup.addElement(element); /* */ } /* */ } else { /* */ /* 984 */ Element element = constructElement(hashMap); /* 985 */ paramGroup.addElement(element); /* */ } /* */ /* 988 */ if (paramChangeable21 instanceof WTPart) { /* 989 */ getLinkDifferences(paramChangeable21, paramChangeable22, paramGroup, comparisonResult, hashMap); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private void getLinkDifferences(Changeable2 paramChangeable21, Changeable2 paramChangeable22, Group paramGroup, ComparisonResult paramComparisonResult, HashMap paramHashMap) throws WTException { /* 1007 */ processLinks(paramChangeable21, paramChangeable22, paramComparisonResult, WTPartUsageLink.class, paramHashMap, paramGroup); /* 1008 */ processLinks(paramChangeable21, paramChangeable22, paramComparisonResult, wt.doc.WTDocumentUsageLink.class, paramHashMap, paramGroup); /* 1009 */ processLinks(paramChangeable21, paramChangeable22, paramComparisonResult, EPMMemberLink.class, paramHashMap, paramGroup); /* 1010 */ processLinks(paramChangeable21, paramChangeable22, paramComparisonResult, wt.change2.workset.WTWorkSetComponentLink.class, paramHashMap, paramGroup); /* 1011 */ processLinks(paramChangeable21, paramChangeable22, paramComparisonResult, wt.part.WTPartDescribeLink.class, paramHashMap, paramGroup); /* 1012 */ processLinks(paramChangeable21, paramChangeable22, paramComparisonResult, wt.part.WTPartReferenceLink.class, paramHashMap, paramGroup); /* 1013 */ processLinks(paramChangeable21, paramChangeable22, paramComparisonResult, wt.epm.structure.EPMDescribeLink.class, paramHashMap, paramGroup); /* 1014 */ processLinks(paramChangeable21, paramChangeable22, paramComparisonResult, wt.epm.build.EPMBuildHistory.class, paramHashMap, paramGroup); /* 1015 */ processLinks(paramChangeable21, paramChangeable22, paramComparisonResult, wt.epm.build.EPMBuildRule.class, paramHashMap, paramGroup); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected List getLinks(ComparisonResult paramComparisonResult, String paramString) { /* 1028 */ if (paramComparisonResult == null) { /* 1029 */ return null; /* */ } /* 1031 */ Map map = paramComparisonResult.getLinkDiffsMap(); /* 1032 */ if (map != null) { /* 1033 */ return (List)map.get(paramString); /* */ } /* */ /* 1036 */ return null; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected void processLinks(Changeable2 paramChangeable21, Changeable2 paramChangeable22, ComparisonResult paramComparisonResult, Class paramClass, HashMap paramHashMap, Group paramGroup) throws WTException { /* 1051 */ List list = getLinks(paramComparisonResult, paramClass.getName()); /* 1052 */ if (list != null) { /* 1053 */ ArrayList arrayList1 = new ArrayList(); /* 1054 */ ArrayList arrayList2 = new ArrayList(); /* */ /* 1056 */ for (LinkDiffs linkDiffs : list) { /* 1057 */ if (linkDiffs == null) { /* */ continue; /* */ } /* 1060 */ List list1 = linkDiffs.getLinkRefs(); /* 1061 */ BinaryLink binaryLink1 = getBinaryLink(list1, 0); /* 1062 */ BinaryLink binaryLink2 = getBinaryLink(list1, 1); /* 1063 */ String str1 = ""; /* */ /* 1065 */ addAssociationType((binaryLink2 == null) ? binaryLink1 : binaryLink2, paramHashMap); /* */ /* 1067 */ String str2 = AttachmentsDataUtilityHelper.getBaseURL(); /* 1068 */ String str3 = null; /* 1069 */ if (binaryLink2 != null) { /* 1070 */ addLinkSpecificAttributes(binaryLink2.getOtherObject(paramChangeable21), false, paramHashMap); /* 1071 */ if (IteratedUsageLink.class.isAssignableFrom(paramClass)) { /* 1072 */ addUsageLinkSpecificAttributes((IteratedUsageLink)binaryLink2, false, paramHashMap); /* */ } /* */ /* 1075 */ if (binaryLink1 != null) { /* */ /* 1077 */ str1 = this.CHANGED; /* 1078 */ str3 = str2 + "/netmarkets/images/changeupdate9x9.png"; /* 1079 */ addLinkSpecificAttributes(binaryLink1.getOtherObject(paramChangeable22), true, paramHashMap); /* 1080 */ if (IteratedUsageLink.class.isAssignableFrom(paramClass)) { /* 1081 */ addUsageLinkSpecificAttributes((IteratedUsageLink)binaryLink1, true, paramHashMap); /* */ } /* */ } else { /* */ /* 1085 */ str1 = this.ADDED; /* 1086 */ if (binaryLink2 instanceof WTPartUsageLink) { /* 1087 */ str3 = isNewPart((WTPartUsageLink)binaryLink2) ? (str2 + "/netmarkets/images/newpart.gif") : (str2 + "/netmarkets/images/add16x16.gif"); /* */ } else { /* 1089 */ str3 = str2 + "/netmarkets/images/newpart.gif"; /* */ } /* 1091 */ clearOldLinkSpecificAttributes(paramHashMap); /* */ } /* */ /* 1094 */ } else if (binaryLink1 != null) { /* */ /* */ /* */ /* 1098 */ str1 = this.DELETED; /* 1099 */ str3 = str2 + "/netmarkets/images/remove16x16_chgmgmt_report.png"; /* 1100 */ addLinkSpecificAttributes(binaryLink1.getOtherObject(paramChangeable22), false, paramHashMap); /* 1101 */ clearOldLinkSpecificAttributes(paramHashMap); /* 1102 */ if (IteratedUsageLink.class.isAssignableFrom(paramClass)) { /* 1103 */ addUsageLinkSpecificAttributes((IteratedUsageLink)binaryLink1, false, paramHashMap); /* */ } /* */ } /* */ /* 1107 */ paramHashMap.put("STRUCTDIFF", str1); /* 1108 */ paramHashMap.put("STRUCTDIFFICON", str3); /* */ /* 1110 */ Element element = constructElement(paramHashMap); /* */ /* 1112 */ if (this.CHANGED.equals(str1)) { /* 1113 */ paramGroup.addElement(element); /* */ continue; /* */ } /* 1116 */ if (this.ADDED.equals(str1)) { /* 1117 */ arrayList2.add(element); continue; /* */ } /* 1119 */ if (this.DELETED.equals(str1)) { /* 1120 */ arrayList1.add(element); /* */ } /* */ } /* 1123 */ processAdditionsAndRemovals(arrayList2, arrayList1, paramGroup); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private boolean isNewPart(WTPartUsageLink paramWTPartUsageLink) throws PersistenceException, WTException { /* 1138 */ if (logger.isDebugEnabled()) { /* 1139 */ logger.debug("In ObjectCompareOperation::partStatus to decide klink type for link = " + paramWTPartUsageLink); /* */ } /* 1141 */ WTPartMaster wTPartMaster = (WTPartMaster)paramWTPartUsageLink.getRoleBObjectRef().getObject(); /* */ /* 1143 */ boolean bool = true; /* 1144 */ QueryResult queryResult = VersionControlHelper.service.allVersionsOf(wTPartMaster); /* 1145 */ if (queryResult.hasMoreElements()) { /* 1146 */ WTPart wTPart = (WTPart)queryResult.nextElement(); /* */ /* 1148 */ bool = ChangeIntentHelper.isNewObject(wTPart); /* */ } /* */ /* 1151 */ if (logger.isDebugEnabled()) { /* 1152 */ logger.debug("In ObjectCompareOperation::partStatus. Part to be considered as New : " + bool); /* */ } /* */ /* 1155 */ return bool; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private BinaryLink getBinaryLink(List paramList, int paramInt) { /* 1167 */ if (paramList == null || paramInt < 0 || paramInt >= paramList.size()) { /* 1168 */ return null; /* */ } /* 1170 */ BinaryLink binaryLink = (BinaryLink)((paramList.get(paramInt) != null) ? ((WTReference)paramList.get(paramInt)).getObject() : null); /* */ /* */ /* */ /* 1174 */ if (binaryLink instanceof Proxy) { /* */ /* 1176 */ InvocationHandler invocationHandler = Proxy.getInvocationHandler(binaryLink); /* 1177 */ if (invocationHandler instanceof RelatedOwnerCadDocumentComparator.AbstractBinaryLinkProxy) { /* 1178 */ binaryLink = ((RelatedOwnerCadDocumentComparator.AbstractBinaryLinkProxy)invocationHandler).getBinaryLink(); /* */ } /* */ } /* 1181 */ return binaryLink; /* */ } /* */ /* */ /* */ private void addLinkSpecificAttributes(Persistable paramPersistable, boolean paramBoolean, HashMap paramHashMap) throws WTException { /* 1186 */ if (paramBoolean) { /* 1187 */ paramHashMap.put("COMPORGIDOLD", getOrgID(paramPersistable)); /* 1188 */ paramHashMap.put("COMPNUMBEROLD", getNumber(paramPersistable)); /* 1189 */ paramHashMap.put("COMPNAMEOLD", getName(paramPersistable)); /* 1190 */ paramHashMap.put("COMPVERSIONOLD", getVersion(paramPersistable)); /* */ } else { /* */ /* 1193 */ paramHashMap.put("COMPORGID", getOrgID(paramPersistable)); /* 1194 */ paramHashMap.put("COMPNUMBER", getNumber(paramPersistable)); /* 1195 */ paramHashMap.put("COMPNAME", getName(paramPersistable)); /* 1196 */ paramHashMap.put("COMPVERSION", getVersion(paramPersistable)); /* */ } /* */ } /* */ /* */ private void clearOldLinkSpecificAttributes(Map paramMap) throws WTException { /* 1201 */ paramMap.put("COMPORGIDOLD", ""); /* 1202 */ paramMap.put("COMPNUMBEROLD", ""); /* 1203 */ paramMap.put("COMPNAMEOLD", ""); /* 1204 */ paramMap.put("COMPVERSIONOLD", ""); /* */ /* 1206 */ clearIfContains(paramMap, "FINDNUMBEROLD"); /* 1207 */ clearIfContains(paramMap, "QUANTITYOLD"); /* 1208 */ clearIfContains(paramMap, "UOMOLD"); /* 1209 */ clearIfContains(paramMap, "REFERENCEDESIGNATOROLD"); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private void clearIfContains(Map paramMap, String paramString) { /* 1219 */ if (paramMap.containsKey(paramString)) { /* 1220 */ paramMap.put(paramString, ""); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected void addUsageLinkSpecificAttributes(IteratedUsageLink paramIteratedUsageLink, boolean paramBoolean, HashMap paramHashMap) { /* 1236 */ String str1 = getFindNumber(paramIteratedUsageLink); /* 1237 */ String str2 = getQuantityAmount(paramIteratedUsageLink); /* 1238 */ String str3 = getQuantityUnit(paramIteratedUsageLink); /* 1239 */ String str4 = null; /* */ try { /* 1241 */ str4 = getReferenceDesignator(paramIteratedUsageLink); /* 1242 */ } catch (IllegalFormatException illegalFormatException) { /* 1243 */ illegalFormatException.printStackTrace(); /* 1244 */ } catch (WTException wTException) { /* 1245 */ wTException.printStackTrace(); /* */ } /* */ /* 1248 */ String str5 = getComponentId(paramIteratedUsageLink); /* */ /* 1250 */ if (paramIteratedUsageLink instanceof WTPartUsageLink) { /* 1251 */ if (paramBoolean) { /* 1252 */ paramHashMap.put("FINDNUMBEROLD", str1); /* 1253 */ paramHashMap.put("REFERENCEDESIGNATOROLD", str4); /* 1254 */ paramHashMap.put("COMPONENTIDOLD", str5); /* */ } else { /* */ /* 1257 */ paramHashMap.put("FINDNUMBER", str1); /* 1258 */ paramHashMap.put("REFERENCEDESIGNATOR", str4); /* 1259 */ paramHashMap.put("COMPONENTID", str5); /* */ } /* */ } /* */ /* 1263 */ if (paramBoolean) { /* 1264 */ paramHashMap.put("QUANTITYOLD", str2); /* 1265 */ paramHashMap.put("UOMOLD", str3); /* */ } else { /* */ /* 1268 */ paramHashMap.put("QUANTITY", str2); /* 1269 */ paramHashMap.put("UOM", str3); /* */ } /* */ } /* */ /* */ private String getComponentId(IteratedUsageLink paramIteratedUsageLink) { /* 1274 */ return (paramIteratedUsageLink instanceof WTPartUsageLink) ? ( /* 1275 */ (WTPartUsageLink)paramIteratedUsageLink).getComponentId() : /* 1276 */ null; /* */ } /* */ /* */ private String getReferenceDesignator(IteratedUsageLink paramIteratedUsageLink) { /* 1280 */ return (paramIteratedUsageLink instanceof WTPartUsageLink) ? /* 1281 */ getSoftAttributeValue(paramIteratedUsageLink, "WCTYPE|wt.part.WTPartUsageLink~SCA|referenceDesignatorRange") : /* 1282 */ null; /* */ } /* */ /* */ private static String getSoftAttributeValue(Persistable paramPersistable, String paramString) throws WTException { /* 1286 */ IdentifierFactory identifierFactory = (IdentifierFactory)DefaultServiceProvider.getService(IdentifierFactory.class, "logical"); /* 1287 */ TypeInstanceIdentifier typeInstanceIdentifier = TypeIdentifierUtility.getTypeInstanceIdentifier(paramPersistable); /* 1288 */ AttributeTypeIdentifier[] arrayOfAttributeTypeIdentifier = new AttributeTypeIdentifier[1]; /* 1289 */ arrayOfAttributeTypeIdentifier[0] = (AttributeTypeIdentifier)identifierFactory.get(paramString, typeInstanceIdentifier.getDefinitionIdentifier()); /* 1290 */ TypeInstance typeInstance = CommandHelper.prepare(typeInstanceIdentifier, arrayOfAttributeTypeIdentifier, OperationIdentifier.newOperationIdentifier("STDOP|com.ptc.windchill.view"), /* 1291 */ SessionHelper.getLocale(), false, false); /* 1292 */ Object object = ""; /* 1293 */ AttributeIdentifier[] arrayOfAttributeIdentifier = typeInstance.getAttributeIdentifiers(); /* 1294 */ if (arrayOfAttributeIdentifier.length > 0) { /* 1295 */ if (logger.isDebugEnabled()) { /* 1296 */ logger.debug("Found attribute for " + paramString); /* */ } /* 1298 */ State state = typeInstance.getState(arrayOfAttributeIdentifier[0]); /* 1299 */ if (logger.isDebugEnabled()) { /* 1300 */ logger.debug("Attribute state is: " + state); /* */ } /* 1302 */ if (!State.DEFAULT.equals(state)) { /* 1303 */ object = typeInstance.get(arrayOfAttributeTypeIdentifier[0]); /* */ } /* */ } /* 1306 */ if (logger.isDebugEnabled()) { /* 1307 */ logger.debug("Attribute value is: " + paramString); /* */ } /* 1309 */ return (object instanceof String) ? (String)object : ""; /* */ } /* */ /* */ /* 1313 */ private String getFindNumber(IteratedUsageLink paramIteratedUsageLink) { return (paramIteratedUsageLink instanceof WTPartUsageLink) ? ((WTPartUsageLink)paramIteratedUsageLink).getFindNumber() : null; } /* */ /* */ /* */ private Quantity getQuantity(IteratedUsageLink paramIteratedUsageLink) { /* 1317 */ if (paramIteratedUsageLink instanceof WTPartUsageLink) { /* 1318 */ return ((WTPartUsageLink)paramIteratedUsageLink).getQuantity(); /* */ } /* 1320 */ if (paramIteratedUsageLink instanceof EPMMemberLink) { /* 1321 */ return ((EPMMemberLink)paramIteratedUsageLink).getQuantity(); /* */ } /* 1323 */ return null; /* */ } /* */ /* */ private String getQuantityAmount(IteratedUsageLink paramIteratedUsageLink) { /* 1327 */ Quantity quantity = getQuantity(paramIteratedUsageLink); /* 1328 */ String str = (quantity != null) ? Double.toString(quantity.getAmount()) : ""; /* 1329 */ QuantityUnit quantityUnit = (quantity != null) ? quantity.getUnit() : null; /* 1330 */ if (QuantityUnit.EA.equals(quantityUnit)) { /* 1331 */ str = str.substring(0, str.indexOf('.')); /* */ } /* 1333 */ return str; /* */ } /* */ /* */ private String getQuantityUnit(IteratedUsageLink paramIteratedUsageLink) { /* 1337 */ Quantity quantity = getQuantity(paramIteratedUsageLink); /* 1338 */ return (quantity != null) ? quantity.getUnit().getDisplay(this.locale) : ""; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected void processAdditionsAndRemovals(ArrayList paramArrayList1, ArrayList paramArrayList2, Group paramGroup) throws WTException { /* 1351 */ for (Element element1 : paramArrayList2) { /* 1352 */ String str = (String)element1.getAtt("COMPONENTID").getRawValue(); /* */ /* 1354 */ if (str == null || "".equals(str)) { /* 1355 */ paramGroup.addElement(element1); /* */ /* */ continue; /* */ } /* 1359 */ Element element2 = null; /* */ /* 1361 */ for (Element element : paramArrayList1) { /* 1362 */ String str1 = (String)element.getAtt("COMPONENTID").getRawValue(); /* */ /* 1364 */ if (str1 == null || "".equals(str1)) { /* */ continue; /* */ } /* */ /* 1368 */ if (str1.equals(str)) { /* 1369 */ element2 = element; /* */ /* */ break; /* */ } /* */ } /* 1374 */ if (element2 != null) { /* 1375 */ paramArrayList1.remove(element2); /* 1376 */ Element element = convertToReplace(element1, element2); /* 1377 */ paramGroup.addElement(element); /* */ continue; /* */ } /* 1380 */ paramGroup.addElement(element1); /* */ } /* */ /* */ /* 1384 */ for (Element element : paramArrayList1) { /* 1385 */ paramGroup.addElement(element); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected ComparisonResult getDiff(Iterated paramIterated1, Iterated paramIterated2) throws WTException { /* 1396 */ WTArrayList wTArrayList = new WTArrayList(2); /* */ /* */ /* */ /* 1400 */ wTArrayList.add(paramIterated1); /* 1401 */ wTArrayList.add(paramIterated2); /* 1402 */ AdvancedComparisonSpec advancedComparisonSpec = ComparisonSpec.newAdvancedInstance(wTArrayList); /* */ /* 1404 */ advancedComparisonSpec.setSelectedAttrs(this.filter.getAttributesToCompare(paramIterated2)); /* */ /* 1406 */ if (logger.isDebugEnabled()) { /* 1407 */ logger.debug("the compare spec is : " + advancedComparisonSpec); /* */ } /* */ /* 1410 */ XmlConfigResourceHandler xmlConfigResourceHandler = new XmlConfigResourceHandler(); /* 1411 */ advancedComparisonSpec.setSelectedLinks(xmlConfigResourceHandler.getConfiguredLinksForDomainType(wTArrayList.getReference(0))); /* */ /* 1413 */ return ObjComparisonHelper.service.compareDomainObjs(advancedComparisonSpec); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected Iterated getIterationToCompare(Iterated paramIterated, WTCollection paramWTCollection) throws WTException { /* 1426 */ if (paramIterated instanceof Versioned) { /* 1427 */ Versioned versioned = (Versioned)paramIterated; /* 1428 */ String str = null; /* 1429 */ if (versioned.getVersionIdentifier() != null) { /* 1430 */ str = versioned.getVersionIdentifier().getValue(); /* */ } /* 1432 */ Iterated iterated = null; /* 1433 */ QueryResult queryResult = VersionControlHelper.service.allIterationsFrom(paramIterated); /* */ /* 1435 */ while (queryResult.hasMoreElements()) { /* 1436 */ Iterated iterated1 = (Iterated)queryResult.nextElement(); /* */ /* 1438 */ if (!paramIterated.equals(iterated1)) { /* */ /* 1440 */ if (paramWTCollection.contains(iterated1)) { /* 1441 */ if (logger.isDebugEnabled()) { /* 1442 */ logger.debug("Using the following iteration form the affected objects " + iterated1); /* */ } /* 1444 */ return iterated1; /* */ } /* 1446 */ if (iterated == null && str != null && ((Versioned)iterated1) /* */ /* 1448 */ .getVersionIdentifier().getValue() != null && /* 1449 */ !str.equals(((Versioned)iterated1).getVersionIdentifier().getValue())) { /* 1450 */ iterated = iterated1; /* */ } /* */ } /* */ } /* 1454 */ if (logger.isDebugEnabled()) { /* 1455 */ logger.debug("Unable to find an iteration in the affected objects, using iteration " + iterated); /* */ } /* */ /* 1458 */ return iterated; /* */ } /* */ /* 1461 */ return null; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected Map> getAttributeDifferences(ComparisonResult paramComparisonResult) { /* 1474 */ if (paramComparisonResult == null || paramComparisonResult.getAttrDiffs() == null) { /* 1475 */ return null; /* */ } /* */ /* 1478 */ return paramComparisonResult.getAttrDiffs().getDiffs(); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 1487 */ protected String getTypeName(Object paramObject) throws WTException { return IdentityFactory.getDisplayType(paramObject).getLocalizedMessage(this.locale); } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected static String getIconURL(Persistable paramPersistable) throws WTException { /* */ try { /* 1497 */ if (iconDelegateFactory == null) /* 1498 */ iconDelegateFactory = IconDelegateFactory.getInstance(); /* 1499 */ IconDelegate iconDelegate = iconDelegateFactory.getIconDelegate((WTObject)paramPersistable); /* 1500 */ return IconCache.getIconResource(iconDelegate, Boolean.valueOf(true)); /* 1501 */ } catch (Exception exception) { /* 1502 */ if (exception instanceof WTException) { /* 1503 */ throw (WTException)exception; /* */ } /* */ /* 1506 */ throw new WTException(exception); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected String getName(Object paramObject) throws WTException { /* 1520 */ if (logger.isDebugEnabled()) { /* 1521 */ logger.debug("Attempting to getName for " + paramObject); /* */ } /* 1523 */ String str = ""; /* */ try { /* 1525 */ str = (String)paramObject.getClass().getMethod("getName", new Class[0]).invoke(paramObject, new Object[0]); /* 1526 */ } catch (Exception exception) { /* 1527 */ logger.debug("Unable to get name from object, attempt to get the display identifier", exception); /* 1528 */ str = IdentityFactory.getDisplayIdentifier(paramObject).getLocalizedMessage(this.locale); /* */ } /* */ /* 1531 */ if ((str == null || str.isEmpty()) && paramObject instanceof wt.part.WTProductInstance2) { /* 1532 */ str = getNumber(paramObject); /* */ } /* 1534 */ return str; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected String getNumber(Object paramObject) throws WTException { /* 1545 */ if (logger.isDebugEnabled()) { /* 1546 */ logger.debug("Attempting to getName for " + paramObject); /* */ } /* */ try { /* 1549 */ return (String)paramObject.getClass().getMethod("getNumber", new Class[0]).invoke(paramObject, new Object[0]); /* */ } /* 1551 */ catch (Exception exception) { /* 1552 */ logger.debug("Unable to get number from object, attempt to get the display identifier", exception); /* 1553 */ return IdentityFactory.getDisplayIdentifier(paramObject).getLocalizedMessage(this.locale); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected String getObjectUID(Object paramObject) throws WTException { /* 1566 */ if (logger.isDebugEnabled()) { /* 1567 */ logger.debug("Attempting to getObjectUID for " + paramObject); /* */ } /* */ try { /* 1570 */ return (String)paramObject.getClass().getMethod("getNumber", new Class[0]).invoke(paramObject, new Object[0]) + ", " + (String)paramObject.getClass().getMethod("getNumber", new Class[0]).invoke(paramObject, new Object[0]) + ", " + (String)paramObject /* 1571 */ .getClass().getMethod("getOrganizationUniqueIdentifier", new Class[0]).invoke(paramObject, new Object[0]); /* */ /* */ /* */ } /* 1575 */ catch (Exception exception) { /* 1576 */ return IdentityFactory.getDisplayIdentifier(paramObject).getLocalizedMessage(this.locale); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected String getOrgID(Object paramObject) throws WTException { /* 1590 */ if (OrganizationServicesHelper.isOrganizationDisplayEnabled(paramObject.getClass())) { /* 1591 */ WTOrganization wTOrganization = null; /* */ /* 1593 */ if (paramObject instanceof WTOrganization) { /* 1594 */ wTOrganization = (WTOrganization)paramObject; /* */ } /* 1596 */ else if (paramObject instanceof OrganizationOwned) { /* 1597 */ bool = SessionServerHelper.manager.setAccessEnforced(false); /* */ try { /* 1599 */ wTOrganization = ((OrganizationOwned)paramObject).getOrganization(); /* */ } finally { /* 1601 */ SessionServerHelper.manager.setAccessEnforced(bool); /* */ } /* */ } /* */ /* 1605 */ if (wTOrganization != null && AccessControlHelper.manager.hasAccess(wTOrganization, AccessPermission.READ)) { /* */ /* 1607 */ if (wTOrganization.getOrganizationIdentifier() != null) { /* 1608 */ return wTOrganization.getOrganizationIdentifier().getUniqueIdentifier(); /* */ } /* */ /* */ /* 1612 */ return wTOrganization.getName(); /* */ } /* */ } /* */ /* */ /* */ /* */ /* 1619 */ return ""; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected String getVersion(Object paramObject) throws WTException { /* 1630 */ if (!(paramObject instanceof Versioned)) { /* 1631 */ return ""; /* */ } /* */ try { /* 1634 */ LocalizableMessage localizableMessage = VersionControlHelper.getIterationDisplayIdentifier((Versioned)paramObject); /* 1635 */ String str = localizableMessage.getLocalizedMessage(this.locale); /* */ /* 1637 */ if (paramObject instanceof ViewManageable) { /* 1638 */ String str1 = ((ViewManageable)paramObject).getViewName(); /* */ /* 1640 */ if (str1 != null) { /* 1641 */ str = str + " (" + str + ")"; /* */ } /* */ } /* */ /* 1645 */ return str; /* 1646 */ } catch (Exception exception) { /* 1647 */ logger.error("Unable to get version for object.", exception); /* 1648 */ return paramObject.toString(); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected String getAtt(Element paramElement, String paramString) { /* 1658 */ Att att = paramElement.getAtt(paramString); /* */ /* 1660 */ if (att == null) { /* 1661 */ return null; /* */ } /* */ /* 1664 */ return (String)att.getRawValue(); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected Element convertToReplace(Element paramElement1, Element paramElement2) throws WTException { /* 1676 */ HashMap hashMap = new HashMap(); /* 1677 */ hashMap.put("NAME", getAtt(paramElement2, "NAME")); /* 1678 */ hashMap.put("NUMBER", getAtt(paramElement2, "NUMBER")); /* 1679 */ hashMap.put("ORGID", getAtt(paramElement2, "ORGID")); /* 1680 */ hashMap.put("NEWVERSION", getAtt(paramElement2, "NEWVERSION")); /* 1681 */ hashMap.put("OLDVERSION", getAtt(paramElement2, "OLDVERSION")); /* 1682 */ hashMap.put("ATTRNAME", getAtt(paramElement2, "ATTRNAME")); /* 1683 */ hashMap.put("NEWVALUE", getAtt(paramElement2, "NEWVALUE")); /* 1684 */ hashMap.put("OLDVALUE", getAtt(paramElement2, "OLDVALUE")); /* */ /* 1686 */ hashMap.put("COMPTYPE", getAtt(paramElement2, "COMPTYPE")); /* 1687 */ hashMap.put("LINKTYPE", getAtt(paramElement2, "LINKTYPE")); /* */ /* 1689 */ hashMap.put("STRUCTDIFF", this.REPLACED); /* 1690 */ String str = AttachmentsDataUtilityHelper.getBaseURL(); /* 1691 */ if (getAtt(paramElement2, "STRUCTDIFFICON").equals(str + "/netmarkets/images/newpart.gif")) { /* 1692 */ hashMap.put("STRUCTDIFFICON", AttachmentsDataUtilityHelper.getBaseURL() + "/netmarkets/images/structure_replace_newcreate.gif"); /* */ } else { /* 1694 */ hashMap.put("STRUCTDIFFICON", AttachmentsDataUtilityHelper.getBaseURL() + "/netmarkets/images/structure_replace_existing.gif"); /* */ } /* */ /* */ /* 1698 */ hashMap.put("TYPE", getAtt(paramElement2, "TYPE")); /* 1699 */ hashMap.put("ICONURL", getAtt(paramElement2, "ICONURL")); /* 1700 */ hashMap.put("VIEWPAGEURL", getAtt(paramElement2, "VIEWPAGEURL")); /* */ /* 1702 */ hashMap.put("FINDNUMBER", getAtt(paramElement2, "FINDNUMBER")); /* 1703 */ hashMap.put("FINDNUMBEROLD", getAtt(paramElement1, "FINDNUMBER")); /* */ /* 1705 */ hashMap.put("QUANTITY", getAtt(paramElement2, "QUANTITY")); /* 1706 */ hashMap.put("QUANTITYOLD", getAtt(paramElement1, "QUANTITY")); /* 1707 */ hashMap.put("UOM", getAtt(paramElement2, "UOM")); /* 1708 */ hashMap.put("UOMOLD", getAtt(paramElement1, "UOM")); /* */ /* 1710 */ hashMap.put("COMPNUMBER", getAtt(paramElement2, "COMPNUMBER")); /* 1711 */ hashMap.put("COMPNUMBEROLD", getAtt(paramElement1, "COMPNUMBER")); /* */ /* 1713 */ hashMap.put("COMPNAME", getAtt(paramElement2, "COMPNAME")); /* 1714 */ hashMap.put("COMPNAMEOLD", getAtt(paramElement1, "COMPNAMEOLD")); /* */ /* 1716 */ hashMap.put("COMPORGID", getAtt(paramElement2, "COMPORGID")); /* 1717 */ hashMap.put("COMPORGIDOLD", getAtt(paramElement1, "COMPORGID")); /* */ /* 1719 */ hashMap.put("COMPVERSION", getAtt(paramElement2, "COMPVERSION")); /* 1720 */ hashMap.put("COMPVERSIONOLD", getAtt(paramElement1, "COMPVERSIONOLD")); /* */ /* 1722 */ hashMap.put("OBJECTUID", getAtt(paramElement2, "OBJECTUID")); /* */ /* 1724 */ hashMap.put("REFERENCEDESIGNATOR", getAtt(paramElement2, "REFERENCEDESIGNATOR")); /* 1725 */ hashMap.put("REFERENCEDESIGNATOROLD", getAtt(paramElement2, "REFERENCEDESIGNATOROLD")); /* */ /* 1727 */ return constructElement(hashMap); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected Element constructElement(HashMap paramHashMap) { /* 1739 */ Element element = new Element(); /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 1748 */ element.setUfid("" + this.incrementor++); /* 1749 */ element.addAtt(new Att("OBJECTUID", getAttributeValue(paramHashMap, "OBJECTUID"))); /* 1750 */ element.addAtt(new Att("NAME", getAttributeValue(paramHashMap, "NAME"))); /* 1751 */ element.addAtt(new Att("NUMBER", getAttributeValue(paramHashMap, "NUMBER"))); /* 1752 */ element.addAtt(new Att("ORGID", getAttributeValue(paramHashMap, "ORGID"))); /* 1753 */ element.addAtt(new Att("NEWVERSION", getAttributeValue(paramHashMap, "NEWVERSION"))); /* 1754 */ element.addAtt(new Att("OLDVERSION", getAttributeValue(paramHashMap, "OLDVERSION"))); /* 1755 */ element.addAtt(new Att("ATTRNAME", getAttributeValue(paramHashMap, "ATTRNAME"))); /* 1756 */ element.addAtt(new Att("NEWVALUE", getAttributeValue(paramHashMap, "NEWVALUE"))); /* 1757 */ element.addAtt(new Att("OLDVALUE", getAttributeValue(paramHashMap, "OLDVALUE"))); /* */ /* 1759 */ element.addAtt(new Att("COMPTYPE", getAttributeValue(paramHashMap, "COMPTYPE"))); /* 1760 */ element.addAtt(new Att("LINKTYPE", getAttributeValue(paramHashMap, "LINKTYPE"))); /* 1761 */ element.addAtt(new Att("STRUCTDIFF", getAttributeValue(paramHashMap, "STRUCTDIFF"))); /* 1762 */ element.addAtt(new Att("STRUCTDIFFICON", getAttributeValue(paramHashMap, "STRUCTDIFFICON"))); /* */ /* 1764 */ element.addAtt(new Att("TYPE", getAttributeValue(paramHashMap, "TYPE"))); /* 1765 */ element.addAtt(new Att("ICONURL", getAttributeValue(paramHashMap, "ICONURL"))); /* 1766 */ element.addAtt(new Att("VIEWPAGEURL", getAttributeValue(paramHashMap, "VIEWPAGEURL"))); /* 1767 */ element.addAtt(new Att("TARGETTRANSITION", getAttributeValue(paramHashMap, "TARGETTRANSITION"))); /* */ /* 1769 */ element.addAtt(new Att("FINDNUMBER", getAttributeValue(paramHashMap, "FINDNUMBER"))); /* 1770 */ element.addAtt(new Att("FINDNUMBEROLD", getAttributeValue(paramHashMap, "FINDNUMBEROLD"))); /* */ /* 1772 */ element.addAtt(new Att("COMPONENTID", getAttributeValue(paramHashMap, "COMPONENTID"))); /* 1773 */ element.addAtt(new Att("COMPONENTIDOLD", getAttributeValue(paramHashMap, "COMPONENTIDOLD"))); /* */ /* 1775 */ element.addAtt(new Att("QUANTITY", getAttributeValue(paramHashMap, "QUANTITY"))); /* 1776 */ element.addAtt(new Att("QUANTITYOLD", getAttributeValue(paramHashMap, "QUANTITYOLD"))); /* 1777 */ element.addAtt(new Att("UOM", getAttributeValue(paramHashMap, "UOM"))); /* 1778 */ element.addAtt(new Att("UOMOLD", getAttributeValue(paramHashMap, "UOMOLD"))); /* */ /* 1780 */ element.addAtt(new Att("COMPNUMBER", getAttributeValue(paramHashMap, "COMPNUMBER"))); /* 1781 */ element.addAtt(new Att("COMPNUMBEROLD", getAttributeValue(paramHashMap, "COMPNUMBEROLD"))); /* */ /* 1783 */ element.addAtt(new Att("COMPNAME", getAttributeValue(paramHashMap, "COMPNAME"))); /* 1784 */ element.addAtt(new Att("COMPNAMEOLD", getAttributeValue(paramHashMap, "COMPNAMEOLD"))); /* */ /* 1786 */ element.addAtt(new Att("COMPORGID", getAttributeValue(paramHashMap, "COMPORGID"))); /* 1787 */ element.addAtt(new Att("COMPORGIDOLD", getAttributeValue(paramHashMap, "COMPORGIDOLD"))); /* */ /* 1789 */ element.addAtt(new Att("COMPVERSION", getAttributeValue(paramHashMap, "COMPVERSION"))); /* 1790 */ element.addAtt(new Att("COMPVERSIONOLD", getAttributeValue(paramHashMap, "COMPVERSIONOLD"))); /* */ /* 1792 */ element.addAtt(new Att("REFERENCEDESIGNATOR", getAttributeValue(paramHashMap, "REFERENCEDESIGNATOR"))); /* 1793 */ element.addAtt(new Att("REFERENCEDESIGNATOROLD", getAttributeValue(paramHashMap, "REFERENCEDESIGNATOROLD"))); /* */ /* 1795 */ return element; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected Element constructElementForDisposition(Changeable2 paramChangeable2, String paramString1, String paramString2, String paramString3) { /* 1809 */ Element element = new Element(); /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 1818 */ element.setUfid("" + this.incrementor++); /* 1819 */ element.addAtt(new Att("OBJECTUID", getObjectUID(paramChangeable2))); /* 1820 */ element.addAtt(new Att("NUMBER", getNumber(paramChangeable2))); /* 1821 */ element.addAtt(new Att("DISPOSITIONKEY", paramString1)); /* 1822 */ element.addAtt(new Att("DISPOSITIONVALUE", paramString2)); /* 1823 */ element.addAtt(new Att("DISPOSITIONCOMMENTS", paramString3)); /* */ /* 1825 */ return element; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private Element constructElement(VersionableChangeItem paramVersionableChangeItem, boolean paramBoolean1, boolean paramBoolean2) throws WTException { /* 1838 */ Element element = new Element(); /* 1839 */ element.setUfid(String.valueOf(this.incrementor++)); /* */ /* 1841 */ element.addAtt(new Att("obid", PersistenceHelper.getObjectIdentifier(paramVersionableChangeItem))); /* 1842 */ element.addAtt(new Att("type", paramVersionableChangeItem.getDisplayType().getLocalizedMessage(this.locale))); /* 1843 */ element.addAtt(new Att("number", getNumber(paramVersionableChangeItem))); /* */ /* 1845 */ ReferenceFactory referenceFactory = new ReferenceFactory(); /* */ /* 1847 */ if (paramBoolean1) { /* 1848 */ element.addAtt(new Att("masterReference^organizationReference", referenceFactory /* 1849 */ .getReferenceString(paramVersionableChangeItem.getOrganizationReference()))); /* */ } /* */ /* 1852 */ if (paramBoolean2) { /* 1853 */ element.addAtt(new Att("version", getVersion(paramVersionableChangeItem))); /* */ } /* */ /* 1856 */ element.addAtt(new Att("name", getName(paramVersionableChangeItem))); /* */ /* 1858 */ if (paramVersionableChangeItem.getState() != null) { /* 1859 */ element.addAtt(new Att("state.state", paramVersionableChangeItem.getState().toString())); /* */ } /* */ /* 1862 */ if (paramVersionableChangeItem instanceof WTContained) { /* 1863 */ element.addAtt(new Att("containerReference", referenceFactory /* 1864 */ .getReferenceString(((WTContained)paramVersionableChangeItem).getContainerReference()))); /* */ } /* 1866 */ element.addAtt(new Att("displayIdentifier", paramVersionableChangeItem.getDisplayIdentifier())); /* 1867 */ return element; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private Element constructRemoteChangeItemElement(Object paramObject) throws WTException { /* 1877 */ Element element = new Element(); /* 1878 */ Persistable persistable = (Persistable)paramObject; /* 1879 */ element.addAtt(new Att("NUMBER", ((WTResource)paramObject).getUriString())); /* 1880 */ element.removeAtt("VIEWPAGEURL"); /* 1881 */ element.addAtt(new Att("VIEWPAGEURL", getViewPageURL(persistable))); /* 1882 */ element.addAtt(new Att("ICONURL", getIconURL(persistable))); /* 1883 */ element.addAtt(new Att("type", /* 1884 */ IdentityFactory.getDisplayType(persistable).getLocalizedMessage(this.locale))); /* */ /* 1886 */ return element; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private String getAttributeValue(HashMap paramHashMap, String paramString) { /* 1897 */ String str = ""; /* 1898 */ if (paramHashMap.get(paramString) != null) { /* 1899 */ str = (String)paramHashMap.get(paramString); /* */ } /* 1901 */ return str; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 1919 */ public static void processChangeSummaryAttributes(Group paramGroup, boolean paramBoolean, Locale paramLocale) throws WTException { processChangeSummaryAttributes(paramGroup, paramBoolean, paramLocale, false); } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public static void processChangeSummaryAttributes(Group paramGroup, boolean paramBoolean1, Locale paramLocale, boolean paramBoolean2) throws WTException { /* 1942 */ if (paramGroup != null && paramGroup.getElementCount() > 0) { /* 1943 */ Enumeration enumeration = paramGroup.getElements(); /* 1944 */ while (enumeration.hasMoreElements()) { /* 1945 */ Element element = (Element)enumeration.nextElement(); /* 1946 */ if (logger.isDebugEnabled()) { /* 1947 */ logger.debug("iterating elements: " + element); /* */ } /* 1949 */ replaceAttributesWithDisplayValue("enumerated", element, "state.state", "state", wt.lifecycle.State.class, paramLocale); /* */ /* 1951 */ replaceAttributesWithDisplayValue("reference", element, "masterReference^organizationReference", "organizationIdentifier", null, paramLocale); /* */ /* */ /* 1954 */ replaceAttributesWithDisplayValue("reference", element, "containerReference", "containerName", null, paramLocale); /* */ /* */ /* 1957 */ WTReference wTReference = getWTReference(element); /* 1958 */ if (wTReference != null) { /* 1959 */ Persistable persistable = wTReference.getObject(); /* 1960 */ if (useThirdPartyReporting() || paramBoolean2) { /* 1961 */ element.addAtt(new Att("VIEWPAGEURL", getViewPageURL(persistable))); /* 1962 */ element.addAtt(new Att("ICONURL", getIconURL(persistable))); /* */ /* 1964 */ if (persistable instanceof WTResource) { /* 1965 */ element.removeAtt("number"); /* 1966 */ element.removeAtt("iterationDisplayIdentifier"); /* 1967 */ element.addAtt(new Att("NUMBER", ((WTResource)persistable).getUriString())); /* */ } /* */ } else { /* */ /* 1971 */ createLinkForNumberAttribute(element, persistable); /* */ } /* */ } /* */ /* 1975 */ addChangeAdmin1Column(element, paramLocale); /* */ /* 1977 */ if (paramBoolean1) { /* 1978 */ if (element.getValue("longDescription.formattedtext") != null) { /* 1979 */ element.addAtt(new Att("longDescriptionRichText", element /* 1980 */ .getValue("longDescription.formattedtext"))); /* 1981 */ element.addAtt(new Att("longDescriptionCognosRichText", getDisplayValueForRichText((String)element /* 1982 */ .getValue("longDescription.formattedtext"), TextFormat.COGNOS))); /* 1983 */ element.addAtt(new Att("longDescriptionJasperRichText", getDisplayValueForRichText((String)element /* 1984 */ .getValue("longDescription.formattedtext"), TextFormat.JASPER))); /* */ } /* 1986 */ if (element.getValue("longProposedSolution.formattedtext") != null) { /* 1987 */ element.addAtt(new Att("longProposedSolutionRichText", element /* 1988 */ .getValue("longProposedSolution.formattedtext"))); /* 1989 */ element.addAtt(new Att("longProposedSolutionCognosRichText", /* 1990 */ getDisplayValueForRichText((String)element.getValue("longProposedSolution.formattedtext"), TextFormat.COGNOS))); /* */ /* 1992 */ element.addAtt(new Att("longProposedSolutionJasperRichText", /* 1993 */ getDisplayValueForRichText((String)element.getValue("longProposedSolution.formattedtext"), TextFormat.JASPER))); /* */ } /* */ /* 1996 */ if (element.getValue("longReason.formattedtext") != null) { /* 1997 */ element.addAtt(new Att("longReasonRichText", element /* 1998 */ .getValue("longReason.formattedtext"))); /* 1999 */ element.addAtt(new Att("longReasonCognosRichText", getDisplayValueForRichText((String)element /* 2000 */ .getValue("longReason.formattedtext"), TextFormat.COGNOS))); /* 2001 */ element.addAtt(new Att("longReasonJasperRichText", getDisplayValueForRichText((String)element /* 2002 */ .getValue("longReason.formattedtext"), TextFormat.JASPER))); /* */ } /* 2004 */ replaceAttributesWithDisplayValue("type", element, "type", null, null, paramLocale); /* 2005 */ replaceAttributesWithDisplayValue("enumerated", element, "theIssuePriority", null, wt.change2.IssuePriority.class, paramLocale); /* */ /* 2007 */ replaceAttributesWithDisplayValue("enumerated", element, "requestPriority", null, wt.change2.RequestPriority.class, paramLocale); /* */ /* 2009 */ replaceAttributesWithDisplayValue("enumerated", element, "theComplexity", null, wt.change2.Complexity.class, paramLocale); /* */ /* 2011 */ replaceAttributesWithDisplayValue("enumerated", element, "theCategory", null, wt.change2.Category.class, paramLocale); /* */ /* 2013 */ replaceAttributesWithDisplayValue("enumerated", element, "theVarianceCategory", null, wt.change2.VarianceCategory.class, paramLocale); /* */ /* 2015 */ replaceAttributesWithDisplayValue("enumerated", element, "theChangeNoticeComplexity", null, wt.change2.ChangeNoticeComplexity.class, paramLocale); /* */ /* */ /* */ /* 2019 */ replaceAttributesWithDisplayValue("date", element, "needDate", null, null, paramLocale); /* 2020 */ replaceAttributesWithDisplayValue("date", element, "resolutionDate", null, null, paramLocale); /* */ /* */ /* 2023 */ replaceAttributesWithDisplayValue("timeStamp", element, "thePersistInfo.createStamp", "createTimeStamp", null, paramLocale); /* */ /* 2025 */ replaceAttributesWithDisplayValue("timeStamp", element, "thePersistInfo.modifyStamp", "modifyTimeStamp", null, paramLocale); /* */ /* */ /* 2028 */ replaceAttributesWithDisplayValue("reference", element, "varianceOwner", null, null, paramLocale); /* */ /* 2030 */ replaceAttributesWithDisplayValue("reference", element, "folder.id", "folderId", null, paramLocale); /* */ /* 2032 */ replaceAttributesWithDisplayValue("richText", element, "longDescription.formattedtext", "longDescriptionPlainText", null, paramLocale); /* */ /* 2034 */ replaceAttributesWithDisplayValue("richText", element, "longProposedSolution.formattedtext", "longProposedSolutionPlainText", null, paramLocale); /* */ /* 2036 */ replaceAttributesWithDisplayValue("richText", element, "longReason.formattedtext", "longReasonPlainText", null, paramLocale); /* */ /* 2038 */ replaceAttributesWithDisplayValue("reference", element, "creator.id", "creator", null, paramLocale); /* */ /* 2040 */ replaceAttributesWithDisplayValue("reference", element, "modifier.id", "iterationInfo.modifier", null, paramLocale); /* */ } /* */ } /* */ } /* */ } /* */ /* */ /* */ private static void createLinkForNumberAttribute(Element paramElement, Persistable paramPersistable) throws WTException { /* 2048 */ String str1 = getViewPageURL(paramPersistable); /* 2049 */ String str2 = ""; /* 2050 */ String str3 = "javascript:if(top){top.location='" + str1 + "';}else{window.location='" + str1 + "';}"; /* 2051 */ Att att = paramElement.getAtt("displayIdentifier"); /* 2052 */ if (att != null) { /* 2053 */ paramElement.removeAtt("displayIdentifier"); /* 2054 */ att.setName("displayIdentifier"); /* 2055 */ str2 = att.getValue().toString(); /* 2056 */ if (logger.isDebugEnabled()) { /* 2057 */ logger.debug("name:" + str2); /* 2058 */ logger.debug("url: " + str3); /* */ } /* 2060 */ att.setValue(new Hyperlink(str3, str2)); /* 2061 */ paramElement.addAtt(att); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public static void replaceAttributesWithDisplayValue(String paramString1, Element paramElement, String paramString2, String paramString3, Class paramClass, Locale paramLocale) throws WTException { /* 2079 */ String str = null; /* 2080 */ if (paramElement != null && paramString2 != null) { /* 2081 */ Att att = paramElement.getAtt(paramString2); /* */ /* 2083 */ if (logger.isDebugEnabled()) { /* 2084 */ logger.debug("attribute " + att); /* 2085 */ logger.debug("attributeType " + paramString1); /* */ } /* */ /* 2088 */ if (att != null) { /* 2089 */ if ("enumerated".equals(paramString1)) { /* 2090 */ if (paramClass != null) { /* 2091 */ if (!"".equals(paramElement.getValue(paramString2))) { /* 2092 */ str = getDisplayValueForEnumerated(paramClass, (String)paramElement /* 2093 */ .getValue(paramString2), paramLocale); /* */ } /* */ } else { /* */ /* 2097 */ logger.debug("The enumeratedType is null, but is required to get the localized value "); /* */ } /* */ /* 2100 */ } else if ("date".equals(paramString1) || "timeStamp".equals(paramString1)) { /* 2101 */ boolean bool = "date".equals(paramString1); /* 2102 */ Object object = paramElement.getValue(paramString2); /* 2103 */ Date date = null; /* 2104 */ if (object != null) { /* 2105 */ if (object instanceof Date) { /* 2106 */ date = (Date)object; /* 2107 */ if (object instanceof WrappedTimestamp) { /* 2108 */ date = new Date(((WrappedTimestamp)object).getTime()); /* */ } /* */ } else { /* */ /* 2112 */ WrappedTimestamp wrappedTimestamp = new WrappedTimestamp(object.toString(), 0); /* 2113 */ if (wrappedTimestamp != null) { /* 2114 */ date = new Date(wrappedTimestamp.getTime()); /* */ } /* */ } /* */ } /* 2118 */ if (date != null) { /* 2119 */ str = getDisplayValueForDate(date, paramLocale, bool); /* */ } /* */ } /* 2122 */ else if ("reference".equals(paramString1)) { /* 2123 */ str = getDisplayValueForReferences((String)paramElement.getValue(paramString2)); /* */ /* */ } /* 2126 */ else if ("richText".equals(paramString1)) { /* 2127 */ str = getDisplayValueForRichText((String)paramElement.getValue(paramString2), TextFormat.PLAIN); /* */ /* */ } /* 2130 */ else if ("type".equals(paramString1)) { /* 2131 */ TypeIdentifier[] arrayOfTypeIdentifier = null; /* 2132 */ Att att1 = paramElement.getAtt("type"); /* */ /* 2134 */ if (att1 != null && att1.getAttributeTypeIdentifier() != null) { /* 2135 */ arrayOfTypeIdentifier = new TypeIdentifier[1]; /* 2136 */ arrayOfTypeIdentifier[0] = att1.getAttributeTypeIdentifier().getContext(); /* */ } /* */ /* 2139 */ if (logger.isDebugEnabled()) { /* 2140 */ logger.debug("attType " + att1); /* 2141 */ logger.debug("Type Identifier " + arrayOfTypeIdentifier); /* */ } /* */ /* 2144 */ if (arrayOfTypeIdentifier != null) { /* 2145 */ Map map = getLocalizedDisplayValueforType(arrayOfTypeIdentifier, paramLocale); /* 2146 */ if (map != null && map.size() == 1) { /* 2147 */ str = (String)map.get(arrayOfTypeIdentifier[0]); /* */ } /* */ } /* */ } /* */ /* 2152 */ if (logger.isDebugEnabled()) { /* 2153 */ logger.debug("Attribute internal name " + paramString2); /* 2154 */ logger.debug("Attribute output name " + paramString3); /* 2155 */ logger.debug("Value " + str); /* */ } /* */ /* 2158 */ paramElement.removeAtt(paramString2); /* 2159 */ if (paramString3 != null) { /* 2160 */ att.setName(paramString3); /* */ } /* 2162 */ if (str != null) { /* 2163 */ att.setValue(str); /* */ } /* */ /* 2166 */ paramElement.addAtt(att); /* */ } /* */ /* */ } /* 2170 */ else if (logger.isDebugEnabled()) { /* 2171 */ logger.debug(Boolean.valueOf(("The element is null " + paramElement == null))); /* 2172 */ logger.debug(Boolean.valueOf(("The attributeInternal is null " + paramString2 == null))); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private static Map getLocalizedDisplayValueforType(TypeIdentifier[] paramArrayOfTypeIdentifier, Locale paramLocale) throws WTException { /* 2186 */ HashMap hashMap = null; /* 2187 */ if (paramArrayOfTypeIdentifier != null && paramArrayOfTypeIdentifier.length > 0) { /* 2188 */ DefinitionDescriptor[] arrayOfDefinitionDescriptor = DESCRIPTOR_FACTORY.get(paramArrayOfTypeIdentifier, (String[])null, paramLocale); /* */ /* 2190 */ if (arrayOfDefinitionDescriptor != null && arrayOfDefinitionDescriptor.length > 0) { /* 2191 */ int i = arrayOfDefinitionDescriptor.length; /* 2192 */ hashMap = new HashMap(); /* 2193 */ String str = null; /* 2194 */ for (byte b = 0; b < i; b++) { /* 2195 */ if (arrayOfDefinitionDescriptor[b] != null) { /* 2196 */ str = arrayOfDefinitionDescriptor[b].getDisplay(); /* 2197 */ String str1 = ((WCTypeIdentifier)paramArrayOfTypeIdentifier[b]).getTableClassName(); /* 2198 */ if (str == null || str.equals(str1)) { /* 2199 */ str = WTIntrospector.getClassInfo(str1).getDisplayName(paramLocale); /* */ } /* */ /* 2202 */ hashMap.put((TypeIdentifier)arrayOfDefinitionDescriptor[b].getIdentifier(), str); /* */ } /* */ } /* */ } /* */ } /* 2207 */ return hashMap; /* */ } /* */ /* */ private static String getDisplayValueForReferences(String paramString) throws WTException { /* 2211 */ if (paramString != null) { /* */ try { /* 2213 */ WTReference wTReference = ObjectReferenceTranslator.toWTReference(paramString); /* 2214 */ if (wTReference instanceof WTPrincipalReference) { /* 2215 */ return getPrincipalDisplayName((WTPrincipalReference)wTReference); /* */ } /* 2217 */ String str = wTReference.toString(); /* 2218 */ return ReportTaskUtil.getDisplayName(str); /* 2219 */ } catch (WTException wTException) { /* 2220 */ logger.error("String was not a reference to an object", wTException); /* 2221 */ return paramString; /* */ } /* */ } /* */ /* 2225 */ return ""; /* */ } /* */ /* */ private static String getDisplayValueForDate(Date paramDate, Locale paramLocale, boolean paramBoolean) { /* 2229 */ if (paramDate != null) { /* 2230 */ if (paramBoolean) { /* 2231 */ return WTStandardDateFormat.format(paramDate, 26, paramLocale); /* */ } /* */ /* */ /* 2235 */ return DateFormatUtilities.formatDate(paramDate, paramLocale); /* */ } /* */ /* */ /* 2239 */ return ""; /* */ } /* */ /* */ /* */ private static String getDisplayValueForEnumerated(Class paramClass, String paramString, Locale paramLocale) { /* 2244 */ if (paramClass != null && paramString != null) { /* 2245 */ return EnumeratedTypeUtil.toEnumeratedType(paramClass.getName(), paramString).getDisplay(paramLocale); /* */ } /* 2247 */ return ""; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private static String getDisplayValueForRichText(String paramString, TextFormat paramTextFormat) { /* 2263 */ if (logger.isDebugEnabled()) { /* 2264 */ logger.debug("richTextString: " + paramString); /* 2265 */ logger.debug("TextFormat: " + paramTextFormat.toString()); /* */ } /* */ /* 2268 */ String str = paramString; /* 2269 */ if (null != str) { /* */ try { /* 2271 */ String str1 = null; /* */ /* 2273 */ if (paramTextFormat == TextFormat.COGNOS) { /* 2274 */ str1 = "com/ptc/core/richtext/cognosrichtextfilter.xsl"; /* */ } /* 2276 */ else if (paramTextFormat == TextFormat.JASPER) { /* 2277 */ str1 = "com/ptc/core/richtext/jasperrichtextfilter.xsl"; /* */ } else { /* */ /* 2280 */ str1 = "com/ptc/core/richtext/plaintextfilter.xsl"; /* */ } /* */ /* 2283 */ str = HTMLTextFilter.filterHTMLText(paramString, str1, true, false); /* 2284 */ } catch (Exception exception) { /* 2285 */ logger.error("Error occurred while filtering HTML text", exception); /* */ } /* */ } /* */ /* 2289 */ if (logger.isDebugEnabled()) { /* 2290 */ logger.debug("resultingTextString: " + str); /* */ } /* 2292 */ return str; /* */ } /* */ /* */ private void addAssociationType(BinaryLink paramBinaryLink, HashMap paramHashMap) throws WTException { /* 2296 */ String str1 = ""; /* 2297 */ String str2 = ""; /* 2298 */ if (paramBinaryLink instanceof IteratedUsageLink) { /* 2299 */ str1 = "USES"; /* */ } /* 2301 */ else if (paramBinaryLink instanceof wt.part.WTPartDescribeLink) { /* 2302 */ str1 = "DESCRIBES_BY"; /* 2303 */ str2 = WTMessage.getLocalizedMessage("com.ptc.windchill.enterprise.massChange.massChangeClientResource", "DOCUMENT_DESCRIBED_BY", null, this.locale); /* */ /* */ } /* 2306 */ else if (paramBinaryLink instanceof wt.part.WTPartReferenceLink) { /* 2307 */ str1 = "REFERENCE_TO"; /* 2308 */ str2 = WTMessage.getLocalizedMessage("com.ptc.windchill.enterprise.massChange.massChangeClientResource", "DOCUMENT_REFERENCED_BY", null, this.locale); /* */ } /* */ else { /* */ /* 2312 */ if (paramBinaryLink instanceof wt.epm.build.EPMBuildHistory || paramBinaryLink instanceof wt.epm.build.EPMBuildRule) { /* 2313 */ str1 = "OWNER"; /* 2314 */ } else if (paramBinaryLink instanceof wt.epm.structure.EPMDescribeLink) { /* 2315 */ str1 = "CONTENT"; /* */ } /* 2317 */ if (!str1.isEmpty()) { /* 2318 */ AssociationType associationType = AssociationType.getAssociationType(paramBinaryLink); /* 2319 */ str2 = associationType.getLocalizedName(SessionHelper.getLocale()); /* */ } /* */ } /* 2322 */ if (logger.isDebugEnabled()) { /* 2323 */ logger.debug("The compType is: " + str1); /* 2324 */ logger.debug("The linkType is: " + str2); /* */ } /* 2326 */ paramHashMap.put("COMPTYPE", str1); /* 2327 */ paramHashMap.put("LINKTYPE", str2); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public static String getViewPageURL(Persistable paramPersistable) throws WTException { /* 2340 */ if (paramPersistable instanceof WTResource) { /* 2341 */ return ((WTResource)paramPersistable).getUriString(); /* */ } /* */ /* 2344 */ NmOid nmOid = new NmOid(paramPersistable); /* 2345 */ NmAction nmAction = NmActionServiceHelper.service.getAction("object", "view"); /* 2346 */ nmAction.setContextObject(nmOid); /* */ try { /* 2348 */ return nmAction.getActionUrlExternal(); /* 2349 */ } catch (Exception exception) { /* 2350 */ throw new WTException(exception); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ public static WTReference getWTReference(Element paramElement) throws WTException { /* 2358 */ WTReference wTReference = null; /* 2359 */ if (paramElement != null) { /* 2360 */ Att att = paramElement.getAtt("obid"); /* 2361 */ if (att != null) { /* 2362 */ wTReference = ObjectReferenceTranslator.toWTReference(att.getValue().toString()); /* */ } /* */ } /* 2365 */ return wTReference; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public static void processChangeTask_WorkItem_Attributes(Group paramGroup, Locale paramLocale) throws WTException { /* 2383 */ if (paramGroup != null && paramGroup.getElementCount() > 0) { /* 2384 */ Enumeration enumeration = paramGroup.getElements(); /* 2385 */ while (enumeration.hasMoreElements()) { /* 2386 */ Element element = (Element)enumeration.nextElement(); /* 2387 */ if (logger.isDebugEnabled()) { /* 2388 */ logger.debug("iterating elements: " + element); /* */ } /* 2390 */ replaceAttributesWithDisplayValue("date", element, "needDate", null, null, paramLocale); /* 2391 */ replaceAttributesWithDisplayValue("date", element, "thePersistInfo.createStamp", "createTimeStamp", null, paramLocale); /* */ /* 2393 */ replaceAttributesWithDisplayValue("date", element, "deadline", null, null, paramLocale); /* 2394 */ replaceAttributesWithDisplayValue("enumerated", element, "state.state", "state", wt.lifecycle.State.class, paramLocale); /* */ /* 2396 */ replaceAttributesWithDisplayValue("enumerated", element, "role", null, Role.class, paramLocale); /* */ /* */ /* 2399 */ Att att = element.getAtt("changeActivityObid"); /* 2400 */ if (att != null) { /* 2401 */ WTReference wTReference = ObjectReferenceTranslator.toWTReference(att.getValue().toString()); /* 2402 */ element.addAtt(new Att("ICONURL", getIconURL(wTReference.getObject()))); /* 2403 */ element.addAtt(new Att("VIEWPAGEURL", getViewPageURL(wTReference.getObject()))); /* */ } /* */ } /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public static Persistable getElementOBID(Element paramElement) throws WTException { /* 2420 */ Persistable persistable = null; /* 2421 */ if (paramElement != null) { /* 2422 */ if (ElementObjMap != null && ElementObjMap.containsKey(paramElement)) { /* 2423 */ persistable = (Persistable)ElementObjMap.get(paramElement); /* */ } else { /* */ /* 2426 */ Att att = paramElement.getAtt("obid"); /* 2427 */ if (att != null && att.getValue() != null) { /* 2428 */ WTReference wTReference = ObjectReferenceTranslator.toWTReference(att.getValue().toString()); /* 2429 */ if (wTReference != null && wTReference.getObject() != null) { /* 2430 */ persistable = wTReference.getObject(); /* 2431 */ ElementObjMap.put(paramElement, persistable); /* */ } /* */ } /* */ } /* */ } /* 2436 */ return persistable; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected static Team getTeam(TeamManaged paramTeamManaged) throws WTException { /* 2449 */ Team team = null; /* 2450 */ bool = getStandardSessionManager().setAccessEnforced(false); /* */ try { /* 2452 */ if (paramTeamManaged != null && paramTeamManaged.getTeamId() != null) { /* 2453 */ TeamReference teamReference = paramTeamManaged.getTeamId(); /* 2454 */ if (teamReference != null) { /* 2455 */ team = (Team)teamReference.getObject(); /* 2456 */ team = (Team)persistenceManager.refresh(team); /* */ } /* */ } /* */ } finally { /* 2460 */ getStandardSessionManager().setAccessEnforced(bool); /* */ } /* */ /* 2463 */ return team; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private static String getAdmin1RoleUsers(Team paramTeam) throws WTException { /* 2478 */ StringBuffer stringBuffer = null; /* 2479 */ boolean bool1 = false; /* 2480 */ String str = ""; /* */ /* 2482 */ boolean bool2 = (paramTeam != null && AccessControlHelper.manager.hasAccess(paramTeam, AccessPermission.READ)) ? 1 : 0; /* 2483 */ if (bool2) { /* 2484 */ Role role = Role.toRole("CHANGE ADMINISTRATOR I"); /* 2485 */ Enumeration enumeration = paramTeam.getPrincipalTarget(role); /* 2486 */ stringBuffer = new StringBuffer(); /* 2487 */ while (enumeration.hasMoreElements()) { /* 2488 */ WTPrincipalReference wTPrincipalReference = (WTPrincipalReference)enumeration.nextElement(); /* 2489 */ String str1 = getPrincipalDisplayName(wTPrincipalReference); /* 2490 */ if (str1 != null && !"".equalsIgnoreCase(str1)) { /* 2491 */ if (bool1) { /* 2492 */ stringBuffer.append(sep); /* */ } /* 2494 */ stringBuffer.append(str1); /* 2495 */ bool1 = true; /* */ } /* */ } /* */ } /* 2499 */ if (stringBuffer == null) { /* 2500 */ return str; /* */ } /* 2502 */ return stringBuffer.toString(); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public static void addChangeAdmin1Column(Element paramElement, Locale paramLocale) { /* */ try { /* 2516 */ Team team = null; /* 2517 */ Persistable persistable = getElementOBID(paramElement); /* 2518 */ if (persistable != null && ChangeRequest2.class.isAssignableFrom(persistable.getClass())) { /* 2519 */ TeamManaged teamManaged = (TeamManaged)persistable; /* 2520 */ team = getTeam(teamManaged); /* 2521 */ if (team != null) { /* 2522 */ String str = getAdmin1RoleUsers(team); /* 2523 */ Att att = new Att("CHANGE_ADMIN1", str); /* 2524 */ paramElement.addAtt(att); /* */ } /* */ } /* 2527 */ } catch (WTException wTException) { /* 2528 */ if (logger.isDebugEnabled()) { /* 2529 */ logger.debug("Unable to add change admin 1 column to change request log report because there was an exception " + wTException /* */ /* 2531 */ .getLocalizedMessage(paramLocale)); /* */ } /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 2543 */ private static SessionManagerSvr getStandardSessionManager() { return SessionServerHelper.manager; } /* */ /* */ /* */ private static String getPrincipalDisplayName(WTPrincipalReference paramWTPrincipalReference) throws WTException { /* 2547 */ boolean bool = (paramWTPrincipalReference != null && AccessControlHelper.manager.hasAccess(paramWTPrincipalReference, AccessPermission.READ)) ? 1 : 0; /* 2548 */ String str = null; /* 2549 */ if (bool) { /* 2550 */ WTPrincipal wTPrincipal = (WTPrincipal)paramWTPrincipalReference.getObject(); /* 2551 */ str = processPrincipal(wTPrincipal); /* */ } /* 2553 */ return str; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public static String processPrincipal(WTPrincipal paramWTPrincipal) throws WTException { /* 2567 */ StringBuffer stringBuffer = new StringBuffer(); /* 2568 */ String str = ""; /* */ /* 2570 */ if (paramWTPrincipal instanceof WTUser) { /* 2571 */ str = ((WTUser)paramWTPrincipal).getFullName(); /* 2572 */ stringBuffer.append(str); /* */ } /* 2574 */ else if (paramWTPrincipal instanceof WTGroup) { /* 2575 */ str = ContainerTeamHelper.getDisplayName((WTGroup)paramWTPrincipal, SessionHelper.getLocale()); /* 2576 */ stringBuffer.append(str); /* */ } /* 2578 */ return stringBuffer.toString(); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ public static String getLogReportInputParams(boolean paramBoolean) throws Exception { /* 2587 */ JSONObject jSONObject = new JSONObject(); /* */ /* 2589 */ jSONObject.put("CONTAINERID", "cntnrId"); /* 2590 */ jSONObject.put("CONTAINERTYPE", "cntnrType"); /* */ /* 2592 */ if (paramBoolean) { /* 2593 */ jSONObject.put("PRINCIPALID", "chgAdmin2"); /* */ } else { /* */ /* 2596 */ jSONObject.put("PRINCIPALID", "chgAdmin"); /* */ } /* */ /* 2599 */ jSONObject.put("NUMBER", "num"); /* 2600 */ jSONObject.put("NAME", "name"); /* 2601 */ jSONObject.put("STATE", "state"); /* 2602 */ jSONObject.put("PRIORITY", "priorty"); /* */ /* 2604 */ jSONObject.put("CATEGORY", "ctgry"); /* 2605 */ jSONObject.put("VARIANCECATEGORY", "varCtgry"); /* 2606 */ jSONObject.put("COMPLEXITY", "cmplxty"); /* */ /* 2608 */ jSONObject.put("CREATEDTS_RANGEFROM", "createFromDte"); /* 2609 */ jSONObject.put("CREATEDTS_RANGETO", "createToDte"); /* */ /* 2611 */ jSONObject.put("LASTUPDATEDTS_RANGEFROM", "lstUpdFromDte"); /* */ /* 2613 */ jSONObject.put("LASTUPDATEDTS_RANGETO", "lstUpdToDte"); /* */ /* 2615 */ String str = jSONObject.toString(); /* 2616 */ str = HTMLEncoder.encodeForHTMLAttribute(str); /* */ /* 2618 */ if (logger.isDebugEnabled()) { /* 2619 */ logger.debug("The json string is " + str); /* */ } /* */ /* 2622 */ return str; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public static int getReportsPageSize() { /* 2635 */ int i = 5000; /* */ try { /* 2637 */ i = WTProperties.getLocalProperties().getProperty("wt.change2.reports.pageSize", 5000); /* 2638 */ } catch (IOException iOException) { /* 2639 */ logger.error("Error getting property value for reports page size", iOException); /* */ } /* */ /* 2642 */ if (logger.isDebugEnabled()) { /* 2643 */ logger.debug("reports page size: " + i); /* */ } /* */ /* 2646 */ return i; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected static boolean useThirdPartyReporting() throws WTException { /* 2656 */ Boolean bool = (Boolean)USE_THIRD_PARTY_REPORTING.get(); /* 2657 */ if (bool != null) { /* 2658 */ return bool.booleanValue(); /* */ } /* 2660 */ bool = Boolean.valueOf(false); /* */ try { /* 2662 */ if (ReportHelper.isThirdPartyReportingEnabled()) { /* */ /* 2664 */ long l = ReportHelper.manager.pingThirdPartyReportingSystem(); /* 2665 */ if (l >= 0L) { /* 2666 */ bool = Boolean.valueOf(true); /* */ /* */ /* */ /* */ /* */ /* 2672 */ StackTraceElement[] arrayOfStackTraceElement = Thread.currentThread().getStackTrace(); /* 2673 */ String str = com.ptc.windchill.enterprise.report.ReportTask.class.getName(); /* */ /* */ /* 2676 */ for (StackTraceElement stackTraceElement : arrayOfStackTraceElement) { /* 2677 */ if (stackTraceElement.getClassName().equals(str)) { /* 2678 */ bool = Boolean.valueOf(false); /* */ break; /* */ } /* */ } /* */ } /* */ } /* 2684 */ } catch (WTException wTException) { /* 2685 */ logger.debug("Could not determine if third party reporting is responding.", wTException); /* */ } /* */ /* 2688 */ if (bool.booleanValue()) { /* 2689 */ logger.debug("Third party reporting is enabled and responding."); /* */ } else { /* 2691 */ logger.debug("Third party reporting is either not enabled or not responding."); /* */ } /* 2693 */ setUserThirdPartyReporting(bool); /* 2694 */ return bool.booleanValue(); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 2703 */ static void setUserThirdPartyReporting(Boolean paramBoolean) { USE_THIRD_PARTY_REPORTING.set(paramBoolean); } /* */ } /* Location: C:\ptc\Windchill_12.0\Windchill\codebase\WEB-INF\lib\wncWeb.jar!/com/ptc/windchill/enterprise/change2/reports/ChangeItemReportHelper.class * Java compiler version: 11 (55.0) * JD-Core Version: 1.0.7 */