Einige kleinere Anpassungen bei docmgr. Noch nicht funktionsfähig.

git-svn-id: https://svn.libreccm.org/ccm/trunk@853 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2011-04-15 05:22:09 +00:00
parent 239b1e4516
commit 0bb2108286
6 changed files with 187 additions and 6 deletions

View File

@ -1,23 +1,26 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="ISO-8859-1"?>
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
name="ccm-docmgr"
prettyName="Document Manager"
version="6.6.0"
release="1"
webapp="ROOT">
<ccm:dependencies>
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
<ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/>
<ccm:requires name="ccm-cms-types-article" version="6.6.0" relation="ge"/>
<ccm:requires name="ccm-cms-types-mparticle" version="6.6.0" relation="ge"/>
<ccm:requires name="ccm-ldn-navigation" version="6.6.0" relation="ge"/>
</ccm:dependencies>
<ccm:contacts>
<ccm:contact uri="http://www.runtime-collective.com" type="website"/>
<ccm:contact uri="mailto:info@runtime-collective.com" type="support"/>
</ccm:contacts>
<ccm:description>
Document Manager application for Aplaws.
</ccm:description>
</ccm:application>

View File

@ -65,7 +65,7 @@ query ItemsInFolder {
and i.item_id = d.doc_id(+)
and i.item_id = l.link_id(+)
),
(select description from cms_doc_folders where doc_id = iif.item_id)
(select description from cms_doc_folders where doc_id = iif.item_id)
) as description,
(select dbms_lob.getLength(f.content)
from cms_documents d, cms_files f

View File

@ -0,0 +1,139 @@
model com.arsdigita.cms.docmgr.ui;
import com.arsdigita.cms.ContentItem;
query ItemsInFolder {
ContentItem item;
Boolean isFolder;
Boolean hasLiveVersion;
BigDecimal primaryInstID;
BigDecimal typeId;
String title;
BigDecimal targetDocId;
String url;
Integer foldersCount;
Integer itemsCount;
String description;
Long length;
String mimeType;
Date modified;
BigDecimal creatorID;
do {
select
iif.object_type, iif.display_name, iif.default_domain_class, iif.master_id, iif.item_id, iif.parent_id,
iif.version, iif.name, iif.has_live_version, iif.is_folder, pi.item_id as pi_item_id, pi.type_id,
case when is_folder = 1 then iif.label else pi.title end as title,
pi.target_doc_id, pi.url, pi.creator_id,
(
select
count(*)
from
cms_items i,
cms_folders f
where
i.item_id = f.folder_id
and i.parent_id = iif.item_id
and i.version = :version
and (exists (select 1 from cms_folders f where f.folder_id = i.item_id)
or
exists (select 1 from cms_bundles b where b.bundle_id = i.item_id)
)
) as cntf,
(
select
count(*)
from
cms_items i,
cms_folders f
where
i.item_id = f.folder_id(+)
and i.parent_id = iif.item_id
and i.version = :version
and (exists (select 1 from cms_folders f where f.folder_id = i.item_id)
or
exists (select 1 from cms_bundles b where b.bundle_id = i.item_id)
)
and f.folder_id is null
) as cnti,
nvl2(pi.type_id, (
select nvl(d.description, l.description)
from cms_items i, cms_documents d, cms_doc_links l
where
i.item_id = pi.item_id
and i.item_id = d.doc_id(+)
and i.item_id = l.link_id(+)
),
(select description from cms_doc_folders where doc_id = iif.item_id)
) as description,
(select dbms_lob.getLength(f.content)
from cms_documents d, cms_files f
where pi.item_id = d.doc_id(+) and f.file_id = d.asset_id) as length,
(select m.label
from cms_documents d, cms_assets a, cms_mime_types m
where pi.item_id = d.doc_id(+) and a.asset_id = d.asset_id and m.mime_type = a.mime_type
) as mime_type,
(select d.last_modified_cached from cms_documents d where pi.item_id = d.doc_id(+)) as modified
from (
select
a.object_type, a.display_name, a.default_domain_class,
i.master_id, i.item_id, i.parent_id, i.version, i.name,
case when exists (select 1 from cms_items where master_id = i.item_id)
then 1 else 0 end as has_live_version,
case when 0 = nvl(f.folder_id, 0) then 0 else 1 end as is_folder,
f.label
from
cms_items i,
acs_objects a,
cms_folders f
where
i.item_id = a.object_id
and
i.item_id = f.folder_id(+)
and
i.parent_id = :parent
and
i.version = :version
and (exists (select 1 from cms_folders f where f.folder_id = i.item_id)
or
exists (select 1 from cms_bundles b where b.bundle_id = i.item_id)
)
) iif,
(select
b.bundle_id, i.item_id, i.type_id, p.title, d.creator_id, l.target_doc_id, l.url
from
cms_bundles b, cms_items i, cms_pages p, cms_documents d, cms_doc_links l
where
i.parent_id = b.bundle_id
and i.language = b.default_language
and p.item_id = i.item_id
and i.item_id = d.doc_id(+)
and i.item_id = l.link_id(+)
) pi
where
iif.item_id = pi.bundle_id(+)
} map {
item.id = iif.item_id;
item.objectType = iif.object_type;
item.displayName = iif.display_name;
item.defaultDomainClass = iif.default_domain_class;
item.master.id = iif.master_id;
item.version = iif.version;
item.name = iif.name;
isFolder = iif.is_folder;
hasLiveVersion = iif.has_live_version;
primaryInstID = pi_item_id;
typeId = pi.type_id;
title = title;
targetDocId = pi.target_doc_id;
url = pi.url;
foldersCount = cntf;
itemsCount = cnti;
description = description;
length = length;
mimeType = mime_type;
modified = modified;
creatorID = pi.creator_id;
}
}

View File

@ -0,0 +1,37 @@
// the query returns the first(:maxRows) rows of Document & DocLink ordered by last_modified_cached date
// docID, objectType - OID attributes
// input parameters: :ancestors, :maxRows
model com.arsdigita.cms.docmgr.ui;
query RecentUpdatedDocs {
BigDecimal docID;
String objectType;
do {
select id, object_type from (
select * from (
select * from (
select d.doc_id as id, d.last_modified_cached, ao.object_type
from cms_documents d inner join acs_objects ao on (d.doc_id = ao.object_id) inner join cms_items i on (d.doc_id = i.item_id)
where d.last_modified_cached is not null
and i.ancestors like :ancestors
order by d.last_modified_cached desc
) where rownum <= :maxRows
union
select * from (
select d.link_id as id, d.last_modified_cached, ao.object_type
from cms_doc_links d inner join acs_objects ao on (d.link_id = ao.object_id) inner join cms_items i on (d.link_id = i.item_id)
where d.last_modified_cached is not null
and i.ancestors like :ancestors
order by d.last_modified_cached desc
) where rownum <= :maxRows
) order by last_modified_cached desc
) where rownum <= :maxRows
} map {
docID = id;
objectType = object_type;
}
}

View File

@ -42,7 +42,7 @@ public final class DocMgrConfig extends AbstractConfig {
m_contentSection = new StringParameter
("com.arsdigita.cms.docmgr.content_section",
Parameter.REQUIRED,
"documents");
"content");
m_legacyFolderName = new StringParameter
("com.arsdigita.cms.docmgr.legacy_folder_name",

View File

@ -94,14 +94,16 @@ class FolderContentsTableForm extends Form
Folder parentFolder = new Folder(fid);
DataQuery m_collection = SessionManager.getSession().retrieveQuery("com.arsdigita.cms.docmgr.ui.ItemsInFolder");
DataQuery m_collection = SessionManager.getSession()
.retrieveQuery("com.arsdigita.cms.docmgr.ui.ItemsInFolder");
m_collection.setParameter(Folder.PARENT, fid);
m_collection.setParameter(Folder.VERSION, parentFolder.getVersion());
long size = m_collection.size();
m_collection.close();
int rowsPerPage = DocMgr.getConfig().getRowsPerPage();
int maxPages = (int) ((size / rowsPerPage) + (size % rowsPerPage > 0 ? 1 : 0));
int maxPages = (int) ((size / rowsPerPage) +
(size % rowsPerPage > 0 ? 1 : 0));
return new Integer(maxPages);
}
};