XML 파일의 X 시간마다 디렉토리를 폴링 한 다음 JCR로 특정 형식으로 가져올 수 있습니까? CQ5가이 기능을 제거했다고 나는 믿는다. 또한 Adobe는 필요로하는 외로운 발바닥을 유용하게 활용할 수 있습니까? 감사합니다CQ5 FTP XML 파일
0
A
답변
0
저는 그러한 기능이 실제로 CQ5 또는 AEM에 있다고 생각하지 않습니다. 일반적으로 수행 할 작업은 com.day.cq.polling.importer.Importer
인터페이스의 구현을 만든 다음 피드 가져 오기 도구 (http://localhost:4502/etc/importers/polling.html)를 통해 가져 오기 프로세스를 구성하는 것입니다. (주 - 이름이 피드에만입니다 의미하지만, 이러한 경우가
현재 매우 간단한 사용자 정의 수입의 예를 볼 수있다 : 이것은 단지에서 파일을 가져 https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/master/bundle/src/main/java/com/adobe/acs/commons/wcm/impl/FileImporter.java
합니다. 파일 시스템에 저장하고 저장소에 저장
0
옛날 옛적에 비슷한 요구 사항이 있었고 Jsch을 사용하여 sFTP를 통해 파일을 저장하고 파일을 저장소에 저장했습니다.이 서비스는 scheduled job에서 호출되어 xml을 처리합니다 필요에 따라
jtch를 사용하여 실제로 sftp를 통해 파일을 검색 한 다음 repo에 저장하는 코드와 관련이 있습니다.
JSch jsch = new JSch();
log.info(
"connecting to {}@{}:{}",
new String[] {parameters.getUsername(), parameters.getHost(), String.valueOf(parameters.getPort()) });
Session session = jsch.getSession(parameters.getUsername(), parameters.getHost(), parameters.getPort());
session.setConfig("StrictHostKeyChecking", "no");
session.setPassword(parameters.getPassword());
session.connect();
Channel channel = session.openChannel(CHANNEL_SFTP);
channel.connect();
ChannelSftp sftpChannel = (ChannelSftp) channel;
log.debug("change directory to {}", parameters.getPath());
sftpChannel.cd(parameters.getPath());
log.debug("get file {}", parameters.getFilename());
InputStream stream = sftpChannel.get(parameters.getFilename());
saveStreamToRepository(stream, resourceResolver, path, parameters.getFilename());
sftpChannel.exit();
session.disconnect();
log.info("disconnecting from sFTP after retrieving file {}.", parameters.getFilename());
return path + "/" + parameters.getFilename();
private void saveStreamToRepository(InputStream stream, ResourceResolver resourceResolver, String path,
String fileName) throws RepositoryException {
javax.jcr.Session jcrSession = resourceResolver.adaptTo(javax.jcr.Session.class);
Node pathNode = jcrSession.getNode(path);
Node fileNode = pathNode.addNode(fileName, JcrConstants.NT_FILE);
Node resNode = fileNode.addNode(JcrConstants.JCR_CONTENT, JcrConstants.NT_RESOURCE);
resNode.setProperty(JcrConstants.JCR_LASTMODIFIED, Calendar.getInstance());
Binary binary = jcrSession.getValueFactory().createBinary(stream);
resNode.setProperty(JcrConstants.JCR_DATA, binary);
jcrSession.save();
}
관련 문제
- 1. ftp 바이너리 xml 파일 업로드
- 2. 문자가 CQ5 파일 이름에 허용됨
- 3. CQ5 파일 업로드 구성 요소를 사용하는 방법?
- 4. Camel FTP - 알려진 파일 이름의 FTP 소비자
- 5. FileZilla를 사용하는 FTP XML 파일 = 수신 측에 잘못된 태그가 있습니까?
- 6. FTP 서버의 파일 수정
- 7. NSURLConnection FTP 파일 업로드
- 8. FTP 서버와 파일 동기화
- 9. VB 매크로 ftp 파일
- 10. FTP 파일 업로드 스크립트는
- 11. ftp 파일 공유
- 12. FTP 파일 전송
- 13. FTP 업로드 파일 Python
- 14. FTP 및 파일
- 15. 전송 FTP 무시 파일
- 16. FileInputFormat.setInputPath의 FTP 파일 이름
- 17. FTP 관련 파일
- 18. 자동 업로드 파일 ftp
- 19. FTP 파일 전송
- 20. 디렉토리에서 FTP "get"파일
- 21. FTP - 파일 이름은
- 22. Bat 파일 FTP 명령
- 23. ftp 서버에서 파일 액세스하기
- 24. UltraEdit FTP 파일 크기
- 25. FTP 요청시 파일 생성
- 26. PHP - FTP 목록 파일
- 27. FTP 파일 다운로드를 중지하십시오.
- 28. Eclipse 다운로드 ftp 파일
- 29. FTP 서버의 CronJob 파일
- 30. 파일 업로드 FTP 서버