-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
package org.argeo.slc.client.ui.dist.wizards;
import java.net.URI;
-import java.util.Hashtable;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.SimpleCredentials;
import javax.jcr.nodetype.NodeType;
+import org.argeo.api.NodeUtils;
+import org.argeo.api.security.Keyring;
+import org.argeo.cms.ArgeoNames;
+import org.argeo.cms.ArgeoTypes;
import org.argeo.eclipse.ui.dialogs.ErrorFeedback;
-import org.argeo.jcr.ArgeoJcrConstants;
-import org.argeo.jcr.ArgeoJcrUtils;
-import org.argeo.jcr.ArgeoNames;
-import org.argeo.jcr.ArgeoTypes;
import org.argeo.jcr.JcrUtils;
-import org.argeo.jcr.UserJcrUtils;
import org.argeo.slc.SlcException;
import org.argeo.slc.repo.RepoConstants;
-import org.argeo.util.security.Keyring;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.wizard.Wizard;
// Default values
private final static String DEFAULT_NAME = "Argeo Public Repository";
- private final static String DEFAULT_URI = "http://repo.argeo.org/data/pub/java";
+ private final static String DEFAULT_URI = "https://forge.argeo.org/jcr/java";
private final static String DEFAULT_USER_NAME = "anonymous";
private final static boolean DEFAULT_ANONYMOUS = true;
Session nodeSession = null;
try {
nodeSession = nodeRepository.login();
- String reposPath = UserJcrUtils.getUserHome(nodeSession).getPath() + RepoConstants.REPOSITORIES_BASE_PATH;
+ String reposPath = NodeUtils.getUserHome(nodeSession).getPath() + RepoConstants.REPOSITORIES_BASE_PATH;
Node repos = nodeSession.getNode(reposPath);
String repoNodeName = JcrUtils.replaceInvalidChars(name.getText());
if (uri.getText().startsWith("http")) {// http, https
URI checkedUri = new URI(uri.getText());
String checkedUriStr = checkedUri.toString();
- Hashtable<String, String> params = new Hashtable<String, String>();
- params.put(ArgeoJcrConstants.JCR_REPOSITORY_URI, checkedUriStr);
- Repository repository = ArgeoJcrUtils.getRepositoryByUri(repositoryFactory, checkedUriStr);
- // FIXME make it more generic
- String defaultWorkspace = "main";
+ Repository repository = NodeUtils.getRepositoryByUri(repositoryFactory, checkedUriStr);
if (username.getText().trim().equals("")) {// anonymous
- session = repository.login(defaultWorkspace);
+ session = repository.login(RepoConstants.DEFAULT_DEFAULT_WORKSPACE);
} else {
char[] pwd = password.getTextChars();
SimpleCredentials sc = new SimpleCredentials(username.getText(), pwd);
- session = repository.login(sc, defaultWorkspace);
+ session = repository.login(sc, RepoConstants.DEFAULT_DEFAULT_WORKSPACE);
}
} else {// alias
- Repository repository = ArgeoJcrUtils.getRepositoryByAlias(repositoryFactory, uri.getText());
+ Repository repository = NodeUtils.getRepositoryByAlias(repositoryFactory, uri.getText());
session = repository.login();
}
MessageDialog.openInformation(getShell(), "Success", "Connection to '" + uri.getText() + "' successful");