+++ /dev/null
-package org.apache.archiva.rest.api.model;
-/*
- * 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.
- */
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * @author Olivier Lamy
- * @since 1.4-M3
- */
-@XmlRootElement( name = "browseIdEntry" )
-public class BrowseIdEntry
- implements Comparable<BrowseIdEntry>
-{
-
- private String name;
-
- private boolean project;
-
- public BrowseIdEntry()
- {
- // no op
- }
-
- public BrowseIdEntry( String name, boolean project )
- {
- this.name = name;
- this.project = project;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName( String name )
- {
- this.name = name;
- }
-
- public boolean isProject()
- {
- return project;
- }
-
- public void setProject( boolean project )
- {
- this.project = project;
- }
-
- public int compareTo( BrowseIdEntry browseGroupIdEntry )
- {
- return this.name.compareTo( browseGroupIdEntry.name );
- }
-}
@XmlRootElement( name = "browseResult" )
public class BrowseResult
{
- private List<BrowseIdEntry> browseIdEntries;
+ private List<BrowseResultEntry> browseResultEntries;
public BrowseResult()
{
// no op
}
- public BrowseResult( List<BrowseIdEntry> browseIdEntries )
+ public BrowseResult( List<BrowseResultEntry> browseResultEntries )
{
- this.browseIdEntries = browseIdEntries;
+ this.browseResultEntries = browseResultEntries;
}
- public List<BrowseIdEntry> getBrowseIdEntries()
+ public List<BrowseResultEntry> getBrowseResultEntries()
{
- return browseIdEntries == null ? Collections.<BrowseIdEntry>emptyList() : browseIdEntries;
+ return browseResultEntries == null ? Collections.<BrowseResultEntry>emptyList() : browseResultEntries;
}
- public void setBrowseIdEntries( List<BrowseIdEntry> browseIdEntries )
+ public void setBrowseResultEntries( List<BrowseResultEntry> browseResultEntries )
{
- this.browseIdEntries = browseIdEntries;
+ this.browseResultEntries = browseResultEntries;
}
}
--- /dev/null
+package org.apache.archiva.rest.api.model;
+/*
+ * 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.
+ */
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4-M3
+ */
+@XmlRootElement( name = "browseResultEntry" )
+public class BrowseResultEntry
+ implements Comparable<BrowseResultEntry>
+{
+
+ private String name;
+
+ private boolean project;
+
+ public BrowseResultEntry()
+ {
+ // no op
+ }
+
+ public BrowseResultEntry( String name, boolean project )
+ {
+ this.name = name;
+ this.project = project;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName( String name )
+ {
+ this.name = name;
+ }
+
+ public boolean isProject()
+ {
+ return project;
+ }
+
+ public void setProject( boolean project )
+ {
+ this.project = project;
+ }
+
+ public int compareTo( BrowseResultEntry browseGroupResultEntry )
+ {
+ return this.name.compareTo( browseGroupResultEntry.name );
+ }
+}
import org.apache.archiva.metadata.repository.MetadataResolutionException;
import org.apache.archiva.metadata.repository.MetadataResolver;
import org.apache.archiva.metadata.repository.RepositorySession;
-import org.apache.archiva.rest.api.model.BrowseIdEntry;
+import org.apache.archiva.rest.api.model.BrowseResultEntry;
import org.apache.archiva.rest.api.model.BrowseResult;
import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
import org.apache.archiva.rest.api.services.BrowseService;
repositorySession.close();
}
- List<BrowseIdEntry> browseGroupIdEntries = new ArrayList<BrowseIdEntry>( namespaces.size() );
+ List<BrowseResultEntry> browseGroupResultEntries = new ArrayList<BrowseResultEntry>( namespaces.size() );
for ( String namespace : namespaces )
{
- browseGroupIdEntries.add( new BrowseIdEntry( namespace, false ) );
+ browseGroupResultEntries.add( new BrowseResultEntry( namespace, false ) );
}
- Collections.sort( browseGroupIdEntries );
- return new BrowseResult( browseGroupIdEntries );
+ Collections.sort( browseGroupResultEntries );
+ return new BrowseResult( browseGroupResultEntries );
}
public BrowseResult browseGroupId( String groupId )
{
repositorySession.close();
}
- List<BrowseIdEntry> browseGroupIdEntries = new ArrayList<BrowseIdEntry>( namespaces.size() + projects.size() );
+ List<BrowseResultEntry> browseGroupResultEntries = new ArrayList<BrowseResultEntry>( namespaces.size() + projects.size() );
for ( String namespace : namespaces )
{
- browseGroupIdEntries.add( new BrowseIdEntry( namespace, false ) );
+ browseGroupResultEntries.add( new BrowseResultEntry( namespace, false ) );
}
for ( String project : projects )
{
- browseGroupIdEntries.add( new BrowseIdEntry( project, true ) );
+ browseGroupResultEntries.add( new BrowseResultEntry( project, true ) );
}
- Collections.sort( browseGroupIdEntries );
- return new BrowseResult( browseGroupIdEntries );
+ Collections.sort( browseGroupResultEntries );
+ return new BrowseResult( browseGroupResultEntries );
}
.browse-list{
list-style-image: url("../images/folder.png")
+}
+
+.force-upper-case{
+ text-transform: uppercase;
}
\ No newline at end of file
*/
$(function() {
- BrowseViewModel=function(browseIdEntries,parentGroupdId){
- this.browseIdEntries=browseIdEntries;
+ BrowseViewModel=function(browseResultEntries,parentGroupdId){
+ this.browseResultEntries=browseResultEntries;
this.parentGroupdId=parentGroupdId;
displayGroupId=function(groupId){
displayGroupDetail(groupId,"..");
type: "GET",
dataType: 'json',
success: function(data) {
- var browseIdEntries = mapBrowseIdEntries(data);
- $.log("size:"+browseIdEntries.length);
- var browseViewModel = new BrowseViewModel(browseIdEntries);
+ var browseResultEntries = mapbrowseResultEntries(data);
+ $.log("size:"+browseResultEntries.length);
+ var browseViewModel = new BrowseViewModel(browseResultEntries);
ko.applyBindings(browseViewModel,mainContent.get(0));
}
type: "GET",
dataType: 'json',
success: function(data) {
- var browseIdEntries = mapBrowseIdEntries(data);
- var browseViewModel = new BrowseViewModel(browseIdEntries,parentGroupdId);
+ var browseResultEntries = mapbrowseResultEntries(data);
+ var browseViewModel = new BrowseViewModel(browseResultEntries,parentGroupdId);
ko.applyBindings(browseViewModel,mainContent.get(0));
}
$("#main-content" ).html("coming soon :-)");
}
- mapBrowseIdEntries=function(data){
- if (data.browseResult && data.browseResult.browseIdEntries) {
- return $.isArray(data.browseResult.browseIdEntries) ?
- $.map(data.browseResult.browseIdEntries,function(item){
- return new BrowseIdEntry(item.name, item.project);
- }): [data.browseResult.browseIdEntries];
+ mapbrowseResultEntries=function(data){
+ if (data.browseResult && data.browseResult.browseResultEntries) {
+ return $.isArray(data.browseResult.browseResultEntries) ?
+ $.map(data.browseResult.browseResultEntries,function(item){
+ return new BrowseResultEntry(item.name, item.project);
+ }): [data.browseResult.browseResultEntries];
}
return [];
}
- BrowseIdEntry=function(name,project){
+ BrowseResultEntry=function(name,project){
this.name=name;
this.project=project;
}
<div>
<ul>
<li class="browse-list"><a href="#" data-bind="click:function(){displayGroupId($root.parentGroupdId)}">..</a></li>
- {{each(i,browseIdEntry) browseIdEntries}}
+ {{each(i,browseResultEntry) browseResultEntries}}
<li class="browse-list">
- <a href="#" data-bind="click:function(){displayGroupId(browseIdEntry.name)}">
- ${browseIdEntry.name}-project: ${browseIdEntry.project}
+ <a href="#" data-bind="click:function(){displayGroupId(browseResultEntry.name)}">
+ ${browseResultEntry.name} (project: ${browseResultEntry.project})
</a>
</li>
{{/each}}
</li>
<li id="login-link" class="pull-right" style="display: none">
<a href="#" onclick="loginBox();" id="login-link-a">
- <span class="label label-success">${$.i18n.prop('login')}</span>
+ <span class="label label-success force-upper-case">${$.i18n.prop('login')}</span>
</a>
</li>
<li id="change-password-link" class="pull-right" style="">
</li>
<li id="logout-link" class="pull-right" style="display: none">
<a href="#" onclick="logout();" id="logout-link-a">
- <span class="label label-important">${$.i18n.prop('logout')}</span>
+ <span class="label label-important force-upper-case">${$.i18n.prop('logout')}</span>
</a>
</li>
<li id="register-link" class="pull-right" style="display: none">
<a href="#" onclick="registerBox();" id="register-link-a">
- <span class="label label-info">${$.i18n.prop('register')}</span>
+ <span class="label label-info force-upper-case">${$.i18n.prop('register')}</span>
</a>
</li>
<li class="pull-right">