Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
merged changes back in from trunk
Browse files Browse the repository at this point in the history
git-svn-id: file:///opt/svn/repositories/sonatype.org/nexus/branches/nexus-1.8.0@7197 2aa8b3fc-8ebb-4439-a84f-95066eaea8ab
  • Loading branch information
dbradicich committed Sep 16, 2010
1 parent c93e86b commit f087ea5
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package org.sonatype.nexus.tasks;

import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.util.StringUtils;
import org.sonatype.nexus.feeds.FeedRecorder;
import org.sonatype.nexus.proxy.repository.ShadowRepository;
import org.sonatype.nexus.scheduling.AbstractNexusRepositoriesTask;
Expand All @@ -37,12 +38,27 @@ protected String getRepositoryFieldId()

public String getShadowRepositoryId()
{
return getParameter( SynchronizeShadowTaskDescriptor.REPO_FIELD_ID );
return getRepositoryId();
}

public void setShadowRepositoryId( String shadowRepositoryId )
{
getParameters().put( SynchronizeShadowTaskDescriptor.REPO_FIELD_ID, shadowRepositoryId );
setRepositoryId( shadowRepositoryId );
}

@Override
public String getRepositoryId()
{
return getParameters().get( getRepositoryFieldId() );
}

@Override
public void setRepositoryId( String repositoryId )
{
if ( !StringUtils.isEmpty( repositoryId ) )
{
getParameters().put( getRepositoryFieldId(), repositoryId );
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import org.codehaus.plexus.component.annotations.Component;
import org.sonatype.nexus.formfields.FormField;
import org.sonatype.nexus.formfields.RepoOrGroupComboFormField;
import org.sonatype.nexus.formfields.RepoComboFormField;

@Component( role = ScheduledTaskDescriptor.class, hint = "SynchronizeShadow", description = "Synchronize Shadow Repository" )
public class SynchronizeShadowTaskDescriptor
Expand All @@ -28,8 +28,8 @@ public class SynchronizeShadowTaskDescriptor

public static final String REPO_FIELD_ID = "shadowRepositoryId";

private final RepoOrGroupComboFormField repoField =
new RepoOrGroupComboFormField( REPO_FIELD_ID, "Shadow Repository",
private final RepoComboFormField repoField =
new RepoComboFormField( REPO_FIELD_ID, "Shadow Repository",
"Select the repository shadow to assign to this task.", FormField.MANDATORY );

public String getId()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,20 @@ protected String[] getPrincipalsAndCredentials( String scheme, String encoded )
{
String decoded = Base64.decodeToString( encoded );

// no credentials, no auth
if ( StringUtils.isEmpty( encoded ) )
{
return null;
}

String[] parts = decoded.split( ":" );

// invalid credentials, no auth
if ( parts == null || parts.length < 2 )
{
return null;
}

return new String[] { parts[0], decoded.substring( parts[0].length() + 1 ) };
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,9 @@ Sonatype.repoServer.PrivilegeEditor = function(config) {
repositoryGroupId : function(val, fpanel) {
var v = fpanel.form.findField('repositoryOrGroup').getValue();
return v.indexOf('group_') == 0 ? v.substring('group_'.length) : '';
},
type : function(val, fpanel) {
return 'target';
}
}
},
Expand Down Expand Up @@ -413,28 +416,6 @@ Sonatype.repoServer.PrivilegeEditor = function(config) {

if (this.isNew)
{
items.push({
xtype : 'combo',
fieldLabel : 'Type',
itemCls : 'required-field',
helpText : ht.type,
name : 'type',
store : this.privilegeTypeStore,
displayField : 'name',
valueField : 'id',
editable : false,
forceSelection : true,
mode : 'local',
triggerAction : 'all',
emptyText : 'Select...',
selectOnFocus : true,
allowBlank : false,
width : this.COMBO_WIDTH,
value : 'target',
lazyInit : false,
disabled : true
});

// clone the target store
var targetStore2 = new Ext.data.JsonStore({
root : 'data',
Expand Down

0 comments on commit f087ea5

Please sign in to comment.