diff options
Diffstat (limited to 'bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel')
12 files changed, 0 insertions, 1378 deletions
diff --git a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/AbstractUDDIElement.java b/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/AbstractUDDIElement.java deleted file mode 100644 index a40b239d9..000000000 --- a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/AbstractUDDIElement.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.ws.internal.explorer.platform.uddi.datamodel; - -import java.util.Enumeration; -import org.eclipse.wst.ws.internal.datamodel.Model; -import org.eclipse.wst.ws.internal.explorer.platform.constants.ModelConstants; -import org.eclipse.wst.ws.internal.explorer.platform.datamodel.TreeElement; - -public abstract class AbstractUDDIElement extends TreeElement -{ - public AbstractUDDIElement(String name, Model model) - { - super(name, model); - } - - public final TreeElement getParentElement() - { - return getParentElement(this); - } - - public final TreeElement getParentElement(TreeElement child) - { - Enumeration e = child.getElements(ModelConstants.REL_OWNER); - if (e.hasMoreElements()) - return (TreeElement)e.nextElement(); - else - return null; - } - - public final RegistryElement getRegistryElement() - { - if (this instanceof RegistryElement) - return (RegistryElement)this; - else - { - TreeElement childElement = this; - TreeElement parentElement = getParentElement(childElement); - while (parentElement != null && parentElement != childElement) - { - if (parentElement instanceof RegistryElement) - return (RegistryElement)parentElement; - childElement = parentElement; - parentElement = getParentElement(childElement); - } - return null; - } - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/BusinessElement.java b/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/BusinessElement.java deleted file mode 100644 index f6fcc6a4f..000000000 --- a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/BusinessElement.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.ws.internal.explorer.platform.uddi.datamodel; - -import org.eclipse.wst.ws.internal.datamodel.Model; -import org.eclipse.wst.ws.internal.explorer.platform.datamodel.ListManager; -import org.uddi4j.datatype.business.BusinessEntity; - -public class BusinessElement extends AbstractUDDIElement -{ - private BusinessEntity be_; - private ListManager publisherAssertions_; - - public BusinessElement(BusinessEntity be,Model model) - { - super(be.getDefaultNameString(),model); - be_ = be; - setKey(be_.getBusinessKey()); - publisherAssertions_ = null; - } - - public final BusinessEntity getBusinessEntity() - { - return be_; - } - - public final void setBusinessEntity(BusinessEntity be) - { - be_ = be; - setKey(be_.getBusinessKey()); - } - - public ListManager getPublisherAssertions() - { - return publisherAssertions_; - } - - public void setPublisherAssertions(ListManager listManager) - { - publisherAssertions_ = listManager; - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/CategoryElement.java b/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/CategoryElement.java deleted file mode 100644 index b111b246f..000000000 --- a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/CategoryElement.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.ws.internal.explorer.platform.uddi.datamodel; - -import org.eclipse.wst.ws.internal.datamodel.Model; -import org.uddi4j.util.KeyedReference; - -public class CategoryElement extends AbstractUDDIElement -{ - private KeyedReference category_; - - public CategoryElement(String name,KeyedReference category,Model model) - { - super(name,model); - category_ = category; - saveCategoryProperties(); - } - - private final void saveCategoryProperties() - { - if (category_ != null) - { - String keyName = category_.getKeyName(); - if (keyName != null) - setName(keyName); - } - } - - public final KeyedReference getCategory() - { - return category_; - } - - public final String getNameForTree() - { - StringBuffer nameForTree = new StringBuffer("["); - nameForTree.append(category_.getKeyValue()).append("] ").append(category_.getKeyName()); - return nameForTree.toString(); - } - - public final void updateCategory(String keyName,String keyValue,String tModelKey) - { - category_.setKeyName(keyName); - category_.setKeyValue(keyValue); - category_.setTModelKey(tModelKey); - saveCategoryProperties(); - } -} diff --git a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/CategoryModel.java b/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/CategoryModel.java deleted file mode 100644 index aa4d07cbd..000000000 --- a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/CategoryModel.java +++ /dev/null @@ -1,569 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.ws.internal.explorer.platform.uddi.datamodel; - -import java.io.BufferedReader; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.io.UnsupportedEncodingException; -import java.text.ParseException; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.Properties; -import java.util.Vector; -import javax.servlet.ServletContext; -import org.eclipse.wst.ws.internal.datamodel.BasicModel; -import org.eclipse.wst.ws.internal.datamodel.Element; -import org.eclipse.wst.ws.internal.explorer.platform.constants.ModelConstants; -import org.eclipse.wst.ws.internal.explorer.platform.uddi.constants.UDDIModelConstants; -import org.eclipse.wst.ws.internal.explorer.platform.util.HTMLUtils; -import org.eclipse.wst.ws.internal.model.v10.taxonomy.Category; -import org.eclipse.wst.ws.internal.model.v10.taxonomy.Taxonomy; -import org.uddi4j.util.KeyedReference; - -public class CategoryModel extends BasicModel -{ - private ServletContext application_; - private String defaultDataFile_; - private Hashtable categoryElements_; - private String columnDelimiter_; - private String stringDelimiter_; - private String categoryKey_; - private boolean checked_; - private String displayName_; - private String tModelKey_; - private Throwable errorException_; - - // Return codes for loading and saving category data. - public static final byte OPERATION_SUCCESSFUL = 0x00; - public static final byte ERROR_FILE = 0x01; - public static final byte ERROR_SECURITY = 0x02; - public static final byte ERROR_ENCODING = 0x03; - public static final byte ERROR_IO = 0x04; - public static final byte ERROR_CATEGORY_KEY = 0x05; - - private final String defaultColumnDelimiter_ = "#"; - private final String defaultStringDelimiter_ = "\""; - - public CategoryModel() - { - super("categories"); - application_ = null; - defaultDataFile_ = null; - columnDelimiter_ = defaultColumnDelimiter_; - stringDelimiter_ = defaultStringDelimiter_; - categoryElements_ = null; - categoryKey_ = null; - checked_ = true; - displayName_ = null; - tModelKey_ = null; - errorException_ = null; - } - - /** - * CategoryModels load their data from the file named via the - * {@link #setDefaultDataFile(String)} method. The data file - * name is interpretted as either a physical pathname or a - * context-root relative pathname depending on whether the - * servlet context or "application" is null (default) or not. - * @param application The application context, null by default. - * Value can be the ServletContext of the WSExplorer or null. - */ - public final void setServletContext(ServletContext application) - { - application_ = application; - } - - public final void setDefaultDataFile(String defaultDataFile) - { - defaultDataFile_ = defaultDataFile; - } - - public final void setCategoryKey(String categoryKey) - { - categoryKey_ = categoryKey; - } - - public final String getCategoryKey() - { - return categoryKey_; - } - - public final void setColumnDelimiter(String columnDelimiter) - { - columnDelimiter_ = columnDelimiter; - } - - public final String getColumnDelimiter() - { - return columnDelimiter_; - } - - public final void setStringDelimiter(String stringDelimiter) - { - stringDelimiter_ = stringDelimiter; - } - - public final String getStringDelimiter() - { - return stringDelimiter_; - } - - public final void enableChecked(boolean isChecked) - { - checked_ = isChecked; - } - - public final boolean isChecked() - { - return checked_; - } - - public final void setDisplayName(String displayName) - { - displayName_ = displayName; - } - - public final String getDisplayName() - { - return displayName_; - } - - public final void setTModelKey(String tModelKey) - { - tModelKey_ = tModelKey; - } - - public final String getTModelKey() - { - return tModelKey_; - } - - public final boolean isDataLoaded() - { - return (categoryElements_ != null); - } - - public final Throwable getErrorException() - { - return errorException_; - } - - private final boolean isEnclosedInQuotes(String string) - { - return string.startsWith("\"") && string.endsWith("\""); - } - - public final void loadFromTaxonomy(Taxonomy taxonomy) - { - String name = taxonomy.getName(); - CategoryElement root = new CategoryElement(name,null,this); - setRootElement(root); - categoryElements_ = new Hashtable(); - for (Iterator it = taxonomy.getCategory().iterator(); it.hasNext();) - { - addCategory(root, (Category)it.next()); - } - } - - private void addCategory(CategoryElement parent, Category category) - { - String keyName = category.getName(); - String keyValue = category.getCode(); - CategoryElement child = new CategoryElement(keyName,new KeyedReference(keyName,keyValue,tModelKey_),this); - parent.connect(child,UDDIModelConstants.REL_SUBCATEGORIES,ModelConstants.REL_OWNER); - categoryElements_.put(keyValue, child); - for (Iterator it = category.getCategory().iterator(); it.hasNext();) - { - addCategory(child, (Category)it.next()); - } - } - - public final byte loadFromDefaultDataFile() - { - try - { - if (defaultDataFile_ == null) - throw new FileNotFoundException(); - BufferedReader br = null; - if (application_ == null) - br = new BufferedReader(new InputStreamReader(new FileInputStream(defaultDataFile_),HTMLUtils.UTF8_ENCODING)); - else - br = new BufferedReader(new InputStreamReader(application_.getResourceAsStream(defaultDataFile_),HTMLUtils.UTF8_ENCODING)); - return loadData(br); - } - catch (FileNotFoundException e) - { - errorException_ = e; - return ERROR_FILE; - } - catch (SecurityException e) - { - errorException_ = e; - return ERROR_SECURITY; - } - catch (UnsupportedEncodingException e) - { - errorException_ = e; - return ERROR_ENCODING; - } - } - - public final byte loadFromDelimiterFile() - { - // Get the associated .properties file and set the delimiters. The defaultDataFile_ is set to the delimiter file in this case. - // The properties file contains the following keys: - // wsad.dataFile - location of the category data file. - // wsad.checked - whether or not the category is checked. - // wsad.name - the display name of the category. - // column.delimiter - the delimiter character used for separating columns. - // string.delimiter - the delimiter character used to encapsulate data such that column delimiter characters are treated as data. - try - { - Properties p = new Properties(); - InputStream fin = null; - if (application_ == null) - fin = new FileInputStream(defaultDataFile_); - else - fin = application_.getResourceAsStream(defaultDataFile_); - p.load(fin); - fin.close(); - columnDelimiter_ = p.getProperty("column.delimiter"); - stringDelimiter_ = p.getProperty("string.delimiter"); - defaultDataFile_ = p.getProperty("wsad.dataFile"); - return loadFromDefaultDataFile(); - } - catch (FileNotFoundException e) - { - errorException_ = e; - return ERROR_FILE; - } - catch (SecurityException e) - { - errorException_ = e; - return ERROR_SECURITY; - } - catch (IOException e) - { - errorException_ = e; - return ERROR_IO; - } - } - - public final byte loadData(BufferedReader br) - { - errorException_ = null; - CategoryElement rootElement = null; - categoryElements_ = new Hashtable(); - byte returnCode = OPERATION_SUCCESSFUL; - String line = null; - int lineNumber = 0; - try - { - char columnDelimiterChar = columnDelimiter_.charAt(0); - char stringDelimiterChar = stringDelimiter_.charAt(0); - Vector values = new Vector(); - while((line = br.readLine()) != null) - { - lineNumber++; - // Ignore blank lines. - if (line.trim().length() == 0) - continue; - int index = 0; - int length = line.length(); - boolean inStringDelimiters = false; - values.removeAllElements(); - StringBuffer currentToken = new StringBuffer(); - while (index < length) - { - char currentChar = line.charAt(index); - if (inStringDelimiters) - { - // In quote so ignoring delimiters - if (currentChar == stringDelimiterChar) - { - if (index < length - 1) - { - // currentChar could be a closing string delimiter or escape - // Need to look ahead to be sure... - char followingChar = line.charAt(index + 1); - if (followingChar == stringDelimiterChar) - { - // There is an escaped quote - currentToken.append(stringDelimiterChar); - // jump forward two characters. - index += 2; - } - else - { - // There was a closing string delimiter...jump forward to the next delimiter - inStringDelimiters = false; - //look for the next column delimiter character - int nextDelimiter = line.indexOf(columnDelimiterChar, index); - if (nextDelimiter == -1) - { - // There were no more delimiters so break out of the loop - break; - } - else - { - values.addElement(currentToken.toString()); - //values[tokenCount++] = currentToken.toString(); - currentToken.setLength(0); - inStringDelimiters = false; - index = nextDelimiter + 1; - } - } - } - else - { - // This is the last character and it's a closing string delimiter. - index++; - inStringDelimiters = false; - } - } - else - { - currentToken.append(currentChar); - index++; - } - } - else if (currentChar == columnDelimiterChar) - { - // There was a delimiter outside of quotes - values.addElement(currentToken.toString()); - //values[tokenCount++] = currentToken.toString(); - currentToken.setLength(0); - index++; - } - else if (currentChar == stringDelimiterChar) - { - // A quote appearing outside of quotes must be a opening quote - inStringDelimiters = true; - index++; - } - else - { - // There is a normal char outside of quotes - currentToken.append(currentChar); - index++; - } - } - // Expect token count to be values.length - 1 at this point if everything is ok - if (inStringDelimiters) - { - br.close(); - throw new ParseException(line,lineNumber); - } - - // Add the final token. - values.addElement(currentToken.toString()); - - // 3 columns format. From left to right, these are: - // 1) category's key value - // 2) category's key name - // 3) category's parent key value - // Convert to 4 columns format. - if (values.size() == 3) - { - if (categoryKey_ != null) - values.insertElementAt(categoryKey_, 0); - else - values.insertElementAt(tModelKey_, 0); - } - - // 4 columns format. From left to right, these are: - // 1) type of category (categoryKey) - // 2) category's key value - // 3) category's key name - // 4) category's parent key value - if (values.size() == 4) - { - String categoryKey = (String)values.elementAt(0); - if (categoryKey_ == null) - categoryKey_ = categoryKey; - else if (!categoryKey_.equals(categoryKey)) - throw new Exception(categoryKey); - String keyValue = (String)values.elementAt(1); - String keyName = (String)values.elementAt(2); - String parentKeyValue = (String)values.elementAt(3); - if (rootElement == null) - { - rootElement = new CategoryElement(displayName_,null,this); - setRootElement(rootElement); - } - if (isEnclosedInQuotes(keyName)) - keyName = keyName.substring(1,keyName.length()-1); - // Check if the CategoryElement already exists. If it does, refresh the Category. - CategoryElement categoryElement = (CategoryElement)categoryElements_.get(keyValue); - if (categoryElement != null) - categoryElement.updateCategory(keyName,keyValue,tModelKey_); - else - categoryElement = new CategoryElement(keyName,new KeyedReference(keyName,keyValue,tModelKey_),this); - Element parentElement; - if (parentKeyValue.equals(keyValue)) - parentElement = rootElement; - else - parentElement = (Element)categoryElements_.get(parentKeyValue); - if (parentElement == null) - { - parentElement = new CategoryElement("temp",new KeyedReference("",parentKeyValue,tModelKey_),this); - categoryElements_.put(parentKeyValue,parentElement); - } - else - parentElement.connect(categoryElement,UDDIModelConstants.REL_SUBCATEGORIES,ModelConstants.REL_OWNER); - categoryElements_.put(keyValue,categoryElement); - } - else - { - br.close(); - throw new ParseException(line,lineNumber); - } - } - br.close(); - return returnCode; - } - catch (IOException e) - { - errorException_ = e; - returnCode = ERROR_IO; - } - catch (ParseException e) - { - errorException_ = e; - returnCode = ERROR_FILE; - } - catch (Exception e) - { - errorException_ = e; - returnCode = ERROR_CATEGORY_KEY; - } - categoryElements_ = null; - return returnCode; - } - - private final void saveData(PrintWriter pw,CategoryElement categoryElement,CategoryElement parentElement,boolean isFirst) - { - // File format: - // <categoryKey>#<keyValue>#<keyName>#<parentKeyValue> - KeyedReference kr = categoryElement.getCategory(); - // Check if this is not the root element. - if (kr != null) - { - String keyName = kr.getKeyName(); - String keyValue = kr.getKeyValue(); - String parentKeyValue; - if (parentElement == null) - parentKeyValue = keyValue; - else - { - KeyedReference parentKr = parentElement.getCategory(); - // Check if the parent is the root element. - if (parentKr == null) - parentKeyValue = keyValue; - else - parentKeyValue = parentKr.getKeyValue(); - } - if (!isFirst) - pw.println(); - else - isFirst = false; - pw.print(mangle(categoryKey_)); - pw.print(columnDelimiter_); - pw.print(mangle(keyValue)); - pw.print(columnDelimiter_); - pw.print(mangle(keyName)); - pw.print(columnDelimiter_); - pw.print(mangle(parentKeyValue)); - } - Enumeration e = categoryElement.getElements(UDDIModelConstants.REL_SUBCATEGORIES); - if (e != null) - { - while (e.hasMoreElements()) - saveData(pw,(CategoryElement)e.nextElement(),categoryElement,isFirst); - } - } - - // Mangle an input string if it contains default column delimiter characters by surrounding it with the string delimiters. - private final String mangle(String input) - { - if (input != null && input.indexOf(columnDelimiter_) != -1) - { - StringBuffer s = new StringBuffer(input); - s.insert(0,stringDelimiter_).append(stringDelimiter_); - return s.toString(); - } - return input; - } - - public final byte saveData(String fileName) - { - // The fileName should already be URLEncoded. - byte returnCode = OPERATION_SUCCESSFUL; - errorException_ = null; - if (isDataLoaded()) - { - try - { - PrintWriter pw = new PrintWriter(new OutputStreamWriter(new FileOutputStream(fileName),HTMLUtils.UTF8_ENCODING),true); - CategoryElement rootElement = (CategoryElement)getRootElement(); - saveData(pw,rootElement,null,true); - pw.flush(); - pw.close(); - // Save the properties file. - Properties p = new Properties(); - p.setProperty("wsad.dataFile",fileName); - p.setProperty("wsad.checked",String.valueOf(checked_)); - p.setProperty("wsad.name",displayName_); - p.setProperty("column.delimiter",columnDelimiter_); - p.setProperty("string.delimiter",stringDelimiter_); - StringBuffer propertiesFileName = new StringBuffer(fileName.substring(0,fileName.lastIndexOf('.'))); - propertiesFileName.append(".properties"); - FileOutputStream fout = new FileOutputStream(propertiesFileName.toString()); - p.store(fout,null); - fout.close(); - } - catch (FileNotFoundException e) - { - errorException_ = e; - returnCode = ERROR_FILE; - } - catch (SecurityException e) - { - errorException_ = e; - returnCode = ERROR_SECURITY; - } - catch (UnsupportedEncodingException e) - { - errorException_ = e; - returnCode = ERROR_ENCODING; - } - catch (IOException e) - { - errorException_ = e; - returnCode = ERROR_IO; - } - } - return returnCode; - } - - public String toString() - { - return displayName_; - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/PublishedItemsElement.java b/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/PublishedItemsElement.java deleted file mode 100644 index f24b27c8b..000000000 --- a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/PublishedItemsElement.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.ws.internal.explorer.platform.uddi.datamodel; - -import java.util.Enumeration; -import org.eclipse.wst.ws.internal.datamodel.Model; -import org.eclipse.wst.ws.internal.explorer.platform.constants.ModelConstants; -import org.eclipse.wst.ws.internal.explorer.platform.uddi.constants.UDDIModelConstants; - -public class PublishedItemsElement extends AbstractUDDIElement -{ - public PublishedItemsElement(int type,String name,Model model) - { - super(name,model); - setPropertyAsString(ModelConstants.REL_CHILDREN,UDDIModelConstants.REL_PUBLISHED_ITEMS); - setPropertyAsString(UDDIModelConstants.QUERY_TYPE,String.valueOf(type)); - } - - public final int getType() - { - return Integer.parseInt(getPropertyAsString(UDDIModelConstants.QUERY_TYPE)); - } - - public Enumeration getItems() - { - return getElements(UDDIModelConstants.REL_PUBLISHED_ITEMS); - } -} diff --git a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/PublisherAssertionElement.java b/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/PublisherAssertionElement.java deleted file mode 100644 index eac7d6154..000000000 --- a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/PublisherAssertionElement.java +++ /dev/null @@ -1,111 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.wst.ws.internal.explorer.platform.uddi.datamodel; - -import org.eclipse.wst.ws.internal.explorer.platform.datamodel.ListElement; -import org.uddi4j.datatype.assertion.PublisherAssertion; -import org.uddi4j.util.KeyedReference; - -public class PublisherAssertionElement { - - // owningBusinessKey_ is the key of the business element that owns this - // publisherAssertionElement - private String fromKey_; - private String toKey_; - private String owningBusinessKey_; - - // the other business that the containing business is asserted from or to - private ListElement sp_; - private int subQueryItemId_; - - // status of this publisherAssertion - private String status_; - private KeyedReference keyedReference_; - - public PublisherAssertionElement(String fromKey, String toKey, String owningBusinessKey, ListElement sp, int subQueryItemId, String status, KeyedReference keyedRef) { - fromKey_ = fromKey; - toKey_ = toKey; - owningBusinessKey_ = owningBusinessKey; - sp_ = sp; - subQueryItemId_ = subQueryItemId; - status_ = status; - keyedReference_ = keyedRef; - } - - public void setFromKey(String fromKey) { - fromKey_ = fromKey; - } - - public String getFromKey() { - return fromKey_; - } - - public void setToKey(String toKey) { - toKey_ = toKey; - } - - public String getToKey() { - return toKey_; - } - - public void setOwningBusinessKey(String key) { - owningBusinessKey_ = key; - } - - public String getOwningBusinessKey() { - return owningBusinessKey_; - } - - public void setServiceProvider(ListElement sp) { - sp_ = sp; - } - - public ListElement getServiceProvider() { - return sp_; - } - - public void setSubQueryItemId(int id) { - subQueryItemId_ = id; - } - - public int getSubQueryItemId() { - return subQueryItemId_; - } - - public void setStatus(String status) { - status_ = status; - } - - public String getStatus() { - return status_; - } - - public void setKeyedRef(KeyedReference keyedRef) { - keyedReference_ = keyedRef; - } - - public KeyedReference getKeyedRef() { - return keyedReference_; - } - - public PublisherAssertion getPublisherAssertion() { - if (fromKey_ == null || - toKey_ == null || - keyedReference_ == null) { - return null; - } - - PublisherAssertion pubAssertion = new PublisherAssertion(fromKey_, toKey_, keyedReference_); - return pubAssertion; - } - -} diff --git a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/QueryElement.java b/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/QueryElement.java deleted file mode 100644 index 59bed5068..000000000 --- a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/QueryElement.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.ws.internal.explorer.platform.uddi.datamodel; - -import java.util.Vector; -import org.eclipse.wst.ws.internal.datamodel.Model; -import org.eclipse.wst.ws.internal.explorer.platform.constants.ModelConstants; -import org.eclipse.wst.ws.internal.explorer.platform.uddi.constants.UDDIActionInputs; -import org.eclipse.wst.ws.internal.explorer.platform.uddi.constants.UDDIModelConstants; -import org.uddi4j.datatype.business.BusinessEntity; -import org.uddi4j.datatype.service.BusinessService; -import org.uddi4j.datatype.tmodel.TModel; - -public class QueryElement extends AbstractUDDIElement -{ - private final void initQueryProperties(int itemType,Object[] results) - { - Vector resultsVector = new Vector(); - for (int i=0;i<results.length;i++) - resultsVector.addElement(results[i]); - setPropertyAsString(ModelConstants.REL_CHILDREN,UDDIModelConstants.REL_QUERY_RESULTS); - setPropertyAsObject(UDDIModelConstants.INITIAL_RESULTS,resultsVector); - setPropertyAsString(UDDIModelConstants.QUERY_TYPE,String.valueOf(itemType)); - } - - public QueryElement(BusinessEntity[] spList,String name,Model model) - { - super(name,model); - initQueryProperties(UDDIActionInputs.QUERY_ITEM_BUSINESSES,spList); - } - - public QueryElement(BusinessService[] bsList,String name,Model model) - { - super(name,model); - initQueryProperties(UDDIActionInputs.QUERY_ITEM_SERVICES,bsList); - } - - public QueryElement(TModel[] tModelList,String name,Model model) - { - super(name,model); - initQueryProperties(UDDIActionInputs.QUERY_ITEM_SERVICE_INTERFACES,tModelList); - } - - public int getQueryType() - { - return Integer.parseInt(getPropertyAsString(UDDIModelConstants.QUERY_TYPE)); - } - - public QueryParentElement getQueryParentElement() - { - return (QueryParentElement)getParentElement(); - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/QueryParentElement.java b/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/QueryParentElement.java deleted file mode 100644 index c2d822c44..000000000 --- a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/QueryParentElement.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.ws.internal.explorer.platform.uddi.datamodel; - -import java.util.Enumeration; -import org.eclipse.wst.ws.internal.datamodel.Model; -import org.eclipse.wst.ws.internal.explorer.platform.constants.ModelConstants; -import org.eclipse.wst.ws.internal.explorer.platform.uddi.constants.UDDIModelConstants; - -public class QueryParentElement extends AbstractUDDIElement -{ - public QueryParentElement(String name,Model model) - { - super(name,model); - setPropertyAsString(ModelConstants.REL_CHILDREN,UDDIModelConstants.REL_QUERIES); - } - - public Enumeration getQueries() - { - return getElements(UDDIModelConstants.REL_QUERIES); - } -} diff --git a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/RegistryElement.java b/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/RegistryElement.java deleted file mode 100644 index ee23fd5d1..000000000 --- a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/RegistryElement.java +++ /dev/null @@ -1,299 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060427 136449 brunssen@us.ibm.com - Vince Brunssen - * 20060912 141796 gilberta@ca.ibm.com - Gilbert Andrews - *******************************************************************************/ -package org.eclipse.wst.ws.internal.explorer.platform.uddi.datamodel; - -import java.net.MalformedURLException; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.wst.ws.internal.datamodel.Model; -import org.eclipse.wst.ws.internal.explorer.platform.uddi.constants.UDDIModelConstants; -import org.eclipse.wst.ws.internal.model.v10.registry.Registry; -import org.eclipse.wst.ws.internal.model.v10.taxonomy.Taxonomy; -import org.eclipse.wst.ws.internal.model.v10.uddiregistry.UDDIRegistry; -import org.eclipse.wst.ws.internal.parser.discovery.NetUtils; -import org.eclipse.wst.ws.internal.registry.IRegistryManager; -import org.eclipse.wst.ws.internal.registry.RegistryService; -import org.eclipse.wst.ws.internal.registry.UDDIRegistryService; -import org.uddi4j.UDDIException; -import org.uddi4j.client.UDDIProxy; -import org.uddi4j.datatype.Description; -import org.uddi4j.datatype.service.BusinessService; -import org.uddi4j.response.AuthToken; -import org.uddi4j.transport.TransportException; - -public class RegistryElement extends AbstractUDDIElement -{ - private final long AUTH_INFO_TIMEOUT = 3000000; - private UDDIProxy proxy_; - private long authTokenTimestamp_; - private AuthToken authToken_; - private String id_; - private String password_; - private String inquiryURL_; - private String publishURL_; - private String cachedPublishURL_; - private String registrationURL_; - private Hashtable userDefinedCategories_; - private boolean checkForUserDefinedCategories_; - private String categoriesDirectory_; - - public RegistryElement(UDDIProxy proxy, String inquiryURL, String name, Model model) - { - super(name, model); - proxy_ = proxy; - inquiryURL_ = inquiryURL; - publishURL_ = null; - authTokenTimestamp_ = -1; - authToken_ = null; - id_ = null; - password_ = null; - cachedPublishURL_ = null; - registrationURL_ = null; - userDefinedCategories_ = null; - checkForUserDefinedCategories_ = false; - categoriesDirectory_ = null; - } - - public final UDDIProxy getProxy() - { - return proxy_; - } - - public final String getInquiryURL() - { - return inquiryURL_; - } - - public final QueryParentElement getQueryParentElement() - { - return (QueryParentElement) (getElements(UDDIModelConstants.REL_QUERIES_PARENT).nextElement()); - } - - public final PublishedItemsElement getPublishedBusinessesElement() - { - return (PublishedItemsElement) (getElements(UDDIModelConstants.REL_PUBLISHED_BUSINESSES_PARENT).nextElement()); - } - - public final PublishedItemsElement getPublishedServicesElement() - { - return (PublishedItemsElement) (getElements(UDDIModelConstants.REL_PUBLISHED_SERVICES_PARENT).nextElement()); - } - - public final PublishedItemsElement getPublishedServiceInterfacesElement() - { - return (PublishedItemsElement) (getElements(UDDIModelConstants.REL_PUBLISHED_SERVICE_INTERFACES_PARENT).nextElement()); - } - - public final void performLogin(String publishURL, String userId, String password) throws TransportException, UDDIException, MalformedURLException - { - publishURL_ = publishURL; - proxy_.setPublishURL(NetUtils.createURL(publishURL)); - authToken_ = proxy_.get_authToken(userId, password); - authTokenTimestamp_ = System.currentTimeMillis(); - id_ = userId; - password_ = password; - } - - public final void performLogout() throws TransportException, UDDIException - { - proxy_.discard_authToken(authToken_.getAuthInfoString()); - } - - public final String getAuthInfoString() - { - if (!isLoggedIn()) - return null; - if ((System.currentTimeMillis() - authTokenTimestamp_) > AUTH_INFO_TIMEOUT) - { - try - { - authToken_ = proxy_.get_authToken(id_, password_); - authTokenTimestamp_ = System.currentTimeMillis(); - } - catch (Throwable t) - { - } - } - return authToken_.getAuthInfoString(); - } - - public final boolean isLoggedIn() - { - return authToken_ != null; - } - - public final void setCachedPublishURL(String publishURL) - { - cachedPublishURL_ = publishURL; - } - - public final String getPublishURL() - { - if (isLoggedIn() && publishURL_ != null) - return publishURL_; - return cachedPublishURL_; - } - - public final void setRegistrationURL(String registrationURL) - { - registrationURL_ = registrationURL; - } - - public final String getRegistrationURL() - { - return registrationURL_; - } - - public final String getUserId() - { - return id_; - } - - public final void setUserId(String userId) - { - id_ = userId; - } - - public final String getCred() - { - return password_; - } - - public final void setCred(String cred) - { - password_ = cred; - } - - public final void setUserDefinedCategories(Hashtable userDefinedCategories) - { - userDefinedCategories_ = userDefinedCategories; - } - - public final Enumeration getUserDefinedCategories() - { - if (userDefinedCategories_ != null) - return userDefinedCategories_.elements(); - else - return null; - } - - public final CategoryModel getUserDefinedCategory(String tModelKey) - { - return (CategoryModel) userDefinedCategories_.get(tModelKey); - } - - // Special handler to be invoked before sending a message to the registry. - public final void handlePreInvocation(BusinessService busService) - { - // For XMethods, business services must contain a description of the form: - // IMPLEMENTATION: ibmws - if (getInquiryURL().equals("http://uddi.xmethods.net/inquire")) - { - Vector descriptionVector = busService.getDescriptionVector(); - if (descriptionVector == null) - descriptionVector = new Vector(); - boolean containsImplementationDescription = false; - for (int i = 0; i < descriptionVector.size(); i++) - { - Description description = (Description) descriptionVector.elementAt(i); - if (description.getText().startsWith("IMPLEMENTATION: ")) - { - containsImplementationDescription = true; - break; - } - } - if (!containsImplementationDescription) - { - descriptionVector.addElement(new Description("IMPLEMENTATION: ibmws")); - busService.setDescriptionVector(descriptionVector); - } - } - } - - public final void setCheckForUserDefinedCategories(boolean checkForUserDefinedCategories) - { - checkForUserDefinedCategories_ = checkForUserDefinedCategories; - } - - public final boolean getCheckForUserDefinedCategories() - { - return checkForUserDefinedCategories_; - } - - public final void setCategoriesDirectory(String directory) - { - categoriesDirectory_ = directory; - } - - public final String getCategoriesDirectory() - { - return categoriesDirectory_; - } - - public void refreshMeta(){ - - RegistryService regService = RegistryService.instance(); - IRegistryManager regManager = regService.getDefaultRegistryManager(); - - - try - { - regManager.refreshManager(); - String[] regURIs = regManager.getRegistryURIs(); - for (int i = 0; i < regURIs.length; i++) - { - Registry reg = regManager.loadRegistry(regURIs[i]); - if (reg instanceof UDDIRegistry) - { - UDDIRegistry uddiReg = (UDDIRegistry)reg; - if(uddiReg.getDiscoveryURL().equals(getInquiryURL())){ - - - - Taxonomy[] taxonomies = regManager.loadTaxonomies(UDDIRegistryService.instance().getTaxonomyURIs(uddiReg)); - if (taxonomies != null) - { - Hashtable taxonomyTable = new Hashtable(); - for (int j=0; j<taxonomies.length; j++) - { - Taxonomy taxonomy = taxonomies[j]; - String name = taxonomy.getName(); - String tmodelKey = taxonomy.getTmodelKey(); - CategoryModel catModel = new CategoryModel(); - catModel.setDisplayName(name); - catModel.setCategoryKey(name); - catModel.setTModelKey(tmodelKey); - catModel.loadFromTaxonomy(taxonomy); - taxonomyTable.put(tmodelKey, catModel); - } - - setUserDefinedCategories(taxonomyTable); - } - } - - } - - } - }catch (CoreException ce) - { - // TODO: Better error reporting - ce.printStackTrace(); - } - } - -}
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/ServiceElement.java b/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/ServiceElement.java deleted file mode 100644 index cc10e2c00..000000000 --- a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/ServiceElement.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.ws.internal.explorer.platform.uddi.datamodel; - -import org.eclipse.wst.ws.internal.datamodel.Model; -import org.uddi4j.datatype.service.BusinessService; - -public class ServiceElement extends AbstractUDDIElement -{ - private BusinessService bs_; - - public ServiceElement(BusinessService bs,Model model) - { - super(bs.getDefaultNameString(),model); - setKey(bs.getServiceKey()); - bs_ = bs; - } - - public final BusinessService getBusinessService() - { - return bs_; - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/ServiceInterfaceElement.java b/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/ServiceInterfaceElement.java deleted file mode 100644 index 108142d3b..000000000 --- a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/ServiceInterfaceElement.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.ws.internal.explorer.platform.uddi.datamodel; - -import org.eclipse.wst.ws.internal.datamodel.Model; -import org.uddi4j.datatype.tmodel.TModel; - -public class ServiceInterfaceElement extends AbstractUDDIElement -{ - private TModel tModel_; - - public ServiceInterfaceElement(TModel tModel,Model model) - { - super(tModel.getNameString(),model); - tModel_ = tModel; - setKey(tModel.getTModelKey()); - } - - public final TModel getTModel() - { - return tModel_; - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/UDDIMainElement.java b/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/UDDIMainElement.java deleted file mode 100644 index ef72f68dd..000000000 --- a/bundles/org.eclipse.wst.ws.explorer/wsexplorer-src/org/eclipse/wst/ws/internal/explorer/platform/uddi/datamodel/UDDIMainElement.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.wst.ws.internal.explorer.platform.uddi.datamodel; - -import java.util.Hashtable; -import org.eclipse.wst.ws.internal.datamodel.Model; -import org.eclipse.wst.ws.internal.explorer.platform.datamodel.TreeElement; - -public class UDDIMainElement extends TreeElement -{ - private Hashtable registryNames_; - - public UDDIMainElement(String name,Model model) - { - super(name,model); - registryNames_ = new Hashtable(); - } - - public final boolean containsRegistryName(String name) - { - return (registryNames_.get(name) != null); - } - - public final void addRegistryName(String name) - { - registryNames_.put(name,Boolean.TRUE); - } - - public final void removeRegistryName(String name) - { - registryNames_.remove(name); - } - - public final void clearRegistryNames() - { - registryNames_.clear(); - } -} |