diff options
Diffstat (limited to '')
4 files changed, 183 insertions, 0 deletions
diff --git a/branches/sca-java-1.x/modules/domain-manager/src/main/resources/DomainManager.composite b/branches/sca-java-1.x/modules/domain-manager/src/main/resources/DomainManager.composite index ba57ea45d1..d9b0939517 100644 --- a/branches/sca-java-1.x/modules/domain-manager/src/main/resources/DomainManager.composite +++ b/branches/sca-java-1.x/modules/domain-manager/src/main/resources/DomainManager.composite @@ -29,6 +29,13 @@ </service> </component> + <component name="SearchPage"> + <t:implementation.widget location="search.html"/> + <service name="Widget"> + <t:binding.http uri="http://localhost:9990/ui/search"/> + </service> + </component> + <component name="HomeGadget"> <t:implementation.widget location="home-gadget.html"/> <service name="Widget"> @@ -247,6 +254,29 @@ <reference name="cloudCollection" target="CloudCollectionComponent/LocalItemCollection"/> <reference name="processCollection" target="NodeProcessCollectionComponent/LocalItemCollection"/> </component> + + <component name="SearchGadget"> + <t:implementation.widget location="search-gadget.html"/> + <service name="Widget"> + <t:binding.http uri="http://localhost:9990/ui/search-gadget"/> + </service> + <reference name="searcher" target="SearcherCollectionComponent/ItemCollection"> + <t:binding.atom/> + </reference> + + </component> + + <component name="SearcherCollectionComponent"> + <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.Searcher"/> + + <service name="ItemCollection"> + <t:binding.atom uri="http://localhost:9990/search" title="Search"/> + </service> + + <reference name="domainSearch" target="DomainSearchComponent"/> + <reference name="contributionCollection" target="ContributionCollectionComponent/WorkspaceReader"/> + + </component> <component name="NodeProcessCollectionFacadeComponent"> <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.NodeProcessCollectionFacadeImpl"/> @@ -258,6 +288,7 @@ <reference name="processCollection" target="NodeProcessCollectionComponent/ItemCollection"> <t:binding.atom/> </reference> + </component> <component name="NodeProcessCollectionComponent"> @@ -277,5 +308,9 @@ <component name="DomainManagerConfigurationComponent"> <implementation.java class="org.apache.tuscany.sca.domain.manager.impl.DomainManagerConfigurationImpl"/> </component> + + <component name="DomainSearchComponent"> + <implementation.java class="org.apache.tuscany.sca.domain.search.impl.DomainSearchImpl"/> + </component> </composite> diff --git a/branches/sca-java-1.x/modules/domain-manager/src/main/resources/composite-gadget.html b/branches/sca-java-1.x/modules/domain-manager/src/main/resources/composite-gadget.html index ce1039d9e5..3af9c3f725 100644 --- a/branches/sca-java-1.x/modules/domain-manager/src/main/resources/composite-gadget.html +++ b/branches/sca-java-1.x/modules/domain-manager/src/main/resources/composite-gadget.html @@ -65,6 +65,7 @@ var gadget = gadget(window, document); if (gadget.showContributions == null) { gadget.showContributions = true; + } var domainCompositeForm = elementByID(gadget, 'domainCompositeForm'); diff --git a/branches/sca-java-1.x/modules/domain-manager/src/main/resources/search-gadget.html b/branches/sca-java-1.x/modules/domain-manager/src/main/resources/search-gadget.html new file mode 100644 index 0000000000..df68d9751d --- /dev/null +++ b/branches/sca-java-1.x/modules/domain-manager/src/main/resources/search-gadget.html @@ -0,0 +1,81 @@ +<!-- + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. +--> +<html> + +<head> + +<title>SCA Domain - Domain Composite</title> + +<script type="text/javascript" src="../search-gadget/search-gadget.js"></script> +<script type="text/javascript" src="utils.js"></script> + + + +<link rel="stylesheet" type="text/css" href="manager.css"> + + + +</head> + +<body> + + + <div id="domainSearch"> + + <form id="domainSearchForm"> + + <p style="margin-top:1em;margin-bottom:1em;margin-left:1em;margin-right:1em"> + <input id="searchField" type="text" value="" /> <input id="searchButton" type="button" value="Search" onclick="search()" /> + </p> + + <br> + <br> + <div id="results"></div> + </form> + + </div> +</body> + +<script type="text/javascript"> + + //@Reference + var searcher = new tuscany.sca.Reference("searcher"); + + var gadget = gadget(window, document); + + function search() { + searcher.get(elementByID(gadget, 'searchField').value, searchResponse); + } + + function searchResponse(feed) { + var entries = feed.getElementsByTagName("entry"); + var content = entries[0].getElementsByTagName("content"); + + // alert(content[0].firstChild.data); + + var results = elementByID(gadget, "results"); + results.innerHTML = content[0].firstChild.data; + + } + + elementByID(gadget, 'searchButton').onclick = search + +</script> + +</html> diff --git a/branches/sca-java-1.x/modules/domain-manager/src/main/resources/search.html b/branches/sca-java-1.x/modules/domain-manager/src/main/resources/search.html new file mode 100644 index 0000000000..52309f3256 --- /dev/null +++ b/branches/sca-java-1.x/modules/domain-manager/src/main/resources/search.html @@ -0,0 +1,66 @@ +<!-- + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. +--> +<html> +<head> +<title>SCA Domain - Search</title> + +<script type="text/javascript" src="utils.js"></script> + +<link rel="stylesheet" type="text/css" href="manager.css"> +</head> + +<body> + <div id="toolbarGadgetDiv"></div> + <br> + + <span class=hd1> + SCA Domain<br><br> + Domain Search <a href="/search/"><img src="icons/feed-icon.png" border="0"></a> + </span> + <br> + + <p> + <div id="searchGadgetDiv"></div> + </p> + + <iframe id="toolbarGadget" src="toolbar-gadget.html"></iframe> + <iframe id="searchGadget" src="search-gadget.html"marginwidth="0" marginheight="0" frameborder="0" scrolling="no"></iframe> +</body> + +<script type="text/javascript"> + var toolbarGadgetDiv = elementByID(document, 'toolbarGadgetDiv'); + var searchGadgetDiv = elementByID(document, 'searchGadgetDiv'); + + var toolbarGadget = elementByID(document, 'toolbarGadget'); + var searchGadget = elementByID(document, 'searchGadget'); + + function ongadget(win, doc) { + if (doc == content(toolbarGadget)) { + toolbarGadgetDiv.innerHTML = doc.body.innerHTML; + return toolbarGadgetDiv; + } else if (doc == content(searchGadget)) { + searchGadgetDiv.innerHTML = doc.body.innerHTML; + searchGadgetDiv.showContributions = true; + searchGadgetDiv.showComponents = true; + return searchGadgetDiv; + } + return document; + } +</script> +</html> |