Package org.nuxeo.ecm.webengine.forms

Examples of org.nuxeo.ecm.webengine.forms.FormData


    protected static final String AVATAR_PROPERTY = "userprofile:avatar";

    @GET
    public Object index(@Context HttpServletRequest request) throws Exception {
        FormData formData = new FormData(request);

        String lang = formData.getString("lang");
        setLanguage(lang);
        setDocumentLinkBuilder(formData.getString("documentLinkBuilder"));

        // get the arguments
        String ref = formData.getString("docRef");
        String queryText = formData.getString("queryText");
        int pageSize = getIntFromString(formData.getString("limit"));
        int page = getIntFromString(formData.getString("page"));
        return buildDocumentList(ref, pageSize, page, queryText).arg(
                "renderFullHtml", true);
    }
View Full Code Here


     */
    @POST
    @Path("documentList")
    public Object documentList(@Context HttpServletRequest request)
            throws Exception {
        FormData formData = new FormData(request);

        String lang = formData.getString("lang");
        setLanguage(lang);
        setDocumentLinkBuilder(formData.getString("documentLinkBuilder"));

        // get the arguments
        String ref = formData.getString("docRef");
        int pageSize = getIntFromString(formData.getString("limit"));
        int page = getIntFromString(formData.getString("page"));
        return buildDocumentList(ref, pageSize, page, null);
    }
View Full Code Here

    @GET
    @Path("documentListGet")
    public Object documentListGet(@Context HttpServletRequest request)
            throws Exception {
        FormData formData = new FormData(request);

        String lang = formData.getString("lang");
        setLanguage(lang);
        setDocumentLinkBuilder(formData.getString("documentLinkBuilder"));

        // get the arguments
        String ref = formData.getString("docRef");
        int pageSize = getIntFromString(formData.getString("limit"));
        int page = getIntFromString(formData.getString("page"));
        return buildDocumentList(ref, pageSize, page, null);
    }
View Full Code Here

     */
    @POST
    @Path("search")
    public Object search(@Context HttpServletRequest request)
            throws Exception {
        FormData formData = new FormData(request);

        String lang = formData.getString("lang");
        setLanguage(lang);
        setDocumentLinkBuilder(formData.getString("documentLinkBuilder"));

        // get the arguments
        String ref = formData.getString("docRef");
        int pageSize = getIntFromString(formData.getString("limit"));
        int page = getIntFromString(formData.getString("page"));
        String queryText = formData.getString("queryText");
        return buildDocumentList(ref, pageSize, page, queryText);
    }
View Full Code Here

    @POST
    @Path("publishDocument")
    public Object publishDocument(@Context HttpServletRequest request)
            throws Exception {
        FormData formData = new FormData(request);
        CoreSession session = ctx.getCoreSession();
        DocumentRef docRef = getDocumentRef(formData.getString("targetRef"));

        DocumentModel target = session.getDocument(docRef);
        SocialDocument socialDocument = toSocialDocument(target);

        if (socialDocument == null) {
            throw new ClientException("Can't fetch social document.");
        }

        boolean isPublic = "true".equals(formData.getString("public"));
        if (isPublic) {
            socialDocument.makePublic();
        } else {
            socialDocument.restrictToMembers();
        }
View Full Code Here

     */
    @POST
    @Path("deleteDocument")
    public Object deleteDocument(@Context HttpServletRequest request)
            throws Exception {
        FormData formData = new FormData(request);
        String target = formData.getString("targetRef");
        DocumentRef docRef = getDocumentRef(target);
        CoreSession session = ctx.getCoreSession();

        if (session.getAllowedStateTransitions(docRef).contains(
                DELETE_TRANSITION)) {
View Full Code Here

    @POST
    @Path("createDocument")
    public Object createDocument(@Context HttpServletRequest request)
            throws Exception {
        CoreSession session = ctx.getCoreSession();
        FormData formData = new FormData(request);
        String type = formData.getDocumentType();
        String title = formData.getDocumentTitle();
        DocumentRef docRef = getDocumentRef(formData.getString("docRef"));
        DocumentModel parent = session.getDocument(docRef);
        DocumentModel newDoc = session.createDocumentModel(
                parent.getPathAsString(), title, type);
        formData.fillDocument(newDoc);
        newDoc = session.createDocument(newDoc);
        session.save();
        if (newDoc.isFolder()) {
            return buildDocumentList(newDoc.getId(), 0, 0, null);
        } else {
View Full Code Here

TOP

Related Classes of org.nuxeo.ecm.webengine.forms.FormData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.