You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Doug Chestnut <dh...@virginia.edu> on 2004/12/03 06:48:52 UTC

unable to publish a document in default pub

Hi developers,
Again, this is from the trunk, I did this to get the src:
 svn co http://svn.apache.org/repos/asf/lenya/trunk lenya-1.4
Is this right to get 1.4?

Anyway,  /src/webapp/lenya/content/publishing/screen.xsp is supposed to 
check if the parent document has a live version before it allows you to 
publish a document.  Instead, it was checking to see if the current document 
has a live version before allowing you to publish.  Trying to publish a top 
level document would spit out an error so I had to use the getParent method 
that uses the defaultDocumentId parameter.

Good thing about looking at this code is that it shows me how to acomplish 
the global assets (actually just inherited assets) option that I need.

Here is the chunk that I changed in 
/src/webapp/lenya/content/publishing/screen.xsp.  Seems to be working for me 
now.


    <usecase:task-id>publish</usecase:task-id>

    <xsp:logic>
      Document document = (Document) <input:get-attribute 
module="page-envelope" as="object" name="document"/>;
      DocumentIdentityMap identityMap = document.getIdentityMap();

      try {
//          Document parent = identityMap.getFactory().getParent(document);
          Document parent = 
identityMap.getFactory().getParent(document,"/index");
//          Document liveParent = 
identityMap.getFactory().getAreaVersion(document, Publication.LIVE_AREA);
          Document liveParent = 
identityMap.getFactory().getAreaVersion(parent, "live");
//          if (!liveParent.exists() ) {
          if (!liveParent.exists()) {
              <usecase:message id="parent-not-live"/>

              String url = liveParent.getCanonicalWebappURL();

              <usecase:parent>
                <xsp:attribute 
name="href"><xsp-request:get-context-path/><xsp:expr>url</xsp:expr></xsp:attribute>
                <xsp:attribute 
name="id"><xsp:expr>liveParent.getId()</xsp:expr></xsp:attribute>
                <xsp:attribute 
name="language"><xsp:expr>liveParent.getLanguage()</xsp:expr></xsp:attribute>
              </usecase:parent>
          }
      }
      catch (Exception e) {
          throw new ProcessingException(e);
      }
    </xsp:logic>


--Doug


---------------------------------------------------------------------
To unsubscribe, e-mail:              dev-unsubscribe@lenya.apache.org
For additional commands, e-mail:            dev-help@lenya.apache.org
Apache Lenya Project                          http://lenya.apache.org


Re: unable to publish a document in default pub

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Doug Chestnut wrote:
> Hi developers,
> Again, this is from the trunk, I did this to get the src:
> svn co http://svn.apache.org/repos/asf/lenya/trunk lenya-1.4
> Is this right to get 1.4?
> 
> Anyway,  /src/webapp/lenya/content/publishing/screen.xsp is supposed to 
> check if the parent document has a live version before it allows you to 
> publish a document.  Instead, it was checking to see if the current 
> document has a live version before allowing you to publish.  Trying to 
> publish a top level document would spit out an error so I had to use the 
> getParent method that uses the defaultDocumentId parameter.
> 
> Good thing about looking at this code is that it shows me how to 
> acomplish the global assets (actually just inherited assets) option that 
> I need.
> 
> Here is the chunk that I changed in 
> /src/webapp/lenya/content/publishing/screen.xsp.  Seems to be working 
> for me now.

applied, thanks

-- 
Gregor J. Rothfuss
COO, Wyona       Content Management Solutions    http://wyona.com
Apache Lenya                              http://lenya.apache.org
gregor.rothfuss@wyona.com                       gregor@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail:              dev-unsubscribe@lenya.apache.org
For additional commands, e-mail:            dev-help@lenya.apache.org
Apache Lenya Project                          http://lenya.apache.org


asset management futures

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Doug Chestnut wrote:

> Looking at the 1.4 API, I really like the way it handles assets.
> I hope to have the ability to inherit assets from parent documents 
> working shortly.  I think that I just need to think about the ability to 
> delete/rename assets and make the link changes in all descendant documents.

publishing also may cause problems if you publish a page that contains 
references to unpublished pages with assets. if you only allow access to 
assets from parent pages, that should not be a problem since the 
publishing process dissallows publication of pages that do not have 
their parents published. then again.. you could have added the asset in 
the meantime.. just a thought.

> I would also like the ability to have "code fragment" assets that are 
> inherited in the same way.  The code fragments could have names like 
> "callout box" or "two column page" that would be accessible to our 
> content managers like assets are currently.  Selecting a fragment would 
> allow our content managers to use our designers fancy css styled 
> elements without knowing css or even having to look at the xhtml 
> source.  Is there something in the works that I should look at before 
> pursuing this feature?

