Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Updating fileupload file in content structure
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
blumenr  
View profile  
 More options Jun 15 2012, 6:38 am
From: blumenr <villeskantsblumenrivi...@googlemail.com>
Date: Fri, 15 Jun 2012 03:38:06 -0700 (PDT)
Local: Fri, Jun 15 2012 6:38 am
Subject: Updating fileupload file in content structure

I have created a content structure with one file type field. On the website
(frontend) I prepared a form which allows the user to edit  the data of
this content structure. If a user had uploaded an image previously and does
not choose an image (in a later edit), the image shall not be removed from
the content (structure). In case the user chooses an image, the image shall
be replaced, of course. How would my velocity code look like in order to
make this work? Currently, I have the following approach:

#if($UtilMethods.isSet($oldAnswer))

      #set($submitContentSrc = "/vtl/content_form_macro_override_edit.vtl")

      #set($defaultAnswernumeric = $oldAnswer.answernumeric)
      #set($defaultAnswertext = $oldAnswer.answertext)

      #if($request.getParameter('uploadedFile') == "")

              #set($defaultUploadedFile = $oldAnswer.uploadedFile)
      #else
              *#set($defaultUploadedFile =
$request.getParameter('uploadedFile'))*

      #end

      #set($structureType = "Aduseranswers")
      #set($theinode = $oldAnswer.inode)
      #set($theidentifier = $oldAnswer.identifier)
      #set($uid = $session.getAttribute("USER_ID"))

Thanks in advance!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Maria Ahues Bouza  
View profile  
 More options Jun 15 2012, 12:21 pm
From: Maria Ahues Bouza <ma...@dotcms.com>
Date: Fri, 15 Jun 2012 09:21:49 -0700
Local: Fri, Jun 15 2012 12:21 pm
Subject: Re: [dotcms] Updating fileupload file in content structure

Hello,

Is this code not working?

The logic looks ok but I don't know what you're doing with these variables
on the code so I don't know if it's okay or not.

The only thing that's confusing is that you're setting two different
objects on $defaultUploadedFile, one is the uploadedFile that comes in the
content object,and the second case the uploaded file from the browser.

Since I don't see the entire code I'm not sure how you're handling that
later in the code.

Thanks
Maria

On Fri, Jun 15, 2012 at 3:38 AM, blumenr <

--
Community Manager

dotCMS
Main: 305.900.2001
Fax: 305.397.2579
www.dotcms.com
http://www.twitter.com/dotCMS
http://www.facebook.com/dotCMS
http://www.twitter.com/mabouza

Please consider the planet before printing this email.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ville Skants  
View profile  
 More options Jun 15 2012, 12:47 pm
From: Ville Skants <villeskantsblumenrivi...@googlemail.com>
Date: Fri, 15 Jun 2012 18:47:43 +0200
Local: Fri, Jun 15 2012 12:47 pm
Subject: Re: [dotcms] Updating fileupload file in content structure

It seems that there is no built-in way to edit content structure data on
the front-end? Here's also the later part of my code:

#if($UtilMethods.isSet($oldAnswer))

      #set($submitContentSrc = "/vtl/content_form_macro_override_edit.vtl")

      #set($defaultAnswernumeric = $oldAnswer.answernumeric)
      #set($defaultAnswertext = $oldAnswer.answertext)

      #if($request.getParameter('uploadedFile') == "")

              #set($defaultUploadedFile = $oldAnswer.uploadedFile)
      #else
              #set($defaultUploadedFile =
$request.getParameter('uploadedFile'))

      #end

      #set($structureType = "Aduseranswers")
      #set($theinode = $oldAnswer.inode)
      #set($theidentifier = $oldAnswer.identifier)
      #set($uid = $session.getAttribute("USER_ID"))

      #else
            #set($submitContentSrc = "/vtl/content_form_macro_override.vtl")
      #end
            #if($content.answertype.selectValue == "i" ||
$content.answertype.selectValue == "f")
              #set($dontShowFields = "answertext, uploadedFile")
            #elseif($content.answertype.selectValue == "t")
              #set($dontShowFields = "answernumeric, uploadedFile")
            #elseif($content.answertype.selectValue == "u")
              #set($dontShowFields = "answernumeric")
            #end
            #set($contentAutoPublish = true)
            #set($currentURLMapContent =
$dotcontent.find($URLMapContent.identifier))
            #set($pageUri = $currentURLMapContent.getUrlMap())
              #set($pp = $pp - 1)
            #set($myUrl = $pageUri + "?page=" + $pp)
            #set($contentFormReferer = $!myUrl)
      #set($Parent_Aduserresearches-Child_Aduseranswers =
$myAduserresearches.identifier)
      #set($Parent_Adquestions-Child_Aduseranswers  = $content.identifier)
            *#submitContent('aduseranswers')*

2012/6/15 Maria Ahues Bouza <ma...@dotcms.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Maria Ahues Bouza  
View profile  
 More options Jun 15 2012, 12:55 pm
From: Maria Ahues Bouza <ma...@dotcms.com>
Date: Fri, 15 Jun 2012 09:55:17 -0700
Local: Fri, Jun 15 2012 12:55 pm
Subject: Re: [dotcms] Updating fileupload file in content structure

No, right now there isn't a macro to edit content in the frontend.

I don't think you can use submitContent to save this content though.

Are you getting errors with this code? What is working and what is not
working?

Can you edit content without the file upload? Is that the only thing that
is not working on the code right now?

On Fri, Jun 15, 2012 at 9:47 AM, Ville Skants <

--
Community Manager

dotCMS
Main: 305.900.2001
Fax: 305.397.2579
www.dotcms.com
http://www.twitter.com/dotCMS
http://www.facebook.com/dotCMS
http://www.twitter.com/mabouza

Please consider the planet before printing this email.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ville Skants  
View profile  
 More options Jun 15 2012, 1:07 pm
From: Ville Skants <villeskantsblumenrivi...@googlemail.com>
Date: Fri, 15 Jun 2012 19:07:37 +0200
Local: Fri, Jun 15 2012 1:07 pm
Subject: Re: [dotcms] Updating fileupload file in content structure

Yes. The file upload is the only thing which isn't working. This is an
application tool which allows users to write and upload answers and
save(submit) them. Users can log out and again log in and the old answers
are retrieved from the structures. After this a user can save again his/her
answer. The problem is that when a user uploads a new file, it doesn't
override the old one. So a user can edit and update his textarea text but
overriding the old file isn't working..

2012/6/15 Maria Ahues Bouza <ma...@dotcms.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Maria Ahues Bouza  
View profile  
 More options Jun 15 2012, 2:26 pm
From: Maria Ahues Bouza <ma...@dotcms.com>
Date: Fri, 15 Jun 2012 11:26:06 -0700
Local: Fri, Jun 15 2012 2:26 pm
Subject: Re: [dotcms] Updating fileupload file in content structure

Let me see if we have an example anywhere on how to do this.

If not, I'll try it on demo on Monday.

On Fri, Jun 15, 2012 at 10:07 AM, Ville Skants <

--
Community Manager

dotCMS
Main: 305.900.2001
Fax: 305.397.2579
www.dotcms.com
http://www.twitter.com/dotCMS
http://www.facebook.com/dotCMS
http://www.twitter.com/mabouza

Please consider the planet before printing this email.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »