Click here to register.
      
Sprechen Sie WebGUI? Parlez vous WebGUI? Se habla WebGUI? Spreekt u WebGUI?

Do you speak WebGUI? Please help us translate WebGUI into your language.



     Discuss > WebGUI Dev

state and status for Assets

User colink
Date 11/11/2007 10:59 pm
Views 1289
Rating 8    Rate [
|
]
Previous · Next
User Message
colink

I've been looking through the code, I'm thoroughly confused about what "archived" means.  It seems to be mainly associated with "status" (see , AssetLineage, POD for getLineage) but it's included in several SQL queries for state (see AssetLineage, lines 180 and 195).  The funny thing about that is I don't see anywhere where state is assigned to archived.  So...help!

What is the difference between state and status for Assets?

What are the valid values for state and status?



Back to Top
Rate [
|
]
 
 
preaction

"state" is for clipboard and trash, look at the Asset.pm->publish method for information

"status" is for versioning, look at the AssetVersioning.pm->commit for information.

EDIT: "status" is where "archived" is set. It's set by a workflow activity, "ArchiveOldThreads"



Back to Top
Rate [
|
]
 
 
colink

EDIT: "status" is where "archived" is set. It's set by a workflow activity, "ArchiveOldThreads"

Thanks, Doug!  That helps a bunch.

But I think my question of "Where is 'state' set to 'archived'?" still stands. It's used in SQL queries:

 AssetLineage.pm:195:    my ($count) = $self->session->db->quickArray("select count(*) from asset where state in ('published', 'archived') and lineage like ?", [$self->get("lineage")."%"]);

and in 3 or 4 other places. (Try ack archived . | grep state to get them all)

See what I mean?  If state is never set to archived, why should it be queried for?  Should those comparisons be "state=published or status=archived" instead?  Or is the archived check just dead code that we can remove?



Back to Top
Rate [
|
]
 
 
JT

State is whether an asset is published or has some special state. Possible states are:

published - the normal state of all assets

trash - the asset is in the trash

trash-limbo - the asset is in the trash because one of it's ancestors is in the trash

clipboard - the asset is in the clipboard

clipboard-limbo - the asset is in the clipboard because one of it's ancestors is in the clipboard

State is stored in the asset table in the state field.

 

Status is "versioning" status. Valid statuses are:

approved - Asset has been approved for publishing

pending - Asset is pending approval and should not be displayed on the site.

archived - Asset is approved but archived. This means that it should not show up in main listings, such as the collaboration system main listing.

Status is stored in the assetData table in the status field.



Back to Top
Rate [
|
]
 
 
colink

Updated with IRC notes:

01:47 <@rizen> yeah, state never uses archived
01:47 <@rizen> only status
01:48 < perlDreamer> so should the logic be reduced to just state=published (and ignore state) or does it need to be state=published OR status=archived?
01:49 < perlDreamer> i.e. AssetLineage line 195
01:54 <@rizen> actually
01:54 <@rizen> it needs to be changed to state='published' and (status='approved' or status='archived')
01:57 < perlDreamer> asset.state='published' and (assetData.status in ('approved','archived'))
 

Do we need another clause, even beyond that?

(asset.state='published' and (assetData.status in ('approved','archived')))

OR

(assetData.tagId = $self->session->scratch->get("versionTag"))



Back to Top
Rate [
|
]
 
 
JT
No. For this query it should not be variable based upon your version tag. 

Back to Top
Rate [
|
]
 
 
     Discuss > WebGUI Dev




Re: OReilly by koen - Sat @ 06:44pm

Re: OReilly by JT - Sat @ 12:46pm

Re: Glad to be here by Mike_S - Sat @ 09:11am

Partner Marketing Goals? by koen - Sat @ 08:15am

Re: OReilly by koen - Sat @ 08:07am

Re: Glad to be here by koen - Sat @ 08:05am

Re: WebGUI Drinks by Albert2 - Sat @ 05:06am