It's all about the answers!

Ask a question

List of UUID and files in CCM


Torsten Welk (341710) | asked Jun 25 '19, 7:52 a.m.
edited Jun 26 '19, 2:02 a.m. by Ralph Schoon (63.1k33646)

We have stored documents in CCM (6.0.4). When we have a reference in that document  to another document the URL includes the UUID. Loading the documents into the workspace works. When you work offline you will not be able to find the referenced dockument.
Ist there any tool that may create a list with UUID and documentname + document path ?

Accepted answer


permanent link
Luca Martinucci (1.0k294112) | answered Jun 26 '19, 5:25 a.m.
Personally, I am not aware of such a tool.

Anyway, if you are familiar with Plain Java API, you can search the repository, retrieve the documents and get their names and UUIDs this way:


// retrieve the versionable (i.e. the document)
IVersionable versionable = ...;
String versionableName = versionable.getName();
UUID versionableId = versionable.getItemId();
String UUIDString = versionableId.toString();
Getting the document path is a bit more complex.
You must retrieve the configuration (IConfiguration) associated to the component to which the versionable belongs, then you can "build" the path this way:

String filePath = "";
IVersionableHandle versionableHandle = (IVersionableHandle) versionable.getItemHandle(),
List<IVersionableHandle> versionableHandleList = new ArrayList<IVersionableHandle>();
versionableHandleList.add(versionableHandle); 
List<?> ancestorReports = configuration.locateAncestors(versionableHandleList, monitor);
IAncestorReport iAncestorReport = (IAncestorReport) ancestorReports.get(0);
List<INameItemPair> reportList = iAncestorReport.getNameItemPairs();     
for (INameItemPair iNameItemPair : reportList){
String temp = iNameItemPair.getName();
if (temp != null) {
filePath += "/" + temp ;
}
}

Torsten Welk selected this answer as the correct answer

One other answer



permanent link
Torsten Welk (341710) | answered Jun 26 '19, 7:03 a.m.
Thank you very much for the fast answer.

From an other side I got the possibility to use the CLI.

lscm login -r <URL> -n local -u <user> -P <PW>
lscm list files -D '-' -i -j -r local  <STREAM> > file.json

Writes out a json file with all files from the stream

Comments
Luca Martinucci commented Jun 27 '19, 2:28 a.m.

Yours is a quickier way to retrieve name and UUID of a file.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.