this is a very interesting idea. you could insert xml fragments that way 
to do xincludes, for instance. might be useful to have a collection of 
these fragments for things like side bars, TOC etc. at this time, 
dealing with xincludes is kinda clunky since you have to either define 
it in the doctype or the pipeline, which is much more overhead than you 
probably want. just being able to quickly place xinclude fragments 
somewhere and have a xinclude transformer take care of it automatically 
would make it much easier to mix and match content.

im assuming that 
http://wiki.apache.org/lenya/XIncludeAggregationProposal has some of the 
same goals.

> I guess that 1.4 is considered the alpha/beta development version?
> How eager should I be to develop my publications in lenya 1.4 at this 
> point in its development?

if you get your changes in before the big repository revamp happens, it 
should be reasonably stable. so for the next couple weeks / months it 
should be safe to use 1.4 (unless someone surprises me and starts doing 
large scale changes). don't quote me on that though :)

1.2 is the stable branch. at the same time, i wanted to make you aware 
of the extended asset management API in 1.4 (which, maybe, could be 
backported too?)

-- 
Gregor J. Rothfuss
COO, Wyona       Content Management Solutions    http://wyona.com
Apache Lenya                              http://lenya.apache.org
gregor.rothfuss@wyona.com                       gregor@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail:              dev-unsubscribe@lenya.apache.org
For additional commands, e-mail:            dev-help@lenya.apache.org
Apache Lenya Project                          http://lenya.apache.org


Re: unable to publish a document in default pub

Posted by Doug Chestnut <dh...@virginia.edu>.
Thanks Gregor,
I will be sure to submit future patches (in the proper format) to Bugzilla.

Looking at the 1.4 API, I really like the way it handles assets.
I hope to have the ability to inherit assets from parent documents working 
shortly.  I think that I just need to think about the ability to 
delete/rename assets and make the link changes in all descendant documents.

I would also like the ability to have "code fragment" assets that are 
inherited in the same way.  The code fragments could have names like 
"callout box" or "two column page" that would be accessible to our content 
managers like assets are currently.  Selecting a fragment would allow our 
content managers to use our designers fancy css styled elements without 
knowing css or even having to look at the xhtml source.  Is there something 
in the works that I should look at before pursuing this feature?

I guess that 1.4 is considered the alpha/beta development version?
How eager should I be to develop my publications in lenya 1.4 at this point 
in its development?

Thanks,
--Doug


----- Original Message ----- 
From: "Gregor J. Rothfuss" <gr...@apache.org>
To: "Lenya Developers List" <de...@lenya.apache.org>
Sent: Friday, December 03, 2004 11:20 AM
Subject: Re: unable to publish a document in default pub


> Doug Chestnut wrote:
>> Hi developers,
>> Again, this is from the trunk, I did this to get the src:
>> svn co http://svn.apache.org/repos/asf/lenya/trunk lenya-1.4
>> Is this right to get 1.4?
>
> yes
>
>> Anyway,  /src/webapp/lenya/content/publishing/screen.xsp is supposed to 
>> check if the parent document has a live version before it allows you to 
>> publish a document.  Instead, it was checking to see if the current 
>> document has a live version before allowing you to publish.  Trying to 
>> publish a top level document would spit out an error so I had to use the 
>> getParent method that uses the defaultDocumentId parameter.
>
> thanks for your patches! i would suggest in the future, you attach them on 
> bugzilla so they dont get lost.
>
> i will take a look.
>
> -gregor
>
> -- 
> Gregor J. Rothfuss
> COO, Wyona       Content Management Solutions    http://wyona.com
> Apache Lenya                              http://lenya.apache.org
> gregor.rothfuss@wyona.com                       gregor@apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:              dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail:            dev-help@lenya.apache.org
> Apache Lenya Project                          http://lenya.apache.org
>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail:              dev-unsubscribe@lenya.apache.org
For additional commands, e-mail:            dev-help@lenya.apache.org
Apache Lenya Project                          http://lenya.apache.org


Re: unable to publish a document in default pub

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Doug Chestnut wrote:
> Hi developers,
> Again, this is from the trunk, I did this to get the src:
> svn co http://svn.apache.org/repos/asf/lenya/trunk lenya-1.4
> Is this right to get 1.4?

yes

> Anyway,  /src/webapp/lenya/content/publishing/screen.xsp is supposed to 
> check if the parent document has a live version before it allows you to 
> publish a document.  Instead, it was checking to see if the current 
> document has a live version before allowing you to publish.  Trying to 
> publish a top level document would spit out an error so I had to use the 
> getParent method that uses the defaultDocumentId parameter.

thanks for your patches! i would suggest in the future, you attach them 
on bugzilla so they dont get lost.

i will take a look.

-gregor

-- 
Gregor J. Rothfuss
COO, Wyona       Content Management Solutions    http://wyona.com
Apache Lenya                              http://lenya.apache.org
gregor.rothfuss@wyona.com                       gregor@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail:              dev-unsubscribe@lenya.apache.org
For additional commands, e-mail:            dev-help@lenya.apache.org
Apache Lenya Project                          http://lenya.apache.org