Hello All,
I am working on gathering all links which content the port number in all pages in my product spaces.
Example: http://abc.com:1234
Due to the space was contributing by many people and static ports were there, I could not ask one by one. Are there any way to search exactly and quickly?
Thank for your help.
@Andy tran huynh You might try to do an Advanced Search with wildcards—maybe something like:
"http*:1234"
The following pages might help you:
Thanks @Barbara Szczesniak in case i dont know which port number after http*:xxxx can you suggest me some hints ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Andy tran huynh !
I would think of
import com.atlassian.confluence.pages.Page
import com.atlassian.confluence.pages.PageManager
import com.atlassian.sal.api.component.ComponentLocator
import java.util.regex.Matcher
import java.util.regex.Pattern
def pageManager = ComponentLocator.getComponent(PageManager.class)
long ROOT_PAGE = 1234567L;
String linkPattern = "(<a href=\"https://aaa:d{4}.+?</a>)";
Page parentPage = pageManager.getPage(ROOT_PAGE);
List<Page> pages = parentPage.getDescendants();
for (Page page : pages) {
Pattern regex = Pattern.compile(linkPattern);
Matcher matcher = regex.matcher(page.getBodyAsString());
while (matcher.find()) {
String linksName = matcher.group(0);
log.warn "Page title | " + page.getTitle() + "| Link to Page |" + page.getUrlPath() + " |Links| " + linksName + "\n";
}
}
https://developer.atlassian.com/cloud/confluence/rest/v2/intro/#auth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.