Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8647061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:58:17+00:00 2026-06-12T12:58:17+00:00

I am working in a Spring 3.1 application and I need to find a

  • 0

I am working in a Spring 3.1 application and I need to find a String template document located in Alfresco’s repository. I can already create a file in alfresco with OpenCMIS, but I couldn’t figure out how to find a template, so if anyone knows how to do it or point me an example, please let me know, thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:58:18+00:00Added an answer on June 12, 2026 at 12:58 pm

    There are a number of options you can use. First of all, you need to have a criteria that uniquely identifies your document. Here below I’ll show some, hopefully your case falls in one of them or they will inspire you towards a proper solution. The following uses pseudo code, please have a look to the OpenCMIS dev guide for working with the Java client API.

    BY ID

    Once you create a Document via CMIS, you get the unique ID of it that you can store in your application for later retrieval.

    Map<String, Object> templateProperties = createDocumentProperties();
    Folder folder = getTemplatesFolder();
    ObjectId templateId = createTemplateIn(folder);
    storeTemplateId(templateId.getId(), templateProperties); // persist the ID
    ...
    // later on
    ...
    String id = getTemplateId(); // retrieve the ID
    Session session = openCMISSession();
    Document template = (Document)session.getObject(id);
    

    BY PATH

    Similar to the previous example, you will have to take note of where you stored the document instead of its ID, or having a way to construct the path by hand.

    String path = getTemplatePath(); // either recover it from DB or construct a path
    Document template = (Document)session.getObjectByPath(path);
    

    BY PROPERTY VALUE

    Let’s say you can use a specific metadata field on a template Document that allows you to easily retrieve it afterwards (e.g. you created some specific Alfresco metadata model for your use case).

    String meta = TemplateProperties.TEMPLATE_ID; // e.g. my:templateId
    String type = TemplateProperties.TEMPLATE_TYPE; // e.g. my:template
    String templateMeta = "TEMPLATE1";
    Map<String, Object> templateProperties = createDocumentProperties();
    templateProperties.put(meta, templateMeta);
    templateProperties.put(PropertyIds.OBJECT_TYPE_ID, type);
    createTemplate(templateProperties);
    ...
    // later on
    ...
    String type = TemplateProperties.TEMPLATE_TYPE; // e.g. my:template
    String meta = TemplateProperties.TEMPLATE_ID;
    String tplId = "TEMPLATE1";
    String query = String.format("SELECT * FROM % WHERE % = '%'", type, meta, tplId);
    ItemIterable<QueryResult> i = session.query(query, false);
    QueryResult qr = i.iterator().next(); // let's assume we have one single match
    String templateId = qr.getPropertyByQueryName("cmis:objectId").getFirstValue()
    Document template = (Document)session.getObject(templateId);
    

    BY QUERY

    The previous approach is not really tied to search by property name, and can be easily extended to use any kind of query that identifies your templates. Have a look at the Alfresco page on its CMIS query language implementation details to learn more ways of querying the repository.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to find the publisherID of my native AIR application so I can
I am working on a Spring web application and need to implement a simple
I am working on a Spring web application where I have a need to
I've try to implement integration tests for a working application (spring, hibernate, soap, cxf).
I am working on Spring-Hibernate-Websphere application and sybase as database. Following is the code
i am working on a spring 3 web service application and on it i
I am working on an application using Spring 3 and Hibernate 3.5 with Java
I am working on profiling a legacy application using Spring AOP and I want
I'm working on a Java web application (Adobe Flex front-end, JPA/Hibernate/BlazeDS/Spring MVC backend) and
I'm currently running a working Spring + Apache Tiles webapp. I need to show

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.