當前位置: 首頁>>代碼示例>>Java>>正文


Java WicketUtils.getRepositoryName方法代碼示例

本文整理匯總了Java中com.gitblit.wicket.WicketUtils.getRepositoryName方法的典型用法代碼示例。如果您正苦於以下問題:Java WicketUtils.getRepositoryName方法的具體用法?Java WicketUtils.getRepositoryName怎麽用?Java WicketUtils.getRepositoryName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.gitblit.wicket.WicketUtils的用法示例。


在下文中一共展示了WicketUtils.getRepositoryName方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: EditRepositoryPage

import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
public EditRepositoryPage(PageParameters params) {
	// edit constructor
	super(params);
	isCreate = false;
	String name = WicketUtils.getRepositoryName(params);
	RepositoryModel model = GitBlit.self().getRepositoryModel(name);
	setupPage(model);
	setStatelessHint(false);
	setOutputMarkupId(true);
}
 
開發者ID:warpfork,項目名稱:gitblit,代碼行數:11,代碼來源:EditRepositoryPage.java

示例2: PatchPage

import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
public PatchPage(PageParameters params) {
	super(params);

	if (!params.containsKey("r")) {
		GitBlitWebSession.get().cacheErrorMessage(getString("gb.repositoryNotSpecified"));
		redirectToInterceptPage(new RepositoriesPage());
		return;
	}

	final String repositoryName = WicketUtils.getRepositoryName(params);
	final String baseObjectId = WicketUtils.getBaseObjectId(params);
	final String objectId = WicketUtils.getObject(params);
	final String blobPath = WicketUtils.getPath(params);

	Repository r = GitBlit.self().getRepository(repositoryName);
	if (r == null) {
		GitBlitWebSession.get().cacheErrorMessage(getString("gb.canNotLoadRepository") + " " + repositoryName);
		redirectToInterceptPage(new RepositoriesPage());
		return;
	}

	RevCommit commit = JGitUtils.getCommit(r, objectId);
	if (commit == null) {
		GitBlitWebSession.get().cacheErrorMessage(getString("gb.commitIsNull"));
		redirectToInterceptPage(new RepositoriesPage());
		return;
	}

	RevCommit baseCommit = null;
	if (!StringUtils.isEmpty(baseObjectId)) {
		baseCommit = JGitUtils.getCommit(r, baseObjectId);
	}
	String patch = DiffUtils.getCommitPatch(r, baseCommit, commit, blobPath);
	add(new Label("patchText", patch));
	r.close();
}
 
開發者ID:warpfork,項目名稱:gitblit,代碼行數:37,代碼來源:PatchPage.java

示例3: EmptyRepositoryPage

import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
public EmptyRepositoryPage(PageParameters params) {
	super(params);

	setVersioned(false);

	String repositoryName = WicketUtils.getRepositoryName(params);
	RepositoryModel repository = GitBlit.self().getRepositoryModel(repositoryName);
	if (repository == null) {
		error(getString("gb.canNotLoadRepository") + " " + repositoryName, true);
	}
	
	if (repository.hasCommits) {
		// redirect to the summary page if this repository is not empty
		throw new GitblitRedirectException(SummaryPage.class, params);
	}
	
	setupPage(repositoryName, getString("gb.emptyRepository"));

	UserModel user = GitBlitWebSession.get().getUser();
	if (user == null) {
		user = UserModel.ANONYMOUS;
	}
	
	RepositoryUrlPanel urlPanel = new RepositoryUrlPanel("pushurl", false, user, repository);
	String primaryUrl = urlPanel.getPrimaryUrl();
	
	add(new Label("repository", repositoryName));
	add(urlPanel);
	add(new Label("cloneSyntax", MessageFormat.format("git clone {0}", primaryUrl)));
	add(new Label("remoteSyntax", MessageFormat.format("git remote add gitblit {0}\ngit push gitblit master", primaryUrl)));
}
 
開發者ID:warpfork,項目名稱:gitblit,代碼行數:32,代碼來源:EmptyRepositoryPage.java

示例4: EmptyRepositoryPage

import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
public EmptyRepositoryPage(PageParameters params) {
	super(params);

	setVersioned(false);

	String repositoryName = WicketUtils.getRepositoryName(params);
	RepositoryModel repository = GitBlit.self().getRepositoryModel(repositoryName);
	if (repository == null) {
		error(getString("gb.canNotLoadRepository") + " " + repositoryName, true);
	}
	
	if (repository.hasCommits) {
		// redirect to the summary page if this repository is not empty
		throw new GitblitRedirectException(SummaryPage.class, params);
	}
	
	setupPage(repositoryName, getString("gb.emptyRepository"));

	List<String> repositoryUrls = new ArrayList<String>();

	if (GitBlit.getBoolean(Keys.git.enableGitServlet, true)) {
		// add the Gitblit repository url
		repositoryUrls.add(getRepositoryUrl(repository));
	}
	UserModel user = GitBlitWebSession.get().getUser();
	repositoryUrls.addAll(GitBlit.self().getOtherCloneUrls(repositoryName, user == null ? "" : user.username));
	
	String primaryUrl = ArrayUtils.isEmpty(repositoryUrls) ? "" : repositoryUrls.get(0);
	add(new Label("repository", repositoryName));
	add(new RepositoryUrlPanel("pushurl", primaryUrl));
	add(new Label("cloneSyntax", MessageFormat.format("git clone {0}", repositoryUrls.get(0))));
	add(new Label("remoteSyntax", MessageFormat.format("git remote add gitblit {0}\ngit push gitblit master", primaryUrl)));
}
 
開發者ID:BullShark,項目名稱:IRCBlit,代碼行數:34,代碼來源:EmptyRepositoryPage.java

示例5: RepositoryPage

import com.gitblit.wicket.WicketUtils; //導入方法依賴的package包/類
public RepositoryPage(PageParameters params) {
	super(params);
	repositoryName = WicketUtils.getRepositoryName(params);
	String root =StringUtils.getFirstPathElement(repositoryName);
	if (StringUtils.isEmpty(root)) {
		projectName = GitBlit.getString(Keys.web.repositoryRootGroupName, "main");
	} else {
		projectName = root;
	}
	objectId = WicketUtils.getObject(params);
	
	if (StringUtils.isEmpty(repositoryName)) {
		error(MessageFormat.format(getString("gb.repositoryNotSpecifiedFor"), getPageName()), true);
	}

	if (!getRepositoryModel().hasCommits) {
		setResponsePage(EmptyRepositoryPage.class, params);
	}
	
	if (getRepositoryModel().isCollectingGarbage) {
		error(MessageFormat.format(getString("gb.busyCollectingGarbage"), getRepositoryModel().name), true);
	}

	if (objectId != null) {
		RefModel branch = null;
		if ((branch = JGitUtils.getBranch(getRepository(), objectId)) != null) {
			UserModel user = GitBlitWebSession.get().getUser();
			if (user == null) {
				// workaround until get().getUser() is reviewed throughout the app
				user = UserModel.ANONYMOUS;
			}
			boolean canAccess = user.canView(getRepositoryModel(),
							branch.reference.getName());
			if (!canAccess) {
				error(getString("gb.accessDenied"), true);
			}
		}
	}

	// register the available page links for this page and user
	registeredPages = registerPages();

	// standard page links
	List<PageRegistration> pages = new ArrayList<PageRegistration>(registeredPages.values());
	NavigationPanel navigationPanel = new NavigationPanel("navPanel", getClass(), pages);
	add(navigationPanel);

	add(new ExternalLink("syndication", SyndicationServlet.asLink(getRequest()
			.getRelativePathPrefixToContextRoot(), repositoryName, null, 0)));

	// add floating search form
	SearchForm searchForm = new SearchForm("searchForm", repositoryName);
	add(searchForm);
	searchForm.setTranslatedAttributes();

	// set stateless page preference
	setStatelessHint(true);
}
 
開發者ID:BullShark,項目名稱:IRCBlit,代碼行數:59,代碼來源:RepositoryPage.java


注:本文中的com.gitblit.wicket.WicketUtils.getRepositoryName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。