nuxeo-localizer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nuxeo-localizer] Question re: using manage_editLocalProperty


From: Michael Stuempel
Subject: [Nuxeo-localizer] Question re: using manage_editLocalProperty
Date: Mon, 5 Aug 2002 11:47:24 +0900

Hi,

I'm hoping I can get some help with this problem. I'm a newbie to Zope
and to Localizer (although I'm learning that both are great!) and have
run into a problem that's had me running in circles over the last couple
of days.

I want to create a form to edit both the Message Catalog and the Body of
the localizer text. However, I don't want to use the built in zope
management interface. I need to have a way for an authenticated user to
make the edits, but I can't have them seeing all the other tabs that the
regular interface throws up. I've created a form (see below) which gets
the correct information from both Message Catalog and from the body of
the object. This populates the form correctly (including language) and I
can make changes to that text, however I can't figure out a way to
update the actual objects. 

The form basically pulls in data from the object to be edited from the
body of html_content and then from the Message Catalog. Once SUBMIT is
pressed, the form reloads going to the TRUE case of the <dtml-if>. At
the moment the text 'submitting...' is being shown on the rendered page.
I need to have it update the Message Catalog, update the body of
html_content and then redirect itself to the original page to edit,
showing the updated text.

I've been trying to use manage_editLocalProperty, but can't seem to get
the correct variables/objects passed for the call to work. 

Does anyone have any advice on how to get this to work? 

Thanks in Advance,

  --Michael


-----DTML TEXT FOLLOWS ----

<html>
<body>

<dtml-comment>

'passedURL' and 'passedTITLE' are the actual URL and Title of the page
that I want to edit. They are passed to the form when EDIT PAGE is
clicked

</dtml-comment>

<dtml-with "restrictedTraverse(passedURL, _.None)">

  <dtml-if SUBMIT>

  Submitting...<br><br>

  <dtml-comment>
    Test to make sure that the correct object is being used - passes
    <dtml-var objectIds><br>
  </dtml-comment>

  <dtml-comment>
 
************************************************************************
************************************
    I want to update the appropriate page based on the form at this
point. Kind of lost at this point.
 
************************************************************************
************************************

    <dtml-call "html_content.manage_editLocalProperty(self, id, REQUEST,
RESPONSE=RESPONSE)">

  </dtml-comment>

  <dtml-else>

    <dtml-comment>
    Get the language information for the page that is being edited
    </dtml-comment>

    <dtml-in "msgCat.get_languages_map()" mapping>
      <dtml-if selected><h1><dtml-var "msgCat(title, id)"> Page
Content</h1>
      </dtml-if>
    </dtml-in>   

    <p class="form-help">
    You may edit the source for this document using the form below.</p>

    <form action="" method="post">
    <table cellpadding="2" cellspacing="0" width="100%" border="0">
    <tr>
      <dtml-comment>

      This gets the title from the message catalog

      </dtml-comment>
      <td align="left" valign="top">
      <div class="form-optional">
      Title
      </div>
      </td>
      <td align="left" valign="top">
      <input type="text" name="contentTitle" size="40" value="<dtml-var
"msgCat.gettext(passedTITLE)">">
      </td>
    </tr>

    <tr>
      <dtml-comment>

      This gets the body text from the object (using WITH to specify
object)

      </dtml-comment>
      <td align="left" valign="top" colspan="2">
      <div style="width: 100%;">
      <textarea name="data:text" wrap="soft" style="width: 100%;
cols="100%"; rows="25"><dtml-var "html_content.body"
html_quote></textarea>
      </div>
      </td>
    </tr>

    <tr>
      <td align="left" valign="top" colspan="2">
        <div class="form-element">
           <input class="form-element" type="submit" name="SUBMIT"
value="Save Changes">
        </div>
      </td>
    </tr>
    </table>
    </form>

  </dtml-if>

</dtml-with>

</body>
</html>

-----DTML TEXT FINISH ----

---
Michael Stuempel, MCSE
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]