summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-04-03 08:24:25 (EDT)
committer Manik Kishore2012-06-19 07:25:23 (EDT)
commit36cbbf84f806952c17e7a7ce7b2a875db8eaa3cb (patch)
treee0e308559f02660461425ca0fcb08f26761b3233
parentca1b8743e2315dc10c4f443e26499a87859d645d (diff)
downloadorg.eclipse.stardust.ui.web-36cbbf84f806952c17e7a7ce7b2a875db8eaa3cb.zip
org.eclipse.stardust.ui.web-36cbbf84f806952c17e7a7ce7b2a875db8eaa3cb.tar.gz
org.eclipse.stardust.ui.web-36cbbf84f806952c17e7a7ce7b2a875db8eaa3cb.tar.bz2
Jira-ID: CRNT-24266
1)Made changes to ModelUtils.java getDeclaredDocumentTypes() to include reference data. 2)Made changes to DocumentMgmtUtility.java to make call to getDeclaredDocumentTypesForDocTemp() in getDeclaredDocumentTypes() 3)Made change to call to ExtractPageDialog.java for getDocumentType() git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@55232 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/docmgmt/DocumentMgmtUtility.java8
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/DocumentTypeWrapper.java25
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ModelUtils.java30
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/tiff/extract/ExtractPageDialog.java6
4 files changed, 51 insertions, 18 deletions
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/docmgmt/DocumentMgmtUtility.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/docmgmt/DocumentMgmtUtility.java
index 07d2ddd..5e32b4c 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/docmgmt/DocumentMgmtUtility.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/docmgmt/DocumentMgmtUtility.java
@@ -41,6 +41,7 @@ import org.eclipse.stardust.common.CollectionUtils;
import org.eclipse.stardust.common.Direction;
import org.eclipse.stardust.common.StringUtils;
import org.eclipse.stardust.engine.api.dto.DataDetails;
+import org.eclipse.stardust.engine.api.model.Data;
import org.eclipse.stardust.engine.api.model.DataPath;
import org.eclipse.stardust.engine.api.model.Model;
import org.eclipse.stardust.engine.api.model.ProcessDefinition;
@@ -544,12 +545,7 @@ public class DocumentMgmtUtility
for (DeployedModel deployedModel : allModels)
{
- List<DocumentType> documentTypes = DocumentTypeUtils.getDeclaredDocumentTypes(deployedModel);
-
- for (DocumentType documentType : documentTypes)
- {
- declaredDocTypes.add(new DocumentTypeWrapper(documentType, deployedModel.getModelOID()));
- }
+ declaredDocTypes.addAll(ModelUtils.getDeclaredDocumentTypesForDocTemp(deployedModel));
}
return declaredDocTypes;
}
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/DocumentTypeWrapper.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/DocumentTypeWrapper.java
index c07e40b..c396041 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/DocumentTypeWrapper.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/DocumentTypeWrapper.java
@@ -49,16 +49,27 @@ public class DocumentTypeWrapper
this.typeDeclaration = model.getTypeDeclaration(documentType);
}
}
-
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#hashCode()
+ */
@Override
- public boolean equals(Object obj)
+ public int hashCode()
{
+ final int prime = 31;
+ int result = 1;
if (null != getDocumentType())
- {
- getDocumentType().equals(obj);
- }
-
- return false;
+ result = prime * result + ((getDocumentType().getDocumentTypeId() == null) ? 0 : getDocumentType().getDocumentTypeId().hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ DocumentTypeWrapper docWrapperObj=(DocumentTypeWrapper) obj;
+ return getDocumentType().getDocumentTypeId().equals(docWrapperObj.getDocumentType().getDocumentTypeId());
}
public String getDocumentTypeI18nName()
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ModelUtils.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ModelUtils.java
index d8a2840..81df033 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ModelUtils.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ModelUtils.java
@@ -20,6 +20,7 @@ import java.util.Set;
import javax.xml.namespace.QName;
import org.eclipse.stardust.common.CollectionUtils;
+import org.eclipse.stardust.engine.api.model.Data;
import org.eclipse.stardust.engine.api.model.DataPath;
import org.eclipse.stardust.engine.api.model.Model;
import org.eclipse.stardust.engine.api.model.ModelParticipantInfo;
@@ -281,6 +282,35 @@ public class ModelUtils
{
allDocumentTypes.add(new DocumentTypeWrapper(documentType, model));
}
+ // Get the reference document data for given model and get DocType using Data
+ // modelID
+ List<Data> referedDocData = DocumentTypeUtils.getReferencedDocumentData(model);
+ for (Data docData : referedDocData)
+ {
+ DeployedModel dataModel = getModel(docData.getModelOID());
+ allDocumentTypes.add(new DocumentTypeWrapper(DocumentTypeUtils.getDocumentTypeFromData(dataModel, docData),
+ dataModel));
+ }
+ return allDocumentTypes;
+ }
+
+ /**
+ * Temporary method to convert viewscommon.utils.DocumentTypeWrapper to
+ * views.document.DocumentTypeWrapper used by DocumentMgmtUtility.java
+ *
+ * @param model
+ * @return
+ */
+ public static Set<org.eclipse.stardust.ui.web.viewscommon.views.document.DocumentTypeWrapper> getDeclaredDocumentTypesForDocTemp(
+ DeployedModel model)
+ {
+ Set<org.eclipse.stardust.ui.web.viewscommon.views.document.DocumentTypeWrapper> allDocumentTypes = CollectionUtils
+ .newHashSet();
+ for (DocumentTypeWrapper wrapper : getDeclaredDocumentTypes(model))
+ {
+ allDocumentTypes.add(new org.eclipse.stardust.ui.web.viewscommon.views.document.DocumentTypeWrapper(wrapper
+ .getDocumentType(), model.getModelOID()));
+ }
return allDocumentTypes;
}
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/tiff/extract/ExtractPageDialog.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/tiff/extract/ExtractPageDialog.java
index 8fdc36b..91a8eb2 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/tiff/extract/ExtractPageDialog.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/document/tiff/extract/ExtractPageDialog.java
@@ -1435,11 +1435,7 @@ public class ExtractPageDialog extends PopupUIComponentBean implements Confirmat
// if selected process support attachment then show all document type
if (isAttachmentAllowed)
{
- List<DocumentType> types= DocumentTypeUtils.getDeclaredDocumentTypes(model);
- for(DocumentType documentType:types)
- {
- docTypes.add(new DocumentTypeWrapper(documentType,model));
- }
+ docTypes.addAll(ModelUtils.getDeclaredDocumentTypes(model));
}
else
{