本文整理汇总了Java中org.apache.chemistry.opencmis.client.api.CmisObject.getName方法的典型用法代码示例。如果您正苦于以下问题:Java CmisObject.getName方法的具体用法?Java CmisObject.getName怎么用?Java CmisObject.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.chemistry.opencmis.client.api.CmisObject
的用法示例。
在下文中一共展示了CmisObject.getName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTargetFolder
import org.apache.chemistry.opencmis.client.api.CmisObject; //导入方法依赖的package包/类
private CmisObject getTargetFolder(final Session session, final BatchClassCmisConfiguration batchClassCmisConfiguration) {
CmisObject targetFolder = null;
LOGGER.info("Acquiring Root Folder.");
final Folder root = session.getRootFolder();
final ItemIterable<CmisObject> children = root.getChildren();
LOGGER.info("Looping through Root Folder children.");
for (final CmisObject cmisObject : children) {
if (cmisObject != null && cmisObject.getName() != null
&& cmisObject.getName().equalsIgnoreCase(batchClassCmisConfiguration.getFolderName())
&& isObjectFolder(cmisObject)) {
LOGGER.info("Verified that the target is of type cmis:folder.");
LOGGER.info("Target folder, " + batchClassCmisConfiguration.getFolderName() + ", found.");
targetFolder = cmisObject;
break;
}
}
return targetFolder;
}
示例2: handleVfsOnlyChildren
import org.apache.chemistry.opencmis.client.api.CmisObject; //导入方法依赖的package包/类
private void handleVfsOnlyChildren(OpenCmsModule ocmsModule, String parentVfsPath, Map<String, CmisObject> vfsChildMap) {
LOG.info("Handle files/folders that exist only on the vfs");
for (CmisObject vfsChild : vfsChildMap.values()) {
if (progressIndicator.isCanceled()) {
return;
}
String childVfsPath = parentVfsPath + vfsChild.getName();
// files
if (vfsChild.getBaseTypeId().equals(BaseTypeId.CMIS_DOCUMENT)) {
addVfsOnlyFileToSyncList(ocmsModule, childVfsPath, vfsChild, false);
}
// folders
else if (vfsChild.getBaseTypeId().equals(BaseTypeId.CMIS_FOLDER)) {
addVfsOnlyFolderTreeToSyncList(ocmsModule, childVfsPath, vfsChild, false);
}
}
}
示例3: addVfsOnlyFolderTreeToSyncList
import org.apache.chemistry.opencmis.client.api.CmisObject; //导入方法依赖的package包/类
private void addVfsOnlyFolderTreeToSyncList(OpenCmsModule ocmsModule, String vfsPath, CmisObject vfsObject, boolean replaceExistingEntity) {
LOG.info("Adding VFS only folder " + vfsPath);
SyncAction syncAction = getVfsOnlySyncAction(ocmsModule.getSyncMode());
SyncFolder syncFolder = new SyncFolder(ocmsModule, vfsPath, null, vfsObject, syncAction, replaceExistingEntity);
syncList.add(syncFolder);
if (syncAction != SyncAction.DELETE_VFS) {
// traverse folder, add children to the SyncJob
LOG.info("Get children of VFS folder " + vfsPath);
ItemIterable<CmisObject> vfsChildren = ((Folder) vfsObject).getChildren();
for (CmisObject child : vfsChildren) {
String childVfsPath = vfsPath + "/" + child.getName();
// files
if (child.getBaseTypeId().equals(BaseTypeId.CMIS_DOCUMENT)) {
addVfsOnlyFileToSyncList(ocmsModule, childVfsPath, child, false);
}
// folders
else if (child.getBaseTypeId().equals(BaseTypeId.CMIS_FOLDER)) {
addVfsOnlyFolderTreeToSyncList(ocmsModule, childVfsPath, child, false);
}
}
}
}
示例4: addModuleResourceFolderTreeToSyncList
import org.apache.chemistry.opencmis.client.api.CmisObject; //导入方法依赖的package包/类
private void addModuleResourceFolderTreeToSyncList(OpenCmsModule ocmsModule, String vfsPath, CmisObject vfsObject) {
LOG.info("Adding VFS module resource folder " + vfsPath);
SyncFolder syncFolder = new SyncFolder(ocmsModule, vfsPath, null, vfsObject, SyncAction.PULL, false);
syncList.add(syncFolder);
// traverse folder, add children to the SyncJob
LOG.info("Get children of VFS folder " + vfsPath);
ItemIterable<CmisObject> vfsChildren = ((Folder) vfsObject).getChildren();
for (CmisObject child : vfsChildren) {
if (progressIndicator.isCanceled()) {
executeSync = false;
return;
}
String childVfsPath = vfsPath + "/" + child.getName();
// files
if (child.getBaseTypeId().equals(BaseTypeId.CMIS_DOCUMENT)) {
addModuleResourceFileToSyncList(ocmsModule, childVfsPath, child);
}
// folders
else if (child.getBaseTypeId().equals(BaseTypeId.CMIS_FOLDER)) {
addModuleResourceFolderTreeToSyncList(ocmsModule, childVfsPath, child);
}
}
}
示例5: monitorTargetFolder
import org.apache.chemistry.opencmis.client.api.CmisObject; //导入方法依赖的package包/类
private void monitorTargetFolder(final CmisObject cmisFolder, final BatchClassCmisConfiguration batchClassCmisConfiguration) {
final Folder targetFolder = (Folder) cmisFolder;
final ItemIterable<CmisObject> folderChildren = targetFolder.getChildren();
LOGGER.info("ImportFolder has children count of = " + folderChildren.getTotalNumItems());
LOGGER.info("Looping through " + batchClassCmisConfiguration.getFolderName() + " children...");
for (final CmisObject cmisObject : folderChildren) {
LOGGER.info("Name = " + cmisObject.getName() + "\nId = " + cmisObject.getId());
if (cmisObject instanceof Folder) {
LOGGER.info("Found sub folder :" + cmisObject.getName());
LOGGER.info("Skipping sub folder for processing");
// Uncomment below line for supporting the subfolder.
// monitorTargetFolder(cmisFolder);
} else if (eligibleForImport(cmisObject, batchClassCmisConfiguration)) {
LOGGER.info("Name = " + cmisObject.getName() + " HAS NOT BEEN IMPORTED TO EPHESOFT YET!");
// GETTING OBJECT CONTENT
String fileName = cmisObject.getName();
final String destinationFolder = batchClassCmisConfiguration.getBatchClass().getUncFolder() + File.separator
+ fileName.substring(0, fileName.indexOf('.')) + "_" + System.currentTimeMillis();
final String destinationFile = destinationFolder + File.separator + fileName;
copyObjectToLocation(getObjectContent(cmisObject), destinationFolder, destinationFile);
outputToXml(generatePropertiesXml(cmisObject), destinationFolder + File.separator + fileName + "_PROPERTIES" + ".xml");
setPropertyImportFlag(cmisObject, batchClassCmisConfiguration);
}
}
LOGGER.info("***** Target Folder Monitor Service Scan END *****");
}
示例6: doInBackground
import org.apache.chemistry.opencmis.client.api.CmisObject; //导入方法依赖的package包/类
@Override
protected String doInBackground(Void... arg0) {
// Initiates a Session Factory
SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
// Initiates connection session parameters.
Map<String, String> parameter = new HashMap<String, String>();
parameter.put(SessionParameter.USER, "admin");
parameter.put(SessionParameter.PASSWORD, "admin");
parameter.put(SessionParameter.ATOMPUB_URL, "http://192.168.1.36:8081/inmemory/atom/");
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
// Retrieves repository information and create the session object.
Repository repository = sessionFactory.getRepositories(parameter).get(0);
parameter.put(SessionParameter.REPOSITORY_ID, repository.getId());
Session session = sessionFactory.createSession(parameter);
// Retrieves media folder and list all this children.
String listChildren = "";
Folder mediaFolder = (Folder) session.getObjectByPath("/media");
ItemIterable<CmisObject> children = mediaFolder.getChildren();
for (CmisObject o : children) {
listChildren += o.getName() + " - " + o.getType().getDisplayName() + " - " + o.getCreatedBy() + "\b\n";
}
return listChildren;
}